From e3bc1a277ca0480c2a62c6b1bb95924560f7d0d3 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Wed, 16 Jun 2010 17:04:56 +0200 Subject: #i112247# shrink glyph-fallback font if needed (thanks cmc!) --- vcl/unx/headless/svpgdi.hxx | 2 +- vcl/unx/headless/svppspgraphics.cxx | 2 +- vcl/unx/headless/svppspgraphics.hxx | 2 +- vcl/unx/headless/svptext.cxx | 9 ++++++--- vcl/unx/inc/pspgraphics.h | 2 +- vcl/unx/inc/salgdi.h | 2 +- vcl/unx/source/gdi/pspgraphics.cxx | 2 +- vcl/unx/source/gdi/salgdi3.cxx | 13 ++++++++----- 8 files changed, 20 insertions(+), 14 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/headless/svpgdi.hxx b/vcl/unx/headless/svpgdi.hxx index 132dafaa9adf..f48a2885c45e 100644 --- a/vcl/unx/headless/svpgdi.hxx +++ b/vcl/unx/headless/svpgdi.hxx @@ -86,7 +86,7 @@ public: virtual void SetTextColor( SalColor nSalColor ); virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel ); - virtual void GetFontMetric( ImplFontMetricData* ); + virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs ); virtual ImplFontCharMap* GetImplFontCharMap() const; virtual void GetDevFontList( ImplDevFontList* ); diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx index 7f551051c1a7..2bb943a4eeb8 100644 --- a/vcl/unx/headless/svppspgraphics.cxx +++ b/vcl/unx/headless/svppspgraphics.cxx @@ -792,7 +792,7 @@ void PspGraphics::GetDevFontSubstList( OutputDevice* pOutDev ) } } -void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric ) +void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric, int ) { const psp::PrintFontManager& rMgr = psp::PrintFontManager::get(); psp::PrintFontInfo aInfo; diff --git a/vcl/unx/headless/svppspgraphics.hxx b/vcl/unx/headless/svppspgraphics.hxx index 82ba613615cb..83e295e7e23a 100644 --- a/vcl/unx/headless/svppspgraphics.hxx +++ b/vcl/unx/headless/svppspgraphics.hxx @@ -105,7 +105,7 @@ public: virtual void SetTextColor( SalColor nSalColor ); virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel ); - virtual void GetFontMetric( ImplFontMetricData* ); + virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs ); virtual ImplFontCharMap* GetImplFontCharMap() const; virtual void GetDevFontList( ImplDevFontList* ); diff --git a/vcl/unx/headless/svptext.cxx b/vcl/unx/headless/svptext.cxx index ecb8b11b7e04..34941fc777db 100644 --- a/vcl/unx/headless/svptext.cxx +++ b/vcl/unx/headless/svptext.cxx @@ -240,12 +240,15 @@ USHORT SvpSalGraphics::SetFont( ImplFontSelectData* pIFSD, int nFallbackLevel ) // --------------------------------------------------------------------------- -void SvpSalGraphics::GetFontMetric( ImplFontMetricData* pMetric ) +void SvpSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLevel ) { - if( m_pServerFont[0] != NULL ) + if( nFallbackLevel >= MAX_FALLBACK ) + return; + + if( m_pServerFont[nFallbackLevel] != NULL ) { long rDummyFactor; - m_pServerFont[0]->FetchFontMetric( *pMetric, rDummyFactor ); + m_pServerFont[nFallbackLevel]->FetchFontMetric( *pMetric, rDummyFactor ); } } diff --git a/vcl/unx/inc/pspgraphics.h b/vcl/unx/inc/pspgraphics.h index 2eae73cdaa86..e6c56e0208ce 100644 --- a/vcl/unx/inc/pspgraphics.h +++ b/vcl/unx/inc/pspgraphics.h @@ -102,7 +102,7 @@ public: virtual void SetTextColor( SalColor nSalColor ); virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel ); - virtual void GetFontMetric( ImplFontMetricData* ); + virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); virtual ULONG GetKernPairs( ULONG nMaxPairs, ImplKernPairData* ); virtual ImplFontCharMap* GetImplFontCharMap() const; virtual void GetDevFontList( ImplDevFontList* ); diff --git a/vcl/unx/inc/salgdi.h b/vcl/unx/inc/salgdi.h index da69f04b6f8f..0bb6cf6f327a 100644 --- a/vcl/unx/inc/salgdi.h +++ b/vcl/unx/inc/salgdi.h @@ -249,7 +249,7 @@ public: virtual void SetTextColor( SalColor nSalColor ); virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel ); - virtual void GetFontMetric( ImplFontMetricData* ); + virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); virtual ULONG GetKernPairs( ULONG nMaxPairs, ImplKernPairData* ); virtual ImplFontCharMap* GetImplFontCharMap() const; virtual void GetDevFontList( ImplDevFontList* ); diff --git a/vcl/unx/source/gdi/pspgraphics.cxx b/vcl/unx/source/gdi/pspgraphics.cxx index d599e09e71f2..5785ff1f6d7c 100644 --- a/vcl/unx/source/gdi/pspgraphics.cxx +++ b/vcl/unx/source/gdi/pspgraphics.cxx @@ -885,7 +885,7 @@ void PspGraphics::GetDevFontSubstList( OutputDevice* pOutDev ) } } -void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric ) +void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric, int ) { const psp::PrintFontManager& rMgr = psp::PrintFontManager::get(); psp::PrintFontInfo aInfo; diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx index f00ee26c0d4d..9ddb6d99927e 100644 --- a/vcl/unx/source/gdi/salgdi3.cxx +++ b/vcl/unx/source/gdi/salgdi3.cxx @@ -1763,16 +1763,19 @@ bool GetFCFontOptions( const ImplFontAttributes& rFontAttributes, int nSize, // ---------------------------------------------------------------------------- void -X11SalGraphics::GetFontMetric( ImplFontMetricData *pMetric ) +X11SalGraphics::GetFontMetric( ImplFontMetricData *pMetric, int nFallbackLevel ) { - if( mpServerFont[0] != NULL ) + if( nFallbackLevel >= MAX_FALLBACK ) + return; + + if( mpServerFont[nFallbackLevel] != NULL ) { long rDummyFactor; - mpServerFont[0]->FetchFontMetric( *pMetric, rDummyFactor ); + mpServerFont[nFallbackLevel]->FetchFontMetric( *pMetric, rDummyFactor ); } - else if( mXFont[0] != NULL ) + else if( mXFont[nFallbackLevel] != NULL ) { - mXFont[0]->ToImplFontMetricData( pMetric ); + mXFont[nFallbackLevel]->ToImplFontMetricData( pMetric ); if ( bFontVertical_ ) pMetric->mnOrientation = 0; } -- cgit From d315e8bee6e680a5f7a6f4df067e07e58bc8b61d Mon Sep 17 00:00:00 2001 From: Caol?n McNamara Date: Thu, 24 Jun 2010 20:59:17 +0100 Subject: cmcfixes76: #i112656# osl_setEnvironment/osl_clearEnvironment --- vcl/unx/gtk/app/gtkdata.cxx | 7 ++++--- vcl/unx/source/app/i18n_im.cxx | 30 ++++++++++-------------------- vcl/unx/source/app/saldata.cxx | 6 ++---- 3 files changed, 16 insertions(+), 27 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx index 2679f4a29c02..1f1c469bf9a1 100644 --- a/vcl/unx/gtk/app/gtkdata.cxx +++ b/vcl/unx/gtk/app/gtkdata.cxx @@ -630,9 +630,10 @@ void GtkXLib::Init() * the clipboard build another connection * to the xserver using $DISPLAY */ - char *pPutEnvIsBroken = g_strdup_printf( "DISPLAY=%s", - gdk_display_get_name( pGdkDisp ) ); - putenv( pPutEnvIsBroken ); + rtl::OUString envVar(RTL_CONSTASCII_USTRINGPARAM("DISPLAY")); + const gchar *name = gdk_display_get_name( pGdkDisp ); + rtl::OUString envValue(name, strlen(name), aEnc); + osl_setEnvironment(envVar.pData, envValue.pData); Display *pDisp = gdk_x11_display_get_xdisplay( pGdkDisp ); diff --git a/vcl/unx/source/app/i18n_im.cxx b/vcl/unx/source/app/i18n_im.cxx index 9f1ffee3d1c4..c797da34e76c 100644 --- a/vcl/unx/source/app/i18n_im.cxx +++ b/vcl/unx/source/app/i18n_im.cxx @@ -36,10 +36,6 @@ # endif #endif #include -#ifdef SOLARIS -// for SetSystemEnvironment() -#include -#endif #include #include @@ -53,6 +49,7 @@ #include #include +#include using namespace vcl; #include "i18n_cb.hxx" @@ -179,21 +176,13 @@ SetSystemLocale( const char* p_inlocale ) #ifdef SOLARIS static void -SetSystemEnvironment( const char* p_locale ) +SetSystemEnvironment( const rtl::OUString& rLocale ) { - const char *lc_all = "LC_ALL=%s"; - const char *lang = "LANG=%s"; - - char *p_buffer; + rtl::OUString LC_ALL_Var(RTL_CONSTASCII_USTRINGPARAM("LC_ALL")); + osl_setEnvironment(LC_ALL_Var.pData, rLocale.pData); - if (p_locale != NULL) - { - p_buffer = (char*)alloca(10 + strlen(p_locale)); - sprintf(p_buffer, lc_all, p_locale); - putenv(strdup(p_buffer)); - sprintf(p_buffer, lang, p_locale); - putenv(strdup(p_buffer)); - } + rtl::OUString LANG_Var(RTL_CONSTASCII_USTRINGPARAM("LANG")); + osl_setEnvironment(LANG_Var.pData, rLocale.pData); } #endif @@ -249,13 +238,13 @@ SalI18N_InputMethod::SetLocale( const char* pLocale ) osl_setThreadTextEncoding (RTL_TEXTENCODING_ISO_8859_1); locale = SetSystemLocale( "en_US" ); #ifdef SOLARIS - SetSystemEnvironment( "en_US" ); + SetSystemEnvironment( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en_US")) ); #endif if (! IsXWindowCompatibleLocale(locale)) { locale = SetSystemLocale( "C" ); #ifdef SOLARIS - SetSystemEnvironment( "C" ); + SetSystemEnvironment( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("C")) ); #endif if (! IsXWindowCompatibleLocale(locale)) mbUseable = False; @@ -440,7 +429,8 @@ SalI18N_InputMethod::CreateMethod ( Display *pDisplay ) if ((maMethod == (XIM)NULL) && (getenv("XMODIFIERS") != NULL)) { - putenv (strdup("XMODIFIERS")); + rtl::OUString envVar(RTL_CONSTASCII_USTRINGPARAM("XMODIFIERS")); + osl_clearEnvironment(envVar.pData); XSetLocaleModifiers(""); maMethod = XOpenIM(pDisplay, NULL, NULL, NULL); mbMultiLingual = False; diff --git a/vcl/unx/source/app/saldata.cxx b/vcl/unx/source/app/saldata.cxx index 50ef71df8619..beb7b60a551c 100644 --- a/vcl/unx/source/app/saldata.cxx +++ b/vcl/unx/source/app/saldata.cxx @@ -425,10 +425,8 @@ void SalXLib::Init() * the clipboard build another connection * to the xserver using $DISPLAY */ - const char envpre[] = "DISPLAY="; - char *envstr = new char[sizeof(envpre)+aDisplay.getLength()]; - snprintf(envstr, sizeof(envpre)+aDisplay.getLength(), "DISPLAY=%s", aDisplay.getStr()); - putenv(envstr); + rtl::OUString envVar(RTL_CONSTASCII_USTRINGPARAM("DISPLAY")); + osl_setEnvironment(envVar.pData, aParam.pData); } break; } -- cgit From 839a386cb51ba43988142957c091140885a5d3f7 Mon Sep 17 00:00:00 2001 From: Malte Timmermann Date: Thu, 1 Jul 2010 09:13:15 +0200 Subject: codecleanup02: #i52551# Removed old stuff: VOS_NAMESPACE, use vos:: directly --- vcl/unx/gtk/app/gtkinst.cxx | 2 +- vcl/unx/headless/svpinst.cxx | 8 ++++---- vcl/unx/headless/svpinst.hxx | 6 +++--- vcl/unx/inc/salinst.h | 6 +++--- vcl/unx/source/app/saldisp.cxx | 2 +- vcl/unx/source/app/salinst.cxx | 8 ++++---- 6 files changed, 16 insertions(+), 16 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx index 68617c8c16be..faedc7e5e600 100644 --- a/vcl/unx/gtk/app/gtkinst.cxx +++ b/vcl/unx/gtk/app/gtkinst.cxx @@ -76,7 +76,7 @@ void GtkHookedYieldMutex::ThreadsLeave() #if OSL_DEBUG_LEVEL > 1 if( mnThreadId && - mnThreadId != NAMESPACE_VOS(OThread)::getCurrentIdentifier()) + mnThreadId != vos::OThread::getCurrentIdentifier()) fprintf( stderr, "\n\n--- A different thread owns the mutex ...---\n\n\n"); #endif diff --git a/vcl/unx/headless/svpinst.cxx b/vcl/unx/headless/svpinst.cxx index 466b56868900..5c3be54f9ddc 100644 --- a/vcl/unx/headless/svpinst.cxx +++ b/vcl/unx/headless/svpinst.cxx @@ -302,7 +302,7 @@ vos::IMutex* SvpSalInstance::GetYieldMutex() ULONG SvpSalInstance::ReleaseYieldMutex() { if ( m_aYieldMutex.GetThreadId() == - NAMESPACE_VOS(OThread)::getCurrentIdentifier() ) + vos::OThread::getCurrentIdentifier() ) { ULONG nCount = m_aYieldMutex.GetAcquireCount(); ULONG n = nCount; @@ -464,13 +464,13 @@ SvpSalYieldMutex::SvpSalYieldMutex() void SvpSalYieldMutex::acquire() { OMutex::acquire(); - mnThreadId = NAMESPACE_VOS(OThread)::getCurrentIdentifier(); + mnThreadId = vos::OThread::getCurrentIdentifier(); mnCount++; } void SvpSalYieldMutex::release() { - if ( mnThreadId == NAMESPACE_VOS(OThread)::getCurrentIdentifier() ) + if ( mnThreadId == vos::OThread::getCurrentIdentifier() ) { if ( mnCount == 1 ) mnThreadId = 0; @@ -483,7 +483,7 @@ sal_Bool SvpSalYieldMutex::tryToAcquire() { if ( OMutex::tryToAcquire() ) { - mnThreadId = NAMESPACE_VOS(OThread)::getCurrentIdentifier(); + mnThreadId = vos::OThread::getCurrentIdentifier(); mnCount++; return sal_True; } diff --git a/vcl/unx/headless/svpinst.hxx b/vcl/unx/headless/svpinst.hxx index 284a2d11cd82..d931a2735ff9 100644 --- a/vcl/unx/headless/svpinst.hxx +++ b/vcl/unx/headless/svpinst.hxx @@ -46,11 +46,11 @@ // SalYieldMutex // ------------------------------------------------------------------------- -class SvpSalYieldMutex : public NAMESPACE_VOS(OMutex) +class SvpSalYieldMutex : public vos::OMutex { protected: ULONG mnCount; - NAMESPACE_VOS(OThread)::TThreadIdentifier mnThreadId; + vos::OThread::TThreadIdentifier mnThreadId; public: SvpSalYieldMutex(); @@ -60,7 +60,7 @@ public: virtual sal_Bool tryToAcquire(); ULONG GetAcquireCount() const { return mnCount; } - NAMESPACE_VOS(OThread)::TThreadIdentifier GetThreadId() const { return mnThreadId; } + vos::OThread::TThreadIdentifier GetThreadId() const { return mnThreadId; } }; // --------------- diff --git a/vcl/unx/inc/salinst.h b/vcl/unx/inc/salinst.h index d73d67f81425..8f4719f098f0 100644 --- a/vcl/unx/inc/salinst.h +++ b/vcl/unx/inc/salinst.h @@ -39,11 +39,11 @@ #include #include -class VCL_DLLPUBLIC SalYieldMutex : public NAMESPACE_VOS(OMutex) +class VCL_DLLPUBLIC SalYieldMutex : public vos::OMutex { protected: ULONG mnCount; - NAMESPACE_VOS(OThread)::TThreadIdentifier mnThreadId; + vos::OThread::TThreadIdentifier mnThreadId; public: SalYieldMutex(); @@ -53,7 +53,7 @@ public: virtual sal_Bool tryToAcquire(); ULONG GetAcquireCount() const { return mnCount; } - NAMESPACE_VOS(OThread)::TThreadIdentifier GetThreadId() const { return mnThreadId; } + vos::OThread::TThreadIdentifier GetThreadId() const { return mnThreadId; } }; // -=-= SalInstanceData =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= diff --git a/vcl/unx/source/app/saldisp.cxx b/vcl/unx/source/app/saldisp.cxx index aa2afab93657..71e2975abc8a 100644 --- a/vcl/unx/source/app/saldisp.cxx +++ b/vcl/unx/source/app/saldisp.cxx @@ -2257,7 +2257,7 @@ void SalX11Display::Yield() XEvent aEvent; DBG_ASSERT( static_cast(GetSalData()->m_pInstance->GetYieldMutex())->GetThreadId() == - NAMESPACE_VOS(OThread)::getCurrentIdentifier(), + vos::OThread::getCurrentIdentifier(), "will crash soon since solar mutex not locked in SalDisplay::Yield" ); XNextEvent( pDisp_, &aEvent ); diff --git a/vcl/unx/source/app/salinst.cxx b/vcl/unx/source/app/salinst.cxx index 8a8db44cefcd..49a9cceb8617 100644 --- a/vcl/unx/source/app/salinst.cxx +++ b/vcl/unx/source/app/salinst.cxx @@ -66,13 +66,13 @@ SalYieldMutex::SalYieldMutex() void SalYieldMutex::acquire() { OMutex::acquire(); - mnThreadId = NAMESPACE_VOS(OThread)::getCurrentIdentifier(); + mnThreadId = vos::OThread::getCurrentIdentifier(); mnCount++; } void SalYieldMutex::release() { - if ( mnThreadId == NAMESPACE_VOS(OThread)::getCurrentIdentifier() ) + if ( mnThreadId == vos::OThread::getCurrentIdentifier() ) { if ( mnCount == 1 ) mnThreadId = 0; @@ -85,7 +85,7 @@ sal_Bool SalYieldMutex::tryToAcquire() { if ( OMutex::tryToAcquire() ) { - mnThreadId = NAMESPACE_VOS(OThread)::getCurrentIdentifier(); + mnThreadId = vos::OThread::getCurrentIdentifier(); mnCount++; return True; } @@ -231,7 +231,7 @@ ULONG X11SalInstance::ReleaseYieldMutex() { SalYieldMutex* pYieldMutex = mpSalYieldMutex; if ( pYieldMutex->GetThreadId() == - NAMESPACE_VOS(OThread)::getCurrentIdentifier() ) + vos::OThread::getCurrentIdentifier() ) { ULONG nCount = pYieldMutex->GetAcquireCount(); ULONG n = nCount; -- cgit From e6f7b669bf7ccf418388beaae132da435232605c Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 14 Jul 2010 11:15:41 +0200 Subject: sb123: #i113115# cleanup PrinterInfoManager --- vcl/unx/source/plugadapt/salplug.cxx | 5 +++- vcl/unx/source/printer/printerinfomanager.cxx | 36 +++++++++++++++++++-------- 2 files changed, 29 insertions(+), 12 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/source/plugadapt/salplug.cxx b/vcl/unx/source/plugadapt/salplug.cxx index a438760cffba..fd49ee34f543 100644 --- a/vcl/unx/source/plugadapt/salplug.cxx +++ b/vcl/unx/source/plugadapt/salplug.cxx @@ -36,6 +36,7 @@ #include "vcl/salinst.hxx" #include "saldata.hxx" +#include "vcl/printerinfomanager.hxx" #include #include @@ -291,10 +292,12 @@ const OUString& SalGetDesktopEnvironment() SalData::SalData() : m_pInstance(NULL), - m_pPlugin(NULL) + m_pPlugin(NULL), + m_pPIManager(NULL) { } SalData::~SalData() { + psp::PrinterInfoManager::release(); } diff --git a/vcl/unx/source/printer/printerinfomanager.cxx b/vcl/unx/source/printer/printerinfomanager.cxx index e1d499c40ca5..c534461ea95c 100644 --- a/vcl/unx/source/printer/printerinfomanager.cxx +++ b/vcl/unx/source/printer/printerinfomanager.cxx @@ -35,6 +35,7 @@ #include "cupsmgr.hxx" #include "vcl/fontmanager.hxx" #include "vcl/strhelper.hxx" +#include "saldata.hxx" #include "tools/urlobj.hxx" #include "tools/stream.hxx" @@ -92,22 +93,28 @@ namespace psp PrinterInfoManager& PrinterInfoManager::get() { - static PrinterInfoManager* pManager = NULL; + SalData* pSalData = GetSalData(); - if( ! pManager ) + if( ! pSalData->m_pPIManager ) { - pManager = CUPSManager::tryLoadCUPS(); - if( ! pManager ) - pManager = new PrinterInfoManager(); + pSalData->m_pPIManager = CUPSManager::tryLoadCUPS(); + if( ! pSalData->m_pPIManager ) + pSalData->m_pPIManager = new PrinterInfoManager(); - if( pManager ) - pManager->initialize(); + pSalData->m_pPIManager->initialize(); #if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "PrinterInfoManager::get create Manager of type %d\n", pManager->getType() ); + fprintf( stderr, "PrinterInfoManager::get create Manager of type %d\n", pSalData->m_pPIManager->getType() ); #endif } - return *pManager; + return *pSalData->m_pPIManager; +} + +void PrinterInfoManager::release() +{ + SalData* pSalData = GetSalData(); + delete pSalData->m_pPIManager; + pSalData->m_pPIManager = NULL; } // ----------------------------------------------------------------- @@ -130,6 +137,9 @@ PrinterInfoManager::PrinterInfoManager( Type eType ) : PrinterInfoManager::~PrinterInfoManager() { delete m_pQueueInfo; + #if OSL_DEBUG_LEVEL > 1 + fprintf( stderr, "PrinterInfoManager: destroyed Manager of type %d\n", getType() ); + #endif } // ----------------------------------------------------------------- @@ -324,7 +334,7 @@ void PrinterInfoManager::initialize() } } #if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "global settings: fontsubst = %s, %d substitutes\n", m_aGlobalDefaults.m_bPerformFontSubstitution ? "true" : "false", m_aGlobalDefaults.m_aFontSubstitutes.size() ); + fprintf( stderr, "global settings: fontsubst = %s, %d substitutes\n", m_aGlobalDefaults.m_bPerformFontSubstitution ? "true" : "false", (int)m_aGlobalDefaults.m_aFontSubstitutes.size() ); #endif } } @@ -1166,7 +1176,11 @@ SystemQueueInfo::SystemQueueInfo() : SystemQueueInfo::~SystemQueueInfo() { - terminate(); + static const char* pNoSyncDetection = getenv( "SAL_DISABLE_SYNCHRONOUS_PRINTER_DETECTION" ); + if( ! pNoSyncDetection || !*pNoSyncDetection ) + join(); + else + terminate(); } bool SystemQueueInfo::hasChanged() const -- cgit From 084deeede12ec2c9bf5803f2370ef351ceddee84 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 20 Jul 2010 19:07:21 +0200 Subject: vcl114: #i113259# refine gtk plugins XIOError handling (thanks cmc!) --- vcl/unx/gtk/app/gtkdata.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'vcl/unx') diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx index 2679f4a29c02..46c4b8e5f7c7 100644 --- a/vcl/unx/gtk/app/gtkdata.cxx +++ b/vcl/unx/gtk/app/gtkdata.cxx @@ -489,6 +489,7 @@ class GtkXLib : public SalXLib GSource *m_pUserEvent; oslMutex m_aDispatchMutex; oslCondition m_aDispatchCondition; + XIOErrorHandler m_aOrigGTKXIOErrorHandler; public: static gboolean timeoutFn(gpointer data); @@ -522,6 +523,7 @@ GtkXLib::GtkXLib() m_pUserEvent = NULL; m_aDispatchCondition = osl_createCondition(); m_aDispatchMutex = osl_createMutex(); + m_aOrigGTKXIOErrorHandler = NULL; } GtkXLib::~GtkXLib() @@ -535,6 +537,9 @@ GtkXLib::~GtkXLib() osl_setCondition( m_aDispatchCondition ); osl_destroyCondition( m_aDispatchCondition ); osl_destroyMutex( m_aDispatchMutex ); + + PopXErrorLevel(); + XSetIOErrorHandler (m_aOrigGTKXIOErrorHandler); } void GtkXLib::Init() @@ -596,6 +601,10 @@ void GtkXLib::Init() // init gtk/gdk gtk_init_check( &nParams, &pCmdLineAry ); + //gtk_init_check sets XError/XIOError handlers, we want our own one + m_aOrigGTKXIOErrorHandler = XSetIOErrorHandler ( (XIOErrorHandler)X11SalData::XIOErrorHdl ); + PushXErrorLevel( !!getenv( "SAL_IGNOREXERRORS" ) ); + for (i = 0; i < nParams; i++ ) g_free( pCmdLineAry[i] ); delete [] pCmdLineAry; -- cgit From 37d90e1b4567aeecd23417ed700b2fd1d7d45e5b Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 22 Jul 2010 20:53:07 +0200 Subject: vcl114: #i48666# allow input of arbitrary unicode characters --- vcl/unx/inc/saldata.hxx | 2 + vcl/unx/inc/salframe.h | 4 ++ vcl/unx/source/gdi/salgdi.cxx | 15 +++-- vcl/unx/source/window/salframe.cxx | 126 ++++++++++++++++++++++++++++++++++++- 4 files changed, 140 insertions(+), 7 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/inc/saldata.hxx b/vcl/unx/inc/saldata.hxx index 7e38e0a89bf2..939437060750 100644 --- a/vcl/unx/inc/saldata.hxx +++ b/vcl/unx/inc/saldata.hxx @@ -63,6 +63,7 @@ protected: SalDisplay *m_pSalDisplay; pthread_t hMainThread_; rtl::OUString maLocalHostName; + rtl::OUString maUnicodeAccumulator; public: X11SalData(); @@ -90,6 +91,7 @@ public: const rtl::OUString& GetLocalHostName() const { return maLocalHostName; } + rtl::OUString& GetUnicodeAccumulator() { return maUnicodeAccumulator; } static int XErrorHdl( Display*, XErrorEvent* ); static int XIOErrorHdl( Display* ); diff --git a/vcl/unx/inc/salframe.h b/vcl/unx/inc/salframe.h index 6f962c9a13b3..0aea9c3a5f53 100644 --- a/vcl/unx/inc/salframe.h +++ b/vcl/unx/inc/salframe.h @@ -206,6 +206,10 @@ public: bool isMapped() const { return bMapped_; } bool hasFocus() const { return mbInputFocus; } + void beginUnicodeSequence(); + bool appendUnicodeSequence( sal_Unicode ); + bool endUnicodeSequence(); + virtual SalGraphics* GetGraphics(); virtual void ReleaseGraphics( SalGraphics* pGraphics ); diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx index ae21c3aa9f7b..19b84b26eb91 100644 --- a/vcl/unx/source/gdi/salgdi.cxx +++ b/vcl/unx/source/gdi/salgdi.cxx @@ -1238,12 +1238,17 @@ bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, double basegfx::tools::createLineTrapezoidFromB2DPolygon( aB2DTrapVector, aPolygon, rLineWidth.getX() ); // draw tesselation result - const int nTrapCount = aB2DTrapVector.size(); - const bool bDrawOk = drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, fTransparency ); + if( ! aB2DTrapVector.empty() ) + { + const int nTrapCount = aB2DTrapVector.size(); + const bool bDrawOk = drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, fTransparency ); - // restore the original brush GC - nBrushColor_ = aKeepBrushColor; - return bDrawOk; + // restore the original brush GC + nBrushColor_ = aKeepBrushColor; + return bDrawOk; + } + else + return true; } // get the area polygon for the line polygon diff --git a/vcl/unx/source/window/salframe.cxx b/vcl/unx/source/window/salframe.cxx index 6d243e41db8c..2289a5f9a486 100644 --- a/vcl/unx/source/window/salframe.cxx +++ b/vcl/unx/source/window/salframe.cxx @@ -3146,6 +3146,100 @@ GetAlternateKeyCode( const USHORT nKeyCode ) return aAlternate; } +void X11SalFrame::beginUnicodeSequence() +{ + rtl::OUString& rSeq( GetX11SalData()->GetUnicodeAccumulator() ); + DeletionListener aDeleteWatch( this ); + + if( rSeq.getLength() ) + endUnicodeSequence(); + + rSeq = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "u" ) ); + + if( ! aDeleteWatch.isDeleted() ) + { + USHORT nTextAttr = SAL_EXTTEXTINPUT_ATTR_UNDERLINE; + SalExtTextInputEvent aEv; + aEv.mnTime = 0; + aEv.maText = rSeq; + aEv.mpTextAttr = &nTextAttr; + aEv.mnCursorPos = 0; + aEv.mnDeltaStart = 0; + aEv.mnCursorFlags = 0; + aEv.mbOnlyCursor = FALSE; + + CallCallback(SALEVENT_EXTTEXTINPUT, (void*)&aEv); + } +} + +bool X11SalFrame::appendUnicodeSequence( sal_Unicode c ) +{ + bool bRet = false; + rtl::OUString& rSeq( GetX11SalData()->GetUnicodeAccumulator() ); + if( rSeq.getLength() > 0 ) + { + // range check + if( (c >= sal_Unicode('0') && c <= sal_Unicode('9')) || + (c >= sal_Unicode('a') && c <= sal_Unicode('f')) || + (c >= sal_Unicode('A') && c <= sal_Unicode('F')) ) + { + rtl::OUStringBuffer aBuf( rSeq.getLength() + 1 ); + aBuf.append( rSeq ); + aBuf.append( c ); + rSeq = aBuf.makeStringAndClear(); + std::vector attribs( rSeq.getLength(), SAL_EXTTEXTINPUT_ATTR_UNDERLINE ); + + SalExtTextInputEvent aEv; + aEv.mnTime = 0; + aEv.maText = rSeq; + aEv.mpTextAttr = &attribs[0]; + aEv.mnCursorPos = 0; + aEv.mnDeltaStart = 0; + aEv.mnCursorFlags = 0; + aEv.mbOnlyCursor = FALSE; + + CallCallback(SALEVENT_EXTTEXTINPUT, (void*)&aEv); + bRet = true; + } + else + bRet = endUnicodeSequence(); + } + else + endUnicodeSequence(); + return bRet; +} + +bool X11SalFrame::endUnicodeSequence() +{ + rtl::OUString& rSeq( GetX11SalData()->GetUnicodeAccumulator() ); + + DeletionListener aDeleteWatch( this ); + if( rSeq.getLength() > 1 && rSeq.getLength() < 6 ) + { + // cut the "u" + rtl::OUString aNumbers( rSeq.copy( 1 ) ); + sal_Int32 nValue = aNumbers.toInt32( 16 ); + if( nValue >= 32 ) + { + USHORT nTextAttr = SAL_EXTTEXTINPUT_ATTR_UNDERLINE; + SalExtTextInputEvent aEv; + aEv.mnTime = 0; + aEv.maText = rtl::OUString( sal_Unicode(nValue) ); + aEv.mpTextAttr = &nTextAttr; + aEv.mnCursorPos = 0; + aEv.mnDeltaStart = 0; + aEv.mnCursorFlags = 0; + aEv.mbOnlyCursor = FALSE; + CallCallback(SALEVENT_EXTTEXTINPUT, (void*)&aEv); + } + } + bool bWasInput = rSeq.getLength() > 0; + rSeq = rtl::OUString(); + if( bWasInput && ! aDeleteWatch.isDeleted() ) + CallCallback(SALEVENT_ENDEXTTEXTINPUT, NULL); + return bWasInput; +} + // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent ) { @@ -3191,6 +3285,9 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent ) if( pEvent->state & Mod1Mask ) nModCode |= KEY_MOD2; + if( nModCode != (KEY_SHIFT|KEY_MOD1) ) + endUnicodeSequence(); + if( nKeySym == XK_Shift_L || nKeySym == XK_Shift_R || nKeySym == XK_Control_L || nKeySym == XK_Control_R || nKeySym == XK_Alt_L || nKeySym == XK_Alt_R @@ -3314,6 +3411,33 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent ) if( !nKeyCode && !nLen && !nKeyString) return 0; + DeletionListener aDeleteWatch( this ); + + if( nModCode == (KEY_SHIFT | KEY_MOD1) && pEvent->type == XLIB_KeyPress ) + { + USHORT nSeqKeyCode = pDisplay_->GetKeyCode( nUnmodifiedKeySym, &aDummy ); + if( nSeqKeyCode == KEY_U ) + { + beginUnicodeSequence(); + return 1; + } + else if( nSeqKeyCode >= KEY_0 && nSeqKeyCode <= KEY_9 ) + { + if( appendUnicodeSequence( sal_Unicode( '0' ) + sal_Unicode(nSeqKeyCode - KEY_0) ) ) + return 1; + } + else if( nSeqKeyCode >= KEY_A && nSeqKeyCode <= KEY_F ) + { + if( appendUnicodeSequence( sal_Unicode( 'a' ) + sal_Unicode(nSeqKeyCode - KEY_A) ) ) + return 1; + } + else + endUnicodeSequence(); + } + + if( aDeleteWatch.isDeleted() ) + return 0; + rtl_TextEncoding nEncoding; if (mpInputContext != NULL && mpInputContext->IsMultiLingual() ) @@ -3372,8 +3496,6 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent ) nSize = 0; } - DeletionListener aDeleteWatch( this ); - if ( mpInputContext != NULL && mpInputContext->UseContext() && KeyRelease != pEvent->type -- cgit From cb183c4c7750bedb079337b01f32590bf2ec0176 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 28 Jul 2010 13:22:52 +0200 Subject: vcl114: #i113490# avoid accessing a possible NULL ptr (thanks cmc!) --- vcl/unx/gtk/a11y/atkutil.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/gtk/a11y/atkutil.cxx b/vcl/unx/gtk/a11y/atkutil.cxx index 13492f3d4a5c..ad33cdf67de6 100644 --- a/vcl/unx/gtk/a11y/atkutil.cxx +++ b/vcl/unx/gtk/a11y/atkutil.cxx @@ -77,11 +77,10 @@ atk_wrapper_focus_idle_handler (gpointer data) uno::Reference< accessibility::XAccessible > xAccessible = xNextFocusObject; if( xAccessible.get() == reinterpret_cast < accessibility::XAccessible * > (data) ) { + AtkObject *atk_obj = xAccessible.is() ? atk_object_wrapper_ref( xAccessible ) : NULL; // Gail does not notify focus changes to NULL, so do we .. - if( xAccessible.is() ) + if( atk_obj ) { - AtkObject *atk_obj = atk_object_wrapper_ref( xAccessible ); - #ifdef ENABLE_TRACING fprintf(stderr, "notifying focus event for %p\n", atk_obj); #endif -- cgit From 95a5931e6942c1d2bd9a91c64ae85ac41b53d5f2 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 28 Jul 2010 19:23:35 +0200 Subject: vcl114: #i113499# fix an erroneous assertion --- vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 9d3ce6b137cd..188bc0b34931 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -2291,11 +2291,10 @@ BOOL GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, const ImplControlValue& aValue, const OUString& ) { - OSL_ASSERT( aValue.getType() == CTRL_TAB_ITEM ); + OSL_ASSERT( nType != CTRL_TAB_ITEM || aValue.getType() == CTRL_TAB_ITEM ); GdkPixmap * pixmap; Rectangle pixmapRect; Rectangle tabRect; - const TabitemValue * pTabitemValue = static_cast(&aValue); GtkStateType stateType; GtkShadowType shadowType; if( ! gWidgetData[ m_nScreen ].gCacheTabItems ) @@ -2311,9 +2310,8 @@ BOOL GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, if( !aCachePage.GetSize() ) aCachePage.SetSize( 1 ); - if ( !pTabitemValue && (nType==CTRL_TAB_ITEM) ) + if ( (nType == CTRL_TAB_ITEM) && (aValue.getType() != CTRL_TAB_ITEM) ) { - std::fprintf( stderr, "NWPaintGTKTabItem() received a NULL TabitemValue. Cannot draw native tab\n" ); return( false ); } @@ -2326,6 +2324,7 @@ BOOL GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, pixmapRect = rControlRectangle; if ( nType == CTRL_TAB_ITEM ) { + const TabitemValue * pTabitemValue = static_cast(&aValue); if ( !pTabitemValue->isFirst() ) { // GTK+ tabs overlap on the right edge (the top tab obscures the -- cgit From 100e71ffeac18415d7500200e1b0258a8b079afa Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 6 Aug 2010 17:25:55 +0200 Subject: vcl114: #i79083# use correct paint method for inconsistent checkbox --- vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 60 ++------------------------------ vcl/unx/inc/plugins/gtk/gtkgdi.hxx | 4 --- 2 files changed, 3 insertions(+), 61 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 188bc0b34931..69751843582d 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -732,12 +732,6 @@ BOOL GtkSalGraphics::drawNativeControl( ControlType nType, const ImplControlValue& aValue, const OUString& rCaption ) { - if( (nType==CTRL_CHECKBOX) && (nPart==PART_ENTIRE_CONTROL) && - aValue.getTristateVal() == BUTTONVALUE_MIXED ) - { - return drawNativeMixedStateCheck( nType, nPart, rControlRegion, nState, aValue, rCaption ); - } - BOOL returnVal = FALSE; // get a GC with current clipping region set SelectFont(); @@ -895,55 +889,6 @@ BOOL GtkSalGraphics::drawNativeControl( ControlType nType, return( returnVal ); } -BOOL GtkSalGraphics::drawNativeMixedStateCheck( ControlType nType, - ControlPart nPart, - const Rectangle& rControlRegion, - ControlState nState, - const ImplControlValue& aValue, - const OUString& rCaption ) -{ - // need to emulate something for mixed state - - // do this via pixmap since some themes don't care for regions - bool bOldNeedPixmapPaint = bNeedPixmapPaint; - bNeedPixmapPaint = true; - - Rectangle aCtrlRect = rControlRegion; - BOOL returnVal = FALSE; - SelectFont(); - - // draw upper half in off state - const_cast(aValue).setTristateVal( BUTTONVALUE_OFF ); - XLIB_Region aRegion = XCreateRegion(); - XRectangle aXRect = { aCtrlRect.Left(), aCtrlRect.Top(), aCtrlRect.GetWidth(), aCtrlRect.GetHeight() }; - const unsigned short nH = aXRect.height/2; - aXRect.height -= nH; - XUnionRectWithRegion( &aXRect, aRegion, aRegion ); - SetClipRegion( pFontGC_, aRegion ); - XDestroyRegion( aRegion ); - - returnVal = drawNativeControl( nType, nPart, rControlRegion, nState, aValue, rCaption ); - - if( returnVal ) - { - // draw lower half in on state - const_cast(aValue).setTristateVal( BUTTONVALUE_ON ); - aXRect.y += nH; - aRegion = XCreateRegion(); - XUnionRectWithRegion( &aXRect, aRegion, aRegion ); - SetClipRegion( pFontGC_, aRegion ); - XDestroyRegion( aRegion ); - returnVal = drawNativeControl( nType, nPart, rControlRegion, nState, aValue, rCaption ); - } - - // clean up - bNeedPixmapPaint = bOldNeedPixmapPaint; - const_cast(aValue).setTristateVal( BUTTONVALUE_MIXED ); - SetClipRegion( pFontGC_ ); - return returnVal; -} - - /* * DrawNativeControlText() * @@ -1378,7 +1323,8 @@ BOOL GtkSalGraphics::NWPaintGTKCheck( GdkDrawable* gdkDrawable, { GtkStateType stateType; GtkShadowType shadowType; - BOOL isChecked = (aValue.getTristateVal()==BUTTONVALUE_ON) ? TRUE : FALSE; + bool isChecked = (aValue.getTristateVal() == BUTTONVALUE_ON); + bool isInconsistent = (aValue.getTristateVal() == BUTTONVALUE_MIXED); GdkRectangle clipRect; gint x,y; @@ -1393,7 +1339,7 @@ BOOL GtkSalGraphics::NWPaintGTKCheck( GdkDrawable* gdkDrawable, y = rControlRectangle.Top() + (rControlRectangle.GetHeight()-indicator_size)/2; // Set the shadow based on if checked or not so we get a checkmark. - shadowType = isChecked ? GTK_SHADOW_IN : GTK_SHADOW_OUT; + shadowType = isChecked ? GTK_SHADOW_IN : isInconsistent ? GTK_SHADOW_ETCHED_IN : GTK_SHADOW_OUT; NWSetWidgetState( gWidgetData[m_nScreen].gCheckWidget, nState, stateType ); GTK_TOGGLE_BUTTON(gWidgetData[m_nScreen].gCheckWidget)->active = isChecked; diff --git a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx index 7544a566d8ae..38c79b3e11df 100644 --- a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx +++ b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx @@ -178,10 +178,6 @@ protected: const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, const OUString& rCaption ); - - BOOL drawNativeMixedStateCheck( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, - ControlState nState, const ImplControlValue& aValue, - const rtl::OUString& rCaption ); }; #endif // _VCL_GTKGDI_HXX -- cgit From fb51494aaa2e361ec036b81d59b620324eb25c7e Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 6 Aug 2010 20:04:45 +0200 Subject: vcl114: #i96895# fix toolbar buttons, control state is actually misleading here --- vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 69751843582d..b8a3ac773a8f 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -2479,7 +2479,6 @@ BOOL GtkSalGraphics::NWPaintGTKToolbar( gint g_x=0, g_y=0, g_w=10, g_h=10; bool bPaintButton = true; GtkWidget* pButtonWidget = gWidgetData[m_nScreen].gToolbarButtonWidget; - const gchar* pButtonDetail = "button"; GdkRectangle clipRect; NWEnsureGTKToolbar( m_nScreen ); @@ -2538,13 +2537,18 @@ BOOL GtkSalGraphics::NWPaintGTKToolbar( { pButtonWidget = gWidgetData[m_nScreen].gToolbarToggleWidget; shadowType = GTK_SHADOW_IN; + stateType = GTK_STATE_ACTIVE; // special case stateType value for depressed toggle buttons // cf. gtk+/gtk/gtktogglebutton.c (gtk_toggle_button_update_state) - if( ! (nState & (CTRL_STATE_PRESSED|CTRL_STATE_ROLLOVER)) ) - stateType = GTK_STATE_ACTIVE; - pButtonDetail = "togglebutton"; + if( (nState & (CTRL_STATE_ROLLOVER|CTRL_STATE_PRESSED)) ) + { + stateType = GTK_STATE_PRELIGHT; + shadowType = GTK_SHADOW_OUT; + } bPaintButton = true; } + else + stateType = GTK_STATE_PRELIGHT; // only for bPaintButton = true, in which case always rollver is meant NWSetWidgetState( pButtonWidget, nState, stateType ); gtk_widget_ensure_style( pButtonWidget ); @@ -2602,7 +2606,7 @@ BOOL GtkSalGraphics::NWPaintGTKToolbar( stateType, shadowType, &clipRect, - pButtonWidget, pButtonDetail, x, y, w, h ); + pButtonWidget, "button", x, y, w, h ); } } } -- cgit From 336664d07bc3d3f865e28ca760fba3a37020c70e Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Wed, 11 Aug 2010 14:28:31 +0200 Subject: #i113800 remove fontconfig pseudo-dupe patterns as early as possible --- vcl/unx/source/fontmanager/fontconfig.cxx | 41 +++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 10 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/source/fontmanager/fontconfig.cxx b/vcl/unx/source/fontmanager/fontconfig.cxx index 03816857f27c..d495187ddd25 100644 --- a/vcl/unx/source/fontmanager/fontconfig.cxx +++ b/vcl/unx/source/fontmanager/fontconfig.cxx @@ -124,13 +124,15 @@ class FontCfgWrapper FcBool (*m_pFcConfigAppFontAddFile)(FcConfig*, const FcChar8*); FcBool (*m_pFcConfigAppFontAddDir)(FcConfig*, const FcChar8*); FcBool (*m_pFcConfigParseAndLoad)(FcConfig*,const FcChar8*,FcBool); - FcBool (*m_pFcConfigSubstitute)(FcConfig*,FcPattern*,FcMatchKind); + FcBool (*m_pFcPatternAddInteger)(FcPattern*,const char*,int); FcBool (*m_pFcPatternAddDouble)(FcPattern*,const char*,double); FcBool (*m_pFcPatternAddBool)(FcPattern*,const char*,FcBool); FcBool (*m_pFcPatternAddCharSet)(FcPattern*,const char*,const FcCharSet*); FcBool (*m_pFcPatternAddString)(FcPattern*,const char*,const FcChar8*); + FcBool (*m_pFcPatternDel)(FcPattern*,const char*); + FT_UInt (*m_pFcFreeTypeCharIndex)(FT_Face,FcChar32); oslGenericFunction loadSymbol( const char* ); @@ -242,6 +244,8 @@ public: { return m_pFcPatternAddBool( pPattern, pObject, nValue ); } FcBool FcPatternAddCharSet(FcPattern* pPattern,const char* pObject,const FcCharSet*pCharSet) { return m_pFcPatternAddCharSet(pPattern,pObject,pCharSet); } + FcBool FcPatternDel(FcPattern* pPattern, const char* object) + { return m_pFcPatternDel( pPattern, object); } FT_UInt FcFreeTypeCharIndex( FT_Face face, FcChar32 ucs4 ) { return m_pFcFreeTypeCharIndex ? m_pFcFreeTypeCharIndex( face, ucs4 ) : 0; } @@ -349,6 +353,9 @@ FontCfgWrapper::FontCfgWrapper() loadSymbol( "FcPatternAddCharSet" ); m_pFcPatternAddString = (FcBool(*)(FcPattern*,const char*,const FcChar8*)) loadSymbol( "FcPatternAddString" ); + m_pFcPatternDel = (FcBool(*)(FcPattern*,const char*)) + loadSymbol( "FcPatternDel" ); + m_pFcFreeTypeCharIndex = (FT_UInt(*)(FT_Face,FcChar32)) loadSymbol( "FcFreeTypeCharIndex" ); @@ -397,7 +404,8 @@ FontCfgWrapper::FontCfgWrapper() m_pFcPatternAddDouble && m_pFcPatternAddCharSet && m_pFcPatternAddBool && - m_pFcPatternAddString + m_pFcPatternAddString && + m_pFcPatternDel ) ) { osl_unloadModule( (oslModule)m_pLib ); @@ -428,18 +436,31 @@ void FontCfgWrapper::addFontSet( FcSetName eSetName ) if( !pOrig ) return; + // filter the font sets to remove obsolete or duplicate faces for( int i = 0; i < pOrig->nfont; ++i ) { - FcBool outline = false; - FcPattern *pOutlinePattern = pOrig->fonts[i]; - FcResult eOutRes = - FcPatternGetBool( pOutlinePattern, FC_OUTLINE, 0, &outline ); - if( (eOutRes != FcResultMatch) || (outline != FcTrue) ) + FcPattern* pOrigPattern = pOrig->fonts[i]; + // create a pattern to find eventually better alternatives + FcPattern* pTestPattern = FcPatternDuplicate( pOrigPattern ); + FcPatternAddBool( pTestPattern, FC_OUTLINE, FcTrue ); + // TODO: use pattern->ImplFontAttr->pattern to filter out + // all attribute that are not interesting for finding dupes + FcPatternDel( pTestPattern, FC_FONTVERSION ); + FcPatternDel( pTestPattern, FC_CHARSET ); + FcPatternDel( pTestPattern, FC_FILE ); + // find the font face for the dupe-search pattern + FcResult eFcResult = FcResultMatch; + FcPattern* pBetterPattern = FcFontMatch( FcConfigGetCurrent(), pTestPattern, &eFcResult ); + FcPatternDestroy( pTestPattern ); + if( eFcResult != FcResultMatch ) continue; - FcPatternReference(pOutlinePattern); - FcFontSetAdd(m_pOutlineSet, pOutlinePattern); + // insert best found pattern for the dupe-search pattern + // TODO: skip inserting patterns that are already known in the target fontset + FcPatternReference( pBetterPattern ); + FcFontSetAdd( m_pOutlineSet, pBetterPattern ); } - // TODO: FcFontSetDestroy( pOrig ); + + // TODO?: FcFontSetDestroy( pOrig ); #else (void)eSetName; // prevent compiler warning about unused parameter #endif -- cgit From 7c65391cadfe6caad000bd6ea058a437958c52ac Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 12 Aug 2010 11:22:12 +0200 Subject: vcl115: #i113809# do not set an empty max size (thanks cmc!) --- vcl/unx/gtk/window/gtkframe.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vcl/unx') diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index c6ff16f8395b..5afff180b94f 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -1452,7 +1452,7 @@ void GtkSalFrame::setMinMaxSize() aHints |= GDK_HINT_MAX_SIZE; } } - if( m_bFullscreen ) + if( m_bFullscreen && m_aMaxSize.Width() && m_aMaxSize.Height() ) { aGeo.max_width = m_aMaxSize.Width(); aGeo.max_height = m_aMaxSize.Height(); -- cgit From 6513107d7cd9114dceb57ecbef9045f2e912caca Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 13 Aug 2010 14:05:25 +0200 Subject: vcl115: #i113856# another WM workaround (thanks cmc!) --- vcl/unx/gtk/window/gtkframe.cxx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index 5afff180b94f..cc056d95ac0d 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -1353,11 +1353,7 @@ void GtkSalFrame::Show( BOOL bVisible, BOOL bNoActivate ) // // i.e. having a time < that of the toplevel frame means that the toplevel frame gets unfocused. // awesome. - bool bHack = - getDisplay()->getWMAdaptor()->getWindowManagerName().EqualsAscii("Metacity") || - getDisplay()->getWMAdaptor()->getWindowManagerName().EqualsAscii("compiz") - ; - if( nUserTime == 0 && bHack ) + if( nUserTime == 0 ) { /* #i99360# ugly workaround an X11 library bug */ nUserTime= getDisplay()->GetLastUserEventTime( true ); @@ -1365,7 +1361,7 @@ void GtkSalFrame::Show( BOOL bVisible, BOOL bNoActivate ) } lcl_set_user_time( GTK_WIDGET(m_pWindow)->window, nUserTime ); - if( bHack && ! bNoActivate && (m_nStyle & SAL_FRAME_STYLE_TOOLWINDOW) ) + if( ! bNoActivate && (m_nStyle & SAL_FRAME_STYLE_TOOLWINDOW) ) m_bSetFocusOnMap = true; gtk_widget_show( m_pWindow ); -- cgit From 2b5d5724c530ae230c6b3b888cee2da1778a74b6 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Fri, 13 Aug 2010 12:37:22 +0200 Subject: #i113800# wrap more fontconfig symbols --- vcl/unx/source/fontmanager/fontconfig.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'vcl/unx') diff --git a/vcl/unx/source/fontmanager/fontconfig.cxx b/vcl/unx/source/fontmanager/fontconfig.cxx index d495187ddd25..2ff4298b7658 100644 --- a/vcl/unx/source/fontmanager/fontconfig.cxx +++ b/vcl/unx/source/fontmanager/fontconfig.cxx @@ -121,11 +121,13 @@ class FontCfgWrapper FcResult (*m_pFcPatternGetBool)(const FcPattern*,const char*,int,FcBool*); void (*m_pFcDefaultSubstitute)(FcPattern *); FcPattern* (*m_pFcFontSetMatch)(FcConfig*,FcFontSet**, int, FcPattern*,FcResult*); + FcPattern* (*m_pFcFontMatch)(FcConfig*,FcPattern*,FcResult*); FcBool (*m_pFcConfigAppFontAddFile)(FcConfig*, const FcChar8*); FcBool (*m_pFcConfigAppFontAddDir)(FcConfig*, const FcChar8*); FcBool (*m_pFcConfigParseAndLoad)(FcConfig*,const FcChar8*,FcBool); FcBool (*m_pFcConfigSubstitute)(FcConfig*,FcPattern*,FcMatchKind); + FcPattern* (*m_pFcPatternDuplicate)(const FcPattern*); FcBool (*m_pFcPatternAddInteger)(FcPattern*,const char*,int); FcBool (*m_pFcPatternAddDouble)(FcPattern*,const char*,double); FcBool (*m_pFcPatternAddBool)(FcPattern*,const char*,FcBool); @@ -232,8 +234,13 @@ public: { m_pFcDefaultSubstitute( pPattern ); } FcPattern* FcFontSetMatch( FcConfig* pConfig, FcFontSet **ppFontSet, int nset, FcPattern* pPattern, FcResult* pResult ) { return m_pFcFontSetMatch ? m_pFcFontSetMatch( pConfig, ppFontSet, nset, pPattern, pResult ) : 0; } + FcPattern* FcFontMatch( FcConfig* pConfig, FcPattern* pPattern, FcResult* pResult ) + { return m_pFcFontMatch( pConfig, pPattern, pResult ); } FcBool FcConfigSubstitute( FcConfig* pConfig, FcPattern* pPattern, FcMatchKind eKind ) { return m_pFcConfigSubstitute( pConfig, pPattern, eKind ); } + + FcPattern* FcPatternDuplicate( const FcPattern* pPattern ) const + { return m_pFcPatternDuplicate( pPattern ); } FcBool FcPatternAddInteger( FcPattern* pPattern, const char* pObject, int nValue ) { return m_pFcPatternAddInteger( pPattern, pObject, nValue ); } FcBool FcPatternAddDouble( FcPattern* pPattern, const char* pObject, double nValue ) @@ -341,8 +348,13 @@ FontCfgWrapper::FontCfgWrapper() loadSymbol( "FcDefaultSubstitute" ); m_pFcFontSetMatch = (FcPattern*(*)(FcConfig*,FcFontSet**,int,FcPattern*,FcResult*)) loadSymbol( "FcFontSetMatch" ); + m_pFcFontMatch = (FcPattern*(*)(FcConfig*,FcPattern*,FcResult*)) + loadSymbol( "FcFontMatch" ); m_pFcConfigSubstitute = (FcBool(*)(FcConfig*,FcPattern*,FcMatchKind)) loadSymbol( "FcConfigSubstitute" ); + + m_pFcPatternDuplicate = (FcPattern*(*)(const FcPattern*)) + loadSymbol( "FcPatternDuplicate" ); m_pFcPatternAddInteger = (FcBool(*)(FcPattern*,const char*,int)) loadSymbol( "FcPatternAddInteger" ); m_pFcPatternAddDouble = (FcBool(*)(FcPattern*,const char*,double)) @@ -398,8 +410,10 @@ FontCfgWrapper::FontCfgWrapper() m_pFcConfigAppFontAddFile && m_pFcConfigAppFontAddDir && m_pFcConfigParseAndLoad && + m_pFcFontMatch && m_pFcDefaultSubstitute && m_pFcConfigSubstitute && + m_pFcPatternDuplicate && m_pFcPatternAddInteger && m_pFcPatternAddDouble && m_pFcPatternAddCharSet && -- cgit From 1fc79e17babe1511326f289e3539772674be9562 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Fri, 13 Aug 2010 17:00:29 +0200 Subject: #i113604# fix some charmap refcounting issues --- vcl/unx/source/gdi/salgdi3.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'vcl/unx') diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx index 16529d3ce78f..c6410e128596 100644 --- a/vcl/unx/source/gdi/salgdi3.cxx +++ b/vcl/unx/source/gdi/salgdi3.cxx @@ -1507,7 +1507,8 @@ ImplFontCharMap* X11SalGraphics::GetImplFontCharMap() const CmapResult aCmapResult; if( !mpServerFont[0]->GetFontCodeRanges( aCmapResult ) ) return NULL; - return new ImplFontCharMap( aCmapResult ); + ImplFontCharMap* pNewMap = new ImplFontCharMap( aCmapResult ); + return pNewMap; } // ---------------------------------------------------------------------------- -- cgit From 588516e12af81741174b16feb22bef6d5f5fc66e Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Mon, 16 Aug 2010 14:55:27 +0200 Subject: #i113861# prepare caching of ImplFontCharMap objects on UNX --- vcl/unx/headless/svppspgraphics.cxx | 7 ++----- vcl/unx/headless/svptext.cxx | 6 ++---- vcl/unx/source/gdi/pspgraphics.cxx | 7 ++----- vcl/unx/source/gdi/salgdi3.cxx | 12 ++---------- 4 files changed, 8 insertions(+), 24 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx index 86f356031f52..ccced8701f83 100644 --- a/vcl/unx/headless/svppspgraphics.cxx +++ b/vcl/unx/headless/svppspgraphics.cxx @@ -685,14 +685,11 @@ void PspGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout ) ImplFontCharMap* PspGraphics::GetImplFontCharMap() const { - // TODO: get ImplFontCharMap directly from fonts if( !m_pServerFont[0] ) return NULL; - CmapResult aCmapResult; - if( !m_pServerFont[0]->GetFontCodeRanges( aCmapResult ) ) - return NULL; - return new ImplFontCharMap( aCmapResult ); + ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap(); + return pIFCMap; } USHORT PspGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel ) diff --git a/vcl/unx/headless/svptext.cxx b/vcl/unx/headless/svptext.cxx index 34941fc777db..df3625e82643 100644 --- a/vcl/unx/headless/svptext.cxx +++ b/vcl/unx/headless/svptext.cxx @@ -277,10 +277,8 @@ ImplFontCharMap* SvpSalGraphics::GetImplFontCharMap() const if( !m_pServerFont[0] ) return NULL; - CmapResult aCmapResult; - if( !m_pServerFont[0]->GetFontCodeRanges( aCmapResult ) ) - return NULL; - return new ImplFontCharMap( aCmapResult ); + ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap(); + return pIFCMap; } // --------------------------------------------------------------------------- diff --git a/vcl/unx/source/gdi/pspgraphics.cxx b/vcl/unx/source/gdi/pspgraphics.cxx index 220d7bbcae87..3f73d1021bb8 100644 --- a/vcl/unx/source/gdi/pspgraphics.cxx +++ b/vcl/unx/source/gdi/pspgraphics.cxx @@ -772,14 +772,11 @@ void PspGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout ) ImplFontCharMap* PspGraphics::GetImplFontCharMap() const { - // TODO: get ImplFontCharMap directly from fonts if( !m_pServerFont[0] ) return NULL; - CmapResult aCmapResult; - if( !m_pServerFont[0]->GetFontCodeRanges( aCmapResult ) ) - return NULL; - return new ImplFontCharMap( aCmapResult ); + ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap(); + return pIFCMap; } USHORT PspGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel ) diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx index c6410e128596..7e605dbee981 100644 --- a/vcl/unx/source/gdi/salgdi3.cxx +++ b/vcl/unx/source/gdi/salgdi3.cxx @@ -1496,19 +1496,11 @@ void X11SalGraphics::DrawStringUCS2MB( ExtendedFontStruct& rFont, ImplFontCharMap* X11SalGraphics::GetImplFontCharMap() const { - // TODO: get ImplFontCharMap directly from fonts if( !mpServerFont[0] ) -#if 0 // RIP XLFD fonts - if( mXFont[0] ) - // TODO?: nPairCount = mXFont[0]->GetFontCodeRanges( NULL ); -#endif return NULL; - CmapResult aCmapResult; - if( !mpServerFont[0]->GetFontCodeRanges( aCmapResult ) ) - return NULL; - ImplFontCharMap* pNewMap = new ImplFontCharMap( aCmapResult ); - return pNewMap; + ImplFontCharMap* pIFCMap = mpServerFont[0]->GetImplFontCharMap(); + return pIFCMap; } // ---------------------------------------------------------------------------- -- cgit From 1bee6c0e9121cf1d3d246a7e49f5e0d89aad6682 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 16 Aug 2010 20:31:58 +0200 Subject: pdfprint: #i94173# #i113802# send print jobs in PDF instead of PostScript --- vcl/unx/inc/salprn.h | 6 + vcl/unx/source/gdi/salprnpsp.cxx | 205 ++++++++++++++++++++++++-- vcl/unx/source/printer/cupsmgr.cxx | 14 ++ vcl/unx/source/printer/jobdata.cxx | 13 +- vcl/unx/source/printer/printerinfomanager.cxx | 12 +- vcl/unx/source/printergfx/printerjob.cxx | 3 +- 6 files changed, 236 insertions(+), 17 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/inc/salprn.h b/vcl/unx/inc/salprn.h index fa68f1b38e73..6e6ca0a2f1cc 100644 --- a/vcl/unx/inc/salprn.h +++ b/vcl/unx/inc/salprn.h @@ -71,6 +71,7 @@ public: bool m_bFax:1; bool m_bPdf:1; bool m_bSwallowFaxNo:1; + bool m_bIsPDFWriterJob:1; PspGraphics* m_pGraphics; psp::PrinterJob m_aPrintJob; psp::JobData m_aJobData; @@ -91,6 +92,11 @@ public: bool bCollate, bool bDirect, ImplJobSetup* pSetupData ); + virtual BOOL StartJob( const String*, + const String&, + const String&, + ImplJobSetup*, + vcl::PrinterController& i_rController ); virtual BOOL EndJob(); virtual BOOL AbortJob(); virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, BOOL bNewJobData ); diff --git a/vcl/unx/source/gdi/salprnpsp.cxx b/vcl/unx/source/gdi/salprnpsp.cxx index 8617bc4e5bfa..b9e3cec07e00 100644 --- a/vcl/unx/source/gdi/salprnpsp.cxx +++ b/vcl/unx/source/gdi/salprnpsp.cxx @@ -54,6 +54,8 @@ #include "vcl/svapp.hxx" #include "vcl/jobset.h" #include "vcl/print.h" +#include "vcl/print.hxx" +#include "vcl/pdfwriter.hxx" #include "vcl/salptype.hxx" #include "vcl/printerinfomanager.hxx" @@ -63,6 +65,7 @@ using namespace psp; using namespace rtl; +using namespace com::sun::star; /* * static helpers @@ -892,9 +895,26 @@ ULONG PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, USHORT case PRINTER_CAPABILITIES_FAX: return PrinterInfoManager::get().checkFeatureToken( pJobSetup->maPrinterName, "fax" ) ? 1 : 0; case PRINTER_CAPABILITIES_PDF: - return PrinterInfoManager::get().checkFeatureToken( pJobSetup->maPrinterName, "pdf" ) ? 1 : 0; + if( PrinterInfoManager::get().checkFeatureToken( pJobSetup->maPrinterName, "pdf" ) ) + return 1; + else + { + // see if the PPD contains a value to set Collate to True + JobData aData = PrinterInfoManager::get().getPrinterInfo( pJobSetup->maPrinterName ); + if( pJobSetup->mpDriverData ) + JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData ); + return aData.m_nPDFDevice > 0 ? 1 : 0; + } case PRINTER_CAPABILITIES_EXTERNALDIALOG: return PrinterInfoManager::get().checkFeatureToken( pJobSetup->maPrinterName, "external_dialog" ) ? 1 : 0; + case PRINTER_CAPABILITIES_USEPULLMODEL: + { + // see if the PPD contains a value to set Collate to True + JobData aData = PrinterInfoManager::get().getPrinterInfo( pJobSetup->maPrinterName ); + if( pJobSetup->mpDriverData ) + JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData ); + return aData.m_nPDFDevice > 0 ? 1 : 0; + } default: break; }; return 0; @@ -910,6 +930,7 @@ ULONG PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, USHORT : m_bFax( false ), m_bPdf( false ), m_bSwallowFaxNo( false ), + m_bIsPDFWriterJob( false ), m_pGraphics( NULL ), m_nCopies( 1 ), m_bCollate( false ), @@ -1021,22 +1042,28 @@ BOOL PspSalPrinter::StartJob( BOOL PspSalPrinter::EndJob() { - BOOL bSuccess = m_aPrintJob.EndJob(); - - if( bSuccess ) + BOOL bSuccess = FALSE; + if( m_bIsPDFWriterJob ) + bSuccess = TRUE; + else { - // check for fax - if( m_bFax ) - { + bSuccess = m_aPrintJob.EndJob(); - const PrinterInfo& rInfo( PrinterInfoManager::get().getPrinterInfo( m_aJobData.m_aPrinterName ) ); - // sendAFax removes the file after use - bSuccess = sendAFax( m_aFaxNr, m_aTmpFile, rInfo.m_aCommand ); - } - else if( m_bPdf ) + if( bSuccess ) { - const PrinterInfo& rInfo( PrinterInfoManager::get().getPrinterInfo( m_aJobData.m_aPrinterName ) ); - bSuccess = createPdf( m_aFileName, m_aTmpFile, rInfo.m_aCommand ); + // check for fax + if( m_bFax ) + { + + const PrinterInfo& rInfo( PrinterInfoManager::get().getPrinterInfo( m_aJobData.m_aPrinterName ) ); + // sendAFax removes the file after use + bSuccess = sendAFax( m_aFaxNr, m_aTmpFile, rInfo.m_aCommand ); + } + else if( m_bPdf ) + { + const PrinterInfo& rInfo( PrinterInfoManager::get().getPrinterInfo( m_aJobData.m_aPrinterName ) ); + bSuccess = createPdf( m_aFileName, m_aTmpFile, rInfo.m_aCommand ); + } } } vcl_sal::PrinterUpdate::jobEnded(); @@ -1089,6 +1116,156 @@ ULONG PspSalPrinter::GetErrorCode() return 0; } +// ----------------------------------------------------------------------- + +BOOL PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJobName, const String& i_rAppName, + ImplJobSetup* i_pSetupData, vcl::PrinterController& i_rController ) +{ + OSL_TRACE( "StartJob with controller: pFilename = %s", i_pFileName ? rtl::OUStringToOString( *i_pFileName, RTL_TEXTENCODING_UTF8 ).getStr() : "" ); + // mark for endjob + m_bIsPDFWriterJob = true; + // reset IsLastPage + i_rController.setLastPage( sal_False ); + + // update job data + if( i_pSetupData ) + JobData::constructFromStreamBuffer( i_pSetupData->mpDriverData, i_pSetupData->mnDriverDataLen, m_aJobData ); + + OSL_ASSERT( m_aJobData.m_nPDFDevice > 0 ); + m_aJobData.m_nPDFDevice = 1; + + // do we want a progress panel ? + // possibly create one job for collated output + sal_Bool bSinglePrintJobs = sal_False; + beans::PropertyValue* pSingleValue = i_rController.getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintCollateAsSingleJobs" ) ) ); + if( pSingleValue ) + { + pSingleValue->Value >>= bSinglePrintJobs; + } + + m_aJobData.m_nCopies = i_rController.getPrinter()->GetCopyCount(); + int nJobs = 1; + if( bSinglePrintJobs ) + { + nJobs = m_aJobData.m_nCopies; + m_aJobData.m_nCopies = 1; + } + + // notify start of real print job + i_rController.jobStarted(); + + // produce PDF file + OUString aPDFUrl; + if( i_pFileName ) + aPDFUrl = *i_pFileName; + else + osl_createTempFile( NULL, NULL, &aPDFUrl.pData ); + if( aPDFUrl.compareToAscii( "file:", 5 ) != 0 ) + { + // this is not a file URL, but it should + // form it into a osl friendly file URL + rtl::OUString aTmp; + osl_getFileURLFromSystemPath( aPDFUrl.pData, &aTmp.pData ); + aPDFUrl = aTmp; + } + + // setup PDFWriter + + vcl::PDFWriter::PDFWriterContext aContext; + aContext.URL = aPDFUrl; + aContext.Version = vcl::PDFWriter::PDF_1_4; + aContext.Tagged = false; + aContext.EmbedStandardFonts = true; + aContext.Encrypt = false; + aContext.DocumentLocale = Application::GetSettings().GetLocale(); + + vcl::PDFDocInfo aDocInfo; + aDocInfo.Title = i_rJobName; + aDocInfo.Creator = i_rAppName; + aDocInfo.Producer = i_rAppName; + + vcl::PDFWriter aPDFWriter( aContext ); + aPDFWriter.SetDocInfo( aDocInfo ); + vcl::PDFWriter::PlayMetafileContext aMtfContext; + aMtfContext.m_bOnlyLosslessCompression = true; + + boost::shared_ptr pPrinter( i_rController.getPrinter() ); + int nAllPages = i_rController.getFilteredPageCount(); + i_rController.createProgressDialog(); + bool bAborted = false; + for( int nPage = 0; nPage < nAllPages && ! bAborted; nPage++ ) + { + if( nPage == nAllPages-1 ) + i_rController.setLastPage( sal_True ); + + // get the pages metafile + GDIMetaFile aPageFile; + vcl::PrinterController::PageSize aPageSize = i_rController.getFilteredPageFile( nPage, aPageFile ); + if( i_rController.isProgressCanceled() ) + { + bAborted = true; + if( nPage != nAllPages-1 ) + { + i_rController.createProgressDialog(); + i_rController.setLastPage( sal_True ); + i_rController.getFilteredPageFile( nPage, aPageFile ); + } + } + else + { + pPrinter->SetMapMode( MapMode( MAP_100TH_MM ) ); + pPrinter->SetPaperSizeUser( aPageSize.aSize, true ); + Size aRealSize( pPrinter->GetPaperSize() ); + + aPDFWriter.NewPage( TenMuToPt( aRealSize.Width() ), + TenMuToPt( aRealSize.Height() ), + vcl::PDFWriter::Portrait ); + + aPDFWriter.PlayMetafile( aPageFile, aMtfContext, NULL ); + } + } + + aPDFWriter.Emit(); + + if( ! i_pFileName && ! bAborted ) + { + oslFileHandle pFile = NULL; + osl_openFile( aContext.URL.pData, &pFile, osl_File_OpenFlag_Read ); + if( pFile ) + { + osl_setFilePos( pFile, osl_Pos_Absolut, 0 ); + std::vector< char > buffer( 0x10000, 0 ); + for( int nCurJob = 0; nCurJob < nJobs; nCurJob++ ) + { + FILE* fp = PrinterInfoManager::get().startSpool( i_pSetupData->maPrinterName, i_rController.isDirectPrint() ); + if( fp ) + { + sal_uInt64 nBytesRead = 0; + do + { + osl_readFile( pFile, &buffer[0], buffer.size(), &nBytesRead ); + if( nBytesRead > 0 ) + fwrite( &buffer[0], 1, nBytesRead, fp ); + } while( nBytesRead == buffer.size() ); + PrinterInfoManager::get().endSpool( i_pSetupData->maPrinterName, i_rJobName, fp, m_aJobData ); + } + } + osl_closeFile( pFile ); + } + } + + // job has been spooled + i_rController.setJobState( bAborted ? view::PrintableState_JOB_ABORTED : view::PrintableState_JOB_SPOOLED ); + + // clean up the PDF file + if( ! i_pFileName || bAborted ) + osl_removeFile( aPDFUrl.pData ); + + return TRUE; +} + + + /* * vcl::PrinterUpdate */ diff --git a/vcl/unx/source/printer/cupsmgr.cxx b/vcl/unx/source/printer/cupsmgr.cxx index e245b2548c79..c4fcf433d349 100644 --- a/vcl/unx/source/printer/cupsmgr.cxx +++ b/vcl/unx/source/printer/cupsmgr.cxx @@ -524,12 +524,18 @@ void CUPSManager::initialize() // introduced in dests with 1.2 // this is needed to check for %%IncludeFeature support // (#i65684#, #i65491#) + bool bUsePDF = false; cups_dest_t* pDest = ((cups_dest_t*)m_pDests); const char* pOpt = m_pCUPSWrapper->cupsGetOption( "printer-info", pDest->num_options, pDest->options ); if( pOpt ) + { m_bUseIncludeFeature = true; + bUsePDF = true; + if( m_aGlobalDefaults.m_nPSLevel == 0 && m_aGlobalDefaults.m_nPDFDevice == 0 ) + m_aGlobalDefaults.m_nPDFDevice = 1; + } // do not send include JobPatch; CUPS will insert that itself // TODO: currently unknwon which versions of CUPS insert JobPatches // so currently it is assumed CUPS = don't insert JobPatch files @@ -593,6 +599,8 @@ void CUPSManager::initialize() aPrinter.m_aInfo.m_pParser = c_it->second.getParser(); aPrinter.m_aInfo.m_aContext = c_it->second; } + if( bUsePDF && aPrinter.m_aInfo.m_nPSLevel == 0 && aPrinter.m_aInfo.m_nPDFDevice == 0 ) + aPrinter.m_aInfo.m_nPDFDevice = 1; aPrinter.m_aInfo.m_aDriverName = aBuf.makeStringAndClear(); aPrinter.m_bModified = false; @@ -880,6 +888,12 @@ void CUPSManager::getOptionsFromDocumentSetup( const JobData& rJob, int& rNumOpt } } } + + if( rJob.m_nPDFDevice > 0 && rJob.m_nCopies > 1 ) + { + rtl::OString aVal( rtl::OString::valueOf( sal_Int32( rJob.m_nCopies ) ) ); + rNumOptions = m_pCUPSWrapper->cupsAddOption( "copies", aVal.getStr(), rNumOptions, (cups_option_t**)rOptions ); + } } int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData ) diff --git a/vcl/unx/source/printer/jobdata.cxx b/vcl/unx/source/printer/jobdata.cxx index a1bca9441f77..019c1da1fbc9 100644 --- a/vcl/unx/source/printer/jobdata.cxx +++ b/vcl/unx/source/printer/jobdata.cxx @@ -51,6 +51,7 @@ JobData& JobData::operator=(const JobData& rRight) m_pParser = rRight.m_pParser; m_aContext = rRight.m_aContext; m_nPSLevel = rRight.m_nPSLevel; + m_nPDFDevice = rRight.m_nPDFDevice; m_nColorDevice = rRight.m_nColorDevice; if( ! m_pParser && m_aPrinterName.getLength() ) @@ -128,6 +129,10 @@ bool JobData::getStreamBuffer( void*& pData, int& bytes ) aLine += ByteString::CreateFromInt32( m_nPSLevel ); aStream.WriteLine( aLine ); + aLine = "pdfdevice="; + aLine += ByteString::CreateFromInt32( m_nPDFDevice ); + aStream.WriteLine( aLine ); + aLine = "colordevice="; aLine += ByteString::CreateFromInt32( m_nColorDevice ); aStream.WriteLine( aLine ); @@ -158,6 +163,7 @@ bool JobData::constructFromStreamBuffer( void* pData, int bytes, JobData& rJobDa bool bColorDepth = false; bool bColorDevice = false; bool bPSLevel = false; + bool bPDFDevice = false; while( ! aStream.IsEof() ) { aStream.ReadLine( aLine ); @@ -202,6 +208,11 @@ bool JobData::constructFromStreamBuffer( void* pData, int bytes, JobData& rJobDa bPSLevel = true; rJobData.m_nPSLevel = aLine.Copy( 8 ).ToInt32(); } + else if( aLine.CompareTo( "pdfdevice=", 10 ) == COMPARE_EQUAL ) + { + bPDFDevice = true; + rJobData.m_nPDFDevice = aLine.Copy( 10 ).ToInt32(); + } else if( aLine.Equals( "PPDContexData" ) ) { if( bPrinter ) @@ -222,5 +233,5 @@ bool JobData::constructFromStreamBuffer( void* pData, int bytes, JobData& rJobDa } } - return bVersion && bPrinter && bOrientation && bCopies && bContext && bMargin && bPSLevel && bColorDevice && bColorDepth; + return bVersion && bPrinter && bOrientation && bCopies && bContext && bMargin && bPSLevel && bPDFDevice && bColorDevice && bColorDepth; } diff --git a/vcl/unx/source/printer/printerinfomanager.cxx b/vcl/unx/source/printer/printerinfomanager.cxx index e1d499c40ca5..84997d11ac56 100644 --- a/vcl/unx/source/printer/printerinfomanager.cxx +++ b/vcl/unx/source/printer/printerinfomanager.cxx @@ -283,6 +283,10 @@ void PrinterInfoManager::initialize() if( aValue.Len() ) m_aGlobalDefaults.m_nPSLevel = aValue.ToInt32(); + aValue = aConfig.ReadKey( "PDFDevice" ); + if( aValue.Len() ) + m_aGlobalDefaults.m_nPDFDevice = aValue.ToInt32(); + aValue = aConfig.ReadKey( "PerformFontSubstitution" ); if( aValue.Len() ) { @@ -494,6 +498,10 @@ void PrinterInfoManager::initialize() if( aValue.Len() ) aPrinter.m_aInfo.m_nPSLevel = aValue.ToInt32(); + aValue = aConfig.ReadKey( "PDFDevice" ); + if( aValue.Len() ) + aPrinter.m_aInfo.m_nPDFDevice = aValue.ToInt32(); + aValue = aConfig.ReadKey( "PerformFontSubstitution" ); if( ! aValue.Equals( "0" ) && ! aValue.EqualsIgnoreCaseAscii( "false" ) ) aPrinter.m_aInfo.m_bPerformFontSubstitution = true; @@ -758,6 +766,7 @@ bool PrinterInfoManager::writePrinterConfig() pConfig->WriteKey( "Copies", ByteString::CreateFromInt32( it->second.m_aInfo.m_nCopies ) ); pConfig->WriteKey( "Orientation", it->second.m_aInfo.m_eOrientation == orientation::Landscape ? "Landscape" : "Portrait" ); pConfig->WriteKey( "PSLevel", ByteString::CreateFromInt32( it->second.m_aInfo.m_nPSLevel ) ); + pConfig->WriteKey( "PDFDevice", ByteString::CreateFromInt32( it->second.m_aInfo.m_nPDFDevice ) ); pConfig->WriteKey( "ColorDevice", ByteString::CreateFromInt32( it->second.m_aInfo.m_nColorDevice ) ); pConfig->WriteKey( "ColorDepth", ByteString::CreateFromInt32( it->second.m_aInfo.m_nColorDepth ) ); aValue = ByteString::CreateFromInt32( it->second.m_aInfo.m_nLeftMarginAdjust ); @@ -845,9 +854,10 @@ bool PrinterInfoManager::addPrinter( const OUString& rPrinterName, const OUStrin m_aPrinters[ rPrinterName ] = aPrinter; bSuccess = true; #if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "new printer %s, level = %d, colordevice = %d, depth = %d\n", + fprintf( stderr, "new printer %s, level = %d, pdfdevice = %d, colordevice = %d, depth = %d\n", OUStringToOString( rPrinterName, osl_getThreadTextEncoding() ).getStr(), m_aPrinters[rPrinterName].m_aInfo.m_nPSLevel, + m_aPrinters[rPrinterName].m_aInfo.m_nPDFDevice, m_aPrinters[rPrinterName].m_aInfo.m_nColorDevice, m_aPrinters[rPrinterName].m_aInfo.m_nColorDepth ); #endif diff --git a/vcl/unx/source/printergfx/printerjob.cxx b/vcl/unx/source/printergfx/printerjob.cxx index 5e18849b8dfe..c69a0771655d 100644 --- a/vcl/unx/source/printergfx/printerjob.cxx +++ b/vcl/unx/source/printergfx/printerjob.cxx @@ -341,7 +341,8 @@ PrinterJob::~PrinterJob () delete mpJobTrailer; // XXX should really call osl::remove routines - removeSpoolDir (maSpoolDirName); + if( maSpoolDirName.getLength() ) + removeSpoolDir (maSpoolDirName); // osl::Directory::remove (maSpoolDirName); } -- cgit From 90adc1368e7f158f9f2e9545f738027581dc4f18 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 18 Aug 2010 11:08:24 +0200 Subject: vcl115: #i113908# improve some border cases for recent file manager --- vcl/unx/gtk/app/gtkinst.cxx | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx index 68617c8c16be..9bd0e4c888b6 100644 --- a/vcl/unx/gtk/app/gtkinst.cxx +++ b/vcl/unx/gtk/app/gtkinst.cxx @@ -39,6 +39,8 @@ #include +#include + #if OSL_DEBUG_LEVEL > 1 #include #endif @@ -216,9 +218,25 @@ extern "C" void GtkInstance::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType) { + rtl::OString sGtkURL; + rtl_TextEncoding aSystemEnc = osl_getThreadTextEncoding(); + if ((aSystemEnc == RTL_TEXTENCODING_UTF8) || (rFileUrl.compareToAscii( "file://", 7 ) != 0)) + sGtkURL = rtl::OUStringToOString(rFileUrl, RTL_TEXTENCODING_UTF8); + else + { + //Non-utf8 locales are a bad idea if trying to work with non-ascii filenames + //Decode %XX components + rtl::OUString sDecodedUri = Uri::decode(rFileUrl.copy(7), rtl_UriDecodeToIuri, RTL_TEXTENCODING_UTF8); + //Convert back to system locale encoding + rtl::OString sSystemUrl = rtl::OUStringToOString(sDecodedUri, aSystemEnc); + //Encode to an escaped ASCII-encoded URI + gchar *g_uri = g_filename_to_uri(sSystemUrl.getStr(), NULL, NULL); + sGtkURL = rtl::OString(g_uri); + g_free(g_uri); + } #if GTK_CHECK_VERSION(2,10,0) GtkRecentManager *manager = gtk_recent_manager_get_default (); - gtk_recent_manager_add_item (manager, rtl::OUStringToOString(rFileUrl, RTL_TEXTENCODING_UTF8).getStr()); + gtk_recent_manager_add_item (manager, sGtkURL); (void)rMimeType; #else static getDefaultFnc sym_gtk_recent_manager_get_default = @@ -227,10 +245,7 @@ void GtkInstance::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const r static addItemFnc sym_gtk_recent_manager_add_item = (addItemFnc)osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gtk_recent_manager_add_item"); if (sym_gtk_recent_manager_get_default && sym_gtk_recent_manager_add_item) - { - sym_gtk_recent_manager_add_item(sym_gtk_recent_manager_get_default(), - rtl::OUStringToOString(rFileUrl, RTL_TEXTENCODING_UTF8).getStr()); - } + sym_gtk_recent_manager_add_item(sym_gtk_recent_manager_get_default(), sGtkURL); else X11SalInstance::AddToRecentDocumentList(rFileUrl, rMimeType); #endif -- cgit From 1e2a8e040e075d208c184743daaea79866d17e23 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 18 Aug 2010 13:37:53 +0200 Subject: pdfprint: #i94173# printer name --- vcl/unx/source/gdi/salprnpsp.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/source/gdi/salprnpsp.cxx b/vcl/unx/source/gdi/salprnpsp.cxx index b9e3cec07e00..cf38769b2b99 100644 --- a/vcl/unx/source/gdi/salprnpsp.cxx +++ b/vcl/unx/source/gdi/salprnpsp.cxx @@ -1237,7 +1237,7 @@ BOOL PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJobNam std::vector< char > buffer( 0x10000, 0 ); for( int nCurJob = 0; nCurJob < nJobs; nCurJob++ ) { - FILE* fp = PrinterInfoManager::get().startSpool( i_pSetupData->maPrinterName, i_rController.isDirectPrint() ); + FILE* fp = PrinterInfoManager::get().startSpool( pPrinter->GetName(), i_rController.isDirectPrint() ); if( fp ) { sal_uInt64 nBytesRead = 0; @@ -1247,7 +1247,7 @@ BOOL PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJobNam if( nBytesRead > 0 ) fwrite( &buffer[0], 1, nBytesRead, fp ); } while( nBytesRead == buffer.size() ); - PrinterInfoManager::get().endSpool( i_pSetupData->maPrinterName, i_rJobName, fp, m_aJobData ); + PrinterInfoManager::get().endSpool( pPrinter->GetName(), i_rJobName, fp, m_aJobData ); } } osl_closeFile( pFile ); -- cgit From 6f59f19bc89387609dfc09b126c46697792f4655 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 18 Aug 2010 13:50:09 +0200 Subject: pdfprint: additional debug traces --- vcl/unx/source/printer/cupsmgr.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'vcl/unx') diff --git a/vcl/unx/source/printer/cupsmgr.cxx b/vcl/unx/source/printer/cupsmgr.cxx index c4fcf433d349..96f74acf00ba 100644 --- a/vcl/unx/source/printer/cupsmgr.cxx +++ b/vcl/unx/source/printer/cupsmgr.cxx @@ -834,8 +834,15 @@ void CUPSManager::setupJobContextData( FILE* CUPSManager::startSpool( const OUString& rPrintername, bool bQuickCommand ) { + OSL_TRACE( "endSpool: %s, %s", + rtl::OUStringToOString( rPrintername, RTL_TEXTENCODING_UTF8 ).getStr(), + bQuickCommand ? "true" : "false" ); + if( m_aCUPSDestMap.find( rPrintername ) == m_aCUPSDestMap.end() ) + { + OSL_TRACE( "defer to PrinterInfoManager::startSpool" ); return PrinterInfoManager::startSpool( rPrintername, bQuickCommand ); + } #ifdef ENABLE_CUPS OUString aTmpURL, aTmpFile; @@ -898,6 +905,10 @@ void CUPSManager::getOptionsFromDocumentSetup( const JobData& rJob, int& rNumOpt int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData ) { + OSL_TRACE( "endSpool: %s, %s", + rtl::OUStringToOString( rPrintername, RTL_TEXTENCODING_UTF8 ).getStr(), + rtl::OUStringToOString( rJobTitle, RTL_TEXTENCODING_UTF8 ).getStr() ); + int nJobID = 0; osl::MutexGuard aGuard( m_aCUPSMutex ); @@ -905,7 +916,10 @@ int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTit std::hash_map< OUString, int, OUStringHash >::iterator dest_it = m_aCUPSDestMap.find( rPrintername ); if( dest_it == m_aCUPSDestMap.end() ) + { + OSL_TRACE( "defer to PrinterInfoManager::endSpool" ); return PrinterInfoManager::endSpool( rPrintername, rJobTitle, pFile, rDocumentJobData ); + } #ifdef ENABLE_CUPS std::hash_map< FILE*, OString, FPtrHash >::const_iterator it = m_aSpoolFiles.find( pFile ); -- cgit From 15b7dd1db09078beda2eed6e532e5930fa4044d1 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 20 Aug 2010 15:12:16 +0200 Subject: pdfprint: #i94173# handle multiple page formats, collation --- vcl/unx/source/gdi/salprnpsp.cxx | 186 +++++++++++++++++++------- vcl/unx/source/printer/cupsmgr.cxx | 18 ++- vcl/unx/source/printer/jobdata.cxx | 15 +++ vcl/unx/source/printer/printerinfomanager.cxx | 4 +- vcl/unx/source/printergfx/printerjob.cxx | 2 +- 5 files changed, 164 insertions(+), 61 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/source/gdi/salprnpsp.cxx b/vcl/unx/source/gdi/salprnpsp.cxx index cf38769b2b99..163877c0208c 100644 --- a/vcl/unx/source/gdi/salprnpsp.cxx +++ b/vcl/unx/source/gdi/salprnpsp.cxx @@ -1118,6 +1118,14 @@ ULONG PspSalPrinter::GetErrorCode() // ----------------------------------------------------------------------- +struct PDFPrintFile +{ + rtl::OUString maTmpURL; + Size maPageSize; + + PDFPrintFile( const rtl::OUString& i_rURL, const Size& i_rSize ) : maTmpURL( i_rURL ), maPageSize( i_rSize ) {} +}; + BOOL PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJobName, const String& i_rAppName, ImplJobSetup* i_pSetupData, vcl::PrinterController& i_rController ) { @@ -1134,7 +1142,6 @@ BOOL PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJobNam OSL_ASSERT( m_aJobData.m_nPDFDevice > 0 ); m_aJobData.m_nPDFDevice = 1; - // do we want a progress panel ? // possibly create one job for collated output sal_Bool bSinglePrintJobs = sal_False; beans::PropertyValue* pSingleValue = i_rController.getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintCollateAsSingleJobs" ) ) ); @@ -1143,62 +1150,43 @@ BOOL PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJobNam pSingleValue->Value >>= bSinglePrintJobs; } - m_aJobData.m_nCopies = i_rController.getPrinter()->GetCopyCount(); - int nJobs = 1; - if( bSinglePrintJobs ) - { - nJobs = m_aJobData.m_nCopies; - m_aJobData.m_nCopies = 1; - } + int nCopies = i_rController.getPrinter()->GetCopyCount(); + bool bCollate = i_rController.getPrinter()->IsCollateCopy(); // notify start of real print job i_rController.jobStarted(); - // produce PDF file - OUString aPDFUrl; - if( i_pFileName ) - aPDFUrl = *i_pFileName; - else - osl_createTempFile( NULL, NULL, &aPDFUrl.pData ); - if( aPDFUrl.compareToAscii( "file:", 5 ) != 0 ) - { - // this is not a file URL, but it should - // form it into a osl friendly file URL - rtl::OUString aTmp; - osl_getFileURLFromSystemPath( aPDFUrl.pData, &aTmp.pData ); - aPDFUrl = aTmp; - } - - // setup PDFWriter - + // setup PDFWriter context vcl::PDFWriter::PDFWriterContext aContext; - aContext.URL = aPDFUrl; aContext.Version = vcl::PDFWriter::PDF_1_4; aContext.Tagged = false; aContext.EmbedStandardFonts = true; aContext.Encrypt = false; aContext.DocumentLocale = Application::GetSettings().GetLocale(); + // prepare doc info vcl::PDFDocInfo aDocInfo; aDocInfo.Title = i_rJobName; aDocInfo.Creator = i_rAppName; aDocInfo.Producer = i_rAppName; - vcl::PDFWriter aPDFWriter( aContext ); - aPDFWriter.SetDocInfo( aDocInfo ); + // define how we handle metafiles in PDFWriter vcl::PDFWriter::PlayMetafileContext aMtfContext; aMtfContext.m_bOnlyLosslessCompression = true; + boost::shared_ptr pWriter; + std::vector< PDFPrintFile > aPDFFiles; boost::shared_ptr pPrinter( i_rController.getPrinter() ); int nAllPages = i_rController.getFilteredPageCount(); i_rController.createProgressDialog(); bool bAborted = false; + Size aLastPageSize(0,0); for( int nPage = 0; nPage < nAllPages && ! bAborted; nPage++ ) { if( nPage == nAllPages-1 ) i_rController.setLastPage( sal_True ); - // get the pages metafile + // get the page's metafile GDIMetaFile aPageFile; vcl::PrinterController::PageSize aPageSize = i_rController.getFilteredPageFile( nPage, aPageFile ); if( i_rController.isProgressCanceled() ) @@ -1216,50 +1204,144 @@ BOOL PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJobNam pPrinter->SetMapMode( MapMode( MAP_100TH_MM ) ); pPrinter->SetPaperSizeUser( aPageSize.aSize, true ); Size aRealSize( pPrinter->GetPaperSize() ); + Size aLSSize( aRealSize.Height(), aRealSize.Width() ); + + // create PDF writer on demand + // either on first page + // or on paper format change - cups does not support multiple paper formats per job (yet?) + // so we need to start a new job to get a new paper format from the printer + // orientation switches (that is switch of height and width) is handled transparently by CUPS + if( ! pWriter || + (aRealSize != aLastPageSize && aLSSize != aLastPageSize && ! i_pFileName ) ) + { + if( pWriter ) + { + pWriter->Emit(); + } + // produce PDF file + OUString aPDFUrl; + if( i_pFileName ) + aPDFUrl = *i_pFileName; + else + osl_createTempFile( NULL, NULL, &aPDFUrl.pData ); + // normalize to file URL + if( aPDFUrl.compareToAscii( "file:", 5 ) != 0 ) + { + // this is not a file URL, but it should + // form it into a osl friendly file URL + rtl::OUString aTmp; + osl_getFileURLFromSystemPath( aPDFUrl.pData, &aTmp.pData ); + aPDFUrl = aTmp; + } + // save current file and paper format + aLastPageSize = aRealSize; + aPDFFiles.push_back( PDFPrintFile( aPDFUrl, aRealSize ) ); + // update context + aContext.URL = aPDFUrl; + + // create and initialize PDFWriter + pWriter.reset( new vcl::PDFWriter( aContext ) ); + pWriter->SetDocInfo( aDocInfo ); + } - aPDFWriter.NewPage( TenMuToPt( aRealSize.Width() ), - TenMuToPt( aRealSize.Height() ), - vcl::PDFWriter::Portrait ); + pWriter->NewPage( TenMuToPt( aRealSize.Width() ), + TenMuToPt( aRealSize.Height() ), + vcl::PDFWriter::Portrait ); - aPDFWriter.PlayMetafile( aPageFile, aMtfContext, NULL ); + pWriter->PlayMetafile( aPageFile, aMtfContext, NULL ); } } - aPDFWriter.Emit(); + // emit the last file + if( pWriter ) + pWriter->Emit(); + // handle collate, copy count and multiple jobs correctly + int nOuterJobs = 1; + if( bSinglePrintJobs ) + { + nOuterJobs = nCopies; + m_aJobData.m_nCopies = 1; + } + else + { + if( bCollate ) + { + if( aPDFFiles.size() == 1 && pPrinter->HasSupport( SUPPORT_COLLATECOPY ) ) + { + m_aJobData.setCollate( true ); + m_aJobData.m_nCopies = nCopies; + } + else + { + nOuterJobs = nCopies; + m_aJobData.m_nCopies = 1; + } + } + else + { + m_aJobData.setCollate( false ); + m_aJobData.m_nCopies = nCopies; + } + } + + // spool files if( ! i_pFileName && ! bAborted ) { - oslFileHandle pFile = NULL; - osl_openFile( aContext.URL.pData, &pFile, osl_File_OpenFlag_Read ); - if( pFile ) + bool bFirstJob = true; + for( int nCurJob = 0; nCurJob < nOuterJobs; nCurJob++ ) { - osl_setFilePos( pFile, osl_Pos_Absolut, 0 ); - std::vector< char > buffer( 0x10000, 0 ); - for( int nCurJob = 0; nCurJob < nJobs; nCurJob++ ) + for( size_t i = 0; i < aPDFFiles.size(); i++ ) { - FILE* fp = PrinterInfoManager::get().startSpool( pPrinter->GetName(), i_rController.isDirectPrint() ); - if( fp ) + oslFileHandle pFile = NULL; + osl_openFile( aPDFFiles[i].maTmpURL.pData, &pFile, osl_File_OpenFlag_Read ); + if( pFile ) { - sal_uInt64 nBytesRead = 0; - do + osl_setFilePos( pFile, osl_Pos_Absolut, 0 ); + std::vector< char > buffer( 0x10000, 0 ); + // update job data with current page size + Size aPageSize( aPDFFiles[i].maPageSize ); + m_aJobData.setPaper( TenMuToPt( aPageSize.Width() ), TenMuToPt( aPageSize.Height() ) ); + + // spool current file + FILE* fp = PrinterInfoManager::get().startSpool( pPrinter->GetName(), i_rController.isDirectPrint() ); + if( fp ) { - osl_readFile( pFile, &buffer[0], buffer.size(), &nBytesRead ); - if( nBytesRead > 0 ) - fwrite( &buffer[0], 1, nBytesRead, fp ); - } while( nBytesRead == buffer.size() ); - PrinterInfoManager::get().endSpool( pPrinter->GetName(), i_rJobName, fp, m_aJobData ); + sal_uInt64 nBytesRead = 0; + do + { + osl_readFile( pFile, &buffer[0], buffer.size(), &nBytesRead ); + if( nBytesRead > 0 ) + fwrite( &buffer[0], 1, nBytesRead, fp ); + } while( nBytesRead == buffer.size() ); + rtl::OUStringBuffer aBuf( i_rJobName.Len() + 8 ); + aBuf.append( i_rJobName ); + if( i > 0 || nCurJob > 0 ) + { + aBuf.append( sal_Unicode(' ') ); + aBuf.append( sal_Int32( i + nCurJob * aPDFFiles.size() ) ); + } + PrinterInfoManager::get().endSpool( pPrinter->GetName(), aBuf.makeStringAndClear(), fp, m_aJobData, bFirstJob ); + bFirstJob = false; + } } + osl_closeFile( pFile ); } - osl_closeFile( pFile ); } } // job has been spooled i_rController.setJobState( bAborted ? view::PrintableState_JOB_ABORTED : view::PrintableState_JOB_SPOOLED ); - // clean up the PDF file + // clean up the temporary PDF files if( ! i_pFileName || bAborted ) - osl_removeFile( aPDFUrl.pData ); + { + for( size_t i = 0; i < aPDFFiles.size(); i++ ) + { + osl_removeFile( aPDFFiles[i].maTmpURL.pData ); + OSL_TRACE( "removed print PDF file %s\n", rtl::OUStringToOString( aPDFFiles[i].maTmpURL, RTL_TEXTENCODING_UTF8 ).getStr() ); + } + } return TRUE; } diff --git a/vcl/unx/source/printer/cupsmgr.cxx b/vcl/unx/source/printer/cupsmgr.cxx index 96f74acf00ba..caf3249b5f46 100644 --- a/vcl/unx/source/printer/cupsmgr.cxx +++ b/vcl/unx/source/printer/cupsmgr.cxx @@ -865,7 +865,7 @@ struct less_ppd_key : public ::std::binary_function { return left->getOrderDependency() < right->getOrderDependency(); } }; -void CUPSManager::getOptionsFromDocumentSetup( const JobData& rJob, int& rNumOptions, void** rOptions ) const +void CUPSManager::getOptionsFromDocumentSetup( const JobData& rJob, bool bBanner, int& rNumOptions, void** rOptions ) const { rNumOptions = 0; *rOptions = NULL; @@ -901,13 +901,19 @@ void CUPSManager::getOptionsFromDocumentSetup( const JobData& rJob, int& rNumOpt rtl::OString aVal( rtl::OString::valueOf( sal_Int32( rJob.m_nCopies ) ) ); rNumOptions = m_pCUPSWrapper->cupsAddOption( "copies", aVal.getStr(), rNumOptions, (cups_option_t**)rOptions ); } + if( ! bBanner ) + { + rNumOptions = m_pCUPSWrapper->cupsAddOption( "job-sheets", "none", rNumOptions, (cups_option_t**)rOptions ); + } } -int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData ) +int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner ) { - OSL_TRACE( "endSpool: %s, %s", + OSL_TRACE( "endSpool: %s, %s, copy count = %d", rtl::OUStringToOString( rPrintername, RTL_TEXTENCODING_UTF8 ).getStr(), - rtl::OUStringToOString( rJobTitle, RTL_TEXTENCODING_UTF8 ).getStr() ); + rtl::OUStringToOString( rJobTitle, RTL_TEXTENCODING_UTF8 ).getStr(), + rDocumentJobData.m_nCopies + ); int nJobID = 0; @@ -918,7 +924,7 @@ int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTit if( dest_it == m_aCUPSDestMap.end() ) { OSL_TRACE( "defer to PrinterInfoManager::endSpool" ); - return PrinterInfoManager::endSpool( rPrintername, rJobTitle, pFile, rDocumentJobData ); + return PrinterInfoManager::endSpool( rPrintername, rJobTitle, pFile, rDocumentJobData, bBanner ); } #ifdef ENABLE_CUPS @@ -931,7 +937,7 @@ int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTit // setup cups options int nNumOptions = 0; cups_option_t* pOptions = NULL; - getOptionsFromDocumentSetup( rDocumentJobData, nNumOptions, (void**)&pOptions ); + getOptionsFromDocumentSetup( rDocumentJobData, bBanner, nNumOptions, (void**)&pOptions ); cups_dest_t* pDest = ((cups_dest_t*)m_pDests) + dest_it->second; nJobID = m_pCUPSWrapper->cupsPrintFile( pDest->name, diff --git a/vcl/unx/source/printer/jobdata.cxx b/vcl/unx/source/printer/jobdata.cxx index 019c1da1fbc9..7839b90ce485 100644 --- a/vcl/unx/source/printer/jobdata.cxx +++ b/vcl/unx/source/printer/jobdata.cxx @@ -84,6 +84,21 @@ void JobData::setCollate( bool bCollate ) } } +bool JobData::setPaper( int i_nWidth, int i_nHeight ) +{ + bool bSuccess = false; + if( m_pParser ) + { + rtl::OUString aPaper( m_pParser->matchPaper( i_nWidth, i_nHeight ) ); + + const PPDKey* pKey = m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) ); + const PPDValue* pValue = pKey ? pKey->getValueCaseInsensitive( aPaper ) : NULL; + + bSuccess = pKey && pValue && m_aContext.setValue( pKey, pValue, false ); + } + return bSuccess; +} + bool JobData::getStreamBuffer( void*& pData, int& bytes ) { // consistency checks diff --git a/vcl/unx/source/printer/printerinfomanager.cxx b/vcl/unx/source/printer/printerinfomanager.cxx index 84997d11ac56..1e5ab8fd7007 100644 --- a/vcl/unx/source/printer/printerinfomanager.cxx +++ b/vcl/unx/source/printer/printerinfomanager.cxx @@ -328,7 +328,7 @@ void PrinterInfoManager::initialize() } } #if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "global settings: fontsubst = %s, %d substitutes\n", m_aGlobalDefaults.m_bPerformFontSubstitution ? "true" : "false", m_aGlobalDefaults.m_aFontSubstitutes.size() ); + fprintf( stderr, "global settings: fontsubst = %s, %d substitutes\n", m_aGlobalDefaults.m_bPerformFontSubstitution ? "true" : "false", (int)m_aGlobalDefaults.m_aFontSubstitutes.size() ); #endif } } @@ -1105,7 +1105,7 @@ FILE* PrinterInfoManager::startSpool( const OUString& rPrintername, bool bQuickC return popen (aShellCommand.getStr(), "w"); } -int PrinterInfoManager::endSpool( const OUString& /*rPrintername*/, const OUString& /*rJobTitle*/, FILE* pFile, const JobData& /*rDocumentJobData*/ ) +int PrinterInfoManager::endSpool( const OUString& /*rPrintername*/, const OUString& /*rJobTitle*/, FILE* pFile, const JobData& /*rDocumentJobData*/, bool /*bBanner*/ ) { return (0 == pclose( pFile )); } diff --git a/vcl/unx/source/printergfx/printerjob.cxx b/vcl/unx/source/printergfx/printerjob.cxx index c69a0771655d..26a1d75f68c2 100644 --- a/vcl/unx/source/printergfx/printerjob.cxx +++ b/vcl/unx/source/printergfx/printerjob.cxx @@ -611,7 +611,7 @@ PrinterJob::EndJob () { PrinterInfoManager& rPrinterInfoManager = PrinterInfoManager::get(); if (0 == rPrinterInfoManager.endSpool( m_aLastJobData.m_aPrinterName, - maJobTitle, pDestFILE, m_aDocumentJobData )) + maJobTitle, pDestFILE, m_aDocumentJobData, true )) { bSuccess = sal_False; } -- cgit From 123175d154c725a8238a408abce8d6491ed7df1c Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Mon, 23 Aug 2010 19:27:56 +0200 Subject: mib19: #163018# adjust other platforms --- vcl/unx/inc/salobj.h | 1 + vcl/unx/source/window/salobj.cxx | 7 +++++++ 2 files changed, 8 insertions(+) (limited to 'vcl/unx') diff --git a/vcl/unx/inc/salobj.h b/vcl/unx/inc/salobj.h index fa9f1309c8ca..d7d9334f281b 100644 --- a/vcl/unx/inc/salobj.h +++ b/vcl/unx/inc/salobj.h @@ -98,6 +98,7 @@ public: virtual const SystemEnvData* GetSystemData() const; + virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept ); }; #endif // _SV_SALOBJ_H diff --git a/vcl/unx/source/window/salobj.cxx b/vcl/unx/source/window/salobj.cxx index 647b95ae032c..2ff6d05c35c6 100644 --- a/vcl/unx/source/window/salobj.cxx +++ b/vcl/unx/source/window/salobj.cxx @@ -559,3 +559,10 @@ long X11SalObject::Dispatch( XEvent* pEvent ) } return 0; } + +// ----------------------------------------------------------------------- + +void X11SalObject::InterceptChildWindowKeyDown( sal_Bool /*bIntercept*/ ) +{ +} + -- cgit From 3036c496a1f303386d9d7eebe4317ea6c7d3cf0c Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Tue, 31 Aug 2010 11:29:02 +0200 Subject: mib19: missing implementations of abstract function --- vcl/unx/gtk/window/gtkobject.cxx | 5 +++++ vcl/unx/headless/svpdummies.cxx | 1 + vcl/unx/headless/svpdummies.hxx | 2 ++ vcl/unx/inc/plugins/gtk/gtkobject.hxx | 1 + 4 files changed, 9 insertions(+) (limited to 'vcl/unx') diff --git a/vcl/unx/gtk/window/gtkobject.cxx b/vcl/unx/gtk/window/gtkobject.cxx index 2a2bbe78078a..c5f5a168f653 100644 --- a/vcl/unx/gtk/window/gtkobject.cxx +++ b/vcl/unx/gtk/window/gtkobject.cxx @@ -209,3 +209,8 @@ void GtkSalObject::signalDestroy( GtkObject* pObj, gpointer object ) pThis->m_pSocket = NULL; } } + +void GtkSalObject::InterceptChildWindowKeyDown( sal_Bool /*bIntercept*/ ) +{ +} + diff --git a/vcl/unx/headless/svpdummies.cxx b/vcl/unx/headless/svpdummies.cxx index 5983ff18c34f..0a67b147804a 100644 --- a/vcl/unx/headless/svpdummies.cxx +++ b/vcl/unx/headless/svpdummies.cxx @@ -61,6 +61,7 @@ void SvpSalObject::GrabFocus() {} void SvpSalObject::SetBackground() {} void SvpSalObject::SetBackground( SalColor ) {} const SystemEnvData* SvpSalObject::GetSystemData() const { return &m_aSystemChildData; } +void SvpSalObject::InterceptChildWindowKeyDown( sal_Bool ) {} // SalI18NImeStatus SvpImeStatus::~SvpImeStatus() {} diff --git a/vcl/unx/headless/svpdummies.hxx b/vcl/unx/headless/svpdummies.hxx index febf7eef6bbe..ea7667ce51ca 100644 --- a/vcl/unx/headless/svpdummies.hxx +++ b/vcl/unx/headless/svpdummies.hxx @@ -58,6 +58,8 @@ public: virtual void SetBackground( SalColor nSalColor ); virtual const SystemEnvData* GetSystemData() const; + + virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept ); }; class SvpImeStatus : public SalI18NImeStatus diff --git a/vcl/unx/inc/plugins/gtk/gtkobject.hxx b/vcl/unx/inc/plugins/gtk/gtkobject.hxx index ea740249f1c6..9d3f235b8894 100644 --- a/vcl/unx/inc/plugins/gtk/gtkobject.hxx +++ b/vcl/unx/inc/plugins/gtk/gtkobject.hxx @@ -64,6 +64,7 @@ public: virtual const SystemEnvData* GetSystemData() const; + virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept ); }; #endif // _SV_SALOBJ_H -- cgit From 5ab470fa157f54d14bd6134739486c7f6b2cc8af Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 1 Sep 2010 17:27:18 +0200 Subject: pdfprint: #i94173# start new job if input slot changes --- vcl/unx/source/gdi/salgdi.cxx | 4 ++-- vcl/unx/source/gdi/salprnpsp.cxx | 49 +++++++++++++++++++++++++++++--------- vcl/unx/source/printer/jobdata.cxx | 13 ++++++++++ 3 files changed, 53 insertions(+), 13 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx index ae21c3aa9f7b..e13c56fbcf25 100644 --- a/vcl/unx/source/gdi/salgdi.cxx +++ b/vcl/unx/source/gdi/salgdi.cxx @@ -1127,7 +1127,7 @@ bool X11SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rOrigPoly basegfx::B2DTrapezoidVector aB2DTrapVector; basegfx::tools::trapezoidSubdivide( aB2DTrapVector, aPolyPoly ); const int nTrapCount = aB2DTrapVector.size(); - const bool bDrawn = drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, fTransparency ); + const bool bDrawn = nTrapCount == 0 || drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, fTransparency ); return bDrawn; } @@ -1239,7 +1239,7 @@ bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, double // draw tesselation result const int nTrapCount = aB2DTrapVector.size(); - const bool bDrawOk = drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, fTransparency ); + const bool bDrawOk = nTrapCount == 0 || drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, fTransparency ); // restore the original brush GC nBrushColor_ = aKeepBrushColor; diff --git a/vcl/unx/source/gdi/salprnpsp.cxx b/vcl/unx/source/gdi/salprnpsp.cxx index 163877c0208c..0c63afcf6a53 100644 --- a/vcl/unx/source/gdi/salprnpsp.cxx +++ b/vcl/unx/source/gdi/salprnpsp.cxx @@ -1118,12 +1118,38 @@ ULONG PspSalPrinter::GetErrorCode() // ----------------------------------------------------------------------- +struct PDFNewJobParameters +{ + Size maPageSize; + USHORT mnPaperBin; + + PDFNewJobParameters( const Size& i_rSize = Size(), + USHORT i_nPaperBin = 0xffff ) + : maPageSize( i_rSize ), mnPaperBin( i_nPaperBin ) {} + + bool operator!=(const PDFNewJobParameters& rComp ) const + { + Size aCompLSSize( rComp.maPageSize.Height(), rComp.maPageSize.Width() ); + return + (maPageSize != rComp.maPageSize && maPageSize != aCompLSSize) + || mnPaperBin != rComp.mnPaperBin + ; + } + + bool operator==(const PDFNewJobParameters& rComp) const + { + return ! this->operator!=(rComp); + } +}; + struct PDFPrintFile { rtl::OUString maTmpURL; - Size maPageSize; + PDFNewJobParameters maParameters; - PDFPrintFile( const rtl::OUString& i_rURL, const Size& i_rSize ) : maTmpURL( i_rURL ), maPageSize( i_rSize ) {} + PDFPrintFile( const rtl::OUString& i_rURL, const PDFNewJobParameters& i_rNewParameters ) + : maTmpURL( i_rURL ) + , maParameters( i_rNewParameters ) {} }; BOOL PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJobName, const String& i_rAppName, @@ -1180,7 +1206,7 @@ BOOL PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJobNam int nAllPages = i_rController.getFilteredPageCount(); i_rController.createProgressDialog(); bool bAborted = false; - Size aLastPageSize(0,0); + PDFNewJobParameters aLastParm; for( int nPage = 0; nPage < nAllPages && ! bAborted; nPage++ ) { if( nPage == nAllPages-1 ) @@ -1203,8 +1229,7 @@ BOOL PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJobNam { pPrinter->SetMapMode( MapMode( MAP_100TH_MM ) ); pPrinter->SetPaperSizeUser( aPageSize.aSize, true ); - Size aRealSize( pPrinter->GetPaperSize() ); - Size aLSSize( aRealSize.Height(), aRealSize.Width() ); + PDFNewJobParameters aNewParm( pPrinter->GetPaperSize(), pPrinter->GetPaperBin() ); // create PDF writer on demand // either on first page @@ -1212,7 +1237,7 @@ BOOL PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJobNam // so we need to start a new job to get a new paper format from the printer // orientation switches (that is switch of height and width) is handled transparently by CUPS if( ! pWriter || - (aRealSize != aLastPageSize && aLSSize != aLastPageSize && ! i_pFileName ) ) + (aNewParm != aLastParm && ! i_pFileName ) ) { if( pWriter ) { @@ -1234,8 +1259,8 @@ BOOL PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJobNam aPDFUrl = aTmp; } // save current file and paper format - aLastPageSize = aRealSize; - aPDFFiles.push_back( PDFPrintFile( aPDFUrl, aRealSize ) ); + aLastParm = aNewParm; + aPDFFiles.push_back( PDFPrintFile( aPDFUrl, aNewParm ) ); // update context aContext.URL = aPDFUrl; @@ -1244,8 +1269,8 @@ BOOL PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJobNam pWriter->SetDocInfo( aDocInfo ); } - pWriter->NewPage( TenMuToPt( aRealSize.Width() ), - TenMuToPt( aRealSize.Height() ), + pWriter->NewPage( TenMuToPt( aNewParm.maPageSize.Width() ), + TenMuToPt( aNewParm.maPageSize.Height() ), vcl::PDFWriter::Portrait ); pWriter->PlayMetafile( aPageFile, aMtfContext, NULL ); @@ -1300,8 +1325,10 @@ BOOL PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJobNam osl_setFilePos( pFile, osl_Pos_Absolut, 0 ); std::vector< char > buffer( 0x10000, 0 ); // update job data with current page size - Size aPageSize( aPDFFiles[i].maPageSize ); + Size aPageSize( aPDFFiles[i].maParameters.maPageSize ); m_aJobData.setPaper( TenMuToPt( aPageSize.Width() ), TenMuToPt( aPageSize.Height() ) ); + // update job data with current paperbin + m_aJobData.setPaperBin( aPDFFiles[i].maParameters.mnPaperBin ); // spool current file FILE* fp = PrinterInfoManager::get().startSpool( pPrinter->GetName(), i_rController.isDirectPrint() ); diff --git a/vcl/unx/source/printer/jobdata.cxx b/vcl/unx/source/printer/jobdata.cxx index 7839b90ce485..d4211eae31df 100644 --- a/vcl/unx/source/printer/jobdata.cxx +++ b/vcl/unx/source/printer/jobdata.cxx @@ -99,6 +99,19 @@ bool JobData::setPaper( int i_nWidth, int i_nHeight ) return bSuccess; } +bool JobData::setPaperBin( int i_nPaperBin ) +{ + bool bSuccess = false; + if( m_pParser ) + { + const PPDKey* pKey = m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "InputSlot" ) ) ); + const PPDValue* pValue = pKey ? pKey->getValue( i_nPaperBin ) : NULL; + + bSuccess = pKey && pValue && m_aContext.setValue( pKey, pValue, false ); + } + return bSuccess; +} + bool JobData::getStreamBuffer( void*& pData, int& bytes ) { // consistency checks -- cgit From cd34f6befb38f8685cbe03c127c037863b9d9a4b Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 1 Sep 2010 18:07:30 +0200 Subject: workaround a compiler warning with boost::shared_ptr --- vcl/unx/source/gdi/salprnpsp.cxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'vcl/unx') diff --git a/vcl/unx/source/gdi/salprnpsp.cxx b/vcl/unx/source/gdi/salprnpsp.cxx index 0c63afcf6a53..a7c2962a2154 100644 --- a/vcl/unx/source/gdi/salprnpsp.cxx +++ b/vcl/unx/source/gdi/salprnpsp.cxx @@ -1265,7 +1265,13 @@ BOOL PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJobNam aContext.URL = aPDFUrl; // create and initialize PDFWriter + #if defined __SUNPRO_CC + #pragma disable_warn + #endif pWriter.reset( new vcl::PDFWriter( aContext ) ); + #if defined __SUNPRO_CC + #pragma enable_warn + #endif pWriter->SetDocInfo( aDocInfo ); } -- cgit From 34c6b390e191e8aca888ccc52351fc469f59b663 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Wed, 15 Sep 2010 12:01:51 +0200 Subject: #i113861# shared ImplFontCharMap objects better be constant --- vcl/unx/headless/svpgdi.hxx | 2 +- vcl/unx/headless/svppspgraphics.cxx | 4 ++-- vcl/unx/headless/svppspgraphics.hxx | 2 +- vcl/unx/headless/svptext.cxx | 4 ++-- vcl/unx/inc/pspgraphics.h | 2 +- vcl/unx/inc/salgdi.h | 2 +- vcl/unx/source/gdi/pspgraphics.cxx | 4 ++-- vcl/unx/source/gdi/salgdi3.cxx | 4 ++-- 8 files changed, 12 insertions(+), 12 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/headless/svpgdi.hxx b/vcl/unx/headless/svpgdi.hxx index 1ad9eca9d272..93ec080d0136 100644 --- a/vcl/unx/headless/svpgdi.hxx +++ b/vcl/unx/headless/svpgdi.hxx @@ -88,7 +88,7 @@ public: virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel ); virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs ); - virtual ImplFontCharMap* GetImplFontCharMap() const; + virtual const ImplFontCharMap* GetImplFontCharMap() const; virtual void GetDevFontList( ImplDevFontList* ); virtual void GetDevFontSubstList( OutputDevice* ); virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName ); diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx index ccced8701f83..c7b1f4f41fca 100644 --- a/vcl/unx/headless/svppspgraphics.cxx +++ b/vcl/unx/headless/svppspgraphics.cxx @@ -683,12 +683,12 @@ void PspGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout ) DrawPrinterLayout( rLayout, *m_pPrinterGfx, true ); } -ImplFontCharMap* PspGraphics::GetImplFontCharMap() const +const ImplFontCharMap* PspGraphics::GetImplFontCharMap() const { if( !m_pServerFont[0] ) return NULL; - ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap(); + const ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap(); return pIFCMap; } diff --git a/vcl/unx/headless/svppspgraphics.hxx b/vcl/unx/headless/svppspgraphics.hxx index 987923eb40ff..138198239621 100644 --- a/vcl/unx/headless/svppspgraphics.hxx +++ b/vcl/unx/headless/svppspgraphics.hxx @@ -107,7 +107,7 @@ public: virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel ); virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs ); - virtual ImplFontCharMap* GetImplFontCharMap() const; + virtual const ImplFontCharMap* GetImplFontCharMap() const; virtual void GetDevFontList( ImplDevFontList* ); virtual void GetDevFontSubstList( OutputDevice* ); virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName ); diff --git a/vcl/unx/headless/svptext.cxx b/vcl/unx/headless/svptext.cxx index df3625e82643..dff1fd4d6ca7 100644 --- a/vcl/unx/headless/svptext.cxx +++ b/vcl/unx/headless/svptext.cxx @@ -272,12 +272,12 @@ ULONG SvpSalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs ) // --------------------------------------------------------------------------- -ImplFontCharMap* SvpSalGraphics::GetImplFontCharMap() const +const ImplFontCharMap* SvpSalGraphics::GetImplFontCharMap() const { if( !m_pServerFont[0] ) return NULL; - ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap(); + const ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap(); return pIFCMap; } diff --git a/vcl/unx/inc/pspgraphics.h b/vcl/unx/inc/pspgraphics.h index a91029e34580..d4f5a9f156e0 100644 --- a/vcl/unx/inc/pspgraphics.h +++ b/vcl/unx/inc/pspgraphics.h @@ -104,7 +104,7 @@ public: virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel ); virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); virtual ULONG GetKernPairs( ULONG nMaxPairs, ImplKernPairData* ); - virtual ImplFontCharMap* GetImplFontCharMap() const; + virtual const ImplFontCharMap* GetImplFontCharMap() const; virtual void GetDevFontList( ImplDevFontList* ); virtual void GetDevFontSubstList( OutputDevice* ); virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName ); diff --git a/vcl/unx/inc/salgdi.h b/vcl/unx/inc/salgdi.h index 33e6be054d48..b5fdce50eee9 100644 --- a/vcl/unx/inc/salgdi.h +++ b/vcl/unx/inc/salgdi.h @@ -255,7 +255,7 @@ public: virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel ); virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); virtual ULONG GetKernPairs( ULONG nMaxPairs, ImplKernPairData* ); - virtual ImplFontCharMap* GetImplFontCharMap() const; + virtual const ImplFontCharMap* GetImplFontCharMap() const; virtual void GetDevFontList( ImplDevFontList* ); virtual void GetDevFontSubstList( OutputDevice* ); virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName ); diff --git a/vcl/unx/source/gdi/pspgraphics.cxx b/vcl/unx/source/gdi/pspgraphics.cxx index 3f73d1021bb8..082780cee510 100644 --- a/vcl/unx/source/gdi/pspgraphics.cxx +++ b/vcl/unx/source/gdi/pspgraphics.cxx @@ -770,12 +770,12 @@ void PspGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout ) DrawPrinterLayout( rLayout, *m_pPrinterGfx, true ); } -ImplFontCharMap* PspGraphics::GetImplFontCharMap() const +const ImplFontCharMap* PspGraphics::GetImplFontCharMap() const { if( !m_pServerFont[0] ) return NULL; - ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap(); + const ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap(); return pIFCMap; } diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx index 7e605dbee981..62e575ebc5ef 100644 --- a/vcl/unx/source/gdi/salgdi3.cxx +++ b/vcl/unx/source/gdi/salgdi3.cxx @@ -1494,12 +1494,12 @@ void X11SalGraphics::DrawStringUCS2MB( ExtendedFontStruct& rFont, //-------------------------------------------------------------------------- -ImplFontCharMap* X11SalGraphics::GetImplFontCharMap() const +const ImplFontCharMap* X11SalGraphics::GetImplFontCharMap() const { if( !mpServerFont[0] ) return NULL; - ImplFontCharMap* pIFCMap = mpServerFont[0]->GetImplFontCharMap(); + const ImplFontCharMap* pIFCMap = mpServerFont[0]->GetImplFontCharMap(); return pIFCMap; } -- cgit From 52c74840c9bdd4809f61d15a82150408966676ea Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 23 Sep 2010 18:22:24 +0200 Subject: vcl115: #i114702# fix an off by one (thanks cmc!) --- vcl/unx/source/fontmanager/fontcache.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/source/fontmanager/fontcache.cxx b/vcl/unx/source/fontmanager/fontcache.cxx index db4a7d05e5fc..0c43373bfa8e 100644 --- a/vcl/unx/source/fontmanager/fontcache.cxx +++ b/vcl/unx/source/fontmanager/fontcache.cxx @@ -373,9 +373,9 @@ void FontCache::read() xub_StrLen nLastIndex = nIndex+1; for( nIndex = nLastIndex ; nIndex < nLen && pLine[nIndex] != ';'; nIndex++ ) ; - if( nIndex - nLastIndex > 1 ) + if( nIndex - nLastIndex ) { - OUString aAlias( pLine+nLastIndex, nIndex-nLastIndex-1, RTL_TEXTENCODING_UTF8 ); + OUString aAlias( pLine+nLastIndex, nIndex-nLastIndex, RTL_TEXTENCODING_UTF8 ); pFont->m_aAliases.push_back( pAtoms->getAtom( ATOM_FAMILYNAME, aAlias, sal_True ) ); } } -- cgit From 585906551012bb231308bcc26a290b4c99651dbe Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Fri, 24 Sep 2010 14:08:30 +0200 Subject: #i114703# better selection of localized fontnames (thanks cmc) --- vcl/unx/source/fontmanager/fontconfig.cxx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/source/fontmanager/fontconfig.cxx b/vcl/unx/source/fontmanager/fontconfig.cxx index 2ff4298b7658..01e183a68dce 100644 --- a/vcl/unx/source/fontmanager/fontconfig.cxx +++ b/vcl/unx/source/fontmanager/fontconfig.cxx @@ -544,22 +544,29 @@ namespace std::vector::const_iterator aEnd = families.end(); bool alreadyclosematch = false; - for (std::vector::const_iterator aIter = families.begin(); aIter != aEnd; ++aIter) + for( std::vector::const_iterator aIter = families.begin(); aIter != aEnd; ++aIter ) { const char *pLang = (const char*)aIter->first; - //perfect - if( rtl_str_compare(pLang,sFullMatch.getStr() ) == 0) + if( rtl_str_compare( pLang, sFullMatch.getStr() ) == 0) { + // both language and country match candidate = aIter->second; break; } - else if( (rtl_str_compare(pLang,sLangMatch.getStr()) == 0) && (!alreadyclosematch)) + else if( alreadyclosematch ) + continue; + else if( rtl_str_compare( pLang, sLangMatch.getStr()) == 0) { + // just the language matches candidate = aIter->second; alreadyclosematch = true; } + else if( rtl_str_compare( pLang, "en") == 0) + { + // fallback to the english family name + candidate = aIter->second; + } } - return candidate; } } -- cgit From b42596ac9af6a3c7b33c8ad67acd94fab33fe4da Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Tue, 28 Sep 2010 17:06:57 +0200 Subject: fwk149: #i114668# check whether the directory can be opened --- vcl/unx/source/printer/ppdparser.cxx | 62 +++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 30 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/source/printer/ppdparser.cxx b/vcl/unx/source/printer/ppdparser.cxx index b2549573d099..587e58be5bc7 100644 --- a/vcl/unx/source/printer/ppdparser.cxx +++ b/vcl/unx/source/printer/ppdparser.cxx @@ -405,51 +405,53 @@ void PPDParser::scanPPDDir( const String& rDir ) const int nSuffixes = sizeof(pSuffixes)/sizeof(pSuffixes[0]); osl::Directory aDir( rDir ); - aDir.open(); - osl::DirectoryItem aItem; - - INetURLObject aPPDDir(rDir); - while( aDir.getNextItem( aItem ) == osl::FileBase::E_None ) + if ( aDir.open() == osl::FileBase::E_None ) { - osl::FileStatus aStatus( FileStatusMask_FileName ); - if( aItem.getFileStatus( aStatus ) == osl::FileBase::E_None ) + osl::DirectoryItem aItem; + + INetURLObject aPPDDir(rDir); + while( aDir.getNextItem( aItem ) == osl::FileBase::E_None ) { - rtl::OUStringBuffer aURLBuf( rDir.Len() + 64 ); - aURLBuf.append( rDir ); - aURLBuf.append( sal_Unicode( '/' ) ); - aURLBuf.append( aStatus.getFileName() ); + osl::FileStatus aStatus( FileStatusMask_FileName ); + if( aItem.getFileStatus( aStatus ) == osl::FileBase::E_None ) + { + rtl::OUStringBuffer aURLBuf( rDir.Len() + 64 ); + aURLBuf.append( rDir ); + aURLBuf.append( sal_Unicode( '/' ) ); + aURLBuf.append( aStatus.getFileName() ); - rtl::OUString aFileURL, aFileName; - osl::FileStatus::Type eType = osl::FileStatus::Unknown; + rtl::OUString aFileURL, aFileName; + osl::FileStatus::Type eType = osl::FileStatus::Unknown; - if( resolveLink( aURLBuf.makeStringAndClear(), aFileURL, aFileName, eType ) == osl::FileBase::E_None ) - { - if( eType == osl::FileStatus::Regular ) + if( resolveLink( aURLBuf.makeStringAndClear(), aFileURL, aFileName, eType ) == osl::FileBase::E_None ) { - INetURLObject aPPDFile = aPPDDir; - aPPDFile.Append( aFileName ); - - // match extension - for( int nSuffix = 0; nSuffix < nSuffixes; nSuffix++ ) + if( eType == osl::FileStatus::Regular ) { - if( aFileName.getLength() > pSuffixes[nSuffix].nSuffixLen ) + INetURLObject aPPDFile = aPPDDir; + aPPDFile.Append( aFileName ); + + // match extension + for( int nSuffix = 0; nSuffix < nSuffixes; nSuffix++ ) { - if( aFileName.endsWithIgnoreAsciiCaseAsciiL( pSuffixes[nSuffix].pSuffix, pSuffixes[nSuffix].nSuffixLen ) ) + if( aFileName.getLength() > pSuffixes[nSuffix].nSuffixLen ) { - (*pAllPPDFiles)[ aFileName.copy( 0, aFileName.getLength() - pSuffixes[nSuffix].nSuffixLen ) ] = aPPDFile.PathToFileName(); - break; + if( aFileName.endsWithIgnoreAsciiCaseAsciiL( pSuffixes[nSuffix].pSuffix, pSuffixes[nSuffix].nSuffixLen ) ) + { + (*pAllPPDFiles)[ aFileName.copy( 0, aFileName.getLength() - pSuffixes[nSuffix].nSuffixLen ) ] = aPPDFile.PathToFileName(); + break; + } } } } - } - else if( eType == osl::FileStatus::Directory ) - { - scanPPDDir( aFileURL ); + else if( eType == osl::FileStatus::Directory ) + { + scanPPDDir( aFileURL ); + } } } } + aDir.close(); } - aDir.close(); } void PPDParser::initPPDFiles() -- cgit From 039c16253801f3d2e3d446765863f406d633a6c9 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 30 Sep 2010 14:28:10 +0200 Subject: pdfprint: #i94173# handle MAP_PIXEL appropriately on printer --- vcl/unx/source/gdi/salprnpsp.cxx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'vcl/unx') diff --git a/vcl/unx/source/gdi/salprnpsp.cxx b/vcl/unx/source/gdi/salprnpsp.cxx index a7c2962a2154..417704eb3b69 100644 --- a/vcl/unx/source/gdi/salprnpsp.cxx +++ b/vcl/unx/source/gdi/salprnpsp.cxx @@ -1207,6 +1207,9 @@ BOOL PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJobNam i_rController.createProgressDialog(); bool bAborted = false; PDFNewJobParameters aLastParm; + + aContext.DPIx = pPrinter->ImplGetDPIX(); + aContext.DPIy = pPrinter->ImplGetDPIY(); for( int nPage = 0; nPage < nAllPages && ! bAborted; nPage++ ) { if( nPage == nAllPages-1 ) -- cgit From 6b2736fed5bb3c5e7949be2baa4a50c9a9c9b3e2 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 8 Oct 2010 11:48:35 +0200 Subject: vcl116: #i114958# implement DBG_TESTSOALRMUTEX on all platforms --- vcl/unx/headless/svpinst.cxx | 13 +++++++++++++ vcl/unx/headless/svpinst.hxx | 1 + vcl/unx/inc/salinst.h | 1 + vcl/unx/source/app/salinst.cxx | 18 ++++++++++++++++++ 4 files changed, 33 insertions(+) (limited to 'vcl/unx') diff --git a/vcl/unx/headless/svpinst.cxx b/vcl/unx/headless/svpinst.cxx index 5c3be54f9ddc..5f94a7ebf375 100644 --- a/vcl/unx/headless/svpinst.cxx +++ b/vcl/unx/headless/svpinst.cxx @@ -327,6 +327,19 @@ void SvpSalInstance::AcquireYieldMutex( ULONG nCount ) } } +bool SvpSalInstance::CheckYieldMutex() +{ + bool bRet = true; + + if ( m_aYieldMutex.GetThreadId() != + vos::OThread::getCurrentIdentifier() ) + { + bRet = false; + } + + return bRet; +} + void SvpSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents ) { // first, check for already queued events. diff --git a/vcl/unx/headless/svpinst.hxx b/vcl/unx/headless/svpinst.hxx index d931a2735ff9..bf323e6e0317 100644 --- a/vcl/unx/headless/svpinst.hxx +++ b/vcl/unx/headless/svpinst.hxx @@ -176,6 +176,7 @@ public: virtual vos::IMutex* GetYieldMutex(); virtual ULONG ReleaseYieldMutex(); virtual void AcquireYieldMutex( ULONG nCount ); + virtual bool CheckYieldMutex(); // wait next event and dispatch // must returned by UserEvent (SalFrame::PostEvent) diff --git a/vcl/unx/inc/salinst.h b/vcl/unx/inc/salinst.h index 8f4719f098f0..69e7c21fd923 100644 --- a/vcl/unx/inc/salinst.h +++ b/vcl/unx/inc/salinst.h @@ -102,6 +102,7 @@ public: virtual vos::IMutex* GetYieldMutex(); virtual ULONG ReleaseYieldMutex(); virtual void AcquireYieldMutex( ULONG nCount ); + virtual bool CheckYieldMutex(); virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ); virtual bool AnyInput( USHORT nType ); diff --git a/vcl/unx/source/app/salinst.cxx b/vcl/unx/source/app/salinst.cxx index 49a9cceb8617..88af0b70ef7e 100644 --- a/vcl/unx/source/app/salinst.cxx +++ b/vcl/unx/source/app/salinst.cxx @@ -259,6 +259,24 @@ void X11SalInstance::AcquireYieldMutex( ULONG nCount ) } } +// ----------------------------------------------------------------------- + +bool X11SalInstance::CheckYieldMutex() +{ + bool bRet = true; + + SalYieldMutex* pYieldMutex = mpSalYieldMutex; + if ( pYieldMutex->GetThreadId() != + vos::OThread::getCurrentIdentifier() ) + { + bRet = false; + } + + return bRet; +} + +// ----------------------------------------------------------------------- + void X11SalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents ) { GetX11SalData()->GetLib()->Yield( bWait, bHandleAllCurrentEvents ); } -- cgit From 95433a2374cae162aa2856b7c52a76d44ebd4509 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 8 Oct 2010 17:33:55 +0200 Subject: vcl116: #i114993# fix assertion, native menu cleanup --- vcl/unx/headless/svpinst.cxx | 18 ------ vcl/unx/headless/svpinst.hxx | 6 -- vcl/unx/inc/salinst.h | 4 -- vcl/unx/source/window/makefile.mk | 2 +- vcl/unx/source/window/salmenu.cxx | 132 -------------------------------------- 5 files changed, 1 insertion(+), 161 deletions(-) delete mode 100644 vcl/unx/source/window/salmenu.cxx (limited to 'vcl/unx') diff --git a/vcl/unx/headless/svpinst.cxx b/vcl/unx/headless/svpinst.cxx index 5f94a7ebf375..fc788b2a0530 100644 --- a/vcl/unx/headless/svpinst.cxx +++ b/vcl/unx/headless/svpinst.cxx @@ -432,24 +432,6 @@ bool SvpSalInstance::AnyInput( USHORT nType ) return false; } -SalMenu* SvpSalInstance::CreateMenu( BOOL ) -{ - return NULL; -} - -void SvpSalInstance::DestroyMenu( SalMenu* ) -{ -} - -SalMenuItem* SvpSalInstance::CreateMenuItem( const SalItemParams* ) -{ - return NULL; -} - -void SvpSalInstance::DestroyMenuItem( SalMenuItem* ) -{ -} - SalSession* SvpSalInstance::CreateSalSession() { return NULL; diff --git a/vcl/unx/headless/svpinst.hxx b/vcl/unx/headless/svpinst.hxx index bf323e6e0317..02d5e3fa9494 100644 --- a/vcl/unx/headless/svpinst.hxx +++ b/vcl/unx/headless/svpinst.hxx @@ -184,12 +184,6 @@ public: virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ); virtual bool AnyInput( USHORT nType ); - // Menues - virtual SalMenu* CreateMenu( BOOL bMenuBar ); - virtual void DestroyMenu( SalMenu* pMenu); - virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData ); - virtual void DestroyMenuItem( SalMenuItem* pItem ); - // may return NULL to disable session management virtual SalSession* CreateSalSession(); diff --git a/vcl/unx/inc/salinst.h b/vcl/unx/inc/salinst.h index 69e7c21fd923..133f0bf6037f 100644 --- a/vcl/unx/inc/salinst.h +++ b/vcl/unx/inc/salinst.h @@ -106,10 +106,6 @@ public: virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ); virtual bool AnyInput( USHORT nType ); - virtual SalMenu* CreateMenu( BOOL bMenuBar ); - virtual void DestroyMenu( SalMenu* pMenu); - virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData ); - virtual void DestroyMenuItem( SalMenuItem* pItem ); virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ); void FillFontPathList( std::list< rtl::OString >& o_rFontPaths ); diff --git a/vcl/unx/source/window/makefile.mk b/vcl/unx/source/window/makefile.mk index 808b712903f3..c5cd95ba6b1c 100644 --- a/vcl/unx/source/window/makefile.mk +++ b/vcl/unx/source/window/makefile.mk @@ -48,7 +48,7 @@ dummy: .ELSE # "$(GUIBASE)"!="unx" SLOFILES= \ - $(SLO)/FWS.obj $(SLO)/salframe.obj $(SLO)/salobj.obj $(SLO)/salmenu.obj + $(SLO)/FWS.obj $(SLO)/salframe.obj $(SLO)/salobj.obj .ENDIF # "$(GUIBASE)"!="unx" diff --git a/vcl/unx/source/window/salmenu.cxx b/vcl/unx/source/window/salmenu.cxx deleted file mode 100644 index 0739b6cd5352..000000000000 --- a/vcl/unx/source/window/salmenu.cxx +++ /dev/null @@ -1,132 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_vcl.hxx" - - -#include -#include -#include - - -// ======================================================================= - -// X11SalInst factory methods - -SalMenu* X11SalInstance::CreateMenu( BOOL /*bMenuBar*/ ) -{ - return NULL; // no support for native menues -} - -void X11SalInstance::DestroyMenu( SalMenu* pSalMenu ) -{ - delete pSalMenu; -} - - -SalMenuItem* X11SalInstance::CreateMenuItem( const SalItemParams* ) -{ - return NULL; // no support for native menues -} - -void X11SalInstance::DestroyMenuItem( SalMenuItem* pSalMenuItem ) -{ - delete pSalMenuItem; -} - - -// ======================================================================= - - -/* - * X11SalMenu - */ - - -X11SalMenu::~X11SalMenu() -{ -} - -BOOL X11SalMenu::VisibleMenuBar() -{ - return FALSE; -} - -void X11SalMenu::SetFrame( const SalFrame* ) -{ -} - -void X11SalMenu::InsertItem( SalMenuItem*, unsigned ) -{ -} - -void X11SalMenu::RemoveItem( unsigned ) -{ -} - -void X11SalMenu::SetSubMenu( SalMenuItem*, SalMenu*, unsigned ) -{ -} - -void X11SalMenu::CheckItem( unsigned, BOOL ) -{ -} - -void X11SalMenu::EnableItem( unsigned, BOOL ) -{ -} - -void X11SalMenu::SetItemImage( unsigned, SalMenuItem*, const Image& ) -{ -} - -void X11SalMenu::SetItemText( unsigned, SalMenuItem*, const XubString& ) -{ -} - -void X11SalMenu::SetAccelerator( unsigned, SalMenuItem*, const KeyCode&, const XubString& ) -{ -} - -void X11SalMenu::GetSystemMenuData( SystemMenuData* ) -{ -} - -// ======================================================================= - -/* - * SalMenuItem - */ - - -X11SalMenuItem::~X11SalMenuItem() -{ -} - -// ------------------------------------------------------------------- - -- cgit From 405f7ff73987a2f03b4eb89a6c8e433085311848 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 14 Oct 2010 14:07:00 +0200 Subject: vcl116: #i115053# save work in EndJob if there is no page in the job --- vcl/unx/source/printergfx/printerjob.cxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'vcl/unx') diff --git a/vcl/unx/source/printergfx/printerjob.cxx b/vcl/unx/source/printergfx/printerjob.cxx index 5e18849b8dfe..1eeffb813175 100644 --- a/vcl/unx/source/printergfx/printerjob.cxx +++ b/vcl/unx/source/printergfx/printerjob.cxx @@ -495,6 +495,10 @@ PrinterJob::StartJob ( sal_Bool PrinterJob::EndJob () { + // no pages ? that really means no print job + if( maPageList.empty() ) + return sal_False; + // write document setup (done here because it // includes the accumulated fonts if( mpJobHeader ) -- cgit From 674bf4426ecedc72d5f2c5b804e07e7f1aaec714 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 14 Oct 2010 14:26:33 +0200 Subject: vcl116: #i115053# spelling --- vcl/unx/source/printer/printerinfomanager.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vcl/unx') diff --git a/vcl/unx/source/printer/printerinfomanager.cxx b/vcl/unx/source/printer/printerinfomanager.cxx index e1d499c40ca5..15d525fddd32 100644 --- a/vcl/unx/source/printer/printerinfomanager.cxx +++ b/vcl/unx/source/printer/printerinfomanager.cxx @@ -624,7 +624,7 @@ const PrinterInfo& PrinterInfoManager::getPrinterInfo( const OUString& rPrinter static PrinterInfo aEmptyInfo; ::std::hash_map< OUString, Printer, OUStringHash >::const_iterator it = m_aPrinters.find( rPrinter ); - DBG_ASSERT( it != m_aPrinters.end(), "Do not ask for info about nonexistant printers" ); + DBG_ASSERT( it != m_aPrinters.end(), "Do not ask for info about nonexistent printers" ); return it != m_aPrinters.end() ? it->second.m_aInfo : aEmptyInfo; } -- cgit From c3f2933f4f5cab7206826df037aa009a31c70bf3 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 14 Oct 2010 16:29:26 +0200 Subject: vcl116: #i112421# use gdk default monitor if available (thanks cmc!) --- vcl/unx/gtk/app/gtkdata.cxx | 23 ++++++++++++++++++++++- vcl/unx/inc/plugins/gtk/gtkdata.hxx | 4 ++++ vcl/unx/inc/saldisp.hxx | 3 ++- vcl/unx/source/app/saldisp.cxx | 5 +++-- vcl/unx/source/app/salsys.cxx | 2 +- 5 files changed, 32 insertions(+), 5 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx index 322530b881cc..978163214d0c 100644 --- a/vcl/unx/gtk/app/gtkdata.cxx +++ b/vcl/unx/gtk/app/gtkdata.cxx @@ -217,11 +217,12 @@ void GtkSalDisplay::monitorsChanged( GdkScreen* pScreen ) { gint nMonitors = gdk_screen_get_n_monitors(pScreen); m_aXineramaScreens = std::vector(); + m_aXineramaScreenIndexMap = std::vector(nMonitors); for (gint i = 0; i < nMonitors; ++i) { GdkRectangle dest; gdk_screen_get_monitor_geometry(pScreen, i, &dest); - addXineramaScreenUnique( dest.x, dest.y, dest.width, dest.height ); + m_aXineramaScreenIndexMap[i] = addXineramaScreenUnique( dest.x, dest.y, dest.width, dest.height ); } m_bXinerama = m_aXineramaScreens.size() > 1; if( ! m_aFrames.empty() ) @@ -235,6 +236,26 @@ void GtkSalDisplay::monitorsChanged( GdkScreen* pScreen ) } } +extern "C" +{ + typedef gint(* screen_get_primary_monitor)(GdkScreen *screen); +} + +int GtkSalDisplay::GetDefaultMonitorNumber() const +{ + int n = 0; + GdkScreen* pScreen = gdk_display_get_screen( m_pGdkDisplay, m_nDefaultScreen ); +#if GTK_CHECK_VERSION(2,20,0) + n = m_aXineramaScreenIndexMap[gdk_screen_get_primary_monitor(pScreen)]; +#else + static screen_get_primary_monitor sym_gdk_screen_get_primary_monitor = + (screen_get_primary_monitor)osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gdk_screen_get_primary_monitor" ); + if (sym_gdk_screen_get_primary_monitor) + n = sym_gdk_screen_get_primary_monitor( pScreen ); +#endif + return n; +} + void GtkSalDisplay::initScreen( int nScreen ) const { if( nScreen < 0 || nScreen >= static_cast(m_aScreens.size()) ) diff --git a/vcl/unx/inc/plugins/gtk/gtkdata.hxx b/vcl/unx/inc/plugins/gtk/gtkdata.hxx index d4dec957a6b3..b650cffbae8b 100644 --- a/vcl/unx/inc/plugins/gtk/gtkdata.hxx +++ b/vcl/unx/inc/plugins/gtk/gtkdata.hxx @@ -59,6 +59,8 @@ class GtkSalDisplay : public SalDisplay GdkDisplay* m_pGdkDisplay; GdkCursor *m_aCursors[ POINTER_COUNT ]; bool m_bStartupCompleted; + std::vector< int > m_aXineramaScreenIndexMap; + GdkCursor* getFromXPM( const char *pBitmap, const char *pMask, int nWidth, int nHeight, int nXHot, int nYHot ); public: @@ -73,6 +75,8 @@ public: virtual long Dispatch( XEvent *pEvent ); virtual void initScreen( int nScreen ) const; + virtual int GetDefaultMonitorNumber() const; + static GdkFilterReturn filterGdkEvent( GdkXEvent* sys_event, GdkEvent* event, gpointer data ); diff --git a/vcl/unx/inc/saldisp.hxx b/vcl/unx/inc/saldisp.hxx index 3734cbec6ef7..99c9bea699d6 100644 --- a/vcl/unx/inc/saldisp.hxx +++ b/vcl/unx/inc/saldisp.hxx @@ -405,7 +405,7 @@ protected: int processRandREvent( XEvent* ); void doDestruct(); - void addXineramaScreenUnique( long i_nX, long i_nY, long i_nWidth, long i_nHeight ); + int addXineramaScreenUnique( long i_nX, long i_nY, long i_nWidth, long i_nHeight ); public: static SalDisplay *GetSalDisplay( Display* display ); static BOOL BestVisual( Display *pDisp, @@ -475,6 +475,7 @@ public: XLIB_Window GetDrawable( int nScreen ) const { return getDataForScreen( nScreen ).m_aRefWindow; } Display *GetDisplay() const { return pDisp_; } int GetDefaultScreenNumber() const { return m_nDefaultScreen; } + virtual int GetDefaultMonitorNumber() const { return 0; } const Size& GetScreenSize( int nScreen ) const { return getDataForScreen( nScreen ).m_aSize; } srv_vendor_t GetServerVendor() const { return meServerVendor; } void SetServerVendor() { meServerVendor = sal_GetServerVendor(pDisp_); } diff --git a/vcl/unx/source/app/saldisp.cxx b/vcl/unx/source/app/saldisp.cxx index acf8c91ab5db..354c4d433d42 100644 --- a/vcl/unx/source/app/saldisp.cxx +++ b/vcl/unx/source/app/saldisp.cxx @@ -2592,7 +2592,7 @@ void SalDisplay::PrintInfo() const sal::static_int_cast< unsigned int >(GetVisual(m_nDefaultScreen).GetVisualId()) ); } -void SalDisplay::addXineramaScreenUnique( long i_nX, long i_nY, long i_nWidth, long i_nHeight ) +int SalDisplay::addXineramaScreenUnique( long i_nX, long i_nY, long i_nWidth, long i_nHeight ) { // see if any frame buffers are at the same coordinates // this can happen with weird configuration e.g. on @@ -2608,10 +2608,11 @@ void SalDisplay::addXineramaScreenUnique( long i_nX, long i_nY, long i_nWidth, l { m_aXineramaScreens[n].SetSize( Size( i_nWidth, i_nHeight ) ); } - return; + return (int)n; } } m_aXineramaScreens.push_back( Rectangle( Point( i_nX, i_nY ), Size( i_nWidth, i_nHeight ) ) ); + return (int)m_aXineramaScreens.size()-1; } void SalDisplay::InitXinerama() diff --git a/vcl/unx/source/app/salsys.cxx b/vcl/unx/source/app/salsys.cxx index 1ccb214df4ed..84c9dba32e40 100644 --- a/vcl/unx/source/app/salsys.cxx +++ b/vcl/unx/source/app/salsys.cxx @@ -71,7 +71,7 @@ bool X11SalSystem::IsMultiDisplay() unsigned int X11SalSystem::GetDefaultDisplayNumber() { SalDisplay* pSalDisp = GetX11SalData()->GetDisplay(); - return pSalDisp->GetDefaultScreenNumber(); + return pSalDisp->IsXinerama() ? pSalDisp->GetDefaultMonitorNumber() : pSalDisp->GetDefaultScreenNumber(); } Rectangle X11SalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen ) -- cgit From 101233881d7d912f53614aac83b9c72f7e97e420 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 14 Oct 2010 17:41:02 +0200 Subject: vcl116: #i112421# use correct index (thanks cmc!) --- vcl/unx/gtk/app/gtkdata.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vcl/unx') diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx index 978163214d0c..f308822df147 100644 --- a/vcl/unx/gtk/app/gtkdata.cxx +++ b/vcl/unx/gtk/app/gtkdata.cxx @@ -251,7 +251,7 @@ int GtkSalDisplay::GetDefaultMonitorNumber() const static screen_get_primary_monitor sym_gdk_screen_get_primary_monitor = (screen_get_primary_monitor)osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gdk_screen_get_primary_monitor" ); if (sym_gdk_screen_get_primary_monitor) - n = sym_gdk_screen_get_primary_monitor( pScreen ); + n = m_aXineramaScreenIndexMap[sym_gdk_screen_get_primary_monitor( pScreen )]; #endif return n; } -- cgit From 2a8b5063b765105e7092c763694bcdc59fdaf5c0 Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Wed, 20 Oct 2010 09:56:16 +0200 Subject: #i10000# temporarily disable assertion to get smoketest running --- vcl/unx/source/fontmanager/fontconfig.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vcl/unx') diff --git a/vcl/unx/source/fontmanager/fontconfig.cxx b/vcl/unx/source/fontmanager/fontconfig.cxx index 01e183a68dce..ecb4aa54549b 100644 --- a/vcl/unx/source/fontmanager/fontconfig.cxx +++ b/vcl/unx/source/fontmanager/fontconfig.cxx @@ -743,7 +743,7 @@ int PrintFontManager::countFontconfigFonts( std::hash_map Date: Fri, 22 Oct 2010 12:22:38 +0200 Subject: #i115131# ignore fonts worse than outline fonts --- vcl/unx/source/fontmanager/fontconfig.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'vcl/unx') diff --git a/vcl/unx/source/fontmanager/fontconfig.cxx b/vcl/unx/source/fontmanager/fontconfig.cxx index ecb4aa54549b..c5d35faaded8 100644 --- a/vcl/unx/source/fontmanager/fontconfig.cxx +++ b/vcl/unx/source/fontmanager/fontconfig.cxx @@ -468,6 +468,11 @@ void FontCfgWrapper::addFontSet( FcSetName eSetName ) FcPatternDestroy( pTestPattern ); if( eFcResult != FcResultMatch ) continue; + // #i115131# double check results and eventually ignore them + FcBool bOutline = FcFalse; + FcResult eOutRes = FcPatternGetBool( pBetterPattern, FC_OUTLINE, 0, &bOutline ); + if( (eOutRes != FcResultMatch) || (bOutline == FcFalse) ) + continue; // insert best found pattern for the dupe-search pattern // TODO: skip inserting patterns that are already known in the target fontset FcPatternReference( pBetterPattern ); @@ -773,7 +778,10 @@ int PrintFontManager::countFontconfigFonts( std::hash_mapgetAtom( ATOM_FAMILYNAME, OStringToOUString( OString( (sal_Char*)family ), RTL_TEXTENCODING_UTF8 ), sal_True ); PrintFont* pUpdate = aFonts.front(); -- cgit From a420a92b26cb536f6329d176f7349c63e7cfa4d8 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 25 Oct 2010 17:41:04 +0200 Subject: vcl116: #i96684# optionally do not switch workspaces of WM --- vcl/unx/inc/wmadaptor.hxx | 6 ++++- vcl/unx/source/app/wmadaptor.cxx | 58 ++++++++++++++++++++++++++++++---------- 2 files changed, 49 insertions(+), 15 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/inc/wmadaptor.hxx b/vcl/unx/inc/wmadaptor.hxx index cbedede2cc99..e8620db29c6f 100644 --- a/vcl/unx/inc/wmadaptor.hxx +++ b/vcl/unx/inc/wmadaptor.hxx @@ -165,6 +165,8 @@ protected: bool m_bLegacyPartialFullscreen; int m_nWinGravity; int m_nInitWinGravity; + bool m_bWMshouldSwitchWorkspace; + bool m_bWMshouldSwitchWorkspaceInit; WMAdaptor( SalDisplay * ) ; @@ -177,6 +179,7 @@ protected: */ virtual bool isValid() const; + bool getWMshouldSwitchWorkspace() const; public: virtual ~WMAdaptor(); @@ -214,8 +217,9 @@ public: /* * attemp to switch the desktop to a certain workarea + * if bConsiderWM is true, then on some WMs the call will not result in any action */ - void switchToWorkArea( int nWorkArea ) const; + void switchToWorkArea( int nWorkArea, bool bConsiderWM = true ) const; /* * sets window title diff --git a/vcl/unx/source/app/wmadaptor.cxx b/vcl/unx/source/app/wmadaptor.cxx index aa2e4c84ef24..f816c5d1426e 100644 --- a/vcl/unx/source/app/wmadaptor.cxx +++ b/vcl/unx/source/app/wmadaptor.cxx @@ -31,21 +31,22 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include +#include "sal/alloca.h" +#include "wmadaptor.hxx" +#include "saldisp.hxx" +#include "saldata.hxx" +#include "salframe.h" +#include "vcl/salgdi.hxx" +#include "osl/thread.h" +#include "rtl/locale.h" +#include "osl/process.h" +#include "vcl/configsettings.hxx" + +#include "tools/prex.h" #include #include #include -#include +#include "tools/postx.h" #if OSL_DEBUG_LEVEL > 1 #include @@ -238,7 +239,9 @@ WMAdaptor::WMAdaptor( SalDisplay* pDisplay ) : m_bEnableAlwaysOnTopWorks( false ), m_bLegacyPartialFullscreen( false ), m_nWinGravity( StaticGravity ), - m_nInitWinGravity( StaticGravity ) + m_nInitWinGravity( StaticGravity ), + m_bWMshouldSwitchWorkspace( true ), + m_bWMshouldSwitchWorkspaceInit( false ) { Atom aRealType = None; int nFormat = 8; @@ -965,6 +968,30 @@ bool WMAdaptor::getNetWmName() return bNetWM; } +bool WMAdaptor::getWMshouldSwitchWorkspace() const +{ + if( ! m_bWMshouldSwitchWorkspaceInit ) + { + WMAdaptor * pWMA = const_cast(this); + + pWMA->m_bWMshouldSwitchWorkspace = true; + vcl::SettingsConfigItem* pItem = vcl::SettingsConfigItem::get(); + rtl::OUString aSetting( pItem->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WM" ) ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ShouldSwitchWorkspace" ) ) ) ); + if( aSetting.getLength() == 0 ) + { + if( m_aWMName.EqualsAscii( "awesome" ) ) + { + pWMA->m_bWMshouldSwitchWorkspace = false; + } + } + else + pWMA->m_bWMshouldSwitchWorkspace = aSetting.toBoolean(); + pWMA->m_bWMshouldSwitchWorkspaceInit = true; + } + return m_bWMshouldSwitchWorkspace; +} + /* * WMAdaptor::isValid() */ @@ -2338,8 +2365,11 @@ int WMAdaptor::getWindowWorkArea( XLIB_Window aWindow ) const * WMAdaptor::getCurrentWorkArea */ // fixme: multi screen case -void WMAdaptor::switchToWorkArea( int nWorkArea ) const +void WMAdaptor::switchToWorkArea( int nWorkArea, bool bConsiderWM ) const { + if( bConsiderWM && ! getWMshouldSwitchWorkspace() ) + return; + if( m_aWMAtoms[ NET_CURRENT_DESKTOP ] ) { XEvent aEvent; -- cgit From 42c20c4a7d4360a1e2664ea16113dcd19675495f Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Tue, 26 Oct 2010 10:50:27 +0200 Subject: #i115204# avoid problem on systems with older fontconfig libs --- vcl/unx/source/fontmanager/fontconfig.cxx | 41 +++++++++++++++++++------------ 1 file changed, 25 insertions(+), 16 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/source/fontmanager/fontconfig.cxx b/vcl/unx/source/fontmanager/fontconfig.cxx index c5d35faaded8..434263db352e 100644 --- a/vcl/unx/source/fontmanager/fontconfig.cxx +++ b/vcl/unx/source/fontmanager/fontconfig.cxx @@ -454,25 +454,33 @@ void FontCfgWrapper::addFontSet( FcSetName eSetName ) for( int i = 0; i < pOrig->nfont; ++i ) { FcPattern* pOrigPattern = pOrig->fonts[i]; - // create a pattern to find eventually better alternatives - FcPattern* pTestPattern = FcPatternDuplicate( pOrigPattern ); - FcPatternAddBool( pTestPattern, FC_OUTLINE, FcTrue ); - // TODO: use pattern->ImplFontAttr->pattern to filter out - // all attribute that are not interesting for finding dupes - FcPatternDel( pTestPattern, FC_FONTVERSION ); - FcPatternDel( pTestPattern, FC_CHARSET ); - FcPatternDel( pTestPattern, FC_FILE ); - // find the font face for the dupe-search pattern - FcResult eFcResult = FcResultMatch; - FcPattern* pBetterPattern = FcFontMatch( FcConfigGetCurrent(), pTestPattern, &eFcResult ); - FcPatternDestroy( pTestPattern ); - if( eFcResult != FcResultMatch ) - continue; - // #i115131# double check results and eventually ignore them + // #i115131# ignore non-outline fonts FcBool bOutline = FcFalse; - FcResult eOutRes = FcPatternGetBool( pBetterPattern, FC_OUTLINE, 0, &bOutline ); + FcResult eOutRes = FcPatternGetBool( pOrigPattern, FC_OUTLINE, 0, &bOutline ); if( (eOutRes != FcResultMatch) || (bOutline == FcFalse) ) continue; + // create a pattern to find eventually better alternatives + FcPattern* pBetterPattern = pOrigPattern; + if( m_nFcVersion > 20400 ) // #i115204# avoid trouble with old FC versions + { + FcPattern* pTestPattern = FcPatternDuplicate( pOrigPattern ); + FcPatternAddBool( pTestPattern, FC_OUTLINE, FcTrue ); + // TODO: ignore all attributes that are not interesting for finding dupes + // e.g. by using pattern->ImplFontAttr->pattern conversion + FcPatternDel( pTestPattern, FC_FONTVERSION ); + FcPatternDel( pTestPattern, FC_CHARSET ); + FcPatternDel( pTestPattern, FC_FILE ); + // find the font face for the dupe-search pattern + FcResult eFcResult = FcResultMatch; + pBetterPattern = FcFontMatch( FcConfigGetCurrent(), pTestPattern, &eFcResult ); + FcPatternDestroy( pTestPattern ); + if( eFcResult != FcResultMatch ) + continue; + // #i115131# double check results and eventually ignore them + eOutRes = FcPatternGetBool( pBetterPattern, FC_OUTLINE, 0, &bOutline ); + if( (eOutRes != FcResultMatch) || (bOutline == FcFalse) ) + continue; + } // insert best found pattern for the dupe-search pattern // TODO: skip inserting patterns that are already known in the target fontset FcPatternReference( pBetterPattern ); @@ -1111,6 +1119,7 @@ bool PrintFontManager::getFontOptions( ImplFontOptions& rOptions) const { #ifndef ENABLE_FONTCONFIG + (void)rInfo;(void)nSize;(void)subcallback;(void)rOptions; return false; #else // ENABLE_FONTCONFIG FontCfgWrapper& rWrapper = FontCfgWrapper::get(); -- cgit From d5d2a1cffc728100f8119252ff26f95949e6d35c Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Wed, 27 Oct 2010 14:20:22 +0200 Subject: #i115204#,#i115131# HDU: avoid problem on systems with older fontconfig libs,ignore fonts worse than outline fonts --- vcl/unx/source/fontmanager/fontconfig.cxx | 43 +++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 13 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/source/fontmanager/fontconfig.cxx b/vcl/unx/source/fontmanager/fontconfig.cxx index ecb4aa54549b..434263db352e 100644 --- a/vcl/unx/source/fontmanager/fontconfig.cxx +++ b/vcl/unx/source/fontmanager/fontconfig.cxx @@ -454,20 +454,33 @@ void FontCfgWrapper::addFontSet( FcSetName eSetName ) for( int i = 0; i < pOrig->nfont; ++i ) { FcPattern* pOrigPattern = pOrig->fonts[i]; - // create a pattern to find eventually better alternatives - FcPattern* pTestPattern = FcPatternDuplicate( pOrigPattern ); - FcPatternAddBool( pTestPattern, FC_OUTLINE, FcTrue ); - // TODO: use pattern->ImplFontAttr->pattern to filter out - // all attribute that are not interesting for finding dupes - FcPatternDel( pTestPattern, FC_FONTVERSION ); - FcPatternDel( pTestPattern, FC_CHARSET ); - FcPatternDel( pTestPattern, FC_FILE ); - // find the font face for the dupe-search pattern - FcResult eFcResult = FcResultMatch; - FcPattern* pBetterPattern = FcFontMatch( FcConfigGetCurrent(), pTestPattern, &eFcResult ); - FcPatternDestroy( pTestPattern ); - if( eFcResult != FcResultMatch ) + // #i115131# ignore non-outline fonts + FcBool bOutline = FcFalse; + FcResult eOutRes = FcPatternGetBool( pOrigPattern, FC_OUTLINE, 0, &bOutline ); + if( (eOutRes != FcResultMatch) || (bOutline == FcFalse) ) continue; + // create a pattern to find eventually better alternatives + FcPattern* pBetterPattern = pOrigPattern; + if( m_nFcVersion > 20400 ) // #i115204# avoid trouble with old FC versions + { + FcPattern* pTestPattern = FcPatternDuplicate( pOrigPattern ); + FcPatternAddBool( pTestPattern, FC_OUTLINE, FcTrue ); + // TODO: ignore all attributes that are not interesting for finding dupes + // e.g. by using pattern->ImplFontAttr->pattern conversion + FcPatternDel( pTestPattern, FC_FONTVERSION ); + FcPatternDel( pTestPattern, FC_CHARSET ); + FcPatternDel( pTestPattern, FC_FILE ); + // find the font face for the dupe-search pattern + FcResult eFcResult = FcResultMatch; + pBetterPattern = FcFontMatch( FcConfigGetCurrent(), pTestPattern, &eFcResult ); + FcPatternDestroy( pTestPattern ); + if( eFcResult != FcResultMatch ) + continue; + // #i115131# double check results and eventually ignore them + eOutRes = FcPatternGetBool( pBetterPattern, FC_OUTLINE, 0, &bOutline ); + if( (eOutRes != FcResultMatch) || (bOutline == FcFalse) ) + continue; + } // insert best found pattern for the dupe-search pattern // TODO: skip inserting patterns that are already known in the target fontset FcPatternReference( pBetterPattern ); @@ -773,7 +786,10 @@ int PrintFontManager::countFontconfigFonts( std::hash_mapgetAtom( ATOM_FAMILYNAME, OStringToOUString( OString( (sal_Char*)family ), RTL_TEXTENCODING_UTF8 ), sal_True ); PrintFont* pUpdate = aFonts.front(); @@ -1103,6 +1119,7 @@ bool PrintFontManager::getFontOptions( ImplFontOptions& rOptions) const { #ifndef ENABLE_FONTCONFIG + (void)rInfo;(void)nSize;(void)subcallback;(void)rOptions; return false; #else // ENABLE_FONTCONFIG FontCfgWrapper& rWrapper = FontCfgWrapper::get(); -- cgit From 2ce6a123f867943205e26c2976159fd4a23da9f7 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 2 Nov 2010 15:47:47 +0100 Subject: fix a merge problem --- vcl/unx/source/gdi/salprnpsp.cxx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/source/gdi/salprnpsp.cxx b/vcl/unx/source/gdi/salprnpsp.cxx index 417704eb3b69..ece724d717cb 100644 --- a/vcl/unx/source/gdi/salprnpsp.cxx +++ b/vcl/unx/source/gdi/salprnpsp.cxx @@ -1187,14 +1187,12 @@ BOOL PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJobNam aContext.Version = vcl::PDFWriter::PDF_1_4; aContext.Tagged = false; aContext.EmbedStandardFonts = true; - aContext.Encrypt = false; aContext.DocumentLocale = Application::GetSettings().GetLocale(); // prepare doc info - vcl::PDFDocInfo aDocInfo; - aDocInfo.Title = i_rJobName; - aDocInfo.Creator = i_rAppName; - aDocInfo.Producer = i_rAppName; + aContext.DocumentInfo.Title = i_rJobName; + aContext.DocumentInfo.Creator = i_rAppName; + aContext.DocumentInfo.Producer = i_rAppName; // define how we handle metafiles in PDFWriter vcl::PDFWriter::PlayMetafileContext aMtfContext; @@ -1271,11 +1269,10 @@ BOOL PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJobNam #if defined __SUNPRO_CC #pragma disable_warn #endif - pWriter.reset( new vcl::PDFWriter( aContext ) ); + pWriter.reset( new vcl::PDFWriter( aContext, uno::Reference< beans::XMaterialHolder >() ) ); #if defined __SUNPRO_CC #pragma enable_warn #endif - pWriter->SetDocInfo( aDocInfo ); } pWriter->NewPage( TenMuToPt( aNewParm.maPageSize.Width() ), -- cgit From b3a698533c14db14beae871486270b752d21774c Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 15 Nov 2010 16:15:10 +0100 Subject: vcl117: #i115133# catch an XError in gtk_im_context_set_cursor_location --- vcl/unx/gtk/window/gtkframe.cxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'vcl/unx') diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index d04d5c0ce684..9181ee3fd40d 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -3339,7 +3339,9 @@ void GtkSalFrame::IMHandler::updateIMSpotLocation() aArea.y = aPosEvent.mnY; aArea.width = aPosEvent.mnWidth; aArea.height = aPosEvent.mnHeight; + m_pFrame->getDisplay()->GetXLib()->PushXErrorLevel( true ); gtk_im_context_set_cursor_location( m_pIMContext, &aArea ); + m_pFrame->getDisplay()->GetXLib()->PopXErrorLevel(); } void GtkSalFrame::IMHandler::setInputContext( SalInputContext* ) -- cgit From cd17f5da7f69678d3cec9af251dbfc3651b950be Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 16 Nov 2010 17:28:04 +0100 Subject: vcl117: add debug clarity --- vcl/unx/source/app/saldisp.cxx | 1 + 1 file changed, 1 insertion(+) (limited to 'vcl/unx') diff --git a/vcl/unx/source/app/saldisp.cxx b/vcl/unx/source/app/saldisp.cxx index 354c4d433d42..063b03de7798 100644 --- a/vcl/unx/source/app/saldisp.cxx +++ b/vcl/unx/source/app/saldisp.cxx @@ -2575,6 +2575,7 @@ void SalDisplay::PrintInfo() const fprintf( stderr, "\tProperties \t0x%lX\n", GetProperties() ); if( eWindowManager_ != otherwm ) fprintf( stderr, "\tWindowmanager \t%d\n", eWindowManager_ ); + fprintf( stderr, "\tWMName \t%s\n", rtl::OUStringToOString( getWMAdaptor()->getWindowManagerName(), osl_getThreadTextEncoding() ).getStr() ); } fprintf( stderr, "Screen\n" ); fprintf( stderr, "\tResolution/Size \t%ld*%ld %ld*%ld %.1lf\"\n", -- cgit From 269f91cd65551454c94d71bfd6f688c949c22a66 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Tue, 16 Nov 2010 17:31:59 +0100 Subject: #i110171# RIP XLFD --- vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 7 +- vcl/unx/inc/saldisp.hxx | 18 - vcl/unx/inc/salgdi.h | 9 +- vcl/unx/inc/xfont.hxx | 162 ----- vcl/unx/source/app/saldisp.cxx | 4 - vcl/unx/source/gdi/makefile.mk | 5 - vcl/unx/source/gdi/salgdi.cxx | 10 +- vcl/unx/source/gdi/salgdi3.cxx | 561 +---------------- vcl/unx/source/gdi/xfont.cxx | 780 ----------------------- vcl/unx/source/gdi/xlfd_attr.cxx | 686 -------------------- vcl/unx/source/gdi/xlfd_attr.hxx | 228 ------- vcl/unx/source/gdi/xlfd_extd.cxx | 1001 ------------------------------ vcl/unx/source/gdi/xlfd_extd.hxx | 272 -------- vcl/unx/source/gdi/xlfd_smpl.cxx | 268 -------- vcl/unx/source/gdi/xlfd_smpl.hxx | 92 --- 15 files changed, 11 insertions(+), 4092 deletions(-) delete mode 100644 vcl/unx/inc/xfont.hxx delete mode 100644 vcl/unx/source/gdi/xfont.cxx delete mode 100644 vcl/unx/source/gdi/xlfd_attr.cxx delete mode 100644 vcl/unx/source/gdi/xlfd_attr.hxx delete mode 100644 vcl/unx/source/gdi/xlfd_extd.cxx delete mode 100644 vcl/unx/source/gdi/xlfd_extd.hxx delete mode 100644 vcl/unx/source/gdi/xlfd_smpl.cxx delete mode 100644 vcl/unx/source/gdi/xlfd_smpl.hxx (limited to 'vcl/unx') diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 318f593ac6a3..ff615f5ede74 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -737,7 +737,7 @@ BOOL GtkSalGraphics::drawNativeControl( ControlType nType, { BOOL returnVal = FALSE; // get a GC with current clipping region set - SelectFont(); + GetFontGC(); // theme changed ? @@ -3687,7 +3687,8 @@ GdkPixmap* GtkSalGraphics::NWGetPixmapFromScreen( Rectangle srcRect ) BOOL GtkSalGraphics::NWRenderPixmapToScreen( GdkPixmap* pPixmap, Rectangle dstRect ) { // The GC can't be null, otherwise we'd have no clip region - if( SelectFont() == NULL ) + GC aFontGC = GetFontGC(); + if( aFontGC == NULL ) { std::fprintf(stderr, "salnativewidgets.cxx: no valid GC\n" ); return( FALSE ); @@ -3702,7 +3703,7 @@ BOOL GtkSalGraphics::NWRenderPixmapToScreen( GdkPixmap* pPixmap, Rectangle dstRe gdk_screen_get_number( gdk_drawable_get_screen( GDK_DRAWABLE(pPixmap) ) ), gdk_drawable_get_depth( GDK_DRAWABLE(pPixmap) ), GetDrawable(), m_nScreen, GetVisual().GetDepth(), - SelectFont(), + aFontGC, 0, 0, dstRect.GetWidth(), dstRect.GetHeight(), dstRect.Left(), dstRect.Top() ); return( TRUE ); diff --git a/vcl/unx/inc/saldisp.hxx b/vcl/unx/inc/saldisp.hxx index 99c9bea699d6..89efad3cde4d 100644 --- a/vcl/unx/inc/saldisp.hxx +++ b/vcl/unx/inc/saldisp.hxx @@ -269,15 +269,10 @@ public: class SalI18N_InputMethod; class SalI18N_KeyboardExtension; -class XlfdStorage; -class ExtendedFontStruct; -class ExtendedXlfd; class AttributeProvider; class SalUnicodeConverter; class SalConverterCache; -DECLARE_LIST( SalFontCache, ExtendedFontStruct* ) - extern "C" { struct SnDisplay; struct SnLauncheeContext; @@ -349,8 +344,6 @@ protected: SalI18N_KeyboardExtension *mpKbdExtension; AttributeProvider *mpFactory; - XlfdStorage *mpFontList; - const ExtendedXlfd *mpFallbackFactory; Display *pDisp_; // X Display int m_nDefaultScreen; // XDefaultScreen @@ -374,8 +367,6 @@ protected: XLIB_Cursor aPointerCache_[POINTER_COUNT]; SalFrame* m_pCapture; - mutable SalFontCache* m_pFontCache; - // Keyboard BOOL bNumLockFromXS_; // Num Lock handled by X Server int nNumLockIndex_; // modifier index in modmap @@ -397,7 +388,6 @@ protected: mutable XLIB_Time m_nLastUserEventTime; // mutable because changed on first access - void DestroyFontCache(); virtual long Dispatch( XEvent *pEvent ) = 0; void InitXinerama(); void InitRandR( XLIB_Window aRoot ) const; @@ -434,14 +424,6 @@ public: void PrintEvent( const ByteString &rComment, XEvent *pEvent ) const; - XlfdStorage* GetXlfdList() const; - ExtendedFontStruct* - GetFont( const ExtendedXlfd *pFont, - const Size& rPixelSize, sal_Bool bVertical ) const; - const ExtendedXlfd* - GetFallbackFactory() - { return mpFallbackFactory; } - void Beep() const; void ModifierMapping(); diff --git a/vcl/unx/inc/salgdi.h b/vcl/unx/inc/salgdi.h index b5fdce50eee9..6a77d4bacf96 100644 --- a/vcl/unx/inc/salgdi.h +++ b/vcl/unx/inc/salgdi.h @@ -38,8 +38,9 @@ class SalFontCacheItem; #include "vcl/salgtype.hxx" #include "tools/fract.hxx" #include "vcl/dllapi.h" +#include +#include #include -#include "xfont.hxx" // -=-= forwards -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= struct ImplFontMetricData; @@ -100,7 +101,6 @@ protected: Pixel nPenPixel_; GC pFontGC_; // Font attributes - ExtendedFontStructRef mXFont[ MAX_FALLBACK ]; ServerFont* mpServerFont[ MAX_FALLBACK ]; SalColor nTextColor_; @@ -185,7 +185,7 @@ protected: const SalBitmap &rTransparentBitmap, SalColor nTransparentColor ); - GC SelectFont(); + GC GetFontGC(); bool setFont( const ImplFontSelectData* pEntry, int nFallbackLevel ); void drawMaskedBitmap( const SalTwoRect* pPosAry, @@ -193,9 +193,6 @@ protected: const SalBitmap& rTransparentBitmap ); protected: - void DrawStringUCS2MB( ExtendedFontStruct& rFont, const Point&, - const sal_Unicode* pStr, int nLength ); - void DrawPrinterString( const SalLayout& ); void DrawServerFontString( const ServerFontLayout& ); diff --git a/vcl/unx/inc/xfont.hxx b/vcl/unx/inc/xfont.hxx deleted file mode 100644 index 4041ed7ce67d..000000000000 --- a/vcl/unx/inc/xfont.hxx +++ /dev/null @@ -1,162 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef EXTENDED_FONTSTRUCT_HXX -#define EXTENDED_FONTSTRUCT_HXX - -#ifndef _XLIB_H_ -#include -#include -#include -#endif -#include -#include -#include -#include - -typedef unsigned short sal_MultiByte; - -class ImplFontMetricData; -class ExtendedXlfd; - -struct VerticalTextItem -{ - BOOL mbFixed; - XFontStruct* mpXFontStruct; - const sal_Unicode* mpString; - int mnLength; - int mnTransX; - int mnTransY; - int mnFixedAdvance; - int* mpAdvanceAry; - - VerticalTextItem( XFontStruct* pXFontStruct, - const sal_Unicode* pString, - int nLength, - int nTransX, - int nTransY, - int nFixedAdvance ) - : mbFixed( TRUE ), - mpXFontStruct( pXFontStruct ), - mpString( pString ), - mnLength( nLength ), - mnTransX( nTransX ), - mnTransY( nTransY ), - mnFixedAdvance( nFixedAdvance ) - {} - - VerticalTextItem( XFontStruct* pXFontStruct, - const sal_Unicode* pString, - int nLength, - int nTransX, - int nTransY, - int* pAdvanceAry ) - : mbFixed( FALSE ), - mpXFontStruct( pXFontStruct ), - mpString( pString ), - mnLength( nLength ), - mnTransX( nTransX ), - mnTransY( nTransY ), - mpAdvanceAry( pAdvanceAry ) - {} - - ~VerticalTextItem() - { - if (!mbFixed) - { - delete( mpAdvanceAry ); - } - } -}; - -class ExtendedFontStruct : public SvRefBase -{ - private: - Display* mpDisplay; - Size maPixelSize; - float mfXScale; - float mfYScale; - sal_Size mnDefaultWidth; - sal_Bool mbVertical; - rtl_TextEncoding mnCachedEncoding; - rtl_TextEncoding mnAsciiEncoding; - - ExtendedXlfd* mpXlfd; - XFontStruct** mpXFontStruct; - - // unicode range cache - mutable sal_uInt32* mpRangeCodes; - mutable int mnRangeCount; - - int LoadEncoding( rtl_TextEncoding nEncoding ); - FontPitch GetSpacing( rtl_TextEncoding nEncoding ); - bool GetFontBoundingBox( XCharStruct *pCharStruct, - int *pAscent, int *pDescent ) ; - - sal_Size GetDefaultWidth(); - sal_Size GetCharWidth8( sal_Unicode nFrom, sal_Unicode nTo, - sal_Int32 *pWidthArray, - rtl_TextEncoding nEncoding ); - sal_Size GetCharWidthUTF16( sal_Unicode nFrom, sal_Unicode nTo, - sal_Int32 *pWidthArray ); - sal_Size GetCharWidth16( sal_Unicode nFrom, sal_Unicode nTo, - sal_Int32 *pWidthArray, ExtendedFontStruct *pFallback ); - public: - ExtendedFontStruct( Display* pDisplay, - const Size& rPixelSize, sal_Bool bVertical, - ExtendedXlfd* pXlfd ); - ~ExtendedFontStruct(); - bool Match( const ExtendedXlfd *pXlfd, - const Size& rPixelSize, sal_Bool bVertical ) const; - XFontStruct* GetFontStruct( rtl_TextEncoding nEncoding ); - XFontStruct* GetFontStruct( sal_Unicode nChar, - rtl_TextEncoding *pEncoding ); - bool ToImplFontMetricData( ImplFontMetricData *pMetric ); - rtl_TextEncoding GetAsciiEncoding( int *pAsciiRange = NULL ) const; - sal_Size GetCharWidth( sal_Unicode, - sal_Int32* pPhysWidth, sal_Int32* pLogWidth ); - int GetFontCodeRanges( sal_uInt32* pCodePairs ) const; - bool HasUnicodeChar( sal_Unicode ) const; -}; - -// Declaration and Implementation for ExtendedFontStructRef: Add RefCounting -// to ExtendedFontStruct (it's not possible to separate decl and impl into -// a separate source file: all ref member functions are inline -SV_DECL_IMPL_REF( ExtendedFontStruct ); - -class X11FontLayout : public GenericSalLayout -{ -public: - X11FontLayout( ExtendedFontStruct& ); - virtual bool LayoutText( ImplLayoutArgs& ); - virtual void AdjustLayout( ImplLayoutArgs& ); - virtual void DrawText( SalGraphics& ) const; - -private: - ExtendedFontStruct& mrFont; -}; - -#endif /* EXTENDED_FONTSTRUCT_HXX */ diff --git a/vcl/unx/source/app/saldisp.cxx b/vcl/unx/source/app/saldisp.cxx index 063b03de7798..cd3d7ea06fde 100644 --- a/vcl/unx/source/app/saldisp.cxx +++ b/vcl/unx/source/app/saldisp.cxx @@ -508,7 +508,6 @@ BOOL SalDisplay::BestVisual( Display *pDisplay, SalDisplay::SalDisplay( Display *display ) : mpInputMethod( NULL ), - mpFallbackFactory ( NULL ), pDisp_( display ), m_pWMAdaptor( NULL ), m_pDtIntegrator( NULL ), @@ -557,7 +556,6 @@ void SalDisplay::doDestruct() m_pDtIntegrator = NULL; X11SalBitmap::ImplDestroyCache(); X11SalGraphics::releaseGlyphPeer(); - DestroyFontCache(); if( IsDisplay() ) { @@ -814,8 +812,6 @@ void SalDisplay::Init() eWindowManager_ = otherwm; nProperties_ = PROPERTY_DEFAULT; hEventGuard_ = NULL; - m_pFontCache = NULL; - mpFontList = (XlfdStorage*)NULL; mpFactory = (AttributeProvider*)NULL; m_pCapture = NULL; m_bXinerama = false; diff --git a/vcl/unx/source/gdi/makefile.mk b/vcl/unx/source/gdi/makefile.mk index 536aadcac015..7e889266a831 100644 --- a/vcl/unx/source/gdi/makefile.mk +++ b/vcl/unx/source/gdi/makefile.mk @@ -53,17 +53,12 @@ SLOFILES= \ $(SLO)$/salvd.obj \ $(SLO)$/dtint.obj \ $(SLO)$/salcvt.obj \ - $(SLO)$/xfont.obj \ - $(SLO)$/xlfd_attr.obj \ - $(SLO)$/xlfd_extd.obj \ - $(SLO)$/xlfd_smpl.obj \ $(SLO)$/salgdi3.obj \ $(SLO)$/gcach_xpeer.obj \ $(SLO)$/xrender_peer.obj \ $(SLO)$/pspgraphics.obj EXCEPTIONSFILES=\ - $(SLO)$/xlfd_extd.obj \ $(SLO)$/salgdi.obj \ $(SLO)$/salbmp.obj \ $(SLO)$/salgdi3.obj \ diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx index 9215f2e25b16..b2e40310a03e 100644 --- a/vcl/unx/source/gdi/salgdi.cxx +++ b/vcl/unx/source/gdi/salgdi.cxx @@ -111,12 +111,8 @@ X11SalGraphics::X11SalGraphics() nPenPixel_ = 0; nPenColor_ = MAKE_SALCOLOR( 0x00, 0x00, 0x00 ); // Black - pFontGC_ = NULL; for( int i = 0; i < MAX_FALLBACK; ++i ) - { - mXFont[i] = NULL; mpServerFont[i] = NULL; - } nTextPixel_ = 0; nTextColor_ = MAKE_SALCOLOR( 0x00, 0x00, 0x00 ); // Black @@ -144,7 +140,6 @@ X11SalGraphics::X11SalGraphics() bPrinter_ = FALSE; bVirDev_ = FALSE; bPenGC_ = FALSE; - bFontGC_ = FALSE; bBrushGC_ = FALSE; bMonoGC_ = FALSE; bCopyGC_ = FALSE; @@ -174,7 +169,6 @@ void X11SalGraphics::freeResources() if( hBrush_ ) XFreePixmap( pDisplay, hBrush_ ), hBrush_ = None; if( pPenGC_ ) XFreeGC( pDisplay, pPenGC_ ), pPenGC_ = None; - if( pFontGC_ ) XFreeGC( pDisplay, pFontGC_ ), pFontGC_ = None; if( pBrushGC_ ) XFreeGC( pDisplay, pBrushGC_ ), pBrushGC_ = None; if( pMonoGC_ ) XFreeGC( pDisplay, pMonoGC_ ), pMonoGC_ = None; if( pCopyGC_ ) XFreeGC( pDisplay, pCopyGC_ ), pCopyGC_ = None; @@ -189,7 +183,7 @@ void X11SalGraphics::freeResources() if( m_aRenderPicture ) XRenderPeer::GetInstance().FreePicture( m_aRenderPicture ), m_aRenderPicture = 0; - bPenGC_ = bFontGC_ = bBrushGC_ = bMonoGC_ = bCopyGC_ = bInvertGC_ = bInvert50GC_ = bStippleGC_ = bTrackingGC_ = false; + bPenGC_ = bBrushGC_ = bMonoGC_ = bCopyGC_ = bInvertGC_ = bInvert50GC_ = bStippleGC_ = bTrackingGC_ = false; } void X11SalGraphics::SetDrawable( Drawable aDrawable, int nScreen ) @@ -582,7 +576,6 @@ void X11SalGraphics::ResetClipRegion() if( pClipRegion_ ) { bPenGC_ = FALSE; - bFontGC_ = FALSE; bBrushGC_ = FALSE; bMonoGC_ = FALSE; bCopyGC_ = FALSE; @@ -632,7 +625,6 @@ bool X11SalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& ) void X11SalGraphics::EndSetClipRegion() { bPenGC_ = FALSE; - bFontGC_ = FALSE; bBrushGC_ = FALSE; bMonoGC_ = FALSE; bCopyGC_ = FALSE; diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx index 62e575ebc5ef..360c7e95d8f9 100644 --- a/vcl/unx/source/gdi/salgdi3.cxx +++ b/vcl/unx/source/gdi/salgdi3.cxx @@ -46,11 +46,7 @@ #include "salgdi.h" #include "pspgraphics.h" #include "salvd.h" -#include "xfont.hxx" #include -#include "xlfd_attr.hxx" -#include "xlfd_smpl.hxx" -#include "xlfd_extd.hxx" #include "salcvt.hxx" #include "vcl/printergfx.hxx" @@ -112,391 +108,6 @@ struct _XRegion }; using namespace rtl; -// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -// ---------------------------------------------------------------------------- -// -// manage X11 fonts and self rastered fonts -// -// ---------------------------------------------------------------------------- - -#ifndef _USE_PRINT_EXTENSION_ - -class FontLookup -{ - public: - - struct hash; - struct equal; - typedef ::std::hash_set< FontLookup, - FontLookup::hash, - FontLookup::equal > fl_hashset; - - private: - - rtl::OString maName; - FontWeight mnWeight; - FontItalic mnItalic; - sal_Bool mbDisplay; - - public: - - FontLookup ( ::std::list< psp::fontID >::iterator& it, - const psp::PrintFontManager& rMgr ); - FontLookup (const Xlfd& rFont); - FontLookup (const FontLookup &rRef) : - maName (rRef.maName), - mnWeight (rRef.mnWeight), - mnItalic (rRef.mnItalic), - mbDisplay(rRef.mbDisplay) - {} - ~FontLookup () - {} - - static void BuildSet (fl_hashset& rSet); - static bool InSet (const fl_hashset& rSet, const Xlfd& rXfld); - bool InSet (const fl_hashset& rSet) const; - - bool operator== (const FontLookup &rRef) const - { - return (abs(mnWeight - rRef.mnWeight) < 2) - && (mnItalic == rRef.mnItalic) - && (maName == rRef.maName) - && (mbDisplay== rRef.mbDisplay); - } - FontLookup& operator= (const FontLookup &rRef) - { - mnWeight = rRef.mnWeight; - mnItalic = rRef.mnItalic; - maName = rRef.maName; - mbDisplay= rRef.mbDisplay; - - return *this; - } - size_t Hash() const - { - return maName.hashCode (); - } - - struct equal - { - bool operator()(const FontLookup &r1, const FontLookup &r2) const - { - return r1 == r2; - } - }; - struct hash - { - size_t operator()(const FontLookup &rArg) const - { - return rArg.Hash(); - } - }; -}; - -FontLookup::FontLookup ( ::std::list< psp::fontID >::iterator& it, - const psp::PrintFontManager& rMgr ) -{ - psp::FastPrintFontInfo aInfo; - if (rMgr.getFontFastInfo (*it, aInfo)) - { - mnItalic = PspGraphics::ToFontItalic (aInfo.m_eItalic); - mnWeight = PspGraphics::ToFontWeight (aInfo.m_eWeight); - mbDisplay= aInfo.m_eType == psp::fonttype::Builtin - || aInfo.m_eType == psp::fonttype::Unknown ? False : True; - maName = rtl::OUStringToOString - ( aInfo.m_aFamilyName, - RTL_TEXTENCODING_ISO_8859_1).toAsciiLowerCase(); - - sal_Int32 n_length = maName.getLength(); - const sal_Char* p_from = maName.getStr(); - sal_Char* p_to = (sal_Char*)alloca (n_length + 1); - - sal_Int32 i, j; - for (i = 0, j = 0; i < n_length; i++) - { - if ( p_from[i] != ' ' ) - p_to[j++] = p_from[i]; - } - maName = rtl::OString (p_to, j); - if (mnItalic == ITALIC_OBLIQUE) - mnItalic = ITALIC_NORMAL; - } - else - { - mnItalic = ITALIC_DONTKNOW; - mnWeight = WEIGHT_DONTKNOW; - mbDisplay= False; - } -} - -FontLookup::FontLookup (const Xlfd& rFont) -{ - AttributeProvider* pFactory = rFont.mpFactory; - Attribute* pAttr; - - pAttr = pFactory->RetrieveSlant (rFont.mnSlant); - mnItalic = (FontItalic)pAttr->GetValue(); - pAttr = pFactory->RetrieveWeight (rFont.mnWeight); - mnWeight = (FontWeight)pAttr->GetValue(); - pAttr = pFactory->RetrieveFamily (rFont.mnFamily); - maName = pAttr->GetKey(); - - if (mnItalic == ITALIC_OBLIQUE) - mnItalic = ITALIC_NORMAL; - - mbDisplay = True; -} - -void -FontLookup::BuildSet (FontLookup::fl_hashset &rSet) -{ - ::std::list< psp::fontID > aIdList; - - psp::PrintFontManager& rMgr = psp::PrintFontManager::get(); - rMgr.getFontList( aIdList, NULL, false ); - - ::std::list< psp::fontID >::iterator it; - for (it = aIdList.begin(); it != aIdList.end(); ++it) - { - FontLookup aItem (it, rMgr); - rSet.insert (aItem); - } -} - -bool -FontLookup::InSet (const FontLookup::fl_hashset& rSet) const -{ - fl_hashset::const_iterator it = rSet.find(*this); - return it == rSet.end() ? false : true; -} - -bool -FontLookup::InSet (const FontLookup::fl_hashset& rSet, const Xlfd& rXlfd) -{ - FontLookup aNeedle (rXlfd); - return aNeedle.InSet (rSet); -} - -#endif - -// ---------------------------------------------------------------------------- -// -// SalDisplay -// -// ---------------------------------------------------------------------------- - -XlfdStorage* -SalDisplay::GetXlfdList() const -{ - if ( mpFontList != NULL ) - { - return mpFontList; - } - else - { - const_cast(this)->mpFactory = new AttributeProvider; - const_cast(this)->mpFontList = new XlfdStorage; - const_cast(this)->mpFallbackFactory = new VirtualXlfd; - - int i, nFontCount; - const int nMaxCount = 64 * 1024 - 1; - Display *pDisplay = GetDisplay(); - char **ppFontList = XListFonts(pDisplay, "-*", nMaxCount, &nFontCount); - - // - // create a list of simple Xlfd font information - // - - Xlfd *pXlfdList = (Xlfd*)malloc( nFontCount * sizeof(Xlfd) ); - int nXlfdCount = 0; - - for ( i = 0; i < nFontCount; i++ ) - { - if ( pXlfdList[ nXlfdCount ].FromString(ppFontList[i], mpFactory) ) - ++nXlfdCount; - } - - XFreeFontNames( ppFontList ); - - mpFactory->AddClassification(); - // add some pretty print description - mpFactory->AddAnnotation(); - // misc feature checking - mpFactory->TagFeature(); - - // sort according to font style - qsort( pXlfdList, nXlfdCount, sizeof(Xlfd), XlfdCompare ); - -#ifndef _USE_PRINT_EXTENSION_ - // create a list of fonts already managed by the fontmanager - FontLookup::fl_hashset aSet; - FontLookup::BuildSet (aSet); -#endif - - // - // create a font list with merged encoding information - // - - BitmapXlfdStorage aBitmapList; - ScalableXlfd *pScalableFont = NULL; - - int nFrom = 0; - for ( i = 0; i < nXlfdCount; i++ ) - { - // exclude openlook glyph and cursor - Attribute *pAttr = mpFactory->RetrieveFamily(pXlfdList[i].mnFamily); - if ( pAttr->HasFeature( XLFD_FEATURE_OL_GLYPH - | XLFD_FEATURE_OL_CURSOR) ) - continue; - // exclude fonts with unknown encoding - if ( pXlfdList[i].GetEncoding() == RTL_TEXTENCODING_DONTKNOW ) - continue; - // exclude "interface system" and "interface user" - if (pAttr->HasFeature( XLFD_FEATURE_APPLICATION_FONT ) ) - continue; - // exclude fonts already managed by fontmanager, anyway keep - // gui fonts: they are candidates for GetInterfaceFont () - if (pXlfdList[i].Fonttype() == eTypeScalable) - ((VirtualXlfd*)mpFallbackFactory)->FilterInterfaceFont (pXlfdList + i); -#ifndef _USE_PRINT_EXTENSION_ - if (FontLookup::InSet (aSet, pXlfdList[i])) - continue; -#endif - Bool bSameOutline = pXlfdList[i].SameFontoutline(pXlfdList + nFrom); - XlfdFonttype eType = pXlfdList[i].Fonttype(); - - // flush the old merged font list if the name doesn't match any more - if ( !bSameOutline ) - { - mpFontList->Add( pScalableFont ); - mpFontList->Add( &aBitmapList ); - pScalableFont = NULL; - aBitmapList.Reset(); - } - - // merge the font or generate a new one - switch( eType ) - { - case eTypeScalable: - if ( pScalableFont == NULL ) - pScalableFont = new ScalableXlfd; - pScalableFont->AddEncoding(pXlfdList + i); - break; - - case eTypeBitmap: - aBitmapList.AddBitmapFont( pXlfdList + i ); - break; - - case eTypeScalableBitmap: - // ignore scaled X11 bitmap fonts because they look too ugly - default: - break; - } - - nFrom = i; - } - - // flush the merged list into the global list - mpFontList->Add( pScalableFont ); - mpFontList->Add( &aBitmapList ); - if (mpFallbackFactory->NumEncodings() > 0) - mpFontList->Add( mpFallbackFactory ); - // cleanup the list of simple font information - if ( pXlfdList != NULL ) - free( pXlfdList ); - - return mpFontList; - } -} - -// --------------------------------------------------------------------------- - -ExtendedFontStruct* -SalDisplay::GetFont( const ExtendedXlfd *pRequestedFont, - const Size& rPixelSize, sal_Bool bVertical ) const -{ - // TODO: either get rid of X11 fonts or get rid of the non-hashmapped cache - if( !m_pFontCache ) - { - m_pFontCache = new SalFontCache( 64, 64, 16 ); // ??? - } - else - { - ExtendedFontStruct *pItem; - for ( pItem = m_pFontCache->First(); - pItem != NULL; - pItem = m_pFontCache->Next() ) - { - if ( pItem->Match(pRequestedFont, rPixelSize, bVertical) ) - { - if( m_pFontCache->GetCurPos() ) - { - m_pFontCache->Remove( pItem ); - m_pFontCache->Insert( pItem, 0UL ); - } - return pItem; - } - } - } - - // before we expand the cache, we look for very old and unused items - if( m_pFontCache->Count() >= 64 ) - { - ExtendedFontStruct *pItem; - for ( pItem = m_pFontCache->Last(); - pItem != NULL; - pItem = m_pFontCache->Prev() ) - { - if( 1 == pItem->GetRefCount() ) - { - m_pFontCache->Remove( pItem ); - pItem->ReleaseRef(); - if( m_pFontCache->Count() < 64 ) - break; - } - } - } - - ExtendedFontStruct *pItem = new ExtendedFontStruct( GetDisplay(), - rPixelSize, bVertical, - const_cast(pRequestedFont) ); - m_pFontCache->Insert( pItem, 0UL ); - pItem->AddRef(); - - return pItem; -} - -// --------------------------------------------------------------------------- - -void -SalDisplay::DestroyFontCache() -{ - if( m_pFontCache ) - { - ExtendedFontStruct *pItem = m_pFontCache->First(); - while( pItem ) - { - delete pItem; - pItem = m_pFontCache->Next(); - } - delete m_pFontCache; - } - if( mpFontList ) - { - mpFontList->Dispose(); - delete mpFontList; - } - if ( mpFactory ) - { - delete mpFactory; - } - - m_pFontCache = (SalFontCache*)NULL; - mpFontList = (XlfdStorage*)NULL; - mpFactory = (AttributeProvider*)NULL; -} - // =========================================================================== // PspKernInfo allows on-demand-querying of psprint provided kerning info (#i29881#) @@ -538,7 +149,7 @@ void PspKernInfo::Initialize() const // ---------------------------------------------------------------------------- GC -X11SalGraphics::SelectFont() +X11SalGraphics::GetFontGC() { Display *pDisplay = GetXDisplay(); @@ -594,8 +205,6 @@ bool X11SalGraphics::setFont( const ImplFontSelectData *pEntry, int nFallbackLev // release all no longer needed font resources for( int i = nFallbackLevel; i < MAX_FALLBACK; ++i ) { - mXFont[i] = NULL; // ->ReleaseRef() - if( mpServerFont[i] != NULL ) { // old server side font is no longer referenced @@ -614,18 +223,6 @@ bool X11SalGraphics::setFont( const ImplFontSelectData *pEntry, int nFallbackLev if( !pEntry->mpFontData ) return false; - // handle the request for a native X11-font - if( ImplX11FontData::CheckFontData( *pEntry->mpFontData ) ) - { - const ImplX11FontData* pRequestedFont = static_cast( pEntry->mpFontData ); - const ExtendedXlfd& rX11Font = pRequestedFont->GetExtendedXlfd(); - - Size aReqSize( pEntry->mnWidth, pEntry->mnHeight ); - mXFont[ nFallbackLevel ] = GetDisplay()->GetFont( &rX11Font, aReqSize, bFontVertical_ ); - bFontGC_ = FALSE; - return true; - } - // handle the request for a non-native X11-font => use the GlyphCache ServerFont* pServerFont = GlyphCache::GetInstance().CacheFont( *pEntry ); if( pServerFont != NULL ) @@ -674,83 +271,6 @@ void ImplServerFontEntry::HandleFontOptions( void ) //-------------------------------------------------------------------------- -inline sal_Unicode SwapBytes( const sal_Unicode nIn ) -{ - return ((nIn >> 8) & 0x00ff) | ((nIn & 0x00ff) << 8); -} - -// draw string in a specific multibyte encoding -static void -ConvertTextItem16( XTextItem16* pTextItem, rtl_TextEncoding nEncoding ) -{ - if ( (pTextItem == NULL) || (pTextItem->nchars <= 0) ) - return; - - SalConverterCache* pCvt = SalConverterCache::GetInstance(); - // convert the string into the font encoding - sal_Size nSize; - sal_Size nBufferSize = pTextItem->nchars * 2; - sal_Char *pBuffer = (sal_Char*)alloca( nBufferSize ); - - nSize = pCvt->ConvertStringUTF16( (sal_Unicode*)pTextItem->chars, pTextItem->nchars, - pBuffer, nBufferSize, nEncoding); - - sal_Char *pTextChars = (sal_Char*)pTextItem->chars; - unsigned int n = 0, m = 0; - - if ( nEncoding == RTL_TEXTENCODING_GB_2312 - || nEncoding == RTL_TEXTENCODING_GBT_12345 - || nEncoding == RTL_TEXTENCODING_GBK - || nEncoding == RTL_TEXTENCODING_BIG5 ) - { - // GB and Big5 needs special treatment since chars can be single or - // double byte: encoding is - // [ 0x00 - 0x7f ] | [ 0x81 - 0xfe ] [ 0x40 - 0x7e 0x80 - 0xfe ] - while ( n < nSize ) - { - if ( (unsigned char)pBuffer[ n ] < 0x80 ) - { - pTextChars[ m++ ] = 0x0; - pTextChars[ m++ ] = pBuffer[ n++ ]; - } - else - { - pTextChars[ m++ ] = pBuffer[ n++ ]; - pTextChars[ m++ ] = pBuffer[ n++ ]; - } - } - pTextItem->nchars = m / 2; - } - else - if ( pCvt->IsSingleByteEncoding(nEncoding) ) - { - // Single Byte encoding has to be padded - while ( n < nSize ) - { - pTextChars[ m++ ] = 0x0; - pTextChars[ m++ ] = pBuffer[ n++ ]; - } - pTextItem->nchars = nSize; - } - else - { - while ( n < nSize ) - { - pTextChars[ m++ ] = pBuffer[ n++ ]; - } - pTextItem->nchars = nSize / 2; - } - - // XXX FIXME - if ( (nEncoding == RTL_TEXTENCODING_GB_2312) - || (nEncoding == RTL_TEXTENCODING_EUC_KR) ) - { - for (unsigned int n_char = 0; n_char < m; n_char++ ) - pTextChars[ n_char ] &= 0x7F; - } -} - -//-------------------------------------------------------------------------- namespace { class CairoWrapper @@ -1289,7 +809,7 @@ bool X11SalGraphics::DrawServerAAForcedString( const ServerFontLayout& rLayout ) } // prepare context - GC nGC = SelectFont(); + GC nGC = GetFontGC(); XGCValues aGCVal; XGetGCValues( pDisplay, nGC, GCForeground, &aGCVal ); @@ -1376,7 +896,7 @@ void X11SalGraphics::DrawServerSimpleFontString( const ServerFontLayout& rSalLay X11GlyphPeer& rGlyphPeer = X11GlyphCache::GetInstance().GetPeer(); Display* pDisplay = GetXDisplay(); - GC nGC = SelectFont(); + GC nGC = GetFontGC(); XGCValues aGCVal; aGCVal.fill_style = FillStippled; @@ -1439,61 +959,6 @@ void X11SalGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout ) //-------------------------------------------------------------------------- -void X11SalGraphics::DrawStringUCS2MB( ExtendedFontStruct& rFont, - const Point& rPoint, const sal_Unicode* pStr, int nLength ) -{ - Display* pDisplay = GetXDisplay(); - GC nGC = SelectFont(); - - if( rFont.GetAsciiEncoding() == RTL_TEXTENCODING_UNICODE ) - { - // plain Unicode, can handle all chars and can be handled straight forward - XFontStruct* pFontStruct = rFont.GetFontStruct( RTL_TEXTENCODING_UNICODE ); - if( !pFontStruct ) - return; - - XSetFont( pDisplay, nGC, pFontStruct->fid ); - - #ifdef OSL_LITENDIAN - sal_Unicode *pBuffer = (sal_Unicode*)alloca( nLength * sizeof(sal_Unicode) ); - for ( int i = 0; i < nLength; i++ ) - pBuffer[ i ] = SwapBytes(pStr[ i ]) ; - #else - sal_Unicode *pBuffer = const_cast(pStr); - #endif - - XDrawString16( pDisplay, hDrawable_, nGC, rPoint.X(), rPoint.Y(), (XChar2b*)pBuffer, nLength ); - } - else - { - XTextItem16 *pTextItem = (XTextItem16*)alloca( nLength * sizeof(XTextItem16) ); - XChar2b *pMBChar = (XChar2b*)pStr; - int nItem = 0; - - DBG_ASSERT( nLength<=1, "#i49902# DrawStringUCS2MB with nLength>1 => problems with XOrg6.8.[0123]"); - - for( int nChar = 0; nChar < nLength; ++nChar ) - { - rtl_TextEncoding nEnc; - XFontStruct* pFontStruct = rFont.GetFontStruct( pStr[nChar], &nEnc ); - if( !pFontStruct ) - continue; - - pTextItem[ nItem ].chars = pMBChar + nChar; - pTextItem[ nItem ].delta = 0; - pTextItem[ nItem ].font = pFontStruct->fid; - pTextItem[ nItem ].nchars = 1; - - ConvertTextItem16( &pTextItem[ nItem ], nEnc ); - ++nItem; - } - - XDrawText16( pDisplay, hDrawable_, nGC, rPoint.X(), rPoint.Y(), pTextItem, nItem ); - } -} - -//-------------------------------------------------------------------------- - const ImplFontCharMap* X11SalGraphics::GetImplFontCharMap() const { if( !mpServerFont[0] ) @@ -1528,7 +993,6 @@ X11SalGraphics::SetTextColor( SalColor nSalColor ) { nTextColor_ = nSalColor; nTextPixel_ = GetPixel( nSalColor ); - bFontGC_ = FALSE; } } @@ -1575,15 +1039,6 @@ void RegisterFontSubstitutors( ImplDevFontList* ); void X11SalGraphics::GetDevFontList( ImplDevFontList *pList ) { - // allow disabling of native X11 fonts - static const char* pEnableX11FontStr = getenv( "SAL_ENABLE_NATIVE_XFONTS" ); - if( pEnableX11FontStr && (pEnableX11FontStr[0] != '0') ) - { - // announce X11 fonts - XlfdStorage* pX11FontList = GetDisplay()->GetXlfdList(); - pX11FontList->AnnounceFonts( pList ); - } - // prepare the GlyphCache using psprint's font infos X11GlyphCache& rGC = X11GlyphCache::GetInstance(); @@ -1766,12 +1221,6 @@ X11SalGraphics::GetFontMetric( ImplFontMetricData *pMetric, int nFallbackLevel ) long rDummyFactor; mpServerFont[nFallbackLevel]->FetchFontMetric( *pMetric, rDummyFactor ); } - else if( mXFont[nFallbackLevel] != NULL ) - { - mXFont[nFallbackLevel]->ToImplFontMetricData( pMetric ); - if ( bFontVertical_ ) - pMetric->mnOrientation = 0; - } } // --------------------------------------------------------------------------- @@ -1859,10 +1308,6 @@ SalLayout* X11SalGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLe #endif pLayout = new ServerFontLayout( *mpServerFont[ nFallbackLevel ] ); } - else if( mXFont[ nFallbackLevel ] ) - pLayout = new X11FontLayout( *mXFont[ nFallbackLevel ] ); - else - pLayout = NULL; return pLayout; } diff --git a/vcl/unx/source/gdi/xfont.cxx b/vcl/unx/source/gdi/xfont.cxx deleted file mode 100644 index f6d19909cd4a..000000000000 --- a/vcl/unx/source/gdi/xfont.cxx +++ /dev/null @@ -1,780 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_vcl.hxx" - -#include -#include "xfont.hxx" -#include "xlfd_extd.hxx" -#include "salcvt.hxx" -#include -#include -#include -#include - -// for GetMirroredChar -#include - -#if OSL_DEBUG_LEVEL > 1 -#include -#endif - -#include - -#define VCLASS_ROTATE 0 -#define VCLASS_ROTATE_REVERSE 1 -#define VCLASS_TRANSFORM1 2 -#define VCLASS_TRANSFORM2 3 -#define VCLASS_CJK 4 -#define VCLASS_DONTKNOW 5 -#define VCLASS_FONT_NUM 2 // Other than rotate and rotate_reverse, - // don't have spacial font - -// Select the max size of a font, which is token for real -// This routine is (and should be) called only once, the result should be -// stored in some static variable - -static int GetMaxFontHeight() -{ - static int nMaxFontHeight = 0; - if( nMaxFontHeight <= 0 ) - { - const char *pFontHeight = getenv ("SAL_MAXFONTHEIGHT"); - if( pFontHeight ) - nMaxFontHeight = atoi( pFontHeight ); - static const int DEFAULT_MAXFONTHEIGHT = 250; - if (nMaxFontHeight <= 20) - nMaxFontHeight = DEFAULT_MAXFONTHEIGHT; - } - - return nMaxFontHeight; -} - - -ExtendedFontStruct::ExtendedFontStruct( Display* pDisplay, const Size& rPixelSize, - sal_Bool bVertical, ExtendedXlfd* pXlfd ) : - mpDisplay( pDisplay ), - maPixelSize( rPixelSize ), - mfXScale(1.0), mfYScale(1.0), - mbVertical( bVertical ), - mnCachedEncoding( RTL_TEXTENCODING_DONTKNOW ), - mpXlfd( pXlfd ), - mpRangeCodes(NULL), - mnRangeCount(-1) -{ - if( !maPixelSize.Width() ) - maPixelSize.Width() = maPixelSize.Height(); - mnAsciiEncoding = GetAsciiEncoding (NULL); - mnDefaultWidth = GetDefaultWidth(); - - mpXFontStruct = (XFontStruct**)calloc( mpXlfd->NumEncodings(), - sizeof(XFontStruct*) ); -} - -ExtendedFontStruct::~ExtendedFontStruct() -{ - delete[] mpRangeCodes; - - for ( int nIdx = 0; nIdx < mpXlfd->NumEncodings(); nIdx++ ) - if ( mpXFontStruct[nIdx] != NULL ) - XFreeFont( mpDisplay, mpXFontStruct[nIdx] ); - - free(mpXFontStruct); -} - -rtl_TextEncoding -ExtendedFontStruct::GetAsciiEncoding( int *pAsciiRange ) const -{ - return mpXlfd->GetAsciiEncoding( pAsciiRange ); -} - -FontPitch -ExtendedFontStruct::GetSpacing( rtl_TextEncoding nEncoding ) -{ - return mpXlfd->GetPitch( nEncoding ); -} - -static XFontStruct* -LoadXFont (Display* pDisplay, const char* pFontName) -{ - XFontStruct* pFont = XLoadQueryFont (pDisplay, pFontName); - if ((pFont != NULL) && (pFont->fid == 0)) - pFont->fid = XLoadFont(pDisplay, pFontName); - -#ifdef HDU_DEBUG - fprintf( stderr, "XLoadFont \"%s\" => %d\n", pFontName, (pFont!= NULL) ); -#endif - return pFont; -} - -int -ExtendedFontStruct::LoadEncoding( rtl_TextEncoding nEncoding ) -{ - int nIdx = mpXlfd->GetEncodingIdx( nEncoding ); - if ( (nIdx < 0) || (mpXFontStruct[ nIdx ] != NULL) ) - return nIdx; - - // limit font height that gets requested from the XServer - // see BugId #44528# FontWork (-> #45038#) and as well Bug #47127# - int nReqPixelHeight = maPixelSize.Height(); - if( nReqPixelHeight > GetMaxFontHeight() ) - nReqPixelHeight = GetMaxFontHeight(); - else if( nReqPixelHeight < 2 ) - nReqPixelHeight = 2; - - // get the X11 font from a matching XLFD - ByteString aFontName; - mpXlfd->ToString( aFontName, nReqPixelHeight, nEncoding ); - mpXFontStruct[ nIdx ] = LoadXFont( mpDisplay, aFontName.GetBuffer() ); - if (mpXFontStruct[nIdx] == NULL) - mpXFontStruct[nIdx] = LoadXFont( mpDisplay, "fixed" ); - - // calculate correction factors to improve matching - // the selected font size to the used bitmap font - int nRealPixelSize = mpXlfd->GetPixelSize(); - if( !nRealPixelSize ) // check for scalable mpXlfd - nRealPixelSize = nReqPixelHeight; - if( nRealPixelSize && (nRealPixelSize != maPixelSize.Width()) ) - mfXScale = (float)maPixelSize.Width() / nRealPixelSize; - if( nRealPixelSize && (nRealPixelSize != maPixelSize.Height()) ) - mfYScale = (float)maPixelSize.Height() / nRealPixelSize; - - return nIdx; -} - -XFontStruct* -ExtendedFontStruct::GetFontStruct( rtl_TextEncoding nEncoding ) -{ - int nIdx = LoadEncoding( nEncoding ); - return nIdx < 0 ? NULL : mpXFontStruct[nIdx] ; -} - -bool -ExtendedFontStruct::GetFontBoundingBox( XCharStruct *pCharStruct, - int *pAscent, int *pDescent ) -{ - pCharStruct->lbearing = 0; - pCharStruct->rbearing = 0; - pCharStruct->width = 0; - pCharStruct->ascent = 0; - pCharStruct->descent = 0; - - *pAscent = 0; - *pDescent = 0; - - int nIdx; - - // check if there is at least one encoding already loaded - bool bEmpty = true; - for ( nIdx = 0; nIdx < mpXlfd->NumEncodings(); nIdx++ ) - bEmpty &= (mpXFontStruct[nIdx] == NULL); - if ( bEmpty ) - LoadEncoding( mpXlfd->GetAsciiEncoding() ); - - // get the max bounding box from all font structs - for ( nIdx = 0; nIdx < mpXlfd->NumEncodings(); nIdx++ ) - if ( mpXFontStruct[ nIdx ] != NULL ) - { - *pAscent = std::max( mpXFontStruct[nIdx]->ascent, *pAscent ); - *pDescent = std::max( mpXFontStruct[nIdx]->descent, *pDescent ); - - XCharStruct* pMaxBounds = &(mpXFontStruct[nIdx]->max_bounds); - - pCharStruct->lbearing = std::max( pMaxBounds->lbearing, - pCharStruct->lbearing ); - pCharStruct->rbearing = std::max( pMaxBounds->rbearing, - pCharStruct->rbearing ); - pCharStruct->width = std::max( pMaxBounds->width, - pCharStruct->width ); - pCharStruct->ascent = std::max( pMaxBounds->ascent, - pCharStruct->ascent ); - pCharStruct->descent = std::max( pMaxBounds->descent, - pCharStruct->descent ); - } - - // apply correction factors to better match selected size to available size - if( mfYScale != 1.0 ) - { - *pAscent = int(*pAscent * mfYScale); - *pDescent = int(*pDescent * mfYScale); - pCharStruct->ascent = (short int)(pCharStruct->ascent * mfYScale); - pCharStruct->descent = (short int)(pCharStruct->descent * mfYScale); - } - if( mfXScale != 1.0 ) - { - pCharStruct->lbearing = (short int)(pCharStruct->lbearing * mfXScale); - pCharStruct->rbearing = (short int)(pCharStruct->rbearing * mfXScale); - pCharStruct->width = (short int)(pCharStruct->width * mfXScale); - } - - return (pCharStruct->width > 0); -} - -bool -ExtendedFontStruct::ToImplFontMetricData(ImplFontMetricData *pFontMetric) -{ - pFontMetric->mnOrientation = 0; - pFontMetric->mnSlant = 0; - pFontMetric->mbDevice = true; - pFontMetric->mbScalableFont = mpXlfd->IsScalable(); - pFontMetric->mbKernableFont = false; - pFontMetric->mbSymbolFlag= mpXlfd->IsSymbolFont(); - pFontMetric->meFamily = mpXlfd->GetFamilyType(); - pFontMetric->meWeight = mpXlfd->GetWeight(); - pFontMetric->mePitch = mpXlfd->GetPitch(); - pFontMetric->meItalic = mpXlfd->GetSlant(); - - int nAscent, nDescent; - XCharStruct aBoundingBox; - if ( GetFontBoundingBox(&aBoundingBox, &nAscent, &nDescent) ) - { - pFontMetric->mnWidth = aBoundingBox.width; - pFontMetric->mnAscent = aBoundingBox.ascent; - pFontMetric->mnDescent = aBoundingBox.descent; - pFontMetric->mnIntLeading = std::max(0, aBoundingBox.ascent - nAscent - + aBoundingBox.descent - nDescent ); - pFontMetric->mnExtLeading = 0; // TODO!!! - return true; - } - else - { - return false; - } -} - -bool -ExtendedFontStruct::Match( const ExtendedXlfd *pXlfd, - const Size& rPixelSize, sal_Bool bVertical ) const -{ - if( mpXlfd != pXlfd ) - return false; - - if( bVertical != mbVertical ) - return FALSE; - - if( rPixelSize.Height() != maPixelSize.Height() ) - return FALSE; - - long nReqWidth = rPixelSize.Width(); - if( !nReqWidth ) - nReqWidth = rPixelSize.Height(); - if( nReqWidth != maPixelSize.Width() ) - return FALSE; - - return true; -} - -// Get an appropriate x-font that contains a glyph for the given unicode -// code point. -// This routine is designed to be called for each character in a text. -// It first checks the given encoding to optimize for the fact that two -// adjacent characters in a text most probably have the same encoding -// In the first call initialize pEncodingInOut to dontknow, this causes -// EncodingHasChar() to fail and thus bootstraps the encoding, otherwise -// make sure that the initial value of pFontInOut matches the encoding and -// that the encoding is valid for the font. -XFontStruct* -ExtendedFontStruct::GetFontStruct( sal_Unicode nChar, rtl_TextEncoding *pEncoding ) -{ - SalConverterCache *pCvt = SalConverterCache::GetInstance(); - - if ( pCvt->EncodingHasChar(mnAsciiEncoding, nChar) ) - { - *pEncoding = mnAsciiEncoding; - return GetFontStruct (mnAsciiEncoding); - } - else - if ( pCvt->EncodingHasChar(mnCachedEncoding, nChar) ) - { - *pEncoding = mnCachedEncoding; - return GetFontStruct (mnCachedEncoding); - } - else - { - for ( int nIdx = 0; nIdx < mpXlfd->NumEncodings(); nIdx++ ) - { - rtl_TextEncoding nEnc = mpXlfd->GetEncoding(nIdx); - if ( (nEnc != mnCachedEncoding) && (nEnc != mnAsciiEncoding) - && pCvt->EncodingHasChar(nEnc, nChar)) - { - mnCachedEncoding = nEnc; - *pEncoding = mnCachedEncoding; - return GetFontStruct (mnCachedEncoding); - } - } - } - - *pEncoding = RTL_TEXTENCODING_DONTKNOW; - return NULL; -} - -// --------------------------------------------------------------------------- -// utility functions to handle xfontstruct information, this is all to -// calculate charwidth information -// --------------------------------------------------------------------------- - -static bool -CharExists( const XCharStruct* pChar ) -{ - if ( pChar == NULL ) - return false; - - return pChar->width - || pChar->ascent || pChar->descent - || pChar->lbearing || pChar->rbearing; -} - -// this relies on non-null per_char information in the fontstruct -static XCharStruct* -GetCharinfo( const XFontStruct *pXFontStruct, sal_MultiByte nChar ) -{ - unsigned int nRow = nChar >> 8; - unsigned int nCol = nChar & 0xFF; - - unsigned int nMinRow = pXFontStruct->min_byte1; - unsigned int nMaxRow = pXFontStruct->max_byte1; - unsigned int nMinCol = pXFontStruct->min_char_or_byte2; - unsigned int nMaxCol = pXFontStruct->max_char_or_byte2; - - if ( nRow >= nMinRow && nRow <= nMaxRow - && nCol >= nMinCol && nCol <= nMaxCol ) - { - return &pXFontStruct->per_char[ - (nRow-nMinRow) * (nMaxCol-nMinCol+1) + (nCol-nMinCol) ]; - } - - return NULL; -} - -static sal_Size -QueryCharWidth16( Display* pDisplay, XLIB_Font nFontID, sal_MultiByte nChar, - sal_Size nDefaultWidth ) -{ - int nDirection, nFontAscent, nFontDescent; - XCharStruct aBoundingBox; - - XQueryTextExtents16( pDisplay, nFontID, (XChar2b*)&nChar, 1, - &nDirection, &nFontAscent, &nFontDescent, &aBoundingBox ); - - return CharExists( &aBoundingBox ) ? aBoundingBox.width : nDefaultWidth; -} - -#if 0 -// currently not used -static sal_Size -QueryCharWidth8( XFontStruct* pXFontStruct, sal_Char nChar, - sal_Size nDefaultWidth ) -{ - int nDirection, nFontAscent, nFontDescent; - XCharStruct aBoundingBox; - - XTextExtents( pXFontStruct, &nChar, 1, - &nDirection, &nFontAscent, &nFontDescent, &aBoundingBox ); - - return CharExists( &aBoundingBox ) ? aBoundingBox.width : nDefaultWidth; -} -#endif - -sal_Size -ExtendedFontStruct::GetDefaultWidth() -{ - return (maPixelSize.Width() + 1) / 2; -} - -// Handle single byte fonts which do not require conversion, this exploits -// the fact that unicode equals latin1 or ansi1252 in the range [0..0xff] and -// is compatible with iso8859-X at least in the range to 0x7f -sal_Size -ExtendedFontStruct::GetCharWidth8( sal_Unicode nFrom, sal_Unicode nTo, - sal_Int32* pWidthArray, rtl_TextEncoding nEncoding ) -{ - if ( !(nFrom <= nTo) ) - return 0; - - XFontStruct* pXFontStruct = GetFontStruct( nEncoding ); - if ( pXFontStruct == NULL ) - return 0; - - // query the font metrics - if ( (pXFontStruct->max_bounds.width == pXFontStruct->min_bounds.width) - || (pXFontStruct->per_char == NULL) ) - { - // fixed width font - for ( int nIdx = nFrom; nIdx <= nTo; nIdx++, pWidthArray++ ) - *pWidthArray = pXFontStruct->max_bounds.width; - } - else - { - // variable width font - int nMinChar = pXFontStruct->min_char_or_byte2; - int nMaxChar = pXFontStruct->max_char_or_byte2; - - int nIdx = nFrom; - - for ( ; nIdx < std::min((int)nTo, nMinChar); nIdx++, pWidthArray++ ) - *pWidthArray = mnDefaultWidth; - for ( ; nIdx <= std::min((int)nTo, nMaxChar); nIdx++, pWidthArray++ ) - { - XCharStruct* pChar = &(pXFontStruct->per_char[nIdx - nMinChar]); - *pWidthArray = CharExists(pChar) ? pChar->width : mnDefaultWidth; - } - for ( ; nIdx <= nTo; nIdx++, pWidthArray++ ) - *pWidthArray = mnDefaultWidth; - } - - // return amount of handled chars - return nTo - nFrom + 1; -} - -// Handle utf16 encoded fonts, which do not require conversion -sal_Size -ExtendedFontStruct::GetCharWidthUTF16( sal_Unicode nFrom, sal_Unicode nTo, - sal_Int32* pWidthArray ) -{ - if ( !(nFrom <= nTo) ) - return 0; - - XFontStruct* pXFontStruct = GetFontStruct( RTL_TEXTENCODING_UNICODE ); - FontPitch nSpacing = mpXlfd->GetPitch( RTL_TEXTENCODING_UNICODE ); - - if ( pXFontStruct == NULL ) - return 0; - - // query the font metrics - if ( nSpacing == PITCH_VARIABLE - && pXFontStruct->per_char == NULL) - { - // get per_char information from the server - for ( sal_Int32 nIdx = nFrom; nIdx <= nTo; nIdx++, pWidthArray++ ) - *pWidthArray = QueryCharWidth16( mpDisplay, pXFontStruct->fid, - nIdx, mnDefaultWidth ); - } - else - if ( (pXFontStruct->max_bounds.width == pXFontStruct->min_bounds.width) - || (pXFontStruct->per_char == NULL) ) - { - // really a fixed width font - for ( sal_Int32 nIdx = nFrom; nIdx <= nTo; nIdx++, pWidthArray++ ) - *pWidthArray = pXFontStruct->max_bounds.width; - } - else - { - // get per_char information from the xfontstruct - for ( sal_Int32 nIdx = nFrom; nIdx <= nTo; nIdx++, pWidthArray++ ) - { - XCharStruct* pChar = GetCharinfo( pXFontStruct, nIdx ); - *pWidthArray = CharExists(pChar) ? pChar->width : mnDefaultWidth; - } - } - - // return amount of handled chars - return nTo - nFrom + 1; -} - -// handle non unicode fonts that are converted into encoding matching the -// font in fontstruct, 8 and 16 bit fonts are handled the same way -sal_Size -ExtendedFontStruct::GetCharWidth16( sal_Unicode nFrom, sal_Unicode nTo, - sal_Int32* pWidthArray, ExtendedFontStruct *pFallback ) -{ - if ( nFrom > nTo ) - return 0; - - sal_Char pBuffer[64]; - - SalConverterCache *pCvt = SalConverterCache::GetInstance(); - for ( sal_Int32 nIdx = nFrom ; nIdx <= nTo ; nIdx++, pWidthArray++ ) - { - FontPitch nSpacing; - sal_Size nSize; - sal_Unicode nUniIdx = (sal_Unicode)nIdx; - - // get a matching fontstruct - rtl_TextEncoding nEnc; - XFontStruct *pFont; - - if ( (pFont = GetFontStruct(nUniIdx, &nEnc)) != NULL ) - { - nSpacing = GetSpacing( nEnc ); - } - else - if ( (pFallback != NULL) - && ((pFont = pFallback->GetFontStruct(nUniIdx, &nEnc)) != NULL) ) - { - nSpacing = pFallback->GetSpacing( nEnc ); - } - else - if ( (pFallback != NULL) - && ((pFont = pFallback->GetFontStruct(nUniIdx = '?', &nEnc)) != NULL) ) - { - nSpacing = pFallback->GetSpacing( nEnc ); - } - else - { - // TODO What should the default value be? - nSpacing = PITCH_FIXED; - } - - if ( pFont ) - { - nSize = pCvt->ConvertStringUTF16(&nUniIdx, 1, pBuffer, sizeof(pBuffer), nEnc); - // XXX FIXME - if ((nEnc == RTL_TEXTENCODING_GB_2312) || (nEnc == RTL_TEXTENCODING_EUC_KR)) - { - for (unsigned int n_char = 0; n_char < nSize; n_char++ ) - pBuffer[ n_char ] &= 0x7F; - } - } - - // query font metrics - if ( pFont && (nSize == 1 || nSize == 2) ) - { - sal_MultiByte nChar = (nSize == 1) ? (unsigned char)pBuffer[0] : - ((sal_MultiByte)pBuffer[0] << 8) + (sal_MultiByte)pBuffer[1]; - - if ( nSpacing == PITCH_VARIABLE - && pFont->per_char == NULL) - { - // get per_char information from the x-server - *pWidthArray = QueryCharWidth16( mpDisplay, pFont->fid, - nChar, mnDefaultWidth ); - } - else - if ( (pFont->max_bounds.width == pFont->min_bounds.width) - || (pFont->per_char == NULL) ) - { - // fixed width font - *pWidthArray = pFont->max_bounds.width; - } - else - { - // get per_char information from the xfontstruct - XCharStruct* pChar = GetCharinfo( pFont, nChar ); - *pWidthArray = CharExists(pChar) ? pChar->width : mnDefaultWidth; - } - } - else - { - // conversion error - *pWidthArray = mnDefaultWidth; - } - } - - // return amount of handled chars - return nTo - nFrom + 1; -} - -sal_Size -ExtendedFontStruct::GetCharWidth( sal_Unicode cChar, sal_Int32 *pPhysicalWidth, - sal_Int32 *pLogicalWidth ) -{ - sal_Size nConverted = 0; - - // dispatch querying of metrics to most promising encoding candidate - int nAsciiRange; - rtl_TextEncoding nEncoding = mpXlfd->GetAsciiEncoding(&nAsciiRange); - if ( nEncoding == RTL_TEXTENCODING_UNICODE ) - { - // if we have a unicode encoded system font than we get the charwidth - // straight forward - nConverted = GetCharWidthUTF16( cChar, cChar, pPhysicalWidth ); - } - else - { - if ( cChar < nAsciiRange ) - { - // optimize the most frequent case, requesting only the latin1 - // chars which are mappable to a single encoding - nConverted = GetCharWidth8( cChar, cChar, pPhysicalWidth, nEncoding ); - } - - // if further requests are pending, then the according unicode - // codepoint has to be dispatched to one of the system fonts and - // converted to this fonts encoding - nConverted += GetCharWidth16( cChar + nConverted, cChar, - pPhysicalWidth + nConverted, NULL ); - } - - // convert physical width to logical width, apply correction factor if needed - *pLogicalWidth = *pPhysicalWidth; - if( mfXScale != 1.0 ) - *pLogicalWidth = sal_Int32(*pLogicalWidth * mfXScale); - - return nConverted; -} - -bool ExtendedFontStruct::HasUnicodeChar( sal_Unicode cChar ) const -{ - // #i18818# return false if there are no known encodings - if( !mnRangeCount ) - return false; - - // init unicode range cache if needed - if( mnRangeCount < 0 ) - { - mnRangeCount = mpXlfd->GetFontCodeRanges( NULL ); - if( !mnRangeCount ) - return false; - mpRangeCodes = new sal_uInt32[ 2*mnRangeCount ]; - mpXlfd->GetFontCodeRanges( mpRangeCodes ); - // TODO: make sure everything is sorted - } - - // binary search in unicode ranges - int nLower = 0; - int nMid = mnRangeCount; - int nUpper = 2 * mnRangeCount - 1; - while( nLower < nUpper ) - { - if( cChar >= mpRangeCodes[ nMid ] ) - nLower = nMid; - else - nUpper = nMid - 1; - nMid = (nLower + nUpper + 1) / 2; - } - if( (nMid == 0) && (cChar < mpRangeCodes[0]) ) - return false; - return (nMid & 1) ? false: true; -} - -int ExtendedFontStruct::GetFontCodeRanges( sal_uInt32* pCodePairs ) const -{ - // make sure unicode range cache is initialized - HasUnicodeChar(0); - - // transfer range pairs if requested - if( pCodePairs ) - { - for( int i = 0; i < 2*mnRangeCount; ++i ) - pCodePairs[i] = mpRangeCodes[i]; - } - - return mnRangeCount; -} - -// ======================================================================= - -X11FontLayout::X11FontLayout( ExtendedFontStruct& rFont ) -: mrFont( rFont ) -{} - -// ----------------------------------------------------------------------- - -bool X11FontLayout::LayoutText( ImplLayoutArgs& rArgs ) -{ - Point aNewPos( 0, 0 ); - bool bRightToLeft; - int nCharPos; - - for( nCharPos = -1; rArgs.GetNextPos( &nCharPos, &bRightToLeft ); ) - { - sal_UCS4 cChar = rArgs.mpStr[ nCharPos ]; - if( bRightToLeft ) - cChar = GetMirroredChar( cChar ); - int nGlyphIndex = cChar | GF_ISCHAR; - - // check if the font supports the char - if( !mrFont.HasUnicodeChar( cChar ) ) - { - // try to replace the failing char using the same font - const char* pApproxUTF8 = GetAutofallback( cChar ); - cChar = 0; - if( pApproxUTF8 ) - { - String aApproxStr( pApproxUTF8, RTL_TEXTENCODING_UTF8 ); - if( aApproxStr.Len() == 1 ) - { - // TODO: support Autofallback for len>1 - sal_Unicode cApprox = aApproxStr.GetChar( 0 ); - if( mrFont.HasUnicodeChar( cApprox ) ) - nGlyphIndex = (cChar = cApprox) | GF_ISCHAR; - } - } - // request fallback glyph if necessary - if( !cChar ) - { - rArgs.NeedFallback( nCharPos, bRightToLeft ); - if( rArgs.mnFlags & SAL_LAYOUT_FOR_FALLBACK ) - nGlyphIndex = 0; // drop NotDef fallback glyphs - } - } - - sal_Int32 nPhysGlyphWidth, nLogGlyphWidth; - mrFont.GetCharWidth( cChar, &nPhysGlyphWidth, &nLogGlyphWidth ); - int nGlyphFlags = (nPhysGlyphWidth > 0) ? 0 : GlyphItem::IS_IN_CLUSTER; - if( bRightToLeft ) - nGlyphFlags |= GlyphItem::IS_RTL_GLYPH; - GlyphItem aGI( nCharPos, nGlyphIndex, aNewPos, nGlyphFlags, nPhysGlyphWidth ); - aGI.mnNewWidth = nLogGlyphWidth; - AppendGlyph( aGI ); - - aNewPos.X() += nLogGlyphWidth; - } - - return (nCharPos >= 0); -} - -// ----------------------------------------------------------------------- - -void X11FontLayout::AdjustLayout( ImplLayoutArgs& rArgs ) -{ - GenericSalLayout::AdjustLayout( rArgs ); - SetOrientation( 0 ); // X11 fonts are to be rotated in upper layers -} - -// ----------------------------------------------------------------------- - -void X11FontLayout::DrawText( SalGraphics& rSalGraphics ) const -{ - static const int MAXGLYPHS = 160; - int nMaxGlyphs = GetOrientation() ? 1 : MAXGLYPHS; - - // workaround for #i49902# similar to #b6228733 with XDrawText items - // => output each item separately for non-unicode font encodings! - // this is done here instead of in DrawStringUCS2MB() because - // it needs the item positions and they are easily available here - if( mrFont.GetAsciiEncoding() != RTL_TEXTENCODING_UNICODE ) - nMaxGlyphs = 1; - - Point aPos; - sal_GlyphId aGlyphAry[ MAXGLYPHS ]; - sal_Unicode pStr[ MAXGLYPHS ]; - for( int nStart=0;;) - { - int nGlyphCount = GetNextGlyphs( nMaxGlyphs, aGlyphAry, aPos, nStart ); - if( !nGlyphCount ) - break; - - for( int i = 0; i < nGlyphCount; ++i ) - pStr[ i ] = aGlyphAry[ i ] & GF_IDXMASK; - - static_cast(rSalGraphics).DrawStringUCS2MB( mrFont, aPos, pStr, nGlyphCount ); - } -} - -// ======================================================================= diff --git a/vcl/unx/source/gdi/xlfd_attr.cxx b/vcl/unx/source/gdi/xlfd_attr.cxx deleted file mode 100644 index ca49a8548afb..000000000000 --- a/vcl/unx/source/gdi/xlfd_attr.cxx +++ /dev/null @@ -1,686 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_vcl.hxx" -#include -#include -#include -#include -#include "xlfd_attr.hxx" -#include -#include - -// --------------------------------------------------------------------------- -// -// -// Attribute is a container for simple name value pairs -// eg. ( "times", FAMILY_ROMAN ) or ( "demi bold", WEIGHT_SEMIBOLD ) -// enriched with an annotation which is a pretty-printed version of the -// string, i.e. "itc avant garde" would get an annotation of "Itc Avant Garde" -// -// -// --------------------------------------------------------------------------- - -// release the stored string -void -Attribute::Release() -{ - if ( mpAnnotation != NULL ) - delete mpAnnotation; - if ( mpKeyName != NULL ) - delete mpKeyName; - if ( mpName != NULL ) - free( (void*)mpName ); -} - -// get a private copy of the given argument -void -Attribute::SetName( const char *p, int nLen ) -{ - mpName = (char*)malloc( nLen + 1 ); - mnLength = nLen; - memcpy( (void*)mpName, p, mnLength ); - ((char*)mpName)[ mnLength ] = '\0'; -} - -// Compare whether two strings a equal for the first nLen bytes -// i.e. arial == arialnarrow -int -Attribute::Compare( const char *p, int nLen ) -{ - return strncmp( mpName, p, nLen ); -} - -// Get a all lowercase name with all blanks removed -const rtl::OString& -Attribute::GetKey () -{ - static rtl::OString aEmptyStr; - - if (mpKeyName != NULL) - return *mpKeyName; - if (mnLength == 0) - return aEmptyStr; - - sal_Char* pBuffer = (sal_Char*)alloca (mnLength); - - sal_Int32 i, j; - for (i = 0, j = 0; i < mnLength; i++) - { - if ( mpName[i] != ' ' ) - pBuffer[j++] = mpName[i]; - } - mpKeyName = new rtl::OString(pBuffer, j); - - return *mpKeyName; -} - -void -Attribute::InitKey () -{ - mpKeyName = NULL; -} - -// Compare two strings, they have to be equal for nLen bytes, after nLen -// bytes both strings have to be terminated either by '\0' or by '-' -// this is for comparing a string being a substring in a Xlfd with a -// zeroterminated string -Bool -Attribute::ExactMatch( const char *p, int nLen ) -{ - Bool bMatch; - if ( nLen > 0 ) - bMatch = Compare( p, nLen ) == 0; - else - bMatch = True; - if ( bMatch ) - { - char c1 = p[ nLen ]; - char c2 = mpName[ nLen ]; - bMatch = (c1 == '-' || c1 == '\0') && (c2 == '-' || c2 == '\0'); - } - - return bMatch; -} - -void -Attribute::TagFeature( unsigned short nFeature ) -{ - if ( (nFeature & XLFD_FEATURE_NARROW) - && (strstr(mpName, "narrow") != NULL) ) - { - mnFeature |= XLFD_FEATURE_NARROW; - } - - if ( (nFeature & XLFD_FEATURE_OL_CURSOR) - && (strcmp(mpName, "open look cursor") == 0) ) - { - mnFeature |= XLFD_FEATURE_OL_CURSOR; - } - - if ( (nFeature & XLFD_FEATURE_OL_GLYPH) - && (strcmp(mpName, "open look glyph") == 0) ) - { - mnFeature |= XLFD_FEATURE_OL_GLYPH; - } - - if ( (nFeature & XLFD_FEATURE_APPLICATION_FONT) - && ( (strcmp(mpName, "interface user") == 0) - || (strcmp(mpName, "interface system") == 0))) - { - mnFeature |= XLFD_FEATURE_APPLICATION_FONT; - } - - if (nFeature & XLFD_FEATURE_INTERFACE_FONT) - { - // european - if (strcmp(mpName, "arial") == 0) - mnFeature |= (XLFD_FEATURE_INTERFACE_FONT | XLFD_FEATURE_HQ | XLFD_FEATURE_MQ); - else - if (strcmp(mpName, "helvetica") == 0) - mnFeature |= (XLFD_FEATURE_INTERFACE_FONT | XLFD_FEATURE_HQ); - else - if ( (strcmp(mpName, "lucidux sans") == 0) - || (strcmp(mpName, "luxi sans") == 0)) - mnFeature |= (XLFD_FEATURE_INTERFACE_FONT | XLFD_FEATURE_MQ | XLFD_FEATURE_LQ); - else - if (strcmp(mpName, "charter") == 0) - mnFeature |= (XLFD_FEATURE_INTERFACE_FONT | XLFD_FEATURE_MQ); - else - // japanese - if ( (strcmp(mpName, "hg mincho l") == 0) /* Solaris: jisx0208 jisx0201 */ - || (strcmp(mpName, "heiseimin") == 0) /* Solaris: jisx0212 */ - || (strcmp(mpName, "minchol") == 0) /* TurboLinux */ - || (strcmp(mpName, "mincho") == 0)) /* Redhat 6.2 JP */ - { - mnFeature |= XLFD_FEATURE_INTERFACE_FONT; - } - else - // chinese - if ( (strcmp(mpName, "kai") == 0) /* Solaris */ - || (strcmp(mpName, "ar pl mingti2l big5") == 0)) /* TurboLinux */ - { - mnFeature |= XLFD_FEATURE_INTERFACE_FONT; - } - else - // korean - if ( (strcmp(mpName, "myeongjo") == 0)) /* Solaris */ - { - mnFeature |= XLFD_FEATURE_INTERFACE_FONT; - } - } - - if ( nFeature & XLFD_FEATURE_REDUNDANTSTYLE ) - { - switch ( mpName[0] ) - { - case '\0': - mnFeature |= XLFD_FEATURE_REDUNDANTSTYLE; - break; - - case 'b': - if ( (strcmp(mpName, "bold") == 0) - || (strcmp(mpName, "bold italic") == 0) - || (strcmp(mpName, "bold sans") == 0) ) - mnFeature |= XLFD_FEATURE_REDUNDANTSTYLE; - break; - - case 'd': - if ( (strcmp(mpName, "demi") == 0) - || (strcmp(mpName, "demi italic") == 0) ) - mnFeature |= XLFD_FEATURE_REDUNDANTSTYLE; - break; - - case 'i': - if ( strcmp(mpName, "italic") == 0 ) - mnFeature |= XLFD_FEATURE_REDUNDANTSTYLE; - break; - - case 's': - if ( (strcmp(mpName, "sans") == 0) - || (strcmp(mpName, "serif") == 0) ) - mnFeature |= XLFD_FEATURE_REDUNDANTSTYLE; - break; - } - } -} - -// given Attribute classifications, strings have to be in alphabetical -// order, since they are treated by binary search algorithm - -#define InitializeAttributeWith( p, a ) p, sizeof(p) - 1, a, 0, NULL, NULL -#define MembersOf( p ) (sizeof(p) / sizeof(p[0]) ) - -const Attribute pFamilyAttribute[] = { - { InitializeAttributeWith( "arial", FAMILY_SWISS ) }, - { InitializeAttributeWith( "arioso", FAMILY_SCRIPT ) }, - { InitializeAttributeWith( "avant garde", FAMILY_SWISS ) }, - { InitializeAttributeWith( "avantgarde", FAMILY_SWISS ) }, - { InitializeAttributeWith( "bembo", FAMILY_ROMAN ) }, - { InitializeAttributeWith( "bookman", FAMILY_ROMAN ) }, - { InitializeAttributeWith( "conga", FAMILY_ROMAN ) }, - { InitializeAttributeWith( "courier", FAMILY_MODERN ) }, - { InitializeAttributeWith( "curl", FAMILY_SCRIPT ) }, - { InitializeAttributeWith( "fixed", FAMILY_MODERN ) }, - { InitializeAttributeWith( "gill", FAMILY_SWISS ) }, - { InitializeAttributeWith( "helmet", FAMILY_MODERN ) }, - { InitializeAttributeWith( "helvetica", FAMILY_SWISS ) }, - { InitializeAttributeWith( "international", FAMILY_MODERN ) }, - { InitializeAttributeWith( "lucida", FAMILY_SWISS ) }, - { InitializeAttributeWith( "new century schoolbook", FAMILY_ROMAN ) }, - { InitializeAttributeWith( "palatino", FAMILY_ROMAN ) }, - { InitializeAttributeWith( "roman", FAMILY_ROMAN ) }, - { InitializeAttributeWith( "sans serif", FAMILY_SWISS ) }, - { InitializeAttributeWith( "sansserif", FAMILY_SWISS ) }, - { InitializeAttributeWith( "serf", FAMILY_ROMAN ) }, - { InitializeAttributeWith( "serif", FAMILY_ROMAN ) }, - { InitializeAttributeWith( "times", FAMILY_ROMAN ) }, - { InitializeAttributeWith( "utopia", FAMILY_ROMAN ) }, - { InitializeAttributeWith( "zapf chancery", FAMILY_SCRIPT ) }, - { InitializeAttributeWith( "zapfchancery", FAMILY_SCRIPT ) } -}; - -const Attribute pWeightAttribute[] = { - { InitializeAttributeWith( "black", WEIGHT_BLACK ) }, - { InitializeAttributeWith( "bold", WEIGHT_BOLD ) }, - { InitializeAttributeWith( "book", WEIGHT_LIGHT ) }, - { InitializeAttributeWith( "demi", WEIGHT_SEMIBOLD ) }, - { InitializeAttributeWith( "demi bold", WEIGHT_SEMIBOLD ) }, - { InitializeAttributeWith( "demibold", WEIGHT_SEMIBOLD ) }, - { InitializeAttributeWith( "light", WEIGHT_LIGHT ) }, - { InitializeAttributeWith( "medium", WEIGHT_MEDIUM ) }, - { InitializeAttributeWith( "normal", WEIGHT_NORMAL ) }, - { InitializeAttributeWith( "regular", WEIGHT_NORMAL ) }, - { InitializeAttributeWith( "roman", WEIGHT_NORMAL ) }, - { InitializeAttributeWith( "semicondensed", WEIGHT_LIGHT ) }, - { InitializeAttributeWith( "ultrabold", WEIGHT_ULTRABOLD ) } -}; - -const Attribute pSlantAttribute[] = { - { InitializeAttributeWith( "i", ITALIC_NORMAL ) }, - { InitializeAttributeWith( "o", ITALIC_OBLIQUE ) }, - { InitializeAttributeWith( "r", ITALIC_NONE ) } -}; - -const Attribute pSetwidthAttribute[] = { - { InitializeAttributeWith( "bold", WIDTH_SEMI_EXPANDED ) }, - { InitializeAttributeWith( "condensed", WIDTH_CONDENSED ) }, - { InitializeAttributeWith( "double wide", WIDTH_ULTRA_EXPANDED ) }, - { InitializeAttributeWith( "expanded", WIDTH_EXPANDED ) }, - { InitializeAttributeWith( "extracondensed", WIDTH_EXTRA_CONDENSED ) }, - { InitializeAttributeWith( "extraexpanded", WIDTH_EXTRA_EXPANDED ) }, - { InitializeAttributeWith( "medium", WIDTH_NORMAL ) }, - { InitializeAttributeWith( "narrow", WIDTH_CONDENSED ) }, - { InitializeAttributeWith( "normal", WIDTH_NORMAL ) }, - { InitializeAttributeWith( "semicondensed", WIDTH_SEMI_CONDENSED ) }, - { InitializeAttributeWith( "semiexpanded", WIDTH_SEMI_EXPANDED ) }, - { InitializeAttributeWith( "ultracondensed", WIDTH_ULTRA_CONDENSED ) }, - { InitializeAttributeWith( "ultraexpanded", WIDTH_ULTRA_EXPANDED ) }, - { InitializeAttributeWith( "wide", WIDTH_EXPANDED ) } -}; - -const Attribute pEnhancedCharsetAttribute[] = { - { InitializeAttributeWith( "iso8859-1", RTL_TEXTENCODING_MS_1252 ) }, - { InitializeAttributeWith( "iso8859_1", RTL_TEXTENCODING_MS_1252 ) } -}; - -// ------------------------------------------------------------------------- -// -// String handling utility functions -// -// ------------------------------------------------------------------------- - - -void -AppendAttribute( Attribute *pAttribute, ByteString &rString ) -{ - if ( pAttribute == NULL ) - return ; - - int nLength = pAttribute->GetLength(); - char *pBuffer = (char*)alloca( nLength + 1); - - pBuffer[ 0 ] = '-'; - memcpy( pBuffer + 1, pAttribute->GetName(), nLength ); - rString.Append( pBuffer, nLength + 1); -} - -// -// Prettify the font name: make each leading character of a fontname -// uppercase. For example -// times new roman -> Times New Roman -// - -static void -ToUpper( char *pCharacter ) -{ - // replace [a,z] with [A,Z] - if ( (*pCharacter >= 97) && (*pCharacter <= 122) ) - *pCharacter -= 32; -} - -static String* -Capitalize( const char *pStr, int nLength ) -{ - char *pCopy = (char*)alloca( nLength + 1 ); - char *pPtr = pCopy; - memcpy( pPtr, pStr, nLength + 1 ); - - // loop over string data and uppercase first char and all chars - // following a space (other white space would be unexpected here) - char nPreviousChar = ' '; - while ( *pPtr ) - { - if ( nPreviousChar == ' ' ) - ToUpper( pPtr ); - nPreviousChar = *pPtr++; - } - - return new String( pCopy, RTL_TEXTENCODING_ISO_8859_1 ); -} - -String* -AnnotateString( const Attribute& rAttribute ) -{ - return Capitalize(rAttribute.GetName(), rAttribute.GetLength()); -} - -String* -AnnotateSlant( const Attribute& rAttribute ) -{ - const char* pStr = rAttribute.GetName(); - int nLen = rAttribute.GetLength(); - - static const struct { - const char *pFrom; const char *pTo; - } pTranslation[] = { - { "r", "Roman" }, - { "o", "Oblique" }, - { "i", "Italic" }, - { "ri", "Reverse Italic" }, - { "ro", "Reverse Oblique" }, - { "ot", "Other" } - }; - - for ( unsigned int i = 0; i < MembersOf(pTranslation); i++ ) - if ( strcmp(pStr, pTranslation[i].pFrom) == 0 ) - { - return new String( pTranslation[i].pTo, - RTL_TEXTENCODING_ISO_8859_1 ); - } - - return Capitalize(pStr, nLen); -} - -String* -AnnotateNone( const Attribute& ) -{ - return new String(); -} - -// --------------------------------------------------------------------------- -// -// -// manage global lists of Attributes -// since XListFonts does never list more than 64K fonts this storage does -// handle array size and indices with unsigned short values for low -// memory consumption -// -// -// --------------------------------------------------------------------------- - -AttributeStorage::AttributeStorage( unsigned short nDefaultValue ) : - mpList( NULL ), - mnSize( 0 ), - mnCount( 0 ), - mnLastmatch( 0 ), - mnDefaultValue( nDefaultValue ) -{ -} - -AttributeStorage::~AttributeStorage() -{ - if ( mpList != NULL ) - { - for ( int i = 0; i < mnCount; i++ ) - mpList[i].Release(); - free( mpList ); - } -} - -#if OSL_DEBUG_LEVEL > 1 -void -AttributeStorage::Dump() -{ - fprintf(stderr, "AttributeStorage: size=%i, used=%i\n", mnSize, mnCount); - for ( int i = 0; i < mnCount; i++ ) - { - ByteString aAnnotation = ByteString( - mpList[i].GetAnnotation(), - RTL_TEXTENCODING_ISO_8859_1 ); - fprintf(stderr, "\t%4i: <%s><%s>\n", i, mpList[i].GetName(), - mpList[i].GetLength(), mpList[i].GetValue(), - aAnnotation.GetBuffer() ); - } - fprintf(stderr, "\n"); -} -#endif - -Attribute* -AttributeStorage::Retrieve( unsigned short nIndex ) const -{ - return nIndex < mnCount ? &mpList[ nIndex ] : (Attribute*)NULL ; -} - -// pClassification contains a list of name-value pairs. If names in -// the AttributeStorage match those in the pClassification then -// the according value is copied. Matching means match for the length -// of the string in pClassification (i.e. arial matches arialnarrow) -// the strings in pClassification must be in alphabetical order, all -// strings Lowercase -void -AttributeStorage::AddClassification( Attribute *pClassification, - unsigned short nNum ) -{ - for ( int i = 0; i < mnCount; i++ ) - { - unsigned int nLower = 0; - unsigned int nUpper = nNum; - unsigned int nCurrent; - int nComparison = 1; - Attribute *pHaystack = 0, *pNeedle; - - pNeedle = &mpList[ i ]; - - // binary search - while ( nLower < nUpper ) - { - nCurrent = (nLower + nUpper) / 2; - pHaystack = &pClassification[ nCurrent ]; - nComparison = pNeedle->Compare( pHaystack->GetName(), - pHaystack->GetLength() ); - if (nComparison < 0) - nUpper = nCurrent; - else - if (nComparison > 0) - nLower = nCurrent + 1; - else - break; - } - - // if there's a match store the according classification in the - // Attribute storage, otherwise do nothing since defaults are - // already provided in AttributeStorage::Insert() - if ( nComparison == 0 ) - pNeedle->SetValue( pHaystack->GetValue() ); - } -} - -void -AttributeStorage::AddClassification( AttributeClassifierT Classify ) -{ - for ( int i = 0; i < mnCount; i++ ) - { - Attribute& rCurrent = mpList[i] ; - int nValue = Classify( rCurrent.GetName() ); - rCurrent.SetValue( nValue ); - } -} - -void -AttributeStorage::AddAnnotation( AttributeAnnotatorT Annotate ) -{ - for ( int i = 0; i < mnCount; i++ ) - { - String* pAnnotation = Annotate( mpList[i] ); - mpList[i].SetAnnotation( pAnnotation ); - } -} - -void -AttributeStorage::TagFeature( unsigned short nFeature ) -{ - for ( int i = 0; i < mnCount; i++ ) - mpList[i].TagFeature( nFeature ); -} - -// Enlarge the list of Attributes -void -AttributeStorage::Enlarge() -{ - if ( mnSize == 0 ) - { - mnSize = 8; - mpList = (Attribute*) malloc( mnSize * sizeof(Attribute) ); - } - else - { - mnSize = mnSize < 32768 ? (mnSize * 2) : 65535; - mpList = (Attribute*) realloc( mpList, mnSize * sizeof(Attribute) ); - } -} - -// nLength is the length as it would be reported by strlen(3) -// for an null-terminated string. if a string is part of a Xlfd -// the field separator '-' is taken as '\0' -// the AttributeStorage itself is NOT sorted to make sure that the -// leased keys are still valid -unsigned short -AttributeStorage::Insert( const char *pString, int nLength ) -{ - // check whether the last match is still equal to the current - // string since XListFonts lists fonts in sets of similar fontnames - if ( mnLastmatch < mnCount ) - { - if ( mpList[mnLastmatch].ExactMatch(pString, nLength) ) - return mnLastmatch; - } - - // otherwise search in list - for ( int i = 0; i < mnCount; i++ ) - { - if ( mpList[i].ExactMatch(pString, nLength) ) - return mnLastmatch = i; - } - - // if still not found we have to Insert the new string - if ( mnSize == mnCount ) - Enlarge(); - mpList[mnCount].SetName( pString, nLength ); - mpList[mnCount].SetValue( mnDefaultValue ); - mpList[mnCount].SetAnnotation( NULL ); - mpList[mnCount].SetFeature( XLFD_FEATURE_NONE ); - mpList[mnCount].InitKey( ); - mnLastmatch = mnCount; - mnCount = mnCount < 65535 ? mnCount + 1 : mnCount; - - return mnLastmatch; -} - - -// --------------------------------------------------------------------------- -// -// -// Attribute provider is a frame for a set of AttributeStorages. -// -// -// --------------------------------------------------------------------------- - -AttributeProvider::AttributeProvider () -{ - mpField[eXLFDFoundry ] = new AttributeStorage(0); - mpField[eXLFDFamilyName ] = new AttributeStorage(FAMILY_DONTKNOW); - mpField[eXLFDWeightName ] = new AttributeStorage(WEIGHT_NORMAL); - mpField[eXLFDSlant ] = new AttributeStorage(ITALIC_NONE); - mpField[eXLFDSetwidthName] = new AttributeStorage(WIDTH_NORMAL); - mpField[eXLFDAddstyleName] = new AttributeStorage(RTL_TEXTENCODING_DONTKNOW); - mpField[eXLFDCharset ] = new AttributeStorage(RTL_TEXTENCODING_DONTKNOW); -} - -AttributeProvider::~AttributeProvider() -{ - for ( int i = 0; i < eXLFDMaxEntry; i++ ) - delete mpField[ i ]; -} - -#if OSL_DEBUG_LEVEL > 1 -void -AttributeProvider::Dump() -{ - for ( int i = 0; i < eXLFDMaxEntry; i++ ) - mpField[ i ]->Dump(); -} -#endif - -extern "C" rtl_TextEncoding -GetTextEncodingFromAddStylename( const sal_Char *pAddStylename ) -{ - int nBufferLength = strlen( pAddStylename ) + 1; - sal_Char *pBuffer = (sal_Char*)alloca( nBufferLength ); - for ( int i = 0; i < nBufferLength; i++ ) - pBuffer[i] = pAddStylename[i] == '_' ? '-' : pAddStylename[i] ; - - return rtl_getTextEncodingFromUnixCharset( pBuffer ); -} - - -// classification information is needed before sorting because of course the -// classification is the sort criteria -void -AttributeProvider::AddClassification() -{ - /* mpField[ eXLFDFoundry ] doesn't need classification */ - mpField[ eXLFDFamilyName ]->AddClassification( - (Attribute*)pFamilyAttribute, - MembersOf(pFamilyAttribute) ); - mpField[ eXLFDWeightName ]->AddClassification( - (Attribute*)pWeightAttribute, - MembersOf(pWeightAttribute) ); - mpField[ eXLFDSlant ]->AddClassification( - (Attribute*)pSlantAttribute, - MembersOf(pSlantAttribute) ); - mpField[ eXLFDSetwidthName ]->AddClassification( - (Attribute*)pSetwidthAttribute, - MembersOf(pSetwidthAttribute) ); - mpField[ eXLFDAddstyleName ]->AddClassification( - GetTextEncodingFromAddStylename ); - mpField[ eXLFDCharset ]->AddClassification( - rtl_getTextEncodingFromUnixCharset ); -} - -// add some pretty print description -void -AttributeProvider::AddAnnotation() -{ - mpField[ eXLFDFoundry ]->AddAnnotation( AnnotateNone ); - mpField[ eXLFDFamilyName ]->AddAnnotation( AnnotateString ); - mpField[ eXLFDWeightName ]->AddAnnotation( AnnotateString ); - mpField[ eXLFDSlant ]->AddAnnotation( AnnotateSlant ); - mpField[ eXLFDSetwidthName ]->AddAnnotation( AnnotateString ); - mpField[ eXLFDAddstyleName ]->AddAnnotation( AnnotateNone ); - mpField[ eXLFDCharset ]->AddAnnotation( AnnotateNone ); -} - -// this is the misc or any section: dirty hacks for dirty xlfd usage -void -AttributeProvider::TagFeature() -{ - mpField[ eXLFDFamilyName ]->TagFeature( - XLFD_FEATURE_OL_GLYPH - | XLFD_FEATURE_OL_CURSOR - | XLFD_FEATURE_NARROW - | XLFD_FEATURE_INTERFACE_FONT - | XLFD_FEATURE_APPLICATION_FONT); - - mpField[ eXLFDSetwidthName ]->TagFeature( - XLFD_FEATURE_NARROW ); - - mpField[ eXLFDAddstyleName ]->TagFeature( - XLFD_FEATURE_REDUNDANTSTYLE ); -} - diff --git a/vcl/unx/source/gdi/xlfd_attr.hxx b/vcl/unx/source/gdi/xlfd_attr.hxx deleted file mode 100644 index b721310da506..000000000000 --- a/vcl/unx/source/gdi/xlfd_attr.hxx +++ /dev/null @@ -1,228 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef XLFD_ATTRIBUTE_HXX -#define XLFD_ATTRIBUTE_HXX - -#include -#include - - -struct Attribute { - - const char* mpName; - unsigned short mnLength; - unsigned short mnValue; - unsigned short mnFeature; - String* mpAnnotation; - rtl::OString* mpKeyName; - - const char* GetName() const - { return mpName; } - unsigned short GetValue() const - { return mnValue; } - unsigned short GetLength() const - { return mnLength; } - Bool HasFeature( unsigned short nFeature ) const - { return ((mnFeature & nFeature) != 0); } - const String &GetAnnotation() const - { return *mpAnnotation; } - const rtl::OString& - GetKey(); - void InitKey(); - - void SetName( const char *p, int nLen ); - void SetValue( unsigned short nIn ) - { mnValue = nIn; } - void SetAnnotation( String *pString ) - { mpAnnotation = pString; } - void SetFeature( unsigned short nFeature ) - { mnFeature = nFeature; } - void TagFeature( unsigned short nFeature ); - - int Compare( const char *p, int nLen ); - Bool ExactMatch( const char *p, int nLen ); - void Release(); -}; - - -void -AppendAttribute( Attribute *pAttribute, ByteString &rString ); - - -typedef String*(*AttributeAnnotatorT)(const Attribute &rAttribute); -extern "C" { -typedef rtl_TextEncoding(*AttributeClassifierT)(const char* pStr); -} - -#define XLFD_FEATURE_NONE 0x0000 -#define XLFD_FEATURE_NARROW 0x0001 -#define XLFD_FEATURE_OL_GLYPH 0x0002 -#define XLFD_FEATURE_OL_CURSOR 0x0004 -#define XLFD_FEATURE_REDUNDANTSTYLE 0x0008 -#define XLFD_FEATURE_APPLICATION_FONT 0x0010 - -#define XLFD_FEATURE_INTERFACE_FONT 0x0020 -#define XLFD_FEATURE_LQ 0x0040 -#define XLFD_FEATURE_MQ 0x0080 -#define XLFD_FEATURE_HQ 0x0100 - -// --------------------------------------------------------------------------- -// -// -// manage global lists of Attributes -// since XListFonts does never list more than 64K fonts this storage does -// handle array size and indices with unsigned short values for low -// memory consumption -// -// -// --------------------------------------------------------------------------- - -class AttributeStorage { - - private: - - Attribute* mpList; - unsigned short mnSize; - unsigned short mnCount; - unsigned short mnLastmatch; - unsigned short mnDefaultValue; - - void Enlarge(); - AttributeStorage(); - - public: - - AttributeStorage( unsigned short nDefaultValue ); - ~AttributeStorage(); - unsigned short Insert( const char *pString, int nLength ); - Attribute* Retrieve( unsigned short nIndex ) const ; - void AddClassification( Attribute *pClassification, - unsigned short nNum ); - void AddClassification( AttributeClassifierT Classify ); - void TagFeature( unsigned short nFeature ); - void AddAnnotation( AttributeAnnotatorT Annotate ); - #if OSL_DEBUG_LEVEL > 1 - void Dump(); - #endif -}; - - -// --------------------------------------------------------------------------- -// -// -// Attribute provider is a frame for a set of AttributeStorages. For XLFD -// interpretation and efficient storage, AttributeStorages for foundry, -// family_name, weight_name, slant, setwidth_name, add_style_name and combined -// charset_registry and charset_encoding are used. pixel_size, point_size, -// resolution_x and resolution_y are stored as numbers. please note that this -// does not allow storage of matrix-enhanced fonts. spacing is stored as -// a char, since only the 'm', 'c' and 'p' types are defined. -// -// -// --------------------------------------------------------------------------- - -enum eXLFDAttributeT { - eXLFDFoundry = 0, - eXLFDFamilyName, - eXLFDWeightName, - eXLFDSlant, - eXLFDSetwidthName, - eXLFDAddstyleName, - eXLFDCharset, - eXLFDMaxEntry -}; - -class AttributeProvider { - - private: - - AttributeStorage* mpField[ eXLFDMaxEntry ]; - - AttributeStorage* GetField( eXLFDAttributeT eXLFDField ) - { return mpField[ eXLFDField]; } - public: - - AttributeProvider (); - ~AttributeProvider (); - - void AddClassification(); - void AddAnnotation(); - void TagFeature(); - #if OSL_DEBUG_LEVEL > 1 - void Dump(); - #endif - - // these are just shortcuts or proxies for the most common used - // AttributeStorage functionality - AttributeStorage* GetFoundry() - { return GetField(eXLFDFoundry); } - AttributeStorage* GetFamily() - { return GetField(eXLFDFamilyName); } - AttributeStorage* GetWeight() - { return GetField(eXLFDWeightName); } - AttributeStorage* GetSlant() - { return GetField(eXLFDSlant); } - AttributeStorage* GetSetwidth() - { return GetField(eXLFDSetwidthName); } - AttributeStorage* GetAddstyle() - { return GetField(eXLFDAddstyleName); } - AttributeStorage* GetCharset() - { return GetField(eXLFDCharset); } - - Attribute* RetrieveFoundry( unsigned short nIndex ) - { return GetFoundry()->Retrieve(nIndex); } - Attribute* RetrieveFamily( unsigned short nIndex ) - { return GetFamily()->Retrieve(nIndex); } - Attribute* RetrieveWeight( unsigned short nIndex ) - { return GetWeight()->Retrieve(nIndex); } - Attribute* RetrieveSlant( unsigned short nIndex ) - { return GetSlant()->Retrieve(nIndex); } - Attribute* RetrieveSetwidth( unsigned short nIndex ) - { return GetSetwidth()->Retrieve(nIndex); } - Attribute* RetrieveAddstyle( unsigned short nIndex ) - { return GetAddstyle()->Retrieve(nIndex); } - Attribute* RetrieveCharset( unsigned short nIndex ) - { return GetCharset()->Retrieve(nIndex); } - - unsigned short InsertFoundry( const char *pString, int nLength ) - { return GetFoundry()->Insert(pString, nLength); } - unsigned short InsertFamily( const char *pString, int nLength ) - { return GetFamily()->Insert(pString, nLength); } - unsigned short InsertWeight( const char *pString, int nLength ) - { return GetWeight()->Insert(pString, nLength); } - unsigned short InsertSlant( const char *pString, int nLength ) - { return GetSlant()->Insert(pString, nLength); } - unsigned short InsertSetwidth( const char *pString, int nLength ) - { return GetSetwidth()->Insert(pString, nLength);} - unsigned short InsertAddstyle( const char *pString, int nLength ) - { return GetAddstyle()->Insert(pString, nLength);} - unsigned short InsertCharset( const char *pString, int nLength ) - { return GetCharset()->Insert(pString, nLength); } -}; - -#endif /* XLFD_ATTRIBUTE_HXX */ - diff --git a/vcl/unx/source/gdi/xlfd_extd.cxx b/vcl/unx/source/gdi/xlfd_extd.cxx deleted file mode 100644 index 73731eddf115..000000000000 --- a/vcl/unx/source/gdi/xlfd_extd.cxx +++ /dev/null @@ -1,1001 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_vcl.hxx" -#include -#include -#include -#include "xlfd_attr.hxx" -#include "xlfd_smpl.hxx" -#include "xlfd_extd.hxx" -#include -#include - -#ifndef _RTL_TENCINFO_H_ -#include -#endif - -#include - -// -------------------------------------------------------------------------- - -ImplX11FontData::ImplX11FontData( const ExtendedXlfd& rXlfd, int nHeight ) -: ImplFontData( rXlfd, X11IFD_MAGIC ), - mrXlfd( rXlfd ) -{ - mnHeight = nHeight; - mnWidth = 0; -} - -ImplFontEntry* ImplX11FontData::CreateFontInstance( ImplFontSelectData& rFSD ) const -{ - ImplFontEntry* pEntry = new ImplFontEntry( rFSD ); - return pEntry; -} - -sal_IntPtr ImplX11FontData::GetFontId() const -{ - return reinterpret_cast(&mrXlfd); -} - -// -------------------------------------------------------------------------- -// -// classes for Xlfd handling that contain more than a single encoding. -// Members that may vary through different encodings are stored in -// a mpEncodingInfo member. There are three different classes: -// true scalable fonts (truetype and type1) scalable bitmap fonts -// (the ugly ones) and bitmap fonts. The ExtendedXlfd stores all the members -// that are specific to a font outline -// ( e.g. adobe-times-roman-medium-r-normal- X -p- X ) -// and specifies the interface. -// -// -------------------------------------------------------------------------- - -ExtendedXlfd::EncodingInfo& -ExtendedXlfd::EncodingInfo::operator= ( const Xlfd *pXlfd ) -{ - mcSpacing = pXlfd->mcSpacing; - mnResolutionX = pXlfd->mnResolutionX; - mnResolutionY = pXlfd->mnResolutionY; - mnAddstyle = pXlfd->mnAddstyle; - mnCharset = pXlfd->mnCharset; - mnEncoding = pXlfd->GetEncoding(); - - return *this; -} - -// ------ base class -------------------------------------------------------- - -ExtendedXlfd::ExtendedXlfd( bool bScalable ) -: mbScalable( bScalable ), - mnEncodings( 0 ), - mnEncCapacity( 0 ), - mpEncodingInfo( NULL ) -{ - mbOrientation = false; - mbDevice = false; - mbSubsettable = false; - mbEmbeddable = false; - - mnQuality = -1; -} - -ExtendedXlfd::~ExtendedXlfd() -{ - if ( mnEncodings != 0 ) - rtl_freeMemory( mpEncodingInfo ); -} - -inline void* -Realloc( void *pPtr, sal_Size nSize ) -{ - return rtl_reallocateMemory( pPtr, nSize ); -} - -int -ExtendedXlfd::GetEncodingIdx( rtl_TextEncoding nEncoding ) const -{ - for ( int i = 0; i < mnEncodings; i++ ) - if ( nEncoding == mpEncodingInfo[i].mnEncoding ) - return i; - return -1; -} - -bool -ExtendedXlfd::HasEncoding( rtl_TextEncoding nEncoding ) const -{ - return !(GetEncodingIdx( nEncoding ) < 0) ; -} - -rtl_TextEncoding -ExtendedXlfd::GetEncoding( int i ) const -{ - if ( i < mnEncodings && i >= 0 ) - return mpEncodingInfo[i].mnEncoding; - - return RTL_TEXTENCODING_DONTKNOW; -} - -rtl_TextEncoding -ExtendedXlfd::GetEncoding() const -{ - return mnEncodings == 1 ? mpEncodingInfo[0].mnEncoding : RTL_TEXTENCODING_DONTKNOW; -} - -// query the most unicode / Ascii compatible font: either one of the fonts -// is utf16 encoded or there's a single byte font which is unicode -// compatible for the first 256 chars (latin1) or for at least 128 -// chars (most latin-X encodings, cyrillic encodings) -rtl_TextEncoding -ExtendedXlfd::GetAsciiEncoding( int *pAsciiRange ) const -{ - rtl_TextEncoding nBestEncoding = RTL_TEXTENCODING_DONTKNOW; - int nLargestRange = 0x0000; - - for ( int i = 0; i < mnEncodings && nLargestRange < 0xffff; i++ ) - { - rtl_TextEncoding nCurEncoding = mpEncodingInfo[i].mnEncoding; - switch ( nCurEncoding ) - { - case RTL_TEXTENCODING_UNICODE: - nLargestRange = 0xffff; - nBestEncoding = nCurEncoding; - break; - - case RTL_TEXTENCODING_ISO_8859_1: - case RTL_TEXTENCODING_MS_1252: - nLargestRange = 0x00ff; - nBestEncoding = nCurEncoding; - break; - - case RTL_TEXTENCODING_ISO_8859_2: - case RTL_TEXTENCODING_ISO_8859_4: - case RTL_TEXTENCODING_ISO_8859_5: - case RTL_TEXTENCODING_ISO_8859_6: - case RTL_TEXTENCODING_ISO_8859_7: - case RTL_TEXTENCODING_ISO_8859_8: - case RTL_TEXTENCODING_ISO_8859_9: - case RTL_TEXTENCODING_ISO_8859_13: - case RTL_TEXTENCODING_ISO_8859_15: - case RTL_TEXTENCODING_MS_1251: - case RTL_TEXTENCODING_KOI8_R: - case RTL_TEXTENCODING_JIS_X_0201: - if ( nLargestRange < 0x0080 ) - { - nLargestRange = 0x0080; - nBestEncoding = nCurEncoding; - } - break; - - default: - if ( nLargestRange == 0x0000 ) - { - nBestEncoding = nCurEncoding; - } - break; - } - } - - if ( pAsciiRange != NULL ) - *pAsciiRange = nLargestRange; - - return nBestEncoding; -} - -bool -ExtendedXlfd::AddEncoding( const Xlfd *pXlfd ) -{ - rtl_TextEncoding nEncoding = pXlfd->GetEncoding(); - if ( HasEncoding(nEncoding) ) - return false; - - if ( mnEncodings == 0 ) - { - // bootstrap - mnFoundry = pXlfd->mnFoundry; - mnFamily = pXlfd->mnFamily; - mnWeight = pXlfd->mnWeight; - mnSlant = pXlfd->mnSlant; - mnSetwidth = pXlfd->mnSetwidth; - mpFactory = pXlfd->mpFactory; - - Attribute *pFamilyAttr = mpFactory->RetrieveFamily( mnFamily ); - Attribute *pWeightAttr = mpFactory->RetrieveWeight( mnWeight ); - Attribute *pWidthAttr = mpFactory->RetrieveSetwidth( mnSetwidth ); - Attribute *pSlantAttr = mpFactory->RetrieveSlant( mnSlant ); - - meFamily = GetFamilyType(); - meWeight = GetWeight(); - meItalic = GetSlant(); - meWidthType = GetWidthType(); - mbSymbolFlag= (GetEncoding() == RTL_TEXTENCODING_SYMBOL); - mePitch = GetPitch(); - - maName = pFamilyAttr->GetAnnotation(); - - // the helvetica narrow hack - if ( ! pFamilyAttr->HasFeature(XLFD_FEATURE_NARROW) - && pWidthAttr->HasFeature(XLFD_FEATURE_NARROW) ) - { - static const String aNarrow( RTL_CONSTASCII_USTRINGPARAM(" Narrow") ); - maName += aNarrow; - } - - // stylename = weight + slant + width - // XXX Fix me: there may be a space missing between them - if ( meWeight != WEIGHT_NORMAL ) - maStyleName += pWeightAttr->GetAnnotation(); - if ( meItalic != ITALIC_NONE ) - maStyleName += pSlantAttr->GetAnnotation(); - if ( (meWidthType != WIDTH_NORMAL) - && (! pWidthAttr->HasFeature(XLFD_FEATURE_NARROW)) ) - maStyleName += pWidthAttr->GetAnnotation(); - } - - if( mnEncodings <= mnEncCapacity ) - { - mnEncCapacity += mnEncodings + 4; - mpEncodingInfo = (EncodingInfo*)Realloc( mpEncodingInfo, mnEncCapacity * sizeof(EncodingInfo) ); - } - - mpEncodingInfo[ mnEncodings ] = pXlfd; - mnEncodings += 1; - return true; -} - -void -ExtendedXlfd::ToString( ByteString &rString, - unsigned short /*nPixelSize*/, rtl_TextEncoding /*nEncoding*/ ) const -{ - AppendAttribute( mpFactory->RetrieveFoundry(mnFoundry), rString ); - AppendAttribute( mpFactory->RetrieveFamily(mnFamily), rString ); - AppendAttribute( mpFactory->RetrieveWeight(mnWeight), rString ); - AppendAttribute( mpFactory->RetrieveSlant(mnSlant), rString ); - AppendAttribute( mpFactory->RetrieveSetwidth(mnSetwidth), rString ); -} - -void -ExtendedXlfd::ToString( ByteString &rString, - unsigned short /*nPixelSize*/, char* /*pMatricsString*/, rtl_TextEncoding /*nEncoding*/ ) const -{ - AppendAttribute( mpFactory->RetrieveFoundry(mnFoundry), rString ); - AppendAttribute( mpFactory->RetrieveFamily(mnFamily), rString ); - AppendAttribute( mpFactory->RetrieveWeight(mnWeight), rString ); - AppendAttribute( mpFactory->RetrieveSlant(mnSlant), rString ); - AppendAttribute( mpFactory->RetrieveSetwidth(mnSetwidth), rString ); -} - -static FontPitch GetPitchFromX11Pitch( const char cSpacing ) -{ - switch ( cSpacing ) - { - case 'c': // fall through - case 'm': return PITCH_FIXED; - case 'p': return PITCH_VARIABLE; - default: return PITCH_DONTKNOW; - } -} - -// you must not call any of the ExtendedXlfd::GetXXX() functions if the -// ExtendedXlfd is really empty (i.e. mnEncodings is zero) - -FontPitch ExtendedXlfd::GetPitch() const -{ - if( mnEncodings > 1 ) - return PITCH_VARIABLE; - if( mnEncodings == 1 ) - return GetPitchFromX11Pitch( mpEncodingInfo[0].mcSpacing ); - return PITCH_DONTKNOW; -} - -FontPitch ExtendedXlfd::GetPitch( rtl_TextEncoding nEncoding ) const -{ - for ( int nIdx = 0; nIdx < mnEncodings; nIdx++ ) - if ( mpEncodingInfo[nIdx].mnEncoding == nEncoding ) - return GetPitchFromX11Pitch( mpEncodingInfo[nIdx].mcSpacing ); - return PITCH_DONTKNOW; -} - -FontFamily ExtendedXlfd::GetFamilyType() const -{ - Attribute *pFamilyAttr= mpFactory->RetrieveFamily(mnFamily); - return (FontFamily)pFamilyAttr->GetValue(); -} - -FontWeight ExtendedXlfd::GetWeight() const -{ - Attribute *pWeightAttr = mpFactory->RetrieveWeight(mnWeight); - return (FontWeight)pWeightAttr->GetValue(); -} - -FontItalic ExtendedXlfd::GetSlant() const -{ - Attribute *pSlantAttr = mpFactory->RetrieveSlant(mnSlant); - return (FontItalic)pSlantAttr->GetValue(); -} - -FontWidth ExtendedXlfd::GetWidthType() const -{ - Attribute *pWidthAttr = mpFactory->RetrieveSetwidth(mnSetwidth); - return (FontWidth)pWidthAttr->GetValue(); -} - -class CodeRange -{ -public: - CodeRange( int nMin, int nEnd ) : mnMin( nMin ), mnEnd( nEnd ) {} - - sal_uInt32 GetMin() const { return mnMin; } - sal_uInt32 GetEnd() const { return mnEnd; } - - bool operator<( const CodeRange& r ) const - { return (mnMin RangeSet; - RangeSet aRangeSet; - - for( unsigned short i = 0; i < mnEncodings; ++i ) - { - // TODO: move encoding -> unicode range mapping to RTL - // NOTE: for now only some are VERY roughly approximated - const rtl_TextEncoding eEncoding = mpEncodingInfo[i].mnEncoding; - switch( mpEncodingInfo[i].mnEncoding ) - { - case RTL_TEXTENCODING_SYMBOL: // postscript symbol encoding - aRangeSet.insert( CodeRange( 0x0020, 0x0100 ) ); // symbol aliasing - aRangeSet.insert( CodeRange( 0xF020, 0xF100 ) ); - break; - - case RTL_TEXTENCODING_ISO_8859_15: - aRangeSet.insert( CodeRange( 0x20AC, 0x20AD ) ); // Euro currency symbol - // fall through - case RTL_TEXTENCODING_APPLE_ROMAN: - case RTL_TEXTENCODING_ISO_8859_1: - case RTL_TEXTENCODING_MS_1252: - case RTL_TEXTENCODING_IBM_437: - case RTL_TEXTENCODING_IBM_852: - aRangeSet.insert( CodeRange( 0x0020, 0x0080 ) ); - aRangeSet.insert( CodeRange( 0x00A0, 0x0100 ) ); - break; - - // Traditional, Simplified, Japanese - case RTL_TEXTENCODING_APPLE_CHINSIMP: - case RTL_TEXTENCODING_APPLE_CHINTRAD: - case RTL_TEXTENCODING_APPLE_JAPANESE: - case RTL_TEXTENCODING_SHIFT_JIS: - case RTL_TEXTENCODING_GB_2312: - case RTL_TEXTENCODING_GBT_12345: - case RTL_TEXTENCODING_GBK: - case RTL_TEXTENCODING_BIG5: - case RTL_TEXTENCODING_EUC_JP: - case RTL_TEXTENCODING_EUC_CN: - case RTL_TEXTENCODING_EUC_TW: - case RTL_TEXTENCODING_ISO_2022_JP: - case RTL_TEXTENCODING_ISO_2022_CN: - case RTL_TEXTENCODING_GB_18030: - case RTL_TEXTENCODING_BIG5_HKSCS: - case RTL_TEXTENCODING_JIS_X_0201: - case RTL_TEXTENCODING_JIS_X_0208: - case RTL_TEXTENCODING_JIS_X_0212: - case RTL_TEXTENCODING_MS_932: - case RTL_TEXTENCODING_MS_936: - case RTL_TEXTENCODING_MS_950: - aRangeSet.insert( CodeRange( 0x3000, 0xA000 ) ); - aRangeSet.insert( CodeRange( 0xF900, 0xFB00 ) ); - break; - - // Korean - case RTL_TEXTENCODING_APPLE_KOREAN: - case RTL_TEXTENCODING_MS_949: - case RTL_TEXTENCODING_MS_1361: - case RTL_TEXTENCODING_EUC_KR: - case RTL_TEXTENCODING_ISO_2022_KR: - aRangeSet.insert( CodeRange( 0x1100, 0x1200 ) ); - aRangeSet.insert( CodeRange( 0x3130, 0x3190 ) ); - aRangeSet.insert( CodeRange( 0xAC00, 0xD7A4 ) ); - break; - - // unknown encoding - case RTL_TEXTENCODING_DONTKNOW: - bHasUnknownEncoding = true; - break; - - // Unicode - case RTL_TEXTENCODING_UNICODE: - case RTL_TEXTENCODING_UTF7: - case RTL_TEXTENCODING_UTF8: - bHasUnicode = true; - break; - - // misc 8bit encodings - default: - if( !rtl_isOctetTextEncoding( eEncoding ) ) - bHasUnknownEncoding = true; - else - { - // use the unicode converter to get the coverage of an 8bit encoding - rtl_TextToUnicodeConverter aConverter = rtl_createTextToUnicodeConverter( eEncoding ); - rtl_UnicodeToTextContext aCvtContext = rtl_createTextToUnicodeContext( aConverter ); - if( !aConverter || !aCvtContext ) - bHasUnknownEncoding = true; - else - { - sal_Char cCharsInp[ 0x100 ]; - for( int j = 0x20; j < 0x080; ++j ) - cCharsInp[ j-0x20 ] = j; - for( int j = 0xA0; j < 0x100; ++j ) - cCharsInp[ j-0x40 ] = j; - - sal_Unicode cCharsOut[ 0x100 ]; - sal_uInt32 nCvtInfo; - sal_Size nSrcCvtBytes; - int nOutLen = rtl_convertTextToUnicode( - aConverter, aCvtContext, - cCharsInp, 0xC0, - cCharsOut, sizeof(cCharsOut)/sizeof(*cCharsOut), - RTL_TEXTTOUNICODE_FLAGS_INVALID_IGNORE - | RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE, - &nCvtInfo, &nSrcCvtBytes ); - - for( int j = 0; j < nOutLen; ++j ) - aRangeSet.insert( CodeRange( cCharsOut[j], cCharsOut[j]+1 ) ); - - rtl_destroyTextToUnicodeConverter( aCvtContext ); - rtl_destroyTextToUnicodeConverter( aConverter ); - } - } - break; - } - } - - // unicode encoded fonts usually do not cover the entire unicode range - // => only use them to determine coverage when no other encodings are available - if( aRangeSet.empty() && (bHasUnicode || bHasUnknownEncoding) ) - { - if( pCodePairs ) - { - pCodePairs[0] = 0x0020; - pCodePairs[1] = 0xD800; - pCodePairs[2] = 0xE000; - pCodePairs[3] = 0xFFFE; - } - return 2; - } - - if( aRangeSet.empty() ) - return 0; - - // sort and merge the code pairs - sal_uInt32* pDst = pCodePairs; - RangeSet::const_iterator it = aRangeSet.begin(); - for( sal_uInt32 nEnd = 0; it != aRangeSet.end(); ++it ) - { - // check overlap with to previous range - const CodeRange& rSrc = *it; - if( nEnd < rSrc.GetMin() ) - { - nEnd = rSrc.GetEnd(); - if( pCodePairs ) - { - pDst[0] = rSrc.GetMin(); - pDst[1] = rSrc.GetEnd(); - } - pDst += 2; - } - else - { - // merge overlapping ranges - if( nEnd < rSrc.GetEnd() ) - { - nEnd = rSrc.GetEnd(); - if( pCodePairs ) - pDst[-1] = nEnd; - } - } - } - - int nRangeCount = (pDst - pCodePairs) / 2; - return nRangeCount; -} - -// ------ class to handle scalable bitmap fonts ------------------------------ - -ScalableBitmapXlfd::ScalableBitmapXlfd() -: ExtendedXlfd( true ) -{} - -ScalableBitmapXlfd::~ScalableBitmapXlfd() -{} - -void -ScalableBitmapXlfd::ToString( ByteString &rString, - unsigned short nPixelSize, rtl_TextEncoding nEncoding ) const -{ - int nIdx = GetEncodingIdx( nEncoding ); - if ( nIdx < 0 ) - return; - - ExtendedXlfd::ToString( rString, nPixelSize, nEncoding ); - EncodingInfo& rInfo = mpEncodingInfo[ nIdx ]; - - AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString ); - - rString += '-'; - rString += ByteString::CreateFromInt32( nPixelSize ); - rString += "-0-"; - rString += ByteString::CreateFromInt32( rInfo.mnResolutionX ); - rString += '-'; - rString += ByteString::CreateFromInt32( rInfo.mnResolutionY ); - rString += '-'; - rString += static_cast< char >(rInfo.mcSpacing); - rString += "-0"; - - AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString ); -} - -void -ScalableBitmapXlfd::ToString( ByteString &rString, - unsigned short nPixelSize, char *pMatricsString, rtl_TextEncoding nEncoding ) const -{ - int nIdx = GetEncodingIdx( nEncoding ); - if ( nIdx < 0 ) - return; - - ExtendedXlfd::ToString( rString, nPixelSize, nEncoding ); - EncodingInfo& rInfo = mpEncodingInfo[ nIdx ]; - - AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString ); - - rString += "-*-"; - char pTmp[256]; - snprintf( pTmp, sizeof(pTmp), pMatricsString, nPixelSize, nPixelSize ); - rString += pTmp; - rString += "-*-*-"; - rString += static_cast< char >(rInfo.mcSpacing); - rString += "-*"; - - AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString ); -} - -ImplFontData* ScalableBitmapXlfd::GetImplFontData() const -{ - ImplX11FontData* pFontData = new ImplX11FontData( *this, 0 ); - pFontData->mnQuality= 0; - return pFontData; -} - -// ------ class to handle true bitmap fonts ---------------------------------- - -void -BitmapXlfd::ToString( ByteString &rString, - unsigned short nPixelSize, char *pMatricsString, rtl_TextEncoding nEncoding ) const -{ - int nIdx = GetEncodingIdx( nEncoding ); - if ( nIdx < 0 ) - return; - - ExtendedXlfd::ToString( rString, nPixelSize, nEncoding ); - EncodingInfo& rInfo = mpEncodingInfo[ nIdx ]; - - AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString ); - - rString += "-*-"; - char pTmp[256]; - snprintf( pTmp, sizeof(pTmp), pMatricsString, nPixelSize, nPixelSize ); - rString += pTmp; - rString += "-*-*-"; - rString += static_cast< char >(rInfo.mcSpacing); - rString += "-*"; - - AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString ); -} - -BitmapXlfd::BitmapXlfd( ) -: ExtendedXlfd( false ) -{} - -BitmapXlfd::~BitmapXlfd( ) -{} - -bool -BitmapXlfd::AddEncoding( const Xlfd *pXlfd ) -{ - if ( mnEncodings == 0 ) - { - mnPixelSize = pXlfd->mnPixelSize; - mnPointSize = pXlfd->mnPointSize; - mnAverageWidth = pXlfd->mnAverageWidth; - } - - return ExtendedXlfd::AddEncoding( pXlfd ); -} - -void -BitmapXlfd::ToString( ByteString &rString, - unsigned short nPixelSize, rtl_TextEncoding nEncoding ) const -{ - int nIdx = GetEncodingIdx( nEncoding ); - if ( nIdx < 0 ) - return; - - ExtendedXlfd::ToString( rString, nPixelSize, nEncoding ); - EncodingInfo& rInfo = mpEncodingInfo[ nIdx ]; - AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString ); - rString += '-'; - rString += ByteString::CreateFromInt32( mnPixelSize ); - rString += "-*-*-*-"; - rString += static_cast< char >(rInfo.mcSpacing); - rString += "-*"; - - AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString ); -} - -ImplFontData* BitmapXlfd::GetImplFontData() const -{ - ImplX11FontData* pFontData = new ImplX11FontData( *this, mnPixelSize ); - pFontData->mnQuality= 100; - return pFontData; -} - -// ------ class to handle true scalable fonts -------------------------------- - -ScalableXlfd::ScalableXlfd() -: ExtendedXlfd( true ) -{} - -ScalableXlfd::~ScalableXlfd() -{} - -void -ScalableXlfd::ToString( ByteString &rString, - unsigned short nPixelSize, rtl_TextEncoding nEncoding ) const -{ - int nIdx = GetEncodingIdx( nEncoding ); - if ( nIdx < 0 ) - return; - - ExtendedXlfd::ToString( rString, nPixelSize, nEncoding); - - EncodingInfo& rInfo = mpEncodingInfo[ nIdx ]; - AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString ); - - rString += '-'; - rString += ByteString::CreateFromInt32( nPixelSize ); - rString += "-0-0-0-"; - rString += static_cast< char >(rInfo.mcSpacing); - rString += "-0"; - - AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString ); -} - -void -ScalableXlfd::ToString( ByteString &rString, - unsigned short nPixelSize, char* pMatricsString, rtl_TextEncoding nEncoding ) const -{ - int nIdx = GetEncodingIdx( nEncoding ); - if ( nIdx < 0 ) - return; - - ExtendedXlfd::ToString( rString, nPixelSize, nEncoding); - - EncodingInfo& rInfo = mpEncodingInfo[ nIdx ]; - AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString ); - - rString += "-*-"; - char pTmp[256]; - snprintf( pTmp, sizeof(pTmp), pMatricsString, nPixelSize, nPixelSize ); - rString += pTmp; - rString += "-*-*-"; - rString += static_cast< char >(rInfo.mcSpacing); - rString += "-*"; - - AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString ); -} - -ImplFontData* ScalableXlfd::GetImplFontData() const -{ - ImplX11FontData* pFontData = new ImplX11FontData( *this, 0 ); - pFontData->mnQuality= 200; - return pFontData; -} - -/* ------- virtual fonts for user interface ------------------------------- */ - -VirtualXlfd::ExtEncodingInfo& -VirtualXlfd::ExtEncodingInfo::operator= ( const Xlfd *pXlfd ) -{ - mnFoundry = pXlfd->mnFoundry; - mnFamily = pXlfd->mnFamily; - mnWeight = pXlfd->mnWeight; - mnSlant = pXlfd->mnSlant; - mnSetwidth = pXlfd->mnSetwidth; - - return *this; -} - -VirtualXlfd::VirtualXlfd() -: ExtendedXlfd( true ), - mnExtCapacity(0), - mpExtEncodingInfo(NULL) -{ - mnFoundry = 0; - mnFamily = 0; - mnWeight = 0; - mnSlant = 0; - mnSetwidth = 0; -} - -VirtualXlfd::~VirtualXlfd() -{ - if ( mpExtEncodingInfo != NULL ) - rtl_freeMemory( mpExtEncodingInfo ); -} - -int -VirtualXlfd::GetFontQuality (unsigned short nFamily) -{ - Attribute *pFamily = mpFactory->RetrieveFamily(nFamily); - int nQuality = 0; - - if (pFamily->HasFeature(XLFD_FEATURE_HQ)) - nQuality += 16; - if (pFamily->HasFeature(XLFD_FEATURE_MQ)) - nQuality += 8; - if (pFamily->HasFeature(XLFD_FEATURE_LQ)) - nQuality += 4; - return nQuality; -} - -bool -VirtualXlfd::AddEncoding( const Xlfd *pXlfd ) -{ - // add new font - bool bRC = ExtendedXlfd::AddEncoding( pXlfd ); - - int nIdx; - if( bRC ) - { - // new encoding => append the new pXlfd - nIdx = mnEncodings - 1; - if( nIdx >= mnExtCapacity ) - { - mnExtCapacity = mnEncCapacity; - mpExtEncodingInfo = (ExtEncodingInfo*)Realloc( mpExtEncodingInfo, - mnExtCapacity * sizeof(ExtEncodingInfo) ); - } - } - else - { - // existing encoding => check if the new pXlfd is better - rtl_TextEncoding nEncoding = pXlfd->GetEncoding(); - nIdx = GetEncodingIdx( nEncoding ); - - int nOldQuality = GetFontQuality( mpExtEncodingInfo[nIdx].mnFamily ); - int nNewQuality = GetFontQuality( pXlfd->mnFamily ); - if( nOldQuality >= nNewQuality ) - return false; - } - - mpExtEncodingInfo[ nIdx ] = pXlfd; - return true; -} - -void -VirtualXlfd::FilterInterfaceFont (const Xlfd *pXlfd) -{ - Attribute *pAttr; - AttributeProvider *pFactory = pXlfd->mpFactory; - - if (! pXlfd->Fonttype() == TYPE_SCALABLE) - return; - pAttr = pFactory->RetrieveFamily(pXlfd->mnFamily); - if (! pAttr->HasFeature(XLFD_FEATURE_INTERFACE_FONT)) - return; - pAttr = pFactory->RetrieveSlant(pXlfd->mnSlant); - if (! (FontItalic)pAttr->GetValue() == ITALIC_NONE) - return; - pAttr = pFactory->RetrieveSetwidth(pXlfd->mnSetwidth); - if (pAttr->HasFeature(XLFD_FEATURE_NARROW)) - return; - pAttr = pFactory->RetrieveWeight(pXlfd->mnWeight); - FontWeight eWeight = (FontWeight)pAttr->GetValue(); - if ((eWeight != WEIGHT_NORMAL) && (eWeight != WEIGHT_MEDIUM)) - return; - - AddEncoding (pXlfd); -} - -void -VirtualXlfd::ToString( ByteString &rString, unsigned short nPixelSize, - rtl_TextEncoding nEncoding ) const -{ - int nIdx = GetEncodingIdx( nEncoding ); - if ( nIdx < 0 ) - return; - - ExtEncodingInfo &rExtInfo = mpExtEncodingInfo[ nIdx ]; - - AppendAttribute( mpFactory->RetrieveFoundry(rExtInfo.mnFoundry), rString ); - AppendAttribute( mpFactory->RetrieveFamily(rExtInfo.mnFamily), rString ); - AppendAttribute( mpFactory->RetrieveWeight(rExtInfo.mnWeight), rString ); - AppendAttribute( mpFactory->RetrieveSlant(rExtInfo.mnSlant), rString ); - AppendAttribute( mpFactory->RetrieveSetwidth(rExtInfo.mnSetwidth), rString ); - - EncodingInfo& rInfo = mpEncodingInfo[ nIdx ]; - AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString ); - - rString += '-'; - rString += ByteString::CreateFromInt32( nPixelSize ); - rString += "-0-0-0-"; - rString += static_cast< char >(rInfo.mcSpacing); - rString += "-0"; - - AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString ); -} - -void -VirtualXlfd::ToString( ByteString &rString, unsigned short nPixelSize, - char* pMatricsString, rtl_TextEncoding nEncoding ) const -{ - int nIdx = GetEncodingIdx( nEncoding ); - if ( nIdx < 0 ) - return; - - ExtEncodingInfo &rExtInfo = mpExtEncodingInfo[ nIdx ]; - - AppendAttribute( mpFactory->RetrieveFoundry(rExtInfo.mnFoundry), rString ); - AppendAttribute( mpFactory->RetrieveFamily(rExtInfo.mnFamily), rString ); - AppendAttribute( mpFactory->RetrieveWeight(rExtInfo.mnWeight), rString ); - AppendAttribute( mpFactory->RetrieveSlant(rExtInfo.mnSlant), rString ); - AppendAttribute( mpFactory->RetrieveSetwidth(rExtInfo.mnSetwidth), rString ); - - EncodingInfo& rInfo = mpEncodingInfo[ nIdx ]; - AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString ); - - rString += "-*-"; - char pTmp[256]; - snprintf( pTmp, sizeof(pTmp), pMatricsString, nPixelSize, nPixelSize ); - rString += pTmp; - rString += "-*-*-"; - rString += static_cast< char >(rInfo.mcSpacing); - rString += "-*"; - - AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString ); -} - -ImplFontData* VirtualXlfd::GetImplFontData() const -{ - ImplX11FontData* pFontData = new ImplX11FontData( *this, 0 ); - - // family name - static const String aFontName( RTL_CONSTASCII_USTRINGPARAM("Interface User") ); - pFontData->maName = aFontName; - // pFontData->maStyleName = aStyleName; - pFontData->meFamily = FAMILY_SWISS; - pFontData->meWeight = WEIGHT_NORMAL; - pFontData->meItalic = ITALIC_NONE; - pFontData->meWidthType = WIDTH_NORMAL; - pFontData->mePitch = PITCH_VARIABLE; - - pFontData->mbSymbolFlag = false; - pFontData->mbOrientation= false; - pFontData->mbDevice = true; - pFontData->mnQuality = 100; - - return pFontData; -} - -// ------ font list ------------------------------------------------------- - -XlfdStorage::XlfdStorage() -{ - maXlfdList.reserve( 256 ); -} - -void -XlfdStorage::Dispose() -{ - XlfdList::const_iterator it = maXlfdList.begin(); - for(; it != maXlfdList.end(); ++it ) - delete *it; - maXlfdList.clear(); -} - -void -XlfdStorage::Reset() -{ - maXlfdList.clear(); -} - -void -XlfdStorage::Add( const ExtendedXlfd* pXlfd ) -{ - if ( pXlfd != NULL ) - maXlfdList.push_back( pXlfd ); -} - -void -XlfdStorage::Add( const XlfdStorage* pXlfd ) -{ - if ( !pXlfd || pXlfd->maXlfdList.empty() ) - return; - - maXlfdList.reserve( maXlfdList.size() + pXlfd->maXlfdList.size() ); - XlfdList::const_iterator it = pXlfd->maXlfdList.begin(); - for(; it != pXlfd->maXlfdList.end(); ++it ) - maXlfdList.push_back( *it ); -} - -void XlfdStorage::AnnounceFonts( ImplDevFontList* pList ) const -{ - XlfdList::const_iterator it = maXlfdList.begin(); - for(; it != maXlfdList.end(); ++it ) - { - const ExtendedXlfd* pXlfd = *it; - ImplFontData* pFontData = pXlfd->GetImplFontData(); - pList->Add( pFontData ); - } -} - -// ------ bitmap font list -------------------------------------------------- - -void -BitmapXlfdStorage::AddBitmapFont( const Xlfd *pXlfd ) -{ - if ( pXlfd == NULL ) - return; - - int nPixelSize = pXlfd->mnPixelSize; - XlfdList::const_iterator it = maXlfdList.begin(); - for(; it != maXlfdList.end(); ++it ) - { - BitmapXlfd* pBitmapXlfd = (BitmapXlfd*)*it; - if( nPixelSize == pBitmapXlfd->GetPixelSize() ) - { - // we need to add an encoding to an existing bitmap font - pBitmapXlfd->AddEncoding( pXlfd ); - return; - } - } - - // we have a new bitmap font - BitmapXlfd* pBitmapXlfd = new BitmapXlfd; - pBitmapXlfd->AddEncoding( pXlfd ); - Add( pBitmapXlfd ); -} diff --git a/vcl/unx/source/gdi/xlfd_extd.hxx b/vcl/unx/source/gdi/xlfd_extd.hxx deleted file mode 100644 index 523f87fac477..000000000000 --- a/vcl/unx/source/gdi/xlfd_extd.hxx +++ /dev/null @@ -1,272 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef XLFD_EXTENDED_HXX -#define XLFD_EXTENDED_HXX - -#include -#ifndef _VCL_VCLENUM_HXX -#include -#endif -#ifndef _VCL_OUTFONT_HXX -#include -#endif - -#include - -class Xlfd; -class AttributeProvider; -class ImplDevFontList; -class ByteString; - -// -------------------------------------------------------------------------- -// -// classes for Xlfd handling that contain more than a single encoding. -// Members that may vary through different encodings are stored in -// a mpEncodingInfo member. There are three different classes: -// true scalable fonts (truetype and type1) scalable bitmap fonts -// (the ugly ones) and bitmap fonts. The ExtendedXlfd stores all the members -// that are specific to a font outline -// ( e.g. adobe-times-roman-medium-r-normal- * -p- * ) -// and specifies the interface. -// -// -------------------------------------------------------------------------- - -// base class - -class ExtendedXlfd : public ImplDevFontAttributes -{ - public: - ExtendedXlfd( bool bScalable ); - virtual ~ExtendedXlfd(); - virtual bool AddEncoding( const Xlfd* ); - bool HasEncoding( rtl_TextEncoding ) const; - int GetEncodingIdx( rtl_TextEncoding nEncoding ) const; - unsigned short NumEncodings() const - { return mnEncodings; } - virtual int GetPixelSize() const - { return 0; } - virtual void ToString( ByteString &rString, - unsigned short nPixelSize, - rtl_TextEncoding nEncoding ) const ; - virtual void ToString( ByteString &rString, - unsigned short nPixelSize, - char* pMatricsString, - rtl_TextEncoding nEncoding ) const; - - virtual ImplFontData* GetImplFontData() const = 0; - bool IsScalable() const { return mbScalable; } - virtual FontFamily GetFamilyType() const; - virtual FontWeight GetWeight() const; - virtual FontItalic GetSlant() const; - virtual FontWidth GetWidthType() const; - virtual FontPitch GetPitch() const; - virtual FontPitch GetPitch( rtl_TextEncoding ) const; - rtl_TextEncoding GetAsciiEncoding( int *pAsciiRange = NULL ) const; - rtl_TextEncoding GetEncoding() const; - rtl_TextEncoding GetEncoding( int i ) const; - - int GetFontCodeRanges( sal_uInt32* pCodePairs ) const; - - protected: - AttributeProvider* mpFactory; - - public: - unsigned short mnFoundry; - unsigned short mnFamily; - unsigned short mnWeight; - unsigned short mnSlant; - unsigned short mnSetwidth; - bool mbScalable; - - protected: - unsigned short mnEncodings; - unsigned short mnEncCapacity; - struct EncodingInfo { - unsigned char mcSpacing; - unsigned short mnResolutionX; - unsigned short mnResolutionY; - unsigned short mnAddstyle; - unsigned short mnCharset; - rtl_TextEncoding mnEncoding; - - EncodingInfo& operator= ( const Xlfd *pXlfd ); - } *mpEncodingInfo; -}; - -// class to handle scalable bitmap fonts - -class ScalableBitmapXlfd : public ExtendedXlfd { - - public: - ScalableBitmapXlfd(); - virtual ~ScalableBitmapXlfd(); - virtual void ToString( ByteString &rString, - unsigned short nPixelSize, - rtl_TextEncoding nEncoding ) const; - virtual void ToString( ByteString &rString, - unsigned short nPixelSize, - char* pMatricsString, - rtl_TextEncoding nEncoding ) const; - - virtual ImplFontData* GetImplFontData() const ; -}; - -// class to handle true bitmap fonts - -class ScalableXlfd; - -class BitmapXlfd : public ExtendedXlfd { - - public: - BitmapXlfd(); - ~BitmapXlfd(); - bool AddEncoding( const Xlfd* ); - virtual int GetPixelSize() const - { return mnPixelSize; } - virtual void ToString( ByteString &rString, - unsigned short nPixelSize, - rtl_TextEncoding nEncoding ) const; - virtual void ToString( ByteString &rString, - unsigned short nPixelSize, - char* pMatricsString, - rtl_TextEncoding nEncoding ) const; - virtual ImplFontData* GetImplFontData() const ; - protected: - - unsigned short mnPixelSize; - unsigned short mnPointSize; - unsigned short mnAverageWidth; -}; - -// class to handle true scalable fonts - -class ScalableXlfd : public ExtendedXlfd { - - friend class BitmapXlfd; - - public: - ScalableXlfd(); - virtual ~ScalableXlfd(); - virtual void ToString( ByteString &rString, - unsigned short nPixelSize, - rtl_TextEncoding nEncoding ) const; - - virtual void ToString( ByteString &rString, - unsigned short nPixelSize, - char* pMatricsString, - rtl_TextEncoding nEncoding ) const; - virtual ImplFontData* GetImplFontData() const ; -}; - -// class to maintain a list of fonts ( bitmap and scalable ) - -class XlfdStorage { - - public: - XlfdStorage(); - - void Dispose(); - void Reset(); - - void Add( const ExtendedXlfd *pXlfd ); - void Add( const XlfdStorage *pXlfd ); - void AnnounceFonts( ImplDevFontList* ) const; - - protected: - - typedef ::std::vector XlfdList; - XlfdList maXlfdList; -}; - -// list of fonts specific for bitmap fonts - -class BitmapXlfdStorage : public XlfdStorage { - - public: - - void AddBitmapFont( const Xlfd *pXlfd ); -}; - - -/* Virtual font for User Interface */ - -class VirtualXlfd : public ExtendedXlfd -{ - private: - - int GetFontQuality (unsigned short nFamily); - - public: - VirtualXlfd(); - virtual ~VirtualXlfd(); - virtual bool AddEncoding( const Xlfd* ); - void FilterInterfaceFont (const Xlfd *pXlfd); - virtual void ToString( ByteString &rString, - unsigned short nPixelSize, - rtl_TextEncoding nEncoding ) const ; - virtual void ToString( ByteString &rString, - unsigned short nPixelSize, - char* pMatricsString, - rtl_TextEncoding nEncoding ) const; - - virtual ImplFontData* GetImplFontData() const ; - protected: - - unsigned short mnExtCapacity; - struct ExtEncodingInfo { - unsigned short mnFoundry; - unsigned short mnFamily; - unsigned short mnWeight; - unsigned short mnSlant; - unsigned short mnSetwidth; - - ExtEncodingInfo& operator= ( const Xlfd *pXlfd ); - } *mpExtEncodingInfo; - - friend class ExtEncodingInfo; -}; - - -// class to describe a X11 physically available font face - -class ImplX11FontData : public ImplFontData -{ -private: - enum { X11IFD_MAGIC = 0x111FDA1C }; - const ExtendedXlfd& mrXlfd; - -public: - ImplX11FontData( const ExtendedXlfd&, int nHeight ); - const ExtendedXlfd& GetExtendedXlfd() const { return mrXlfd; } - virtual ImplFontData* Clone() const { return new ImplX11FontData( *this ); } - virtual ImplFontEntry* CreateFontInstance( ImplFontSelectData& ) const; - virtual sal_IntPtr GetFontId() const; - - static bool CheckFontData( const ImplFontData& r ) { return r.CheckMagic( X11IFD_MAGIC ); } -}; - -#endif /* XLFD_EXTENDED_HXX */ diff --git a/vcl/unx/source/gdi/xlfd_smpl.cxx b/vcl/unx/source/gdi/xlfd_smpl.cxx deleted file mode 100644 index 6cf18d98de1e..000000000000 --- a/vcl/unx/source/gdi/xlfd_smpl.cxx +++ /dev/null @@ -1,268 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_vcl.hxx" -#include -#include -#include -#include "xlfd_attr.hxx" -#include "xlfd_smpl.hxx" - -// -------------------------------------------------------------------------- -// -// -// broken down structure equivalent to a Xlfd string -// -// -// -------------------------------------------------------------------------- - -Xlfd::Xlfd() -{ -} - -// XlfdCompare abi has to be qsort(3) compatible, the sorting result must -// guarantee that fonts with SameFontoutline() are successive -// XlfdCompare relies on vFrom->mpFactory eq vTo->mpFactory. Since comparing -// Xlfd's is done by comparing attributes there is no way around this. -extern "C" int -XlfdCompare( const void *vFrom, const void *vTo ) -{ - const Xlfd *pFrom = (Xlfd*)vFrom; - const Xlfd *pTo = (Xlfd*)vTo; - - // Compare outline description - if ( pFrom->mnFoundry != pTo->mnFoundry ) - return (int)pFrom->mnFoundry - (int)pTo->mnFoundry; - if ( pFrom->mnFamily != pTo->mnFamily ) - return (int)pFrom->mnFamily - (int)pTo->mnFamily; - if ( pFrom->mnWeight != pTo->mnWeight ) - return (int)pFrom->mnWeight - (int)pTo->mnWeight; - if ( pFrom->mnSlant != pTo->mnSlant ) - return (int)pFrom->mnSlant - (int)pTo->mnSlant; - if ( pFrom->mnSetwidth != pTo->mnSetwidth ) - return (int)pFrom->mnSetwidth - (int)pTo->mnSetwidth; - - // Addstyle name is futile tricky. it may contain encoding information - // (like "ansi_1251") which Compares equal, or it may contain style - // information (like "serif") which Compares unequal, anyway if the font - // is "interface user" or "interface system" then compare equal anyway to - // build fontsets as large as possible - if ( pFrom->mnAddstyle == pTo->mnAddstyle ) - return 0; - - AttributeProvider *pFactory = pFrom->mpFactory; - Attribute *pFamily = pFactory->RetrieveFamily( pFrom->mnFamily ); - if ( pFamily->HasFeature(XLFD_FEATURE_APPLICATION_FONT) ) - return 0; - - Attribute *pFromAddStyle = pFactory->RetrieveAddstyle( pFrom->mnAddstyle ); - Attribute *pToAddStyle = pFactory->RetrieveAddstyle( pTo->mnAddstyle ); - - // if both addstyles denote encodings or if one denotes an - // encoding and the other denotes a style which really - // duplicates weight and slant information - - int nFromCompare = (pFromAddStyle->GetValue() != RTL_TEXTENCODING_DONTKNOW) - || (pFromAddStyle->HasFeature(XLFD_FEATURE_REDUNDANTSTYLE)) ? - -1 : pFrom->mnAddstyle; - int nToCompare = (pToAddStyle->GetValue() != RTL_TEXTENCODING_DONTKNOW) - || (pToAddStyle->HasFeature(XLFD_FEATURE_REDUNDANTSTYLE)) ? - -1 : pTo->mnAddstyle; - - return nFromCompare - nToCompare; -} - -// check whether two fonts are identical as appearance is concerned -// this does not Compare the actual scaling of two fonts -Bool -Xlfd::SameFontoutline( const Xlfd* pComparedTo ) const -{ - void* pThis = (void*)this; - return XlfdCompare( (void*)pThis, (void*)pComparedTo ) == 0 ; -} - -unsigned short -Xlfd::GetEncoding() const -{ - Attribute *pAddstyle = mpFactory->RetrieveAddstyle( mnAddstyle ); - if ( pAddstyle->GetValue() != RTL_TEXTENCODING_DONTKNOW ) - return pAddstyle->GetValue(); - - Attribute *pEncoding = mpFactory->RetrieveCharset( mnCharset ); - return pEncoding->GetValue(); -} - -XlfdFonttype -Xlfd::Fonttype() const -{ - if ( (mnAverageWidth == 0) && (mnPixelSize == 0) && (mnPointSize == 0) ) - { - return (mnResolutionX == 0) - && (mnResolutionY == 0) ? eTypeScalable : eTypeScalableBitmap; - } - - return eTypeBitmap; -} - -void -Advance( const char** pFrom, const char** pTo ) -{ - const char *pTmp = *pTo; - - for( ; (*pTmp != '\0') && (*pTmp++ != '-'); ) - {} - *pFrom = *pTo; - *pTo = pTmp; -} - -Bool -Xlfd::IsConformant (const char* pXlfd) const -{ - // X FontNameRegistry prefix "-" - if (*pXlfd++ != '-') - return False; - - // All Xlfd FontName fields are defined - int nNumFields = 1; - while (*pXlfd != '\0') - { - if (*pXlfd++ == '-') - nNumFields++; - } - // enough entries ? - if (nNumFields != 14) - return False; - // and the last one is not empty as well ? - if (*(pXlfd - 1) == '-') - return False; - - return True; -} - -// this is the real workhorse function. Since this is called for every font -// in the fontpath it has to be as fast a possible -Bool -Xlfd::FromString( const char* pXlfdstring, AttributeProvider *pFactory ) -{ - if (!IsConformant(pXlfdstring)) - return False; - - const char* pFrom = pXlfdstring + 1; - const char* pTo = pFrom; - mpFactory = pFactory; - - Advance( &pFrom, &pTo ); //-foundry-* - mnFoundry = mpFactory->InsertFoundry( pFrom, pTo - pFrom - 1 ); - - Advance( &pFrom, &pTo ); // -*-family-* - mnFamily = mpFactory->InsertFamily( pFrom, pTo - pFrom - 1 ); - - Advance( &pFrom, &pTo ); // -*-*-weight-* - mnWeight = mpFactory->InsertWeight( pFrom, pTo - pFrom - 1 ); - - Advance( &pFrom, &pTo ); //-*-*-*-slant-* - mnSlant = mpFactory->InsertSlant( pFrom, pTo - pFrom - 1 ); - - Advance( &pFrom, &pTo ); //-*-*-*-*-setwidth-* - mnSetwidth = mpFactory->InsertSetwidth( pFrom, pTo - pFrom - 1 ); - - Advance( &pFrom, &pTo ); //-*-*-*-*-*-Addstyle-* - mnAddstyle = mpFactory->InsertAddstyle( pFrom, pTo - pFrom - 1 ); - - Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-height-* - mnPixelSize = atoi( pFrom ); - - Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-*-pt height-* - mnPointSize = atoi( pFrom ); - - Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-*-*-x resolution-* - mnResolutionX = atoi( pFrom ); - - Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-*-*-*-y resolution-* - mnResolutionY = atoi( pFrom ); - - Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-*-*-*-*-spacing-* - mcSpacing = pFrom == pTo ? '\0' : *pFrom; - - Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-*-*-*-*-*-average-* - mnAverageWidth = atoi( pFrom ); - - Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-*-*-*-*-*-*-registry-encoding - const char* pTmp = pFrom; - Advance( &pTmp, &pTo ); - mnCharset = mpFactory->InsertCharset( pFrom, pTo - pFrom ); - - // sanity check whether we have really found a valid XLFD, if not - // throw away the whole font, since we have no idea what parts of - // the XLFD contains the error. - if ( !(pTo > pFrom) ) - return False; - - // a non-empty family name is essential, since otherwise the font - // would match the "default font" #52299# - Attribute* pFamily = mpFactory->RetrieveFamily( mnFamily ); - const char* pFamilyName = pFamily->GetName(); - if ( pFamilyName[0] == '\0' ) - return False; - - // well done - return True; -} - -#if OSL_DEBUG_LEVEL > 1 -// pure debug for now: this is only to inspect/pretty print a Xlfd struct -const char* -Xlfd::ToString( ByteString &rString ) const -{ - AppendAttribute( mpFactory->RetrieveFoundry(mnFoundry), rString ); - AppendAttribute( mpFactory->RetrieveFamily(mnFamily), rString ); - AppendAttribute( mpFactory->RetrieveWeight(mnWeight), rString ); - AppendAttribute( mpFactory->RetrieveSlant(mnSlant), rString ); - AppendAttribute( mpFactory->RetrieveSetwidth(mnSetwidth), rString ); - AppendAttribute( mpFactory->RetrieveAddstyle(mnAddstyle), rString ); - - rString.Append("-"); rString.Append( ByteString::CreateFromInt32( mnPixelSize ) ); - rString.Append("-"); rString.Append( ByteString::CreateFromInt32( mnPointSize ) ); - rString.Append("-"); rString.Append( ByteString::CreateFromInt32( mnResolutionX ) ); - rString.Append("-"); rString.Append( ByteString::CreateFromInt32( mnResolutionY ) ); - rString.Append("-"); rString.Append( (char)mcSpacing ); - rString.Append("-"); rString.Append( ByteString::CreateFromInt32( mnAverageWidth ) ); - - AppendAttribute( mpFactory->RetrieveCharset(mnCharset), rString ); - - return rString.GetBuffer() ; -} - -void -Xlfd::Dump() const -{ - ByteString aString; - fprintf(stderr, "Xlfd: %s\n", ToString(aString) ); -} -#endif - diff --git a/vcl/unx/source/gdi/xlfd_smpl.hxx b/vcl/unx/source/gdi/xlfd_smpl.hxx deleted file mode 100644 index f62ac381e6b9..000000000000 --- a/vcl/unx/source/gdi/xlfd_smpl.hxx +++ /dev/null @@ -1,92 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef XLFD_SIMPLE_HXX -#define XLFD_SIMPLE_HXX - -#include -#include -#include - -class AttributeProvider; - -// -------------------------------------------------------------------------- -// -// -// broken down structure equivalent to a Xlfd string -// -// -// -------------------------------------------------------------------------- - -enum XlfdFonttype { - eTypeUnknown = TYPE_DONTKNOW, - eTypeBitmap = TYPE_RASTER, - eTypeScalableBitmap = TYPE_VECTOR, - eTypeScalable = TYPE_SCALABLE -}; - -class Xlfd { - - public: - - unsigned short mnFoundry; - unsigned short mnFamily; - unsigned short mnWeight; - unsigned short mnSlant; - unsigned short mnSetwidth; - unsigned short mnAddstyle; - unsigned short mnPixelSize; - unsigned short mnPointSize; - unsigned short mnResolutionX; - unsigned short mnResolutionY; - unsigned char mcSpacing; - unsigned short mnAverageWidth; - unsigned short mnCharset; - - // all foundry, family, weight ... information referres - // to this factory - AttributeProvider *mpFactory; - - Bool IsConformant( const char* pXlfdstring ) const; - - public: - Xlfd(); - Bool FromString( const char* pXlfdstring, - AttributeProvider *pFactory ); - Bool SameFontoutline( const Xlfd *pComparedTo ) const ; - XlfdFonttype Fonttype() const ; - unsigned short GetEncoding() const ; - #if OSL_DEBUG_LEVEL > 1 - const char* ToString( ByteString &rString ) const ; - void Dump() const; - #endif -}; - -extern "C" int -XlfdCompare( const void *vFrom, const void *vTo ); - -#endif /* XLFD_SIMPLE_HXX */ - -- cgit From 098a95148b87e2cae95912459703ac5b2fb9b722 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Wed, 17 Nov 2010 11:35:55 +0100 Subject: #i110171# FontGC is still needed for clipping/forcedAA/gtk/kde-plugins --- vcl/unx/source/gdi/salgdi.cxx | 8 +++++++- vcl/unx/source/gdi/salgdi3.cxx | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'vcl/unx') diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx index b2e40310a03e..10532b811d68 100644 --- a/vcl/unx/source/gdi/salgdi.cxx +++ b/vcl/unx/source/gdi/salgdi.cxx @@ -111,6 +111,7 @@ X11SalGraphics::X11SalGraphics() nPenPixel_ = 0; nPenColor_ = MAKE_SALCOLOR( 0x00, 0x00, 0x00 ); // Black + pFontGC_ = NULL; for( int i = 0; i < MAX_FALLBACK; ++i ) mpServerFont[i] = NULL; @@ -140,6 +141,7 @@ X11SalGraphics::X11SalGraphics() bPrinter_ = FALSE; bVirDev_ = FALSE; bPenGC_ = FALSE; + bFontGC_ = FALSE; bBrushGC_ = FALSE; bMonoGC_ = FALSE; bCopyGC_ = FALSE; @@ -169,6 +171,7 @@ void X11SalGraphics::freeResources() if( hBrush_ ) XFreePixmap( pDisplay, hBrush_ ), hBrush_ = None; if( pPenGC_ ) XFreeGC( pDisplay, pPenGC_ ), pPenGC_ = None; + if( pFontGC_ ) XFreeGC( pDisplay, pFontGC_ ), pFontGC_ = None; if( pBrushGC_ ) XFreeGC( pDisplay, pBrushGC_ ), pBrushGC_ = None; if( pMonoGC_ ) XFreeGC( pDisplay, pMonoGC_ ), pMonoGC_ = None; if( pCopyGC_ ) XFreeGC( pDisplay, pCopyGC_ ), pCopyGC_ = None; @@ -183,7 +186,7 @@ void X11SalGraphics::freeResources() if( m_aRenderPicture ) XRenderPeer::GetInstance().FreePicture( m_aRenderPicture ), m_aRenderPicture = 0; - bPenGC_ = bBrushGC_ = bMonoGC_ = bCopyGC_ = bInvertGC_ = bInvert50GC_ = bStippleGC_ = bTrackingGC_ = false; + bPenGC_ = bFontGC_ = bBrushGC_ = bMonoGC_ = bCopyGC_ = bInvertGC_ = bInvert50GC_ = bStippleGC_ = bTrackingGC_ = false; } void X11SalGraphics::SetDrawable( Drawable aDrawable, int nScreen ) @@ -576,6 +579,7 @@ void X11SalGraphics::ResetClipRegion() if( pClipRegion_ ) { bPenGC_ = FALSE; + bFontGC_ = FALSE; bBrushGC_ = FALSE; bMonoGC_ = FALSE; bCopyGC_ = FALSE; @@ -625,6 +629,7 @@ bool X11SalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& ) void X11SalGraphics::EndSetClipRegion() { bPenGC_ = FALSE; + bFontGC_ = FALSE; bBrushGC_ = FALSE; bMonoGC_ = FALSE; bCopyGC_ = FALSE; @@ -749,6 +754,7 @@ void X11SalGraphics::SetXORMode( bool bSet, bool ) { bXORMode_ = bSet; bPenGC_ = FALSE; + bFontGC_ = FALSE; bBrushGC_ = FALSE; bMonoGC_ = FALSE; bCopyGC_ = FALSE; diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx index 360c7e95d8f9..0861b778ed57 100644 --- a/vcl/unx/source/gdi/salgdi3.cxx +++ b/vcl/unx/source/gdi/salgdi3.cxx @@ -993,6 +993,7 @@ X11SalGraphics::SetTextColor( SalColor nSalColor ) { nTextColor_ = nSalColor; nTextPixel_ = GetPixel( nSalColor ); + bFontGC_ = FALSE; } } -- cgit From 84444c912fd76c38d39c9db7ad94648b49e912ba Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Wed, 17 Nov 2010 15:10:23 +0100 Subject: #i110171# remove obsoleted fwd-decls and dbg-utils --- vcl/unx/inc/salgdi.h | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/inc/salgdi.h b/vcl/unx/inc/salgdi.h index 6a77d4bacf96..8af62a5c6607 100644 --- a/vcl/unx/inc/salgdi.h +++ b/vcl/unx/inc/salgdi.h @@ -28,10 +28,6 @@ #ifndef _SV_SALGDI_H #define _SV_SALGDI_H - -// -=-= exports -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -class SalFontCacheItem; - // -=-= includes -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= #include "salstd.hxx" #include "vcl/salgdi.hxx" @@ -383,19 +379,8 @@ inline Pixel X11SalGraphics::GetPixel( SalColor nSalColor ) const #ifdef DBG_UTIL #define stderr0( s ) fprintf( stderr, s ) -#define stderr1( s, a ) fprintf( stderr, s, a ) -#define stderr2( s, a, b ) fprintf( stderr, s, a, b ) -#define stderr3( s, a, b, c ) fprintf( stderr, s, a, b, c ) -#define stdass0( b ) (void)( !(b) \ - ? fprintf( stderr, "\"%s\" (%s line %d)\n", \ - #b, __FILE__, __LINE__ ) \ - : 0 ) #else #define stderr0( s ) ; -#define stderr1( s, a ) ; -#define stderr2( s, a, b ) ; -#define stderr3( s, a, b, c ) ; -#define stdass0( b ) ; #endif #endif // _SV_SALGDI_H -- cgit From f01fbf1d4f68ddd9dae19de5138e213764be8c1d Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Wed, 17 Nov 2010 15:36:53 +0100 Subject: #i115635# finish of remainders of xprint usage --- vcl/unx/inc/i18n_im.hxx | 4 ---- vcl/unx/source/app/saldisp.cxx | 5 ----- vcl/unx/source/gdi/makefile.mk | 5 ----- vcl/unx/source/gdi/salgdi.cxx | 5 ----- vcl/unx/source/gdi/salgdi3.cxx | 18 ------------------ vcl/unx/source/window/salframe.cxx | 2 -- 6 files changed, 39 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/inc/i18n_im.hxx b/vcl/unx/inc/i18n_im.hxx index 297bc8edec17..a22a57b976c8 100644 --- a/vcl/unx/inc/i18n_im.hxx +++ b/vcl/unx/inc/i18n_im.hxx @@ -56,10 +56,6 @@ public: Bool FilterEvent( XEvent *pEvent, XLIB_Window window ); Bool AddConnectionWatch (Display *pDisplay, void *pConnectionHandler); - #ifdef _USE_PRINT_EXTENSION_ - void Invalidate() { mbUseable = False; } - #endif - SalI18N_InputMethod(); ~SalI18N_InputMethod(); }; diff --git a/vcl/unx/source/app/saldisp.cxx b/vcl/unx/source/app/saldisp.cxx index cd3d7ea06fde..92d5f75f7315 100644 --- a/vcl/unx/source/app/saldisp.cxx +++ b/vcl/unx/source/app/saldisp.cxx @@ -375,11 +375,6 @@ sal_GetServerVendor( Display *p_display ) { vendor_none, NULL, 0 }, }; -#ifdef _USE_PRINT_EXTENSION_ - if ( ! XSalIsDisplay( p_display ) ) - return vendor_xprinter; -#endif - // handle regular server vendors char *p_name = ServerVendor( p_display ); vendor_t *p_vendor; diff --git a/vcl/unx/source/gdi/makefile.mk b/vcl/unx/source/gdi/makefile.mk index 7e889266a831..123fcbcf9131 100644 --- a/vcl/unx/source/gdi/makefile.mk +++ b/vcl/unx/source/gdi/makefile.mk @@ -64,13 +64,8 @@ EXCEPTIONSFILES=\ $(SLO)$/salgdi3.obj \ $(SLO)$/salcvt.obj -.IF "$(USE_XPRINT)" == "TRUE" -CFLAGS+=-D_USE_PRINT_EXTENSION_=1 -SLOFILES+=$(SLO)$/xprintext.obj -.ELSE SLOFILES+=$(SLO)$/salprnpsp.obj EXCEPTIONSFILES+=$(SLO)$/salprnpsp.obj -.ENDIF .IF "$(OS)"=="SOLARIS" SLOFILES+=$(SLO)$/cdeint.obj diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx index 10532b811d68..9dfbfff22d03 100644 --- a/vcl/unx/source/gdi/salgdi.cxx +++ b/vcl/unx/source/gdi/salgdi.cxx @@ -335,13 +335,8 @@ GC X11SalGraphics::SelectBrush() { XSetFillStyle ( pDisplay, pBrushGC_, FillSolid ); XSetForeground( pDisplay, pBrushGC_, nBrushPixel_ ); - #if defined(_USE_PRINT_EXTENSION_) - XSetBackground( pDisplay, pBrushGC_, - WhitePixel(pDisplay, DefaultScreen(pDisplay)) ); - #else if( bPrinter_ ) XSetTile( pDisplay, pBrushGC_, None ); - #endif } else { diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx index 0861b778ed57..d9f81c0f67d2 100644 --- a/vcl/unx/source/gdi/salgdi3.cxx +++ b/vcl/unx/source/gdi/salgdi3.cxx @@ -160,18 +160,10 @@ X11SalGraphics::GetFontGC() values.fill_rule = EvenOddRule; // Pict import/ Gradient values.graphics_exposures = False; values.foreground = nTextPixel_; -#ifdef _USE_PRINT_EXTENSION_ - values.background = xColormap_->GetWhitePixel(); - pFontGC_ = XCreateGC( pDisplay, hDrawable_, - GCSubwindowMode | GCFillRule - | GCGraphicsExposures | GCBackground | GCForeground, - &values ); -#else pFontGC_ = XCreateGC( pDisplay, hDrawable_, GCSubwindowMode | GCFillRule | GCGraphicsExposures | GCForeground, &values ); -#endif } if( !bFontGC_ ) { @@ -1372,7 +1364,6 @@ BOOL X11SalGraphics::CreateFontSubset( const void* X11SalGraphics::GetEmbedFontData( const ImplFontData* pFont, const sal_Ucs* pUnicodes, sal_Int32* pWidths, FontSubsetInfo& rInfo, long* pDataLen ) { -#ifndef _USE_PRINT_EXTENSION_ // in this context the pFont->GetFontId() is a valid PSP // font since they are the only ones left after the PDF // export has filtered its list of subsettable fonts (for @@ -1380,25 +1371,19 @@ const void* X11SalGraphics::GetEmbedFontData( const ImplFontData* pFont, const s // be to have the GlyphCache search for the ImplFontData pFont psp::fontID aFont = pFont->GetFontId(); return PspGraphics::DoGetEmbedFontData( aFont, pUnicodes, pWidths, rInfo, pDataLen ); -#else - return NULL; -#endif } //-------------------------------------------------------------------------- void X11SalGraphics::FreeEmbedFontData( const void* pData, long nLen ) { -#ifndef _USE_PRINT_EXTENSION_ PspGraphics::DoFreeEmbedFontData( pData, nLen ); -#endif } //-------------------------------------------------------------------------- const Ucs2SIntMap* X11SalGraphics::GetFontEncodingVector( const ImplFontData* pFont, const Ucs2OStrMap** pNonEncoded ) { -#ifndef _USE_PRINT_EXTENSION_ // in this context the pFont->GetFontId() is a valid PSP // font since they are the only ones left after the PDF // export has filtered its list of subsettable fonts (for @@ -1406,9 +1391,6 @@ const Ucs2SIntMap* X11SalGraphics::GetFontEncodingVector( const ImplFontData* pF // be to have the GlyphCache search for the ImplFontData pFont psp::fontID aFont = pFont->GetFontId(); return PspGraphics::DoGetFontEncodingVector( aFont, pNonEncoded ); -#else - return NULL; -#endif } //-------------------------------------------------------------------------- diff --git a/vcl/unx/source/window/salframe.cxx b/vcl/unx/source/window/salframe.cxx index 9934277302e1..11c20aa40f5a 100644 --- a/vcl/unx/source/window/salframe.cxx +++ b/vcl/unx/source/window/salframe.cxx @@ -3588,9 +3588,7 @@ long X11SalFrame::HandleFocusEvent( XFocusChangeEvent *pEvent ) if( FocusIn == pEvent->type ) { -#ifndef _USE_PRINT_EXTENSION_ vcl_sal::PrinterUpdate::update(); -#endif mbInputFocus = True; ImplSVData* pSVData = ImplGetSVData(); -- cgit From 75a3de669fef8dff6cdbe430437f8666ba55029f Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 23 Nov 2010 13:57:59 +0100 Subject: vcl117: removed useless header --- vcl/unx/headless/svpinst.cxx | 2 +- vcl/unx/source/app/salinst.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/headless/svpinst.cxx b/vcl/unx/headless/svpinst.cxx index fc788b2a0530..09e359ca3f71 100644 --- a/vcl/unx/headless/svpinst.cxx +++ b/vcl/unx/headless/svpinst.cxx @@ -38,7 +38,7 @@ #include #include -#include +#include #include #include diff --git a/vcl/unx/source/app/salinst.cxx b/vcl/unx/source/app/salinst.cxx index 88af0b70ef7e..f125d5f98fa6 100644 --- a/vcl/unx/source/app/salinst.cxx +++ b/vcl/unx/source/app/salinst.cxx @@ -45,7 +45,7 @@ #include "sm.hxx" #include "vcl/salwtype.hxx" -#include "vcl/salatype.hxx" +#include "vcl/apptypes.hxx" #include "vcl/helper.hxx" #include #include "vos/mutex.hxx" -- cgit From 8130d39f6b56271aedad5dcfd0d2f065ef15acaf Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 2 Dec 2010 14:26:04 +0100 Subject: vcl118: #i115871# include proper header --- vcl/unx/inc/dtint.hxx | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/inc/dtint.hxx b/vcl/unx/inc/dtint.hxx index 75f197c81e13..6e6cf13575ed 100644 --- a/vcl/unx/inc/dtint.hxx +++ b/vcl/unx/inc/dtint.hxx @@ -31,19 +31,12 @@ #include #include #include +#include "svunx.h" class SalBitmap; class SalDisplay; class AllSettings; -#ifndef _XLIB_H_ -// forwards from X -struct Display; -struct XEvent; -#define Atom UINT32 -#define XLIB_Window UINT32 -#endif - enum DtType { DtGeneric, DtCDE -- cgit From 6d85cb5f029b0c3ac8e597d02e5875974dc9757f Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 6 Dec 2010 15:21:36 +0100 Subject: vcl118: #i115905# improved clip region interface on SAL layer (part 3, X11 implementation) --- vcl/unx/gtk/app/gtkdata.cxx | 6 ++- vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 25 ++-------- vcl/unx/headless/svpgdi.cxx | 50 +++++++++---------- vcl/unx/headless/svpgdi.hxx | 5 +- vcl/unx/headless/svppspgraphics.cxx | 36 +++++++------- vcl/unx/headless/svppspgraphics.hxx | 5 +- vcl/unx/inc/plugins/gtk/gtkgdi.hxx | 5 +- vcl/unx/inc/pspgraphics.h | 5 +- vcl/unx/inc/salgdi.h | 7 +-- vcl/unx/source/gdi/pspgraphics.cxx | 36 +++++++------- vcl/unx/source/gdi/salgdi.cxx | 84 +++++++++++++++----------------- vcl/unx/source/gdi/salgdi2.cxx | 12 ++--- vcl/unx/source/gdi/salgdi3.cxx | 24 ++++----- 13 files changed, 128 insertions(+), 172 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx index f308822df147..a031c3dc242e 100644 --- a/vcl/unx/gtk/app/gtkdata.cxx +++ b/vcl/unx/gtk/app/gtkdata.cxx @@ -246,13 +246,15 @@ int GtkSalDisplay::GetDefaultMonitorNumber() const int n = 0; GdkScreen* pScreen = gdk_display_get_screen( m_pGdkDisplay, m_nDefaultScreen ); #if GTK_CHECK_VERSION(2,20,0) - n = m_aXineramaScreenIndexMap[gdk_screen_get_primary_monitor(pScreen)]; + n = gdk_screen_get_primary_monitor(pScreen); #else static screen_get_primary_monitor sym_gdk_screen_get_primary_monitor = (screen_get_primary_monitor)osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gdk_screen_get_primary_monitor" ); if (sym_gdk_screen_get_primary_monitor) - n = m_aXineramaScreenIndexMap[sym_gdk_screen_get_primary_monitor( pScreen )]; + n = sym_gdk_screen_get_primary_monitor( pScreen ); #endif + if( n >= 0 && size_t(n) < m_aXineramaScreenIndexMap.size() ) + n = m_aXineramaScreenIndexMap[n]; return n; } diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 318f593ac6a3..812394b488ce 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -479,30 +479,13 @@ void GtkSalGraphics::ResetClipRegion() X11SalGraphics::ResetClipRegion(); } -void GtkSalGraphics::BeginSetClipRegion( ULONG nCount ) -{ - m_aClipRegion.SetNull(); - X11SalGraphics::BeginSetClipRegion( nCount ); -} - -BOOL GtkSalGraphics::unionClipRegion( long nX, long nY, long nWidth, long nHeight ) -{ - Rectangle aRect( Point( nX, nY ), Size( nWidth, nHeight ) ); - m_aClipRegion.Union( aRect ); - return X11SalGraphics::unionClipRegion( nX, nY, nWidth, nHeight ); -} - -bool GtkSalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& ) -{ - // TODO: implement and advertise OutDevSupport_B2DClip support - return false; -} - -void GtkSalGraphics::EndSetClipRegion() +bool GtkSalGraphics::setClipRegion( const Region& i_rClip ) { + m_aClipRegion = i_rClip; + bool bRet = X11SalGraphics::setClipRegion( m_aClipRegion ); if( m_aClipRegion.IsEmpty() ) m_aClipRegion.SetNull(); - X11SalGraphics::EndSetClipRegion(); + return bRet; } void GtkSalGraphics::copyBits( const SalTwoRect* pPosAry, diff --git a/vcl/unx/headless/svpgdi.cxx b/vcl/unx/headless/svpgdi.cxx index 68d8be7cb4eb..01a953987640 100644 --- a/vcl/unx/headless/svpgdi.cxx +++ b/vcl/unx/headless/svpgdi.cxx @@ -29,6 +29,7 @@ #include "svpbmp.hxx" #include +#include #include #include #include @@ -152,11 +153,16 @@ void SvpSalGraphics::ResetClipRegion() m_aClipMap.reset(); } -void SvpSalGraphics::BeginSetClipRegion( ULONG n ) +bool SvpSalGraphics::setClipRegion( const Region& i_rClip ) { - if( n <= 1 ) + if( i_rClip.IsEmpty() ) + m_aClipMap.reset(); + else if( i_rClip.GetRectCount() == 1 ) { m_aClipMap.reset(); + Rectangle aBoundRect( i_rClip.GetBoundRect() ); + m_aDevice = basebmp::subsetBitmapDevice( m_aOrigDevice, + basegfx::B2IRange(aBoundRect.Left(),aBoundRect.Top(),aBoundRect.Right(),aBoundRect.Bottom()) ); } else { @@ -164,34 +170,22 @@ void SvpSalGraphics::BeginSetClipRegion( ULONG n ) B2IVector aSize = m_aDevice->getSize(); m_aClipMap = createBitmapDevice( aSize, false, Format::ONE_BIT_MSB_GREY ); m_aClipMap->clear( basebmp::Color(0xFFFFFFFF) ); - } -} -BOOL SvpSalGraphics::unionClipRegion( long nX, long nY, long nWidth, long nHeight ) -{ - if( m_aClipMap ) - { - B2DPolyPolygon aFull; - aFull.append( tools::createPolygonFromRect( B2DRectangle( nX, nY, nX+nWidth, nY+nHeight ) ) ); - m_aClipMap->fillPolyPolygon( aFull, basebmp::Color(0), DrawMode_PAINT ); - } - else - { - m_aDevice = basebmp::subsetBitmapDevice( m_aOrigDevice, - basegfx::B2IRange(nX,nY,nX+nWidth,nY+nHeight) ); + ImplRegionInfo aInfo; + long nX, nY, nW, nH; + bool bRegionRect = i_rClip.ImplGetFirstRect(aInfo, nX, nY, nW, nH ); + while( bRegionRect ) + { + if ( nW && nH ) + { + B2DPolyPolygon aFull; + aFull.append( tools::createPolygonFromRect( B2DRectangle( nX, nY, nX+nW, nY+nH ) ) ); + m_aClipMap->fillPolyPolygon( aFull, basebmp::Color(0), DrawMode_PAINT ); + } + bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH ); + } } - - return TRUE; -} - -bool SvpSalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& ) -{ - // TODO: implement and advertise OutDevSupport_B2DClip support - return false; -} - -void SvpSalGraphics::EndSetClipRegion() -{ + return true; } void SvpSalGraphics::SetLineColor() diff --git a/vcl/unx/headless/svpgdi.hxx b/vcl/unx/headless/svpgdi.hxx index 93ec080d0136..9d26d576a664 100644 --- a/vcl/unx/headless/svpgdi.hxx +++ b/vcl/unx/headless/svpgdi.hxx @@ -68,10 +68,7 @@ public: virtual long GetGraphicsWidth() const; virtual void ResetClipRegion(); - virtual void BeginSetClipRegion( ULONG nCount ); - virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight ); - virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& ); - virtual void EndSetClipRegion(); + virtual bool setClipRegion( const Region& ); virtual void SetLineColor(); virtual void SetLineColor( SalColor nSalColor ); diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx index c7b1f4f41fca..ad3cc099157f 100644 --- a/vcl/unx/headless/svppspgraphics.cxx +++ b/vcl/unx/headless/svppspgraphics.cxx @@ -43,6 +43,7 @@ #include "vcl/svapp.hxx" #include "vcl/salprn.hxx" #include "vcl/sysdata.hxx" +#include "vcl/region.h" #include "basegfx/vector/b2ivector.hxx" #include "basegfx/point/b2ipoint.hxx" @@ -216,28 +217,27 @@ long PspGraphics::GetGraphicsWidth() const void PspGraphics::ResetClipRegion() { - m_pPrinterGfx->ResetClipRegion (); + m_pPrinterGfx->ResetClipRegion(); } -void PspGraphics::BeginSetClipRegion( ULONG n ) +bool PspGraphics::setClipRegion( const Region& i_rClip ) { - m_pPrinterGfx->BeginSetClipRegion(n); -} - -BOOL PspGraphics::unionClipRegion( long nX, long nY, long nDX, long nDY ) -{ - return (BOOL)m_pPrinterGfx->UnionClipRegion (nX, nY, nDX, nDY); -} + // TODO: support polygonal clipregions here + m_pPrinterGfx->BeginSetClipRegion( i_rClip.GetRectCount() ); -bool PspGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& ) -{ - // TODO: implement and advertise OutDevSupport_B2DClip support - return false; -} - -void PspGraphics::EndSetClipRegion() -{ - m_pPrinterGfx->EndSetClipRegion (); + ImplRegionInfo aInfo; + long nX, nY, nW, nH; + bool bRegionRect = i_rClip.ImplGetFirstRect(aInfo, nX, nY, nW, nH ); + while( bRegionRect ) + { + if ( nW && nH ) + { + m_pPrinterGfx->UnionClipRegion( nX, nY, nW, nH ); + } + bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH ); + } + m_pPrinterGfx->EndSetClipRegion(); + return true; } void PspGraphics::SetLineColor() diff --git a/vcl/unx/headless/svppspgraphics.hxx b/vcl/unx/headless/svppspgraphics.hxx index 138198239621..ba60a50dedeb 100644 --- a/vcl/unx/headless/svppspgraphics.hxx +++ b/vcl/unx/headless/svppspgraphics.hxx @@ -90,10 +90,7 @@ public: virtual long GetGraphicsWidth() const; virtual void ResetClipRegion(); - virtual void BeginSetClipRegion( ULONG nCount ); - virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight ); - virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& ); - virtual void EndSetClipRegion(); + virtual bool setClipRegion( const Region& ); virtual void SetLineColor(); virtual void SetLineColor( SalColor nSalColor ); diff --git a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx index 38c79b3e11df..7729d14a42fe 100644 --- a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx +++ b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx @@ -78,11 +78,8 @@ public: //helper methods for frame's UpdateSettings void updateSettings( AllSettings& rSettings ); + virtual bool setClipRegion( const Region& ); virtual void ResetClipRegion(); - virtual void BeginSetClipRegion( ULONG nCount ); - virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight ); - virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& ); - virtual void EndSetClipRegion(); // some themes set the background pixmap of our window EVERY time // a control is painted; but presentation effects need diff --git a/vcl/unx/inc/pspgraphics.h b/vcl/unx/inc/pspgraphics.h index d4f5a9f156e0..a4f5bbf86d5f 100644 --- a/vcl/unx/inc/pspgraphics.h +++ b/vcl/unx/inc/pspgraphics.h @@ -87,10 +87,7 @@ public: virtual long GetGraphicsWidth() const; virtual void ResetClipRegion(); - virtual void BeginSetClipRegion( ULONG nCount ); - virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight ); - virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& ); - virtual void EndSetClipRegion(); + virtual bool setClipRegion( const Region& ); virtual void SetLineColor(); virtual void SetLineColor( SalColor nSalColor ); diff --git a/vcl/unx/inc/salgdi.h b/vcl/unx/inc/salgdi.h index b5fdce50eee9..a43ff9dc363b 100644 --- a/vcl/unx/inc/salgdi.h +++ b/vcl/unx/inc/salgdi.h @@ -93,7 +93,7 @@ protected: CairoFontsCache m_aCairoFontsCache; XLIB_Region pPaintRegion_; - XLIB_Region pClipRegion_; + XLIB_Region mpClipRegion; GC pPenGC_; // Pen attributes SalColor nPenColor_; @@ -235,10 +235,7 @@ public: virtual long GetGraphicsHeight() const; virtual void ResetClipRegion(); - virtual void BeginSetClipRegion( ULONG nCount ); - virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight ); - virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& ); - virtual void EndSetClipRegion(); + virtual bool setClipRegion( const Region& ); virtual void SetLineColor(); virtual void SetLineColor( SalColor nSalColor ); diff --git a/vcl/unx/source/gdi/pspgraphics.cxx b/vcl/unx/source/gdi/pspgraphics.cxx index bab78b0cb2df..d1d78f5f390b 100644 --- a/vcl/unx/source/gdi/pspgraphics.cxx +++ b/vcl/unx/source/gdi/pspgraphics.cxx @@ -41,6 +41,7 @@ #include "vcl/svapp.hxx" #include "vcl/salprn.hxx" #include "vcl/sysdata.hxx" +#include "vcl/region.h" #include #include @@ -290,28 +291,27 @@ long PspGraphics::GetGraphicsWidth() const void PspGraphics::ResetClipRegion() { - m_pPrinterGfx->ResetClipRegion (); + m_pPrinterGfx->ResetClipRegion(); } -void PspGraphics::BeginSetClipRegion( ULONG n ) +bool PspGraphics::setClipRegion( const Region& i_rClip ) { - m_pPrinterGfx->BeginSetClipRegion(n); -} - -BOOL PspGraphics::unionClipRegion( long nX, long nY, long nDX, long nDY ) -{ - return (BOOL)m_pPrinterGfx->UnionClipRegion (nX, nY, nDX, nDY); -} + // TODO: support polygonal clipregions here + m_pPrinterGfx->BeginSetClipRegion( i_rClip.GetRectCount() ); -bool PspGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& ) -{ - // TODO: implement and advertise OutDevSupport_B2DClip support - return false; -} - -void PspGraphics::EndSetClipRegion() -{ - m_pPrinterGfx->EndSetClipRegion (); + ImplRegionInfo aInfo; + long nX, nY, nW, nH; + bool bRegionRect = i_rClip.ImplGetFirstRect(aInfo, nX, nY, nW, nH ); + while( bRegionRect ) + { + if ( nW && nH ) + { + m_pPrinterGfx->UnionClipRegion( nX, nY, nW, nH ); + } + bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH ); + } + m_pPrinterGfx->EndSetClipRegion(); + return true; } void PspGraphics::SetLineColor() diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx index 9215f2e25b16..cd8df8439247 100644 --- a/vcl/unx/source/gdi/salgdi.cxx +++ b/vcl/unx/source/gdi/salgdi.cxx @@ -40,6 +40,7 @@ #include "vcl/printergfx.hxx" #include "vcl/jobdata.hxx" +#include "vcl/region.h" #include "tools/debug.hxx" @@ -104,7 +105,7 @@ X11SalGraphics::X11SalGraphics() m_aRenderPicture = 0; m_pRenderFormat = NULL; - pClipRegion_ = NULL; + mpClipRegion = NULL; pPaintRegion_ = NULL; pPenGC_ = NULL; @@ -170,7 +171,7 @@ void X11SalGraphics::freeResources() Display *pDisplay = GetXDisplay(); DBG_ASSERT( !pPaintRegion_, "pPaintRegion_" ); - if( pClipRegion_ ) XDestroyRegion( pClipRegion_ ), pClipRegion_ = None; + if( mpClipRegion ) XDestroyRegion( mpClipRegion ), mpClipRegion = None; if( hBrush_ ) XFreePixmap( pDisplay, hBrush_ ), hBrush_ = None; if( pPenGC_ ) XFreeGC( pDisplay, pPenGC_ ), pPenGC_ = None; @@ -260,8 +261,8 @@ void X11SalGraphics::SetClipRegion( GC pGC, XLIB_Region pXReg ) const int n = 0; XLIB_Region Regions[3]; - if( pClipRegion_ /* && !XEmptyRegion( pClipRegion_ ) */ ) - Regions[n++] = pClipRegion_; + if( mpClipRegion /* && !XEmptyRegion( mpClipRegion ) */ ) + Regions[n++] = mpClipRegion; // if( pPaintRegion_ /* && !XEmptyRegion( pPaintRegion_ ) */ ) // Regions[n++] = pPaintRegion_; @@ -579,7 +580,7 @@ long X11SalGraphics::GetGraphicsHeight() const // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= void X11SalGraphics::ResetClipRegion() { - if( pClipRegion_ ) + if( mpClipRegion ) { bPenGC_ = FALSE; bFontGC_ = FALSE; @@ -591,46 +592,36 @@ void X11SalGraphics::ResetClipRegion() bStippleGC_ = FALSE; bTrackingGC_ = FALSE; - XDestroyRegion( pClipRegion_ ); - pClipRegion_ = NULL; + XDestroyRegion( mpClipRegion ); + mpClipRegion = NULL; } } -// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalGraphics::BeginSetClipRegion( ULONG ) -{ - if( pClipRegion_ ) - XDestroyRegion( pClipRegion_ ); - pClipRegion_ = XCreateRegion(); -} - -// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -BOOL X11SalGraphics::unionClipRegion( long nX, long nY, long nDX, long nDY ) +bool X11SalGraphics::setClipRegion( const Region& i_rClip ) { - if (!nDX || !nDY) - return TRUE; - - XRectangle aRect; - aRect.x = (short)nX; - aRect.y = (short)nY; - aRect.width = (unsigned short)nDX; - aRect.height = (unsigned short)nDY; - - XUnionRectWithRegion( &aRect, pClipRegion_, pClipRegion_ ); - - return TRUE; -} + if( mpClipRegion ) + XDestroyRegion( mpClipRegion ); + mpClipRegion = XCreateRegion(); + + ImplRegionInfo aInfo; + long nX, nY, nW, nH; + bool bRegionRect = i_rClip.ImplGetFirstRect(aInfo, nX, nY, nW, nH ); + while( bRegionRect ) + { + if ( nW && nH ) + { + XRectangle aRect; + aRect.x = (short)nX; + aRect.y = (short)nY; + aRect.width = (unsigned short)nW; + aRect.height = (unsigned short)nH; -// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -bool X11SalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& ) -{ - // TODO: implement and advertise OutDevSupport_B2DClip support - return false; -} + XUnionRectWithRegion( &aRect, mpClipRegion, mpClipRegion ); + } + bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH ); + } -// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalGraphics::EndSetClipRegion() -{ + // done, invalidate GCs bPenGC_ = FALSE; bFontGC_ = FALSE; bBrushGC_ = FALSE; @@ -641,11 +632,12 @@ void X11SalGraphics::EndSetClipRegion() bStippleGC_ = FALSE; bTrackingGC_ = FALSE; - if( XEmptyRegion( pClipRegion_ ) ) + if( XEmptyRegion( mpClipRegion ) ) { - XDestroyRegion( pClipRegion_ ); - pClipRegion_= NULL; + XDestroyRegion( mpClipRegion ); + mpClipRegion= NULL; } + return true; } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -1054,8 +1046,8 @@ XID X11SalGraphics::GetXRenderPicture() #if 0 // setup clipping so the callers don't have to do it themselves // TODO: avoid clipping if already set correctly - if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) ) - rRenderPeer.SetPictureClipRegion( aDstPic, pClipRegion_ ); + if( mpClipRegion && !XEmptyRegion( mpClipRegion ) ) + rRenderPeer.SetPictureClipRegion( aDstPic, mpClipRegion ); else #endif { @@ -1192,8 +1184,8 @@ bool X11SalGraphics::drawFilledTrapezoids( const ::basegfx::B2DTrapezoid* pB2DTr // set clipping // TODO: move into GetXRenderPicture? - if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) ) - rRenderPeer.SetPictureClipRegion( aDstPic, pClipRegion_ ); + if( mpClipRegion && !XEmptyRegion( mpClipRegion ) ) + rRenderPeer.SetPictureClipRegion( aDstPic, mpClipRegion ); // render the trapezoids const XRenderPictFormat* pMaskFormat = rRenderPeer.GetStandardFormatA8(); diff --git a/vcl/unx/source/gdi/salgdi2.cxx b/vcl/unx/source/gdi/salgdi2.cxx index 1cb2abbedf43..6cf1c3e1f470 100644 --- a/vcl/unx/source/gdi/salgdi2.cxx +++ b/vcl/unx/source/gdi/salgdi2.cxx @@ -308,8 +308,8 @@ int X11SalGraphics::Clip( int &nX, && RectangleOut == Clip( pPaintRegion_, nX, nY, nDX, nDY, nSrcX, nSrcY ) ) return RectangleOut; - if( pClipRegion_ - && RectangleOut == Clip( pClipRegion_, nX, nY, nDX, nDY, nSrcX, nSrcY ) ) + if( mpClipRegion + && RectangleOut == Clip( mpClipRegion, nX, nY, nDX, nDY, nSrcX, nSrcY ) ) return RectangleOut; int nPaint; @@ -323,9 +323,9 @@ int X11SalGraphics::Clip( int &nX, nPaint = RectangleIn; int nClip; - if( pClipRegion_ ) + if( mpClipRegion ) { - nClip = XRectInRegion( pClipRegion_, nX, nY, nDX, nDY ); + nClip = XRectInRegion( mpClipRegion, nX, nY, nDX, nDY ); if( RectangleOut == nClip ) return RectangleOut; } @@ -888,8 +888,8 @@ bool X11SalGraphics::drawAlphaBitmap( const SalTwoRect& rTR, return false; // set clipping - if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) ) - rPeer.SetPictureClipRegion( aDstPic, pClipRegion_ ); + if( mpClipRegion && !XEmptyRegion( mpClipRegion ) ) + rPeer.SetPictureClipRegion( aDstPic, mpClipRegion ); // paint source * mask over destination picture rPeer.CompositePicture( PictOpOver, aSrcPic, aAlphaPic, aDstPic, diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx index 62e575ebc5ef..670966f1c2ea 100644 --- a/vcl/unx/source/gdi/salgdi3.cxx +++ b/vcl/unx/source/gdi/salgdi3.cxx @@ -1016,16 +1016,16 @@ void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout ) if (const void *pOptions = Application::GetSettings().GetStyleSettings().GetCairoFontOptions()) rCairo.set_font_options( cr, pOptions); - if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) ) - { - for (long i = 0; i < pClipRegion_->numRects; ++i) + if( mpClipRegion && !XEmptyRegion( mpClipRegion ) ) { + for (long i = 0; i < mpClipRegion->numRects; ++i) + { rCairo.rectangle(cr, - pClipRegion_->rects[i].x1, - pClipRegion_->rects[i].y1, - pClipRegion_->rects[i].x2 - pClipRegion_->rects[i].x1, - pClipRegion_->rects[i].y2 - pClipRegion_->rects[i].y1); - } + mpClipRegion->rects[i].x1, + mpClipRegion->rects[i].y1, + mpClipRegion->rects[i].x2 - mpClipRegion->rects[i].x1, + mpClipRegion->rects[i].y2 - mpClipRegion->rects[i].y1); + } rCairo.clip(cr); } @@ -1109,8 +1109,8 @@ void X11SalGraphics::DrawServerAAFontString( const ServerFontLayout& rLayout ) // set clipping // TODO: move into GetXRenderPicture()? - if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) ) - rRenderPeer.SetPictureClipRegion( aDstPic, pClipRegion_ ); + if( mpClipRegion && !XEmptyRegion( mpClipRegion ) ) + rRenderPeer.SetPictureClipRegion( aDstPic, mpClipRegion ); ServerFont& rFont = rLayout.GetServerFont(); X11GlyphPeer& rGlyphPeer = X11GlyphCache::GetInstance().GetPeer(); @@ -1193,10 +1193,10 @@ bool X11SalGraphics::DrawServerAAForcedString( const ServerFontLayout& rLayout ) else if( m_pVDev ) nWidth = m_pVDev->GetWidth(), nHeight = m_pVDev->GetHeight(); - if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) ) + if( mpClipRegion && !XEmptyRegion( mpClipRegion ) ) { // get bounding box - XClipBox( pClipRegion_, &aXRect ); + XClipBox( mpClipRegion, &aXRect ); // clip with window if( aXRect.x < 0 ) aXRect.x = 0; -- cgit From 62364aa5411b5ac6ed1169748706b26a704d8ecc Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 6 Dec 2010 17:02:05 +0100 Subject: vcl118: fix a warning --- vcl/unx/inc/salgdi.h | 1 + 1 file changed, 1 insertion(+) (limited to 'vcl/unx') diff --git a/vcl/unx/inc/salgdi.h b/vcl/unx/inc/salgdi.h index a43ff9dc363b..72b3766d9bb0 100644 --- a/vcl/unx/inc/salgdi.h +++ b/vcl/unx/inc/salgdi.h @@ -137,6 +137,7 @@ protected: bool bXORMode_ : 1; // is ROP XOR Mode set BOOL bDitherBrush_ : 1; // is solid or tile + using SalGraphics::SetClipRegion; void SetClipRegion( GC pGC, XLIB_Region pXReg = NULL ) const; -- cgit From 98e9b844f2f2038d69ae159ee67cc6c3ba7d1a76 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 13 Dec 2010 13:42:14 +0100 Subject: vcl118: #i116048# improve shutdown behavior of unix clipboard (thanks sb !) --- vcl/unx/source/dtrans/X11_clipboard.hxx | 26 ++++++------ vcl/unx/source/dtrans/X11_dndcontext.hxx | 6 +-- vcl/unx/source/dtrans/X11_selection.cxx | 68 ++++++++++++++++++------------ vcl/unx/source/dtrans/X11_selection.hxx | 39 ++++++++--------- vcl/unx/source/dtrans/X11_service.cxx | 24 +++++++---- vcl/unx/source/dtrans/X11_transferable.hxx | 4 +- vcl/unx/source/fontmanager/fontmanager.cxx | 10 ++++- 7 files changed, 101 insertions(+), 76 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/source/dtrans/X11_clipboard.hxx b/vcl/unx/source/dtrans/X11_clipboard.hxx index 21bf547a9cb7..2c0ee2d95c0d 100644 --- a/vcl/unx/source/dtrans/X11_clipboard.hxx +++ b/vcl/unx/source/dtrans/X11_clipboard.hxx @@ -54,12 +54,12 @@ namespace x11 { >, public SelectionAdaptor { - Reference< ::com::sun::star::datatransfer::XTransferable > m_aContents; - Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner > m_aOwner; + com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > m_aContents; + com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner > m_aOwner; SelectionManager& m_rSelectionManager; - Reference< ::com::sun::star::lang::XInitialization > m_xSelectionManager; - ::std::list< Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener > > m_aListeners; + com::sun::star::uno::Reference< ::com::sun::star::lang::XInitialization > m_xSelectionManager; + ::std::list< com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener > > m_aListeners; Atom m_aSelection; protected: @@ -100,12 +100,12 @@ namespace x11 { * XClipboard */ - virtual Reference< ::com::sun::star::datatransfer::XTransferable > SAL_CALL getContents() + virtual com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > SAL_CALL getContents() throw(RuntimeException); virtual void SAL_CALL setContents( - const Reference< ::com::sun::star::datatransfer::XTransferable >& xTrans, - const Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner >& xClipboardOwner ) + const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& xTrans, + const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner >& xClipboardOwner ) throw(RuntimeException); virtual ::rtl::OUString SAL_CALL getName() @@ -122,27 +122,27 @@ namespace x11 { * XClipboardNotifier */ virtual void SAL_CALL addClipboardListener( - const Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener >& listener ) + const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener >& listener ) throw(RuntimeException); virtual void SAL_CALL removeClipboardListener( - const Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener >& listener ) + const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener >& listener ) throw(RuntimeException); /* * SelectionAdaptor */ - virtual Reference< ::com::sun::star::datatransfer::XTransferable > getTransferable(); + virtual com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > getTransferable(); virtual void clearTransferable(); virtual void fireContentsChanged(); - virtual Reference< XInterface > getReference() throw(); + virtual com::sun::star::uno::Reference< XInterface > getReference() throw(); }; // ------------------------------------------------------------------------ Sequence< ::rtl::OUString > SAL_CALL X11Clipboard_getSupportedServiceNames(); - Reference< XInterface > SAL_CALL X11Clipboard_createInstance( - const Reference< ::com::sun::star::lang::XMultiServiceFactory > & xMultiServiceFactory); + com::sun::star::uno::Reference< XInterface > SAL_CALL X11Clipboard_createInstance( + const com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & xMultiServiceFactory); // ------------------------------------------------------------------------ diff --git a/vcl/unx/source/dtrans/X11_dndcontext.hxx b/vcl/unx/source/dtrans/X11_dndcontext.hxx index 9b48d346f03b..d8ef87444a7a 100644 --- a/vcl/unx/source/dtrans/X11_dndcontext.hxx +++ b/vcl/unx/source/dtrans/X11_dndcontext.hxx @@ -51,7 +51,7 @@ namespace x11 { XLIB_Window m_aDropWindow; XLIB_Time m_nTimestamp; SelectionManager& m_rManager; - Reference< XInterface > m_xManagerRef; + com::sun::star::uno::Reference< XInterface > m_xManagerRef; public: DropTargetDropContext( XLIB_Window, XLIB_Time, SelectionManager& ); virtual ~DropTargetDropContext(); @@ -70,7 +70,7 @@ namespace x11 { XLIB_Window m_aDropWindow; XLIB_Time m_nTimestamp; SelectionManager& m_rManager; - Reference< XInterface > m_xManagerRef; + com::sun::star::uno::Reference< XInterface > m_xManagerRef; public: DropTargetDragContext( XLIB_Window, XLIB_Time, SelectionManager& ); virtual ~DropTargetDragContext(); @@ -88,7 +88,7 @@ namespace x11 { XLIB_Window m_aDropWindow; XLIB_Time m_nTimestamp; SelectionManager& m_rManager; - Reference< XInterface > m_xManagerRef; + com::sun::star::uno::Reference< XInterface > m_xManagerRef; public: DragSourceContext( XLIB_Window, XLIB_Time, SelectionManager& ); virtual ~DragSourceContext(); diff --git a/vcl/unx/source/dtrans/X11_selection.cxx b/vcl/unx/source/dtrans/X11_selection.cxx index 403ee9707a94..8188f2b1164a 100644 --- a/vcl/unx/source/dtrans/X11_selection.cxx +++ b/vcl/unx/source/dtrans/X11_selection.cxx @@ -80,6 +80,12 @@ EnterWindowMask |\ LeaveWindowMask +namespace { + +namespace css = com::sun::star; + +} + using namespace com::sun::star::datatransfer; using namespace com::sun::star::datatransfer::dnd; using namespace com::sun::star::lang; @@ -279,7 +285,8 @@ SelectionManager::SelectionManager() : m_nXdndActionMove( None ), m_nXdndActionLink( None ), m_nXdndActionAsk( None ), - m_nXdndActionPrivate( None ) + m_nXdndActionPrivate( None ), + m_bShutDown( false ) { m_aDropEnterEvent.data.l[0] = None; m_aDragRunning.reset(); @@ -632,7 +639,7 @@ OString SelectionManager::convertToCompound( const OUString& rText ) // ------------------------------------------------------------------------ bool SelectionManager::convertData( - const Reference< XTransferable >& xTransferable, + const css::uno::Reference< XTransferable >& xTransferable, Atom nType, Atom nSelection, int& rFormat, @@ -1527,7 +1534,7 @@ bool SelectionManager::sendData( SelectionAdaptor* pAdaptor, #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "trying bitmap conversion\n" ); #endif - Reference xBM( new BmpTransporter( aData ) ); + css::uno::Reference xBM( new BmpTransporter( aData ) ); Sequence aArgs(2), aOutArgs; Sequence aOutIndex; aArgs.getArray()[0] = makeAny( xBM ); @@ -1674,7 +1681,7 @@ bool SelectionManager::handleSelectionRequest( XSelectionRequestEvent& rRequest if( pAdaptor && XGetSelectionOwner( m_pDisplay, rRequest.selection ) == m_aWindow ) { - Reference< XTransferable > xTrans( pAdaptor->getTransferable() ); + css::uno::Reference< XTransferable > xTrans( pAdaptor->getTransferable() ); if( rRequest.target == m_nTARGETSAtom ) { // someone requests our types @@ -1843,7 +1850,7 @@ bool SelectionManager::handleSelectionRequest( XSelectionRequestEvent& rRequest dsde.DropAction = DNDConstants::ACTION_NONE; dsde.DropSuccess = sal_False; } - Reference< XDragSourceListener > xListener( m_xDragSourceListener ); + css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener ); m_xDragSourceListener.clear(); aGuard.clear(); if( xListener.is() ) @@ -2364,7 +2371,7 @@ void SelectionManager::dropComplete( sal_Bool bSuccess, XLIB_Window aDropWindow, dsde.DragSource = static_cast< XDragSource* >(this); dsde.DropAction = getUserDragAction(); dsde.DropSuccess = bSuccess; - Reference< XDragSourceListener > xListener = m_xDragSourceListener; + css::uno::Reference< XDragSourceListener > xListener = m_xDragSourceListener; m_xDragSourceListener.clear(); aGuard.clear(); @@ -2448,7 +2455,7 @@ void SelectionManager::sendDragStatus( Atom nDropAction ) dsde.DropAction = m_nSourceActions; dsde.UserAction = getUserDragAction(); - Reference< XDragSourceListener > xListener( m_xDragSourceListener ); + css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener ); // caution: do not change anything after this aGuard.clear(); if( xListener.is() ) @@ -2710,7 +2717,7 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage ) dsde.DragSource = static_cast< XDragSource* >(this); dsde.DropAction = m_nTargetAcceptAction; dsde.DropSuccess = m_bDropSuccess; - Reference< XDragSourceListener > xListener( m_xDragSourceListener ); + css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener ); m_xDragSourceListener.clear(); aGuard.clear(); xListener->dragDropEnd( dsde ); @@ -2776,7 +2783,7 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage ) dsde.DragSource = static_cast< XDragSource* >(this); dsde.DropAction = DNDConstants::ACTION_NONE; dsde.DropSuccess = sal_False; - Reference< XDragSourceListener > xListener( m_xDragSourceListener ); + css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener ); m_xDragSourceListener.clear(); aGuard.clear(); xListener->dragDropEnd( dsde ); @@ -2902,7 +2909,7 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage ) m_nDropTimeout = time( NULL ); // HACK :-) aGuard.clear(); - static_cast< X11Clipboard* >( pAdaptor )->setContents( m_xDragSourceTransferable, Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner >() ); + static_cast< X11Clipboard* >( pAdaptor )->setContents( m_xDragSourceTransferable, css::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner >() ); aGuard.reset(); bCancel = false; } @@ -2917,7 +2924,7 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage ) dsde.DragSource = static_cast< XDragSource* >(this); dsde.DropAction = DNDConstants::ACTION_NONE; dsde.DropSuccess = sal_False; - Reference< XDragSourceListener > xListener( m_xDragSourceListener ); + css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener ); m_xDragSourceListener.clear(); aGuard.clear(); xListener->dragDropEnd( dsde ); @@ -3071,7 +3078,7 @@ void SelectionManager::updateDragWindow( int nX, int nY, XLIB_Window aRoot ) { ResettableMutexGuard aGuard( m_aMutex ); - Reference< XDragSourceListener > xListener( m_xDragSourceListener ); + css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener ); m_nLastDragX = nX; m_nLastDragY = nY; @@ -3231,8 +3238,8 @@ void SelectionManager::startDrag( sal_Int8 sourceActions, sal_Int32, sal_Int32, - const Reference< XTransferable >& transferable, - const Reference< XDragSourceListener >& listener + const css::uno::Reference< XTransferable >& transferable, + const css::uno::Reference< XDragSourceListener >& listener ) throw() { #if OSL_DEBUG_LEVEL > 1 @@ -3516,8 +3523,8 @@ void SelectionManager::dragDoDispatch() { ClearableMutexGuard aGuard(m_aMutex); - Reference< XDragSourceListener > xListener( m_xDragSourceListener ); - Reference< XTransferable > xTransferable( m_xDragSourceTransferable ); + css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener ); + css::uno::Reference< XTransferable > xTransferable( m_xDragSourceTransferable ); m_xDragSourceListener.clear(); m_xDragSourceTransferable.clear(); @@ -3787,10 +3794,10 @@ void SelectionManager::run( void* pThis ) timeval aLast; gettimeofday( &aLast, 0 ); - Reference< XMultiServiceFactory > xFact( ::comphelper::getProcessServiceFactory() ); + css::uno::Reference< XMultiServiceFactory > xFact( ::comphelper::getProcessServiceFactory() ); if( xFact.is() ) { - Reference< XDesktop > xDesktop( xFact->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.frame.Desktop" ) ), UNO_QUERY ); + css::uno::Reference< XDesktop > xDesktop( xFact->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.frame.Desktop" ) ), UNO_QUERY ); if( xDesktop.is() ) xDesktop->addTerminateListener(This); } @@ -3805,7 +3812,7 @@ void SelectionManager::run( void* pThis ) if( (aNow.tv_sec - aLast.tv_sec) > 0 ) { ClearableMutexGuard aGuard(This->m_aMutex); - std::list< std::pair< SelectionAdaptor*, Reference< XInterface > > > aChangeList; + std::list< std::pair< SelectionAdaptor*, css::uno::Reference< XInterface > > > aChangeList; for( std::hash_map< Atom, Selection* >::iterator it = This->m_aSelections.begin(); it != This->m_aSelections.end(); ++it ) { @@ -3815,7 +3822,7 @@ void SelectionManager::run( void* pThis ) if( aOwner != it->second->m_aLastOwner ) { it->second->m_aLastOwner = aOwner; - std::pair< SelectionAdaptor*, Reference< XInterface > > + std::pair< SelectionAdaptor*, css::uno::Reference< XInterface > > aKeep( it->second->m_pAdaptor, it->second->m_pAdaptor->getReference() ); aChangeList.push_back( aKeep ); } @@ -3838,6 +3845,11 @@ void SelectionManager::run( void* pThis ) void SelectionManager::shutdown() throw() { ResettableMutexGuard aGuard(m_aMutex); + if( m_bShutDown ) + { + return; + } + m_bShutDown = true; // stop dispatching if( m_aThread ) { @@ -3927,7 +3939,7 @@ void SAL_CALL SelectionManager::queryTermination( const ::com::sun::star::lang:: void SAL_CALL SelectionManager::notifyTermination( const ::com::sun::star::lang::EventObject& rEvent ) throw( ::com::sun::star::uno::RuntimeException ) { - Reference< XDesktop > xDesktop( rEvent.Source, UNO_QUERY ); + css::uno::Reference< XDesktop > xDesktop( rEvent.Source, UNO_QUERY ); if( xDesktop.is() == sal_True ) xDesktop->removeTerminateListener( this ); #if OSL_DEBUG_LEVEL > 1 @@ -4060,7 +4072,7 @@ void SelectionManager::deregisterDropTarget( XLIB_Window aWindow ) dsde.DragSource = static_cast< XDragSource* >(this); dsde.DropAction = DNDConstants::ACTION_NONE; dsde.DropSuccess = sal_False; - Reference< XDragSourceListener > xListener( m_xDragSourceListener ); + css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener ); m_xDragSourceListener.clear(); aGuard.clear(); xListener->dragDropEnd( dsde ); @@ -4071,7 +4083,7 @@ void SelectionManager::deregisterDropTarget( XLIB_Window aWindow ) * SelectionAdaptor */ -Reference< XTransferable > SelectionManager::getTransferable() throw() +css::uno::Reference< XTransferable > SelectionManager::getTransferable() throw() { return m_xDragSourceTransferable; } @@ -4091,9 +4103,9 @@ void SelectionManager::fireContentsChanged() throw() // ------------------------------------------------------------------------ -Reference< XInterface > SelectionManager::getReference() throw() +css::uno::Reference< XInterface > SelectionManager::getReference() throw() { - return Reference< XInterface >( static_cast(this) ); + return css::uno::Reference< XInterface >( static_cast(this) ); } // ------------------------------------------------------------------------ @@ -4124,7 +4136,7 @@ void SelectionManagerHolder::initialize( const Sequence< Any >& arguments ) thro if( arguments.getLength() > 0 ) { - Reference< XDisplayConnection > xConn; + css::uno::Reference< XDisplayConnection > xConn; arguments.getConstArray()[0] >>= xConn; if( xConn.is() ) { @@ -4159,8 +4171,8 @@ sal_Int32 SelectionManagerHolder::getDefaultCursor( sal_Int8 dragAction ) throw( void SelectionManagerHolder::startDrag( const ::com::sun::star::datatransfer::dnd::DragGestureEvent& trigger, sal_Int8 sourceActions, sal_Int32 cursor, sal_Int32 image, - const Reference< ::com::sun::star::datatransfer::XTransferable >& transferable, - const Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >& listener + const css::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& transferable, + const css::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >& listener ) throw() { if( m_xRealDragSource.is() ) diff --git a/vcl/unx/source/dtrans/X11_selection.hxx b/vcl/unx/source/dtrans/X11_selection.hxx index 47baa1776d1a..34a50819bfed 100644 --- a/vcl/unx/source/dtrans/X11_selection.hxx +++ b/vcl/unx/source/dtrans/X11_selection.hxx @@ -66,10 +66,10 @@ namespace x11 { class SelectionAdaptor { public: - virtual Reference< ::com::sun::star::datatransfer::XTransferable > getTransferable() = 0; + virtual com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > getTransferable() = 0; virtual void clearTransferable() = 0; virtual void fireContentsChanged() = 0; - virtual Reference< XInterface > getReference() = 0; + virtual com::sun::star::uno::Reference< XInterface > getReference() = 0; // returns a reference that will keep the SelectionAdaptor alive until the // refernce is released }; @@ -87,9 +87,9 @@ namespace x11 { sal_Int8 m_nDefaultActions; XLIB_Window m_aTargetWindow; class SelectionManager* m_pSelectionManager; - Reference< ::com::sun::star::datatransfer::dnd::XDragSource > + com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource > m_xSelectionManager; - ::std::list< Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener > > + ::std::list< com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener > > m_aListeners; DropTarget(); @@ -105,8 +105,8 @@ namespace x11 { virtual void SAL_CALL initialize( const Sequence< Any >& args ) throw ( ::com::sun::star::uno::Exception ); // XDropTarget - virtual void SAL_CALL addDropTargetListener( const Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& ) throw(); - virtual void SAL_CALL removeDropTargetListener( const Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& ) throw(); + virtual void SAL_CALL addDropTargetListener( const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& ) throw(); + virtual void SAL_CALL removeDropTargetListener( const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& ) throw(); virtual sal_Bool SAL_CALL isActive() throw(); virtual void SAL_CALL setActive( sal_Bool active ) throw(); virtual sal_Int8 SAL_CALL getDefaultActions() throw(); @@ -127,7 +127,7 @@ namespace x11 { > { ::osl::Mutex m_aMutex; - Reference< ::com::sun::star::datatransfer::dnd::XDragSource > + com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource > m_xRealDragSource; public: SelectionManagerHolder(); @@ -148,8 +148,8 @@ namespace x11 { virtual void SAL_CALL startDrag( const ::com::sun::star::datatransfer::dnd::DragGestureEvent& trigger, sal_Int8 sourceActions, sal_Int32 cursor, sal_Int32 image, - const Reference< ::com::sun::star::datatransfer::XTransferable >& transferable, - const Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >& listener + const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& transferable, + const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >& listener ) throw(); }; @@ -260,9 +260,9 @@ namespace x11 { oslThread m_aDragExecuteThread; ::osl::Condition m_aDragRunning; XLIB_Window m_aWindow; - Reference< ::com::sun::star::awt::XDisplayConnection > + com::sun::star::uno::Reference< ::com::sun::star::awt::XDisplayConnection > m_xDisplayConnection; - Reference< com::sun::star::script::XInvocation > + com::sun::star::uno::Reference< com::sun::star::script::XInvocation > m_xBitmapConverter; sal_Int32 m_nSelectionTimeout; XLIB_Time m_nSelectionTimestamp; @@ -285,7 +285,7 @@ namespace x11 { XLIB_Time m_nDropTime; sal_Int8 m_nLastDropAction; // XTransferable for Xdnd with foreign drag source - Reference< ::com::sun::star::datatransfer::XTransferable > + com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > m_xDropTransferable; int m_nLastX, m_nLastY; XLIB_Time m_nDropTimestamp; @@ -303,9 +303,9 @@ namespace x11 { XLIB_Window m_aDropProxy; XLIB_Window m_aDragSourceWindow; // XTransferable for Xdnd when we are drag source - Reference< ::com::sun::star::datatransfer::XTransferable > + com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > m_xDragSourceTransferable; - Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener > + com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener > m_xDragSourceListener; // root coordinates int m_nLastDragX, m_nLastDragY; @@ -383,6 +383,7 @@ namespace x11 { // since this leads to deadlocks in different Xlib implentations // (XFree as well as Xsun) use an own mutex instead ::osl::Mutex m_aMutex; + bool m_bShutDown; SelectionManager(); ~SelectionManager(); @@ -409,7 +410,7 @@ namespace x11 { bool getPasteData( Atom selection, Atom type, Sequence< sal_Int8 >& rData ); // returns true if conversion was successful - bool convertData( const Reference< ::com::sun::star::datatransfer::XTransferable >& xTransferable, + bool convertData( const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& xTransferable, Atom nType, Atom nSelection, int & rFormat, @@ -494,15 +495,15 @@ namespace x11 { virtual void SAL_CALL startDrag( const ::com::sun::star::datatransfer::dnd::DragGestureEvent& trigger, sal_Int8 sourceActions, sal_Int32 cursor, sal_Int32 image, - const Reference< ::com::sun::star::datatransfer::XTransferable >& transferable, - const Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >& listener + const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& transferable, + const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >& listener ) throw(); // SelectionAdaptor for XdndSelection Drag (we are drag source) - virtual Reference< ::com::sun::star::datatransfer::XTransferable > getTransferable() throw(); + virtual com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > getTransferable() throw(); virtual void clearTransferable() throw(); virtual void fireContentsChanged() throw(); - virtual Reference< XInterface > getReference() throw(); + virtual com::sun::star::uno::Reference< XInterface > getReference() throw(); // XEventListener virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw( ::com::sun::star::uno::RuntimeException ); diff --git a/vcl/unx/source/dtrans/X11_service.cxx b/vcl/unx/source/dtrans/X11_service.cxx index e14d81643553..d15518c0b9ab 100644 --- a/vcl/unx/source/dtrans/X11_service.cxx +++ b/vcl/unx/source/dtrans/X11_service.cxx @@ -39,6 +39,12 @@ #include #include +namespace { + +namespace css = com::sun::star; + +} + using namespace rtl; using namespace cppu; using namespace com::sun::star::lang; @@ -69,9 +75,9 @@ Sequence< OUString > SAL_CALL x11::Xdnd_dropTarget_getSupportedServiceNames() // ------------------------------------------------------------------------ -Reference< XInterface > X11SalInstance::CreateClipboard( const Sequence< Any >& arguments ) +css::uno::Reference< XInterface > X11SalInstance::CreateClipboard( const Sequence< Any >& arguments ) { - static std::hash_map< OUString, ::std::hash_map< Atom, Reference< XClipboard > >, ::rtl::OUStringHash > m_aInstances; + static std::hash_map< OUString, ::std::hash_map< Atom, css::uno::Reference< XClipboard > >, ::rtl::OUStringHash > m_aInstances; OUString aDisplayName; Atom nSelection; @@ -80,7 +86,7 @@ Reference< XInterface > X11SalInstance::CreateClipboard( const Sequence< Any >& // by SelectionManager.initialize() if no display connection is given. if( arguments.getLength() > 0 ) { - Reference< XDisplayConnection > xConn; + css::uno::Reference< XDisplayConnection > xConn; arguments.getConstArray()[0] >>= xConn; if( xConn.is() ) @@ -107,8 +113,8 @@ Reference< XInterface > X11SalInstance::CreateClipboard( const Sequence< Any >& nSelection = rManager.getAtom( OUString::createFromAscii( "CLIPBOARD" ) ); } - ::std::hash_map< Atom, Reference< XClipboard > >& rMap( m_aInstances[ aDisplayName ] ); - ::std::hash_map< Atom, Reference< XClipboard > >::iterator it = rMap.find( nSelection ); + ::std::hash_map< Atom, css::uno::Reference< XClipboard > >& rMap( m_aInstances[ aDisplayName ] ); + ::std::hash_map< Atom, css::uno::Reference< XClipboard > >::iterator it = rMap.find( nSelection ); if( it != rMap.end() ) return it->second; @@ -120,16 +126,16 @@ Reference< XInterface > X11SalInstance::CreateClipboard( const Sequence< Any >& // ------------------------------------------------------------------------ -Reference< XInterface > X11SalInstance::CreateDragSource() +css::uno::Reference< XInterface > X11SalInstance::CreateDragSource() { - return Reference < XInterface >( ( OWeakObject * ) new SelectionManagerHolder() ); + return css::uno::Reference < XInterface >( ( OWeakObject * ) new SelectionManagerHolder() ); } // ------------------------------------------------------------------------ -Reference< XInterface > X11SalInstance::CreateDropTarget() +css::uno::Reference< XInterface > X11SalInstance::CreateDropTarget() { - return Reference < XInterface >( ( OWeakObject * ) new DropTarget() ); + return css::uno::Reference < XInterface >( ( OWeakObject * ) new DropTarget() ); } diff --git a/vcl/unx/source/dtrans/X11_transferable.hxx b/vcl/unx/source/dtrans/X11_transferable.hxx index 57f0d6682cab..65f7d1fdc475 100644 --- a/vcl/unx/source/dtrans/X11_transferable.hxx +++ b/vcl/unx/source/dtrans/X11_transferable.hxx @@ -44,10 +44,10 @@ namespace x11 { ::osl::Mutex m_aMutex; SelectionManager& m_rManager; - Reference< XInterface > m_xCreator; + com::sun::star::uno::Reference< XInterface > m_xCreator; Atom m_aSelection; public: - X11Transferable( SelectionManager& rManager, const Reference< XInterface >& xCreator, Atom selection = None ); + X11Transferable( SelectionManager& rManager, const com::sun::star::uno::Reference< XInterface >& xCreator, Atom selection = None ); virtual ~X11Transferable(); /* diff --git a/vcl/unx/source/fontmanager/fontmanager.cxx b/vcl/unx/source/fontmanager/fontmanager.cxx index 21183dc567ec..d72692b86a65 100644 --- a/vcl/unx/source/fontmanager/fontmanager.cxx +++ b/vcl/unx/source/fontmanager/fontmanager.cxx @@ -87,6 +87,12 @@ #define PRINTER_METRICDIR "fontmetric" +namespace { + +namespace css = com::sun::star; + +} + using namespace vcl; using namespace utl; using namespace psp; @@ -3942,10 +3948,10 @@ bool PrintFontManager::readOverrideMetrics() if( ! m_aOverrideFonts.empty() ) return false; - Reference< XMultiServiceFactory > xFact( comphelper::getProcessServiceFactory() ); + css::uno::Reference< XMultiServiceFactory > xFact( comphelper::getProcessServiceFactory() ); if( !xFact.is() ) return false; - Reference< XMaterialHolder > xMat( + css::uno::Reference< XMaterialHolder > xMat( xFact->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.psprint.CompatMetricOverride" ) ) ), UNO_QUERY ); if( !xMat.is() ) -- cgit From 68f2d13c9f1698eb45c4a1b341d1cac7c7526929 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Fri, 7 Jan 2011 18:24:18 +0100 Subject: removetooltypes: #i112600# Adapt Unix part for removed tool types --- vcl/unx/gtk/a11y/atkutil.cxx | 2 +- vcl/unx/gtk/a11y/atkwindow.cxx | 2 +- vcl/unx/gtk/app/gtkdata.cxx | 4 +- vcl/unx/gtk/app/gtkinst.cxx | 4 +- vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 212 +++++++++++++++---------------- vcl/unx/gtk/window/gtkframe.cxx | 194 ++++++++++++++-------------- vcl/unx/gtk/window/gtkobject.cxx | 10 +- vcl/unx/headless/svpbmp.cxx | 14 +- vcl/unx/headless/svpbmp.hxx | 6 +- vcl/unx/headless/svpdummies.cxx | 8 +- vcl/unx/headless/svpdummies.hxx | 8 +- vcl/unx/headless/svpframe.cxx | 40 +++--- vcl/unx/headless/svpframe.hxx | 36 +++--- vcl/unx/headless/svpgdi.cxx | 38 +++--- vcl/unx/headless/svpgdi.hxx | 38 +++--- vcl/unx/headless/svpinst.cxx | 30 ++--- vcl/unx/headless/svpinst.hxx | 32 ++--- vcl/unx/headless/svpprn.cxx | 48 +++---- vcl/unx/headless/svpprn.hxx | 28 ++-- vcl/unx/headless/svppspgraphics.cxx | 58 ++++----- vcl/unx/headless/svppspgraphics.hxx | 36 +++--- vcl/unx/headless/svptext.cxx | 30 ++--- vcl/unx/headless/svpvd.cxx | 2 +- vcl/unx/headless/svpvd.hxx | 6 +- vcl/unx/inc/i18n_cb.hxx | 2 +- vcl/unx/inc/i18n_ic.hxx | 2 +- vcl/unx/inc/plugins/gtk/gtkframe.hxx | 48 +++---- vcl/unx/inc/plugins/gtk/gtkgdi.hxx | 60 ++++----- vcl/unx/inc/plugins/gtk/gtkinst.hxx | 8 +- vcl/unx/inc/plugins/gtk/gtkobject.hxx | 10 +- vcl/unx/inc/plugins/kde/kdedata.hxx | 6 +- vcl/unx/inc/pspgraphics.h | 36 +++--- vcl/unx/inc/salbmp.h | 16 +-- vcl/unx/inc/saldata.hxx | 6 +- vcl/unx/inc/saldisp.hxx | 60 ++++----- vcl/unx/inc/salframe.h | 58 ++++----- vcl/unx/inc/salgdi.h | 72 +++++------ vcl/unx/inc/salinst.h | 18 +-- vcl/unx/inc/salobj.h | 20 +-- vcl/unx/inc/salprn.h | 30 ++--- vcl/unx/inc/saltimer.h | 2 +- vcl/unx/inc/salunx.h | 6 +- vcl/unx/inc/salvd.h | 18 +-- vcl/unx/inc/soicon.hxx | 4 +- vcl/unx/inc/xfont.hxx | 6 +- vcl/unx/kde/kdedata.cxx | 2 +- vcl/unx/kde/salnativewidgets-kde.cxx | 128 +++++++++---------- vcl/unx/source/app/i18n_cb.cxx | 12 +- vcl/unx/source/app/i18n_ic.cxx | 4 +- vcl/unx/source/app/i18n_status.cxx | 10 +- vcl/unx/source/app/keysymnames.cxx | 2 +- vcl/unx/source/app/saldata.cxx | 2 +- vcl/unx/source/app/saldisp.cxx | 136 ++++++++++---------- vcl/unx/source/app/salinst.cxx | 28 ++-- vcl/unx/source/app/salsys.cxx | 6 +- vcl/unx/source/app/saltimer.cxx | 4 +- vcl/unx/source/app/sm.cxx | 8 +- vcl/unx/source/app/soicon.cxx | 14 +- vcl/unx/source/gdi/gcach_xpeer.cxx | 6 +- vcl/unx/source/gdi/pspgraphics.cxx | 58 ++++----- vcl/unx/source/gdi/salbmp.cxx | 54 ++++---- vcl/unx/source/gdi/salgdi.cxx | 180 +++++++++++++------------- vcl/unx/source/gdi/salgdi2.cxx | 28 ++-- vcl/unx/source/gdi/salgdi3.cxx | 36 +++--- vcl/unx/source/gdi/salprnpsp.cxx | 68 +++++----- vcl/unx/source/gdi/salvd.cxx | 30 ++--- vcl/unx/source/gdi/xfont.cxx | 6 +- vcl/unx/source/window/salframe.cxx | 146 ++++++++++----------- vcl/unx/source/window/salobj.cxx | 28 ++-- 69 files changed, 1185 insertions(+), 1185 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/gtk/a11y/atkutil.cxx b/vcl/unx/gtk/a11y/atkutil.cxx index 076e36291ae6..d3c1afdd2efe 100644 --- a/vcl/unx/gtk/a11y/atkutil.cxx +++ b/vcl/unx/gtk/a11y/atkutil.cxx @@ -598,7 +598,7 @@ static void handle_menu_highlighted(::VclMenuEvent const * pEvent) try { Menu* pMenu = pEvent->GetMenu(); - USHORT nPos = pEvent->GetItemPos(); + sal_uInt16 nPos = pEvent->GetItemPos(); if( pMenu && nPos != 0xFFFF) { diff --git a/vcl/unx/gtk/a11y/atkwindow.cxx b/vcl/unx/gtk/a11y/atkwindow.cxx index 5448235998e8..c4fdc54e9064 100644 --- a/vcl/unx/gtk/a11y/atkwindow.cxx +++ b/vcl/unx/gtk/a11y/atkwindow.cxx @@ -78,7 +78,7 @@ init_from_window( AtkObject *accessible, Window *pWindow ) */ case AccessibleRole::WINDOW: { - USHORT type = WINDOW_WINDOW; + sal_uInt16 type = WINDOW_WINDOW; bool parentIsMenuFloatingWindow = false; Window *pParent = pWindow->GetParent(); diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx index f308822df147..de3d46733bfd 100644 --- a/vcl/unx/gtk/app/gtkdata.cxx +++ b/vcl/unx/gtk/app/gtkdata.cxx @@ -527,7 +527,7 @@ public: YieldFunc handle ); virtual void Remove( int fd ); - virtual void StartTimer( ULONG nMS ); + virtual void StartTimer( sal_uInt32 nMS ); virtual void StopTimer(); virtual void Wakeup(); virtual void PostUserEvent(); @@ -727,7 +727,7 @@ gboolean GtkXLib::timeoutFn(gpointer data) return FALSE; } -void GtkXLib::StartTimer( ULONG nMS ) +void GtkXLib::StartTimer( sal_uInt32 nMS ) { m_nTimeoutMS = nMS; // for restarting diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx index 2cb92ecd8292..4f9a739ea85a 100644 --- a/vcl/unx/gtk/app/gtkinst.cxx +++ b/vcl/unx/gtk/app/gtkinst.cxx @@ -65,7 +65,7 @@ void GtkHookedYieldMutex::ThreadsEnter() acquire(); if( !aYieldStack.empty() ) { /* Previously called ThreadsLeave() */ - ULONG nCount = aYieldStack.front(); + sal_uInt32 nCount = aYieldStack.front(); aYieldStack.pop_front(); while( nCount-- > 1 ) acquire(); @@ -188,7 +188,7 @@ GtkInstance::~GtkInstance() DeInitAtkBridge(); } -SalFrame* GtkInstance::CreateFrame( SalFrame* pParent, ULONG nStyle ) +SalFrame* GtkInstance::CreateFrame( SalFrame* pParent, sal_uInt32 nStyle ) { return new GtkSalFrame( pParent, nStyle ); } diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 318f593ac6a3..f3026be3dbb1 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -48,11 +48,11 @@ typedef struct _cairo_font_options cairo_font_options_t; // initialize statics -BOOL GtkSalGraphics::bThemeChanged = TRUE; -BOOL GtkSalGraphics::bNeedPixmapPaint = FALSE; -BOOL GtkSalGraphics::bGlobalNeedPixmapPaint = FALSE; -BOOL GtkSalGraphics::bToolbarGripWorkaround = FALSE; -BOOL GtkSalGraphics::bNeedButtonStyleAsEditBackgroundWorkaround = FALSE; +sal_Bool GtkSalGraphics::bThemeChanged = sal_True; +sal_Bool GtkSalGraphics::bNeedPixmapPaint = sal_False; +sal_Bool GtkSalGraphics::bGlobalNeedPixmapPaint = sal_False; +sal_Bool GtkSalGraphics::bToolbarGripWorkaround = sal_False; +sal_Bool GtkSalGraphics::bNeedButtonStyleAsEditBackgroundWorkaround = sal_False; GtkSalGraphics::~GtkSalGraphics() { @@ -269,7 +269,7 @@ public: { delete [] pData; m_idx = 0; m_size = n; pData = new NWPixmapCacheData[m_size]; } int GetSize() { return m_size; } - BOOL Find( ControlType aType, ControlState aState, const Rectangle& r_pixmapRect, GdkPixmap** pPixmap ); + sal_Bool Find( ControlType aType, ControlState aState, const Rectangle& r_pixmapRect, GdkPixmap** pPixmap ); void Fill( ControlType aType, ControlState aState, const Rectangle& r_pixmapRect, GdkPixmap* pPixmap ); void ThemeChanged(); @@ -322,7 +322,7 @@ void NWPixmapCache::ThemeChanged() pData[i].SetPixmap( NULL ); } -BOOL NWPixmapCache::Find( ControlType aType, ControlState aState, const Rectangle& r_pixmapRect, GdkPixmap** pPixmap ) +sal_Bool NWPixmapCache::Find( ControlType aType, ControlState aState, const Rectangle& r_pixmapRect, GdkPixmap** pPixmap ) { aState &= ~CTRL_CACHING_ALLOWED; // mask clipping flag int i; @@ -335,10 +335,10 @@ BOOL NWPixmapCache::Find( ControlType aType, ControlState aState, const Rectang pData[i].m_pixmap != NULL ) { *pPixmap = pData[i].m_pixmap; - return TRUE; + return sal_True; } } - return FALSE; + return sal_False; } void NWPixmapCache::Fill( ControlType aType, ControlState aState, const Rectangle& r_pixmapRect, GdkPixmap* pPixmap ) @@ -479,13 +479,13 @@ void GtkSalGraphics::ResetClipRegion() X11SalGraphics::ResetClipRegion(); } -void GtkSalGraphics::BeginSetClipRegion( ULONG nCount ) +void GtkSalGraphics::BeginSetClipRegion( sal_uInt32 nCount ) { m_aClipRegion.SetNull(); X11SalGraphics::BeginSetClipRegion( nCount ); } -BOOL GtkSalGraphics::unionClipRegion( long nX, long nY, long nWidth, long nHeight ) +sal_Bool GtkSalGraphics::unionClipRegion( long nX, long nY, long nWidth, long nHeight ) { Rectangle aRect( Point( nX, nY ), Size( nWidth, nHeight ) ); m_aClipRegion.Union( aRect ); @@ -533,10 +533,10 @@ void GtkSalGraphics::copyBits( const SalTwoRect* pPosAry, /* * IsNativeControlSupported() * - * Returns TRUE if the platform supports native + * Returns sal_True if the platform supports native * drawing of the control defined by nPart */ -BOOL GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart ) +sal_Bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart ) { if ( ((nType==CTRL_PUSHBUTTON) && (nPart==PART_ENTIRE_CONTROL)) || @@ -603,26 +603,26 @@ BOOL GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP ) ) ) - return( TRUE ); + return( sal_True ); - return( FALSE ); + return( sal_False ); } /* * HitTestNativeControl() * - * bIsInside is set to TRUE if aPos is contained within the + * bIsInside is set to sal_True if aPos is contained within the * given part of the control, whose bounding region is * given by rControlRegion (in VCL frame coordinates). * * returns whether bIsInside was really set. */ -BOOL GtkSalGraphics::hitTestNativeControl( ControlType nType, +sal_Bool GtkSalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, const Point& aPos, - BOOL& rIsInside ) + sal_Bool& rIsInside ) { if ( ( nType == CTRL_SCROLLBAR ) && ( ( nPart == PART_BUTTON_UP ) || @@ -645,7 +645,7 @@ BOOL GtkSalGraphics::hitTestNativeControl( ControlType nType, Rectangle aForward; Rectangle aBackward; - rIsInside = FALSE; + rIsInside = sal_False; ControlPart nCounterPart = 0; if ( nPart == PART_BUTTON_UP ) @@ -704,17 +704,17 @@ BOOL GtkSalGraphics::hitTestNativeControl( ControlType nType, if ( has_forward2 ) rIsInside |= aForward.IsInside( aPos ); } - return ( TRUE ); + return ( sal_True ); } if( IsNativeControlSupported(nType, nPart) ) { rIsInside = rControlRegion.IsInside( aPos ); - return( TRUE ); + return( sal_True ); } else { - return( FALSE ); + return( sal_False ); } } @@ -728,14 +728,14 @@ BOOL GtkSalGraphics::hitTestNativeControl( ControlType nType, * aValue: An optional value (tristate/numerical/string) * rCaption: A caption or title string (like button text etc) */ -BOOL GtkSalGraphics::drawNativeControl( ControlType nType, +sal_Bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState, const ImplControlValue& aValue, const OUString& rCaption ) { - BOOL returnVal = FALSE; + sal_Bool returnVal = sal_False; // get a GC with current clipping region set SelectFont(); @@ -747,7 +747,7 @@ BOOL GtkSalGraphics::drawNativeControl( ControlType nType, for( unsigned int i = 0; i < gWidgetData.size(); i++ ) if( gWidgetData[i].gNWPixmapCacheList ) gWidgetData[i].gNWPixmapCacheList->ThemeChanged(); - GtkSalGraphics::bThemeChanged = FALSE; + GtkSalGraphics::bThemeChanged = sal_False; } Rectangle aCtrlRect( rControlRegion ); @@ -774,7 +774,7 @@ BOOL GtkSalGraphics::drawNativeControl( ControlType nType, Size( aCtrlRect.GetWidth()+2, aCtrlRect.GetHeight()+2) ); pixmap = NWGetPixmapFromScreen( aPixmapRect ); if( ! pixmap ) - return FALSE; + return sal_False; gdkDrawable = GDK_DRAWABLE( pixmap ); aCtrlRect = Rectangle( Point(1,1), aCtrlRect.GetSize() ); aClip.push_back( aCtrlRect ); @@ -835,7 +835,7 @@ BOOL GtkSalGraphics::drawNativeControl( ControlType nType, else if ( (nType==CTRL_TAB_ITEM) || (nType==CTRL_TAB_PANE) || (nType==CTRL_TAB_BODY) || (nType==CTRL_FIXEDBORDER) ) { if ( nType == CTRL_TAB_BODY ) - returnVal = TRUE; + returnVal = sal_True; else returnVal = NWPaintGTKTabItem( nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption); } @@ -902,22 +902,22 @@ BOOL GtkSalGraphics::drawNativeControl( ControlType nType, * aValue: An optional value (tristate/numerical/string) * rCaption: A caption or title string (like button text etc) */ -BOOL GtkSalGraphics::drawNativeControlText( ControlType, +sal_Bool GtkSalGraphics::drawNativeControlText( ControlType, ControlPart, const Rectangle&, ControlState, const ImplControlValue&, const OUString& ) { - return( FALSE ); + return( sal_False ); } /* * GetNativeControlRegion() * - * If the return value is TRUE, rNativeBoundingRegion - * contains the TRUE bounding region covered by the control + * If the return value is sal_True, rNativeBoundingRegion + * contains the true bounding region covered by the control * including any adornment, while rNativeContentRegion contains the area * within the control that can be safely drawn into without drawing over * the borders of the control. @@ -926,7 +926,7 @@ BOOL GtkSalGraphics::drawNativeControlText( ControlType, * aValue: An optional value (tristate/numerical/string) * rCaption: A caption or title string (like button text etc) */ -BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType, +sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState, @@ -935,7 +935,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType, Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion ) { - BOOL returnVal = FALSE; + sal_Bool returnVal = sal_False; if ( (nType==CTRL_PUSHBUTTON) && (nPart==PART_ENTIRE_CONTROL) && (rControlRegion.GetWidth() > 16) @@ -945,7 +945,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType, nState, aValue, rCaption ); rNativeContentRegion = rControlRegion; - returnVal = TRUE; + returnVal = sal_True; } if ( (nType==CTRL_COMBOBOX) && ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) ) { @@ -953,7 +953,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType, aValue, rCaption ); rNativeContentRegion = rNativeBoundingRegion; - returnVal = TRUE; + returnVal = sal_True; } if ( (nType==CTRL_SPINBOX) && ((nPart==PART_BUTTON_UP) || (nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) ) { @@ -962,7 +962,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType, aValue, rCaption ); rNativeContentRegion = rNativeBoundingRegion; - returnVal = TRUE; + returnVal = sal_True; } if ( (nType==CTRL_LISTBOX) && ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) ) { @@ -970,7 +970,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType, aValue, rCaption ); rNativeContentRegion = rNativeBoundingRegion; - returnVal = TRUE; + returnVal = sal_True; } if ( (nType==CTRL_TOOLBAR) && ((nPart==PART_DRAW_BACKGROUND_HORZ) || @@ -982,7 +982,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType, { rNativeBoundingRegion = NWGetToolbarRect( m_nScreen, nType, nPart, rControlRegion, nState, aValue, rCaption ); rNativeContentRegion = rNativeBoundingRegion; - returnVal = TRUE; + returnVal = sal_True; } if ( (nType==CTRL_SCROLLBAR) && ((nPart==PART_BUTTON_LEFT) || (nPart==PART_BUTTON_RIGHT) || (nPart==PART_BUTTON_UP) || (nPart==PART_BUTTON_DOWN) ) ) @@ -990,7 +990,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType, rNativeBoundingRegion = NWGetScrollButtonRect( m_nScreen, nPart, rControlRegion ); rNativeContentRegion = rNativeBoundingRegion; - returnVal = TRUE; + returnVal = sal_True; } if( (nType == CTRL_MENUBAR) && (nPart == PART_ENTIRE_CONTROL) ) { @@ -1002,7 +1002,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType, Size( aMenuBarRect.GetWidth(), aReq.height+1 ) ); rNativeBoundingRegion = aMenuBarRect; rNativeContentRegion = rNativeBoundingRegion; - returnVal = TRUE; + returnVal = sal_True; } if( (nType == CTRL_MENU_POPUP) ) { @@ -1022,7 +1022,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType, (rControlRegion.GetHeight()-indicator_size)/2), Size( indicator_size, indicator_size ) ); rNativeContentRegion = aIndicatorRect; - returnVal = TRUE; + returnVal = sal_True; } } if( (nType == CTRL_RADIOBUTTON || nType == CTRL_CHECKBOX) ) @@ -1041,7 +1041,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType, (rControlRegion.GetHeight()-indicator_size)/2), Size( indicator_size, indicator_size ) ); rNativeContentRegion = aIndicatorRect; - returnVal = TRUE; + returnVal = sal_True; } if( (nType == CTRL_EDITBOX || nType == CTRL_SPINBOX) && nPart == PART_ENTIRE_CONTROL ) { @@ -1055,7 +1055,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType, Size( aEditRect.GetWidth(), nHeight ) ); rNativeBoundingRegion = aEditRect; rNativeContentRegion = rNativeBoundingRegion; - returnVal = TRUE; + returnVal = sal_True; } if( (nType == CTRL_SLIDER) && (nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT) ) { @@ -1079,7 +1079,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType, aRect.Right() = aRect.Left() + slider_width - 1; } rNativeBoundingRegion = rNativeContentRegion = aRect; - returnVal = TRUE; + returnVal = sal_True; } return( returnVal ); @@ -1089,7 +1089,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType, /************************************************************************ * Individual control drawing functions ************************************************************************/ -BOOL GtkSalGraphics::NWPaintGTKButton( +sal_Bool GtkSalGraphics::NWPaintGTKButton( GdkDrawable* gdkDrawable, ControlType, ControlPart, const Rectangle& rControlRectangle, @@ -1102,7 +1102,7 @@ BOOL GtkSalGraphics::NWPaintGTKButton( gboolean interiorFocus; gint focusWidth; gint focusPad; - BOOL bDrawFocus = TRUE; + sal_Bool bDrawFocus = sal_True; gint x, y, w, h; GtkBorder aDefBorder; GtkBorder* pBorder; @@ -1133,7 +1133,7 @@ BOOL GtkSalGraphics::NWPaintGTKButton( // If the button is too small, don't ever draw focus or grab more space if ( (w < 16) || (h < 16) ) - bDrawFocus = FALSE; + bDrawFocus = sal_False; NWSetWidgetState( gWidgetData[m_nScreen].gBtnWidget, nState, stateType ); @@ -1203,7 +1203,7 @@ BOOL GtkSalGraphics::NWPaintGTKButton( } #endif - return( TRUE ); + return( sal_True ); } static Rectangle NWGetButtonArea( int nScreen, @@ -1215,7 +1215,7 @@ static Rectangle NWGetButtonArea( int nScreen, gint focusPad; GtkBorder aDefBorder; GtkBorder * pBorder; - BOOL bDrawFocus = TRUE; + sal_Bool bDrawFocus = sal_True; Rectangle aRect; gint x, y, w, h; @@ -1242,7 +1242,7 @@ static Rectangle NWGetButtonArea( int nScreen, // If the button is too small, don't ever draw focus or grab more space if ( (w < 16) || (h < 16) ) - bDrawFocus = FALSE; + bDrawFocus = sal_False; if ( (nState & CTRL_STATE_DEFAULT) && bDrawFocus ) { @@ -1259,7 +1259,7 @@ static Rectangle NWGetButtonArea( int nScreen, //------------------------------------- -BOOL GtkSalGraphics::NWPaintGTKRadio( GdkDrawable* gdkDrawable, +sal_Bool GtkSalGraphics::NWPaintGTKRadio( GdkDrawable* gdkDrawable, ControlType, ControlPart, const Rectangle& rControlRectangle, const clipList& rClipList, @@ -1269,7 +1269,7 @@ BOOL GtkSalGraphics::NWPaintGTKRadio( GdkDrawable* gdkDrawable, { GtkStateType stateType; GtkShadowType shadowType; - BOOL isChecked = (aValue.getTristateVal()==BUTTONVALUE_ON); + sal_Bool isChecked = (aValue.getTristateVal()==BUTTONVALUE_ON); gint x, y; GdkRectangle clipRect; @@ -1297,7 +1297,7 @@ BOOL GtkSalGraphics::NWPaintGTKRadio( GdkDrawable* gdkDrawable, // intermediate states between active/inactive. Let's hope that // GtkToggleButtone stays binary compatible. if (!isChecked) - GTK_TOGGLE_BUTTON(gWidgetData[m_nScreen].gRadioWidgetSibling)->active = TRUE; + GTK_TOGGLE_BUTTON(gWidgetData[m_nScreen].gRadioWidgetSibling)->active = sal_True; GTK_TOGGLE_BUTTON(gWidgetData[m_nScreen].gRadioWidget)->active = isChecked; for( clipList::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it ) @@ -1312,12 +1312,12 @@ BOOL GtkSalGraphics::NWPaintGTKRadio( GdkDrawable* gdkDrawable, x, y, indicator_size, indicator_size ); } - return( TRUE ); + return( sal_True ); } //------------------------------------- -BOOL GtkSalGraphics::NWPaintGTKCheck( GdkDrawable* gdkDrawable, +sal_Bool GtkSalGraphics::NWPaintGTKCheck( GdkDrawable* gdkDrawable, ControlType, ControlPart, const Rectangle& rControlRectangle, const clipList& rClipList, @@ -1359,7 +1359,7 @@ BOOL GtkSalGraphics::NWPaintGTKCheck( GdkDrawable* gdkDrawable, x, y, indicator_size, indicator_size ); } - return( TRUE ); + return( sal_True ); } //------------------------------------- @@ -1375,7 +1375,7 @@ static void NWCalcArrowRect( const Rectangle& rButton, Rectangle& rArrow ) ) ); } -BOOL GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart, +sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList&, ControlState nState, @@ -1430,7 +1430,7 @@ BOOL GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart, scrollbarRect = pixmapRect; if ( (scrollbarRect.GetWidth() <= 1) || (scrollbarRect.GetHeight() <= 1) ) - return( TRUE ); + return( sal_True ); // Grab some button style attributes gtk_widget_style_get( gWidgetData[m_nScreen].gScrollHorizWidget, @@ -1556,7 +1556,7 @@ BOOL GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart, thumbRect.Move( (scrollbarRect.GetWidth() - slider_width) / 2, 0 ); } - BOOL has_slider = ( thumbRect.GetWidth() > 0 && thumbRect.GetHeight() > 0 ); + sal_Bool has_slider = ( thumbRect.GetWidth() > 0 && thumbRect.GetHeight() > 0 ); scrollbarValues = gtk_range_get_adjustment( GTK_RANGE(scrollbarWidget) ); if ( scrollbarValues == NULL ) @@ -1581,7 +1581,7 @@ BOOL GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart, // painting them directly to the window flickers pixmap = NWGetPixmapFromScreen( pixmapRect ); if( ! pixmap ) - return FALSE; + return sal_False; x = y = 0; w = pixmapRect.GetWidth(); @@ -1635,7 +1635,7 @@ BOOL GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart, // ----------------- ARROW 1 NWCalcArrowRect( button11BoundRect, arrowRect ); gtk_paint_arrow( style, gdkDrawable, stateType, shadowType, - gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button1Type, TRUE, + gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button1Type, sal_True, x+hShim+arrowRect.Left(), y+vShim+arrowRect.Top(), arrowRect.GetWidth(), arrowRect.GetHeight() ); } @@ -1650,7 +1650,7 @@ BOOL GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart, // ----------------- ARROW 1 NWCalcArrowRect( button12BoundRect, arrowRect ); gtk_paint_arrow( style, gdkDrawable, stateType, shadowType, - gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button2Type, TRUE, + gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button2Type, sal_True, x+hShim+arrowRect.Left(), y+vShim+arrowRect.Top(), arrowRect.GetWidth(), arrowRect.GetHeight() ); } @@ -1666,7 +1666,7 @@ BOOL GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart, // ----------------- ARROW 2 NWCalcArrowRect( button21BoundRect, arrowRect ); gtk_paint_arrow( style, gdkDrawable, stateType, shadowType, - gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button1Type, TRUE, + gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button1Type, sal_True, x+hShim+arrowRect.Left(), y+vShim+arrowRect.Top(), arrowRect.GetWidth(), arrowRect.GetHeight() ); } @@ -1681,7 +1681,7 @@ BOOL GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart, // ----------------- ARROW 2 NWCalcArrowRect( button22BoundRect, arrowRect ); gtk_paint_arrow( style, gdkDrawable, stateType, shadowType, - gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button2Type, TRUE, + gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button2Type, sal_True, x+hShim+arrowRect.Left(), y+vShim+arrowRect.Top(), arrowRect.GetWidth(), arrowRect.GetHeight() ); } @@ -1689,11 +1689,11 @@ BOOL GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart, if( !NWRenderPixmapToScreen(pixmap, pixmapRect) ) { g_object_unref( pixmap ); - return( FALSE ); + return( sal_False ); } g_object_unref( pixmap ); - return( TRUE ); + return( sal_True ); } //--- @@ -1781,7 +1781,7 @@ static Rectangle NWGetScrollButtonRect( int nScreen, ControlPart nPart, Rectangl //------------------------------------- -BOOL GtkSalGraphics::NWPaintGTKEditBox( GdkDrawable* gdkDrawable, +sal_Bool GtkSalGraphics::NWPaintGTKEditBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, @@ -1806,7 +1806,7 @@ BOOL GtkSalGraphics::NWPaintGTKEditBox( GdkDrawable* gdkDrawable, NWPaintOneEditBox( m_nScreen, gdkDrawable, &clipRect, nType, nPart, pixmapRect, nState, aValue, rCaption ); } - return( TRUE ); + return( sal_True ); } @@ -1919,7 +1919,7 @@ static void NWPaintOneEditBox( int nScreen, //------------------------------------- -BOOL GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart, +sal_Bool GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList&, ControlState nState, @@ -1970,7 +1970,7 @@ BOOL GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart, pixmap = NWGetPixmapFromScreen( pixmapRect ); if ( !pixmap ) - return( FALSE ); + return( sal_False ); upBtnRect = NWGetSpinButtonRect( m_nScreen, nType, upBtnPart, pixmapRect, upBtnState, aValue, rCaption ); downBtnRect = NWGetSpinButtonRect( m_nScreen, nType, downBtnPart, pixmapRect, downBtnState, aValue, rCaption ); @@ -2006,11 +2006,11 @@ BOOL GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart, if( !NWRenderPixmapToScreen(pixmap, pixmapRect) ) { g_object_unref( pixmap ); - return( FALSE ); + return( sal_False ); } g_object_unref( pixmap ); - return( TRUE ); + return( sal_True ); } //--- @@ -2093,7 +2093,7 @@ static void NWPaintOneSpinButton( int nScreen, arrowRect.setY( buttonRect.Top() + (buttonRect.GetHeight() - arrowRect.GetHeight()) / 2 - 1); gtk_paint_arrow( gWidgetData[nScreen].gSpinButtonWidget->style, pixmap, stateType, GTK_SHADOW_OUT, NULL, gWidgetData[nScreen].gSpinButtonWidget, - "spinbutton", (nPart == PART_BUTTON_UP) ? GTK_ARROW_UP : GTK_ARROW_DOWN, TRUE, + "spinbutton", (nPart == PART_BUTTON_UP) ? GTK_ARROW_UP : GTK_ARROW_DOWN, sal_True, (arrowRect.Left() - aAreaRect.Left()), (arrowRect.Top() - aAreaRect.Top()), arrowRect.GetWidth(), arrowRect.GetHeight() ); } @@ -2101,7 +2101,7 @@ static void NWPaintOneSpinButton( int nScreen, //------------------------------------- -BOOL GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable, +sal_Bool GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, @@ -2169,12 +2169,12 @@ BOOL GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable, buttonRect.GetWidth(), buttonRect.GetHeight() ); gtk_paint_arrow( gWidgetData[m_nScreen].gArrowWidget->style, gdkDrawable, stateType, shadowType, - &clipRect, gWidgetData[m_nScreen].gArrowWidget, "arrow", GTK_ARROW_DOWN, TRUE, + &clipRect, gWidgetData[m_nScreen].gArrowWidget, "arrow", GTK_ARROW_DOWN, sal_True, x+(arrowRect.Left() - pixmapRect.Left()), y+(arrowRect.Top() - pixmapRect.Top()), arrowRect.GetWidth(), arrowRect.GetHeight() ); } - return( TRUE ); + return( sal_True ); } //---- @@ -2234,7 +2234,7 @@ static Rectangle NWGetComboBoxButtonRect( int nScreen, -BOOL GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, +sal_Bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, const Rectangle& rControlRectangle, const clipList&, ControlState nState, @@ -2368,14 +2368,14 @@ BOOL GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, else aCachePage.Fill( nType, nState, pixmapRect, pixmap ); - BOOL bSuccess = NWRenderPixmapToScreen(pixmap, pixmapRect); + sal_Bool bSuccess = NWRenderPixmapToScreen(pixmap, pixmapRect); g_object_unref( pixmap ); return bSuccess; } //------------------------------------- -BOOL GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable, +sal_Bool GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, @@ -2466,10 +2466,10 @@ BOOL GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable, } } - return( TRUE ); + return( sal_True ); } -BOOL GtkSalGraphics::NWPaintGTKToolbar( +sal_Bool GtkSalGraphics::NWPaintGTKToolbar( GdkDrawable* gdkDrawable, ControlType, ControlPart nPart, const Rectangle& rControlRectangle, @@ -2615,12 +2615,12 @@ BOOL GtkSalGraphics::NWPaintGTKToolbar( } } - return( TRUE ); + return( sal_True ); } //---- -BOOL GtkSalGraphics::NWPaintGTKMenubar( +sal_Bool GtkSalGraphics::NWPaintGTKMenubar( GdkDrawable* gdkDrawable, ControlType, ControlPart nPart, const Rectangle& rControlRectangle, @@ -2702,10 +2702,10 @@ BOOL GtkSalGraphics::NWPaintGTKMenubar( } } - return( TRUE ); + return( sal_True ); } -BOOL GtkSalGraphics::NWPaintGTKPopupMenu( +sal_Bool GtkSalGraphics::NWPaintGTKPopupMenu( GdkDrawable* gdkDrawable, ControlType, ControlPart nPart, const Rectangle& rControlRectangle, @@ -2716,7 +2716,7 @@ BOOL GtkSalGraphics::NWPaintGTKPopupMenu( // #i50745# gtk does not draw disabled menu entries (and crux theme // even crashes), draw them using vcl functionality. if( nPart == PART_MENU_ITEM && ! (nState & CTRL_STATE_ENABLED) ) - return FALSE; + return sal_False; GtkStateType stateType; GtkShadowType shadowType; @@ -2832,10 +2832,10 @@ BOOL GtkSalGraphics::NWPaintGTKPopupMenu( } } - return( TRUE ); + return( sal_True ); } -BOOL GtkSalGraphics::NWPaintGTKTooltip( +sal_Bool GtkSalGraphics::NWPaintGTKTooltip( GdkDrawable* gdkDrawable, ControlType, ControlPart, const Rectangle& rControlRectangle, @@ -2870,10 +2870,10 @@ BOOL GtkSalGraphics::NWPaintGTKTooltip( x, y, w, h ); } - return( TRUE ); + return( sal_True ); } -BOOL GtkSalGraphics::NWPaintGTKListNode( +sal_Bool GtkSalGraphics::NWPaintGTKListNode( GdkDrawable*, ControlType, ControlPart, const Rectangle& rControlRectangle, @@ -2909,7 +2909,7 @@ BOOL GtkSalGraphics::NWPaintGTKListNode( GdkPixmap* pixmap = NWGetPixmapFromScreen( aRect ); if( ! pixmap ) - return FALSE; + return sal_False; GdkDrawable* const &pixDrawable = GDK_DRAWABLE( pixmap ); gtk_paint_expander( gWidgetData[m_nScreen].gTreeView->style, @@ -2921,13 +2921,13 @@ BOOL GtkSalGraphics::NWPaintGTKListNode( w/2, h/2, eStyle ); - BOOL bRet = NWRenderPixmapToScreen( pixmap, aRect ); + sal_Bool bRet = NWRenderPixmapToScreen( pixmap, aRect ); g_object_unref( pixmap ); return bRet; } -BOOL GtkSalGraphics::NWPaintGTKProgress( +sal_Bool GtkSalGraphics::NWPaintGTKProgress( GdkDrawable*, ControlType, ControlPart, const Rectangle& rControlRectangle, @@ -2945,7 +2945,7 @@ BOOL GtkSalGraphics::NWPaintGTKProgress( GdkPixmap* pixmap = NWGetPixmapFromScreen( Rectangle( Point( 0, 0 ), Size( w, h ) ) ); if( ! pixmap ) - return FALSE; + return sal_False; GdkDrawable* const &pixDrawable = GDK_DRAWABLE( pixmap ); @@ -2985,13 +2985,13 @@ BOOL GtkSalGraphics::NWPaintGTKProgress( } } - BOOL bRet = NWRenderPixmapToScreen( pixmap, rControlRectangle ); + sal_Bool bRet = NWRenderPixmapToScreen( pixmap, rControlRectangle ); g_object_unref( pixmap ); return bRet; } -BOOL GtkSalGraphics::NWPaintGTKSlider( +sal_Bool GtkSalGraphics::NWPaintGTKSlider( GdkDrawable*, ControlType, ControlPart nPart, const Rectangle& rControlRectangle, @@ -3010,7 +3010,7 @@ BOOL GtkSalGraphics::NWPaintGTKSlider( GdkPixmap* pixmap = NWGetPixmapFromScreen( rControlRectangle ); if( ! pixmap ) - return FALSE; + return sal_False; GdkDrawable* const &pixDrawable = GDK_DRAWABLE( pixmap ); GtkWidget* pWidget = (nPart == PART_TRACK_HORZ_AREA) @@ -3111,7 +3111,7 @@ BOOL GtkSalGraphics::NWPaintGTKSlider( } #endif - BOOL bRet = NWRenderPixmapToScreen( pixmap, rControlRectangle ); + sal_Bool bRet = NWRenderPixmapToScreen( pixmap, rControlRectangle ); g_object_unref( pixmap ); return bRet; @@ -3360,9 +3360,9 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) else { Color aColor2 = aStyleSet.GetLightColor(); - Color aCheck( (BYTE)(((USHORT)aBackColor.GetRed()+(USHORT)aColor2.GetRed())/2), - (BYTE)(((USHORT)aBackColor.GetGreen()+(USHORT)aColor2.GetGreen())/2), - (BYTE)(((USHORT)aBackColor.GetBlue()+(USHORT)aColor2.GetBlue())/2) + Color aCheck( (sal_uInt8)(((sal_uInt16)aBackColor.GetRed()+(sal_uInt16)aColor2.GetRed())/2), + (sal_uInt8)(((sal_uInt16)aBackColor.GetGreen()+(sal_uInt16)aColor2.GetGreen())/2), + (sal_uInt8)(((sal_uInt16)aBackColor.GetBlue()+(sal_uInt16)aColor2.GetBlue())/2) ); aStyleSet.SetCheckedColor( aCheck ); } @@ -3398,7 +3398,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) aStyleSet.SetInactiveTabColor( aSelectedBackColor ); // menu disabled entries handling - aStyleSet.SetSkipDisabledInMenus( TRUE ); + aStyleSet.SetSkipDisabledInMenus( sal_True ); // menu colors GtkStyle* pMenuStyle = gtk_widget_get_style( gWidgetData[m_nScreen].gMenuWidget ); GtkStyle* pMenuItemStyle = gtk_rc_get_style( gWidgetData[m_nScreen].gMenuItemMenuWidget ); @@ -3684,17 +3684,17 @@ GdkPixmap* GtkSalGraphics::NWGetPixmapFromScreen( Rectangle srcRect ) * Copy an alpha pixmap to screen using a gc with clipping ************************************************************************/ -BOOL GtkSalGraphics::NWRenderPixmapToScreen( GdkPixmap* pPixmap, Rectangle dstRect ) +sal_Bool GtkSalGraphics::NWRenderPixmapToScreen( GdkPixmap* pPixmap, Rectangle dstRect ) { // The GC can't be null, otherwise we'd have no clip region if( SelectFont() == NULL ) { std::fprintf(stderr, "salnativewidgets.cxx: no valid GC\n" ); - return( FALSE ); + return( sal_False ); } if ( !pPixmap ) - return( FALSE ); + return( sal_False ); // Copy the background of the screen into a composite pixmap CopyScreenArea( GetXDisplay(), @@ -3705,7 +3705,7 @@ BOOL GtkSalGraphics::NWRenderPixmapToScreen( GdkPixmap* pPixmap, Rectangle dstRe SelectFont(), 0, 0, dstRect.GetWidth(), dstRect.GetHeight(), dstRect.Left(), dstRect.Top() ); - return( TRUE ); + return( sal_True ); } diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index d04d5c0ce684..2b6cf8dc4484 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -83,9 +83,9 @@ using namespace com::sun::star; int GtkSalFrame::m_nFloats = 0; -static USHORT GetKeyModCode( guint state ) +static sal_uInt16 GetKeyModCode( guint state ) { - USHORT nCode = 0; + sal_uInt16 nCode = 0; if( (state & GDK_SHIFT_MASK) ) nCode |= KEY_SHIFT; if( (state & GDK_CONTROL_MASK) ) @@ -100,9 +100,9 @@ static USHORT GetKeyModCode( guint state ) return nCode; } -static USHORT GetMouseModCode( guint state ) +static sal_uInt16 GetMouseModCode( guint state ) { - USHORT nCode = GetKeyModCode( state ); + sal_uInt16 nCode = GetKeyModCode( state ); if( (state & GDK_BUTTON1_MASK) ) nCode |= MOUSE_LEFT; if( (state & GDK_BUTTON2_MASK) ) @@ -113,9 +113,9 @@ static USHORT GetMouseModCode( guint state ) return nCode; } -static USHORT GetKeyCode( guint keyval ) +static sal_uInt16 GetKeyCode( guint keyval ) { - USHORT nCode = 0; + sal_uInt16 nCode = 0; if( keyval >= GDK_0 && keyval <= GDK_9 ) nCode = KEY_0 + (keyval-GDK_0); else if( keyval >= GDK_KP_0 && keyval <= GDK_KP_9 ) @@ -297,14 +297,14 @@ static USHORT GetKeyCode( guint keyval ) // in the independent part. struct KeyAlternate { - USHORT nKeyCode; + sal_uInt16 nKeyCode; sal_Unicode nCharCode; KeyAlternate() : nKeyCode( 0 ), nCharCode( 0 ) {} - KeyAlternate( USHORT nKey, sal_Unicode nChar = 0 ) : nKeyCode( nKey ), nCharCode( nChar ) {} + KeyAlternate( sal_uInt16 nKey, sal_Unicode nChar = 0 ) : nKeyCode( nKey ), nCharCode( nChar ) {} }; inline KeyAlternate -GetAlternateKeyCode( const USHORT nKeyCode ) +GetAlternateKeyCode( const sal_uInt16 nKeyCode ) { KeyAlternate aAlternate; @@ -392,7 +392,7 @@ GtkSalFrame::GraphicsHolder::~GraphicsHolder() delete pGraphics; } -GtkSalFrame::GtkSalFrame( SalFrame* pParent, ULONG nStyle ) +GtkSalFrame::GtkSalFrame( SalFrame* pParent, sal_uInt32 nStyle ) { m_nScreen = getDisplay()->GetDefaultScreenNumber(); getDisplay()->registerFrame( this ); @@ -568,7 +568,7 @@ void GtkSalFrame::InitCommon() m_ePointerStyle = 0xffff; m_bSetFocusOnMap = false; - gtk_widget_set_app_paintable( m_pWindow, TRUE ); + gtk_widget_set_app_paintable( m_pWindow, sal_True ); gtk_widget_set_double_buffered( m_pWindow, FALSE ); gtk_widget_set_redraw_on_allocate( m_pWindow, FALSE ); gtk_widget_add_events( m_pWindow, @@ -755,7 +755,7 @@ GtkSalFrame *GtkSalFrame::getFromWindow( GtkWindow *pWindow ) return (GtkSalFrame *) g_object_get_data( G_OBJECT( pWindow ), "SalFrame" ); } -void GtkSalFrame::Init( SalFrame* pParent, ULONG nStyle ) +void GtkSalFrame::Init( SalFrame* pParent, sal_uInt32 nStyle ) { if( nStyle & SAL_FRAME_STYLE_DEFAULT ) // ensure default style { @@ -823,7 +823,7 @@ void GtkSalFrame::Init( SalFrame* pParent, ULONG nStyle ) else if( (nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) ) { eType = GDK_WINDOW_TYPE_HINT_TOOLBAR; - lcl_set_accept_focus( GTK_WINDOW(m_pWindow), FALSE, true ); + lcl_set_accept_focus( GTK_WINDOW(m_pWindow), sal_False, true ); bNoDecor = true; } else if( (nStyle & SAL_FRAME_STYLE_FLOAT_FOCUSABLE) ) @@ -868,9 +868,9 @@ void GtkSalFrame::Init( SalFrame* pParent, ULONG nStyle ) if( bDecoHandling ) { - gtk_window_set_resizable( GTK_WINDOW(m_pWindow), (nStyle & SAL_FRAME_STYLE_SIZEABLE) ? TRUE : FALSE ); + gtk_window_set_resizable( GTK_WINDOW(m_pWindow), (nStyle & SAL_FRAME_STYLE_SIZEABLE) ? sal_True : FALSE ); if( ( (nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION)) ) ) - lcl_set_accept_focus( GTK_WINDOW(m_pWindow), FALSE, false ); + lcl_set_accept_focus( GTK_WINDOW(m_pWindow), sal_False, false ); } } @@ -1029,10 +1029,10 @@ void GtkSalFrame::ReleaseGraphics( SalGraphics* pGraphics ) } } -BOOL GtkSalFrame::PostEvent( void* pData ) +sal_Bool GtkSalFrame::PostEvent( void* pData ) { getDisplay()->SendInternalEvent( this, pData ); - return TRUE; + return sal_True; } void GtkSalFrame::SetTitle( const String& rTitle ) @@ -1042,8 +1042,8 @@ void GtkSalFrame::SetTitle( const String& rTitle ) gtk_window_set_title( GTK_WINDOW(m_pWindow), rtl::OUStringToOString( rTitle, RTL_TEXTENCODING_UTF8 ).getStr() ); } -static inline BYTE * -getRow( BitmapBuffer *pBuffer, ULONG nRow ) +static inline sal_uInt8 * +getRow( BitmapBuffer *pBuffer, sal_uInt32 nRow ) { if( BMP_SCANLINE_ADJUSTMENT( pBuffer->mnFormat ) == BMP_FORMAT_TOP_DOWN ) return pBuffer->mpBits + nRow * pBuffer->mnScanlineSize; @@ -1057,11 +1057,11 @@ bitmapToPixbuf( SalBitmap *pSalBitmap, SalBitmap *pSalAlpha ) g_return_val_if_fail( pSalBitmap != NULL, NULL ); g_return_val_if_fail( pSalAlpha != NULL, NULL ); - BitmapBuffer *pBitmap = pSalBitmap->AcquireBuffer( TRUE ); + BitmapBuffer *pBitmap = pSalBitmap->AcquireBuffer( sal_True ); g_return_val_if_fail( pBitmap != NULL, NULL ); g_return_val_if_fail( pBitmap->mnBitCount == 24, NULL ); - BitmapBuffer *pAlpha = pSalAlpha->AcquireBuffer( TRUE ); + BitmapBuffer *pAlpha = pSalAlpha->AcquireBuffer( sal_True ); g_return_val_if_fail( pAlpha != NULL, NULL ); g_return_val_if_fail( pAlpha->mnBitCount == 8, NULL ); @@ -1074,8 +1074,8 @@ bitmapToPixbuf( SalBitmap *pSalBitmap, SalBitmap *pSalAlpha ) for( nY = 0; nY < pBitmap->mnHeight; nY++ ) { - BYTE *pData = getRow( pBitmap, nY ); - BYTE *pAlphaData = getRow( pAlpha, nY ); + sal_uInt8 *pData = getRow( pBitmap, nY ); + sal_uInt8 *pAlphaData = getRow( pAlpha, nY ); for( nX = 0; nX < pBitmap->mnWidth; nX++ ) { @@ -1096,18 +1096,18 @@ bitmapToPixbuf( SalBitmap *pSalBitmap, SalBitmap *pSalAlpha ) } } - pSalBitmap->ReleaseBuffer( pBitmap, TRUE ); - pSalAlpha->ReleaseBuffer( pAlpha, TRUE ); + pSalBitmap->ReleaseBuffer( pBitmap, sal_True ); + pSalAlpha->ReleaseBuffer( pAlpha, sal_True ); return gdk_pixbuf_new_from_data( pPixbufData, - GDK_COLORSPACE_RGB, TRUE, 8, + GDK_COLORSPACE_RGB, sal_True, 8, aSize.Width(), aSize.Height(), aSize.Width() * 4, (GdkPixbufDestroyNotify) g_free, NULL ); } -void GtkSalFrame::SetIcon( USHORT nIcon ) +void GtkSalFrame::SetIcon( sal_uInt16 nIcon ) { if( (m_nStyle & (SAL_FRAME_STYLE_PLUG|SAL_FRAME_STYLE_SYSTEMCHILD|SAL_FRAME_STYLE_FLOAT|SAL_FRAME_STYLE_INTRO|SAL_FRAME_STYLE_OWNERDRAWDECORATION)) || ! m_pWindow ) @@ -1119,8 +1119,8 @@ void GtkSalFrame::SetIcon( USHORT nIcon ) GdkPixbuf *pBuf; GList *pIcons = NULL; - USHORT nOffsets[2] = { SV_ICON_SMALL_START, SV_ICON_LARGE_START }; - USHORT nIndex; + sal_uInt16 nOffsets[2] = { SV_ICON_SMALL_START, SV_ICON_LARGE_START }; + sal_uInt16 nIndex; // Use high contrast icons where appropriate if( Application::GetSettings().GetStyleSettings().GetHighContrastMode() ) @@ -1129,7 +1129,7 @@ void GtkSalFrame::SetIcon( USHORT nIcon ) nOffsets[1] = SV_ICON_SMALL_HC_START; } - for( nIndex = 0; nIndex < sizeof(nOffsets)/ sizeof(USHORT); nIndex++ ) + for( nIndex = 0; nIndex < sizeof(nOffsets)/ sizeof(sal_uInt16); nIndex++ ) { // #i44723# workaround gcc temporary problem ResId aResId( nOffsets[nIndex] + nIcon, *ImplGetResMgr() ); @@ -1148,7 +1148,7 @@ void GtkSalFrame::SetIcon( USHORT nIcon ) { case TRANSPARENT_NONE: { - BYTE nTrans = 0; + sal_uInt8 nTrans = 0; aMask = AlphaMask( aBmp.GetSizePixel(), &nTrans ); } break; @@ -1288,7 +1288,7 @@ static void initClientId() } } -void GtkSalFrame::Show( BOOL bVisible, BOOL bNoActivate ) +void GtkSalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate ) { if( m_pWindow ) { @@ -1323,7 +1323,7 @@ void GtkSalFrame::Show( BOOL bVisible, BOOL bNoActivate ) * showing the float (cannot grab it to the float * before show). */ - m_pParent->grabPointer( TRUE, TRUE ); + m_pParent->grabPointer( sal_True, sal_True ); } guint32 nUserTime = 0; @@ -1370,7 +1370,7 @@ void GtkSalFrame::Show( BOOL bVisible, BOOL bNoActivate ) { m_nFloats++; if( ! getDisplay()->GetCaptureFrame() && m_nFloats == 1 ) - grabPointer( TRUE, TRUE ); + grabPointer( sal_True, sal_True ); // #i44068# reset parent's IM context if( m_pParent ) m_pParent->EndExtTextInput(0); @@ -1384,7 +1384,7 @@ void GtkSalFrame::Show( BOOL bVisible, BOOL bNoActivate ) { m_nFloats--; if( ! getDisplay()->GetCaptureFrame() && m_nFloats == 0) - grabPointer( FALSE ); + grabPointer( sal_False ); } gtk_widget_hide( m_pWindow ); if( m_pIMHandler ) @@ -1397,7 +1397,7 @@ void GtkSalFrame::Show( BOOL bVisible, BOOL bNoActivate ) } } -void GtkSalFrame::Enable( BOOL /*bEnable*/ ) +void GtkSalFrame::Enable( sal_Bool /*bEnable*/ ) { // Not implemented by X11SalFrame either } @@ -1487,7 +1487,7 @@ void GtkSalFrame::SetMinClientSize( long nWidth, long nHeight ) } } -void GtkSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags ) +void GtkSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ) { if( !m_pWindow || isChild( true, false ) ) return; @@ -1602,7 +1602,7 @@ void GtkSalFrame::SetWindowState( const SalFrameState* pState ) if( ! m_pWindow || ! pState || isChild( true, false ) ) return; - const ULONG nMaxGeometryMask = + const sal_uInt32 nMaxGeometryMask = SAL_FRAMESTATE_MASK_X | SAL_FRAMESTATE_MASK_Y | SAL_FRAMESTATE_MASK_WIDTH | SAL_FRAMESTATE_MASK_HEIGHT | SAL_FRAMESTATE_MASK_MAXIMIZED_X | SAL_FRAMESTATE_MASK_MAXIMIZED_Y | @@ -1630,7 +1630,7 @@ void GtkSalFrame::SetWindowState( const SalFrameState* pState ) else if( pState->mnMask & (SAL_FRAMESTATE_MASK_X | SAL_FRAMESTATE_MASK_Y | SAL_FRAMESTATE_MASK_WIDTH | SAL_FRAMESTATE_MASK_HEIGHT ) ) { - USHORT nPosSizeFlags = 0; + sal_uInt16 nPosSizeFlags = 0; long nX = pState->mnX - (m_pParent ? m_pParent->maGeometry.nX : 0); long nY = pState->mnY - (m_pParent ? m_pParent->maGeometry.nY : 0); long nWidth = pState->mnWidth; @@ -1675,7 +1675,7 @@ void GtkSalFrame::SetWindowState( const SalFrameState* pState ) } } -BOOL GtkSalFrame::GetWindowState( SalFrameState* pState ) +sal_Bool GtkSalFrame::GetWindowState( SalFrameState* pState ) { pState->mnState = SAL_FRAMESTATE_NORMAL; pState->mnMask = SAL_FRAMESTATE_MASK_STATE; @@ -1711,7 +1711,7 @@ BOOL GtkSalFrame::GetWindowState( SalFrameState* pState ) SAL_FRAMESTATE_MASK_WIDTH | SAL_FRAMESTATE_MASK_HEIGHT; - return TRUE; + return sal_True; } void GtkSalFrame::moveToScreen( int nScreen ) @@ -1775,13 +1775,13 @@ void GtkSalFrame::SetScreenNumber( unsigned int nNewScreen ) Rectangle aNewScreenRect( pDisp->GetXineramaScreens()[nNewScreen] ); bool bVisible = GTK_WIDGET_MAPPED(m_pWindow); if( bVisible ) - Show( FALSE ); + Show( sal_False ); maGeometry.nX = aNewScreenRect.Left() + (maGeometry.nX - aOldScreenRect.Left()); maGeometry.nY = aNewScreenRect.Top() + (maGeometry.nY - aOldScreenRect.Top()); createNewWindow( None, false, m_nScreen ); gtk_window_move( GTK_WINDOW(m_pWindow), maGeometry.nX, maGeometry.nY ); if( bVisible ) - Show( TRUE ); + Show( sal_True ); maGeometry.nScreenNumber = nNewScreen; } else if( sal_Int32(nNewScreen) < pDisp->GetScreenCount() ) @@ -1793,7 +1793,7 @@ void GtkSalFrame::SetScreenNumber( unsigned int nNewScreen ) } } -void GtkSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen ) +void GtkSalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nScreen ) { if( m_pWindow && ! isChild() ) { @@ -1807,7 +1807,7 @@ void GtkSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen ) Size( maGeometry.nWidth, maGeometry.nHeight ) ); bool bVisible = GTK_WIDGET_MAPPED(m_pWindow); if( bVisible ) - Show( FALSE ); + Show( sal_False ); m_nStyle |= SAL_FRAME_STYLE_PARTIAL_FULLSCREEN; createNewWindow( None, false, m_nScreen ); Rectangle aNewPosSize; @@ -1830,11 +1830,11 @@ void GtkSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen ) if( ! getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() ) { if( !(m_nStyle & SAL_FRAME_STYLE_SIZEABLE) ) - gtk_window_set_resizable( GTK_WINDOW(m_pWindow), TRUE ); + gtk_window_set_resizable( GTK_WINDOW(m_pWindow), sal_True ); gtk_window_fullscreen( GTK_WINDOW( m_pWindow ) ); } if( bVisible ) - Show( TRUE ); + Show( sal_True ); } else { @@ -1842,7 +1842,7 @@ void GtkSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen ) if( ! getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() ) gtk_window_unfullscreen( GTK_WINDOW(m_pWindow) ); if( bVisible ) - Show( FALSE ); + Show( sal_False ); m_nStyle &= ~SAL_FRAME_STYLE_PARTIAL_FULLSCREEN; createNewWindow( None, false, m_nScreen ); if( ! m_aRestorePosSize.IsEmpty() ) @@ -1856,7 +1856,7 @@ void GtkSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen ) m_aRestorePosSize = Rectangle(); } if( bVisible ) - Show( TRUE ); + Show( sal_True ); } } else @@ -2025,7 +2025,7 @@ dbus_uninhibit_gsm (guint cookie) } #endif -void GtkSalFrame::StartPresentation( BOOL bStart ) +void GtkSalFrame::StartPresentation( sal_Bool bStart ) { Display *pDisplay = GDK_DISPLAY_XDISPLAY( getGdkDisplay() ); @@ -2062,11 +2062,11 @@ void GtkSalFrame::StartPresentation( BOOL bStart ) } } -void GtkSalFrame::SetAlwaysOnTop( BOOL /*bOnTop*/ ) +void GtkSalFrame::SetAlwaysOnTop( sal_Bool /*bOnTop*/ ) { } -void GtkSalFrame::ToTop( USHORT nFlags ) +void GtkSalFrame::ToTop( sal_uInt16 nFlags ) { if( m_pWindow ) { @@ -2117,13 +2117,13 @@ void GtkSalFrame::SetPointer( PointerStyle ePointerStyle ) // #i80791# use grabPointer the same way as CaptureMouse, respective float grab if( getDisplay()->MouseCaptured( this ) ) - grabPointer( TRUE, FALSE ); + grabPointer( sal_True, sal_False ); else if( m_nFloats > 0 ) - grabPointer( TRUE, TRUE ); + grabPointer( sal_True, sal_True ); } } -void GtkSalFrame::grabPointer( BOOL bGrab, BOOL bOwnerEvents ) +void GtkSalFrame::grabPointer( sal_Bool bGrab, sal_Bool bOwnerEvents ) { if( m_pWindow ) { @@ -2180,7 +2180,7 @@ void GtkSalFrame::grabPointer( BOOL bGrab, BOOL bOwnerEvents ) } } -void GtkSalFrame::CaptureMouse( BOOL bCapture ) +void GtkSalFrame::CaptureMouse( sal_Bool bCapture ) { getDisplay()->CaptureMouse( bCapture ? this : NULL ); } @@ -2225,12 +2225,12 @@ void GtkSalFrame::Sync() gdk_display_sync( getGdkDisplay() ); } -String GtkSalFrame::GetSymbolKeyName( const String&, USHORT nKeyCode ) +String GtkSalFrame::GetSymbolKeyName( const String&, sal_uInt16 nKeyCode ) { return getDisplay()->GetKeyName( nKeyCode ); } -String GtkSalFrame::GetKeyName( USHORT nKeyCode ) +String GtkSalFrame::GetKeyName( sal_uInt16 nKeyCode ) { return getDisplay()->GetKeyName( nKeyCode ); } @@ -2271,16 +2271,16 @@ void GtkSalFrame::SetInputContext( SalInputContext* pContext ) m_pIMHandler->setInputContext( pContext ); } -void GtkSalFrame::EndExtTextInput( USHORT nFlags ) +void GtkSalFrame::EndExtTextInput( sal_uInt16 nFlags ) { if( m_pIMHandler ) m_pIMHandler->endExtTextInput( nFlags ); } -BOOL GtkSalFrame::MapUnicodeToKeyCode( sal_Unicode , LanguageType , KeyCode& ) +sal_Bool GtkSalFrame::MapUnicodeToKeyCode( sal_Unicode , LanguageType , KeyCode& ) { // not supported yet - return FALSE; + return sal_False; } LanguageType GtkSalFrame::GetInputLanguage() @@ -2358,7 +2358,7 @@ void GtkSalFrame::createNewWindow( XLIB_Window aNewParent, bool bXEmbed, int nSc { bool bWasVisible = GTK_WIDGET_MAPPED(m_pWindow); if( bWasVisible ) - Show( FALSE ); + Show( sal_False ); if( nScreen < 0 || nScreen >= getDisplay()->GetScreenCount() ) nScreen = m_nScreen; @@ -2438,7 +2438,7 @@ void GtkSalFrame::createNewWindow( XLIB_Window aNewParent, bool bXEmbed, int nSc SetTitle( m_aTitle ); if( bWasVisible ) - Show( TRUE ); + Show( sal_True ); std::list< GtkSalFrame* > aChildren = m_aChildren; m_aChildren.clear(); @@ -2462,7 +2462,7 @@ void GtkSalFrame::ResetClipRegion() gdk_window_shape_combine_region( m_pWindow->window, NULL, 0, 0 ); } -void GtkSalFrame::BeginSetClipRegion( ULONG ) +void GtkSalFrame::BeginSetClipRegion( sal_uInt32 ) { if( m_pRegion ) gdk_region_destroy( m_pRegion ); @@ -2555,7 +2555,7 @@ bool GtkSalFrame::Dispatch( const XEvent* pEvent ) GdkEventFocus aEvent; aEvent.type = GDK_FOCUS_CHANGE; aEvent.window = m_pWindow->window; - aEvent.send_event = TRUE; + aEvent.send_event = sal_True; aEvent.in = (pEvent->xclient.data.l[1] == 1); signalFocus( m_pWindow, &aEvent, this ); } @@ -2609,7 +2609,7 @@ gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer { GtkSalFrame* pThis = (GtkSalFrame*)frame; SalMouseEvent aEvent; - USHORT nEventType = 0; + sal_uInt16 nEventType = 0; switch( pEvent->type ) { case GDK_BUTTON_PRESS: @@ -2619,14 +2619,14 @@ gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer nEventType = SALEVENT_MOUSEBUTTONUP; break; default: - return FALSE; + return sal_False; } switch( pEvent->button ) { case 1: aEvent.mnButton = MOUSE_LEFT; break; case 2: aEvent.mnButton = MOUSE_MIDDLE; break; case 3: aEvent.mnButton = MOUSE_RIGHT; break; - default: return FALSE; + default: return sal_False; } aEvent.mnTime = pEvent->time; aEvent.mnX = (long)pEvent->x_root - pThis->maGeometry.nX; @@ -2694,7 +2694,7 @@ gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer } } - return FALSE; + return sal_False; } gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEvent* pEvent, gpointer frame ) @@ -2702,7 +2702,7 @@ gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEvent* pEvent, gpointer frame GtkSalFrame* pThis = (GtkSalFrame*)frame; GdkEventScroll* pSEvent = (GdkEventScroll*)pEvent; - static ULONG nLines = 0; + static sal_uInt32 nLines = 0; if( ! nLines ) { char* pEnv = getenv( "SAL_WHEELLINES" ); @@ -2714,8 +2714,8 @@ gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEvent* pEvent, gpointer frame bool bNeg = (pSEvent->direction == GDK_SCROLL_DOWN || pSEvent->direction == GDK_SCROLL_RIGHT ); SalWheelMouseEvent aEvent; aEvent.mnTime = pSEvent->time; - aEvent.mnX = (ULONG)pSEvent->x; - aEvent.mnY = (ULONG)pSEvent->y; + aEvent.mnX = (sal_uInt32)pSEvent->x; + aEvent.mnY = (sal_uInt32)pSEvent->y; aEvent.mnDelta = bNeg ? -120 : 120; aEvent.mnNotchDelta = bNeg ? -1 : 1; aEvent.mnScrollLines = nLines; @@ -2730,7 +2730,7 @@ gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEvent* pEvent, gpointer frame pThis->CallCallback( SALEVENT_WHEELMOUSE, &aEvent ); - return FALSE; + return sal_False; } gboolean GtkSalFrame::signalMotion( GtkWidget*, GdkEventMotion* pEvent, gpointer frame ) @@ -2775,7 +2775,7 @@ gboolean GtkSalFrame::signalMotion( GtkWidget*, GdkEventMotion* pEvent, gpointer } } - return TRUE; + return sal_True; } gboolean GtkSalFrame::signalCrossing( GtkWidget*, GdkEventCrossing* pEvent, gpointer frame ) @@ -2791,7 +2791,7 @@ gboolean GtkSalFrame::signalCrossing( GtkWidget*, GdkEventCrossing* pEvent, gpoi GTK_YIELD_GRAB(); pThis->CallCallback( (pEvent->type == GDK_ENTER_NOTIFY) ? SALEVENT_MOUSEMOVE : SALEVENT_MOUSELEAVE, &aEvent ); - return TRUE; + return sal_True; } @@ -2804,7 +2804,7 @@ gboolean GtkSalFrame::signalExpose( GtkWidget*, GdkEventExpose* pEvent, gpointer GTK_YIELD_GRAB(); pThis->CallCallback( SALEVENT_PAINT, &aEvent ); - return FALSE; + return sal_False; } gboolean GtkSalFrame::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer frame ) @@ -2840,7 +2840,7 @@ gboolean GtkSalFrame::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer f if( m_nFloats == 0 ) pThis->CallCallback( pEvent->in ? SALEVENT_GETFOCUS : SALEVENT_LOSEFOCUS, NULL ); - return FALSE; + return sal_False; } IMPL_LINK( GtkSalFrame, ImplDelayedFullScreenHdl, void*, EMPTYARG ) @@ -2912,7 +2912,7 @@ gboolean GtkSalFrame::signalMap( GtkWidget*, GdkEvent*, gpointer frame ) pThis->CallCallback( SALEVENT_RESIZE, NULL ); - return FALSE; + return sal_False; } gboolean GtkSalFrame::signalUnmap( GtkWidget*, GdkEvent*, gpointer frame ) @@ -2922,7 +2922,7 @@ gboolean GtkSalFrame::signalUnmap( GtkWidget*, GdkEvent*, gpointer frame ) GTK_YIELD_GRAB(); pThis->CallCallback( SALEVENT_RESIZE, NULL ); - return FALSE; + return sal_False; } gboolean GtkSalFrame::signalConfigure( GtkWidget*, GdkEventConfigure* pEvent, gpointer frame ) @@ -2942,7 +2942,7 @@ gboolean GtkSalFrame::signalConfigure( GtkWidget*, GdkEventConfigure* pEvent, gp */ if( (pThis->m_nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) && pThis->getDisplay()->GetCaptureFrame() == pThis ) - return FALSE; + return sal_False; // in child case the coordinates are not root coordinates, @@ -3011,7 +3011,7 @@ gboolean GtkSalFrame::signalConfigure( GtkWidget*, GdkEventConfigure* pEvent, gp else if( bSized ) pThis->CallCallback( SALEVENT_RESIZE, NULL ); - return FALSE; + return sal_False; } gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame ) @@ -3025,7 +3025,7 @@ gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame if( pThis->m_pIMHandler->handleKeyEvent( pEvent ) ) { pThis->m_bSingleAltPress = false; - return TRUE; + return sal_True; } } GTK_YIELD_GRAB(); @@ -3039,7 +3039,7 @@ gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame { SalKeyModEvent aModEvt; - USHORT nModCode = GetKeyModCode( pEvent->state ); + sal_uInt16 nModCode = GetKeyModCode( pEvent->state ); aModEvt.mnModKeyCode = 0; // emit no MODKEYCHANGE events if( pEvent->type == GDK_KEY_PRESS && !pThis->m_nKeyModifiers ) @@ -3052,8 +3052,8 @@ gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame pThis->m_nKeyModifiers = 0; } - USHORT nExtModMask = 0; - USHORT nModMask = 0; + sal_uInt16 nExtModMask = 0; + sal_uInt16 nModMask = 0; // pressing just the ctrl key leads to a keysym of XK_Control but // the event state does not contain ControlMask. In the release // event its the other way round: it does contain the Control mask. @@ -3164,7 +3164,7 @@ gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame if( !aDel.isDeleted() && pThis->m_pIMHandler ) pThis->m_pIMHandler->updateIMSpotLocation(); - return TRUE; + return sal_True; } gboolean GtkSalFrame::signalDelete( GtkWidget*, GdkEvent*, gpointer frame ) @@ -3174,7 +3174,7 @@ gboolean GtkSalFrame::signalDelete( GtkWidget*, GdkEvent*, gpointer frame ) GTK_YIELD_GRAB(); pThis->CallCallback( SALEVENT_CLOSE, NULL ); - return TRUE; + return sal_True; } void GtkSalFrame::signalStyleSet( GtkWidget*, GtkStyle* pPrevious, gpointer frame ) @@ -3213,7 +3213,7 @@ void GtkSalFrame::signalStyleSet( GtkWidget*, GtkStyle* pPrevious, gpointer fram { // signalize theme changed for NWF caches // FIXME: should be called only once for a style change - GtkSalGraphics::bThemeChanged = TRUE; + GtkSalGraphics::bThemeChanged = sal_True; } } @@ -3241,7 +3241,7 @@ gboolean GtkSalFrame::signalState( GtkWidget*, GdkEvent* pEvent, gpointer frame } #endif - return FALSE; + return sal_False; } gboolean GtkSalFrame::signalVisibility( GtkWidget*, GdkEventVisibility* pEvent, gpointer frame ) @@ -3249,7 +3249,7 @@ gboolean GtkSalFrame::signalVisibility( GtkWidget*, GdkEventVisibility* pEvent, GtkSalFrame* pThis = (GtkSalFrame*)frame; pThis->m_nVisibility = pEvent->state; - return FALSE; + return sal_False; } void GtkSalFrame::signalDestroy( GtkObject* pObj, gpointer frame ) @@ -3363,7 +3363,7 @@ void GtkSalFrame::IMHandler::sendEmptyCommit() m_pFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, NULL ); } -void GtkSalFrame::IMHandler::endExtTextInput( USHORT /*nFlags*/ ) +void GtkSalFrame::IMHandler::endExtTextInput( sal_uInt16 /*nFlags*/ ) { gtk_im_context_reset ( m_pIMContext ); @@ -3639,7 +3639,7 @@ void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_ pThis->m_aInputEvent.mnDeltaStart = 0; pThis->m_aInputEvent.mbOnlyCursor = False; - pThis->m_aInputFlags = std::vector( std::max( 1, (int)pThis->m_aInputEvent.maText.Len() ), 0 ); + pThis->m_aInputFlags = std::vector( std::max( 1, (int)pThis->m_aInputEvent.maText.Len() ), 0 ); PangoAttrIterator *iter = pango_attr_list_get_iterator (pAttrs); do @@ -3772,15 +3772,15 @@ gboolean GtkSalFrame::IMHandler::signalIMRetrieveSurrounding( GtkIMContext* pCon sal_uInt32 nPosition = xText->getCaretPosition(); rtl::OUString sAllText = xText->getText(); if (!sAllText.getLength()) - return FALSE; + return sal_False; rtl::OString sUTF = rtl::OUStringToOString(sAllText, RTL_TEXTENCODING_UTF8); rtl::OUString sCursorText(sAllText, nPosition); gtk_im_context_set_surrounding(pContext, sUTF.getStr(), sUTF.getLength(), rtl::OUStringToOString(sCursorText, RTL_TEXTENCODING_UTF8).getLength()); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } gboolean GtkSalFrame::IMHandler::signalIMDeleteSurrounding( GtkIMContext*, gint offset, gint nchars, @@ -3805,8 +3805,8 @@ gboolean GtkSalFrame::IMHandler::signalIMDeleteSurrounding( GtkIMContext*, gint xText->deleteText(nDeletePos, nDeleteEnd); // <-- - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } diff --git a/vcl/unx/gtk/window/gtkobject.cxx b/vcl/unx/gtk/window/gtkobject.cxx index c5f5a168f653..f8cb73c16c15 100644 --- a/vcl/unx/gtk/window/gtkobject.cxx +++ b/vcl/unx/gtk/window/gtkobject.cxx @@ -33,7 +33,7 @@ #include #include -GtkSalObject::GtkSalObject( GtkSalFrame* pParent, BOOL bShow ) +GtkSalObject::GtkSalObject( GtkSalFrame* pParent, sal_Bool bShow ) : m_pSocket( NULL ), m_pRegion( NULL ) { @@ -104,12 +104,12 @@ void GtkSalObject::ResetClipRegion() gdk_window_shape_combine_region( m_pSocket->window, NULL, 0, 0 ); } -USHORT GtkSalObject::GetClipRegionType() +sal_uInt16 GtkSalObject::GetClipRegionType() { return SAL_OBJECT_CLIP_INCLUDERECTS; } -void GtkSalObject::BeginSetClipRegion( ULONG ) +void GtkSalObject::BeginSetClipRegion( sal_uInt32 ) { if( m_pRegion ) gdk_region_destroy( m_pRegion ); @@ -144,7 +144,7 @@ void GtkSalObject::SetPosSize( long nX, long nY, long nWidth, long nHeight ) } } -void GtkSalObject::Show( BOOL bVisible ) +void GtkSalObject::Show( sal_Bool bVisible ) { if( m_pSocket ) { @@ -155,7 +155,7 @@ void GtkSalObject::Show( BOOL bVisible ) } } -void GtkSalObject::Enable( BOOL ) +void GtkSalObject::Enable( sal_Bool ) { } diff --git a/vcl/unx/headless/svpbmp.cxx b/vcl/unx/headless/svpbmp.cxx index 7c84c4a7a579..f96da7b0c12b 100644 --- a/vcl/unx/headless/svpbmp.cxx +++ b/vcl/unx/headless/svpbmp.cxx @@ -43,7 +43,7 @@ SvpSalBitmap::~SvpSalBitmap() } bool SvpSalBitmap::Create( const Size& rSize, - USHORT nBitCount, + sal_uInt16 nBitCount, const BitmapPalette& rPalette ) { sal_uInt32 nFormat = SVP_DEFAULT_BITMAP_FORMAT; @@ -111,7 +111,7 @@ bool SvpSalBitmap::Create( const SalBitmap& /*rSalBmp*/, } bool SvpSalBitmap::Create( const SalBitmap& /*rSalBmp*/, - USHORT /*nNewBitCount*/ ) + sal_uInt16 /*nNewBitCount*/ ) { return false; } @@ -133,9 +133,9 @@ Size SvpSalBitmap::GetSize() const return aSize; } -USHORT SvpSalBitmap::GetBitCount() const +sal_uInt16 SvpSalBitmap::GetBitCount() const { - USHORT nDepth = 0; + sal_uInt16 nDepth = 0; if( m_aBitmap.get() ) nDepth = getBitCountFromScanlineFormat( m_aBitmap->getScanlineFormat() ); return nDepth; @@ -147,7 +147,7 @@ BitmapBuffer* SvpSalBitmap::AcquireBuffer( bool ) if( m_aBitmap.get() ) { pBuf = new BitmapBuffer(); - USHORT nBitCount = 1; + sal_uInt16 nBitCount = 1; switch( m_aBitmap->getScanlineFormat() ) { case Format::ONE_BIT_MSB_GREY: @@ -216,7 +216,7 @@ BitmapBuffer* SvpSalBitmap::AcquireBuffer( bool ) pBuf->mnHeight = aSize.getY(); pBuf->mnScanlineSize = m_aBitmap->getScanlineStride(); pBuf->mnBitCount = nBitCount; - pBuf->mpBits = (BYTE*)m_aBitmap->getBuffer().get(); + pBuf->mpBits = (sal_uInt8*)m_aBitmap->getBuffer().get(); if( nBitCount <= 8 ) { if( m_aBitmap->getScanlineFormat() == Format::EIGHT_BIT_GREY || @@ -255,7 +255,7 @@ void SvpSalBitmap::ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly ) { // palette might have changed, clone device (but recycle // memory) - USHORT nBitCount = 0; + sal_uInt16 nBitCount = 0; switch( m_aBitmap->getScanlineFormat() ) { case Format::ONE_BIT_MSB_GREY: diff --git a/vcl/unx/headless/svpbmp.hxx b/vcl/unx/headless/svpbmp.hxx index dc775e66aaf1..e62f24a171e2 100644 --- a/vcl/unx/headless/svpbmp.hxx +++ b/vcl/unx/headless/svpbmp.hxx @@ -46,16 +46,16 @@ public: // SalBitmap virtual bool Create( const Size& rSize, - USHORT nBitCount, + sal_uInt16 nBitCount, const BitmapPalette& rPal ); virtual bool Create( const SalBitmap& rSalBmp ); virtual bool Create( const SalBitmap& rSalBmp, SalGraphics* pGraphics ); virtual bool Create( const SalBitmap& rSalBmp, - USHORT nNewBitCount ); + sal_uInt16 nNewBitCount ); virtual void Destroy(); virtual Size GetSize() const; - virtual USHORT GetBitCount() const; + virtual sal_uInt16 GetBitCount() const; virtual BitmapBuffer* AcquireBuffer( bool bReadOnly ); virtual void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly ); diff --git a/vcl/unx/headless/svpdummies.cxx b/vcl/unx/headless/svpdummies.cxx index 0a67b147804a..b58571131bda 100644 --- a/vcl/unx/headless/svpdummies.cxx +++ b/vcl/unx/headless/svpdummies.cxx @@ -50,13 +50,13 @@ SvpSalObject::~SvpSalObject() } void SvpSalObject::ResetClipRegion() {} -USHORT SvpSalObject::GetClipRegionType() { return 0; } -void SvpSalObject::BeginSetClipRegion( ULONG ) {} +sal_uInt16 SvpSalObject::GetClipRegionType() { return 0; } +void SvpSalObject::BeginSetClipRegion( sal_uInt32 ) {} void SvpSalObject::UnionClipRegion( long, long, long, long ) {} void SvpSalObject::EndSetClipRegion() {} void SvpSalObject::SetPosSize( long, long, long, long ) {} -void SvpSalObject::Show( BOOL ) {} -void SvpSalObject::Enable( BOOL ) {} +void SvpSalObject::Show( sal_Bool ) {} +void SvpSalObject::Enable( sal_Bool ) {} void SvpSalObject::GrabFocus() {} void SvpSalObject::SetBackground() {} void SvpSalObject::SetBackground( SalColor ) {} diff --git a/vcl/unx/headless/svpdummies.hxx b/vcl/unx/headless/svpdummies.hxx index ea7667ce51ca..090f7c2af288 100644 --- a/vcl/unx/headless/svpdummies.hxx +++ b/vcl/unx/headless/svpdummies.hxx @@ -44,14 +44,14 @@ public: // overload all pure virtual methods virtual void ResetClipRegion(); - virtual USHORT GetClipRegionType(); - virtual void BeginSetClipRegion( ULONG nRects ); + virtual sal_uInt16 GetClipRegionType(); + virtual void BeginSetClipRegion( sal_uInt32 nRects ); virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ); virtual void EndSetClipRegion(); virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight ); - virtual void Show( BOOL bVisible ); - virtual void Enable( BOOL nEnable ); + virtual void Show( sal_Bool bVisible ); + virtual void Enable( sal_Bool nEnable ); virtual void GrabFocus(); virtual void SetBackground(); diff --git a/vcl/unx/headless/svpframe.cxx b/vcl/unx/headless/svpframe.cxx index 1adf9a51cce4..4360012351f7 100644 --- a/vcl/unx/headless/svpframe.cxx +++ b/vcl/unx/headless/svpframe.cxx @@ -39,7 +39,7 @@ SvpSalFrame* SvpSalFrame::s_pFocusFrame = NULL; SvpSalFrame::SvpSalFrame( SvpSalInstance* pInstance, SalFrame* pParent, - ULONG nSalFrameStyle, + sal_uInt32 nSalFrameStyle, SystemParentData* ) : m_pInstance( pInstance ), m_pParent( static_cast(pParent) ), @@ -146,10 +146,10 @@ void SvpSalFrame::ReleaseGraphics( SalGraphics* pGraphics ) delete pSvpGraphics; } -BOOL SvpSalFrame::PostEvent( void* pData ) +sal_Bool SvpSalFrame::PostEvent( void* pData ) { m_pInstance->PostEvent( this, pData, SALEVENT_USEREVENT ); - return TRUE; + return sal_True; } void SvpSalFrame::PostPaint() const @@ -165,7 +165,7 @@ void SvpSalFrame::SetTitle( const XubString& ) { } -void SvpSalFrame::SetIcon( USHORT ) +void SvpSalFrame::SetIcon( sal_uInt16 ) { } @@ -181,7 +181,7 @@ void SvpSalFrame::SetExtendedFrameStyle( SalExtStyle ) { } -void SvpSalFrame::Show( BOOL bVisible, BOOL bNoActivate ) +void SvpSalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate ) { if( bVisible && ! m_bVisible ) { @@ -198,7 +198,7 @@ void SvpSalFrame::Show( BOOL bVisible, BOOL bNoActivate ) } } -void SvpSalFrame::Enable( BOOL ) +void SvpSalFrame::Enable( sal_Bool ) { } @@ -214,7 +214,7 @@ void SvpSalFrame::SetMaxClientSize( long nWidth, long nHeight ) m_nMaxHeight = nHeight; } -void SvpSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags ) +void SvpSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ) { if( (nFlags & SAL_FRAME_POSSIZE_X) != 0 ) maGeometry.nX = nX; @@ -311,7 +311,7 @@ void SvpSalFrame::SetWindowState( const SalFrameState *pState ) } } -BOOL SvpSalFrame::GetWindowState( SalFrameState* pState ) +sal_Bool SvpSalFrame::GetWindowState( SalFrameState* pState ) { pState->mnState = SAL_FRAMESTATE_NORMAL; pState->mnX = maGeometry.nX; @@ -320,24 +320,24 @@ BOOL SvpSalFrame::GetWindowState( SalFrameState* pState ) pState->mnHeight = maGeometry.nHeight; pState->mnMask = _FRAMESTATE_MASK_GEOMETRY | SAL_FRAMESTATE_MASK_STATE; - return TRUE; + return sal_True; } -void SvpSalFrame::ShowFullScreen( BOOL, sal_Int32 ) +void SvpSalFrame::ShowFullScreen( sal_Bool, sal_Int32 ) { SetPosSize( 0, 0, VIRTUAL_DESKTOP_WIDTH, VIRTUAL_DESKTOP_HEIGHT, SAL_FRAME_POSSIZE_WIDTH | SAL_FRAME_POSSIZE_HEIGHT ); } -void SvpSalFrame::StartPresentation( BOOL ) +void SvpSalFrame::StartPresentation( sal_Bool ) { } -void SvpSalFrame::SetAlwaysOnTop( BOOL ) +void SvpSalFrame::SetAlwaysOnTop( sal_Bool ) { } -void SvpSalFrame::ToTop( USHORT ) +void SvpSalFrame::ToTop( sal_uInt16 ) { GetFocus(); } @@ -346,7 +346,7 @@ void SvpSalFrame::SetPointer( PointerStyle ) { } -void SvpSalFrame::CaptureMouse( BOOL ) +void SvpSalFrame::CaptureMouse( sal_Bool ) { } @@ -366,23 +366,23 @@ void SvpSalFrame::SetInputContext( SalInputContext* ) { } -void SvpSalFrame::EndExtTextInput( USHORT ) +void SvpSalFrame::EndExtTextInput( sal_uInt16 ) { } -String SvpSalFrame::GetKeyName( USHORT ) +String SvpSalFrame::GetKeyName( sal_uInt16 ) { return String(); } -String SvpSalFrame::GetSymbolKeyName( const XubString&, USHORT ) +String SvpSalFrame::GetSymbolKeyName( const XubString&, sal_uInt16 ) { return String(); } -BOOL SvpSalFrame::MapUnicodeToKeyCode( sal_Unicode, LanguageType, KeyCode& ) +sal_Bool SvpSalFrame::MapUnicodeToKeyCode( sal_Unicode, LanguageType, KeyCode& ) { - return FALSE; + return sal_False; } LanguageType SvpSalFrame::GetInputLanguage() @@ -435,7 +435,7 @@ void SvpSalFrame::ResetClipRegion() { } -void SvpSalFrame::BeginSetClipRegion( ULONG ) +void SvpSalFrame::BeginSetClipRegion( sal_uInt32 ) { } diff --git a/vcl/unx/headless/svpframe.hxx b/vcl/unx/headless/svpframe.hxx index de968bbf7a4a..b472a3e10103 100644 --- a/vcl/unx/headless/svpframe.hxx +++ b/vcl/unx/headless/svpframe.hxx @@ -42,7 +42,7 @@ class SvpSalFrame : public SalFrame, public SvpElement SvpSalInstance* m_pInstance; SvpSalFrame* m_pParent; // pointer to parent frame std::list< SvpSalFrame* > m_aChildren; // List of child frames - ULONG m_nStyle; + sal_uInt32 m_nStyle; bool m_bVisible; long m_nMinWidth; long m_nMinHeight; @@ -58,7 +58,7 @@ class SvpSalFrame : public SalFrame, public SvpElement public: SvpSalFrame( SvpSalInstance* pInstance, SalFrame* pParent, - ULONG nSalFrameStyle, + sal_uInt32 nSalFrameStyle, SystemParentData* pSystemParent = NULL ); virtual ~SvpSalFrame(); @@ -73,39 +73,39 @@ public: virtual SalGraphics* GetGraphics(); virtual void ReleaseGraphics( SalGraphics* pGraphics ); - virtual BOOL PostEvent( void* pData ); + virtual sal_Bool PostEvent( void* pData ); virtual void SetTitle( const XubString& rTitle ); - virtual void SetIcon( USHORT nIcon ); + virtual void SetIcon( sal_uInt16 nIcon ); virtual void SetMenu( SalMenu* pMenu ); virtual void DrawMenuBar(); virtual void SetExtendedFrameStyle( SalExtStyle nExtStyle ); - virtual void Show( BOOL bVisible, BOOL bNoActivate = FALSE ); - virtual void Enable( BOOL bEnable ); + virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate = sal_False ); + virtual void Enable( sal_Bool bEnable ); virtual void SetMinClientSize( long nWidth, long nHeight ); virtual void SetMaxClientSize( long nWidth, long nHeight ); - virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags ); + virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ); virtual void GetClientSize( long& rWidth, long& rHeight ); virtual void GetWorkArea( Rectangle& rRect ); virtual SalFrame* GetParent() const; virtual void SetWindowState( const SalFrameState* pState ); - virtual BOOL GetWindowState( SalFrameState* pState ); - virtual void ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay ); - virtual void StartPresentation( BOOL bStart ); - virtual void SetAlwaysOnTop( BOOL bOnTop ); - virtual void ToTop( USHORT nFlags ); + virtual sal_Bool GetWindowState( SalFrameState* pState ); + virtual void ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay ); + virtual void StartPresentation( sal_Bool bStart ); + virtual void SetAlwaysOnTop( sal_Bool bOnTop ); + virtual void ToTop( sal_uInt16 nFlags ); virtual void SetPointer( PointerStyle ePointerStyle ); - virtual void CaptureMouse( BOOL bMouse ); + virtual void CaptureMouse( sal_Bool bMouse ); virtual void SetPointerPos( long nX, long nY ); using SalFrame::Flush; virtual void Flush(); virtual void Sync(); virtual void SetInputContext( SalInputContext* pContext ); - virtual void EndExtTextInput( USHORT nFlags ); - virtual String GetKeyName( USHORT nKeyCode ); - virtual String GetSymbolKeyName( const XubString& rFontName, USHORT nKeyCode ); - virtual BOOL MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode ); + virtual void EndExtTextInput( sal_uInt16 nFlags ); + virtual String GetKeyName( sal_uInt16 nKeyCode ); + virtual String GetSymbolKeyName( const XubString& rFontName, sal_uInt16 nKeyCode ); + virtual sal_Bool MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode ); virtual LanguageType GetInputLanguage(); virtual SalBitmap* SnapShot(); virtual void UpdateSettings( AllSettings& rSettings ); @@ -116,7 +116,7 @@ public: virtual bool SetPluginParent( SystemParentData* pNewParent ); virtual void SetBackgroundBitmap( SalBitmap* pBitmap ); virtual void ResetClipRegion(); - virtual void BeginSetClipRegion( ULONG nRects ); + virtual void BeginSetClipRegion( sal_uInt32 nRects ); virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ); virtual void EndSetClipRegion(); diff --git a/vcl/unx/headless/svpgdi.cxx b/vcl/unx/headless/svpgdi.cxx index 68d8be7cb4eb..aa7f70ee1741 100644 --- a/vcl/unx/headless/svpgdi.cxx +++ b/vcl/unx/headless/svpgdi.cxx @@ -131,7 +131,7 @@ void SvpSalGraphics::GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ) rDPIX = rDPIY = 96; } -USHORT SvpSalGraphics::GetBitCount() +sal_uInt16 SvpSalGraphics::GetBitCount() { return SvpElement::getBitCountFromScanlineFormat( m_aDevice->getScanlineFormat() ); } @@ -152,7 +152,7 @@ void SvpSalGraphics::ResetClipRegion() m_aClipMap.reset(); } -void SvpSalGraphics::BeginSetClipRegion( ULONG n ) +void SvpSalGraphics::BeginSetClipRegion( sal_uInt32 n ) { if( n <= 1 ) { @@ -167,7 +167,7 @@ void SvpSalGraphics::BeginSetClipRegion( ULONG n ) } } -BOOL SvpSalGraphics::unionClipRegion( long nX, long nY, long nWidth, long nHeight ) +sal_Bool SvpSalGraphics::unionClipRegion( long nX, long nY, long nWidth, long nHeight ) { if( m_aClipMap ) { @@ -181,7 +181,7 @@ BOOL SvpSalGraphics::unionClipRegion( long nX, long nY, long nWidth, long nHeigh basegfx::B2IRange(nX,nY,nX+nWidth,nY+nHeight) ); } - return TRUE; + return sal_True; } bool SvpSalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& ) @@ -309,13 +309,13 @@ void SvpSalGraphics::drawRect( long nX, long nY, long nWidth, long nHeight ) dbgOut( m_aDevice ); } -void SvpSalGraphics::drawPolyLine( ULONG nPoints, const SalPoint* pPtAry ) +void SvpSalGraphics::drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ) { if( m_bUseLineColor && nPoints ) { B2DPolygon aPoly; aPoly.append( B2DPoint( pPtAry->mnX, pPtAry->mnY ), nPoints ); - for( ULONG i = 1; i < nPoints; i++ ) + for( sal_uInt32 i = 1; i < nPoints; i++ ) aPoly.setB2DPoint( i, B2DPoint( pPtAry[i].mnX, pPtAry[i].mnY ) ); aPoly.setClosed( false ); m_aDevice->drawPolygon( aPoly, m_aLineColor, m_aDrawMode, m_aClipMap ); @@ -323,13 +323,13 @@ void SvpSalGraphics::drawPolyLine( ULONG nPoints, const SalPoint* pPtAry ) dbgOut( m_aDevice ); } -void SvpSalGraphics::drawPolygon( ULONG nPoints, const SalPoint* pPtAry ) +void SvpSalGraphics::drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ) { if( ( m_bUseLineColor || m_bUseFillColor ) && nPoints ) { B2DPolygon aPoly; aPoly.append( B2DPoint( pPtAry->mnX, pPtAry->mnY ), nPoints ); - for( ULONG i = 1; i < nPoints; i++ ) + for( sal_uInt32 i = 1; i < nPoints; i++ ) aPoly.setB2DPoint( i, B2DPoint( pPtAry[i].mnX, pPtAry[i].mnY ) ); if( m_bUseFillColor ) { @@ -360,7 +360,7 @@ void SvpSalGraphics::drawPolyPolygon( sal_uInt32 nPoly, PCONSTSALPOINT pPoints = pPtAry[nPolygon]; B2DPolygon aPoly; aPoly.append( B2DPoint( pPoints->mnX, pPoints->mnY ), nPoints ); - for( ULONG i = 1; i < nPoints; i++ ) + for( sal_uInt32 i = 1; i < nPoints; i++ ) aPoly.setB2DPoint( i, B2DPoint( pPoints[i].mnX, pPoints[i].mnY ) ); aPolyPoly.append( aPoly ); @@ -388,16 +388,16 @@ bool SvpSalGraphics::drawPolyLine( const ::basegfx::B2DPolygon&, double /*fTrans return false; } -sal_Bool SvpSalGraphics::drawPolyLineBezier( ULONG, +sal_Bool SvpSalGraphics::drawPolyLineBezier( sal_uInt32, const SalPoint*, - const BYTE* ) + const sal_uInt8* ) { return sal_False; } -sal_Bool SvpSalGraphics::drawPolygonBezier( ULONG, +sal_Bool SvpSalGraphics::drawPolygonBezier( sal_uInt32, const SalPoint*, - const BYTE* ) + const sal_uInt8* ) { return sal_False; } @@ -405,7 +405,7 @@ sal_Bool SvpSalGraphics::drawPolygonBezier( ULONG, sal_Bool SvpSalGraphics::drawPolyPolygonBezier( sal_uInt32, const sal_uInt32*, const SalPoint* const*, - const BYTE* const* ) + const sal_uInt8* const* ) { return sal_False; } @@ -422,7 +422,7 @@ void SvpSalGraphics::copyArea( long nDestX, long nSrcY, long nSrcWidth, long nSrcHeight, - USHORT /*nFlags*/ ) + sal_uInt16 /*nFlags*/ ) { B2IRange aSrcRect( nSrcX, nSrcY, nSrcX+nSrcWidth, nSrcY+nSrcHeight ); B2IRange aDestRect( nDestX, nDestY, nDestX+nSrcWidth, nDestY+nSrcHeight ); @@ -538,21 +538,21 @@ void SvpSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalInv dbgOut( m_aDevice ); } -void SvpSalGraphics::invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert /*nFlags*/ ) +void SvpSalGraphics::invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalInvert /*nFlags*/ ) { // FIXME: handle SAL_INVERT_50 and SAL_INVERT_TRACKFRAME B2DPolygon aPoly; aPoly.append( B2DPoint( pPtAry->mnX, pPtAry->mnY ), nPoints ); - for( ULONG i = 1; i < nPoints; i++ ) + for( sal_uInt32 i = 1; i < nPoints; i++ ) aPoly.setB2DPoint( i, B2DPoint( pPtAry[i].mnX, pPtAry[i].mnY ) ); aPoly.setClosed( true ); m_aDevice->fillPolyPolygon( B2DPolyPolygon(aPoly), basebmp::Color( 0xffffff ), DrawMode_XOR, m_aClipMap ); dbgOut( m_aDevice ); } -BOOL SvpSalGraphics::drawEPS( long, long, long, long, void*, ULONG ) +sal_Bool SvpSalGraphics::drawEPS( long, long, long, long, void*, sal_uInt32 ) { - return FALSE; + return sal_False; } SystemFontData SvpSalGraphics::GetSysFontData( int nFallbacklevel ) const diff --git a/vcl/unx/headless/svpgdi.hxx b/vcl/unx/headless/svpgdi.hxx index 93ec080d0136..08efc7e846c1 100644 --- a/vcl/unx/headless/svpgdi.hxx +++ b/vcl/unx/headless/svpgdi.hxx @@ -64,12 +64,12 @@ public: // overload all pure virtual methods virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ); - virtual USHORT GetBitCount(); + virtual sal_uInt16 GetBitCount(); virtual long GetGraphicsWidth() const; virtual void ResetClipRegion(); - virtual void BeginSetClipRegion( ULONG nCount ); - virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight ); + virtual void BeginSetClipRegion( sal_uInt32 nCount ); + virtual sal_Bool unionClipRegion( long nX, long nY, long nWidth, long nHeight ); virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& ); virtual void EndSetClipRegion(); @@ -77,7 +77,7 @@ public: virtual void SetLineColor( SalColor nSalColor ); virtual void SetFillColor(); - virtual void SetFillColor( SalColor nSalColor ); + virtual void SetFillColor( SalColor nSalColor ); virtual void SetXORMode( bool bSet, bool ); @@ -85,14 +85,14 @@ public: virtual void SetROPFillColor( SalROPColor nROPColor ); virtual void SetTextColor( SalColor nSalColor ); - virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel ); + virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel ); virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); - virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs ); + virtual sal_uInt32 GetKernPairs( sal_uInt32 nPairs, ImplKernPairData* pKernPairs ); virtual const ImplFontCharMap* GetImplFontCharMap() const; virtual void GetDevFontList( ImplDevFontList* ); virtual void GetDevFontSubstList( OutputDevice* ); virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName ); - virtual BOOL CreateFontSubset( const rtl::OUString& rToFile, + virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile, const ImplFontData*, sal_Int32* pGlyphIDs, sal_uInt8* pEncoding, @@ -111,8 +111,8 @@ public: bool bVertical, Int32Vector& rWidths, Ucs2UIntMap& rUnicodeEnc ); - virtual BOOL GetGlyphBoundRect( long nIndex, Rectangle& ); - virtual BOOL GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& ); + virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& ); + virtual sal_Bool GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& ); virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ); virtual void DrawServerFontLayout( const ServerFontLayout& ); virtual bool supportsOperation( OutDevSupportType ) const; @@ -122,21 +122,21 @@ public: virtual void drawRect( long nX, long nY, long nWidth, long nHeight ); virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ); virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ); - virtual void drawPolyLine( ULONG nPoints, const SalPoint* pPtAry ); - virtual void drawPolygon( ULONG nPoints, const SalPoint* pPtAry ); + virtual void drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ); + virtual void drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ); virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ); - virtual sal_Bool drawPolyLineBezier( ULONG nPoints, + virtual sal_Bool drawPolyLineBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, - const BYTE* pFlgAry ); - virtual sal_Bool drawPolygonBezier( ULONG nPoints, + const sal_uInt8* pFlgAry ); + virtual sal_Bool drawPolygonBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, - const BYTE* pFlgAry ); + const sal_uInt8* pFlgAry ); virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt32* pPoints, const SalPoint* const* pPtAry, - const BYTE* const* pFlgAry ); + const sal_uInt8* const* pFlgAry ); virtual void copyArea( long nDestX, long nDestY, @@ -144,7 +144,7 @@ public: long nSrcY, long nSrcWidth, long nSrcHeight, - USHORT nFlags ); + sal_uInt16 nFlags ); virtual void copyBits( const SalTwoRect* pPosAry, SalGraphics* pSrcGraphics ); virtual void drawBitmap( const SalTwoRect* pPosAry, @@ -161,9 +161,9 @@ public: virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight ); virtual SalColor getPixel( long nX, long nY ); virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags ); - virtual void invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags ); + virtual void invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalInvert nFlags ); - virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize ); + virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uInt32 nSize ); virtual SystemGraphicsData GetGraphicsData() const; virtual SystemFontData GetSysFontData( int nFallbacklevel ) const; diff --git a/vcl/unx/headless/svpinst.cxx b/vcl/unx/headless/svpinst.cxx index fc788b2a0530..f2c3f671c4fd 100644 --- a/vcl/unx/headless/svpinst.cxx +++ b/vcl/unx/headless/svpinst.cxx @@ -122,7 +122,7 @@ SvpSalInstance::~SvpSalInstance() osl_destroyMutex( m_aEventGuard ); } -void SvpSalInstance::PostEvent( const SalFrame* pFrame, void* pData, USHORT nEvent ) +void SvpSalInstance::PostEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent ) { if( osl_acquireMutex( m_aEventGuard ) ) { @@ -132,7 +132,7 @@ void SvpSalInstance::PostEvent( const SalFrame* pFrame, void* pData, USHORT nEve Wakeup(); } -void SvpSalInstance::CancelEvent( const SalFrame* pFrame, void* pData, USHORT nEvent ) +void SvpSalInstance::CancelEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent ) { if( osl_acquireMutex( m_aEventGuard ) ) { @@ -192,7 +192,7 @@ inline int operator >= ( const timeval &t1, const timeval &t2 ) return t1.tv_usec >= t2.tv_usec; return t1.tv_sec > t2.tv_sec; } -inline timeval &operator += ( timeval &t1, ULONG t2 ) +inline timeval &operator += ( timeval &t1, sal_uInt32 t2 ) { t1.tv_sec += t2 / 1000; t1.tv_usec += t2 ? (t2 % 1000) * 1000 : 500; @@ -235,12 +235,12 @@ bool SvpSalInstance::CheckTimeout( bool bExecuteTimers ) return bRet; } -SalFrame* SvpSalInstance::CreateChildFrame( SystemParentData* pParent, ULONG nStyle ) +SalFrame* SvpSalInstance::CreateChildFrame( SystemParentData* pParent, sal_uInt32 nStyle ) { return new SvpSalFrame( this, NULL, nStyle, pParent ); } -SalFrame* SvpSalInstance::CreateFrame( SalFrame* pParent, ULONG nStyle ) +SalFrame* SvpSalInstance::CreateFrame( SalFrame* pParent, sal_uInt32 nStyle ) { return new SvpSalFrame( this, pParent, nStyle ); } @@ -250,7 +250,7 @@ void SvpSalInstance::DestroyFrame( SalFrame* pFrame ) delete pFrame; } -SalObject* SvpSalInstance::CreateObject( SalFrame*, SystemWindowData*, BOOL ) +SalObject* SvpSalInstance::CreateObject( SalFrame*, SystemWindowData*, sal_Bool ) { return new SvpSalObject(); } @@ -262,7 +262,7 @@ void SvpSalInstance::DestroyObject( SalObject* pObject ) SalVirtualDevice* SvpSalInstance::CreateVirtualDevice( SalGraphics*, long nDX, long nDY, - USHORT nBitCount, const SystemGraphicsData* ) + sal_uInt16 nBitCount, const SystemGraphicsData* ) { SvpSalVirtualDevice* pNew = new SvpSalVirtualDevice( nBitCount ); pNew->SetSize( nDX, nDY ); @@ -299,13 +299,13 @@ vos::IMutex* SvpSalInstance::GetYieldMutex() return &m_aYieldMutex; } -ULONG SvpSalInstance::ReleaseYieldMutex() +sal_uInt32 SvpSalInstance::ReleaseYieldMutex() { if ( m_aYieldMutex.GetThreadId() == vos::OThread::getCurrentIdentifier() ) { - ULONG nCount = m_aYieldMutex.GetAcquireCount(); - ULONG n = nCount; + sal_uInt32 nCount = m_aYieldMutex.GetAcquireCount(); + sal_uInt32 n = nCount; while ( n ) { m_aYieldMutex.release(); @@ -318,7 +318,7 @@ ULONG SvpSalInstance::ReleaseYieldMutex() return 0; } -void SvpSalInstance::AcquireYieldMutex( ULONG nCount ) +void SvpSalInstance::AcquireYieldMutex( sal_uInt32 nCount ) { while ( nCount ) { @@ -346,7 +346,7 @@ void SvpSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents ) // release yield mutex std::list< SalUserEvent > aEvents; - ULONG nAcquireCount = ReleaseYieldMutex(); + sal_uInt32 nAcquireCount = ReleaseYieldMutex(); if( osl_acquireMutex( m_aEventGuard ) ) { if( ! m_aUserEvents.empty() ) @@ -425,7 +425,7 @@ void SvpSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents ) } } -bool SvpSalInstance::AnyInput( USHORT nType ) +bool SvpSalInstance::AnyInput( sal_uInt16 nType ) { if( (nType & INPUT_TIMER) != 0 ) return CheckTimeout( false ); @@ -497,7 +497,7 @@ void SvpSalInstance::StopTimer() m_nTimeoutMS = 0; } -void SvpSalInstance::StartTimer( ULONG nMS ) +void SvpSalInstance::StartTimer( sal_uInt32 nMS ) { timeval Timeout (m_aTimeout); // previous timeout. gettimeofday (&m_aTimeout, 0); @@ -525,7 +525,7 @@ void SvpSalTimer::Stop() m_pInstance->StopTimer(); } -void SvpSalTimer::Start( ULONG nMS ) +void SvpSalTimer::Start( sal_uInt32 nMS ) { m_pInstance->StartTimer( nMS ); } diff --git a/vcl/unx/headless/svpinst.hxx b/vcl/unx/headless/svpinst.hxx index 02d5e3fa9494..b7b311b2e32d 100644 --- a/vcl/unx/headless/svpinst.hxx +++ b/vcl/unx/headless/svpinst.hxx @@ -49,7 +49,7 @@ class SvpSalYieldMutex : public vos::OMutex { protected: - ULONG mnCount; + sal_uInt32 mnCount; vos::OThread::TThreadIdentifier mnThreadId; public: @@ -59,7 +59,7 @@ public: virtual void release(); virtual sal_Bool tryToAcquire(); - ULONG GetAcquireCount() const { return mnCount; } + sal_uInt32 GetAcquireCount() const { return mnCount; } vos::OThread::TThreadIdentifier GetThreadId() const { return mnThreadId; } }; @@ -75,7 +75,7 @@ public: virtual ~SvpSalTimer(); // overload all pure virtual methods - virtual void Start( ULONG nMS ); + virtual void Start( sal_uInt32 nMS ); virtual void Stop(); }; @@ -86,7 +86,7 @@ class SvpSalFrame; class SvpSalInstance : public SalInstance { timeval m_aTimeout; - ULONG m_nTimeoutMS; + sal_uInt32 m_nTimeoutMS; int m_pTimeoutFDS[2]; SvpSalYieldMutex m_aYieldMutex; @@ -95,9 +95,9 @@ class SvpSalInstance : public SalInstance { const SalFrame* m_pFrame; void* m_pData; - USHORT m_nEvent; + sal_uInt16 m_nEvent; - SalUserEvent( const SalFrame* pFrame, void* pData, USHORT nEvent = SALEVENT_USEREVENT ) + SalUserEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent = SALEVENT_USEREVENT ) : m_pFrame( pFrame ), m_pData( pData ), m_nEvent( nEvent ) @@ -117,10 +117,10 @@ public: SvpSalInstance(); virtual ~SvpSalInstance(); - void PostEvent( const SalFrame* pFrame, void* pData, USHORT nEvent ); - void CancelEvent( const SalFrame* pFrame, void* pData, USHORT nEvent ); + void PostEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent ); + void CancelEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent ); - void StartTimer( ULONG nMS ); + void StartTimer( sal_uInt32 nMS ); void StopTimer(); void Wakeup(); @@ -131,12 +131,12 @@ public: bool CheckTimeout( bool bExecuteTimers = true ); // Frame - virtual SalFrame* CreateChildFrame( SystemParentData* pParent, ULONG nStyle ); - virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle ); + virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uInt32 nStyle ); + virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uInt32 nStyle ); virtual void DestroyFrame( SalFrame* pFrame ); // Object (System Child Window) - virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow = TRUE ); + virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True ); virtual void DestroyObject( SalObject* pObject ); // VirtualDevice @@ -145,7 +145,7 @@ public: // pData allows for using a system dependent graphics or device context virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics, long nDX, long nDY, - USHORT nBitCount, const SystemGraphicsData *pData = NULL ); + sal_uInt16 nBitCount, const SystemGraphicsData *pData = NULL ); virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice ); // Printer @@ -174,15 +174,15 @@ public: // YieldMutex virtual vos::IMutex* GetYieldMutex(); - virtual ULONG ReleaseYieldMutex(); - virtual void AcquireYieldMutex( ULONG nCount ); + virtual sal_uInt32 ReleaseYieldMutex(); + virtual void AcquireYieldMutex( sal_uInt32 nCount ); virtual bool CheckYieldMutex(); // wait next event and dispatch // must returned by UserEvent (SalFrame::PostEvent) // and timer virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ); - virtual bool AnyInput( USHORT nType ); + virtual bool AnyInput( sal_uInt16 nType ); // may return NULL to disable session management virtual SalSession* CreateSalSession(); diff --git a/vcl/unx/headless/svpprn.cxx b/vcl/unx/headless/svpprn.cxx index 5b461bb996ef..21b5e20af51d 100644 --- a/vcl/unx/headless/svpprn.cxx +++ b/vcl/unx/headless/svpprn.cxx @@ -159,7 +159,7 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData ) if( rData.getStreamBuffer( pBuffer, nBytes ) ) { pJobSetup->mnDriverDataLen = nBytes; - pJobSetup->mpDriverData = (BYTE*)pBuffer; + pJobSetup->mpDriverData = (sal_uInt8*)pBuffer; } else { @@ -518,9 +518,9 @@ void PspSalInfoPrinter::ReleaseGraphics( SalGraphics* pGraphics ) // ----------------------------------------------------------------------- -BOOL PspSalInfoPrinter::Setup( SalFrame*, ImplJobSetup* ) +sal_Bool PspSalInfoPrinter::Setup( SalFrame*, ImplJobSetup* ) { - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -530,7 +530,7 @@ BOOL PspSalInfoPrinter::Setup( SalFrame*, ImplJobSetup* ) // data should be merged into the driver data // If pJobSetup->mpDriverData IS NULL, then the driver defaults // should be merged into the independent data -BOOL PspSalInfoPrinter::SetPrinterData( ImplJobSetup* pJobSetup ) +sal_Bool PspSalInfoPrinter::SetPrinterData( ImplJobSetup* pJobSetup ) { if( pJobSetup->mpDriverData ) return SetData( ~0, pJobSetup ); @@ -548,7 +548,7 @@ BOOL PspSalInfoPrinter::SetPrinterData( ImplJobSetup* pJobSetup ) } m_aPrinterGfx.setStrictSO52Compatibility( bStrictSO52Compatibility ); - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- @@ -557,8 +557,8 @@ BOOL PspSalInfoPrinter::SetPrinterData( ImplJobSetup* pJobSetup ) // and sets the new independ data in pJobSetup // Only the data must be changed, where the bit // in nGetDataFlags is set -BOOL PspSalInfoPrinter::SetData( - ULONG nSetDataFlags, +sal_Bool PspSalInfoPrinter::SetData( + sal_uInt32 nSetDataFlags, ImplJobSetup* pJobSetup ) { JobData aData; @@ -595,7 +595,7 @@ BOOL PspSalInfoPrinter::SetData( pKey = aData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) ); pValue = pKey ? pKey->getValue( aPaper ) : NULL; if( ! ( pKey && pValue && aData.m_aContext.setValue( pKey, pValue, false ) == pValue ) ) - return FALSE; + return sal_False; } // merge paperbin if necessary @@ -655,10 +655,10 @@ BOOL PspSalInfoPrinter::SetData( m_aJobData = aData; copyJobDataToJobSetup( pJobSetup, aData ); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -707,7 +707,7 @@ void PspSalInfoPrinter::GetPageInfo( // ----------------------------------------------------------------------- -ULONG PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup ) +sal_uInt32 PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup ) { if( ! pJobSetup ) return 0; @@ -721,7 +721,7 @@ ULONG PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup ) // ----------------------------------------------------------------------- -String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, ULONG nPaperBin ) +String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, sal_uInt32 nPaperBin ) { JobData aData; JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData ); @@ -745,7 +745,7 @@ String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, ULONG // ----------------------------------------------------------------------- -ULONG PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, USHORT nType ) +sal_uInt32 PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, sal_uInt16 nType ) { switch( nType ) { @@ -841,11 +841,11 @@ static String getTmpName() return aSys; } -BOOL PspSalPrinter::StartJob( +sal_Bool PspSalPrinter::StartJob( const XubString* pFileName, const XubString& rJobName, const XubString& rAppName, - ULONG nCopies, + sal_uInt32 nCopies, bool bCollate, bool /*bDirect*/, ImplJobSetup* pJobSetup ) @@ -920,14 +920,14 @@ BOOL PspSalPrinter::StartJob( } m_aPrinterGfx.setStrictSO52Compatibility( bStrictSO52Compatibility ); - return m_aPrintJob.StartJob( m_aTmpFile.Len() ? m_aTmpFile : m_aFileName, nMode, rJobName, rAppName, m_aJobData, &m_aPrinterGfx, false ) ? TRUE : FALSE; + return m_aPrintJob.StartJob( m_aTmpFile.Len() ? m_aTmpFile : m_aFileName, nMode, rJobName, rAppName, m_aJobData, &m_aPrinterGfx, false ) ? sal_True : sal_False; } // ----------------------------------------------------------------------- -BOOL PspSalPrinter::EndJob() +sal_Bool PspSalPrinter::EndJob() { - BOOL bSuccess = m_aPrintJob.EndJob(); + sal_Bool bSuccess = m_aPrintJob.EndJob(); if( bSuccess ) { @@ -951,16 +951,16 @@ BOOL PspSalPrinter::EndJob() // ----------------------------------------------------------------------- -BOOL PspSalPrinter::AbortJob() +sal_Bool PspSalPrinter::AbortJob() { - BOOL bAbort = m_aPrintJob.AbortJob() ? TRUE : FALSE; + sal_Bool bAbort = m_aPrintJob.AbortJob() ? sal_True : sal_False; vcl_sal::PrinterUpdate::jobEnded(); return bAbort; } // ----------------------------------------------------------------------- -SalGraphics* PspSalPrinter::StartPage( ImplJobSetup* pJobSetup, BOOL ) +SalGraphics* PspSalPrinter::StartPage( ImplJobSetup* pJobSetup, sal_Bool ) { JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, m_aJobData ); m_pGraphics = new PspGraphics( &m_aJobData, &m_aPrinterGfx, m_bFax ? &m_aFaxNr : NULL, m_bSwallowFaxNo, m_pInfoPrinter ); @@ -981,16 +981,16 @@ SalGraphics* PspSalPrinter::StartPage( ImplJobSetup* pJobSetup, BOOL ) // ----------------------------------------------------------------------- -BOOL PspSalPrinter::EndPage() +sal_Bool PspSalPrinter::EndPage() { sal_Bool bResult = m_aPrintJob.EndPage(); m_aPrinterGfx.Clear(); - return bResult ? TRUE : FALSE; + return bResult ? sal_True : sal_False; } // ----------------------------------------------------------------------- -ULONG PspSalPrinter::GetErrorCode() +sal_uInt32 PspSalPrinter::GetErrorCode() { return 0; } diff --git a/vcl/unx/headless/svpprn.hxx b/vcl/unx/headless/svpprn.hxx index 0da506076908..440c5b31cd52 100644 --- a/vcl/unx/headless/svpprn.hxx +++ b/vcl/unx/headless/svpprn.hxx @@ -48,16 +48,16 @@ public: // overload all pure virtual methods virtual SalGraphics* GetGraphics(); virtual void ReleaseGraphics( SalGraphics* pGraphics ); - virtual BOOL Setup( SalFrame* pFrame, ImplJobSetup* pSetupData ); - virtual BOOL SetPrinterData( ImplJobSetup* pSetupData ); - virtual BOOL SetData( ULONG nFlags, ImplJobSetup* pSetupData ); + virtual sal_Bool Setup( SalFrame* pFrame, ImplJobSetup* pSetupData ); + virtual sal_Bool SetPrinterData( ImplJobSetup* pSetupData ); + virtual sal_Bool SetData( sal_uInt32 nFlags, ImplJobSetup* pSetupData ); virtual void GetPageInfo( const ImplJobSetup* pSetupData, long& rOutWidth, long& rOutHeight, long& rPageOffX, long& rPageOffY, long& rPageWidth, long& rPageHeight ); - virtual ULONG GetCapabilities( const ImplJobSetup* pSetupData, USHORT nType ); - virtual ULONG GetPaperBinCount( const ImplJobSetup* pSetupData ); - virtual String GetPaperBinName( const ImplJobSetup* pSetupData, ULONG nPaperBin ); + virtual sal_uInt32 GetCapabilities( const ImplJobSetup* pSetupData, sal_uInt16 nType ); + virtual sal_uInt32 GetPaperBinCount( const ImplJobSetup* pSetupData ); + virtual String GetPaperBinName( const ImplJobSetup* pSetupData, sal_uInt32 nPaperBin ); virtual void InitPaperFormats( const ImplJobSetup* pSetupData ); virtual int GetLandscapeAngle( const ImplJobSetup* pSetupData ); }; @@ -75,7 +75,7 @@ public: psp::PrinterJob m_aPrintJob; psp::JobData m_aJobData; psp::PrinterGfx m_aPrinterGfx; - ULONG m_nCopies; + sal_uInt32 m_nCopies; bool m_bCollate; SalInfoPrinter* m_pInfoPrinter; @@ -84,18 +84,18 @@ public: // overload all pure virtual methods using SalPrinter::StartJob; - virtual BOOL StartJob( const XubString* pFileName, + virtual sal_Bool StartJob( const XubString* pFileName, const XubString& rJobName, const XubString& rAppName, - ULONG nCopies, + sal_uInt32 nCopies, bool bCollate, bool bDirect, ImplJobSetup* pSetupData ); - virtual BOOL EndJob(); - virtual BOOL AbortJob(); - virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, BOOL bNewJobData ); - virtual BOOL EndPage(); - virtual ULONG GetErrorCode(); + virtual sal_Bool EndJob(); + virtual sal_Bool AbortJob(); + virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, sal_Bool bNewJobData ); + virtual sal_Bool EndPage(); + virtual sal_uInt32 GetErrorCode(); }; class Timer; diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx index c7b1f4f41fca..f0067f1677f3 100644 --- a/vcl/unx/headless/svppspgraphics.cxx +++ b/vcl/unx/headless/svppspgraphics.cxx @@ -204,7 +204,7 @@ void PspGraphics::GetResolution( sal_Int32 &rDPIX, sal_Int32 &rDPIY ) } } -USHORT PspGraphics::GetBitCount() +sal_uInt16 PspGraphics::GetBitCount() { return m_pPrinterGfx->GetBitCount(); } @@ -219,14 +219,14 @@ void PspGraphics::ResetClipRegion() m_pPrinterGfx->ResetClipRegion (); } -void PspGraphics::BeginSetClipRegion( ULONG n ) +void PspGraphics::BeginSetClipRegion( sal_uInt32 n ) { m_pPrinterGfx->BeginSetClipRegion(n); } -BOOL PspGraphics::unionClipRegion( long nX, long nY, long nDX, long nDY ) +sal_Bool PspGraphics::unionClipRegion( long nX, long nY, long nDX, long nDY ) { - return (BOOL)m_pPrinterGfx->UnionClipRegion (nX, nY, nDX, nDY); + return (sal_Bool)m_pPrinterGfx->UnionClipRegion (nX, nY, nDX, nDY); } bool PspGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& ) @@ -305,12 +305,12 @@ void PspGraphics::drawRect( long nX, long nY, long nDX, long nDY ) m_pPrinterGfx->DrawRect (Rectangle(Point(nX, nY), Size(nDX, nDY))); } -void PspGraphics::drawPolyLine( ULONG nPoints, const SalPoint *pPtAry ) +void PspGraphics::drawPolyLine( sal_uInt32 nPoints, const SalPoint *pPtAry ) { m_pPrinterGfx->DrawPolyLine (nPoints, (Point*)pPtAry); } -void PspGraphics::drawPolygon( ULONG nPoints, const SalPoint* pPtAry ) +void PspGraphics::drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ) { // Point must be equal to SalPoint! see vcl/inc/salgtype.hxx m_pPrinterGfx->DrawPolygon (nPoints, (Point*)pPtAry); @@ -329,13 +329,13 @@ bool PspGraphics::drawPolyLine( const ::basegfx::B2DPolygon&, double /*fTranspar return false; } -sal_Bool PspGraphics::drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ) +sal_Bool PspGraphics::drawPolyLineBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ) { m_pPrinterGfx->DrawPolyLineBezier (nPoints, (Point*)pPtAry, pFlgAry); return sal_True; } -sal_Bool PspGraphics::drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ) +sal_Bool PspGraphics::drawPolygonBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ) { m_pPrinterGfx->DrawPolygonBezier (nPoints, (Point*)pPtAry, pFlgAry); return sal_True; @@ -344,10 +344,10 @@ sal_Bool PspGraphics::drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, sal_Bool PspGraphics::drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt32* pPoints, const SalPoint* const* pPtAry, - const BYTE* const* pFlgAry ) + const sal_uInt8* const* pFlgAry ) { // Point must be equal to SalPoint! see vcl/inc/salgtype.hxx - m_pPrinterGfx->DrawPolyPolygonBezier (nPoly, pPoints, (Point**)pPtAry, (BYTE**)pFlgAry); + m_pPrinterGfx->DrawPolyPolygonBezier (nPoly, pPoints, (Point**)pPtAry, (sal_uInt8**)pFlgAry); return sal_True; } @@ -357,13 +357,13 @@ bool PspGraphics::drawPolyPolygon( const basegfx::B2DPolyPolygon&, double /*fTra return false; } -void PspGraphics::invert( ULONG /*nPoints*/, +void PspGraphics::invert( sal_uInt32 /*nPoints*/, const SalPoint* /*pPtAry*/, SalInvert /*nFlags*/ ) { DBG_ASSERT( 0, "Error: PrinterGfx::Invert() not implemented" ); } -BOOL PspGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize ) +sal_Bool PspGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uInt32 nSize ) { return m_pPrinterGfx->DrawEPS( Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) ), pPtr, nSize ); } @@ -377,7 +377,7 @@ void PspGraphics::copyBits( const SalTwoRect* /*pPosAry*/, void PspGraphics::copyArea ( long /*nDestX*/, long /*nDestY*/, long /*nSrcX*/, long /*nSrcY*/, long /*nSrcWidth*/, long /*nSrcHeight*/, - USHORT /*nFlags*/ ) + sal_uInt16 /*nFlags*/ ) { DBG_ERROR( "Error: PrinterGfx::CopyArea() not implemented" ); } @@ -692,7 +692,7 @@ const ImplFontCharMap* PspGraphics::GetImplFontCharMap() const return pIFCMap; } -USHORT PspGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel ) +sal_uInt16 PspGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel ) { // release all fonts that are to be overridden for( int i = nFallbackLevel; i < MAX_FALLBACK; ++i ) @@ -817,10 +817,10 @@ void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric, int ) } } -ULONG PspGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData *pKernPairs ) +sal_uInt32 PspGraphics::GetKernPairs( sal_uInt32 nPairs, ImplKernPairData *pKernPairs ) { const ::std::list< ::psp::KernPair >& rPairs( m_pPrinterGfx->getKernPairs() ); - ULONG nHavePairs = rPairs.size(); + sal_uInt32 nHavePairs = rPairs.size(); if( pKernPairs && nPairs ) { ::std::list< ::psp::KernPair >::const_iterator it; @@ -839,38 +839,38 @@ ULONG PspGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData *pKernPairs ) return nHavePairs; } -BOOL PspGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect ) +sal_Bool PspGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect ) { int nLevel = nGlyphIndex >> GF_FONTSHIFT; if( nLevel >= MAX_FALLBACK ) - return FALSE; + return sal_False; ServerFont* pSF = m_pServerFont[ nLevel ]; if( !pSF ) - return FALSE; + return sal_False; nGlyphIndex &= ~GF_FONTMASK; const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex ); rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() ); - return TRUE; + return sal_True; } -BOOL PspGraphics::GetGlyphOutline( long nGlyphIndex, +sal_Bool PspGraphics::GetGlyphOutline( long nGlyphIndex, ::basegfx::B2DPolyPolygon& rB2DPolyPoly ) { int nLevel = nGlyphIndex >> GF_FONTSHIFT; if( nLevel >= MAX_FALLBACK ) - return FALSE; + return sal_False; ServerFont* pSF = m_pServerFont[ nLevel ]; if( !pSF ) - return FALSE; + return sal_False; nGlyphIndex &= ~GF_FONTMASK; if( pSF->GetGlyphOutline( nGlyphIndex, rB2DPolyPoly ) ) - return TRUE; + return sal_True; - return FALSE; + return sal_False; } SalLayout* PspGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLevel ) @@ -895,7 +895,7 @@ SalLayout* PspGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLevel //-------------------------------------------------------------------------- -BOOL PspGraphics::CreateFontSubset( +sal_Bool PspGraphics::CreateFontSubset( const rtl::OUString& rToFile, const ImplFontData* pFont, sal_Int32* pGlyphIDs, @@ -1281,9 +1281,9 @@ bool PspGraphics::filterText( const String& rOrig, String& rNewText, xub_StrLen bool bRet = false; bool bStarted = false; bool bStopped = false; - USHORT nPos; - USHORT nStart = 0; - USHORT nStop = rLen; + sal_uInt16 nPos; + sal_uInt16 nStart = 0; + sal_uInt16 nStop = rLen; String aPhone = rOrig.Copy( nIndex, rLen ); if( ! m_bPhoneCollectionActive ) diff --git a/vcl/unx/headless/svppspgraphics.hxx b/vcl/unx/headless/svppspgraphics.hxx index 138198239621..666dc942739a 100644 --- a/vcl/unx/headless/svppspgraphics.hxx +++ b/vcl/unx/headless/svppspgraphics.hxx @@ -86,12 +86,12 @@ public: // overload all pure virtual methods virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ); - virtual USHORT GetBitCount(); + virtual sal_uInt16 GetBitCount(); virtual long GetGraphicsWidth() const; virtual void ResetClipRegion(); - virtual void BeginSetClipRegion( ULONG nCount ); - virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight ); + virtual void BeginSetClipRegion( sal_uInt32 nCount ); + virtual sal_Bool unionClipRegion( long nX, long nY, long nWidth, long nHeight ); virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& ); virtual void EndSetClipRegion(); @@ -104,14 +104,14 @@ public: virtual void SetROPFillColor( SalROPColor nROPColor ); virtual void SetTextColor( SalColor nSalColor ); - virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel ); + virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel ); virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); - virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs ); + virtual sal_uInt32 GetKernPairs( sal_uInt32 nPairs, ImplKernPairData* pKernPairs ); virtual const ImplFontCharMap* GetImplFontCharMap() const; virtual void GetDevFontList( ImplDevFontList* ); virtual void GetDevFontSubstList( OutputDevice* ); virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName ); - virtual BOOL CreateFontSubset( const rtl::OUString& rToFile, + virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile, const ImplFontData*, sal_Int32* pGlyphIDs, sal_uInt8* pEncoding, @@ -130,8 +130,8 @@ public: bool bVertical, Int32Vector& rWidths, Ucs2UIntMap& rUnicodeEnc ); - virtual BOOL GetGlyphBoundRect( long nIndex, Rectangle& ); - virtual BOOL GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& ); + virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& ); + virtual sal_Bool GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& ); virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ); virtual void DrawServerFontLayout( const ServerFontLayout& ); virtual bool supportsOperation( OutDevSupportType ) const; @@ -139,23 +139,23 @@ public: virtual void drawPixel( long nX, long nY, SalColor nSalColor ); virtual void drawLine( long nX1, long nY1, long nX2, long nY2 ); virtual void drawRect( long nX, long nY, long nWidth, long nHeight ); - virtual void drawPolyLine( ULONG nPoints, const SalPoint* pPtAry ); - virtual void drawPolygon( ULONG nPoints, const SalPoint* pPtAry ); + virtual void drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ); + virtual void drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ); virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ); virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ); virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ); - virtual sal_Bool drawPolyLineBezier( ULONG nPoints, + virtual sal_Bool drawPolyLineBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, - const BYTE* pFlgAry ); - virtual sal_Bool drawPolygonBezier( ULONG nPoints, + const sal_uInt8* pFlgAry ); + virtual sal_Bool drawPolygonBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, - const BYTE* pFlgAry ); + const sal_uInt8* pFlgAry ); virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt32* pPoints, const SalPoint* const* pPtAry, - const BYTE* const* pFlgAry ); + const sal_uInt8* const* pFlgAry ); virtual void copyArea( long nDestX, long nDestY, @@ -163,7 +163,7 @@ public: long nSrcY, long nSrcWidth, long nSrcHeight, - USHORT nFlags ); + sal_uInt16 nFlags ); virtual void copyBits( const SalTwoRect* pPosAry, SalGraphics* pSrcGraphics ); virtual void drawBitmap( const SalTwoRect* pPosAry, @@ -180,9 +180,9 @@ public: virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight ); virtual SalColor getPixel( long nX, long nY ); virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags ); - virtual void invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags ); + virtual void invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalInvert nFlags ); - virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize ); + virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uInt32 nSize ); virtual bool filterText( const String& rOrigText, String& rNewText, xub_StrLen nIndex, xub_StrLen& rLen, xub_StrLen& rCutStart, xub_StrLen& rCutStop ); virtual SystemGraphicsData GetGraphicsData() const; diff --git a/vcl/unx/headless/svptext.cxx b/vcl/unx/headless/svptext.cxx index dff1fd4d6ca7..1ceba05bf87b 100644 --- a/vcl/unx/headless/svptext.cxx +++ b/vcl/unx/headless/svptext.cxx @@ -1,4 +1,4 @@ -/************************************************************************* +#/************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -204,7 +204,7 @@ void PspKernInfo::Initialize() const // =========================================================================== -USHORT SvpSalGraphics::SetFont( ImplFontSelectData* pIFSD, int nFallbackLevel ) +sal_uInt16 SvpSalGraphics::SetFont( ImplFontSelectData* pIFSD, int nFallbackLevel ) { // release all no longer needed font resources for( int i = nFallbackLevel; i < MAX_FALLBACK; ++i ) @@ -254,15 +254,15 @@ void SvpSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLe // --------------------------------------------------------------------------- -ULONG SvpSalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs ) +sal_uInt32 SvpSalGraphics::GetKernPairs( sal_uInt32 nPairs, ImplKernPairData* pKernPairs ) { - ULONG nGotPairs = 0; + sal_uInt32 nGotPairs = 0; if( m_pServerFont[0] != NULL ) { ImplKernPairData* pTmpKernPairs = NULL; nGotPairs = m_pServerFont[0]->GetKernPairs( &pTmpKernPairs ); - for( ULONG i = 0; i < nPairs && i < nGotPairs; ++i ) + for( sal_uInt32 i = 0; i < nPairs && i < nGotPairs; ++i ) pKernPairs[ i ] = pTmpKernPairs[ i ]; delete[] pTmpKernPairs; } @@ -339,7 +339,7 @@ bool SvpSalGraphics::AddTempDevFont( ImplDevFontList*, // --------------------------------------------------------------------------- -BOOL SvpSalGraphics::CreateFontSubset( +sal_Bool SvpSalGraphics::CreateFontSubset( const rtl::OUString& rToFile, const ImplFontData* pFont, sal_Int32* pGlyphIDs, @@ -422,39 +422,39 @@ void SvpSalGraphics::GetGlyphWidths( const ImplFontData* pFont, // --------------------------------------------------------------------------- -BOOL SvpSalGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect ) +sal_Bool SvpSalGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect ) { int nLevel = nGlyphIndex >> GF_FONTSHIFT; if( nLevel >= MAX_FALLBACK ) - return FALSE; + return sal_False; ServerFont* pSF = m_pServerFont[ nLevel ]; if( !pSF ) - return FALSE; + return sal_False; nGlyphIndex &= ~GF_FONTMASK; const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex ); rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() ); - return TRUE; + return sal_True; } // --------------------------------------------------------------------------- -BOOL SvpSalGraphics::GetGlyphOutline( long nGlyphIndex, B2DPolyPolygon& rPolyPoly ) +sal_Bool SvpSalGraphics::GetGlyphOutline( long nGlyphIndex, B2DPolyPolygon& rPolyPoly ) { int nLevel = nGlyphIndex >> GF_FONTSHIFT; if( nLevel >= MAX_FALLBACK ) - return FALSE; + return sal_False; const ServerFont* pSF = m_pServerFont[ nLevel ]; if( !pSF ) - return FALSE; + return sal_False; nGlyphIndex &= ~GF_FONTMASK; if( pSF->GetGlyphOutline( nGlyphIndex, rPolyPoly ) ) - return TRUE; + return sal_True; - return FALSE; + return sal_False; } // --------------------------------------------------------------------------- diff --git a/vcl/unx/headless/svpvd.cxx b/vcl/unx/headless/svpvd.cxx index 1c2ab01ccca2..4afbaefbfe7c 100644 --- a/vcl/unx/headless/svpvd.cxx +++ b/vcl/unx/headless/svpvd.cxx @@ -54,7 +54,7 @@ void SvpSalVirtualDevice::ReleaseGraphics( SalGraphics* pGraphics ) delete pGraphics; } -BOOL SvpSalVirtualDevice::SetSize( long nNewDX, long nNewDY ) +sal_Bool SvpSalVirtualDevice::SetSize( long nNewDX, long nNewDY ) { B2IVector aDevSize( nNewDX, nNewDY ); if( aDevSize.getX() == 0 ) diff --git a/vcl/unx/headless/svpvd.hxx b/vcl/unx/headless/svpvd.hxx index 083547cf19a9..784a2ad6f664 100644 --- a/vcl/unx/headless/svpvd.hxx +++ b/vcl/unx/headless/svpvd.hxx @@ -37,12 +37,12 @@ class SvpSalGraphics; class SvpSalVirtualDevice : public SalVirtualDevice, public SvpElement { - USHORT m_nBitCount; + sal_uInt16 m_nBitCount; basebmp::BitmapDeviceSharedPtr m_aDevice; std::list< SvpSalGraphics* > m_aGraphics; public: - SvpSalVirtualDevice( USHORT nBitCount ) : SvpElement(), m_nBitCount(nBitCount) {} + SvpSalVirtualDevice( sal_uInt16 nBitCount ) : SvpElement(), m_nBitCount(nBitCount) {} virtual ~SvpSalVirtualDevice(); // SvpElement @@ -52,7 +52,7 @@ public: virtual SalGraphics* GetGraphics(); virtual void ReleaseGraphics( SalGraphics* pGraphics ); - virtual BOOL SetSize( long nNewDX, long nNewDY ); + virtual sal_Bool SetSize( long nNewDX, long nNewDY ); virtual void GetSize( long& rWidth, long& rHeight ); }; diff --git a/vcl/unx/inc/i18n_cb.hxx b/vcl/unx/inc/i18n_cb.hxx index d2301c26a3b0..97fd7f1fb6c8 100644 --- a/vcl/unx/inc/i18n_cb.hxx +++ b/vcl/unx/inc/i18n_cb.hxx @@ -89,7 +89,7 @@ typedef struct { preedit_status_t eState; preedit_text_t aText; SalExtTextInputEvent aInputEv; - std::vector< USHORT > aInputFlags; + std::vector< sal_uInt16 > aInputFlags; } preedit_data_t; #endif /* _SAL_I18N_CALLBACK_HXX */ diff --git a/vcl/unx/inc/i18n_ic.hxx b/vcl/unx/inc/i18n_ic.hxx index 2fb97a00b6f2..977d7f3e3a6f 100644 --- a/vcl/unx/inc/i18n_ic.hxx +++ b/vcl/unx/inc/i18n_ic.hxx @@ -75,7 +75,7 @@ public: void HandleDestroyIM(); int HandleKeyEvent( XKeyEvent *pEvent, SalFrame *pFrame ); // unused - void EndExtTextInput( USHORT nFlags ); // unused + void EndExtTextInput( sal_uInt16 nFlags ); // unused int CommitStringCallback( sal_Unicode* pText, sal_Size nLength ); int CommitKeyEvent( sal_Unicode* pText, sal_Size nLength ); int UpdateSpotLocation(); diff --git a/vcl/unx/inc/plugins/gtk/gtkframe.hxx b/vcl/unx/inc/plugins/gtk/gtkframe.hxx index d47e5fb50fca..a623472df797 100644 --- a/vcl/unx/inc/plugins/gtk/gtkframe.hxx +++ b/vcl/unx/inc/plugins/gtk/gtkframe.hxx @@ -134,7 +134,7 @@ class GtkSalFrame : public SalFrame bool m_bFocused; bool m_bPreeditJustChanged; SalExtTextInputEvent m_aInputEvent; - std::vector< USHORT > m_aInputFlags; + std::vector< sal_uInt16 > m_aInputFlags; IMHandler( GtkSalFrame* ); ~IMHandler(); @@ -143,7 +143,7 @@ class GtkSalFrame : public SalFrame void deleteIMContext(); void updateIMSpotLocation(); void setInputContext( SalInputContext* pContext ); - void endExtTextInput( USHORT nFlags ); + void endExtTextInput( sal_uInt16 nFlags ); bool handleKeyEvent( GdkEventKey* pEvent ); void focusChanged( bool bFocusIn ); @@ -167,7 +167,7 @@ class GtkSalFrame : public SalFrame GdkWindow* m_pForeignTopLevel; GdkNativeWindow m_aForeignTopLevelWindow; Pixmap m_hBackgroundPixmap; - ULONG m_nStyle; + sal_uInt32 m_nStyle; SalExtStyle m_nExtStyle; GtkFixed* m_pFixedContainer; GtkSalFrame* m_pParent; @@ -175,7 +175,7 @@ class GtkSalFrame : public SalFrame GdkWindowState m_nState; SystemEnvData m_aSystemData; GraphicsHolder m_aGraphics[ nMaxGraphics ]; - USHORT m_nKeyModifiers; + sal_uInt16 m_nKeyModifiers; GdkCursor *m_pCurrentCursor; GdkVisibilityState m_nVisibility; PointerStyle m_ePointerStyle; @@ -199,7 +199,7 @@ class GtkSalFrame : public SalFrame GdkRegion* m_pRegion; - void Init( SalFrame* pParent, ULONG nStyle ); + void Init( SalFrame* pParent, sal_uInt32 nStyle ); void Init( SystemParentData* pSysData ); void InitCommon(); @@ -251,7 +251,7 @@ class GtkSalFrame : public SalFrame bool isChild( bool bPlug = true, bool bSysChild = true ) { - ULONG nMask = 0; + sal_uInt32 nMask = 0; if( bPlug ) nMask |= SAL_FRAME_STYLE_PLUG; if( bSysChild ) @@ -270,14 +270,14 @@ class GtkSalFrame : public SalFrame DECL_LINK( ImplDelayedFullScreenHdl, void* ); public: - GtkSalFrame( SalFrame* pParent, ULONG nStyle ); + GtkSalFrame( SalFrame* pParent, sal_uInt32 nStyle ); GtkSalFrame( SystemParentData* pSysData ); // dispatches an event, returns true if dispatched // and false else; if true was returned the event should // be swallowed bool Dispatch( const XEvent* pEvent ); - void grabPointer( BOOL bGrab, BOOL bOwnerEvents = FALSE ); + void grabPointer( sal_Bool bGrab, sal_Bool bOwnerEvents = sal_False ); GtkSalDisplay* getDisplay(); GdkDisplay* getGdkDisplay(); @@ -304,41 +304,41 @@ public: // Event must be destroyed, when Frame is destroyed // When Event is called, SalInstance::Yield() must be returned - virtual BOOL PostEvent( void* pData ); + virtual sal_Bool PostEvent( void* pData ); virtual void SetTitle( const XubString& rTitle ); - virtual void SetIcon( USHORT nIcon ); + virtual void SetIcon( sal_uInt16 nIcon ); virtual void SetMenu( SalMenu *pSalMenu ); virtual void DrawMenuBar(); virtual void SetExtendedFrameStyle( SalExtStyle nExtStyle ); // Before the window is visible, a resize event // must be sent with the correct size - virtual void Show( BOOL bVisible, BOOL bNoActivate = FALSE ); - virtual void Enable( BOOL bEnable ); + virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate = sal_False ); + virtual void Enable( sal_Bool bEnable ); // Set ClientSize and Center the Window to the desktop // and send/post a resize message virtual void SetMinClientSize( long nWidth, long nHeight ); virtual void SetMaxClientSize( long nWidth, long nHeight ); - virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags ); + virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ); virtual void GetClientSize( long& rWidth, long& rHeight ); virtual void GetWorkArea( Rectangle& rRect ); virtual SalFrame* GetParent() const; virtual void SetWindowState( const SalFrameState* pState ); - virtual BOOL GetWindowState( SalFrameState* pState ); - virtual void ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay ); + virtual sal_Bool GetWindowState( SalFrameState* pState ); + virtual void ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay ); // Enable/Disable ScreenSaver, SystemAgents, ... - virtual void StartPresentation( BOOL bStart ); + virtual void StartPresentation( sal_Bool bStart ); // Show Window over all other Windows - virtual void SetAlwaysOnTop( BOOL bOnTop ); + virtual void SetAlwaysOnTop( sal_Bool bOnTop ); // Window to top and grab focus - virtual void ToTop( USHORT nFlags ); + virtual void ToTop( sal_uInt16 nFlags ); // this function can call with the same // pointer style virtual void SetPointer( PointerStyle ePointerStyle ); - virtual void CaptureMouse( BOOL bMouse ); + virtual void CaptureMouse( sal_Bool bMouse ); virtual void SetPointerPos( long nX, long nY ); // flush output buffer @@ -348,11 +348,11 @@ public: virtual void Sync(); virtual void SetInputContext( SalInputContext* pContext ); - virtual void EndExtTextInput( USHORT nFlags ); + virtual void EndExtTextInput( sal_uInt16 nFlags ); - virtual String GetKeyName( USHORT nKeyCode ); - virtual String GetSymbolKeyName( const XubString& rFontName, USHORT nKeyCode ); - virtual BOOL MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode ); + virtual String GetKeyName( sal_uInt16 nKeyCode ); + virtual String GetSymbolKeyName( const XubString& rFontName, sal_uInt16 nKeyCode ); + virtual sal_Bool MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode ); // returns the input language used for the last key stroke // may be LANGUAGE_DONTKNOW if not supported by the OS @@ -386,7 +386,7 @@ public: // set clip region to none (-> rectangular windows, normal state) virtual void ResetClipRegion(); // start setting the clipregion consisting of nRects rectangles - virtual void BeginSetClipRegion( ULONG nRects ); + virtual void BeginSetClipRegion( sal_uInt32 nRects ); // add a rectangle to the clip region virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ); // done setting up the clipregion diff --git a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx index 38c79b3e11df..8fb17371d90c 100644 --- a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx +++ b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx @@ -55,23 +55,23 @@ public: // will be set when UI theme was changed - static BOOL bThemeChanged; - static BOOL bNeedPixmapPaint; - static BOOL bGlobalNeedPixmapPaint; - static BOOL bToolbarGripWorkaround; - static BOOL bNeedButtonStyleAsEditBackgroundWorkaround; + static sal_Bool bThemeChanged; + static sal_Bool bNeedPixmapPaint; + static sal_Bool bGlobalNeedPixmapPaint; + static sal_Bool bToolbarGripWorkaround; + static sal_Bool bNeedButtonStyleAsEditBackgroundWorkaround; // native widget methods - virtual BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart ); - virtual BOOL hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, - const Point& aPos, BOOL& rIsInside ); - virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, + virtual sal_Bool IsNativeControlSupported( ControlType nType, ControlPart nPart ); + virtual sal_Bool hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, + const Point& aPos, sal_Bool& rIsInside ); + virtual sal_Bool drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState, const ImplControlValue& aValue, const rtl::OUString& rCaption ); - virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, + virtual sal_Bool drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState, const ImplControlValue& aValue, const rtl::OUString& rCaption ); - virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState, + virtual sal_Bool getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState, const ImplControlValue& aValue, const rtl::OUString& rCaption, Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion ); @@ -79,8 +79,8 @@ public: void updateSettings( AllSettings& rSettings ); virtual void ResetClipRegion(); - virtual void BeginSetClipRegion( ULONG nCount ); - virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight ); + virtual void BeginSetClipRegion( sal_uInt32 nCount ); + virtual sal_Bool unionClipRegion( long nX, long nY, long nWidth, long nHeight ); virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& ); virtual void EndSetClipRegion(); @@ -95,85 +95,85 @@ protected: typedef std::list< Rectangle > clipList; GdkPixmap* NWGetPixmapFromScreen( Rectangle srcRect ); - BOOL NWRenderPixmapToScreen( GdkPixmap* pPixmap, Rectangle dstRect ); + sal_Bool NWRenderPixmapToScreen( GdkPixmap* pPixmap, Rectangle dstRect ); - BOOL NWPaintGTKButton( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, + sal_Bool NWPaintGTKButton( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, const OUString& rCaption ); - BOOL NWPaintGTKRadio( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, + sal_Bool NWPaintGTKRadio( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, const OUString& rCaption ); - BOOL NWPaintGTKCheck( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, + sal_Bool NWPaintGTKCheck( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, const OUString& rCaption ); - BOOL NWPaintGTKScrollbar( ControlType nType, ControlPart nPart, + sal_Bool NWPaintGTKScrollbar( ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, const OUString& rCaption ); - BOOL NWPaintGTKEditBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, + sal_Bool NWPaintGTKEditBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, const OUString& rCaption ); - BOOL NWPaintGTKSpinBox( ControlType nType, ControlPart nPart, + sal_Bool NWPaintGTKSpinBox( ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, const OUString& rCaption ); - BOOL NWPaintGTKComboBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, + sal_Bool NWPaintGTKComboBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, const OUString& rCaption ); - BOOL NWPaintGTKTabItem( ControlType nType, ControlPart nPart, + sal_Bool NWPaintGTKTabItem( ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, const OUString& rCaption ); - BOOL NWPaintGTKListBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, + sal_Bool NWPaintGTKListBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, const OUString& rCaption ); - BOOL NWPaintGTKToolbar( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, + sal_Bool NWPaintGTKToolbar( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, const OUString& rCaption ); - BOOL NWPaintGTKMenubar( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, + sal_Bool NWPaintGTKMenubar( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, const OUString& rCaption ); - BOOL NWPaintGTKPopupMenu( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, + sal_Bool NWPaintGTKPopupMenu( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, const OUString& rCaption ); - BOOL NWPaintGTKTooltip( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, + sal_Bool NWPaintGTKTooltip( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, const OUString& rCaption ); - BOOL NWPaintGTKProgress( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, + sal_Bool NWPaintGTKProgress( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, const OUString& rCaption ); - BOOL NWPaintGTKSlider( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, + sal_Bool NWPaintGTKSlider( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, const OUString& rCaption ); - BOOL NWPaintGTKListNode( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, + sal_Bool NWPaintGTKListNode( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, diff --git a/vcl/unx/inc/plugins/gtk/gtkinst.hxx b/vcl/unx/inc/plugins/gtk/gtkinst.hxx index ee07199cb266..a6a508118865 100644 --- a/vcl/unx/inc/plugins/gtk/gtkinst.hxx +++ b/vcl/unx/inc/plugins/gtk/gtkinst.hxx @@ -63,7 +63,7 @@ class GtkHookedYieldMutex : public GtkYieldMutex { virtual int Grab() { return 0; }; virtual void Ungrab(int ) {}; - std::list aYieldStack; + std::list aYieldStack; public: GtkHookedYieldMutex(); virtual void acquire(); @@ -84,9 +84,9 @@ public: {} virtual ~GtkInstance(); - virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle ); - virtual SalFrame* CreateChildFrame( SystemParentData* pParent, ULONG nStyle ); - virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow = TRUE ); + virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uInt32 nStyle ); + virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uInt32 nStyle ); + virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True ); virtual SalSystem* CreateSalSystem(); virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType); }; diff --git a/vcl/unx/inc/plugins/gtk/gtkobject.hxx b/vcl/unx/inc/plugins/gtk/gtkobject.hxx index 9d3f235b8894..8188fcfd4b88 100644 --- a/vcl/unx/inc/plugins/gtk/gtkobject.hxx +++ b/vcl/unx/inc/plugins/gtk/gtkobject.hxx @@ -44,19 +44,19 @@ class GtkSalObject : public SalObject static gboolean signalFocus( GtkWidget*, GdkEventFocus*, gpointer ); static void signalDestroy( GtkObject*, gpointer ); public: - GtkSalObject( GtkSalFrame* pParent, BOOL bShow = TRUE ); + GtkSalObject( GtkSalFrame* pParent, sal_Bool bShow = sal_True ); virtual ~GtkSalObject(); // overload all pure virtual methods virtual void ResetClipRegion(); - virtual USHORT GetClipRegionType(); - virtual void BeginSetClipRegion( ULONG nRects ); + virtual sal_uInt16 GetClipRegionType(); + virtual void BeginSetClipRegion( sal_uInt32 nRects ); virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ); virtual void EndSetClipRegion(); virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight ); - virtual void Show( BOOL bVisible ); - virtual void Enable( BOOL nEnable ); + virtual void Show( sal_Bool bVisible ); + virtual void Enable( sal_Bool nEnable ); virtual void GrabFocus(); virtual void SetBackground(); diff --git a/vcl/unx/inc/plugins/kde/kdedata.hxx b/vcl/unx/inc/plugins/kde/kdedata.hxx index a55471901283..501dbfbbb616 100644 --- a/vcl/unx/inc/plugins/kde/kdedata.hxx +++ b/vcl/unx/inc/plugins/kde/kdedata.hxx @@ -67,14 +67,14 @@ class KDESalFrame : public X11SalFrame GraphicsHolder m_aGraphics[ nMaxGraphics ]; public: - KDESalFrame( SalFrame* pParent, ULONG nStyle ); + KDESalFrame( SalFrame* pParent, sal_uInt32 ); virtual ~KDESalFrame(); virtual SalGraphics* GetGraphics(); virtual void ReleaseGraphics( SalGraphics *pGraphics ); virtual void updateGraphics( bool bClear ); virtual void UpdateSettings( AllSettings& rSettings ); - virtual void Show( BOOL bVisible, BOOL bNoActivate ); + virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate ); }; class KDESalInstance : public X11SalInstance @@ -83,7 +83,7 @@ public: KDESalInstance( SalYieldMutex* pMutex ) : X11SalInstance( pMutex ) {} virtual ~KDESalInstance() {} - virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle ); + virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uInt32 nStyle ); }; class KDEXLib : public SalXLib diff --git a/vcl/unx/inc/pspgraphics.h b/vcl/unx/inc/pspgraphics.h index d4f5a9f156e0..f9c988dda908 100644 --- a/vcl/unx/inc/pspgraphics.h +++ b/vcl/unx/inc/pspgraphics.h @@ -83,12 +83,12 @@ public: // overload all pure virtual methods virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ); - virtual USHORT GetBitCount(); + virtual sal_uInt16 GetBitCount(); virtual long GetGraphicsWidth() const; virtual void ResetClipRegion(); - virtual void BeginSetClipRegion( ULONG nCount ); - virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight ); + virtual void BeginSetClipRegion( sal_uInt32 nCount ); + virtual sal_Bool unionClipRegion( long nX, long nY, long nWidth, long nHeight ); virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& ); virtual void EndSetClipRegion(); @@ -101,14 +101,14 @@ public: virtual void SetROPFillColor( SalROPColor nROPColor ); virtual void SetTextColor( SalColor nSalColor ); - virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel ); + virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel ); virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); - virtual ULONG GetKernPairs( ULONG nMaxPairs, ImplKernPairData* ); + virtual sal_uInt32 GetKernPairs( sal_uInt32 nMaxPairs, ImplKernPairData* ); virtual const ImplFontCharMap* GetImplFontCharMap() const; virtual void GetDevFontList( ImplDevFontList* ); virtual void GetDevFontSubstList( OutputDevice* ); virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName ); - virtual BOOL CreateFontSubset( const rtl::OUString& rToFile, + virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile, const ImplFontData*, sal_Int32* pGlyphIDs, sal_uInt8* pEncoding, @@ -127,8 +127,8 @@ public: bool bVertical, Int32Vector& rWidths, Ucs2UIntMap& rUnicodeEnc ); - virtual BOOL GetGlyphBoundRect( long nIndex, Rectangle& ); - virtual BOOL GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& ); + virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& ); + virtual sal_Bool GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& ); virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ); virtual void DrawServerFontLayout( const ServerFontLayout& ); virtual bool supportsOperation( OutDevSupportType ) const; @@ -136,30 +136,30 @@ public: virtual void drawPixel( long nX, long nY, SalColor nSalColor ); virtual void drawLine( long nX1, long nY1, long nX2, long nY2 ); virtual void drawRect( long nX, long nY, long nWidth, long nHeight ); - virtual void drawPolyLine( ULONG nPoints, const SalPoint* pPtAry ); - virtual void drawPolygon( ULONG nPoints, const SalPoint* pPtAry ); + virtual void drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ); + virtual void drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ); virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ); virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ); virtual bool drawPolyLine( const basegfx::B2DPolygon&, double fTransparency, const basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin); - virtual sal_Bool drawPolyLineBezier( ULONG nPoints, + virtual sal_Bool drawPolyLineBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, - const BYTE* pFlgAry ); - virtual sal_Bool drawPolygonBezier( ULONG nPoints, + const sal_uInt8* pFlgAry ); + virtual sal_Bool drawPolygonBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, - const BYTE* pFlgAry ); + const sal_uInt8* pFlgAry ); virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt32* pPoints, const SalPoint* const* pPtAry, - const BYTE* const* pFlgAry ); + const sal_uInt8* const* pFlgAry ); virtual void copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth, long nSrcHeight, - USHORT nFlags ); + sal_uInt16 nFlags ); virtual void copyBits( const SalTwoRect* pPosAry, SalGraphics* pSrcGraphics ); virtual void drawBitmap( const SalTwoRect* pPosAry, @@ -176,9 +176,9 @@ public: virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight ); virtual SalColor getPixel( long nX, long nY ); virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags ); - virtual void invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags ); + virtual void invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalInvert nFlags ); - virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize ); + virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uInt32 nSize ); virtual bool filterText( const String& rOrigText, String& rNewText, xub_StrLen nIndex, xub_StrLen& rLen, xub_StrLen& rCutStart, xub_StrLen& rCutStop ); virtual bool drawAlphaBitmap( const SalTwoRect&, diff --git a/vcl/unx/inc/salbmp.h b/vcl/unx/inc/salbmp.h index 23e038f30ab1..c0b5854e5c51 100644 --- a/vcl/unx/inc/salbmp.h +++ b/vcl/unx/inc/salbmp.h @@ -51,7 +51,7 @@ class VCL_DLLPUBLIC X11SalBitmap : public SalBitmap private: static BitmapBuffer* ImplCreateDIB( const Size& rSize, - USHORT nBitCount, + sal_uInt16 nBitCount, const BitmapPalette& rPal ); static BitmapBuffer* ImplCreateDIB( Drawable aDrawable, int nScreen, @@ -62,7 +62,7 @@ private: public: static ImplSalBitmapCache* mpCache; - static ULONG mnCacheInstCount; + static sal_uInt32 mnCacheInstCount; static void ImplCreateCache(); static void ImplDestroyCache(); @@ -103,18 +103,18 @@ public: // overload pure virtual methods virtual bool Create( const Size& rSize, - USHORT nBitCount, + sal_uInt16 nBitCount, const BitmapPalette& rPal ); virtual bool Create( const SalBitmap& rSalBmp ); virtual bool Create( const SalBitmap& rSalBmp, SalGraphics* pGraphics ); virtual bool Create( const SalBitmap& rSalBmp, - USHORT nNewBitCount ); + sal_uInt16 nNewBitCount ); virtual void Destroy(); virtual Size GetSize() const; - virtual USHORT GetBitCount() const; + virtual sal_uInt16 GetBitCount() const; virtual BitmapBuffer* AcquireBuffer( bool bReadOnly ); virtual void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly ); @@ -161,7 +161,7 @@ public: long ImplGetWidth() const { return maTwoRect.mnDestWidth; } long ImplGetHeight() const { return maTwoRect.mnDestHeight; } long ImplGetDepth() const { return mnDepth; } - ULONG ImplGetMemSize() const { return( ( maTwoRect.mnDestWidth * maTwoRect.mnDestHeight * mnDepth ) >> 3 ); } + sal_uInt32 ImplGetMemSize() const { return( ( maTwoRect.mnDestWidth * maTwoRect.mnDestHeight * mnDepth ) >> 3 ); } int ImplGetScreen() const { return mnScreen; } bool ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRect ) const; @@ -178,14 +178,14 @@ class ImplSalBitmapCache private: List maBmpList; - ULONG mnTotalSize; + sal_uInt32 mnTotalSize; public: ImplSalBitmapCache(); ~ImplSalBitmapCache(); - void ImplAdd( X11SalBitmap* pBmp, ULONG nMemSize = 0UL, ULONG nFlags = 0UL ); + void ImplAdd( X11SalBitmap* pBmp, sal_uInt32 nMemSize = 0UL, sal_uInt32 nFlags = 0UL ); void ImplRemove( X11SalBitmap* pBmp ); void ImplClear(); }; diff --git a/vcl/unx/inc/saldata.hxx b/vcl/unx/inc/saldata.hxx index 939437060750..79c7ca277e82 100644 --- a/vcl/unx/inc/saldata.hxx +++ b/vcl/unx/inc/saldata.hxx @@ -58,7 +58,7 @@ typedef unsigned int pthread_t; class VCL_DLLPUBLIC X11SalData : public SalData { protected: - BOOL bNoExceptions_; + sal_Bool bNoExceptions_; SalXLib *pXLib_; SalDisplay *m_pSalDisplay; pthread_t hMainThread_; @@ -85,7 +85,7 @@ public: inline SalXLib* GetLib() const { return pXLib_; } inline pthread_t GetMainThread() const { return hMainThread_; } - void StartTimer( ULONG nMS ); + void StartTimer( sal_uInt32 nMS ); inline void StopTimer(); void Timeout() const; @@ -114,7 +114,7 @@ inline void X11SalData::XError( Display *pDisplay, XErrorEvent *pEvent ) const class YieldMutexReleaser { - ULONG m_nYieldCount; + sal_uInt32 m_nYieldCount; public: inline YieldMutexReleaser(); inline ~YieldMutexReleaser(); diff --git a/vcl/unx/inc/saldisp.hxx b/vcl/unx/inc/saldisp.hxx index 99c9bea699d6..daff940b1f4e 100644 --- a/vcl/unx/inc/saldisp.hxx +++ b/vcl/unx/inc/saldisp.hxx @@ -152,8 +152,8 @@ public: Pixel GetTCPixel( SalColor nColor ) const; SalColor GetTCColor( Pixel nPixel ) const; - BOOL Convert( int &n0, int &n1, int &n2, int &n3 ); // 32bit - BOOL Convert( int &n0, int &n1, int &n2 ); // 24bit + sal_Bool Convert( int &n0, int &n1, int &n2, int &n3 ); // 32bit + sal_Bool Convert( int &n0, int &n1, int &n2 ); // 24bit }; // -=-= SalColormap =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -163,7 +163,7 @@ class SalColormap Colormap m_hColormap; std::vector m_aPalette; // Pseudocolor SalVisual m_aVisual; - std::vector m_aLookupTable; // Pseudocolor: 12bit reduction + std::vector m_aLookupTable; // Pseudocolor: 12bit reduction Pixel m_nWhitePixel; Pixel m_nBlackPixel; Pixel m_nUsed; // Pseudocolor @@ -176,7 +176,7 @@ public: Colormap hColormap, int nScreen ); SalColormap( const BitmapPalette &rpPalette ); - SalColormap( USHORT nDepth ); + SalColormap( sal_uInt16 nDepth ); SalColormap(); ~SalColormap(); @@ -191,11 +191,11 @@ public: inline int GetClass() const { return m_aVisual.GetClass(); } inline int GetScreenNumber() const { return m_nScreen; } - BOOL GetXPixels( XColor &rColor, + sal_Bool GetXPixels( XColor &rColor, int r, int g, int b ) const; - inline BOOL GetXPixel( XColor &rColor, + inline sal_Bool GetXPixel( XColor &rColor, int r, int g, int b ) const; @@ -212,7 +212,7 @@ class VCL_DLLPUBLIC SalXLib { protected: timeval m_aTimeout; - ULONG m_nTimeoutMS; + sal_uInt32 m_nTimeoutMS; int m_pTimeoutFDS[2]; bool m_bHaveSystemChildFrames; @@ -254,7 +254,7 @@ public: void PushXErrorLevel( bool bIgnore ); void PopXErrorLevel(); - virtual void StartTimer( ULONG nMS ); + virtual void StartTimer( sal_uInt32 nMS ); virtual void StopTimer(); bool CheckTimeout( bool bExecuteTimers = true ); @@ -334,9 +334,9 @@ public: { SalFrame* m_pFrame; void* m_pData; - USHORT m_nEvent; + sal_uInt16 m_nEvent; - SalUserEvent( SalFrame* pFrame, void* pData, USHORT nEvent = SALEVENT_USEREVENT ) + SalUserEvent( SalFrame* pFrame, void* pData, sal_uInt16 nEvent = SALEVENT_USEREVENT ) : m_pFrame( pFrame ), m_pData( pData ), m_nEvent( nEvent ) @@ -358,14 +358,14 @@ protected: ScreenData m_aInvalidScreenData; Pair aResolution_; // [dpi] bool mbExactResolution; - ULONG nMaxRequestSize_; // [byte] + sal_uInt32 nMaxRequestSize_; // [byte] srv_vendor_t meServerVendor; SalWM eWindowManager_; - ULONG nProperties_; // PROPERTY_SUPPORT, BUG, FEATURE - BOOL bLocal_; // Server==Client? Init + sal_uInt32 nProperties_; // PROPERTY_SUPPORT, BUG, FEATURE + sal_Bool bLocal_; // Server==Client? Init // in SalDisplay::IsLocal() - BOOL mbLocalIsValid; // bLocal_ is valid ? + sal_Bool mbLocalIsValid; // bLocal_ is valid ? // until x bytes oslMutex hEventGuard_; @@ -377,7 +377,7 @@ protected: mutable SalFontCache* m_pFontCache; // Keyboard - BOOL bNumLockFromXS_; // Num Lock handled by X Server + sal_Bool bNumLockFromXS_; // Num Lock handled by X Server int nNumLockIndex_; // modifier index in modmap int nNumLockMask_; // keyevent state mask for KeySym nShiftKeySym_; // first shift modifier @@ -408,7 +408,7 @@ protected: int addXineramaScreenUnique( long i_nX, long i_nY, long i_nWidth, long i_nHeight ); public: static SalDisplay *GetSalDisplay( Display* display ); - static BOOL BestVisual( Display *pDisp, + static sal_Bool BestVisual( Display *pDisp, int nScreen, XVisualInfo &rVI ); @@ -426,8 +426,8 @@ public: void Init(); - void SendInternalEvent( SalFrame* pFrame, void* pData, USHORT nEvent = SALEVENT_USEREVENT ); - void CancelInternalEvent( SalFrame* pFrame, void* pData, USHORT nEvent ); + void SendInternalEvent( SalFrame* pFrame, void* pData, sal_uInt16 nEvent = SALEVENT_USEREVENT ); + void CancelInternalEvent( SalFrame* pFrame, void* pData, sal_uInt16 nEvent ); bool DispatchInternalEvent(); void PrintInfo() const; @@ -446,8 +446,8 @@ public: void ModifierMapping(); String GetKeyNameFromKeySym( KeySym keysym ) const; - XubString GetKeyName( USHORT nKeyCode ) const; - USHORT GetKeyCode( KeySym keysym, char*pcPrintable ) const; + XubString GetKeyName( sal_uInt16 nKeyCode ) const; + sal_uInt16 GetKeyCode( KeySym keysym, char*pcPrintable ) const; KeySym GetKeySym( XKeyEvent *pEvent, unsigned char *pPrintable, int *pLen, @@ -458,7 +458,7 @@ public: XLIB_Cursor GetPointer( int ePointerStyle ); virtual int CaptureMouse( SalFrame *pCapture ); - BOOL IsLocal(); + sal_Bool IsLocal(); void Remove( XEvent *pEvent ); @@ -479,27 +479,27 @@ public: const Size& GetScreenSize( int nScreen ) const { return getDataForScreen( nScreen ).m_aSize; } srv_vendor_t GetServerVendor() const { return meServerVendor; } void SetServerVendor() { meServerVendor = sal_GetServerVendor(pDisp_); } - BOOL IsDisplay() const { return !!pXLib_; } + sal_Bool IsDisplay() const { return !!pXLib_; } GC GetMonoGC( int nScreen ) const { return getDataForScreen(nScreen).m_aMonoGC; } GC GetCopyGC( int nScreen ) const { return getDataForScreen(nScreen).m_aCopyGC; } GC GetAndInvertedGC( int nScreen ) const { return getDataForScreen(nScreen).m_aAndInvertedGC; } GC GetAndGC( int nScreen ) const { return getDataForScreen(nScreen).m_aAndGC; } GC GetOrGC( int nScreen ) const { return getDataForScreen(nScreen).m_aOrGC; } GC GetStippleGC( int nScreen ) const { return getDataForScreen(nScreen).m_aStippleGC; } - GC GetGC( USHORT nDepth, int nScreen ) const; + GC GetGC( sal_uInt16 nDepth, int nScreen ) const; Pixmap GetInvert50( int nScreen ) const { return getDataForScreen(nScreen).m_hInvert50; } const SalColormap& GetColormap( int nScreen ) const { return getDataForScreen(nScreen).m_aColormap; } const SalVisual& GetVisual( int nScreen ) const { return getDataForScreen(nScreen).m_aVisual; } RenderEntryMap& GetRenderEntries( int nScreen ) const { return getDataForScreen(nScreen).m_aRenderData; } const Pair &GetResolution() const { return aResolution_; } bool GetExactResolution() const { return mbExactResolution; } - ULONG GetProperties() const { return nProperties_; } - ULONG GetMaxRequestSize() const { return nMaxRequestSize_; } + sal_uInt32 GetProperties() const { return nProperties_; } + sal_uInt32 GetMaxRequestSize() const { return nMaxRequestSize_; } XLIB_Time GetLastUserEventTime( bool bAlwaysReget = false ) const; bool XIfEventWithTimeout( XEvent*, XPointer, X_if_predicate, long i_nTimeout = 1000 ) const; - BOOL MouseCaptured( const SalFrame *pFrameData ) const + sal_Bool MouseCaptured( const SalFrame *pFrameData ) const { return m_pCapture == pFrameData; } SalFrame* GetCaptureFrame() const { return m_pCapture; } @@ -511,7 +511,7 @@ public: { mpInputMethod = pInputMethod; } void SetKbdExtension(SalI18N_KeyboardExtension *pKbdExtension) { mpKbdExtension = pKbdExtension; } - const char* GetKeyboardName( BOOL bRefresh = FALSE ); + const char* GetKeyboardName( sal_Bool bRefresh = sal_False ); ::vcl_sal::WMAdaptor* getWMAdaptor() const { return m_pWMAdaptor; } DtIntegrator* getDtIntegrator() const { return m_pDtIntegrator; } bool IsXinerama() const { return m_bXinerama; } @@ -525,14 +525,14 @@ public: const std::list< SalFrame* >& getFrames() const { return m_aFrames; } - BOOL IsNumLockFromXS() const { return bNumLockFromXS_; } + sal_Bool IsNumLockFromXS() const { return bNumLockFromXS_; } std::list< SalObject* >& getSalObjects() { return m_aSalObjects; } }; // -=-= inlines =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -inline GC SalDisplay::GetGC( USHORT nDepth, int nScreen ) const +inline GC SalDisplay::GetGC( sal_uInt16 nDepth, int nScreen ) const { return 1 == nDepth ? GetMonoGC( nScreen ) : getDataForScreen(nScreen).m_aVisual.GetDepth() == nDepth @@ -551,7 +551,7 @@ public: virtual long Dispatch( XEvent *pEvent ); virtual void Yield(); - BOOL IsEvent(); + sal_Bool IsEvent(); }; /*---------------------------------------------------------- diff --git a/vcl/unx/inc/salframe.h b/vcl/unx/inc/salframe.h index 9786bac76f35..076755cde8e8 100644 --- a/vcl/unx/inc/salframe.h +++ b/vcl/unx/inc/salframe.h @@ -87,24 +87,24 @@ class VCL_DLLPUBLIC X11SalFrame : public SalFrame X11SalGraphics *pFreeGraphics_; // first free frame graphics XLIB_Time nReleaseTime_; // timestamp of last key release - USHORT nKeyCode_; // last key code - USHORT nKeyState_; // last key state + sal_uInt16 nKeyCode_; // last key code + sal_uInt16 nKeyState_; // last key state int nCompose_; // compose state bool mbKeyMenu; bool mbSendExtKeyModChange; - USHORT mnExtKeyMod; + sal_uInt16 mnExtKeyMod; int nShowState_; // show state int nWidth_; // client width int nHeight_; // client height Rectangle maRestorePosSize; - ULONG nStyle_; + sal_uInt32 nStyle_; SalExtStyle mnExtStyle; - BOOL bAlwaysOnTop_; - BOOL bViewable_; - BOOL bMapped_; - BOOL mbInShow; - BOOL bDefaultPosition_; // client is centered initially + sal_Bool bAlwaysOnTop_; + sal_Bool bViewable_; + sal_Bool bMapped_; + sal_Bool mbInShow; + sal_Bool bDefaultPosition_; // client is centered initially bool m_bXEmbed; int nVisibility_; int m_nWorkArea; @@ -172,11 +172,11 @@ class VCL_DLLPUBLIC X11SalFrame : public SalFrame void setXEmbedInfo(); void askForXEmbedFocus( sal_Int32 i_nTimeCode ); public: - X11SalFrame( SalFrame* pParent, ULONG nSalFrameStyle, SystemParentData* pSystemParent = NULL ); + X11SalFrame( SalFrame* pParent, sal_uInt32 nSalFrameStyle, SystemParentData* pSystemParent = NULL ); virtual ~X11SalFrame(); long Dispatch( XEvent *pEvent ); - void Init( ULONG nSalFrameStyle, int nScreen = -1, + void Init( sal_uInt32 nSalFrameStyle, int nScreen = -1, SystemParentData* pParentData = NULL, bool bUseGeometry = false ); SalDisplay* GetDisplay() const { return pDisplay_; } @@ -189,10 +189,10 @@ public: XLIB_Window GetStackingWindow() const { return mhStackingWindow; } long ShutDown() const { return CallCallback( SALEVENT_SHUTDOWN, 0 ); } long Close() const { return CallCallback( SALEVENT_CLOSE, 0 ); } - ULONG GetStyle() const { return nStyle_; } + sal_uInt32 GetStyle() const { return nStyle_; } inline XLIB_Cursor GetCursor() const { return hCursor_; } - inline BOOL IsCaptured() const { return nCaptured_ == 1; } + inline sal_Bool IsCaptured() const { return nCaptured_ == 1; } #if !defined(__synchronous_extinput__) void HandleExtTextEvent (XClientMessageEvent *pEvent); void PostExtTextEvent (sal_uInt16 nExtTextEventType, @@ -219,39 +219,39 @@ public: // call with false to setup graphics with window (GetWindow()) virtual void updateGraphics( bool bClear ); - virtual BOOL PostEvent( void* pData ); + virtual sal_Bool PostEvent( void* pData ); virtual void SetTitle( const XubString& rTitle ); - virtual void SetIcon( USHORT nIcon ); + virtual void SetIcon( sal_uInt16 nIcon ); virtual void SetMenu( SalMenu* pMenu ); virtual void DrawMenuBar(); virtual void SetExtendedFrameStyle( SalExtStyle nExtStyle ); - virtual void Show( BOOL bVisible, BOOL bNoActivate = FALSE ); - virtual void Enable( BOOL bEnable ); + virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate = sal_False ); + virtual void Enable( sal_Bool bEnable ); virtual void SetMinClientSize( long nWidth, long nHeight ); virtual void SetMaxClientSize( long nWidth, long nHeight ); - virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags ); + virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ); virtual void GetClientSize( long& rWidth, long& rHeight ); virtual void GetWorkArea( Rectangle& rRect ); virtual SalFrame* GetParent() const; virtual void SetWindowState( const SalFrameState* pState ); - virtual BOOL GetWindowState( SalFrameState* pState ); - virtual void ShowFullScreen( BOOL bFullScreen, sal_Int32 nMonitor ); - virtual void StartPresentation( BOOL bStart ); - virtual void SetAlwaysOnTop( BOOL bOnTop ); - virtual void ToTop( USHORT nFlags ); + virtual sal_Bool GetWindowState( SalFrameState* pState ); + virtual void ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nMonitor ); + virtual void StartPresentation( sal_Bool bStart ); + virtual void SetAlwaysOnTop( sal_Bool bOnTop ); + virtual void ToTop( sal_uInt16 nFlags ); virtual void SetPointer( PointerStyle ePointerStyle ); - virtual void CaptureMouse( BOOL bMouse ); + virtual void CaptureMouse( sal_Bool bMouse ); virtual void SetPointerPos( long nX, long nY ); using SalFrame::Flush; virtual void Flush(); virtual void Sync(); virtual void SetInputContext( SalInputContext* pContext ); - virtual void EndExtTextInput( USHORT nFlags ); - virtual String GetKeyName( USHORT nKeyCode ); - virtual String GetSymbolKeyName( const XubString& rFontName, USHORT nKeyCode ); - virtual BOOL MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode ); + virtual void EndExtTextInput( sal_uInt16 nFlags ); + virtual String GetKeyName( sal_uInt16 nKeyCode ); + virtual String GetSymbolKeyName( const XubString& rFontName, sal_uInt16 nKeyCode ); + virtual sal_Bool MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode ); virtual LanguageType GetInputLanguage(); virtual SalBitmap* SnapShot(); virtual void UpdateSettings( AllSettings& rSettings ); @@ -268,7 +268,7 @@ public: // set clip region to none (-> rectangular windows, normal state) virtual void ResetClipRegion(); // start setting the clipregion consisting of nRects rectangles - virtual void BeginSetClipRegion( ULONG nRects ); + virtual void BeginSetClipRegion( sal_uInt32 nRects ); // add a rectangle to the clip region virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ); // done setting up the clipregion diff --git a/vcl/unx/inc/salgdi.h b/vcl/unx/inc/salgdi.h index b5fdce50eee9..08da57182ac9 100644 --- a/vcl/unx/inc/salgdi.h +++ b/vcl/unx/inc/salgdi.h @@ -105,9 +105,9 @@ protected: SalColor nTextColor_; Pixel nTextPixel_; - BOOL bFontVertical_; + sal_Bool bFontVertical_; - BOOL bDisableGraphite_; + sal_Bool bDisableGraphite_; GC pBrushGC_; // Brush attributes SalColor nBrushColor_; @@ -122,20 +122,20 @@ protected: GC pStippleGC_; GC pTrackingGC_; - BOOL bWindow_ : 1; // is Window - BOOL bPrinter_ : 1; // is Printer - BOOL bVirDev_ : 1; // is VirDev - BOOL bPenGC_ : 1; // is Pen GC valid - BOOL bFontGC_ : 1; // is Font GC valid - BOOL bBrushGC_ : 1; // is Brush GC valid - BOOL bMonoGC_ : 1; // is Mono GC valid - BOOL bCopyGC_ : 1; // is Copy GC valid - BOOL bInvertGC_ : 1; // is Invert GC valid - BOOL bInvert50GC_ : 1; // is Invert50 GC valid - BOOL bStippleGC_ : 1; // is Stipple GC valid - BOOL bTrackingGC_ : 1; // is Tracking GC valid + sal_Bool bWindow_ : 1; // is Window + sal_Bool bPrinter_ : 1; // is Printer + sal_Bool bVirDev_ : 1; // is VirDev + sal_Bool bPenGC_ : 1; // is Pen GC valid + sal_Bool bFontGC_ : 1; // is Font GC valid + sal_Bool bBrushGC_ : 1; // is Brush GC valid + sal_Bool bMonoGC_ : 1; // is Mono GC valid + sal_Bool bCopyGC_ : 1; // is Copy GC valid + sal_Bool bInvertGC_ : 1; // is Invert GC valid + sal_Bool bInvert50GC_ : 1; // is Invert50 GC valid + sal_Bool bStippleGC_ : 1; // is Stipple GC valid + sal_Bool bTrackingGC_ : 1; // is Tracking GC valid bool bXORMode_ : 1; // is ROP XOR Mode set - BOOL bDitherBrush_ : 1; // is solid or tile + sal_Bool bDitherBrush_ : 1; // is solid or tile void SetClipRegion( GC pGC, XLIB_Region pXReg = NULL ) const; @@ -147,12 +147,12 @@ protected: unsigned long nMask = GCGraphicsExposures ); GC SelectPen(); GC SelectBrush(); - void DrawLines( ULONG nPoints, + void DrawLines( sal_uInt32 nPoints, const SalPolyLine &rPoints, GC pGC, bool bClose ); - BOOL GetDitherPixmap ( SalColor nSalColor ); + sal_Bool GetDitherPixmap ( SalColor nSalColor ); inline GC GetMonoGC( Pixmap hPixmap ); inline GC GetCopyGC(); @@ -230,13 +230,13 @@ public: // overload all pure virtual methods virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ); - virtual USHORT GetBitCount(); + virtual sal_uInt16 GetBitCount(); virtual long GetGraphicsWidth() const; virtual long GetGraphicsHeight() const; virtual void ResetClipRegion(); - virtual void BeginSetClipRegion( ULONG nCount ); - virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight ); + virtual void BeginSetClipRegion( sal_uInt32 nCount ); + virtual sal_Bool unionClipRegion( long nX, long nY, long nWidth, long nHeight ); virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& ); virtual void EndSetClipRegion(); @@ -252,14 +252,14 @@ public: virtual void SetROPFillColor( SalROPColor nROPColor ); virtual void SetTextColor( SalColor nSalColor ); - virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel ); + virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel ); virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); - virtual ULONG GetKernPairs( ULONG nMaxPairs, ImplKernPairData* ); + virtual sal_uInt32 GetKernPairs( sal_uInt32 nMaxPairs, ImplKernPairData* ); virtual const ImplFontCharMap* GetImplFontCharMap() const; virtual void GetDevFontList( ImplDevFontList* ); virtual void GetDevFontSubstList( OutputDevice* ); virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName ); - virtual BOOL CreateFontSubset( const rtl::OUString& rToFile, + virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile, const ImplFontData*, sal_Int32* pGlyphIDs, sal_uInt8* pEncoding, @@ -278,8 +278,8 @@ public: bool bVertical, Int32Vector& rWidths, Ucs2UIntMap& rUnicodeEnc ); - virtual BOOL GetGlyphBoundRect( long nIndex, Rectangle& ); - virtual BOOL GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& ); + virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& ); + virtual sal_Bool GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& ); virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ); virtual void DrawServerFontLayout( const ServerFontLayout& ); virtual bool supportsOperation( OutDevSupportType ) const; @@ -287,9 +287,9 @@ public: virtual void drawPixel( long nX, long nY, SalColor nSalColor ); virtual void drawLine( long nX1, long nY1, long nX2, long nY2 ); virtual void drawRect( long nX, long nY, long nWidth, long nHeight ); - void drawPolyLine( ULONG nPoints, const SalPoint* pPtAry, bool bClose ); - virtual void drawPolyLine( ULONG nPoints, const SalPoint* pPtAry ); - virtual void drawPolygon( ULONG nPoints, const SalPoint* pPtAry ); + void drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry, bool bClose ); + virtual void drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ); + virtual void drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ); virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ); @@ -298,16 +298,16 @@ public: virtual bool drawFilledTrapezoids( const ::basegfx::B2DTrapezoid*, int nTrapCount, double fTransparency ); #if 1 // TODO: remove these obselete methods - virtual sal_Bool drawPolyLineBezier( ULONG nPoints, + virtual sal_Bool drawPolyLineBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, - const BYTE* pFlgAry ); - virtual sal_Bool drawPolygonBezier( ULONG nPoints, + const sal_uInt8* pFlgAry ); + virtual sal_Bool drawPolygonBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, - const BYTE* pFlgAry ); + const sal_uInt8* pFlgAry ); virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt32* pPoints, const SalPoint* const* pPtAry, - const BYTE* const* pFlgAry ); + const sal_uInt8* const* pFlgAry ); #endif virtual void copyArea( long nDestX, @@ -316,7 +316,7 @@ public: long nSrcY, long nSrcWidth, long nSrcHeight, - USHORT nFlags ); + sal_uInt16 nFlags ); virtual void copyBits( const SalTwoRect* pPosAry, SalGraphics* pSrcGraphics ); virtual void drawBitmap( const SalTwoRect* pPosAry, @@ -333,9 +333,9 @@ public: virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight ); virtual SalColor getPixel( long nX, long nY ); virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags ); - virtual void invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags ); + virtual void invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalInvert nFlags ); - virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize ); + virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uInt32 nSize ); virtual bool drawAlphaBitmap( const SalTwoRect&, const SalBitmap& rSourceBitmap, diff --git a/vcl/unx/inc/salinst.h b/vcl/unx/inc/salinst.h index 133f0bf6037f..fab34429afb2 100644 --- a/vcl/unx/inc/salinst.h +++ b/vcl/unx/inc/salinst.h @@ -42,7 +42,7 @@ class VCL_DLLPUBLIC SalYieldMutex : public vos::OMutex { protected: - ULONG mnCount; + sal_uInt32 mnCount; vos::OThread::TThreadIdentifier mnThreadId; public: @@ -52,7 +52,7 @@ public: virtual void release(); virtual sal_Bool tryToAcquire(); - ULONG GetAcquireCount() const { return mnCount; } + sal_uInt32 GetAcquireCount() const { return mnCount; } vos::OThread::TThreadIdentifier GetThreadId() const { return mnThreadId; } }; @@ -70,16 +70,16 @@ public: {} virtual ~X11SalInstance(); - virtual SalFrame* CreateChildFrame( SystemParentData* pParent, ULONG nStyle ); - virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle ); + virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uInt32 nStyle ); + virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uInt32 nStyle ); virtual void DestroyFrame( SalFrame* pFrame ); - virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow = TRUE ); + virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True ); virtual void DestroyObject( SalObject* pObject ); virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics, long nDX, long nDY, - USHORT nBitCount, const SystemGraphicsData *pData = NULL ); + sal_uInt16 nBitCount, const SystemGraphicsData *pData = NULL ); virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice ); virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo, @@ -100,12 +100,12 @@ public: virtual SalSession* CreateSalSession(); virtual vos::IMutex* GetYieldMutex(); - virtual ULONG ReleaseYieldMutex(); - virtual void AcquireYieldMutex( ULONG nCount ); + virtual sal_uInt32 ReleaseYieldMutex(); + virtual void AcquireYieldMutex( sal_uInt32 nCount ); virtual bool CheckYieldMutex(); virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ); - virtual bool AnyInput( USHORT nType ); + virtual bool AnyInput( sal_uInt16 nType ); virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ); void FillFontPathList( std::list< rtl::OString >& o_rFontPaths ); diff --git a/vcl/unx/inc/salobj.h b/vcl/unx/inc/salobj.h index d7d9334f281b..865b09f39a04 100644 --- a/vcl/unx/inc/salobj.h +++ b/vcl/unx/inc/salobj.h @@ -41,16 +41,16 @@ public: SalClipRegion(); ~SalClipRegion(); - void BeginSetClipRegion( ULONG nRects ); + void BeginSetClipRegion( sal_uInt32 nRects ); void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ); XRectangle *EndSetClipRegion() { return ClipRectangleList; } void ResetClipRegion() { numClipRectangles = 0; } - USHORT GetClipRegionType() { + sal_uInt16 GetClipRegionType() { return nClipRegionType; } - void SetClipRegionType( USHORT nType ) { + void SetClipRegionType( sal_uInt16 nType ) { nClipRegionType = nType; } int GetRectangleCount() { return numClipRectangles; } @@ -60,7 +60,7 @@ private: XRectangle* ClipRectangleList; int numClipRectangles; int maxClipRectangles; - USHORT nClipRegionType; + sal_uInt16 nClipRegionType; }; @@ -73,24 +73,24 @@ public: XLIB_Window maSecondary; Colormap maColormap; SalClipRegion maClipRegion; - BOOL mbVisible; + sal_Bool mbVisible; static VCL_DLLPUBLIC long Dispatch( XEvent* pEvent ); - static VCL_DLLPUBLIC X11SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow = TRUE ); + static VCL_DLLPUBLIC X11SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True ); X11SalObject(); virtual ~X11SalObject(); // overload all pure virtual methods virtual void ResetClipRegion(); - virtual USHORT GetClipRegionType(); - virtual void BeginSetClipRegion( ULONG nRects ); + virtual sal_uInt16 GetClipRegionType(); + virtual void BeginSetClipRegion( sal_uInt32 nRects ); virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ); virtual void EndSetClipRegion(); virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight ); - virtual void Show( BOOL bVisible ); - virtual void Enable( BOOL nEnable ); + virtual void Show( sal_Bool bVisible ); + virtual void Enable( sal_Bool nEnable ); virtual void GrabFocus(); virtual void SetBackground(); diff --git a/vcl/unx/inc/salprn.h b/vcl/unx/inc/salprn.h index 6e6ca0a2f1cc..8902f2efd497 100644 --- a/vcl/unx/inc/salprn.h +++ b/vcl/unx/inc/salprn.h @@ -48,16 +48,16 @@ public: // overload all pure virtual methods virtual SalGraphics* GetGraphics(); virtual void ReleaseGraphics( SalGraphics* pGraphics ); - virtual BOOL Setup( SalFrame* pFrame, ImplJobSetup* pSetupData ); - virtual BOOL SetPrinterData( ImplJobSetup* pSetupData ); - virtual BOOL SetData( ULONG nFlags, ImplJobSetup* pSetupData ); + virtual sal_Bool Setup( SalFrame* pFrame, ImplJobSetup* pSetupData ); + virtual sal_Bool SetPrinterData( ImplJobSetup* pSetupData ); + virtual sal_Bool SetData( sal_uInt32 nFlags, ImplJobSetup* pSetupData ); virtual void GetPageInfo( const ImplJobSetup* pSetupData, long& rOutWidth, long& rOutHeight, long& rPageOffX, long& rPageOffY, long& rPageWidth, long& rPageHeight ); - virtual ULONG GetCapabilities( const ImplJobSetup* pSetupData, USHORT nType ); - virtual ULONG GetPaperBinCount( const ImplJobSetup* pSetupData ); - virtual String GetPaperBinName( const ImplJobSetup* pSetupData, ULONG nPaperBin ); + virtual sal_uInt32 GetCapabilities( const ImplJobSetup* pSetupData, sal_uInt16 nType ); + virtual sal_uInt32 GetPaperBinCount( const ImplJobSetup* pSetupData ); + virtual String GetPaperBinName( const ImplJobSetup* pSetupData, sal_uInt32 nPaperBin ); virtual void InitPaperFormats( const ImplJobSetup* pSetupData ); virtual int GetLandscapeAngle( const ImplJobSetup* pSetupData ); }; @@ -76,7 +76,7 @@ public: psp::PrinterJob m_aPrintJob; psp::JobData m_aJobData; psp::PrinterGfx m_aPrinterGfx; - ULONG m_nCopies; + sal_uInt32 m_nCopies; bool m_bCollate; SalInfoPrinter* m_pInfoPrinter; @@ -85,23 +85,23 @@ public: // overload all pure virtual methods using SalPrinter::StartJob; - virtual BOOL StartJob( const XubString* pFileName, + virtual sal_Bool StartJob( const XubString* pFileName, const XubString& rJobName, const XubString& rAppName, - ULONG nCopies, + sal_uInt32 nCopies, bool bCollate, bool bDirect, ImplJobSetup* pSetupData ); - virtual BOOL StartJob( const String*, + virtual sal_Bool StartJob( const String*, const String&, const String&, ImplJobSetup*, vcl::PrinterController& i_rController ); - virtual BOOL EndJob(); - virtual BOOL AbortJob(); - virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, BOOL bNewJobData ); - virtual BOOL EndPage(); - virtual ULONG GetErrorCode(); + virtual sal_Bool EndJob(); + virtual sal_Bool AbortJob(); + virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, sal_Bool bNewJobData ); + virtual sal_Bool EndPage(); + virtual sal_uInt32 GetErrorCode(); }; class Timer; diff --git a/vcl/unx/inc/saltimer.h b/vcl/unx/inc/saltimer.h index 132107d705f8..8f0512d47468 100644 --- a/vcl/unx/inc/saltimer.h +++ b/vcl/unx/inc/saltimer.h @@ -37,7 +37,7 @@ public: virtual ~X11SalTimer(); // overload all pure virtual methods - void Start( ULONG nMS ); + void Start( sal_uInt32 nMS ); void Stop(); }; diff --git a/vcl/unx/inc/salunx.h b/vcl/unx/inc/salunx.h index ef53273b60b4..8c543af39f29 100644 --- a/vcl/unx/inc/salunx.h +++ b/vcl/unx/inc/salunx.h @@ -68,7 +68,7 @@ inline int operator == ( const timeval &t1, const timeval &t2 ) { if( t1.tv_sec == t2.tv_sec ) return t1.tv_usec == t2.tv_usec; - return FALSE; + return sal_False; } inline timeval &operator -= ( timeval &t1, const timeval &t2 ) @@ -95,7 +95,7 @@ inline timeval &operator += ( timeval &t1, const timeval &t2 ) return t1; } -inline timeval &operator += ( timeval &t1, ULONG t2 ) +inline timeval &operator += ( timeval &t1, sal_uInt32 t2 ) { t1.tv_sec += t2 / 1000; t1.tv_usec += t2 ? (t2 % 1000) * 1000 : 500; @@ -113,7 +113,7 @@ inline timeval operator + ( const timeval &t1, const timeval &t2 ) return t0 += t2; } -inline timeval operator + ( const timeval &t1, ULONG t2 ) +inline timeval operator + ( const timeval &t1, sal_uInt32 t2 ) { timeval t0 = t1; return t0 += t2; diff --git a/vcl/unx/inc/salvd.h b/vcl/unx/inc/salvd.h index 3d8c681c4e22..c6bf12165ae9 100644 --- a/vcl/unx/inc/salvd.h +++ b/vcl/unx/inc/salvd.h @@ -48,17 +48,17 @@ class X11SalVirtualDevice : public SalVirtualDevice int nDX_; int nDY_; - USHORT nDepth_; - BOOL bGraphics_; // is Graphics used - BOOL bExternPixmap_; + sal_uInt16 nDepth_; + sal_Bool bGraphics_; // is Graphics used + sal_Bool bExternPixmap_; public: X11SalVirtualDevice(); virtual ~X11SalVirtualDevice(); - BOOL Init( SalDisplay *pDisplay, + sal_Bool Init( SalDisplay *pDisplay, long nDX, long nDY, - USHORT nBitCount, + sal_uInt16 nBitCount, int nScreen, Pixmap hDrawable = None, void* pRenderFormat = NULL ); @@ -66,9 +66,9 @@ public: inline Display *GetXDisplay() const; inline SalDisplay *GetDisplay() const; - inline BOOL IsDisplay() const; + inline sal_Bool IsDisplay() const; inline Pixmap GetDrawable() const { return hDrawable_; } - inline USHORT GetDepth() const { return nDepth_; } + inline sal_uInt16 GetDepth() const { return nDepth_; } int GetWidth() const { return nDX_; } int GetHeight() const { return nDY_; } int GetScreenNumber() const { return m_nScreen; } @@ -77,7 +77,7 @@ public: virtual void ReleaseGraphics( SalGraphics* pGraphics ); // Set new size, without saving the old contents - virtual BOOL SetSize( long nNewDX, long nNewDY ); + virtual sal_Bool SetSize( long nNewDX, long nNewDY ); virtual void GetSize( long& rWidth, long& rHeight ); }; @@ -92,7 +92,7 @@ inline Display *X11SalVirtualDevice::GetXDisplay() const inline SalDisplay *X11SalVirtualDevice::GetDisplay() const { return pDisplay_; } -inline BOOL X11SalVirtualDevice::IsDisplay() const +inline sal_Bool X11SalVirtualDevice::IsDisplay() const { return pDisplay_->IsDisplay(); } #endif diff --git a/vcl/unx/inc/soicon.hxx b/vcl/unx/inc/soicon.hxx index 419f9b2cc54a..4efaea4e736f 100644 --- a/vcl/unx/inc/soicon.hxx +++ b/vcl/unx/inc/soicon.hxx @@ -31,7 +31,7 @@ class SalDisplay; class SalBitmap; class Bitmap; -BOOL SelectAppIconPixmap( SalDisplay *pDisplay, int nScreen, - USHORT nIcon, USHORT iconSize, +sal_Bool SelectAppIconPixmap( SalDisplay *pDisplay, int nScreen, + sal_uInt16 nIcon, sal_uInt16 iconSize, Pixmap& icon_pixmap, Pixmap& icon_mask ); #endif diff --git a/vcl/unx/inc/xfont.hxx b/vcl/unx/inc/xfont.hxx index 4041ed7ce67d..c138dc36d34a 100644 --- a/vcl/unx/inc/xfont.hxx +++ b/vcl/unx/inc/xfont.hxx @@ -44,7 +44,7 @@ class ExtendedXlfd; struct VerticalTextItem { - BOOL mbFixed; + sal_Bool mbFixed; XFontStruct* mpXFontStruct; const sal_Unicode* mpString; int mnLength; @@ -59,7 +59,7 @@ struct VerticalTextItem int nTransX, int nTransY, int nFixedAdvance ) - : mbFixed( TRUE ), + : mbFixed( sal_True ), mpXFontStruct( pXFontStruct ), mpString( pString ), mnLength( nLength ), @@ -74,7 +74,7 @@ struct VerticalTextItem int nTransX, int nTransY, int* pAdvanceAry ) - : mbFixed( FALSE ), + : mbFixed( sal_False ), mpXFontStruct( pXFontStruct ), mpString( pString ), mnLength( nLength ), diff --git a/vcl/unx/kde/kdedata.cxx b/vcl/unx/kde/kdedata.cxx index 34b0ff652cde..ae3938b4fbb9 100644 --- a/vcl/unx/kde/kdedata.cxx +++ b/vcl/unx/kde/kdedata.cxx @@ -137,7 +137,7 @@ void KDEXLib::Init() "http://artax.karlin.mff.cuni.cz/~kendy" ); m_nFakeCmdLineArgs = 1; - USHORT nIdx; + sal_uInt16 nIdx; vos::OExtCommandLine aCommandLine; int nParams = aCommandLine.getCommandArgCount(); rtl::OString aDisplay; diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx index 29d79f88ffb3..b92b05abc653 100644 --- a/vcl/unx/kde/salnativewidgets-kde.cxx +++ b/vcl/unx/kde/salnativewidgets-kde.cxx @@ -242,7 +242,7 @@ class WidgetPainter @param gc The graphics context. */ - BOOL drawStyledWidget( QWidget *pWidget, + sal_Bool drawStyledWidget( QWidget *pWidget, ControlState nState, const ImplControlValue& aValue, Display *dpy, XLIB_Window drawable, int nScreen, int nDepth, GC gc, ControlPart nPart = PART_ENTIRE_CONTROL ); @@ -255,7 +255,7 @@ class WidgetPainter @return valid push button. */ - QPushButton *pushButton( const Rectangle& rControlRegion, BOOL bDefault ); + QPushButton *pushButton( const Rectangle& rControlRegion, sal_Bool bDefault ); /** 'Get' method for radio button. @@ -276,7 +276,7 @@ class WidgetPainter @see pushButton(), m_pEditableComboBox */ - QComboBox *comboBox( const Rectangle& rControlRegion, BOOL bEditable ); + QComboBox *comboBox( const Rectangle& rControlRegion, sal_Bool bEditable ); /** 'Get' method for line edit box. @@ -313,13 +313,13 @@ class WidgetPainter @see pushButton() */ QScrollBar *scrollBar( const Rectangle& rControlRegion, - BOOL bHorizontal, const ImplControlValue& aValue ); + sal_Bool bHorizontal, const ImplControlValue& aValue ); /** 'Get' method for tool bar. @see pushButton() */ - QToolBar *toolBar( const Rectangle& rControlRegion, BOOL bHorizontal ); + QToolBar *toolBar( const Rectangle& rControlRegion, sal_Bool bHorizontal ); /** 'Get' method for tool button. @@ -430,13 +430,13 @@ WidgetPainter::~WidgetPainter( void ) delete m_pProgressBar, m_pProgressBar = NULL; } -BOOL WidgetPainter::drawStyledWidget( QWidget *pWidget, +sal_Bool WidgetPainter::drawStyledWidget( QWidget *pWidget, ControlState nState, const ImplControlValue& aValue, Display *dpy, XLIB_Window drawable, int nScreen, int nDepth, GC gc, ControlPart nPart ) { if ( !pWidget ) - return FALSE; + return sal_False; // Normalize the widget QPoint qWidgetPos( pWidget->pos() ); @@ -591,7 +591,7 @@ BOOL WidgetPainter::drawStyledWidget( QWidget *pWidget, pTab = m_pTabMiddle; } if ( !pTab ) - return FALSE; + return sal_False; pTab->setRect( qRect ); @@ -779,7 +779,7 @@ BOOL WidgetPainter::drawStyledWidget( QWidget *pWidget, pWidget->colorGroup(), nStyle ); } else - return FALSE; + return sal_False; // Bitblt it to the screen X11SalGraphics::CopyScreenArea( dpy, @@ -792,11 +792,11 @@ BOOL WidgetPainter::drawStyledWidget( QWidget *pWidget, // Restore widget's position pWidget->move( qWidgetPos ); - return TRUE; + return sal_True; } QPushButton *WidgetPainter::pushButton( const Rectangle& rControlRegion, - BOOL bDefault ) + sal_Bool bDefault ) { if ( !m_pPushButton ) m_pPushButton = new QPushButton( NULL, "push_button" ); @@ -891,7 +891,7 @@ QCheckBox *WidgetPainter::checkBox( const Rectangle& rControlRegion ) } QComboBox *WidgetPainter::comboBox( const Rectangle& rControlRegion, - BOOL bEditable ) + sal_Bool bEditable ) { QComboBox *pComboBox = NULL; if ( bEditable ) @@ -1004,7 +1004,7 @@ QListView *WidgetPainter::listView( const Rectangle& rControlRegion ) } QScrollBar *WidgetPainter::scrollBar( const Rectangle& rControlRegion, - BOOL bHorizontal, const ImplControlValue& aValue ) + sal_Bool bHorizontal, const ImplControlValue& aValue ) { if ( !m_pScrollBar ) { @@ -1031,7 +1031,7 @@ QScrollBar *WidgetPainter::scrollBar( const Rectangle& rControlRegion, return m_pScrollBar; } -QToolBar *WidgetPainter::toolBar( const Rectangle& rControlRegion, BOOL bHorizontal ) +QToolBar *WidgetPainter::toolBar( const Rectangle& rControlRegion, sal_Bool bHorizontal ) { if ( !m_pMainWindow ) m_pMainWindow = new QMainWindow( NULL, "main_window" ); @@ -1172,19 +1172,19 @@ class KDESalGraphics : public X11SalGraphics public: KDESalGraphics() {} virtual ~KDESalGraphics() {} - virtual BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart ); - virtual BOOL hitTestNativeControl( ControlType nType, ControlPart nPart, + virtual sal_Bool IsNativeControlSupported( ControlType nType, ControlPart nPart ); + virtual sal_Bool hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, const Point& aPos, - BOOL& rIsInside ); - virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart, + sal_Bool& rIsInside ); + virtual sal_Bool drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState, const ImplControlValue& aValue, const OUString& aCaption ); - virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart, + virtual sal_Bool drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState, const ImplControlValue& aValue, const OUString& aCaption ); - virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart, + virtual sal_Bool getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState, const ImplControlValue& aValue, const OUString& aCaption, @@ -1199,10 +1199,10 @@ class KDESalGraphics : public X11SalGraphics @param nPart Specification of the widget's part if it consists of more than one. - @return TRUE if the platform supports native drawing of the widget nType + @return sal_True if the platform supports native drawing of the widget nType defined by nPart. */ -BOOL KDESalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart ) +sal_Bool KDESalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart ) { return ( (nType == CTRL_PUSHBUTTON) && (nPart == PART_ENTIRE_CONTROL) ) || @@ -1234,21 +1234,21 @@ BOOL KDESalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP /** Test whether the position is in the native widget. - If the return value is TRUE, bIsInside contains information whether + If the return value is sal_True, bIsInside contains information whether aPos was or was not inside the native widget specified by the nType/nPart combination. */ -BOOL KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, +sal_Bool KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, const Point& rPos, - BOOL& rIsInside ) + sal_Bool& rIsInside ) { if ( nType == CTRL_SCROLLBAR ) { // make position relative to rControlRegion Point aPos = rPos - rControlRegion.TopLeft(); - rIsInside = FALSE; + rIsInside = sal_False; - BOOL bHorizontal = ( nPart == PART_BUTTON_LEFT || nPart == PART_BUTTON_RIGHT ); + sal_Bool bHorizontal = ( nPart == PART_BUTTON_LEFT || nPart == PART_BUTTON_RIGHT ); QScrollBar *pScrollBar = pWidgetPainter->scrollBar( rControlRegion, bHorizontal, ImplControlValue() ); @@ -1258,10 +1258,10 @@ BOOL KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, QStyle::CC_ScrollBar, pScrollBar, QStyle::SC_ScrollBarAddLine ); // There are 2 buttons on the right/bottom side of the scrollbar - BOOL bTwoSubButtons = FALSE; + sal_Bool bTwoSubButtons = sal_False; // It is a Platinum style scroll bar - BOOL bPlatinumStyle = FALSE; + sal_Bool bPlatinumStyle = sal_False; // Workaround for Platinum and 3 button style scroll bars. // It makes the right/down button bigger. @@ -1271,9 +1271,9 @@ BOOL KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, QStyle::CC_ScrollBar, pScrollBar, QStyle::SC_ScrollBarAddPage ).right() + 1 ); if ( qRectAddLine.width() > qRectSubLine.width() ) - bTwoSubButtons = TRUE; + bTwoSubButtons = sal_True; if ( qRectSubLine.left() > kapp->style().querySubControlMetrics( QStyle::CC_ScrollBar, pScrollBar, QStyle::SC_ScrollBarSubPage ).left() ) - bPlatinumStyle = TRUE; + bPlatinumStyle = sal_True; } else { @@ -1281,16 +1281,16 @@ BOOL KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, QStyle::CC_ScrollBar, pScrollBar, QStyle::SC_ScrollBarAddPage ).bottom() + 1 ); if ( qRectAddLine.height() > qRectSubLine.height() ) - bTwoSubButtons = TRUE; + bTwoSubButtons = sal_True; if ( qRectSubLine.top() > kapp->style().querySubControlMetrics( QStyle::CC_ScrollBar, pScrollBar, QStyle::SC_ScrollBarSubPage ).top() ) - bPlatinumStyle = TRUE; + bPlatinumStyle = sal_True; } switch ( nPart ) { case PART_BUTTON_LEFT: if ( !bPlatinumStyle && qRectSubLine.contains( aPos.getX(), aPos.getY() ) ) - rIsInside = TRUE; + rIsInside = sal_True; else if ( bTwoSubButtons ) { qRectAddLine.setWidth( qRectAddLine.width() / 2 ); @@ -1300,7 +1300,7 @@ BOOL KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, case PART_BUTTON_UP: if ( !bPlatinumStyle && qRectSubLine.contains( aPos.getX(), aPos.getY() ) ) - rIsInside = TRUE; + rIsInside = sal_True; else if ( bTwoSubButtons ) { qRectAddLine.setHeight( qRectAddLine.height() / 2 ); @@ -1324,13 +1324,13 @@ BOOL KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, // cases PART_TRACK_HORZ_AREA and PART_TRACK_VERT_AREA default: - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } @@ -1345,12 +1345,12 @@ BOOL KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, @param aCaption A caption or title string (like button text etc.) */ -BOOL KDESalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, +sal_Bool KDESalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState, const ImplControlValue& aValue, const OUString& ) { - BOOL bReturn = FALSE; + sal_Bool bReturn = sal_False; Display *dpy = GetXDisplay(); XLIB_Window drawable = GetDrawable(); @@ -1380,7 +1380,7 @@ BOOL KDESalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, else if ( (nType == CTRL_COMBOBOX) && (nPart == PART_ENTIRE_CONTROL) ) { bReturn = pWidgetPainter->drawStyledWidget( - pWidgetPainter->comboBox( rControlRegion, TRUE ), + pWidgetPainter->comboBox( rControlRegion, sal_True ), nState, aValue, dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc ); } @@ -1394,7 +1394,7 @@ BOOL KDESalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, else if ( (nType == CTRL_LISTBOX) && (nPart == PART_ENTIRE_CONTROL) ) { bReturn = pWidgetPainter->drawStyledWidget( - pWidgetPainter->comboBox( rControlRegion, FALSE ), + pWidgetPainter->comboBox( rControlRegion, sal_False ), nState, aValue, dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc ); } @@ -1487,17 +1487,17 @@ BOOL KDESalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, @param aCaption A caption or title string (like button text etc.) */ -BOOL KDESalGraphics::drawNativeControlText( ControlType, ControlPart, +sal_Bool KDESalGraphics::drawNativeControlText( ControlType, ControlPart, const Rectangle&, ControlState, const ImplControlValue&, const OUString& ) { - return FALSE; + return sal_False; } /** Check if the bounding regions match. - If the return value is TRUE, rNativeBoundingRegion + If the return value is sal_True, rNativeBoundingRegion contains the true bounding region covered by the control including any adornment, while rNativeContentRegion contains the area within the control that can be safely drawn into without drawing over @@ -1512,13 +1512,13 @@ BOOL KDESalGraphics::drawNativeControlText( ControlType, ControlPart, @param aCaption A caption or title string (like button text etc.) */ -BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart, +sal_Bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState, const ImplControlValue&, const OUString&, Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion ) { - BOOL bReturn = FALSE; + sal_Bool bReturn = sal_False; QRect qBoundingRect = WidgetPainter::region2QRect( rControlRegion ); QRect qRect; @@ -1540,7 +1540,7 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar QStyle::PM_ButtonDefaultIndicator, pWidget ); qBoundingRect.addCoords( -nIndicatorSize, -nIndicatorSize, nIndicatorSize, nIndicatorSize ); - bReturn = TRUE; + bReturn = sal_True; } break; } @@ -1555,7 +1555,7 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar qRect.setWidth( kapp->style().pixelMetric( QStyle::PM_ExclusiveIndicatorWidth, pWidget ) ); qRect.setHeight( kapp->style().pixelMetric( QStyle::PM_ExclusiveIndicatorHeight, pWidget ) ); - bReturn = TRUE; + bReturn = sal_True; } break; @@ -1568,7 +1568,7 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar qRect.setWidth( kapp->style().pixelMetric( QStyle::PM_IndicatorWidth, pWidget ) ); qRect.setHeight( kapp->style().pixelMetric( QStyle::PM_IndicatorHeight, pWidget ) ); - bReturn = TRUE; + bReturn = sal_True; } break; @@ -1585,14 +1585,14 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar QStyle::CC_ComboBox, pWidget, QStyle::SC_ComboBoxEditField ).right() + 1 ); qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() ); - bReturn = TRUE; + bReturn = sal_True; break; case PART_SUB_EDIT: qRect = kapp->style().querySubControlMetrics( QStyle::CC_ComboBox, pWidget, QStyle::SC_ComboBoxEditField ); qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() ); - bReturn = TRUE; + bReturn = sal_True; break; } break; @@ -1605,14 +1605,14 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar case PART_BUTTON_UP: qRect = kapp->style().querySubControlMetrics( QStyle::CC_SpinWidget, pWidget, QStyle::SC_SpinWidgetUp ); - bReturn = TRUE; + bReturn = sal_True; qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() ); break; case PART_BUTTON_DOWN: qRect = kapp->style().querySubControlMetrics( QStyle::CC_SpinWidget, pWidget, QStyle::SC_SpinWidgetDown ); - bReturn = TRUE; + bReturn = sal_True; qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() ); break; @@ -1620,7 +1620,7 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar qRect = kapp->style().querySubControlMetrics( QStyle::CC_SpinWidget, pWidget, QStyle::SC_SpinWidgetEditField ); qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() ); - bReturn = TRUE; + bReturn = sal_True; break; } break; @@ -1662,7 +1662,7 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() ); - bReturn = TRUE; + bReturn = sal_True; break; case PART_BUTTON_RIGHT: @@ -1683,7 +1683,7 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() ); - bReturn = TRUE; + bReturn = sal_True; break; } break; @@ -1710,12 +1710,12 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar // KDESalFrame implementation // ----------------------------------------------------------------------- -KDESalFrame::KDESalFrame( SalFrame* pParent, ULONG nStyle ) : +KDESalFrame::KDESalFrame( SalFrame* pParent, sal_uInt32 nStyle ) : X11SalFrame( pParent, nStyle ) { } -void KDESalFrame::Show( BOOL bVisible, BOOL bNoActivate ) +void KDESalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate ) { if ( !GetParent() && ! (GetStyle() & SAL_FRAME_STYLE_INTRO) ) { @@ -1928,9 +1928,9 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings ) { Color aColor2 = aStyleSettings.GetLightColor(); aStyleSettings. - SetCheckedColor( Color( (BYTE)(((USHORT)aBack.GetRed()+(USHORT)aColor2.GetRed())/2), - (BYTE)(((USHORT)aBack.GetGreen()+(USHORT)aColor2.GetGreen())/2), - (BYTE)(((USHORT)aBack.GetBlue()+(USHORT)aColor2.GetBlue())/2) + SetCheckedColor( Color( (sal_uInt8)(((sal_uInt16)aBack.GetRed()+(sal_uInt16)aColor2.GetRed())/2), + (sal_uInt8)(((sal_uInt16)aBack.GetGreen()+(sal_uInt16)aColor2.GetGreen())/2), + (sal_uInt8)(((sal_uInt16)aBack.GetBlue()+(sal_uInt16)aColor2.GetBlue())/2) ) ); } @@ -1962,7 +1962,7 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings ) qMainWindow.createGUI( "/dev/null" ); // hack // Menu - aStyleSettings.SetSkipDisabledInMenus( TRUE ); + aStyleSettings.SetSkipDisabledInMenus( sal_True ); KMenuBar *pMenuBar = qMainWindow.menuBar(); if ( pMenuBar ) { @@ -2083,7 +2083,7 @@ KDESalFrame::GraphicsHolder::~GraphicsHolder() // ----------------------------------------------------------------------- SalFrame * -KDESalInstance::CreateFrame( SalFrame *pParent, ULONG nStyle ) +KDESalInstance::CreateFrame( SalFrame *pParent, sal_uInt32 nStyle ) { return new KDESalFrame( pParent, nStyle ); } diff --git a/vcl/unx/source/app/i18n_cb.cxx b/vcl/unx/source/app/i18n_cb.cxx index d3a4f2b819ae..9756c728250d 100644 --- a/vcl/unx/source/app/i18n_cb.cxx +++ b/vcl/unx/source/app/i18n_cb.cxx @@ -284,12 +284,12 @@ Preedit_UpdateAttributes ( preedit_text_t* ptext, XIMFeedback* feedback, // Convert the XIM feedback values into appropriate VCL // SAL_EXTTEXTINPUT_ATTR values // returns an allocate list of attributes, which must be freed by caller -USHORT* -Preedit_FeedbackToSAL ( XIMFeedback* pfeedback, int nlength, std::vector& rSalAttr ) +sal_uInt16* +Preedit_FeedbackToSAL ( XIMFeedback* pfeedback, int nlength, std::vector& rSalAttr ) { - USHORT *psalattr; - USHORT nval; - USHORT noldval = 0; + sal_uInt16 *psalattr; + sal_uInt16 nval; + sal_uInt16 noldval = 0; XIMFeedback nfeedback; // only work with reasonable length @@ -299,7 +299,7 @@ Preedit_FeedbackToSAL ( XIMFeedback* pfeedback, int nlength, std::vector psalattr = &rSalAttr[0]; } else - return (USHORT*)NULL; + return (sal_uInt16*)NULL; for (int npos = 0; npos < nlength; npos++) { diff --git a/vcl/unx/source/app/i18n_ic.cxx b/vcl/unx/source/app/i18n_ic.cxx index 3064be9367e1..46471d553dda 100644 --- a/vcl/unx/source/app/i18n_ic.cxx +++ b/vcl/unx/source/app/i18n_ic.cxx @@ -187,7 +187,7 @@ SalI18N_InputContext::SalI18N_InputContext ( SalFrame *pFrame ) : maClientData.aInputEv.mnCursorPos = 0; maClientData.aInputEv.mnDeltaStart = 0; maClientData.aInputEv.mnCursorFlags = 0; - maClientData.aInputEv.mbOnlyCursor = FALSE; + maClientData.aInputEv.mbOnlyCursor = sal_False; SalI18N_InputMethod *pInputMethod; pInputMethod = GetX11SalData()->GetDisplay()->GetInputMethod(); @@ -763,7 +763,7 @@ SalI18N_InputContext::SetLanguage(LanguageType) } void -SalI18N_InputContext::EndExtTextInput( USHORT /*nFlags*/ ) +SalI18N_InputContext::EndExtTextInput( sal_uInt16 /*nFlags*/ ) { if ( mbUseable && (maContext != NULL) && maClientData.pFrame ) { diff --git a/vcl/unx/source/app/i18n_status.cxx b/vcl/unx/source/app/i18n_status.cxx index 3a6ae26a2b0e..8937a71c905f 100644 --- a/vcl/unx/source/app/i18n_status.cxx +++ b/vcl/unx/source/app/i18n_status.cxx @@ -102,7 +102,7 @@ class XIMStatusWindow : public StatusWindow // for delayed showing bool m_bDelayedShow; I18NStatus::ShowReason m_eDelayedReason; - ULONG m_nDelayedEvent; + sal_uInt32 m_nDelayedEvent; // for toggling bool m_bOn; @@ -165,7 +165,7 @@ void XIMStatusWindow::layout() m_aStatusText.SetPosSizePixel( Point( 1, 1 ), aControlSize ); m_aStatusText.SetFont( aFont ); - m_aStatusText.Show( TRUE ); + m_aStatusText.Show( sal_True ); if (m_bAnchoredAtRight && IsVisible()) { @@ -257,7 +257,7 @@ void XIMStatusWindow::setPosition( SalFrame* pParent ) { setText( String() ); m_pLastParent = pParent; - Show( FALSE, SHOW_NOACTIVATE ); + Show( sal_False, SHOW_NOACTIVATE ); } if( IsVisible() ) { @@ -359,7 +359,7 @@ IIIMPStatusWindow::IIIMPStatusWindow( SalFrame* pParent, bool bOn ) : m_aStatusBtn.SetSelectHdl( LINK( this, IIIMPStatusWindow, SelectHdl ) ); m_aStatusBtn.SetPopupMenu( &m_aMenu ); - m_aStatusBtn.Show( TRUE ); + m_aStatusBtn.Show( sal_True ); const ::std::vector< I18NStatus::ChoiceData >& rChoices( I18NStatus::get().getChoices() ); int i = 1; @@ -384,7 +384,7 @@ IIIMPStatusWindow::IIIMPStatusWindow( SalFrame* pParent, bool bOn ) : else fprintf( stderr, "Warning: could not reposition status window since no frame\n" ); #endif - EnableAlwaysOnTop( TRUE ); + EnableAlwaysOnTop( sal_True ); } IIIMPStatusWindow::~IIIMPStatusWindow() diff --git a/vcl/unx/source/app/keysymnames.cxx b/vcl/unx/source/app/keysymnames.cxx index c9515f016433..b48f0e629bd9 100644 --- a/vcl/unx/source/app/keysymnames.cxx +++ b/vcl/unx/source/app/keysymnames.cxx @@ -597,7 +597,7 @@ static const keyboard_layout type6_layout[] = #include #endif -const char* SalDisplay::GetKeyboardName( BOOL bRefresh ) +const char* SalDisplay::GetKeyboardName( sal_Bool bRefresh ) { if( bRefresh || ! m_aKeyboardName.Len() ) { diff --git a/vcl/unx/source/app/saldata.cxx b/vcl/unx/source/app/saldata.cxx index beb7b60a551c..b14c11ac783e 100644 --- a/vcl/unx/source/app/saldata.cxx +++ b/vcl/unx/source/app/saldata.cxx @@ -408,7 +408,7 @@ void SalXLib::Init() sal_uInt32 nParams = aCommandLine.getCommandArgCount(); rtl::OUString aParam; rtl::OString aDisplay; - for (USHORT i=0; i= '0' && Host1.toChar() <= '9' ) pHostAddr1 = osl_createInetSocketAddr( Host1.pData, 0 ); @@ -273,7 +273,7 @@ sal_EqualHosts( const OUString& Host1, const OUString& Host2) pHostAddr2 = osl_resolveHostname( Host2.pData ); if( pHostAddr1 && pHostAddr2 ) - bEqualAddress = osl_isEqualSocketAddr( pHostAddr1, pHostAddr2 ) ? TRUE : FALSE; + bEqualAddress = osl_isEqualSocketAddr( pHostAddr1, pHostAddr2 ) ? sal_True : sal_False; if( pHostAddr1 ) osl_destroySocketAddr( pHostAddr1 ); @@ -283,14 +283,14 @@ sal_EqualHosts( const OUString& Host1, const OUString& Host2) return bEqualAddress; } -static BOOL +static sal_Bool sal_IsLocalDisplay( Display *pDisplay ) { const char *pDisplayString = DisplayString( pDisplay ); // no string, no idea if ( pDisplayString == NULL || pDisplayString[ 0 ] == '\0') - return FALSE; + return sal_False; // check for ":x.y" if ( pDisplayString[ 0 ] == ':' ) @@ -314,7 +314,7 @@ sal_IsLocalDisplay( Display *pDisplay ) // compare local hostname to displaystring, both may be ip address or // hostname - BOOL bEqual = FALSE; + sal_Bool bEqual = sal_False; char *pDisplayHost = strdup( pDisplayString ); char *pPtr = strrchr( pDisplayHost, ':' ); @@ -339,14 +339,14 @@ sal_IsLocalDisplay( Display *pDisplay ) // since it is not called very often and sal_IsLocalDisplay() is relative // expensive bLocal_ is initialized on first call -BOOL SalDisplay::IsLocal() +sal_Bool SalDisplay::IsLocal() { if ( ! mbLocalIsValid ) { bLocal_ = sal_IsLocalDisplay( pDisp_ ); - mbLocalIsValid = TRUE; + mbLocalIsValid = sal_True; } - return (BOOL)bLocal_; + return (sal_Bool)bLocal_; } // --------------------------------------------------------------------------- @@ -411,7 +411,7 @@ static sal_Bool sal_IsTrustedSolaris (Display *p_display) // -=-= SalDisplay -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -BOOL SalDisplay::BestVisual( Display *pDisplay, +sal_Bool SalDisplay::BestVisual( Display *pDisplay, int nScreen, XVisualInfo &rVI ) { @@ -436,51 +436,51 @@ BOOL SalDisplay::BestVisual( Display *pDisplay, int i; for( i = 0; i < nVisuals; i++ ) { - BOOL bUsable = FALSE; + sal_Bool bUsable = sal_False; int nTrueColor = 1; if ( pVInfos[i].screen != nScreen ) { - bUsable = FALSE; + bUsable = sal_False; } else if( pVInfos[i].c_class == TrueColor ) { nTrueColor = 2048; if( pVInfos[i].depth == 24 ) - bUsable = TRUE; -#ifdef TRUECOLOR8 + bUsable = sal_True; +#ifdef sal_TrueCOLOR8 else if( pVInfos[i].depth == 8 ) { nTrueColor = -1; // strongly discourage 8 bit true color - bUsable = TRUE; + bUsable = sal_True; } #endif -#ifdef TRUECOLOR15 +#ifdef sal_TrueCOLOR15 else if( pVInfos[i].depth == 15 ) - bUsable = TRUE; + bUsable = sal_True; #endif -#ifdef TRUECOLOR16 +#ifdef sal_TrueCOLOR16 else if( pVInfos[i].depth == 16 ) - bUsable = TRUE; + bUsable = sal_True; #endif -#ifdef TRUECOLOR32 +#ifdef sal_TrueCOLOR32 else if( pVInfos[i].depth == 32 ) { nTrueColor = 256; // we do not have use for an alpha channel // better use a 24 or 16 bit truecolor visual if possible - bUsable = TRUE; + bUsable = sal_True; } #endif } else if( pVInfos[i].c_class == PseudoColor ) { if( pVInfos[i].depth <= 8 ) - bUsable = TRUE; + bUsable = sal_True; #ifdef PSEUDOCOLOR12 else if( pVInfos[i].depth == 12 ) - bUsable = TRUE; + bUsable = sal_True; #endif } pWeight[ i ] = bUsable ? nTrueColor*pVInfos[i].depth : -1024; @@ -645,7 +645,7 @@ fd GetSalData()->m_pInstance->GetYieldMutex(); ::vos::OGuard aGuard( *pSalInstYieldMutex ); pDisplay->Yield(); - return TRUE; + return sal_True; } SalX11Display::SalX11Display( Display *display ) @@ -855,9 +855,9 @@ void SalDisplay::Init() X11SalBitmap::ImplCreateCache(); hEventGuard_ = osl_createMutex(); - bLocal_ = FALSE; /* dont care, initialize later by + bLocal_ = sal_False; /* dont care, initialize later by calling SalDisplay::IsLocal() */ - mbLocalIsValid = FALSE; /* bLocal_ is not yet initialized */ + mbLocalIsValid = sal_False; /* bLocal_ is not yet initialized */ // - - - - - - - - - - Synchronize - - - - - - - - - - - - - if( getenv( "SAL_SYNCHRONIZE" ) ) @@ -1105,7 +1105,7 @@ void SalDisplay::ModifierMapping() } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -XubString SalDisplay::GetKeyName( USHORT nKeyCode ) const +XubString SalDisplay::GetKeyName( sal_uInt16 nKeyCode ) const { String aStrMap; @@ -1288,27 +1288,27 @@ XubString SalDisplay::GetKeyName( USHORT nKeyCode ) const #define IsISOKey( n ) (0x0000FE00==((n)&0xFFFFFF00)) #endif -USHORT SalDisplay::GetKeyCode( KeySym keysym, char*pcPrintable ) const +sal_uInt16 SalDisplay::GetKeyCode( KeySym keysym, char*pcPrintable ) const { - USHORT nKey = 0; + sal_uInt16 nKey = 0; if( XK_a <= keysym && XK_z >= keysym ) - nKey = (USHORT)(KEY_A + (keysym - XK_a)); + nKey = (sal_uInt16)(KEY_A + (keysym - XK_a)); else if( XK_A <= keysym && XK_Z >= keysym ) - nKey = (USHORT)(KEY_A + (keysym - XK_A)); + nKey = (sal_uInt16)(KEY_A + (keysym - XK_A)); else if( XK_0 <= keysym && XK_9 >= keysym ) - nKey = (USHORT)(KEY_0 + (keysym - XK_0)); + nKey = (sal_uInt16)(KEY_0 + (keysym - XK_0)); else if( IsModifierKey( keysym ) ) ; else if( IsKeypadKey( keysym ) ) { if( (keysym >= XK_KP_0) && (keysym <= XK_KP_9) ) { - nKey = (USHORT)(KEY_0 + (keysym - XK_KP_0)); + nKey = (sal_uInt16)(KEY_0 + (keysym - XK_KP_0)); *pcPrintable = '0' + nKey - KEY_0; } else if( IsPFKey( keysym ) ) - nKey = (USHORT)(KEY_F1 + (keysym - XK_KP_F1)); + nKey = (sal_uInt16)(KEY_F1 + (keysym - XK_KP_F1)); else switch( keysym ) { case XK_KP_Space: @@ -1387,7 +1387,7 @@ USHORT SalDisplay::GetKeyCode( KeySym keysym, char*pcPrintable ) const if( bNumLockFromXS_ ) { if( keysym >= XK_F1 && keysym <= XK_F26 ) - nKey = (USHORT)(KEY_F1 + keysym - XK_F1); + nKey = (sal_uInt16)(KEY_F1 + keysym - XK_F1); } else switch( keysym ) { @@ -1456,7 +1456,7 @@ USHORT SalDisplay::GetKeyCode( KeySym keysym, char*pcPrintable ) const break; default: if( keysym >= XK_F1 && keysym <= XK_F26 ) - nKey = (USHORT)(KEY_F1 + keysym - XK_F1); + nKey = (sal_uInt16)(KEY_F1 + keysym - XK_F1); break; } } @@ -2157,7 +2157,7 @@ int SalDisplay::CaptureMouse( SalFrame *pCapture ) // Events // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void SalDisplay::SendInternalEvent( SalFrame* pFrame, void* pData, USHORT nEvent ) +void SalDisplay::SendInternalEvent( SalFrame* pFrame, void* pData, sal_uInt16 nEvent ) { if( osl_acquireMutex( hEventGuard_ ) ) { @@ -2173,7 +2173,7 @@ void SalDisplay::SendInternalEvent( SalFrame* pFrame, void* pData, USHORT nEvent } } -void SalDisplay::CancelInternalEvent( SalFrame* pFrame, void* pData, USHORT nEvent ) +void SalDisplay::CancelInternalEvent( SalFrame* pFrame, void* pData, sal_uInt16 nEvent ) { if( osl_acquireMutex( hEventGuard_ ) ) { @@ -2200,29 +2200,29 @@ void SalDisplay::CancelInternalEvent( SalFrame* pFrame, void* pData, USHORT nEve } } -BOOL SalX11Display::IsEvent() +sal_Bool SalX11Display::IsEvent() { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( osl_acquireMutex( hEventGuard_ ) ) { if( m_aUserEvents.begin() != m_aUserEvents.end() ) - bRet = TRUE; + bRet = sal_True; osl_releaseMutex( hEventGuard_ ); } if( bRet || XEventsQueued( pDisp_, QueuedAlready ) ) - return TRUE; + return sal_True; XFlush( pDisp_ ); - return FALSE; + return sal_False; } bool SalDisplay::DispatchInternalEvent() { SalFrame* pFrame = NULL; void* pData = NULL; - USHORT nEvent = 0; + sal_uInt16 nEvent = 0; if( osl_acquireMutex( hEventGuard_ ) ) { @@ -2334,7 +2334,7 @@ long SalX11Display::Dispatch( XEvent *pEvent ) if( MappingModifier == pEvent->xmapping.request ) ModifierMapping(); if( MappingKeyboard == pEvent->xmapping.request ) // refresh mapping - GetKeyboardName( TRUE ); + GetKeyboardName( sal_True ); } break; case ButtonPress: @@ -2853,14 +2853,14 @@ SalVisual::~SalVisual() #define SALCOLOR RGB #define SALCOLORREVERSE BGR -BOOL SalVisual::Convert( int &n0, int &n1, int &n2, int &n3 ) +sal_Bool SalVisual::Convert( int &n0, int &n1, int &n2, int &n3 ) { int n; switch( GetMode() ) { case other: - return FALSE; + return sal_False; case SALCOLOR: break; case SALCOLORREVERSE: @@ -2885,17 +2885,17 @@ BOOL SalVisual::Convert( int &n0, int &n1, int &n2, int &n3 ) fprintf( stderr, "SalVisual::Convert %d\n", GetMode() ); abort(); } - return TRUE; + return sal_True; } -BOOL SalVisual::Convert( int &n0, int &n1, int &n2 ) +sal_Bool SalVisual::Convert( int &n0, int &n1, int &n2 ) { int n; switch( GetMode() ) { case other: - return FALSE; + return sal_False; case SALCOLOR: break; case RBG: @@ -2929,7 +2929,7 @@ BOOL SalVisual::Convert( int &n0, int &n1, int &n2 ) fprintf( stderr, "SalVisual::Convert %d\n", GetMode() ); abort(); } - return TRUE; + return sal_True; } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -3101,7 +3101,7 @@ SalColormap::SalColormap() } // TrueColor -SalColormap::SalColormap( USHORT nDepth ) +SalColormap::SalColormap( sal_uInt16 nDepth ) : m_pDisplay( GetX11SalData()->GetDisplay() ), m_hColormap( None ), m_nWhitePixel( (1 << nDepth) - 1 ), @@ -3251,14 +3251,14 @@ void SalColormap::GetPalette() } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -static USHORT sal_Lookup( const std::vector& rPalette, +static sal_uInt16 sal_Lookup( const std::vector& rPalette, int r, int g, int b, Pixel nUsed ) { - USHORT nPixel = 0; + sal_uInt16 nPixel = 0; int nBest = ColorDiff( rPalette[0], r, g, b ); - for( USHORT i = 1; i < nUsed; i++ ) + for( sal_uInt16 i = 1; i < nUsed; i++ ) { int n = ColorDiff( rPalette[i], r, g, b ); @@ -3276,7 +3276,7 @@ static USHORT sal_Lookup( const std::vector& rPalette, void SalColormap::GetLookupTable() { - m_aLookupTable = std::vector(16*16*16); + m_aLookupTable = std::vector(16*16*16); int i = 0; for( int r = 0; r < 256; r += 17 ) @@ -3326,7 +3326,7 @@ SalColor SalColormap::GetColor( Pixel nPixel ) const return MAKE_SALCOLOR( aColor.red>>8, aColor.green>>8, aColor.blue>>8 ); } -inline BOOL SalColormap::GetXPixel( XColor &rColor, +inline sal_Bool SalColormap::GetXPixel( XColor &rColor, int r, int g, int b ) const @@ -3337,15 +3337,15 @@ inline BOOL SalColormap::GetXPixel( XColor &rColor, return XAllocColor( GetXDisplay(), m_hColormap, &rColor ); } -BOOL SalColormap::GetXPixels( XColor &rColor, +sal_Bool SalColormap::GetXPixels( XColor &rColor, int r, int g, int b ) const { if( !GetXPixel( rColor, r, g, b ) ) - return FALSE; + return sal_False; if( rColor.pixel & 1 ) - return TRUE; + return sal_True; return GetXPixel( rColor, r^0xFF, g^0xFF, b^0xFF ); } @@ -3433,9 +3433,9 @@ Pixel SalColormap::GetPixel( SalColor nSalColor ) const } // Colormatching ueber Palette - USHORT r = SALCOLOR_RED ( nSalColor ); - USHORT g = SALCOLOR_GREEN( nSalColor ); - USHORT b = SALCOLOR_BLUE ( nSalColor ); + sal_uInt16 r = SALCOLOR_RED ( nSalColor ); + sal_uInt16 g = SALCOLOR_GREEN( nSalColor ); + sal_uInt16 b = SALCOLOR_BLUE ( nSalColor ); return m_aLookupTable[ (((r+8)/17) << 8) + (((g+8)/17) << 4) + ((b+8)/17) ]; diff --git a/vcl/unx/source/app/salinst.cxx b/vcl/unx/source/app/salinst.cxx index 88af0b70ef7e..9284f6aaa293 100644 --- a/vcl/unx/source/app/salinst.cxx +++ b/vcl/unx/source/app/salinst.cxx @@ -149,8 +149,8 @@ X11SalInstance::~X11SalInstance() struct PredicateReturn { - USHORT nType; - BOOL bRet; + sal_uInt16 nType; + sal_Bool bRet; }; extern "C" { @@ -161,7 +161,7 @@ Bool ImplPredicateEvent( Display *, XEvent *pEvent, char *pData ) if ( pPre->bRet ) return False; - USHORT nType; + sal_uInt16 nType; switch( pEvent->type ) { @@ -187,29 +187,29 @@ Bool ImplPredicateEvent( Display *, XEvent *pEvent, char *pData ) } if ( (nType & pPre->nType) || ( ! nType && (pPre->nType & INPUT_OTHER) ) ) - pPre->bRet = TRUE; + pPre->bRet = sal_True; return False; } } -bool X11SalInstance::AnyInput(USHORT nType) +bool X11SalInstance::AnyInput(sal_uInt16 nType) { X11SalData *pSalData = GetX11SalData(); Display *pDisplay = pSalData->GetDisplay()->GetDisplay(); - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( (nType & INPUT_TIMER) && pSalData->GetDisplay()->GetXLib()->CheckTimeout( false ) ) { - bRet = TRUE; + bRet = sal_True; } else if (XPending(pDisplay) ) { PredicateReturn aInput; XEvent aEvent; - aInput.bRet = FALSE; + aInput.bRet = sal_False; aInput.nType = nType; XCheckIfEvent(pDisplay, &aEvent, ImplPredicateEvent, @@ -227,14 +227,14 @@ vos::IMutex* X11SalInstance::GetYieldMutex() // ----------------------------------------------------------------------- -ULONG X11SalInstance::ReleaseYieldMutex() +sal_uInt32 X11SalInstance::ReleaseYieldMutex() { SalYieldMutex* pYieldMutex = mpSalYieldMutex; if ( pYieldMutex->GetThreadId() == vos::OThread::getCurrentIdentifier() ) { - ULONG nCount = pYieldMutex->GetAcquireCount(); - ULONG n = nCount; + sal_uInt32 nCount = pYieldMutex->GetAcquireCount(); + sal_uInt32 n = nCount; while ( n ) { pYieldMutex->release(); @@ -249,7 +249,7 @@ ULONG X11SalInstance::ReleaseYieldMutex() // ----------------------------------------------------------------------- -void X11SalInstance::AcquireYieldMutex( ULONG nCount ) +void X11SalInstance::AcquireYieldMutex( sal_uInt32 nCount ) { SalYieldMutex* pYieldMutex = mpSalYieldMutex; while ( nCount ) @@ -288,14 +288,14 @@ void* X11SalInstance::GetConnectionIdentifier( ConnectionIdentifierType& rReturn return pDisplay ? (void*)pDisplay : (void*)""; } -SalFrame *X11SalInstance::CreateFrame( SalFrame *pParent, ULONG nSalFrameStyle ) +SalFrame *X11SalInstance::CreateFrame( SalFrame *pParent, sal_uInt32 nSalFrameStyle ) { SalFrame *pFrame = new X11SalFrame( pParent, nSalFrameStyle ); return pFrame; } -SalFrame* X11SalInstance::CreateChildFrame( SystemParentData* pParentData, ULONG nStyle ) +SalFrame* X11SalInstance::CreateChildFrame( SystemParentData* pParentData, sal_uInt32 nStyle ) { SalFrame* pFrame = new X11SalFrame( NULL, nStyle, pParentData ); diff --git a/vcl/unx/source/app/salsys.cxx b/vcl/unx/source/app/salsys.cxx index 84c9dba32e40..5e2b870f559f 100644 --- a/vcl/unx/source/app/salsys.cxx +++ b/vcl/unx/source/app/salsys.cxx @@ -152,13 +152,13 @@ int X11SalSystem::ShowNativeDialog( const String& rTitle, const String& rMessage aWarn.SetText( rTitle ); aWarn.Clear(); - USHORT nButton = 0; + sal_uInt16 nButton = 0; for( std::list< String >::const_iterator it = rButtons.begin(); it != rButtons.end(); ++it ) { - aWarn.AddButton( *it, nButton+1, nButton == (USHORT)nDefButton ? BUTTONDIALOG_DEFBUTTON : 0 ); + aWarn.AddButton( *it, nButton+1, nButton == (sal_uInt16)nDefButton ? BUTTONDIALOG_DEFBUTTON : 0 ); nButton++; } - aWarn.SetFocusButton( (USHORT)nDefButton+1 ); + aWarn.SetFocusButton( (sal_uInt16)nDefButton+1 ); nRet = ((int)aWarn.Execute()) - 1; diff --git a/vcl/unx/source/app/saltimer.cxx b/vcl/unx/source/app/saltimer.cxx index 431470935d9e..7c4ec0676428 100644 --- a/vcl/unx/source/app/saltimer.cxx +++ b/vcl/unx/source/app/saltimer.cxx @@ -58,7 +58,7 @@ void SalXLib::StopTimer() m_nTimeoutMS = 0; } -void SalXLib::StartTimer( ULONG nMS ) +void SalXLib::StartTimer( sal_uInt32 nMS ) { timeval Timeout (m_aTimeout); // previous timeout. gettimeofday (&m_aTimeout, 0); @@ -89,7 +89,7 @@ void X11SalTimer::Stop() GetX11SalData()->GetLib()->StopTimer(); } -void X11SalTimer::Start( ULONG nMS ) +void X11SalTimer::Start( sal_uInt32 nMS ) { GetX11SalData()->GetLib()->StartTimer( nMS ); } diff --git a/vcl/unx/source/app/sm.cxx b/vcl/unx/source/app/sm.cxx index 959d6af5912d..21d9b8df60f3 100644 --- a/vcl/unx/source/app/sm.cxx +++ b/vcl/unx/source/app/sm.cxx @@ -149,7 +149,7 @@ extern "C" void SAL_CALL ICEConnectionWorker( void* ); class ICEConnectionObserver { friend void SAL_CALL ICEConnectionWorker(void*); - static BOOL bIsWatching; + static sal_Bool bIsWatching; static void ICEWatchProc( IceConn connection, IcePointer client_data, Bool opening, IcePointer* watch_data ); @@ -175,7 +175,7 @@ public: SmcConn SessionManagerClient::aSmcConnection = NULL; ByteString SessionManagerClient::aClientID; -BOOL ICEConnectionObserver::bIsWatching = FALSE; +sal_Bool ICEConnectionObserver::bIsWatching = sal_False; struct pollfd* ICEConnectionObserver::pFilehandles = NULL; IceConn* ICEConnectionObserver::pConnections = NULL; int ICEConnectionObserver::nConnections = 0; @@ -606,7 +606,7 @@ void ICEConnectionObserver::activate() { nWakeupFiles[0] = nWakeupFiles[1] = 0; ICEMutex = osl_createMutex(); - bIsWatching = TRUE; + bIsWatching = sal_True; #ifdef USE_SM_EXTENSION /* * Default handlers call exit, we don't care that strongly if something @@ -624,7 +624,7 @@ void ICEConnectionObserver::deactivate() if( bIsWatching ) { lock(); - bIsWatching = FALSE; + bIsWatching = sal_False; #ifdef USE_SM_EXTENSION IceRemoveConnectionWatch( ICEWatchProc, NULL ); IceSetErrorHandler( origErrorHandler ); diff --git a/vcl/unx/source/app/soicon.cxx b/vcl/unx/source/app/soicon.cxx index 2bf9e55731d1..ddb14e9ecc39 100644 --- a/vcl/unx/source/app/soicon.cxx +++ b/vcl/unx/source/app/soicon.cxx @@ -43,13 +43,13 @@ #include #include -BOOL SelectAppIconPixmap( SalDisplay *pDisplay, int nScreen,USHORT nIcon, USHORT iconSize, +sal_Bool SelectAppIconPixmap( SalDisplay *pDisplay, int nScreen,sal_uInt16 nIcon, sal_uInt16 iconSize, Pixmap& icon_pixmap, Pixmap& icon_mask) { if( ! ImplGetResMgr() ) - return FALSE; + return sal_False; - USHORT nIconSizeOffset; + sal_uInt16 nIconSizeOffset; if( iconSize >= 48 ) nIconSizeOffset = SV_ICON_SIZE48_START; @@ -58,11 +58,11 @@ BOOL SelectAppIconPixmap( SalDisplay *pDisplay, int nScreen,USHORT nIcon, USHORT else if( iconSize >= 16 ) nIconSizeOffset = SV_ICON_SIZE16_START; else - return FALSE; + return sal_False; BitmapEx aIcon( ResId(nIconSizeOffset + nIcon, *ImplGetResMgr())); - if( TRUE == aIcon.IsEmpty() ) - return FALSE; + if( sal_True == aIcon.IsEmpty() ) + return sal_False; SalTwoRect aRect; aRect.mnSrcX = 0; aRect.mnSrcY = 0; @@ -110,6 +110,6 @@ BOOL SelectAppIconPixmap( SalDisplay *pDisplay, int nScreen,USHORT nIcon, USHORT XFreeGC( pDisplay->GetDisplay(), aMonoGC ); } - return TRUE; + return sal_True; } diff --git a/vcl/unx/source/gdi/gcach_xpeer.cxx b/vcl/unx/source/gdi/gcach_xpeer.cxx index a69a2426b519..3d2af898c7e2 100644 --- a/vcl/unx/source/gdi/gcach_xpeer.cxx +++ b/vcl/unx/source/gdi/gcach_xpeer.cxx @@ -465,13 +465,13 @@ Pixmap X11GlyphPeer::GetPixmap( ServerFont& rServerFont, int nGlyphIndex, int nR if( rServerFont.GetGlyphBitmap1( nGlyphIndex, maRawBitmap ) ) { // #94666# circumvent bug in some X11 systems, e.g. XF410.LynxEM.v163 - ULONG nPixmapWidth = 8 * maRawBitmap.mnScanlineSize - 1; + sal_uInt32 nPixmapWidth = 8 * maRawBitmap.mnScanlineSize - 1; nPixmapWidth = Max( nPixmapWidth, maRawBitmap.mnWidth ); rGlyphData.SetSize( Size( nPixmapWidth, maRawBitmap.mnHeight ) ); rGlyphData.SetOffset( +maRawBitmap.mnXOffset, +maRawBitmap.mnYOffset ); - const ULONG nBytes = maRawBitmap.mnHeight * maRawBitmap.mnScanlineSize; + const sal_uInt32 nBytes = maRawBitmap.mnHeight * maRawBitmap.mnScanlineSize; if( nBytes > 0 ) { // conversion table LSB<->MSB (for XCreatePixmapFromData) @@ -621,7 +621,7 @@ Glyph X11GlyphPeer::GetGlyphId( ServerFont& rServerFont, int nGlyphIndex ) GlyphSet aGlyphSet = GetGlyphSet( rServerFont, -1 ); aGlyphId = nGlyphIndex & 0x00FFFFFF; - const ULONG nBytes = maRawBitmap.mnScanlineSize * maRawBitmap.mnHeight; + const sal_uInt32 nBytes = maRawBitmap.mnScanlineSize * maRawBitmap.mnHeight; XRenderPeer::GetInstance().AddGlyph( aGlyphSet, aGlyphId, aGlyphInfo, (char*)maRawBitmap.mpBits, nBytes ); mnBytesUsed += nBytes; diff --git a/vcl/unx/source/gdi/pspgraphics.cxx b/vcl/unx/source/gdi/pspgraphics.cxx index bab78b0cb2df..c7727dade852 100644 --- a/vcl/unx/source/gdi/pspgraphics.cxx +++ b/vcl/unx/source/gdi/pspgraphics.cxx @@ -278,7 +278,7 @@ void PspGraphics::GetResolution( sal_Int32 &rDPIX, sal_Int32 &rDPIY ) } } -USHORT PspGraphics::GetBitCount() +sal_uInt16 PspGraphics::GetBitCount() { return m_pPrinterGfx->GetBitCount(); } @@ -293,14 +293,14 @@ void PspGraphics::ResetClipRegion() m_pPrinterGfx->ResetClipRegion (); } -void PspGraphics::BeginSetClipRegion( ULONG n ) +void PspGraphics::BeginSetClipRegion( sal_uInt32 n ) { m_pPrinterGfx->BeginSetClipRegion(n); } -BOOL PspGraphics::unionClipRegion( long nX, long nY, long nDX, long nDY ) +sal_Bool PspGraphics::unionClipRegion( long nX, long nY, long nDX, long nDY ) { - return (BOOL)m_pPrinterGfx->UnionClipRegion (nX, nY, nDX, nDY); + return (sal_Bool)m_pPrinterGfx->UnionClipRegion (nX, nY, nDX, nDY); } bool PspGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& ) @@ -379,12 +379,12 @@ void PspGraphics::drawRect( long nX, long nY, long nDX, long nDY ) m_pPrinterGfx->DrawRect (Rectangle(Point(nX, nY), Size(nDX, nDY))); } -void PspGraphics::drawPolyLine( ULONG nPoints, const SalPoint *pPtAry ) +void PspGraphics::drawPolyLine( sal_uInt32 nPoints, const SalPoint *pPtAry ) { m_pPrinterGfx->DrawPolyLine (nPoints, (Point*)pPtAry); } -void PspGraphics::drawPolygon( ULONG nPoints, const SalPoint* pPtAry ) +void PspGraphics::drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ) { // Point must be equal to SalPoint! see vcl/inc/salgtype.hxx m_pPrinterGfx->DrawPolygon (nPoints, (Point*)pPtAry); @@ -409,13 +409,13 @@ bool PspGraphics::drawPolyLine( const basegfx::B2DPolygon&, double /*fTransparen return false; } -sal_Bool PspGraphics::drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ) +sal_Bool PspGraphics::drawPolyLineBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ) { m_pPrinterGfx->DrawPolyLineBezier (nPoints, (Point*)pPtAry, pFlgAry); return sal_True; } -sal_Bool PspGraphics::drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ) +sal_Bool PspGraphics::drawPolygonBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ) { m_pPrinterGfx->DrawPolygonBezier (nPoints, (Point*)pPtAry, pFlgAry); return sal_True; @@ -424,20 +424,20 @@ sal_Bool PspGraphics::drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, sal_Bool PspGraphics::drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt32* pPoints, const SalPoint* const* pPtAry, - const BYTE* const* pFlgAry ) + const sal_uInt8* const* pFlgAry ) { // Point must be equal to SalPoint! see vcl/inc/salgtype.hxx - m_pPrinterGfx->DrawPolyPolygonBezier (nPoly, pPoints, (Point**)pPtAry, (BYTE**)pFlgAry); + m_pPrinterGfx->DrawPolyPolygonBezier (nPoly, pPoints, (Point**)pPtAry, (sal_uInt8**)pFlgAry); return sal_True; } -void PspGraphics::invert( ULONG, +void PspGraphics::invert( sal_uInt32, const SalPoint*, SalInvert ) { DBG_ASSERT( 0, "Error: PrinterGfx::Invert() not implemented" ); } -BOOL PspGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize ) +sal_Bool PspGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uInt32 nSize ) { return m_pPrinterGfx->DrawEPS( Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) ), pPtr, nSize ); } @@ -448,7 +448,7 @@ void PspGraphics::copyBits( const SalTwoRect*, DBG_ERROR( "Error: PrinterGfx::CopyBits() not implemented" ); } -void PspGraphics::copyArea ( long,long,long,long,long,long,USHORT ) +void PspGraphics::copyArea ( long,long,long,long,long,long,sal_uInt16 ) { DBG_ERROR( "Error: PrinterGfx::CopyArea() not implemented" ); } @@ -784,7 +784,7 @@ const ImplFontCharMap* PspGraphics::GetImplFontCharMap() const return pIFCMap; } -USHORT PspGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel ) +sal_uInt16 PspGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel ) { // release all fonts that are to be overridden for( int i = nFallbackLevel; i < MAX_FALLBACK; ++i ) @@ -915,10 +915,10 @@ void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric, int ) } } -ULONG PspGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData *pKernPairs ) +sal_uInt32 PspGraphics::GetKernPairs( sal_uInt32 nPairs, ImplKernPairData *pKernPairs ) { const ::std::list< ::psp::KernPair >& rPairs( m_pPrinterGfx->getKernPairs() ); - ULONG nHavePairs = rPairs.size(); + sal_uInt32 nHavePairs = rPairs.size(); if( pKernPairs && nPairs ) { ::std::list< ::psp::KernPair >::const_iterator it; @@ -937,38 +937,38 @@ ULONG PspGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData *pKernPairs ) return nHavePairs; } -BOOL PspGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect ) +sal_Bool PspGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect ) { int nLevel = nGlyphIndex >> GF_FONTSHIFT; if( nLevel >= MAX_FALLBACK ) - return FALSE; + return sal_False; ServerFont* pSF = m_pServerFont[ nLevel ]; if( !pSF ) - return FALSE; + return sal_False; nGlyphIndex &= ~GF_FONTMASK; const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex ); rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() ); - return TRUE; + return sal_True; } -BOOL PspGraphics::GetGlyphOutline( long nGlyphIndex, +sal_Bool PspGraphics::GetGlyphOutline( long nGlyphIndex, ::basegfx::B2DPolyPolygon& rB2DPolyPoly ) { int nLevel = nGlyphIndex >> GF_FONTSHIFT; if( nLevel >= MAX_FALLBACK ) - return FALSE; + return sal_False; ServerFont* pSF = m_pServerFont[ nLevel ]; if( !pSF ) - return FALSE; + return sal_False; nGlyphIndex &= ~GF_FONTMASK; if( pSF->GetGlyphOutline( nGlyphIndex, rB2DPolyPoly ) ) - return TRUE; + return sal_True; - return FALSE; + return sal_False; } SalLayout* PspGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLevel ) @@ -1007,7 +1007,7 @@ SalLayout* PspGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLevel //-------------------------------------------------------------------------- -BOOL PspGraphics::CreateFontSubset( +sal_Bool PspGraphics::CreateFontSubset( const rtl::OUString& rToFile, const ImplFontData* pFont, sal_Int32* pGlyphIDs, @@ -1402,9 +1402,9 @@ bool PspGraphics::filterText( const String& rOrig, String& rNewText, xub_StrLen bool bRet = false; bool bStarted = false; bool bStopped = false; - USHORT nPos; - USHORT nStart = 0; - USHORT nStop = rLen; + sal_uInt16 nPos; + sal_uInt16 nStart = 0; + sal_uInt16 nStop = rLen; String aPhone = rOrig.Copy( nIndex, rLen ); if( ! m_bPhoneCollectionActive ) diff --git a/vcl/unx/source/gdi/salbmp.cxx b/vcl/unx/source/gdi/salbmp.cxx index cc7934b0a798..0b93333b91c3 100644 --- a/vcl/unx/source/gdi/salbmp.cxx +++ b/vcl/unx/source/gdi/salbmp.cxx @@ -64,7 +64,7 @@ SalBitmap* X11SalInstance::CreateSalBitmap() } ImplSalBitmapCache* X11SalBitmap::mpCache = NULL; -ULONG X11SalBitmap::mnCacheInstCount = 0; +sal_uInt32 X11SalBitmap::mnCacheInstCount = 0; // ----------------------------------------------------------------------------- @@ -109,7 +109,7 @@ void X11SalBitmap::ImplRemovedFromCache() // ----------------------------------------------------------------------------- -BitmapBuffer* X11SalBitmap::ImplCreateDIB( const Size& rSize, USHORT nBitCount, const BitmapPalette& rPal ) +BitmapBuffer* X11SalBitmap::ImplCreateDIB( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal ) { DBG_ASSERT( nBitCount == 1 || nBitCount == 4 || nBitCount == 8 || nBitCount == 16 || nBitCount == 24, "Unsupported BitCount!" ); @@ -128,7 +128,7 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( const Size& rSize, USHORT nBitCount, if( pDIB ) { - const USHORT nColors = ( nBitCount <= 8 ) ? ( 1 << nBitCount ) : 0; + const sal_uInt16 nColors = ( nBitCount <= 8 ) ? ( 1 << nBitCount ) : 0; pDIB->mnFormat = BMP_FORMAT_BOTTOM_UP; @@ -169,7 +169,7 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( const Size& rSize, USHORT nBitCount, try { - pDIB->mpBits = new BYTE[ pDIB->mnScanlineSize * pDIB->mnHeight ]; + pDIB->mpBits = new sal_uInt8[ pDIB->mnScanlineSize * pDIB->mnHeight ]; } catch(std::bad_alloc&) { @@ -214,7 +214,7 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable, { const SalTwoRect aTwoRect = { 0, 0, nWidth, nHeight, 0, 0, nWidth, nHeight }; BitmapBuffer aSrcBuf; - ULONG nDstFormat = BMP_FORMAT_BOTTOM_UP; + sal_uInt32 nDstFormat = BMP_FORMAT_BOTTOM_UP; const BitmapPalette* pDstPal = NULL; aSrcBuf.mnFormat = BMP_FORMAT_TOP_DOWN; @@ -222,7 +222,7 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable, aSrcBuf.mnHeight = nHeight; aSrcBuf.mnBitCount = pImage->bits_per_pixel; aSrcBuf.mnScanlineSize = pImage->bytes_per_line; - aSrcBuf.mpBits = (BYTE*) pImage->data; + aSrcBuf.mpBits = (sal_uInt8*) pImage->data; pImage->red_mask = pSalDisp->GetVisual( nScreen ).red_mask; pImage->green_mask = pSalDisp->GetVisual( nScreen ).green_mask; @@ -304,12 +304,12 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable, else if( aSrcBuf.mnBitCount <= 8 ) { const SalColormap& rColMap = pSalDisp->GetColormap( nScreen ); - const USHORT nCols = Min( (ULONG)rColMap.GetUsed(), (ULONG)(1 << nDrawableDepth) ); + const sal_uInt16 nCols = Min( (sal_uInt32)rColMap.GetUsed(), (sal_uInt32)(1 << nDrawableDepth) ); rPal.SetEntryCount( nCols ); pDstPal = &rPal; - for( USHORT i = 0; i < nCols; i++ ) + for( sal_uInt16 i = 0; i < nCols; i++ ) { const SalColor nColor( rColMap.GetColor( i ) ); BitmapColor& rBmpCol = rPal[ i ]; @@ -363,7 +363,7 @@ XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long if( pImage ) { BitmapBuffer* pDstBuf; - ULONG nDstFormat = BMP_FORMAT_TOP_DOWN; + sal_uInt32 nDstFormat = BMP_FORMAT_TOP_DOWN; BitmapPalette* pPal = NULL; ColorMask* pMask = NULL; @@ -430,11 +430,11 @@ XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long else if( pImage->depth <= 8 ) { const SalColormap& rColMap = pSalDisp->GetColormap( nScreen ); - const USHORT nCols = Min( (ULONG)rColMap.GetUsed(), (ULONG)(1 << pImage->depth) ); + const sal_uInt16 nCols = Min( (sal_uInt32)rColMap.GetUsed(), (sal_uInt32)(1 << pImage->depth) ); pPal = new BitmapPalette( nCols ); - for( USHORT i = 0; i < nCols; i++ ) + for( sal_uInt16 i = 0; i < nCols; i++ ) { const SalColor nColor( rColMap.GetColor( i ) ); BitmapColor& rBmpCol = (*pPal)[ i ]; @@ -683,7 +683,7 @@ void X11SalBitmap::ImplDraw( Drawable aDrawable, // ----------------------------------------------------------------------------- -bool X11SalBitmap::Create( const Size& rSize, USHORT nBitCount, const BitmapPalette& rPal ) +bool X11SalBitmap::Create( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal ) { Destroy(); mpDIB = ImplCreateDIB( rSize, nBitCount, rPal ); @@ -706,7 +706,7 @@ bool X11SalBitmap::Create( const SalBitmap& rSSalBmp ) // TODO: get rid of this when BitmapBuffer gets copy constructor try { - mpDIB->mpBits = new BYTE[ mpDIB->mnScanlineSize * mpDIB->mnHeight ]; + mpDIB->mpBits = new sal_uInt8[ mpDIB->mnScanlineSize * mpDIB->mnHeight ]; } catch( std::bad_alloc& ) { @@ -732,14 +732,14 @@ bool X11SalBitmap::Create( const SalBitmap& rSSalBmp ) bool X11SalBitmap::Create( const SalBitmap&, SalGraphics* ) { - return FALSE; + return sal_False; } // ----------------------------------------------------------------------------- -bool X11SalBitmap::Create( const SalBitmap&, USHORT ) +bool X11SalBitmap::Create( const SalBitmap&, sal_uInt16 ) { - return FALSE; + return sal_False; } // ----------------------------------------------------------------------------- @@ -775,9 +775,9 @@ Size X11SalBitmap::GetSize() const // ----------------------------------------------------------------------------- -USHORT X11SalBitmap::GetBitCount() const +sal_uInt16 X11SalBitmap::GetBitCount() const { - USHORT nBitCount; + sal_uInt16 nBitCount; if( mpDIB ) nBitCount = mpDIB->mnBitCount; @@ -954,7 +954,7 @@ ImplSalDDB::~ImplSalDDB() bool ImplSalDDB::ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRect ) const { - bool bRet = FALSE; + bool bRet = sal_False; if( ( maPixmap != 0 ) && ( ( mnDepth == nDepth ) || ( 1 == mnDepth ) ) && nScreen == mnScreen) { @@ -963,7 +963,7 @@ bool ImplSalDDB::ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRe rTwoRect.mnDestWidth == maTwoRect.mnDestWidth && rTwoRect.mnDestHeight == maTwoRect.mnDestHeight ) { // absolutely indentically - bRet = TRUE; + bRet = sal_True; } else if( rTwoRect.mnSrcWidth == rTwoRect.mnDestWidth && rTwoRect.mnSrcHeight == rTwoRect.mnDestHeight && maTwoRect.mnSrcWidth == maTwoRect.mnDestWidth && maTwoRect.mnSrcHeight == maTwoRect.mnDestHeight && @@ -971,7 +971,7 @@ bool ImplSalDDB::ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRe ( rTwoRect.mnSrcX + rTwoRect.mnSrcWidth ) <= ( maTwoRect.mnSrcX + maTwoRect.mnSrcWidth ) && ( rTwoRect.mnSrcY + rTwoRect.mnSrcHeight ) <= ( maTwoRect.mnSrcY + maTwoRect.mnSrcHeight ) ) { - bRet = TRUE; + bRet = sal_True; } } @@ -1018,10 +1018,10 @@ void ImplSalDDB::ImplDraw( Drawable aSrcDrawable, long nSrcDrawableDepth, struct ImplBmpObj { X11SalBitmap* mpBmp; - ULONG mnMemSize; - ULONG mnFlags; + sal_uInt32 mnMemSize; + sal_uInt32 mnFlags; - ImplBmpObj( X11SalBitmap* pBmp, ULONG nMemSize, ULONG nFlags ) : + ImplBmpObj( X11SalBitmap* pBmp, sal_uInt32 nMemSize, sal_uInt32 nFlags ) : mpBmp( pBmp ), mnMemSize( nMemSize ), mnFlags( nFlags ) {} }; @@ -1041,14 +1041,14 @@ ImplSalBitmapCache::~ImplSalBitmapCache() // ----------------------------------------------------------------------------- -void ImplSalBitmapCache::ImplAdd( X11SalBitmap* pBmp, ULONG nMemSize, ULONG nFlags ) +void ImplSalBitmapCache::ImplAdd( X11SalBitmap* pBmp, sal_uInt32 nMemSize, sal_uInt32 nFlags ) { ImplBmpObj* pObj; - bool bFound = FALSE; + bool bFound = sal_False; for( pObj = (ImplBmpObj*) maBmpList.Last(); pObj && !bFound; pObj = (ImplBmpObj*) maBmpList.Prev() ) if( pObj->mpBmp == pBmp ) - bFound = TRUE; + bFound = sal_True; mnTotalSize += nMemSize; diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx index 9215f2e25b16..3802f4f394ac 100644 --- a/vcl/unx/source/gdi/salgdi.cxx +++ b/vcl/unx/source/gdi/salgdi.cxx @@ -67,21 +67,21 @@ class SalPolyLine XPoint Points_[STATIC_POINTS]; XPoint *pFirst_; public: - inline SalPolyLine( ULONG nPoints ); - inline SalPolyLine( ULONG nPoints, const SalPoint *p ); + inline SalPolyLine( sal_uInt32 nPoints ); + inline SalPolyLine( sal_uInt32 nPoints, const SalPoint *p ); inline ~SalPolyLine(); - inline XPoint &operator [] ( ULONG n ) const + inline XPoint &operator [] ( sal_uInt32 n ) const { return pFirst_[n]; } }; -inline SalPolyLine::SalPolyLine( ULONG nPoints ) +inline SalPolyLine::SalPolyLine( sal_uInt32 nPoints ) : pFirst_( nPoints+1 > STATIC_POINTS ? new XPoint[nPoints+1] : Points_ ) {} -inline SalPolyLine::SalPolyLine( ULONG nPoints, const SalPoint *p ) +inline SalPolyLine::SalPolyLine( sal_uInt32 nPoints, const SalPoint *p ) : pFirst_( nPoints+1 > STATIC_POINTS ? new XPoint[nPoints+1] : Points_ ) { - for( ULONG i = 0; i < nPoints; i++ ) + for( sal_uInt32 i = 0; i < nPoints; i++ ) { pFirst_[i].x = (short)p[i].mnX; pFirst_[i].y = (short)p[i].mnY; @@ -124,7 +124,7 @@ X11SalGraphics::X11SalGraphics() #ifdef ENABLE_GRAPHITE // check if graphite fonts have been disabled static const char* pDisableGraphiteStr = getenv( "SAL_DISABLE_GRAPHITE" ); - bDisableGraphite_ = pDisableGraphiteStr ? (pDisableGraphiteStr[0]!='0') : FALSE; + bDisableGraphite_ = pDisableGraphiteStr ? (pDisableGraphiteStr[0]!='0') : sal_False; #endif pBrushGC_ = NULL; @@ -140,20 +140,20 @@ X11SalGraphics::X11SalGraphics() pStippleGC_ = NULL; pTrackingGC_ = NULL; - bWindow_ = FALSE; - bPrinter_ = FALSE; - bVirDev_ = FALSE; - bPenGC_ = FALSE; - bFontGC_ = FALSE; - bBrushGC_ = FALSE; - bMonoGC_ = FALSE; - bCopyGC_ = FALSE; - bInvertGC_ = FALSE; - bInvert50GC_ = FALSE; - bStippleGC_ = FALSE; - bTrackingGC_ = FALSE; - bXORMode_ = FALSE; - bDitherBrush_ = FALSE; + bWindow_ = sal_False; + bPrinter_ = sal_False; + bVirDev_ = sal_False; + bPenGC_ = sal_False; + bFontGC_ = sal_False; + bBrushGC_ = sal_False; + bMonoGC_ = sal_False; + bCopyGC_ = sal_False; + bInvertGC_ = sal_False; + bInvert50GC_ = sal_False; + bStippleGC_ = sal_False; + bTrackingGC_ = sal_False; + bXORMode_ = sal_False; + bDitherBrush_ = sal_False; } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -241,7 +241,7 @@ void X11SalGraphics::Init( SalFrame *pFrame, Drawable aTarget, int nScreen ) SetDrawable( aTarget, nScreen ); #endif - bWindow_ = TRUE; + bWindow_ = sal_True; m_pFrame = pFrame; m_pVDev = NULL; } @@ -306,7 +306,7 @@ GC X11SalGraphics::SelectPen() XSetForeground( pDisplay, pPenGC_, nPenPixel_ ); XSetFunction ( pDisplay, pPenGC_, bXORMode_ ? GXxor : GXcopy ); SetClipRegion( pPenGC_ ); - bPenGC_ = TRUE; + bPenGC_ = sal_True; } return pPenGC_; @@ -359,7 +359,7 @@ GC X11SalGraphics::SelectBrush() XSetFunction ( pDisplay, pBrushGC_, bXORMode_ ? GXxor : GXcopy ); SetClipRegion( pBrushGC_ ); - bBrushGC_ = TRUE; + bBrushGC_ = sal_True; } return pBrushGC_; @@ -391,26 +391,26 @@ GC X11SalGraphics::GetTrackingGC() if( !bTrackingGC_ ) { SetClipRegion( pTrackingGC_ ); - bTrackingGC_ = TRUE; + bTrackingGC_ = sal_True; } return pTrackingGC_; } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalGraphics::DrawLines( ULONG nPoints, +void X11SalGraphics::DrawLines( sal_uInt32 nPoints, const SalPolyLine &rPoints, GC pGC, bool bClose ) { // errechne wie viele Linien XWindow auf einmal zeichnen kann - ULONG nMaxLines = (GetDisplay()->GetMaxRequestSize() - sizeof(xPolyPointReq)) + sal_uInt32 nMaxLines = (GetDisplay()->GetMaxRequestSize() - sizeof(xPolyPointReq)) / sizeof(xPoint); if( nMaxLines > nPoints ) nMaxLines = nPoints; // gebe alle Linien aus, die XWindows zeichnen kann. - ULONG n; + sal_uInt32 n; for( n = 0; nPoints - n > nMaxLines; n += nMaxLines - 1 ) XDrawLines( GetXDisplay(), GetDrawable(), @@ -454,24 +454,24 @@ BOOL X11SalGraphics::GetDitherPixmap( SalColor nSalColor ) // test for correct depth (8bit) if( GetColormap().GetVisual().GetDepth() != 8 ) - return FALSE; + return sal_False; char pBits[64]; char *pBitsPtr = pBits; // Set the pallette-entries for the dithering tile - UINT8 nSalColorRed = SALCOLOR_RED ( nSalColor ); - UINT8 nSalColorGreen = SALCOLOR_GREEN ( nSalColor ); - UINT8 nSalColorBlue = SALCOLOR_BLUE ( nSalColor ); + sal_uInt8 nSalColorRed = SALCOLOR_RED ( nSalColor ); + sal_uInt8 nSalColorGreen = SALCOLOR_GREEN ( nSalColor ); + sal_uInt8 nSalColorBlue = SALCOLOR_BLUE ( nSalColor ); for( int nY = 0; nY < 8; nY++ ) { for( int nX = 0; nX < 8; nX++ ) { short nMagic = nOrdDither8Bit[nY][nX]; - UINT8 nR = P_DELTA * DMAP( nSalColorRed, nMagic ); - UINT8 nG = P_DELTA * DMAP( nSalColorGreen, nMagic ); - UINT8 nB = P_DELTA * DMAP( nSalColorBlue, nMagic ); + sal_uInt8 nR = P_DELTA * DMAP( nSalColorRed, nMagic ); + sal_uInt8 nG = P_DELTA * DMAP( nSalColorGreen, nMagic ); + sal_uInt8 nB = P_DELTA * DMAP( nSalColorBlue, nMagic ); *pBitsPtr++ = GetColormap().GetPixel( MAKE_SALCOLOR( nR, nG, nB ) ); } @@ -511,7 +511,7 @@ BOOL X11SalGraphics::GetDitherPixmap( SalColor nSalColor ) pImage->data = NULL; XDestroyImage( pImage ); - return TRUE; + return sal_True; } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -549,7 +549,7 @@ void X11SalGraphics::GetResolution( sal_Int32 &rDPIX, sal_Int32 &rDPIY ) // cons } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -USHORT X11SalGraphics::GetBitCount() // const +sal_uInt16 X11SalGraphics::GetBitCount() // const { return GetVisual().GetDepth(); } @@ -581,15 +581,15 @@ void X11SalGraphics::ResetClipRegion() { if( pClipRegion_ ) { - bPenGC_ = FALSE; - bFontGC_ = FALSE; - bBrushGC_ = FALSE; - bMonoGC_ = FALSE; - bCopyGC_ = FALSE; - bInvertGC_ = FALSE; - bInvert50GC_ = FALSE; - bStippleGC_ = FALSE; - bTrackingGC_ = FALSE; + bPenGC_ = sal_False; + bFontGC_ = sal_False; + bBrushGC_ = sal_False; + bMonoGC_ = sal_False; + bCopyGC_ = sal_False; + bInvertGC_ = sal_False; + bInvert50GC_ = sal_False; + bStippleGC_ = sal_False; + bTrackingGC_ = sal_False; XDestroyRegion( pClipRegion_ ); pClipRegion_ = NULL; @@ -597,7 +597,7 @@ void X11SalGraphics::ResetClipRegion() } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalGraphics::BeginSetClipRegion( ULONG ) +void X11SalGraphics::BeginSetClipRegion( sal_uInt32 ) { if( pClipRegion_ ) XDestroyRegion( pClipRegion_ ); @@ -608,7 +608,7 @@ void X11SalGraphics::BeginSetClipRegion( ULONG ) BOOL X11SalGraphics::unionClipRegion( long nX, long nY, long nDX, long nDY ) { if (!nDX || !nDY) - return TRUE; + return sal_True; XRectangle aRect; aRect.x = (short)nX; @@ -618,7 +618,7 @@ BOOL X11SalGraphics::unionClipRegion( long nX, long nY, long nDX, long nDY ) XUnionRectWithRegion( &aRect, pClipRegion_, pClipRegion_ ); - return TRUE; + return sal_True; } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -631,15 +631,15 @@ bool X11SalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& ) // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= void X11SalGraphics::EndSetClipRegion() { - bPenGC_ = FALSE; - bFontGC_ = FALSE; - bBrushGC_ = FALSE; - bMonoGC_ = FALSE; - bCopyGC_ = FALSE; - bInvertGC_ = FALSE; - bInvert50GC_ = FALSE; - bStippleGC_ = FALSE; - bTrackingGC_ = FALSE; + bPenGC_ = sal_False; + bFontGC_ = sal_False; + bBrushGC_ = sal_False; + bMonoGC_ = sal_False; + bCopyGC_ = sal_False; + bInvertGC_ = sal_False; + bInvert50GC_ = sal_False; + bStippleGC_ = sal_False; + bTrackingGC_ = sal_False; if( XEmptyRegion( pClipRegion_ ) ) { @@ -654,7 +654,7 @@ void X11SalGraphics::SetLineColor() if( nPenColor_ != SALCOLOR_NONE ) { nPenColor_ = SALCOLOR_NONE; - bPenGC_ = FALSE; + bPenGC_ = sal_False; } } @@ -665,7 +665,7 @@ void X11SalGraphics::SetLineColor( SalColor nSalColor ) { nPenColor_ = nSalColor; nPenPixel_ = GetPixel( nSalColor ); - bPenGC_ = FALSE; + bPenGC_ = sal_False; } } @@ -674,9 +674,9 @@ void X11SalGraphics::SetFillColor() { if( nBrushColor_ != SALCOLOR_NONE ) { - bDitherBrush_ = FALSE; + bDitherBrush_ = sal_False; nBrushColor_ = SALCOLOR_NONE; - bBrushGC_ = FALSE; + bBrushGC_ = sal_False; } } @@ -685,7 +685,7 @@ void X11SalGraphics::SetFillColor( SalColor nSalColor ) { if( nBrushColor_ != nSalColor ) { - bDitherBrush_ = FALSE; + bDitherBrush_ = sal_False; nBrushColor_ = nSalColor; nBrushPixel_ = GetPixel( nSalColor ); if( TrueColor != GetColormap().GetVisual().GetClass() @@ -707,7 +707,7 @@ void X11SalGraphics::SetFillColor( SalColor nSalColor ) && nSalColor != MAKE_SALCOLOR( 0xFF, 0xFF, 0x00 ) // light brown && nSalColor != MAKE_SALCOLOR( 0xFF, 0xFF, 0xFF ) ) bDitherBrush_ = GetDitherPixmap(nSalColor); - bBrushGC_ = FALSE; + bBrushGC_ = sal_False; } } @@ -727,7 +727,7 @@ void X11SalGraphics::SetROPLineColor( SalROPColor nROPColor ) break; } nPenColor_ = GetColormap().GetColor( nPenPixel_ ); - bPenGC_ = FALSE; + bPenGC_ = sal_False; } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -745,9 +745,9 @@ void X11SalGraphics::SetROPFillColor( SalROPColor nROPColor ) nBrushPixel_ = (Pixel)(1 << GetVisual().GetDepth()) - 1; break; } - bDitherBrush_ = FALSE; + bDitherBrush_ = sal_False; nBrushColor_ = GetColormap().GetColor( nBrushPixel_ ); - bBrushGC_ = FALSE; + bBrushGC_ = sal_False; } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -756,14 +756,14 @@ void X11SalGraphics::SetXORMode( bool bSet, bool ) if( !bXORMode_ == bSet ) { bXORMode_ = bSet; - bPenGC_ = FALSE; - bBrushGC_ = FALSE; - bMonoGC_ = FALSE; - bCopyGC_ = FALSE; - bInvertGC_ = FALSE; - bInvert50GC_ = FALSE; - bStippleGC_ = FALSE; - bTrackingGC_ = FALSE; + bPenGC_ = sal_False; + bBrushGC_ = sal_False; + bMonoGC_ = sal_False; + bCopyGC_ = sal_False; + bInvertGC_ = sal_False; + bInvert50GC_ = sal_False; + bStippleGC_ = sal_False; + bTrackingGC_ = sal_False; } } @@ -839,13 +839,13 @@ void X11SalGraphics::drawRect( long nX, long nY, long nDX, long nDY ) } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalGraphics::drawPolyLine( ULONG nPoints, const SalPoint *pPtAry ) +void X11SalGraphics::drawPolyLine( sal_uInt32 nPoints, const SalPoint *pPtAry ) { drawPolyLine( nPoints, pPtAry, false ); } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalGraphics::drawPolyLine( ULONG nPoints, const SalPoint *pPtAry, bool bClose ) +void X11SalGraphics::drawPolyLine( sal_uInt32 nPoints, const SalPoint *pPtAry, bool bClose ) { if( nPenColor_ != 0xFFFFFFFF ) { @@ -856,7 +856,7 @@ void X11SalGraphics::drawPolyLine( ULONG nPoints, const SalPoint *pPtAry, bool b } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalGraphics::drawPolygon( ULONG nPoints, const SalPoint* pPtAry ) +void X11SalGraphics::drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ) { if( nPoints == 0 ) return; @@ -929,7 +929,7 @@ void X11SalGraphics::drawPolyPolygon( sal_uInt32 nPoly, { if( nBrushColor_ != SALCOLOR_NONE ) { - ULONG i, n; + sal_uInt32 i, n; XLIB_Region pXRegA = NULL; for( i = 0; i < nPoly; i++ ) { @@ -956,7 +956,7 @@ void X11SalGraphics::drawPolyPolygon( sal_uInt32 nPoly, GC pGC = SelectBrush(); SetClipRegion( pGC, pXRegA ); // ??? doppelt XDestroyRegion( pXRegA ); - bBrushGC_ = FALSE; + bBrushGC_ = sal_False; XFillRectangle( GetXDisplay(), GetDrawable(), @@ -966,20 +966,20 @@ void X11SalGraphics::drawPolyPolygon( sal_uInt32 nPoly, } if( nPenColor_ != SALCOLOR_NONE ) - for( ULONG i = 0; i < nPoly; i++ ) + for( sal_uInt32 i = 0; i < nPoly; i++ ) drawPolyLine( pPoints[i], pPtAry[i], true ); } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -sal_Bool X11SalGraphics::drawPolyLineBezier( ULONG, const SalPoint*, const BYTE* ) +sal_Bool X11SalGraphics::drawPolyLineBezier( sal_uInt32, const SalPoint*, const BYTE* ) { return sal_False; } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -sal_Bool X11SalGraphics::drawPolygonBezier( ULONG, const SalPoint*, const BYTE* ) +sal_Bool X11SalGraphics::drawPolygonBezier( sal_uInt32, const SalPoint*, const BYTE* ) { return sal_False; } @@ -994,7 +994,7 @@ sal_Bool X11SalGraphics::drawPolyPolygonBezier( sal_uInt32, const sal_uInt32*, // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalGraphics::invert( ULONG nPoints, +void X11SalGraphics::invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalInvert nFlags ) { @@ -1021,9 +1021,9 @@ void X11SalGraphics::invert( ULONG nPoints, // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -BOOL X11SalGraphics::drawEPS( long,long,long,long,void*,ULONG ) +BOOL X11SalGraphics::drawEPS( long,long,long,long,void*,sal_uInt32 ) { - return FALSE; + return sal_False; } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -1094,22 +1094,22 @@ bool X11SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rOrigPoly // nothing to do for empty polypolygons const int nOrigPolyCount = rOrigPolyPoly.count(); if( nOrigPolyCount <= 0 ) - return TRUE; + return sal_True; // nothing to do if everything is transparent if( (nBrushColor_ == SALCOLOR_NONE) && (nPenColor_ == SALCOLOR_NONE) ) - return TRUE; + return sal_True; // cannot handle pencolor!=brushcolor yet if( (nPenColor_ != SALCOLOR_NONE) && (nPenColor_ != nBrushColor_) ) - return FALSE; + return sal_False; // TODO: remove the env-variable when no longer needed static const char* pRenderEnv = getenv( "SAL_DISABLE_RENDER_POLY" ); if( pRenderEnv ) - return FALSE; + return sal_False; // snap to raster if requested basegfx::B2DPolyPolygon aPolyPoly = rOrigPolyPoly; diff --git a/vcl/unx/source/gdi/salgdi2.cxx b/vcl/unx/source/gdi/salgdi2.cxx index 1cb2abbedf43..018f7514dfeb 100644 --- a/vcl/unx/source/gdi/salgdi2.cxx +++ b/vcl/unx/source/gdi/salgdi2.cxx @@ -150,7 +150,7 @@ inline GC X11SalGraphics::GetMonoGC( Pixmap hPixmap ) if( !bMonoGC_ ) { SetClipRegion( pMonoGC_ ); - bMonoGC_ = TRUE; + bMonoGC_ = sal_True; } return pMonoGC_; @@ -167,7 +167,7 @@ inline GC X11SalGraphics::GetCopyGC() if( !bCopyGC_ ) { SetClipRegion( pCopyGC_ ); - bCopyGC_ = TRUE; + bCopyGC_ = sal_True; } return pCopyGC_; } @@ -185,7 +185,7 @@ GC X11SalGraphics::GetInvertGC() if( !bInvertGC_ ) { SetClipRegion( pInvertGC_ ); - bInvertGC_ = TRUE; + bInvertGC_ = sal_True; } return pInvertGC_; } @@ -233,7 +233,7 @@ GC X11SalGraphics::GetInvert50GC() if( !bInvert50GC_ ) { SetClipRegion( pInvert50GC_ ); - bInvert50GC_ = TRUE; + bInvert50GC_ = sal_True; } return pInvert50GC_; } @@ -251,7 +251,7 @@ inline GC X11SalGraphics::GetStippleGC() { XSetFunction( GetXDisplay(), pStippleGC_, bXORMode_ ? GXxor : GXcopy ); SetClipRegion( pStippleGC_ ); - bStippleGC_ = TRUE; + bStippleGC_ = sal_True; } return pStippleGC_; @@ -608,7 +608,7 @@ void X11SalGraphics::copyBits( const SalTwoRect *pPosAry, void X11SalGraphics::copyArea ( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth, long nSrcHeight, - USHORT ) + sal_uInt16 ) { SalTwoRect aPosAry; @@ -661,11 +661,11 @@ void X11SalGraphics::drawBitmap( const SalTwoRect* pPosAry, DBG_ASSERT( !bPrinter_, "Drawing of transparent bitmaps on printer devices is strictly forbidden" ); // decide if alpha masking or transparency masking is needed - BitmapBuffer* pAlphaBuffer = const_cast(rMaskBitmap).AcquireBuffer( TRUE ); + BitmapBuffer* pAlphaBuffer = const_cast(rMaskBitmap).AcquireBuffer( sal_True ); if( pAlphaBuffer != NULL ) { int nMaskFormat = pAlphaBuffer->mnFormat; - const_cast(rMaskBitmap).ReleaseBuffer( pAlphaBuffer, TRUE ); + const_cast(rMaskBitmap).ReleaseBuffer( pAlphaBuffer, sal_True ); if( nMaskFormat == BMP_FORMAT_8BIT_PAL ) drawAlphaBitmap( *pPosAry, rSrcBitmap, rMaskBitmap ); } @@ -686,7 +686,7 @@ void X11SalGraphics::drawMaskedBitmap( const SalTwoRect* pPosAry, // figure work mode depth. If this is a VDev Drawable, use its // bitdepth to create pixmaps for, otherwise, XCopyArea will // refuse to work. - const USHORT nDepth( m_pVDev ? + const sal_uInt16 nDepth( m_pVDev ? m_pVDev->GetDepth() : pSalDisp->GetVisual( m_nScreen ).GetDepth() ); Pixmap aFG( XCreatePixmap( pXDisp, aDrawable, pPosAry->mnDestWidth, @@ -745,8 +745,8 @@ void X11SalGraphics::drawMaskedBitmap( const SalTwoRect* pPosAry, DBG_TESTTRANS( aBG ); // #105055# Disable XOR temporarily - BOOL bOldXORMode( bXORMode_ ); - bXORMode_ = FALSE; + sal_Bool bOldXORMode( bXORMode_ ); + bXORMode_ = sal_False; // copy pixmap #2 (result) to background XCopyArea( pXDisp, aBG, aDrawable, GetCopyGC(), @@ -834,7 +834,7 @@ bool X11SalGraphics::drawAlphaBitmap( const SalTwoRect& rTR, // TODO: use SalX11Bitmap functionality and caching for the Alpha Pixmap // problem is that they don't provide an 8bit Pixmap on a non-8bit display - BitmapBuffer* pAlphaBuffer = const_cast(rAlphaBmp).AcquireBuffer( TRUE ); + BitmapBuffer* pAlphaBuffer = const_cast(rAlphaBmp).AcquireBuffer( sal_True ); // an XImage needs its data top_down // TODO: avoid wrongly oriented images in upper layers! @@ -879,7 +879,7 @@ bool X11SalGraphics::drawAlphaBitmap( const SalTwoRect& rTR, if( pAlphaBits != (char*)pAlphaBuffer->mpBits ) delete[] pAlphaBits; - const_cast(rAlphaBmp).ReleaseBuffer( pAlphaBuffer, TRUE ); + const_cast(rAlphaBmp).ReleaseBuffer( pAlphaBuffer, sal_True ); XRenderPictureAttributes aAttr; aAttr.repeat = true; @@ -1045,7 +1045,7 @@ SalBitmap *X11SalGraphics::getBitmap( long nX, long nY, long nDX, long nDY ) } X11SalBitmap* pSalBitmap = new X11SalBitmap; - USHORT nBitCount = GetBitCount(); + sal_uInt16 nBitCount = GetBitCount(); if( &GetDisplay()->GetColormap( m_nScreen ) != &GetColormap() ) nBitCount = 1; diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx index 62e575ebc5ef..e570e0e02bc6 100644 --- a/vcl/unx/source/gdi/salgdi3.cxx +++ b/vcl/unx/source/gdi/salgdi3.cxx @@ -566,7 +566,7 @@ X11SalGraphics::SelectFont() { XSetForeground( pDisplay, pFontGC_, nTextPixel_ ); SetClipRegion( pFontGC_ ); - bFontGC_ = TRUE; + bFontGC_ = sal_True; } return pFontGC_; @@ -622,7 +622,7 @@ bool X11SalGraphics::setFont( const ImplFontSelectData *pEntry, int nFallbackLev Size aReqSize( pEntry->mnWidth, pEntry->mnHeight ); mXFont[ nFallbackLevel ] = GetDisplay()->GetFont( &rX11Font, aReqSize, bFontVertical_ ); - bFontGC_ = FALSE; + bFontGC_ = sal_False; return true; } @@ -1509,9 +1509,9 @@ const ImplFontCharMap* X11SalGraphics::GetImplFontCharMap() const // // ---------------------------------------------------------------------------- -USHORT X11SalGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel ) +sal_uInt16 X11SalGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel ) { - USHORT nRetVal = 0; + sal_uInt16 nRetVal = 0; if( !setFont( pEntry, nFallbackLevel ) ) nRetVal |= SAL_SETFONT_BADFONT; if( bPrinter_ || (mpServerFont[ nFallbackLevel ] != NULL) ) @@ -1528,7 +1528,7 @@ X11SalGraphics::SetTextColor( SalColor nSalColor ) { nTextColor_ = nSalColor; nTextPixel_ = GetPixel( nSalColor ); - bFontGC_ = FALSE; + bFontGC_ = sal_False; } } @@ -1776,15 +1776,15 @@ X11SalGraphics::GetFontMetric( ImplFontMetricData *pMetric, int nFallbackLevel ) // --------------------------------------------------------------------------- -ULONG -X11SalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData *pKernPairs ) +sal_uInt32 +X11SalGraphics::GetKernPairs( sal_uInt32 nPairs, ImplKernPairData *pKernPairs ) { if( ! bPrinter_ ) { if( mpServerFont[0] != NULL ) { ImplKernPairData* pTmpKernPairs; - ULONG nGotPairs = mpServerFont[0]->GetKernPairs( &pTmpKernPairs ); + sal_uInt32 nGotPairs = mpServerFont[0]->GetKernPairs( &pTmpKernPairs ); for( unsigned int i = 0; i < nPairs && i < nGotPairs; ++i ) pKernPairs[ i ] = pTmpKernPairs[ i ]; delete[] pTmpKernPairs; @@ -1796,40 +1796,40 @@ X11SalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData *pKernPairs ) // --------------------------------------------------------------------------- -BOOL X11SalGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect ) +sal_Bool X11SalGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect ) { int nLevel = nGlyphIndex >> GF_FONTSHIFT; if( nLevel >= MAX_FALLBACK ) - return FALSE; + return sal_False; ServerFont* pSF = mpServerFont[ nLevel ]; if( !pSF ) - return FALSE; + return sal_False; nGlyphIndex &= ~GF_FONTMASK; const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex ); rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() ); - return TRUE; + return sal_True; } // --------------------------------------------------------------------------- -BOOL X11SalGraphics::GetGlyphOutline( long nGlyphIndex, +sal_Bool X11SalGraphics::GetGlyphOutline( long nGlyphIndex, ::basegfx::B2DPolyPolygon& rPolyPoly ) { int nLevel = nGlyphIndex >> GF_FONTSHIFT; if( nLevel >= MAX_FALLBACK ) - return FALSE; + return sal_False; ServerFont* pSF = mpServerFont[ nLevel ]; if( !pSF ) - return FALSE; + return sal_False; nGlyphIndex &= ~GF_FONTMASK; if( pSF->GetGlyphOutline( nGlyphIndex, rPolyPoly ) ) - return TRUE; + return sal_True; - return FALSE; + return sal_False; } //-------------------------------------------------------------------------- @@ -1894,7 +1894,7 @@ SystemFontData X11SalGraphics::GetSysFontData( int nFallbacklevel ) const //-------------------------------------------------------------------------- -BOOL X11SalGraphics::CreateFontSubset( +sal_Bool X11SalGraphics::CreateFontSubset( const rtl::OUString& rToFile, const ImplFontData* pFont, sal_Int32* pGlyphIDs, diff --git a/vcl/unx/source/gdi/salprnpsp.cxx b/vcl/unx/source/gdi/salprnpsp.cxx index ece724d717cb..c8a0f6532133 100644 --- a/vcl/unx/source/gdi/salprnpsp.cxx +++ b/vcl/unx/source/gdi/salprnpsp.cxx @@ -213,7 +213,7 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData ) if( rData.getStreamBuffer( pBuffer, nBytes ) ) { pJobSetup->mnDriverDataLen = nBytes; - pJobSetup->mpDriverData = (BYTE*)pBuffer; + pJobSetup->mpDriverData = (sal_uInt8*)pBuffer; } else { @@ -588,15 +588,15 @@ void PspSalInfoPrinter::ReleaseGraphics( SalGraphics* pGraphics ) // ----------------------------------------------------------------------- -BOOL PspSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pJobSetup ) +sal_Bool PspSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pJobSetup ) { if( ! pFrame || ! pJobSetup ) - return FALSE; + return sal_False; getPaLib(); if( ! pSetupFunction ) - return FALSE; + return sal_False; PrinterInfoManager& rManager = PrinterInfoManager::get(); @@ -616,14 +616,14 @@ BOOL PspSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pJobSetup ) void* pBuffer = NULL; aInfo.getStreamBuffer( pBuffer, nBytes ); pJobSetup->mnDriverDataLen = nBytes; - pJobSetup->mpDriverData = (BYTE*)pBuffer; + pJobSetup->mpDriverData = (sal_uInt8*)pBuffer; // copy everything to job setup copyJobDataToJobSetup( pJobSetup, aInfo ); JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, m_aJobData ); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -633,7 +633,7 @@ BOOL PspSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pJobSetup ) // data should be merged into the driver data // If pJobSetup->mpDriverData IS NULL, then the driver defaults // should be merged into the independent data -BOOL PspSalInfoPrinter::SetPrinterData( ImplJobSetup* pJobSetup ) +sal_Bool PspSalInfoPrinter::SetPrinterData( ImplJobSetup* pJobSetup ) { // set/clear backwards compatibility flag bool bStrictSO52Compatibility = false; @@ -652,7 +652,7 @@ BOOL PspSalInfoPrinter::SetPrinterData( ImplJobSetup* pJobSetup ) copyJobDataToJobSetup( pJobSetup, m_aJobData ); - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- @@ -661,8 +661,8 @@ BOOL PspSalInfoPrinter::SetPrinterData( ImplJobSetup* pJobSetup ) // and sets the new independ data in pJobSetup // Only the data must be changed, where the bit // in nGetDataFlags is set -BOOL PspSalInfoPrinter::SetData( - ULONG nSetDataFlags, +sal_Bool PspSalInfoPrinter::SetData( + sal_uInt32 nSetDataFlags, ImplJobSetup* pJobSetup ) { JobData aData; @@ -711,7 +711,7 @@ BOOL PspSalInfoPrinter::SetData( } if( ! ( pKey && pValue && aData.m_aContext.setValue( pKey, pValue, false ) == pValue ) ) - return FALSE; + return sal_False; } // merge paperbin if necessary @@ -771,10 +771,10 @@ BOOL PspSalInfoPrinter::SetData( m_aJobData = aData; copyJobDataToJobSetup( pJobSetup, aData ); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -823,7 +823,7 @@ void PspSalInfoPrinter::GetPageInfo( // ----------------------------------------------------------------------- -ULONG PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup ) +sal_uInt32 PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup ) { if( ! pJobSetup ) return 0; @@ -837,7 +837,7 @@ ULONG PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup ) // ----------------------------------------------------------------------- -String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, ULONG nPaperBin ) +String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, sal_uInt32 nPaperBin ) { JobData aData; JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData ); @@ -846,7 +846,7 @@ String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, ULONG if( aData.m_pParser ) { const PPDKey* pKey = aData.m_pParser ? aData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "InputSlot" ) ) ): NULL; - if( ! pKey || nPaperBin >= (ULONG)pKey->countValues() ) + if( ! pKey || nPaperBin >= (sal_uInt32)pKey->countValues() ) aRet = aData.m_pParser->getDefaultInputSlot(); else { @@ -861,7 +861,7 @@ String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, ULONG // ----------------------------------------------------------------------- -ULONG PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, USHORT nType ) +sal_uInt32 PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, sal_uInt16 nType ) { switch( nType ) { @@ -955,11 +955,11 @@ static String getTmpName() return aSys; } -BOOL PspSalPrinter::StartJob( +sal_Bool PspSalPrinter::StartJob( const XubString* pFileName, const XubString& rJobName, const XubString& rAppName, - ULONG nCopies, + sal_uInt32 nCopies, bool bCollate, bool bDirect, ImplJobSetup* pJobSetup ) @@ -1035,16 +1035,16 @@ BOOL PspSalPrinter::StartJob( } m_aPrinterGfx.setStrictSO52Compatibility( bStrictSO52Compatibility ); - return m_aPrintJob.StartJob( m_aTmpFile.Len() ? m_aTmpFile : m_aFileName, nMode, rJobName, rAppName, m_aJobData, &m_aPrinterGfx, bDirect ) ? TRUE : FALSE; + return m_aPrintJob.StartJob( m_aTmpFile.Len() ? m_aTmpFile : m_aFileName, nMode, rJobName, rAppName, m_aJobData, &m_aPrinterGfx, bDirect ) ? sal_True : sal_False; } // ----------------------------------------------------------------------- -BOOL PspSalPrinter::EndJob() +sal_Bool PspSalPrinter::EndJob() { - BOOL bSuccess = FALSE; + sal_Bool bSuccess = sal_False; if( m_bIsPDFWriterJob ) - bSuccess = TRUE; + bSuccess = sal_True; else { bSuccess = m_aPrintJob.EndJob(); @@ -1072,16 +1072,16 @@ BOOL PspSalPrinter::EndJob() // ----------------------------------------------------------------------- -BOOL PspSalPrinter::AbortJob() +sal_Bool PspSalPrinter::AbortJob() { - BOOL bAbort = m_aPrintJob.AbortJob() ? TRUE : FALSE; + sal_Bool bAbort = m_aPrintJob.AbortJob() ? sal_True : sal_False; vcl_sal::PrinterUpdate::jobEnded(); return bAbort; } // ----------------------------------------------------------------------- -SalGraphics* PspSalPrinter::StartPage( ImplJobSetup* pJobSetup, BOOL ) +SalGraphics* PspSalPrinter::StartPage( ImplJobSetup* pJobSetup, sal_Bool ) { JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, m_aJobData ); m_pGraphics = new PspGraphics( &m_aJobData, &m_aPrinterGfx, m_bFax ? &m_aFaxNr : NULL, m_bSwallowFaxNo, m_pInfoPrinter ); @@ -1102,16 +1102,16 @@ SalGraphics* PspSalPrinter::StartPage( ImplJobSetup* pJobSetup, BOOL ) // ----------------------------------------------------------------------- -BOOL PspSalPrinter::EndPage() +sal_Bool PspSalPrinter::EndPage() { sal_Bool bResult = m_aPrintJob.EndPage(); m_aPrinterGfx.Clear(); - return bResult ? TRUE : FALSE; + return bResult ? sal_True : sal_False; } // ----------------------------------------------------------------------- -ULONG PspSalPrinter::GetErrorCode() +sal_uInt32 PspSalPrinter::GetErrorCode() { return 0; } @@ -1121,10 +1121,10 @@ ULONG PspSalPrinter::GetErrorCode() struct PDFNewJobParameters { Size maPageSize; - USHORT mnPaperBin; + sal_uInt16 mnPaperBin; PDFNewJobParameters( const Size& i_rSize = Size(), - USHORT i_nPaperBin = 0xffff ) + sal_uInt16 i_nPaperBin = 0xffff ) : maPageSize( i_rSize ), mnPaperBin( i_nPaperBin ) {} bool operator!=(const PDFNewJobParameters& rComp ) const @@ -1152,7 +1152,7 @@ struct PDFPrintFile , maParameters( i_rNewParameters ) {} }; -BOOL PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJobName, const String& i_rAppName, +sal_Bool PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJobName, const String& i_rAppName, ImplJobSetup* i_pSetupData, vcl::PrinterController& i_rController ) { OSL_TRACE( "StartJob with controller: pFilename = %s", i_pFileName ? rtl::OUStringToOString( *i_pFileName, RTL_TEXTENCODING_UTF8 ).getStr() : "" ); @@ -1376,7 +1376,7 @@ BOOL PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJobNam } } - return TRUE; + return sal_True; } diff --git a/vcl/unx/source/gdi/salvd.cxx b/vcl/unx/source/gdi/salvd.cxx index f242fffae715..675deef90ffe 100644 --- a/vcl/unx/source/gdi/salvd.cxx +++ b/vcl/unx/source/gdi/salvd.cxx @@ -44,7 +44,7 @@ // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= SalVirtualDevice* X11SalInstance::CreateVirtualDevice( SalGraphics* pGraphics, long nDX, long nDY, - USHORT nBitCount, const SystemGraphicsData *pData ) + sal_uInt16 nBitCount, const SystemGraphicsData *pData ) { X11SalVirtualDevice *pVDev = new X11SalVirtualDevice(); if( !nBitCount && pGraphics ) @@ -125,14 +125,14 @@ void X11SalGraphics::Init( X11SalVirtualDevice *pDevice, SalColormap* pColormap, m_pFrame = NULL; bWindow_ = pDisplay->IsDisplay(); - bVirDev_ = TRUE; + bVirDev_ = sal_True; } // -=-= SalVirDevData / SalVirtualDevice -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -BOOL X11SalVirtualDevice::Init( SalDisplay *pDisplay, +sal_Bool X11SalVirtualDevice::Init( SalDisplay *pDisplay, long nDX, long nDY, - USHORT nBitCount, + sal_uInt16 nBitCount, int nScreen, Pixmap hDrawable, void* pRenderFormatVoid ) @@ -170,12 +170,12 @@ BOOL X11SalVirtualDevice::Init( SalDisplay *pDisplay, else { hDrawable_ = hDrawable; - bExternPixmap_ = TRUE; + bExternPixmap_ = sal_True; } pGraphics_->Init( this, pColormap, bDeleteColormap ); - return hDrawable_ != None ? TRUE : FALSE; + return hDrawable_ != None ? sal_True : sal_False; } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -187,8 +187,8 @@ X11SalVirtualDevice::X11SalVirtualDevice() nDX_ = 0; nDY_ = 0; nDepth_ = 0; - bGraphics_ = FALSE; - bExternPixmap_ = FALSE; + bGraphics_ = sal_False; + bExternPixmap_ = sal_False; } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -208,18 +208,18 @@ SalGraphics* X11SalVirtualDevice::GetGraphics() return NULL; if( pGraphics_ ) - bGraphics_ = TRUE; + bGraphics_ = sal_True; return pGraphics_; } void X11SalVirtualDevice::ReleaseGraphics( SalGraphics* ) -{ bGraphics_ = FALSE; } +{ bGraphics_ = sal_False; } -BOOL X11SalVirtualDevice::SetSize( long nDX, long nDY ) +sal_Bool X11SalVirtualDevice::SetSize( long nDX, long nDY ) { if( bExternPixmap_ ) - return FALSE; + return sal_False; // #144688# // the X protocol request CreatePixmap puts an upper bound @@ -229,7 +229,7 @@ BOOL X11SalVirtualDevice::SetSize( long nDX, long nDY ) // 16 bit truncation here without noticing. if( nDX < 0 || nDX > 65535 || nDY < 0 || nDY > 65535 ) - return FALSE; + return sal_False; if( !nDX ) nDX = 1; if( !nDY ) nDY = 1; @@ -248,7 +248,7 @@ BOOL X11SalVirtualDevice::SetSize( long nDX, long nDY ) nDX_ = 1; nDY_ = 1; } - return FALSE; + return sal_False; } if( GetDrawable() ) @@ -261,7 +261,7 @@ BOOL X11SalVirtualDevice::SetSize( long nDX, long nDY ) if( pGraphics_ ) InitGraphics( this ); - return TRUE; + return sal_True; } void X11SalVirtualDevice::GetSize( long& rWidth, long& rHeight ) diff --git a/vcl/unx/source/gdi/xfont.cxx b/vcl/unx/source/gdi/xfont.cxx index f6d19909cd4a..a4da5033e36b 100644 --- a/vcl/unx/source/gdi/xfont.cxx +++ b/vcl/unx/source/gdi/xfont.cxx @@ -275,16 +275,16 @@ ExtendedFontStruct::Match( const ExtendedXlfd *pXlfd, return false; if( bVertical != mbVertical ) - return FALSE; + return false; if( rPixelSize.Height() != maPixelSize.Height() ) - return FALSE; + return false; long nReqWidth = rPixelSize.Width(); if( !nReqWidth ) nReqWidth = rPixelSize.Height(); if( nReqWidth != maPixelSize.Width() ) - return FALSE; + return false; return true; } diff --git a/vcl/unx/source/window/salframe.cxx b/vcl/unx/source/window/salframe.cxx index 9934277302e1..0e0c5f6c03c7 100644 --- a/vcl/unx/source/window/salframe.cxx +++ b/vcl/unx/source/window/salframe.cxx @@ -209,7 +209,7 @@ void X11SalFrame::askForXEmbedFocus( sal_Int32 i_nTimeCode ) // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalFrame::Init( ULONG nSalFrameStyle, int nScreen, SystemParentData* pParentData, bool bUseGeometry ) +void X11SalFrame::Init( sal_uInt32 nSalFrameStyle, int nScreen, SystemParentData* pParentData, bool bUseGeometry ) { if( nScreen < 0 || nScreen >= GetDisplay()->GetScreenCount() ) nScreen = GetDisplay()->GetDefaultScreenNumber(); @@ -482,8 +482,8 @@ void X11SalFrame::Init( ULONG nSalFrameStyle, int nScreen, SystemParentData* pPa } nShowState_ = SHOWSTATE_UNKNOWN; - bViewable_ = TRUE; - bMapped_ = FALSE; + bViewable_ = sal_True; + bMapped_ = sal_False; nVisibility_ = VisibilityFullyObscured; mhWindow = XCreateWindow( GetXDisplay(), aFrameParent, @@ -645,7 +645,7 @@ void X11SalFrame::Init( ULONG nSalFrameStyle, int nScreen, SystemParentData* pPa } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -X11SalFrame::X11SalFrame( SalFrame *pParent, ULONG nSalFrameStyle, SystemParentData* pSystemParent ) +X11SalFrame::X11SalFrame( SalFrame *pParent, sal_uInt32 nSalFrameStyle, SystemParentData* pSystemParent ) { X11SalData* pSalData = GetX11SalData(); @@ -686,16 +686,16 @@ X11SalFrame::X11SalFrame( SalFrame *pParent, ULONG nSalFrameStyle, SystemParentD nHeight_ = 0; nStyle_ = 0; mnExtStyle = 0; - bAlwaysOnTop_ = FALSE; + bAlwaysOnTop_ = sal_False; - // set bViewable_ to TRUE: hack GetClientSize to report something + // set bViewable_ to sal_True: hack GetClientSize to report something // different to 0/0 before first map - bViewable_ = TRUE; - bMapped_ = FALSE; - bDefaultPosition_ = TRUE; + bViewable_ = sal_True; + bMapped_ = sal_False; + bDefaultPosition_ = sal_True; nVisibility_ = VisibilityFullyObscured; m_nWorkArea = 0; - mbInShow = FALSE; + mbInShow = sal_False; m_bXEmbed = false; nScreenSaversTimeout_ = 0; @@ -790,10 +790,10 @@ X11SalFrame::~X11SalFrame() XSelectInput( GetXDisplay(), GetShellWindow(), 0 ); XSelectInput( GetXDisplay(), GetWindow(), 0 ); - ShowFullScreen( FALSE, 0 ); + ShowFullScreen( sal_False, 0 ); if( bMapped_ ) - Show( FALSE ); + Show( sal_False ); if( mpInputContext ) { @@ -963,7 +963,7 @@ void X11SalFrame::Enable( BOOL /*bEnable*/ ) // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalFrame::SetIcon( USHORT nIcon ) +void X11SalFrame::SetIcon( sal_uInt16 nIcon ) { if ( ! IsChildWindow() ) { @@ -1158,7 +1158,7 @@ void X11SalFrame::Show( BOOL bVisible, BOOL bNoActivate ) { SessionManagerClient::open(); // will simply return after the first time - mbInShow = TRUE; + mbInShow = sal_True; if( ! (nStyle_ & SAL_FRAME_STYLE_INTRO) ) { // hide all INTRO frames @@ -1170,12 +1170,12 @@ void X11SalFrame::Show( BOOL bVisible, BOOL bNoActivate ) if( pFrame->nStyle_ & SAL_FRAME_STYLE_INTRO ) { if( pFrame->bMapped_ ) - const_cast(pFrame)->Show( FALSE ); + const_cast(pFrame)->Show( sal_False ); } } } - // update NET_WM_STATE which may have been deleted due to earlier Show(FALSE) + // update NET_WM_STATE which may have been deleted due to earlier Show(sal_False) if( nShowState_ == SHOWSTATE_HIDDEN ) GetDisplay()->getWMAdaptor()->frameIsMapping( this ); @@ -1185,7 +1185,7 @@ void X11SalFrame::Show( BOOL bVisible, BOOL bNoActivate ) * with the basic dialogue editor, * which shows a frame and instantly hides it again. After that the * editor window is shown and the WM takes this as an opportunity - * to show our hidden transient frame also. So Show( FALSE ) must + * to show our hidden transient frame also. So Show( sal_False ) must * withdraw the frame AND delete the WM_TRANSIENT_FOR property. * In case the frame is shown again, the transient hint must be restored here. */ @@ -1319,7 +1319,7 @@ void X11SalFrame::Show( BOOL bVisible, BOOL bNoActivate ) * #98107# plugged windows don't necessarily get the * focus on show because the parent may already be mapped * and have the focus. So try to set the focus - * to the child on Show(TRUE) + * to the child on Show(sal_True) */ if( (nStyle_ & SAL_FRAME_STYLE_PLUG) && ! m_bXEmbed ) XSetInputFocus( GetXDisplay(), @@ -1367,7 +1367,7 @@ void X11SalFrame::Show( BOOL bVisible, BOOL bNoActivate ) } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalFrame::ToTop( USHORT nFlags ) +void X11SalFrame::ToTop( sal_uInt16 nFlags ) { if( ( nFlags & SAL_FRAME_TOTOP_RESTOREWHENMIN ) && ! ( nStyle_ & SAL_FRAME_STYLE_FLOAT ) @@ -1585,7 +1585,7 @@ void X11SalFrame::updateScreenNumber() } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags ) +void X11SalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ) { if( nStyle_ & SAL_FRAME_STYLE_PLUG ) return; @@ -1851,7 +1851,7 @@ BOOL X11SalFrame::GetWindowState( SalFrameState* pState ) pState->mnMask |= _FRAMESTATE_MASK_MAXIMIZED_GEOMETRY; } - return TRUE; + return sal_True; } // ---------------------------------------------------------------------------- @@ -2170,22 +2170,22 @@ void X11SalFrame::SetScreenNumber( unsigned int nNewScreen ) Rectangle aNewScreenRect( GetDisplay()->GetXineramaScreens()[nNewScreen] ); bool bVisible = bMapped_; if( bVisible ) - Show( FALSE ); + Show( sal_False ); maGeometry.nX = aNewScreenRect.Left() + (maGeometry.nX - aOldScreenRect.Left()); maGeometry.nY = aNewScreenRect.Top() + (maGeometry.nY - aOldScreenRect.Top()); createNewWindow( None, m_nScreen ); if( bVisible ) - Show( TRUE ); + Show( sal_True ); maGeometry.nScreenNumber = nNewScreen; } else if( sal_Int32(nNewScreen) < GetDisplay()->GetScreenCount() ) { bool bVisible = bMapped_; if( bVisible ) - Show( FALSE ); + Show( sal_False ); createNewWindow( None, nNewScreen ); if( bVisible ) - Show( TRUE ); + Show( sal_True ); maGeometry.nScreenNumber = nNewScreen; } } @@ -2210,7 +2210,7 @@ void X11SalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen ) nStyle_ |= SAL_FRAME_STYLE_PARTIAL_FULLSCREEN; bool bVisible = bMapped_; if( bVisible ) - Show( FALSE ); + Show( sal_False ); maGeometry.nX = aRect.Left(); maGeometry.nY = aRect.Top(); maGeometry.nWidth = aRect.GetWidth(); @@ -2223,7 +2223,7 @@ void X11SalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen ) else GetDisplay()->getWMAdaptor()->showFullScreen( this, true ); if( bVisible ) - Show(TRUE); + Show(sal_True); } else @@ -2234,14 +2234,14 @@ void X11SalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen ) Rectangle aRect = maRestorePosSize; maRestorePosSize = Rectangle(); if( bVisible ) - Show( FALSE ); + Show( sal_False ); createNewWindow( None, m_nScreen ); if( !aRect.IsEmpty() ) SetPosSize( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(), SAL_FRAME_POSSIZE_X | SAL_FRAME_POSSIZE_Y | SAL_FRAME_POSSIZE_WIDTH | SAL_FRAME_POSSIZE_HEIGHT ); if( bVisible ) - Show( TRUE ); + Show( sal_True ); } } else @@ -2254,12 +2254,12 @@ void X11SalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen ) if( mbFullScreen ) pDisplay_->getWMAdaptor()->showFullScreen( this, false ); if( bVisible ) - Show( FALSE ); + Show( sal_False ); createNewWindow( None, nScreen ); if( mbFullScreen ) pDisplay_->getWMAdaptor()->showFullScreen( this, true ); if( bVisible ) - Show( TRUE ); + Show( sal_True ); } if( mbFullScreen == (bool)bFullScreen ) return; @@ -2344,7 +2344,7 @@ MessageToXAutoLock( Display *p_display, int n_message ) } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalFrame::StartPresentation( BOOL bStart ) +void X11SalFrame::StartPresentation( sal_Bool bStart ) { I18NStatus::get().show( !bStart, I18NStatus::presentation ); if ( bStart ) @@ -2362,7 +2362,7 @@ void X11SalFrame::StartPresentation( BOOL bStart ) static bool DPMSExtensionAvailable = #ifndef SOLARIS (DPMSQueryExtension(GetXDisplay(), &dummy, &dummy) != 0); - static XLIB_BOOL DPMSEnabled = false; + static BOOL DPMSEnabled = false; #else false; bool DPMSEnabled = false; @@ -2544,7 +2544,7 @@ X11SalFrame::HandleExtTextEvent (XClientMessageEvent *pEvent) BOOL X11SalFrame::PostEvent( void *pData ) { GetDisplay()->SendInternalEvent( this, pData ); - return TRUE; + return sal_True; } // Title @@ -2616,7 +2616,7 @@ void X11SalFrame::SetInputContext( SalInputContext* pContext ) // ----------------------------------------------------------------------- -void X11SalFrame::EndExtTextInput( USHORT nFlags ) +void X11SalFrame::EndExtTextInput( sal_uInt16 nFlags ) { if (mpInputContext != NULL) mpInputContext->EndExtTextInput( nFlags ); @@ -2624,12 +2624,12 @@ void X11SalFrame::EndExtTextInput( USHORT nFlags ) // ----------------------------------------------------------------------- -XubString X11SalFrame::GetKeyName( USHORT nKeyCode ) +XubString X11SalFrame::GetKeyName( sal_uInt16 nKeyCode ) { return GetDisplay()->GetKeyName( nKeyCode ); } -XubString X11SalFrame::GetSymbolKeyName( const XubString&, USHORT nKeyCode ) +XubString X11SalFrame::GetSymbolKeyName( const XubString&, sal_uInt16 nKeyCode ) { return GetKeyName( nKeyCode ); } @@ -2637,7 +2637,7 @@ XubString X11SalFrame::GetSymbolKeyName( const XubString&, USHORT nKeyCode ) BOOL X11SalFrame::MapUnicodeToKeyCode( sal_Unicode , LanguageType , KeyCode& ) { // not supported yet - return FALSE; + return sal_False; } LanguageType X11SalFrame::GetInputLanguage() @@ -2696,7 +2696,7 @@ void X11SalFrame::createNewWindow( XLIB_Window aNewParent, int nScreen ) { bool bWasVisible = bMapped_; if( bWasVisible ) - Show( FALSE ); + Show( sal_False ); if( nScreen < 0 || nScreen >= GetDisplay()->GetScreenCount() ) nScreen = m_nScreen; @@ -2765,7 +2765,7 @@ void X11SalFrame::createNewWindow( XLIB_Window aNewParent, int nScreen ) } if( bWasVisible ) - Show( TRUE ); + Show( sal_True ); std::list< X11SalFrame* > aChildren = maChildren; for( std::list< X11SalFrame* >::iterator it = aChildren.begin(); it != aChildren.end(); ++it ) @@ -2801,9 +2801,9 @@ void X11SalFrame::Beep( SoundType eSoundType ) // not fully suported // Event Handling // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -static USHORT sal_GetCode( int state ) +static sal_uInt16 sal_GetCode( int state ) { - USHORT nCode = 0; + sal_uInt16 nCode = 0; if( state & Button1Mask ) nCode |= MOUSE_LEFT; @@ -2852,7 +2852,7 @@ SalFrame::SalPointerState X11SalFrame::GetPointerState() long X11SalFrame::HandleMouseEvent( XEvent *pEvent ) { SalMouseEvent aMouseEvt; - USHORT nEvent = 0; + sal_uInt16 nEvent = 0; bool bClosePopups = false; if( nVisibleFloats && pEvent->type == EnterNotify ) @@ -2978,7 +2978,7 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent ) } if( ! bInside ) { - // need not take care of the XUngrabPointer in Show( FALSE ) + // need not take care of the XUngrabPointer in Show( sal_False ) // because XUngrabPointer does not produce errors if pointer // is not grabbed XUngrabPointer( GetXDisplay(), CurrentTime ); @@ -3062,7 +3062,7 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent ) if( pEvent->type == ButtonRelease ) return 0; - static ULONG nLines = 0; + static sal_uInt32 nLines = 0; if( ! nLines ) { char* pEnv = getenv( "SAL_WHEELLINES" ); @@ -3124,14 +3124,14 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent ) // in the independent part. struct KeyAlternate { - USHORT nKeyCode; + sal_uInt16 nKeyCode; sal_Unicode nCharCode; KeyAlternate() : nKeyCode( 0 ), nCharCode( 0 ) {} - KeyAlternate( USHORT nKey, sal_Unicode nChar = 0 ) : nKeyCode( nKey ), nCharCode( nChar ) {} + KeyAlternate( sal_uInt16 nKey, sal_Unicode nChar = 0 ) : nKeyCode( nKey ), nCharCode( nChar ) {} }; inline KeyAlternate -GetAlternateKeyCode( const USHORT nKeyCode ) +GetAlternateKeyCode( const sal_uInt16 nKeyCode ) { KeyAlternate aAlternate; @@ -3156,7 +3156,7 @@ void X11SalFrame::beginUnicodeSequence() if( ! aDeleteWatch.isDeleted() ) { - USHORT nTextAttr = SAL_EXTTEXTINPUT_ATTR_UNDERLINE; + sal_uInt16 nTextAttr = SAL_EXTTEXTINPUT_ATTR_UNDERLINE; SalExtTextInputEvent aEv; aEv.mnTime = 0; aEv.maText = rSeq; @@ -3164,7 +3164,7 @@ void X11SalFrame::beginUnicodeSequence() aEv.mnCursorPos = 0; aEv.mnDeltaStart = 0; aEv.mnCursorFlags = 0; - aEv.mbOnlyCursor = FALSE; + aEv.mbOnlyCursor = sal_False; CallCallback(SALEVENT_EXTTEXTINPUT, (void*)&aEv); } @@ -3185,7 +3185,7 @@ bool X11SalFrame::appendUnicodeSequence( sal_Unicode c ) aBuf.append( rSeq ); aBuf.append( c ); rSeq = aBuf.makeStringAndClear(); - std::vector attribs( rSeq.getLength(), SAL_EXTTEXTINPUT_ATTR_UNDERLINE ); + std::vector attribs( rSeq.getLength(), SAL_EXTTEXTINPUT_ATTR_UNDERLINE ); SalExtTextInputEvent aEv; aEv.mnTime = 0; @@ -3194,7 +3194,7 @@ bool X11SalFrame::appendUnicodeSequence( sal_Unicode c ) aEv.mnCursorPos = 0; aEv.mnDeltaStart = 0; aEv.mnCursorFlags = 0; - aEv.mbOnlyCursor = FALSE; + aEv.mbOnlyCursor = sal_False; CallCallback(SALEVENT_EXTTEXTINPUT, (void*)&aEv); bRet = true; @@ -3219,7 +3219,7 @@ bool X11SalFrame::endUnicodeSequence() sal_Int32 nValue = aNumbers.toInt32( 16 ); if( nValue >= 32 ) { - USHORT nTextAttr = SAL_EXTTEXTINPUT_ATTR_UNDERLINE; + sal_uInt16 nTextAttr = SAL_EXTTEXTINPUT_ATTR_UNDERLINE; SalExtTextInputEvent aEv; aEv.mnTime = 0; aEv.maText = rtl::OUString( sal_Unicode(nValue) ); @@ -3227,7 +3227,7 @@ bool X11SalFrame::endUnicodeSequence() aEv.mnCursorPos = 0; aEv.mnDeltaStart = 0; aEv.mnCursorFlags = 0; - aEv.mbOnlyCursor = FALSE; + aEv.mbOnlyCursor = sal_False; CallCallback(SALEVENT_EXTTEXTINPUT, (void*)&aEv); } } @@ -3272,8 +3272,8 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent ) } SalKeyEvent aKeyEvt; - USHORT nKeyCode; - USHORT nModCode = 0; + sal_uInt16 nKeyCode; + sal_uInt16 nModCode = 0; char aDummy; if( pEvent->state & ShiftMask ) @@ -3306,8 +3306,8 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent ) // the event state does not contain ControlMask. In the release // event its the other way round: it does contain the Control mask. // The modifier mode therefore has to be adapted manually. - USHORT nExtModMask = 0; - USHORT nModMask = 0; + sal_uInt16 nExtModMask = 0; + sal_uInt16 nModMask = 0; switch( nKeySym ) { case XK_Control_L: @@ -3413,7 +3413,7 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent ) if( nModCode == (KEY_SHIFT | KEY_MOD1) && pEvent->type == XLIB_KeyPress ) { - USHORT nSeqKeyCode = pDisplay_->GetKeyCode( nUnmodifiedKeySym, &aDummy ); + sal_uInt16 nSeqKeyCode = pDisplay_->GetKeyCode( nUnmodifiedKeySym, &aDummy ); if( nSeqKeyCode == KEY_U ) { beginUnicodeSequence(); @@ -3600,7 +3600,7 @@ long X11SalFrame::HandleFocusEvent( XFocusChangeEvent *pEvent ) if ((mpParent != NULL && nStyle_ == 0) && pSVData->maWinData.mpFirstFloat ) { - ULONG nMode = pSVData->maWinData.mpFirstFloat->GetPopupModeFlags(); + sal_uInt32 nMode = pSVData->maWinData.mpFirstFloat->GetPopupModeFlags(); pSVData->maWinData.mpFirstFloat->SetPopupModeFlags( nMode & ~(FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE)); } @@ -3623,7 +3623,7 @@ long X11SalFrame::HandleFocusEvent( XFocusChangeEvent *pEvent ) long X11SalFrame::HandleExposeEvent( XEvent *pEvent ) { XRectangle aRect = { 0, 0, 0, 0 }; - USHORT nCount = 0; + sal_uInt16 nCount = 0; if( pEvent->type == Expose ) { @@ -3845,8 +3845,8 @@ long X11SalFrame::HandleReparentEvent( XReparentEvent *pEvent ) hWM_Parent = GetShellWindow(); break; } - /* #107048# this sometimes happens if a Show(TRUE) is - * immediately followed by Show(FALSE) (which is braindead anyway) + /* #107048# this sometimes happens if a Show(sal_True) is + * immediately followed by Show(sal_False) (which is braindead anyway) */ if( hDummy == hWM_Parent ) hDummy = hRoot; @@ -4192,7 +4192,7 @@ long X11SalFrame::Dispatch( XEvent *pEvent ) if( -1 == nCaptured_ ) { - CaptureMouse( TRUE ); + CaptureMouse( sal_True ); #ifdef DBG_UTIL if( -1 != nCaptured_ ) pDisplay_->PrintEvent( "Captured", pEvent ); @@ -4263,9 +4263,9 @@ long X11SalFrame::Dispatch( XEvent *pEvent ) XUnmapWindow( GetXDisplay(), GetShellWindow() ); break; } - bMapped_ = TRUE; - bViewable_ = TRUE; - nRet = TRUE; + bMapped_ = sal_True; + bViewable_ = sal_True; + nRet = sal_True; if ( mpInputContext != NULL ) mpInputContext->Map( this ); CallCallback( SALEVENT_RESIZE, NULL ); @@ -4353,7 +4353,7 @@ long X11SalFrame::Dispatch( XEvent *pEvent ) RestackChildren(); - mbInShow = FALSE; + mbInShow = sal_False; m_bSetFocusOnMap = false; } break; @@ -4361,9 +4361,9 @@ long X11SalFrame::Dispatch( XEvent *pEvent ) case UnmapNotify: if( pEvent->xunmap.window == GetShellWindow() ) { - bMapped_ = FALSE; - bViewable_ = FALSE; - nRet = TRUE; + bMapped_ = sal_False; + bViewable_ = sal_False; + nRet = sal_True; if ( mpInputContext != NULL ) mpInputContext->Unmap( this ); CallCallback( SALEVENT_RESIZE, NULL ); @@ -4378,7 +4378,7 @@ long X11SalFrame::Dispatch( XEvent *pEvent ) case VisibilityNotify: nVisibility_ = pEvent->xvisibility.state; - nRet = TRUE; + nRet = sal_True; if( bAlwaysOnTop_ && bMapped_ && ! GetDisplay()->getWMAdaptor()->isAlwaysOnTopOK() @@ -4477,7 +4477,7 @@ void X11SalFrame::ResetClipRegion() op, ordering ); } -void X11SalFrame::BeginSetClipRegion( ULONG nRects ) +void X11SalFrame::BeginSetClipRegion( sal_uInt32 nRects ) { if( m_pClipRectangles ) delete [] m_pClipRectangles; diff --git a/vcl/unx/source/window/salobj.cxx b/vcl/unx/source/window/salobj.cxx index 2ff6d05c35c6..730eab142415 100644 --- a/vcl/unx/source/window/salobj.cxx +++ b/vcl/unx/source/window/salobj.cxx @@ -55,12 +55,12 @@ // ======================================================================= // SalInstance member to create and destroy a SalObject -SalObject* X11SalInstance::CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow ) +SalObject* X11SalInstance::CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow ) { return X11SalObject::CreateObject( pParent, pWindowData, bShow ); } -X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow ) +X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow ) { int error_base, event_base; X11SalObject* pObject = new X11SalObject(); @@ -152,7 +152,7 @@ X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* p pVisual, CWEventMask|CWColormap, &aAttribs ); XSync( pDisp, False ); - BOOL bWasXError = pSalDisp->GetXLib()->HasXErrorOccured(); + sal_Bool bWasXError = pSalDisp->GetXLib()->HasXErrorOccured(); pSalDisp->GetXLib()->PopXErrorLevel(); if( bWasXError ) { @@ -179,7 +179,7 @@ X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* p pObjData->pAppContext = NULL; XSync(pDisp, False); - BOOL bWasXError = pSalDisp->GetXLib()->HasXErrorOccured(); + sal_Bool bWasXError = pSalDisp->GetXLib()->HasXErrorOccured(); pSalDisp->GetXLib()->PopXErrorLevel(); if( bWasXError ) { @@ -219,7 +219,7 @@ SalClipRegion::~SalClipRegion() void -SalClipRegion::BeginSetClipRegion( ULONG nRects ) +SalClipRegion::BeginSetClipRegion( sal_uInt32 nRects ) { if (ClipRectangleList) delete [] ClipRectangleList; @@ -324,7 +324,7 @@ X11SalObject::ResetClipRegion() void -X11SalObject::BeginSetClipRegion( ULONG nRectCount ) +X11SalObject::BeginSetClipRegion( sal_uInt32 nRectCount ) { maClipRegion.BeginSetClipRegion ( nRectCount ); } @@ -375,7 +375,7 @@ X11SalObject::EndSetClipRegion() } -USHORT +sal_uInt16 X11SalObject::GetClipRegionType() { return maClipRegion.GetClipRegionType(); @@ -399,7 +399,7 @@ X11SalObject::SetPosSize( long nX, long nY, long nWidth, long nHeight ) void -X11SalObject::Show( BOOL bVisible ) +X11SalObject::Show( sal_Bool bVisible ) { if ( ! maSystemChildData.aWindow ) return; @@ -420,7 +420,7 @@ X11SalObject::Show( BOOL bVisible ) // ----------------------------------------------------------------------- -void X11SalObject::Enable( BOOL ) +void X11SalObject::Enable( sal_Bool ) { } @@ -454,9 +454,9 @@ const SystemChildData* X11SalObject::GetSystemData() const return &maSystemChildData; } -static USHORT sal_GetCode( int state ) +static sal_uInt16 sal_GetCode( int state ) { - USHORT nCode = 0; + sal_uInt16 nCode = 0; if( state & Button1Mask ) nCode |= MOUSE_LEFT; @@ -512,7 +512,7 @@ long X11SalObject::Dispatch( XEvent* pEvent ) aEvt.mnTime = pEvent->xbutton.time; aEvt.mnCode = sal_GetCode( pEvent->xbutton.state ); aEvt.mnButton = 0; - USHORT nEvent = 0; + sal_uInt16 nEvent = 0; if( pEvent->type == ButtonPress || pEvent->type == ButtonRelease ) { @@ -537,10 +537,10 @@ long X11SalObject::Dispatch( XEvent* pEvent ) switch( pEvent->type ) { case UnmapNotify: - pObject->mbVisible = FALSE; + pObject->mbVisible = sal_False; return 1; case MapNotify: - pObject->mbVisible = TRUE; + pObject->mbVisible = sal_True; return 1; case ButtonPress: pObject->CallCallback( SALOBJ_EVENT_TOTOP, NULL ); -- cgit From 8035cbd9e3e5c13095deaae443eb80e3b9785c3a Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Mon, 10 Jan 2011 10:28:18 +0100 Subject: removetooltypes01: #i112600# Last fixes for VCL --- vcl/unx/gtk/app/gtkinst.cxx | 4 ++-- vcl/unx/source/printer/jobdata.cxx | 2 +- vcl/unx/source/printer/ppdparser.cxx | 22 +++++++++++----------- vcl/unx/source/printer/printerinfomanager.cxx | 4 ++-- vcl/unx/source/printergfx/common_gfx.cxx | 8 ++++---- vcl/unx/source/printergfx/printerjob.cxx | 6 +++--- 6 files changed, 23 insertions(+), 23 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx index 4f9a739ea85a..f58f49865f7c 100644 --- a/vcl/unx/gtk/app/gtkinst.cxx +++ b/vcl/unx/gtk/app/gtkinst.cxx @@ -193,14 +193,14 @@ SalFrame* GtkInstance::CreateFrame( SalFrame* pParent, sal_uInt32 nStyle ) return new GtkSalFrame( pParent, nStyle ); } -SalFrame* GtkInstance::CreateChildFrame( SystemParentData* pParentData, ULONG ) +SalFrame* GtkInstance::CreateChildFrame( SystemParentData* pParentData, sal_uInt32 ) { SalFrame* pFrame = new GtkSalFrame( pParentData ); return pFrame; } -SalObject* GtkInstance::CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow ) +SalObject* GtkInstance::CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow ) { // there is no method to set a visual for a GtkWidget // so we need the X11SalObject in that case diff --git a/vcl/unx/source/printer/jobdata.cxx b/vcl/unx/source/printer/jobdata.cxx index d4211eae31df..046c7fd681b9 100644 --- a/vcl/unx/source/printer/jobdata.cxx +++ b/vcl/unx/source/printer/jobdata.cxx @@ -167,7 +167,7 @@ bool JobData::getStreamBuffer( void*& pData, int& bytes ) // now append the PPDContext stream buffer aStream.WriteLine( "PPDContexData" ); - ULONG nBytes; + sal_uInt32 nBytes; void* pContextBuffer = m_aContext.getStreamableBuffer( nBytes ); if( nBytes ) aStream.Write( pContextBuffer, nBytes ); diff --git a/vcl/unx/source/printer/ppdparser.cxx b/vcl/unx/source/printer/ppdparser.cxx index 587e58be5bc7..3cdd4c35f3ec 100644 --- a/vcl/unx/source/printer/ppdparser.cxx +++ b/vcl/unx/source/printer/ppdparser.cxx @@ -311,7 +311,7 @@ void PPDDecompressStream::Open( const rtl::OUString& i_rFile ) mpFileStream->Seek( 0 ); // check for compress'ed or gzip'ed file - ULONG nCompressMethod = 0; + sal_uInt32 nCompressMethod = 0; if( aLine.Len() > 1 && static_cast(aLine.GetChar( 0 )) == 0x1f ) { if( static_cast(aLine.GetChar( 1 )) == 0x8b ) // check for gzip @@ -1110,7 +1110,7 @@ void PPDParser::parse( ::std::list< ByteString >& rLines ) m_pTranslator->insertValue( aUniKey, aOption, aValue, aValueTranslation, aTransLocale ); // eventually update query and remove from option list - if( bQuery && pKey->m_bQueryValue == FALSE ) + if( bQuery && pKey->m_bQueryValue == sal_False ) { pKey->m_aQueryValue = *pValue; pKey->m_bQueryValue = true; @@ -1125,7 +1125,7 @@ void PPDParser::parse( ::std::list< ByteString >& rLines ) if( aLine.CompareTo( "*Default", 8 ) == COMPARE_EQUAL ) { String aKey( aLine.Copy( 8 ), RTL_TEXTENCODING_MS_1252 ); - USHORT nPos = aKey.Search( ':' ); + sal_uInt16 nPos = aKey.Search( ':' ); if( nPos != STRING_NOTFOUND ) { aKey.Erase( nPos ); @@ -1417,7 +1417,7 @@ String PPDParser::getSlot( int nSlot ) const if( nSlot > 0 && nSlot < m_pInputSlots->countValues() ) return m_pInputSlots->getValue( nSlot )->m_aOption; else if( m_pInputSlots->countValues() > 0 ) - return m_pInputSlots->getValue( (ULONG)0 )->m_aOption; + return m_pInputSlots->getValue( (sal_uInt32)0 )->m_aOption; return String(); } @@ -1430,7 +1430,7 @@ String PPDParser::getSlotCommand( int nSlot ) const if( nSlot > 0 && nSlot < m_pInputSlots->countValues() ) return m_pInputSlots->getValue( nSlot )->m_aValue; else if( m_pInputSlots->countValues() > 0 ) - return m_pInputSlots->getValue( (ULONG)0 )->m_aValue; + return m_pInputSlots->getValue( (sal_uInt32)0 )->m_aValue; return String(); } @@ -1457,7 +1457,7 @@ String PPDParser::getPaperDimension( int nPaperDimension ) const if( nPaperDimension > 0 && nPaperDimension < m_pPaperDimensions->countValues() ) return m_pPaperDimensions->getValue( nPaperDimension )->m_aOption; else if( m_pPaperDimensions->countValues() > 0 ) - return m_pPaperDimensions->getValue( (ULONG)0 )->m_aOption; + return m_pPaperDimensions->getValue( (sal_uInt32)0 )->m_aOption; return String(); } @@ -1470,7 +1470,7 @@ String PPDParser::getPaperDimensionCommand( int nPaperDimension ) const if( nPaperDimension > 0 && nPaperDimension < m_pPaperDimensions->countValues() ) return m_pPaperDimensions->getValue( nPaperDimension )->m_aValue; else if( m_pPaperDimensions->countValues() > 0 ) - return m_pPaperDimensions->getValue( (ULONG)0 )->m_aValue; + return m_pPaperDimensions->getValue( (sal_uInt32)0 )->m_aValue; return String(); } @@ -1578,7 +1578,7 @@ String PPDParser::getDuplex( int nDuplex ) const if( nDuplex > 0 && nDuplex < m_pDuplexTypes->countValues() ) return m_pDuplexTypes->getValue( nDuplex )->m_aOption; else if( m_pDuplexTypes->countValues() > 0 ) - return m_pDuplexTypes->getValue( (ULONG)0 )->m_aOption; + return m_pDuplexTypes->getValue( (sal_uInt32)0 )->m_aOption; return String(); } @@ -1591,7 +1591,7 @@ String PPDParser::getDuplexCommand( int nDuplex ) const if( nDuplex > 0 && nDuplex < m_pDuplexTypes->countValues() ) return m_pDuplexTypes->getValue( nDuplex )->m_aValue; else if( m_pDuplexTypes->countValues() > 0 ) - return m_pDuplexTypes->getValue( (ULONG)0 )->m_aValue; + return m_pDuplexTypes->getValue( (sal_uInt32)0 )->m_aValue; return String(); } @@ -2033,7 +2033,7 @@ void PPDContext::getUnconstrainedValues( const PPDKey* pKey, ::std::list< const // ------------------------------------------------------------------- -void* PPDContext::getStreamableBuffer( ULONG& rBytes ) const +void* PPDContext::getStreamableBuffer( sal_uInt32& rBytes ) const { rBytes = 0; if( ! m_aCurrentValues.size() ) @@ -2079,7 +2079,7 @@ void* PPDContext::getStreamableBuffer( ULONG& rBytes ) const // ------------------------------------------------------------------- -void PPDContext::rebuildFromStreamBuffer( void* pBuffer, ULONG nBytes ) +void PPDContext::rebuildFromStreamBuffer( void* pBuffer, sal_uInt32 nBytes ) { if( ! m_pParser ) return; diff --git a/vcl/unx/source/printer/printerinfomanager.cxx b/vcl/unx/source/printer/printerinfomanager.cxx index af189b1b01b5..421ce74b98d8 100644 --- a/vcl/unx/source/printer/printerinfomanager.cxx +++ b/vcl/unx/source/printer/printerinfomanager.cxx @@ -328,7 +328,7 @@ void PrinterInfoManager::initialize() m_aGlobalDefaults.m_aContext. setValue( pKey, aValue.Equals( "*nil" ) ? NULL : pKey->getValue( String( aValue, RTL_TEXTENCODING_ISO_8859_1 ) ), - TRUE ); + sal_True ); } } else if( aKey.Len() > 10 && aKey.CompareTo("SubstFont_", 10 ) == COMPARE_EQUAL ) @@ -533,7 +533,7 @@ void PrinterInfoManager::initialize() aPrinter.m_aInfo.m_aContext. setValue( pKey, aValue.Equals( "*nil" ) ? NULL : pKey->getValue( String( aValue, RTL_TEXTENCODING_ISO_8859_1 ) ), - TRUE ); + sal_True ); } } else if( aKey.Len() > 10 && aKey.CompareTo("SubstFont_", 10 ) == COMPARE_EQUAL ) diff --git a/vcl/unx/source/printergfx/common_gfx.cxx b/vcl/unx/source/printergfx/common_gfx.cxx index 6bb31acfcbbe..fa032c46a74b 100644 --- a/vcl/unx/source/printergfx/common_gfx.cxx +++ b/vcl/unx/source/printergfx/common_gfx.cxx @@ -527,9 +527,9 @@ PrinterGfx::DrawPolyPolygon (sal_uInt32 nPoly, const sal_uInt32* pSizes, const P */ void -PrinterGfx::DrawPolyLineBezier (sal_uInt32 nPoints, const Point* pPath, const BYTE* pFlgAry) +PrinterGfx::DrawPolyLineBezier (sal_uInt32 nPoints, const Point* pPath, const sal_uInt8* pFlgAry) { - const sal_uInt32 nBezString = 1024; + const sal_uInt32 nBezString= 1024; sal_Char pString[nBezString]; if ( nPoints > 1 && maLineColor.Is() && pPath ) @@ -578,7 +578,7 @@ PrinterGfx::DrawPolyLineBezier (sal_uInt32 nPoints, const Point* pPath, const BY } void -PrinterGfx::DrawPolygonBezier (sal_uInt32 nPoints, const Point* pPath, const BYTE* pFlgAry) +PrinterGfx::DrawPolygonBezier (sal_uInt32 nPoints, const Point* pPath, const sal_uInt8* pFlgAry) { const sal_uInt32 nBezString = 1024; sal_Char pString[nBezString]; @@ -634,7 +634,7 @@ PrinterGfx::DrawPolygonBezier (sal_uInt32 nPoints, const Point* pPath, const BYT } void -PrinterGfx::DrawPolyPolygonBezier (sal_uInt32 nPoly, const sal_uInt32 * pPoints, const Point* const * pPtAry, const BYTE* const* pFlgAry) +PrinterGfx::DrawPolyPolygonBezier (sal_uInt32 nPoly, const sal_uInt32 * pPoints, const Point* const * pPtAry, const sal_uInt8* const* pFlgAry) { const sal_uInt32 nBezString = 1024; sal_Char pString[nBezString]; diff --git a/vcl/unx/source/printergfx/printerjob.cxx b/vcl/unx/source/printergfx/printerjob.cxx index af2cf14b1a0c..947eb290ec60 100644 --- a/vcl/unx/source/printergfx/printerjob.cxx +++ b/vcl/unx/source/printergfx/printerjob.cxx @@ -410,7 +410,7 @@ PrinterJob::StartJob ( rtl::OUString aFilterWS; // Creator (this application) - aFilterWS = WhitespaceToSpace( rAppName, FALSE ); + aFilterWS = WhitespaceToSpace( rAppName, sal_False ); WritePS (mpJobHeader, "%%Creator: ("); WritePS (mpJobHeader, aFilterWS); WritePS (mpJobHeader, ")\n"); @@ -448,14 +448,14 @@ PrinterJob::StartJob ( * use the filename, if it contains only ascii * else omit %%Title */ - aFilterWS = WhitespaceToSpace( rJobName, FALSE ); + aFilterWS = WhitespaceToSpace( rJobName, sal_False ); rtl::OUString aTitle( aFilterWS ); if( ! isAscii( aTitle ) ) { sal_Int32 nIndex = 0; while( nIndex != -1 ) aTitle = rFileName.getToken( 0, '/', nIndex ); - aTitle = WhitespaceToSpace( aTitle, FALSE ); + aTitle = WhitespaceToSpace( aTitle, sal_False ); if( ! isAscii( aTitle ) ) aTitle = rtl::OUString(); } -- cgit From 322a75edf8bad6616b1543a6b81972f4c3765ee2 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Tue, 11 Jan 2011 11:10:11 +0100 Subject: removetootypes01: #i112600# Use correct conversion ULONG => sal_uIntPtr --- vcl/unx/gtk/app/gtkdata.cxx | 4 ++-- vcl/unx/gtk/app/gtkinst.cxx | 6 +++--- vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 2 +- vcl/unx/gtk/window/gtkframe.cxx | 16 +++++++-------- vcl/unx/gtk/window/gtkobject.cxx | 2 +- vcl/unx/headless/svpdummies.hxx | 2 +- vcl/unx/headless/svpframe.cxx | 4 ++-- vcl/unx/headless/svpframe.hxx | 8 ++++---- vcl/unx/headless/svpgdi.cxx | 20 +++++++++---------- vcl/unx/headless/svpgdi.hxx | 16 +++++++-------- vcl/unx/headless/svpinst.cxx | 20 +++++++++---------- vcl/unx/headless/svpinst.hxx | 18 ++++++++--------- vcl/unx/headless/svpprn.cxx | 12 +++++------ vcl/unx/headless/svpprn.hxx | 14 ++++++------- vcl/unx/headless/svppspgraphics.cxx | 18 ++++++++--------- vcl/unx/headless/svppspgraphics.hxx | 16 +++++++-------- vcl/unx/headless/svptext.cxx | 6 +++--- vcl/unx/inc/plugins/gtk/gtkframe.hxx | 10 +++++----- vcl/unx/inc/plugins/gtk/gtkgdi.hxx | 2 +- vcl/unx/inc/plugins/gtk/gtkinst.hxx | 6 +++--- vcl/unx/inc/plugins/gtk/gtkobject.hxx | 2 +- vcl/unx/inc/plugins/kde/kdedata.hxx | 4 ++-- vcl/unx/inc/pspgraphics.h | 16 +++++++-------- vcl/unx/inc/salbmp.h | 8 ++++---- vcl/unx/inc/saldata.hxx | 4 ++-- vcl/unx/inc/saldisp.hxx | 12 +++++------ vcl/unx/inc/salframe.h | 10 +++++----- vcl/unx/inc/salgdi.h | 20 +++++++++---------- vcl/unx/inc/salinst.h | 12 +++++------ vcl/unx/inc/salobj.h | 4 ++-- vcl/unx/inc/salprn.h | 14 ++++++------- vcl/unx/inc/saltimer.h | 2 +- vcl/unx/inc/salunx.h | 4 ++-- vcl/unx/kde/salnativewidgets-kde.cxx | 4 ++-- vcl/unx/source/app/i18n_status.cxx | 2 +- vcl/unx/source/app/salinst.cxx | 12 +++++------ vcl/unx/source/app/saltimer.cxx | 4 ++-- vcl/unx/source/gdi/gcach_xpeer.cxx | 6 +++--- vcl/unx/source/gdi/pspgraphics.cxx | 18 ++++++++--------- vcl/unx/source/gdi/salbmp.cxx | 18 ++++++++--------- vcl/unx/source/gdi/salgdi.cxx | 34 ++++++++++++++++---------------- vcl/unx/source/gdi/salgdi3.cxx | 4 ++-- vcl/unx/source/gdi/salprnpsp.cxx | 14 ++++++------- vcl/unx/source/window/salframe.cxx | 10 +++++----- vcl/unx/source/window/salobj.cxx | 4 ++-- 45 files changed, 222 insertions(+), 222 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx index de3d46733bfd..104aa2e80dd3 100644 --- a/vcl/unx/gtk/app/gtkdata.cxx +++ b/vcl/unx/gtk/app/gtkdata.cxx @@ -527,7 +527,7 @@ public: YieldFunc handle ); virtual void Remove( int fd ); - virtual void StartTimer( sal_uInt32 nMS ); + virtual void StartTimer( sal_uIntPtr nMS ); virtual void StopTimer(); virtual void Wakeup(); virtual void PostUserEvent(); @@ -727,7 +727,7 @@ gboolean GtkXLib::timeoutFn(gpointer data) return FALSE; } -void GtkXLib::StartTimer( sal_uInt32 nMS ) +void GtkXLib::StartTimer( sal_uIntPtr nMS ) { m_nTimeoutMS = nMS; // for restarting diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx index f58f49865f7c..df7ce072bde7 100644 --- a/vcl/unx/gtk/app/gtkinst.cxx +++ b/vcl/unx/gtk/app/gtkinst.cxx @@ -65,7 +65,7 @@ void GtkHookedYieldMutex::ThreadsEnter() acquire(); if( !aYieldStack.empty() ) { /* Previously called ThreadsLeave() */ - sal_uInt32 nCount = aYieldStack.front(); + sal_uIntPtr nCount = aYieldStack.front(); aYieldStack.pop_front(); while( nCount-- > 1 ) acquire(); @@ -188,12 +188,12 @@ GtkInstance::~GtkInstance() DeInitAtkBridge(); } -SalFrame* GtkInstance::CreateFrame( SalFrame* pParent, sal_uInt32 nStyle ) +SalFrame* GtkInstance::CreateFrame( SalFrame* pParent, sal_uIntPtr nStyle ) { return new GtkSalFrame( pParent, nStyle ); } -SalFrame* GtkInstance::CreateChildFrame( SystemParentData* pParentData, sal_uInt32 ) +SalFrame* GtkInstance::CreateChildFrame( SystemParentData* pParentData, sal_uIntPtr ) { SalFrame* pFrame = new GtkSalFrame( pParentData ); diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index f3026be3dbb1..dfb311fa9c8d 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -479,7 +479,7 @@ void GtkSalGraphics::ResetClipRegion() X11SalGraphics::ResetClipRegion(); } -void GtkSalGraphics::BeginSetClipRegion( sal_uInt32 nCount ) +void GtkSalGraphics::BeginSetClipRegion( sal_uIntPtr nCount ) { m_aClipRegion.SetNull(); X11SalGraphics::BeginSetClipRegion( nCount ); diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index 2b6cf8dc4484..4ef66f746b49 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -392,7 +392,7 @@ GtkSalFrame::GraphicsHolder::~GraphicsHolder() delete pGraphics; } -GtkSalFrame::GtkSalFrame( SalFrame* pParent, sal_uInt32 nStyle ) +GtkSalFrame::GtkSalFrame( SalFrame* pParent, sal_uIntPtr nStyle ) { m_nScreen = getDisplay()->GetDefaultScreenNumber(); getDisplay()->registerFrame( this ); @@ -755,7 +755,7 @@ GtkSalFrame *GtkSalFrame::getFromWindow( GtkWindow *pWindow ) return (GtkSalFrame *) g_object_get_data( G_OBJECT( pWindow ), "SalFrame" ); } -void GtkSalFrame::Init( SalFrame* pParent, sal_uInt32 nStyle ) +void GtkSalFrame::Init( SalFrame* pParent, sal_uIntPtr nStyle ) { if( nStyle & SAL_FRAME_STYLE_DEFAULT ) // ensure default style { @@ -1043,7 +1043,7 @@ void GtkSalFrame::SetTitle( const String& rTitle ) } static inline sal_uInt8 * -getRow( BitmapBuffer *pBuffer, sal_uInt32 nRow ) +getRow( BitmapBuffer *pBuffer, sal_uIntPtr nRow ) { if( BMP_SCANLINE_ADJUSTMENT( pBuffer->mnFormat ) == BMP_FORMAT_TOP_DOWN ) return pBuffer->mpBits + nRow * pBuffer->mnScanlineSize; @@ -1602,7 +1602,7 @@ void GtkSalFrame::SetWindowState( const SalFrameState* pState ) if( ! m_pWindow || ! pState || isChild( true, false ) ) return; - const sal_uInt32 nMaxGeometryMask = + const sal_uIntPtr nMaxGeometryMask = SAL_FRAMESTATE_MASK_X | SAL_FRAMESTATE_MASK_Y | SAL_FRAMESTATE_MASK_WIDTH | SAL_FRAMESTATE_MASK_HEIGHT | SAL_FRAMESTATE_MASK_MAXIMIZED_X | SAL_FRAMESTATE_MASK_MAXIMIZED_Y | @@ -2462,7 +2462,7 @@ void GtkSalFrame::ResetClipRegion() gdk_window_shape_combine_region( m_pWindow->window, NULL, 0, 0 ); } -void GtkSalFrame::BeginSetClipRegion( sal_uInt32 ) +void GtkSalFrame::BeginSetClipRegion( sal_uIntPtr ) { if( m_pRegion ) gdk_region_destroy( m_pRegion ); @@ -2702,7 +2702,7 @@ gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEvent* pEvent, gpointer frame GtkSalFrame* pThis = (GtkSalFrame*)frame; GdkEventScroll* pSEvent = (GdkEventScroll*)pEvent; - static sal_uInt32 nLines = 0; + static sal_uIntPtr nLines = 0; if( ! nLines ) { char* pEnv = getenv( "SAL_WHEELLINES" ); @@ -2714,8 +2714,8 @@ gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEvent* pEvent, gpointer frame bool bNeg = (pSEvent->direction == GDK_SCROLL_DOWN || pSEvent->direction == GDK_SCROLL_RIGHT ); SalWheelMouseEvent aEvent; aEvent.mnTime = pSEvent->time; - aEvent.mnX = (sal_uInt32)pSEvent->x; - aEvent.mnY = (sal_uInt32)pSEvent->y; + aEvent.mnX = (sal_uIntPtr)pSEvent->x; + aEvent.mnY = (sal_uIntPtr)pSEvent->y; aEvent.mnDelta = bNeg ? -120 : 120; aEvent.mnNotchDelta = bNeg ? -1 : 1; aEvent.mnScrollLines = nLines; diff --git a/vcl/unx/gtk/window/gtkobject.cxx b/vcl/unx/gtk/window/gtkobject.cxx index f8cb73c16c15..96648ce02d30 100644 --- a/vcl/unx/gtk/window/gtkobject.cxx +++ b/vcl/unx/gtk/window/gtkobject.cxx @@ -109,7 +109,7 @@ sal_uInt16 GtkSalObject::GetClipRegionType() return SAL_OBJECT_CLIP_INCLUDERECTS; } -void GtkSalObject::BeginSetClipRegion( sal_uInt32 ) +void GtkSalObject::BeginSetClipRegion( sal_uIntPtr ) { if( m_pRegion ) gdk_region_destroy( m_pRegion ); diff --git a/vcl/unx/headless/svpdummies.hxx b/vcl/unx/headless/svpdummies.hxx index 090f7c2af288..48b3ffc5de19 100644 --- a/vcl/unx/headless/svpdummies.hxx +++ b/vcl/unx/headless/svpdummies.hxx @@ -45,7 +45,7 @@ public: // overload all pure virtual methods virtual void ResetClipRegion(); virtual sal_uInt16 GetClipRegionType(); - virtual void BeginSetClipRegion( sal_uInt32 nRects ); + virtual void BeginSetClipRegion( sal_uIntPtr nRects ); virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ); virtual void EndSetClipRegion(); diff --git a/vcl/unx/headless/svpframe.cxx b/vcl/unx/headless/svpframe.cxx index 4360012351f7..b4835dbcf133 100644 --- a/vcl/unx/headless/svpframe.cxx +++ b/vcl/unx/headless/svpframe.cxx @@ -39,7 +39,7 @@ SvpSalFrame* SvpSalFrame::s_pFocusFrame = NULL; SvpSalFrame::SvpSalFrame( SvpSalInstance* pInstance, SalFrame* pParent, - sal_uInt32 nSalFrameStyle, + sal_uIntPtr nSalFrameStyle, SystemParentData* ) : m_pInstance( pInstance ), m_pParent( static_cast(pParent) ), @@ -435,7 +435,7 @@ void SvpSalFrame::ResetClipRegion() { } -void SvpSalFrame::BeginSetClipRegion( sal_uInt32 ) +void SvpSalFrame::BeginSetClipRegion( sal_uIntPtr ) { } diff --git a/vcl/unx/headless/svpframe.hxx b/vcl/unx/headless/svpframe.hxx index b472a3e10103..37a9a02cde4e 100644 --- a/vcl/unx/headless/svpframe.hxx +++ b/vcl/unx/headless/svpframe.hxx @@ -40,9 +40,9 @@ class SvpSalGraphics; class SvpSalFrame : public SalFrame, public SvpElement { SvpSalInstance* m_pInstance; - SvpSalFrame* m_pParent; // pointer to parent frame + SvpSalFrame* m_pParent; // pointer to parent frame std::list< SvpSalFrame* > m_aChildren; // List of child frames - sal_uInt32 m_nStyle; + sal_uIntPtr m_nStyle; bool m_bVisible; long m_nMinWidth; long m_nMinHeight; @@ -58,7 +58,7 @@ class SvpSalFrame : public SalFrame, public SvpElement public: SvpSalFrame( SvpSalInstance* pInstance, SalFrame* pParent, - sal_uInt32 nSalFrameStyle, + sal_uIntPtr nSalFrameStyle, SystemParentData* pSystemParent = NULL ); virtual ~SvpSalFrame(); @@ -116,7 +116,7 @@ public: virtual bool SetPluginParent( SystemParentData* pNewParent ); virtual void SetBackgroundBitmap( SalBitmap* pBitmap ); virtual void ResetClipRegion(); - virtual void BeginSetClipRegion( sal_uInt32 nRects ); + virtual void BeginSetClipRegion( sal_uIntPtr nRects ); virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ); virtual void EndSetClipRegion(); diff --git a/vcl/unx/headless/svpgdi.cxx b/vcl/unx/headless/svpgdi.cxx index aa7f70ee1741..5485347213f3 100644 --- a/vcl/unx/headless/svpgdi.cxx +++ b/vcl/unx/headless/svpgdi.cxx @@ -152,7 +152,7 @@ void SvpSalGraphics::ResetClipRegion() m_aClipMap.reset(); } -void SvpSalGraphics::BeginSetClipRegion( sal_uInt32 n ) +void SvpSalGraphics::BeginSetClipRegion( sal_uIntPtr n ) { if( n <= 1 ) { @@ -309,13 +309,13 @@ void SvpSalGraphics::drawRect( long nX, long nY, long nWidth, long nHeight ) dbgOut( m_aDevice ); } -void SvpSalGraphics::drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ) +void SvpSalGraphics::drawPolyLine( sal_uIntPtr nPoints, const SalPoint* pPtAry ) { if( m_bUseLineColor && nPoints ) { B2DPolygon aPoly; aPoly.append( B2DPoint( pPtAry->mnX, pPtAry->mnY ), nPoints ); - for( sal_uInt32 i = 1; i < nPoints; i++ ) + for( sal_uIntPtr i = 1; i < nPoints; i++ ) aPoly.setB2DPoint( i, B2DPoint( pPtAry[i].mnX, pPtAry[i].mnY ) ); aPoly.setClosed( false ); m_aDevice->drawPolygon( aPoly, m_aLineColor, m_aDrawMode, m_aClipMap ); @@ -323,13 +323,13 @@ void SvpSalGraphics::drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ) dbgOut( m_aDevice ); } -void SvpSalGraphics::drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ) +void SvpSalGraphics::drawPolygon( sal_uIntPtr nPoints, const SalPoint* pPtAry ) { if( ( m_bUseLineColor || m_bUseFillColor ) && nPoints ) { B2DPolygon aPoly; aPoly.append( B2DPoint( pPtAry->mnX, pPtAry->mnY ), nPoints ); - for( sal_uInt32 i = 1; i < nPoints; i++ ) + for( sal_uIntPtr i = 1; i < nPoints; i++ ) aPoly.setB2DPoint( i, B2DPoint( pPtAry[i].mnX, pPtAry[i].mnY ) ); if( m_bUseFillColor ) { @@ -388,14 +388,14 @@ bool SvpSalGraphics::drawPolyLine( const ::basegfx::B2DPolygon&, double /*fTrans return false; } -sal_Bool SvpSalGraphics::drawPolyLineBezier( sal_uInt32, +sal_Bool SvpSalGraphics::drawPolyLineBezier( sal_uIntPtr, const SalPoint*, const sal_uInt8* ) { return sal_False; } -sal_Bool SvpSalGraphics::drawPolygonBezier( sal_uInt32, +sal_Bool SvpSalGraphics::drawPolygonBezier( sal_uIntPtr, const SalPoint*, const sal_uInt8* ) { @@ -538,19 +538,19 @@ void SvpSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalInv dbgOut( m_aDevice ); } -void SvpSalGraphics::invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalInvert /*nFlags*/ ) +void SvpSalGraphics::invert( sal_uIntPtr nPoints, const SalPoint* pPtAry, SalInvert /*nFlags*/ ) { // FIXME: handle SAL_INVERT_50 and SAL_INVERT_TRACKFRAME B2DPolygon aPoly; aPoly.append( B2DPoint( pPtAry->mnX, pPtAry->mnY ), nPoints ); - for( sal_uInt32 i = 1; i < nPoints; i++ ) + for( sal_uIntPtr i = 1; i < nPoints; i++ ) aPoly.setB2DPoint( i, B2DPoint( pPtAry[i].mnX, pPtAry[i].mnY ) ); aPoly.setClosed( true ); m_aDevice->fillPolyPolygon( B2DPolyPolygon(aPoly), basebmp::Color( 0xffffff ), DrawMode_XOR, m_aClipMap ); dbgOut( m_aDevice ); } -sal_Bool SvpSalGraphics::drawEPS( long, long, long, long, void*, sal_uInt32 ) +sal_Bool SvpSalGraphics::drawEPS( long, long, long, long, void*, sal_uIntPtr ) { return sal_False; } diff --git a/vcl/unx/headless/svpgdi.hxx b/vcl/unx/headless/svpgdi.hxx index 08efc7e846c1..2510d505f6b1 100644 --- a/vcl/unx/headless/svpgdi.hxx +++ b/vcl/unx/headless/svpgdi.hxx @@ -68,7 +68,7 @@ public: virtual long GetGraphicsWidth() const; virtual void ResetClipRegion(); - virtual void BeginSetClipRegion( sal_uInt32 nCount ); + virtual void BeginSetClipRegion( sal_uIntPtr nCount ); virtual sal_Bool unionClipRegion( long nX, long nY, long nWidth, long nHeight ); virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& ); virtual void EndSetClipRegion(); @@ -87,7 +87,7 @@ public: virtual void SetTextColor( SalColor nSalColor ); virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel ); virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); - virtual sal_uInt32 GetKernPairs( sal_uInt32 nPairs, ImplKernPairData* pKernPairs ); + virtual sal_uIntPtr GetKernPairs( sal_uIntPtr nPairs, ImplKernPairData* pKernPairs ); virtual const ImplFontCharMap* GetImplFontCharMap() const; virtual void GetDevFontList( ImplDevFontList* ); virtual void GetDevFontSubstList( OutputDevice* ); @@ -122,15 +122,15 @@ public: virtual void drawRect( long nX, long nY, long nWidth, long nHeight ); virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ); virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ); - virtual void drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ); - virtual void drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ); + virtual void drawPolyLine( sal_uIntPtr nPoints, const SalPoint* pPtAry ); + virtual void drawPolygon( sal_uIntPtr nPoints, const SalPoint* pPtAry ); virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ); - virtual sal_Bool drawPolyLineBezier( sal_uInt32 nPoints, + virtual sal_Bool drawPolyLineBezier( sal_uIntPtr nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ); - virtual sal_Bool drawPolygonBezier( sal_uInt32 nPoints, + virtual sal_Bool drawPolygonBezier( sal_uIntPtr nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ); virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly, @@ -161,9 +161,9 @@ public: virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight ); virtual SalColor getPixel( long nX, long nY ); virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags ); - virtual void invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalInvert nFlags ); + virtual void invert( sal_uIntPtr nPoints, const SalPoint* pPtAry, SalInvert nFlags ); - virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uInt32 nSize ); + virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uIntPtr nSize ); virtual SystemGraphicsData GetGraphicsData() const; virtual SystemFontData GetSysFontData( int nFallbacklevel ) const; diff --git a/vcl/unx/headless/svpinst.cxx b/vcl/unx/headless/svpinst.cxx index f2c3f671c4fd..b6665550563d 100644 --- a/vcl/unx/headless/svpinst.cxx +++ b/vcl/unx/headless/svpinst.cxx @@ -192,7 +192,7 @@ inline int operator >= ( const timeval &t1, const timeval &t2 ) return t1.tv_usec >= t2.tv_usec; return t1.tv_sec > t2.tv_sec; } -inline timeval &operator += ( timeval &t1, sal_uInt32 t2 ) +inline timeval &operator += ( timeval &t1, sal_uIntPtr t2 ) { t1.tv_sec += t2 / 1000; t1.tv_usec += t2 ? (t2 % 1000) * 1000 : 500; @@ -235,12 +235,12 @@ bool SvpSalInstance::CheckTimeout( bool bExecuteTimers ) return bRet; } -SalFrame* SvpSalInstance::CreateChildFrame( SystemParentData* pParent, sal_uInt32 nStyle ) +SalFrame* SvpSalInstance::CreateChildFrame( SystemParentData* pParent, sal_uIntPtr nStyle ) { return new SvpSalFrame( this, NULL, nStyle, pParent ); } -SalFrame* SvpSalInstance::CreateFrame( SalFrame* pParent, sal_uInt32 nStyle ) +SalFrame* SvpSalInstance::CreateFrame( SalFrame* pParent, sal_uIntPtr nStyle ) { return new SvpSalFrame( this, pParent, nStyle ); } @@ -299,13 +299,13 @@ vos::IMutex* SvpSalInstance::GetYieldMutex() return &m_aYieldMutex; } -sal_uInt32 SvpSalInstance::ReleaseYieldMutex() +sal_uIntPtr SvpSalInstance::ReleaseYieldMutex() { if ( m_aYieldMutex.GetThreadId() == vos::OThread::getCurrentIdentifier() ) { - sal_uInt32 nCount = m_aYieldMutex.GetAcquireCount(); - sal_uInt32 n = nCount; + sal_uIntPtr nCount = m_aYieldMutex.GetAcquireCount(); + sal_uIntPtr n = nCount; while ( n ) { m_aYieldMutex.release(); @@ -318,7 +318,7 @@ sal_uInt32 SvpSalInstance::ReleaseYieldMutex() return 0; } -void SvpSalInstance::AcquireYieldMutex( sal_uInt32 nCount ) +void SvpSalInstance::AcquireYieldMutex( sal_uIntPtr nCount ) { while ( nCount ) { @@ -346,7 +346,7 @@ void SvpSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents ) // release yield mutex std::list< SalUserEvent > aEvents; - sal_uInt32 nAcquireCount = ReleaseYieldMutex(); + sal_uIntPtr nAcquireCount = ReleaseYieldMutex(); if( osl_acquireMutex( m_aEventGuard ) ) { if( ! m_aUserEvents.empty() ) @@ -497,7 +497,7 @@ void SvpSalInstance::StopTimer() m_nTimeoutMS = 0; } -void SvpSalInstance::StartTimer( sal_uInt32 nMS ) +void SvpSalInstance::StartTimer( sal_uIntPtr nMS ) { timeval Timeout (m_aTimeout); // previous timeout. gettimeofday (&m_aTimeout, 0); @@ -525,7 +525,7 @@ void SvpSalTimer::Stop() m_pInstance->StopTimer(); } -void SvpSalTimer::Start( sal_uInt32 nMS ) +void SvpSalTimer::Start( sal_uIntPtr nMS ) { m_pInstance->StartTimer( nMS ); } diff --git a/vcl/unx/headless/svpinst.hxx b/vcl/unx/headless/svpinst.hxx index b7b311b2e32d..05f3c01f5bb5 100644 --- a/vcl/unx/headless/svpinst.hxx +++ b/vcl/unx/headless/svpinst.hxx @@ -49,7 +49,7 @@ class SvpSalYieldMutex : public vos::OMutex { protected: - sal_uInt32 mnCount; + sal_uIntPtr mnCount; vos::OThread::TThreadIdentifier mnThreadId; public: @@ -59,7 +59,7 @@ public: virtual void release(); virtual sal_Bool tryToAcquire(); - sal_uInt32 GetAcquireCount() const { return mnCount; } + sal_uIntPtr GetAcquireCount() const { return mnCount; } vos::OThread::TThreadIdentifier GetThreadId() const { return mnThreadId; } }; @@ -75,7 +75,7 @@ public: virtual ~SvpSalTimer(); // overload all pure virtual methods - virtual void Start( sal_uInt32 nMS ); + virtual void Start( sal_uIntPtr nMS ); virtual void Stop(); }; @@ -86,7 +86,7 @@ class SvpSalFrame; class SvpSalInstance : public SalInstance { timeval m_aTimeout; - sal_uInt32 m_nTimeoutMS; + sal_uIntPtr m_nTimeoutMS; int m_pTimeoutFDS[2]; SvpSalYieldMutex m_aYieldMutex; @@ -120,7 +120,7 @@ public: void PostEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent ); void CancelEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent ); - void StartTimer( sal_uInt32 nMS ); + void StartTimer( sal_uIntPtr nMS ); void StopTimer(); void Wakeup(); @@ -131,8 +131,8 @@ public: bool CheckTimeout( bool bExecuteTimers = true ); // Frame - virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uInt32 nStyle ); - virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uInt32 nStyle ); + virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uIntPtr nStyle ); + virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uIntPtr nStyle ); virtual void DestroyFrame( SalFrame* pFrame ); // Object (System Child Window) @@ -174,8 +174,8 @@ public: // YieldMutex virtual vos::IMutex* GetYieldMutex(); - virtual sal_uInt32 ReleaseYieldMutex(); - virtual void AcquireYieldMutex( sal_uInt32 nCount ); + virtual sal_uIntPtr ReleaseYieldMutex(); + virtual void AcquireYieldMutex( sal_uIntPtr nCount ); virtual bool CheckYieldMutex(); // wait next event and dispatch diff --git a/vcl/unx/headless/svpprn.cxx b/vcl/unx/headless/svpprn.cxx index 21b5e20af51d..a81f894e4505 100644 --- a/vcl/unx/headless/svpprn.cxx +++ b/vcl/unx/headless/svpprn.cxx @@ -558,7 +558,7 @@ sal_Bool PspSalInfoPrinter::SetPrinterData( ImplJobSetup* pJobSetup ) // Only the data must be changed, where the bit // in nGetDataFlags is set sal_Bool PspSalInfoPrinter::SetData( - sal_uInt32 nSetDataFlags, + sal_uIntPtr nSetDataFlags, ImplJobSetup* pJobSetup ) { JobData aData; @@ -707,7 +707,7 @@ void PspSalInfoPrinter::GetPageInfo( // ----------------------------------------------------------------------- -sal_uInt32 PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup ) +sal_uIntPtr PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup ) { if( ! pJobSetup ) return 0; @@ -721,7 +721,7 @@ sal_uInt32 PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup ) // ----------------------------------------------------------------------- -String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, sal_uInt32 nPaperBin ) +String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, sal_uIntPtr nPaperBin ) { JobData aData; JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData ); @@ -745,7 +745,7 @@ String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, sal_uI // ----------------------------------------------------------------------- -sal_uInt32 PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, sal_uInt16 nType ) +sal_uIntPtr PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, sal_uInt16 nType ) { switch( nType ) { @@ -845,7 +845,7 @@ sal_Bool PspSalPrinter::StartJob( const XubString* pFileName, const XubString& rJobName, const XubString& rAppName, - sal_uInt32 nCopies, + sal_uIntPtr nCopies, bool bCollate, bool /*bDirect*/, ImplJobSetup* pJobSetup ) @@ -990,7 +990,7 @@ sal_Bool PspSalPrinter::EndPage() // ----------------------------------------------------------------------- -sal_uInt32 PspSalPrinter::GetErrorCode() +sal_uIntPtr PspSalPrinter::GetErrorCode() { return 0; } diff --git a/vcl/unx/headless/svpprn.hxx b/vcl/unx/headless/svpprn.hxx index 440c5b31cd52..8c7372115cde 100644 --- a/vcl/unx/headless/svpprn.hxx +++ b/vcl/unx/headless/svpprn.hxx @@ -50,14 +50,14 @@ public: virtual void ReleaseGraphics( SalGraphics* pGraphics ); virtual sal_Bool Setup( SalFrame* pFrame, ImplJobSetup* pSetupData ); virtual sal_Bool SetPrinterData( ImplJobSetup* pSetupData ); - virtual sal_Bool SetData( sal_uInt32 nFlags, ImplJobSetup* pSetupData ); + virtual sal_Bool SetData( sal_uIntPtr nFlags, ImplJobSetup* pSetupData ); virtual void GetPageInfo( const ImplJobSetup* pSetupData, long& rOutWidth, long& rOutHeight, long& rPageOffX, long& rPageOffY, long& rPageWidth, long& rPageHeight ); - virtual sal_uInt32 GetCapabilities( const ImplJobSetup* pSetupData, sal_uInt16 nType ); - virtual sal_uInt32 GetPaperBinCount( const ImplJobSetup* pSetupData ); - virtual String GetPaperBinName( const ImplJobSetup* pSetupData, sal_uInt32 nPaperBin ); + virtual sal_uIntPtr GetCapabilities( const ImplJobSetup* pSetupData, sal_uInt16 nType ); + virtual sal_uIntPtr GetPaperBinCount( const ImplJobSetup* pSetupData ); + virtual String GetPaperBinName( const ImplJobSetup* pSetupData, sal_uIntPtr nPaperBin ); virtual void InitPaperFormats( const ImplJobSetup* pSetupData ); virtual int GetLandscapeAngle( const ImplJobSetup* pSetupData ); }; @@ -75,7 +75,7 @@ public: psp::PrinterJob m_aPrintJob; psp::JobData m_aJobData; psp::PrinterGfx m_aPrinterGfx; - sal_uInt32 m_nCopies; + sal_uIntPtr m_nCopies; bool m_bCollate; SalInfoPrinter* m_pInfoPrinter; @@ -87,7 +87,7 @@ public: virtual sal_Bool StartJob( const XubString* pFileName, const XubString& rJobName, const XubString& rAppName, - sal_uInt32 nCopies, + sal_uIntPtr nCopies, bool bCollate, bool bDirect, ImplJobSetup* pSetupData ); @@ -95,7 +95,7 @@ public: virtual sal_Bool AbortJob(); virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, sal_Bool bNewJobData ); virtual sal_Bool EndPage(); - virtual sal_uInt32 GetErrorCode(); + virtual sal_uIntPtr GetErrorCode(); }; class Timer; diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx index f0067f1677f3..fe9a883fa583 100644 --- a/vcl/unx/headless/svppspgraphics.cxx +++ b/vcl/unx/headless/svppspgraphics.cxx @@ -219,7 +219,7 @@ void PspGraphics::ResetClipRegion() m_pPrinterGfx->ResetClipRegion (); } -void PspGraphics::BeginSetClipRegion( sal_uInt32 n ) +void PspGraphics::BeginSetClipRegion( sal_uIntPtr n ) { m_pPrinterGfx->BeginSetClipRegion(n); } @@ -305,12 +305,12 @@ void PspGraphics::drawRect( long nX, long nY, long nDX, long nDY ) m_pPrinterGfx->DrawRect (Rectangle(Point(nX, nY), Size(nDX, nDY))); } -void PspGraphics::drawPolyLine( sal_uInt32 nPoints, const SalPoint *pPtAry ) +void PspGraphics::drawPolyLine( sal_uIntPtr nPoints, const SalPoint *pPtAry ) { m_pPrinterGfx->DrawPolyLine (nPoints, (Point*)pPtAry); } -void PspGraphics::drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ) +void PspGraphics::drawPolygon( sal_uIntPtr nPoints, const SalPoint* pPtAry ) { // Point must be equal to SalPoint! see vcl/inc/salgtype.hxx m_pPrinterGfx->DrawPolygon (nPoints, (Point*)pPtAry); @@ -329,13 +329,13 @@ bool PspGraphics::drawPolyLine( const ::basegfx::B2DPolygon&, double /*fTranspar return false; } -sal_Bool PspGraphics::drawPolyLineBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ) +sal_Bool PspGraphics::drawPolyLineBezier( sal_uIntPtr nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ) { m_pPrinterGfx->DrawPolyLineBezier (nPoints, (Point*)pPtAry, pFlgAry); return sal_True; } -sal_Bool PspGraphics::drawPolygonBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ) +sal_Bool PspGraphics::drawPolygonBezier( sal_uIntPtr nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ) { m_pPrinterGfx->DrawPolygonBezier (nPoints, (Point*)pPtAry, pFlgAry); return sal_True; @@ -357,13 +357,13 @@ bool PspGraphics::drawPolyPolygon( const basegfx::B2DPolyPolygon&, double /*fTra return false; } -void PspGraphics::invert( sal_uInt32 /*nPoints*/, +void PspGraphics::invert( sal_uIntPtr /*nPoints*/, const SalPoint* /*pPtAry*/, SalInvert /*nFlags*/ ) { DBG_ASSERT( 0, "Error: PrinterGfx::Invert() not implemented" ); } -sal_Bool PspGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uInt32 nSize ) +sal_Bool PspGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uIntPtr nSize ) { return m_pPrinterGfx->DrawEPS( Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) ), pPtr, nSize ); } @@ -817,10 +817,10 @@ void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric, int ) } } -sal_uInt32 PspGraphics::GetKernPairs( sal_uInt32 nPairs, ImplKernPairData *pKernPairs ) +sal_uInt32 PspGraphics::GetKernPairs( sal_uIntPtr nPairs, ImplKernPairData *pKernPairs ) { const ::std::list< ::psp::KernPair >& rPairs( m_pPrinterGfx->getKernPairs() ); - sal_uInt32 nHavePairs = rPairs.size(); + sal_uIntPtr nHavePairs = rPairs.size(); if( pKernPairs && nPairs ) { ::std::list< ::psp::KernPair >::const_iterator it; diff --git a/vcl/unx/headless/svppspgraphics.hxx b/vcl/unx/headless/svppspgraphics.hxx index 666dc942739a..ee6f5bc25570 100644 --- a/vcl/unx/headless/svppspgraphics.hxx +++ b/vcl/unx/headless/svppspgraphics.hxx @@ -90,7 +90,7 @@ public: virtual long GetGraphicsWidth() const; virtual void ResetClipRegion(); - virtual void BeginSetClipRegion( sal_uInt32 nCount ); + virtual void BeginSetClipRegion( sal_uIntPtr nCount ); virtual sal_Bool unionClipRegion( long nX, long nY, long nWidth, long nHeight ); virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& ); virtual void EndSetClipRegion(); @@ -106,7 +106,7 @@ public: virtual void SetTextColor( SalColor nSalColor ); virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel ); virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); - virtual sal_uInt32 GetKernPairs( sal_uInt32 nPairs, ImplKernPairData* pKernPairs ); + virtual sal_uIntPtr GetKernPairs( sal_uIntPtr nPairs, ImplKernPairData* pKernPairs ); virtual const ImplFontCharMap* GetImplFontCharMap() const; virtual void GetDevFontList( ImplDevFontList* ); virtual void GetDevFontSubstList( OutputDevice* ); @@ -139,17 +139,17 @@ public: virtual void drawPixel( long nX, long nY, SalColor nSalColor ); virtual void drawLine( long nX1, long nY1, long nX2, long nY2 ); virtual void drawRect( long nX, long nY, long nWidth, long nHeight ); - virtual void drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ); - virtual void drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ); + virtual void drawPolyLine( sal_uIntPtr nPoints, const SalPoint* pPtAry ); + virtual void drawPolygon( sal_uIntPtr nPoints, const SalPoint* pPtAry ); virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ); virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ); virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ); - virtual sal_Bool drawPolyLineBezier( sal_uInt32 nPoints, + virtual sal_Bool drawPolyLineBezier( sal_uIntPtr nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ); - virtual sal_Bool drawPolygonBezier( sal_uInt32 nPoints, + virtual sal_Bool drawPolygonBezier( sal_uIntPtr nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ); virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly, @@ -180,9 +180,9 @@ public: virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight ); virtual SalColor getPixel( long nX, long nY ); virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags ); - virtual void invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalInvert nFlags ); + virtual void invert( sal_uIntPtr nPoints, const SalPoint* pPtAry, SalInvert nFlags ); - virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uInt32 nSize ); + virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uIntPtr nSize ); virtual bool filterText( const String& rOrigText, String& rNewText, xub_StrLen nIndex, xub_StrLen& rLen, xub_StrLen& rCutStart, xub_StrLen& rCutStop ); virtual SystemGraphicsData GetGraphicsData() const; diff --git a/vcl/unx/headless/svptext.cxx b/vcl/unx/headless/svptext.cxx index 1ceba05bf87b..dbe1b2c4dc32 100644 --- a/vcl/unx/headless/svptext.cxx +++ b/vcl/unx/headless/svptext.cxx @@ -254,15 +254,15 @@ void SvpSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLe // --------------------------------------------------------------------------- -sal_uInt32 SvpSalGraphics::GetKernPairs( sal_uInt32 nPairs, ImplKernPairData* pKernPairs ) +sal_uIntPtr SvpSalGraphics::GetKernPairs( sal_uIntPtr nPairs, ImplKernPairData* pKernPairs ) { - sal_uInt32 nGotPairs = 0; + sal_uIntPtr nGotPairs = 0; if( m_pServerFont[0] != NULL ) { ImplKernPairData* pTmpKernPairs = NULL; nGotPairs = m_pServerFont[0]->GetKernPairs( &pTmpKernPairs ); - for( sal_uInt32 i = 0; i < nPairs && i < nGotPairs; ++i ) + for( sal_uIntPtr i = 0; i < nPairs && i < nGotPairs; ++i ) pKernPairs[ i ] = pTmpKernPairs[ i ]; delete[] pTmpKernPairs; } diff --git a/vcl/unx/inc/plugins/gtk/gtkframe.hxx b/vcl/unx/inc/plugins/gtk/gtkframe.hxx index a623472df797..528b08925ad4 100644 --- a/vcl/unx/inc/plugins/gtk/gtkframe.hxx +++ b/vcl/unx/inc/plugins/gtk/gtkframe.hxx @@ -167,7 +167,7 @@ class GtkSalFrame : public SalFrame GdkWindow* m_pForeignTopLevel; GdkNativeWindow m_aForeignTopLevelWindow; Pixmap m_hBackgroundPixmap; - sal_uInt32 m_nStyle; + sal_uIntPtr m_nStyle; SalExtStyle m_nExtStyle; GtkFixed* m_pFixedContainer; GtkSalFrame* m_pParent; @@ -199,7 +199,7 @@ class GtkSalFrame : public SalFrame GdkRegion* m_pRegion; - void Init( SalFrame* pParent, sal_uInt32 nStyle ); + void Init( SalFrame* pParent, sal_uIntPtr nStyle ); void Init( SystemParentData* pSysData ); void InitCommon(); @@ -251,7 +251,7 @@ class GtkSalFrame : public SalFrame bool isChild( bool bPlug = true, bool bSysChild = true ) { - sal_uInt32 nMask = 0; + sal_uIntPtr nMask = 0; if( bPlug ) nMask |= SAL_FRAME_STYLE_PLUG; if( bSysChild ) @@ -270,7 +270,7 @@ class GtkSalFrame : public SalFrame DECL_LINK( ImplDelayedFullScreenHdl, void* ); public: - GtkSalFrame( SalFrame* pParent, sal_uInt32 nStyle ); + GtkSalFrame( SalFrame* pParent, sal_uIntPtr nStyle ); GtkSalFrame( SystemParentData* pSysData ); // dispatches an event, returns true if dispatched @@ -386,7 +386,7 @@ public: // set clip region to none (-> rectangular windows, normal state) virtual void ResetClipRegion(); // start setting the clipregion consisting of nRects rectangles - virtual void BeginSetClipRegion( sal_uInt32 nRects ); + virtual void BeginSetClipRegion( sal_uIntPtr nRects ); // add a rectangle to the clip region virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ); // done setting up the clipregion diff --git a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx index 8fb17371d90c..57e36ca5a2ed 100644 --- a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx +++ b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx @@ -79,7 +79,7 @@ public: void updateSettings( AllSettings& rSettings ); virtual void ResetClipRegion(); - virtual void BeginSetClipRegion( sal_uInt32 nCount ); + virtual void BeginSetClipRegion( sal_uIntPtr nCount ); virtual sal_Bool unionClipRegion( long nX, long nY, long nWidth, long nHeight ); virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& ); virtual void EndSetClipRegion(); diff --git a/vcl/unx/inc/plugins/gtk/gtkinst.hxx b/vcl/unx/inc/plugins/gtk/gtkinst.hxx index a6a508118865..58c485ce6e20 100644 --- a/vcl/unx/inc/plugins/gtk/gtkinst.hxx +++ b/vcl/unx/inc/plugins/gtk/gtkinst.hxx @@ -63,7 +63,7 @@ class GtkHookedYieldMutex : public GtkYieldMutex { virtual int Grab() { return 0; }; virtual void Ungrab(int ) {}; - std::list aYieldStack; + std::list aYieldStack; public: GtkHookedYieldMutex(); virtual void acquire(); @@ -84,8 +84,8 @@ public: {} virtual ~GtkInstance(); - virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uInt32 nStyle ); - virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uInt32 nStyle ); + virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uIntPtr nStyle ); + virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uIntPtr nStyle ); virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True ); virtual SalSystem* CreateSalSystem(); virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType); diff --git a/vcl/unx/inc/plugins/gtk/gtkobject.hxx b/vcl/unx/inc/plugins/gtk/gtkobject.hxx index 8188fcfd4b88..fdba1bb9fd38 100644 --- a/vcl/unx/inc/plugins/gtk/gtkobject.hxx +++ b/vcl/unx/inc/plugins/gtk/gtkobject.hxx @@ -50,7 +50,7 @@ public: // overload all pure virtual methods virtual void ResetClipRegion(); virtual sal_uInt16 GetClipRegionType(); - virtual void BeginSetClipRegion( sal_uInt32 nRects ); + virtual void BeginSetClipRegion( sal_uIntPtr nRects ); virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ); virtual void EndSetClipRegion(); diff --git a/vcl/unx/inc/plugins/kde/kdedata.hxx b/vcl/unx/inc/plugins/kde/kdedata.hxx index 501dbfbbb616..e31c4b7cc8e7 100644 --- a/vcl/unx/inc/plugins/kde/kdedata.hxx +++ b/vcl/unx/inc/plugins/kde/kdedata.hxx @@ -67,7 +67,7 @@ class KDESalFrame : public X11SalFrame GraphicsHolder m_aGraphics[ nMaxGraphics ]; public: - KDESalFrame( SalFrame* pParent, sal_uInt32 ); + KDESalFrame( SalFrame* pParent, sal_uIntPtr ); virtual ~KDESalFrame(); virtual SalGraphics* GetGraphics(); @@ -83,7 +83,7 @@ public: KDESalInstance( SalYieldMutex* pMutex ) : X11SalInstance( pMutex ) {} virtual ~KDESalInstance() {} - virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uInt32 nStyle ); + virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uIntPtr nStyle ); }; class KDEXLib : public SalXLib diff --git a/vcl/unx/inc/pspgraphics.h b/vcl/unx/inc/pspgraphics.h index f9c988dda908..08d5918cf7bd 100644 --- a/vcl/unx/inc/pspgraphics.h +++ b/vcl/unx/inc/pspgraphics.h @@ -87,7 +87,7 @@ public: virtual long GetGraphicsWidth() const; virtual void ResetClipRegion(); - virtual void BeginSetClipRegion( sal_uInt32 nCount ); + virtual void BeginSetClipRegion( sal_uIntPtr nCount ); virtual sal_Bool unionClipRegion( long nX, long nY, long nWidth, long nHeight ); virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& ); virtual void EndSetClipRegion(); @@ -103,7 +103,7 @@ public: virtual void SetTextColor( SalColor nSalColor ); virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel ); virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); - virtual sal_uInt32 GetKernPairs( sal_uInt32 nMaxPairs, ImplKernPairData* ); + virtual sal_uIntPtr GetKernPairs( sal_uIntPtr nMaxPairs, ImplKernPairData* ); virtual const ImplFontCharMap* GetImplFontCharMap() const; virtual void GetDevFontList( ImplDevFontList* ); virtual void GetDevFontSubstList( OutputDevice* ); @@ -136,17 +136,17 @@ public: virtual void drawPixel( long nX, long nY, SalColor nSalColor ); virtual void drawLine( long nX1, long nY1, long nX2, long nY2 ); virtual void drawRect( long nX, long nY, long nWidth, long nHeight ); - virtual void drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ); - virtual void drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ); + virtual void drawPolyLine( sal_uIntPtr nPoints, const SalPoint* pPtAry ); + virtual void drawPolygon( sal_uIntPtr nPoints, const SalPoint* pPtAry ); virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ); virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ); virtual bool drawPolyLine( const basegfx::B2DPolygon&, double fTransparency, const basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin); - virtual sal_Bool drawPolyLineBezier( sal_uInt32 nPoints, + virtual sal_Bool drawPolyLineBezier( sal_uIntPtr nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ); - virtual sal_Bool drawPolygonBezier( sal_uInt32 nPoints, + virtual sal_Bool drawPolygonBezier( sal_uIntPtr nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ); virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly, @@ -176,9 +176,9 @@ public: virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight ); virtual SalColor getPixel( long nX, long nY ); virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags ); - virtual void invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalInvert nFlags ); + virtual void invert( sal_uIntPtr nPoints, const SalPoint* pPtAry, SalInvert nFlags ); - virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uInt32 nSize ); + virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uIntPtr nSize ); virtual bool filterText( const String& rOrigText, String& rNewText, xub_StrLen nIndex, xub_StrLen& rLen, xub_StrLen& rCutStart, xub_StrLen& rCutStop ); virtual bool drawAlphaBitmap( const SalTwoRect&, diff --git a/vcl/unx/inc/salbmp.h b/vcl/unx/inc/salbmp.h index c0b5854e5c51..121966345f75 100644 --- a/vcl/unx/inc/salbmp.h +++ b/vcl/unx/inc/salbmp.h @@ -62,7 +62,7 @@ private: public: static ImplSalBitmapCache* mpCache; - static sal_uInt32 mnCacheInstCount; + static sal_uIntPtr mnCacheInstCount; static void ImplCreateCache(); static void ImplDestroyCache(); @@ -161,7 +161,7 @@ public: long ImplGetWidth() const { return maTwoRect.mnDestWidth; } long ImplGetHeight() const { return maTwoRect.mnDestHeight; } long ImplGetDepth() const { return mnDepth; } - sal_uInt32 ImplGetMemSize() const { return( ( maTwoRect.mnDestWidth * maTwoRect.mnDestHeight * mnDepth ) >> 3 ); } + sal_uIntPtr ImplGetMemSize() const { return( ( maTwoRect.mnDestWidth * maTwoRect.mnDestHeight * mnDepth ) >> 3 ); } int ImplGetScreen() const { return mnScreen; } bool ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRect ) const; @@ -178,14 +178,14 @@ class ImplSalBitmapCache private: List maBmpList; - sal_uInt32 mnTotalSize; + sal_uIntPtr mnTotalSize; public: ImplSalBitmapCache(); ~ImplSalBitmapCache(); - void ImplAdd( X11SalBitmap* pBmp, sal_uInt32 nMemSize = 0UL, sal_uInt32 nFlags = 0UL ); + void ImplAdd( X11SalBitmap* pBmp, sal_uIntPtr nMemSize = 0UL, sal_uIntPtr nFlags = 0UL ); void ImplRemove( X11SalBitmap* pBmp ); void ImplClear(); }; diff --git a/vcl/unx/inc/saldata.hxx b/vcl/unx/inc/saldata.hxx index 79c7ca277e82..34180474e256 100644 --- a/vcl/unx/inc/saldata.hxx +++ b/vcl/unx/inc/saldata.hxx @@ -85,7 +85,7 @@ public: inline SalXLib* GetLib() const { return pXLib_; } inline pthread_t GetMainThread() const { return hMainThread_; } - void StartTimer( sal_uInt32 nMS ); + void StartTimer( sal_uIntPtr nMS ); inline void StopTimer(); void Timeout() const; @@ -114,7 +114,7 @@ inline void X11SalData::XError( Display *pDisplay, XErrorEvent *pEvent ) const class YieldMutexReleaser { - sal_uInt32 m_nYieldCount; + sal_uIntPtr m_nYieldCount; public: inline YieldMutexReleaser(); inline ~YieldMutexReleaser(); diff --git a/vcl/unx/inc/saldisp.hxx b/vcl/unx/inc/saldisp.hxx index daff940b1f4e..2c35ce4445ed 100644 --- a/vcl/unx/inc/saldisp.hxx +++ b/vcl/unx/inc/saldisp.hxx @@ -212,7 +212,7 @@ class VCL_DLLPUBLIC SalXLib { protected: timeval m_aTimeout; - sal_uInt32 m_nTimeoutMS; + sal_uIntPtr m_nTimeoutMS; int m_pTimeoutFDS[2]; bool m_bHaveSystemChildFrames; @@ -254,7 +254,7 @@ public: void PushXErrorLevel( bool bIgnore ); void PopXErrorLevel(); - virtual void StartTimer( sal_uInt32 nMS ); + virtual void StartTimer( sal_uIntPtr nMS ); virtual void StopTimer(); bool CheckTimeout( bool bExecuteTimers = true ); @@ -358,11 +358,11 @@ protected: ScreenData m_aInvalidScreenData; Pair aResolution_; // [dpi] bool mbExactResolution; - sal_uInt32 nMaxRequestSize_; // [byte] + sal_uIntPtr nMaxRequestSize_; // [byte] srv_vendor_t meServerVendor; SalWM eWindowManager_; - sal_uInt32 nProperties_; // PROPERTY_SUPPORT, BUG, FEATURE + sal_uIntPtr nProperties_; // PROPERTY_SUPPORT, BUG, FEATURE sal_Bool bLocal_; // Server==Client? Init // in SalDisplay::IsLocal() sal_Bool mbLocalIsValid; // bLocal_ is valid ? @@ -493,8 +493,8 @@ public: RenderEntryMap& GetRenderEntries( int nScreen ) const { return getDataForScreen(nScreen).m_aRenderData; } const Pair &GetResolution() const { return aResolution_; } bool GetExactResolution() const { return mbExactResolution; } - sal_uInt32 GetProperties() const { return nProperties_; } - sal_uInt32 GetMaxRequestSize() const { return nMaxRequestSize_; } + sal_uIntPtr GetProperties() const { return nProperties_; } + sal_uIntPtr GetMaxRequestSize() const { return nMaxRequestSize_; } XLIB_Time GetLastUserEventTime( bool bAlwaysReget = false ) const; bool XIfEventWithTimeout( XEvent*, XPointer, X_if_predicate, long i_nTimeout = 1000 ) const; diff --git a/vcl/unx/inc/salframe.h b/vcl/unx/inc/salframe.h index 076755cde8e8..dde04b79f3ac 100644 --- a/vcl/unx/inc/salframe.h +++ b/vcl/unx/inc/salframe.h @@ -98,7 +98,7 @@ class VCL_DLLPUBLIC X11SalFrame : public SalFrame int nWidth_; // client width int nHeight_; // client height Rectangle maRestorePosSize; - sal_uInt32 nStyle_; + sal_uIntPtr nStyle_; SalExtStyle mnExtStyle; sal_Bool bAlwaysOnTop_; sal_Bool bViewable_; @@ -172,11 +172,11 @@ class VCL_DLLPUBLIC X11SalFrame : public SalFrame void setXEmbedInfo(); void askForXEmbedFocus( sal_Int32 i_nTimeCode ); public: - X11SalFrame( SalFrame* pParent, sal_uInt32 nSalFrameStyle, SystemParentData* pSystemParent = NULL ); + X11SalFrame( SalFrame* pParent, sal_uIntPtr nSalFrameStyle, SystemParentData* pSystemParent = NULL ); virtual ~X11SalFrame(); long Dispatch( XEvent *pEvent ); - void Init( sal_uInt32 nSalFrameStyle, int nScreen = -1, + void Init( sal_uIntPtr nSalFrameStyle, int nScreen = -1, SystemParentData* pParentData = NULL, bool bUseGeometry = false ); SalDisplay* GetDisplay() const { return pDisplay_; } @@ -189,7 +189,7 @@ public: XLIB_Window GetStackingWindow() const { return mhStackingWindow; } long ShutDown() const { return CallCallback( SALEVENT_SHUTDOWN, 0 ); } long Close() const { return CallCallback( SALEVENT_CLOSE, 0 ); } - sal_uInt32 GetStyle() const { return nStyle_; } + sal_uIntPtr GetStyle() const { return nStyle_; } inline XLIB_Cursor GetCursor() const { return hCursor_; } inline sal_Bool IsCaptured() const { return nCaptured_ == 1; } @@ -268,7 +268,7 @@ public: // set clip region to none (-> rectangular windows, normal state) virtual void ResetClipRegion(); // start setting the clipregion consisting of nRects rectangles - virtual void BeginSetClipRegion( sal_uInt32 nRects ); + virtual void BeginSetClipRegion( sal_uIntPtr nRects ); // add a rectangle to the clip region virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ); // done setting up the clipregion diff --git a/vcl/unx/inc/salgdi.h b/vcl/unx/inc/salgdi.h index 08da57182ac9..bb606b08bdf9 100644 --- a/vcl/unx/inc/salgdi.h +++ b/vcl/unx/inc/salgdi.h @@ -147,7 +147,7 @@ protected: unsigned long nMask = GCGraphicsExposures ); GC SelectPen(); GC SelectBrush(); - void DrawLines( sal_uInt32 nPoints, + void DrawLines( sal_uIntPtr nPoints, const SalPolyLine &rPoints, GC pGC, bool bClose @@ -235,7 +235,7 @@ public: virtual long GetGraphicsHeight() const; virtual void ResetClipRegion(); - virtual void BeginSetClipRegion( sal_uInt32 nCount ); + virtual void BeginSetClipRegion( sal_uIntPtr nCount ); virtual sal_Bool unionClipRegion( long nX, long nY, long nWidth, long nHeight ); virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& ); virtual void EndSetClipRegion(); @@ -254,7 +254,7 @@ public: virtual void SetTextColor( SalColor nSalColor ); virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel ); virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); - virtual sal_uInt32 GetKernPairs( sal_uInt32 nMaxPairs, ImplKernPairData* ); + virtual sal_uIntPtr GetKernPairs( sal_uIntPtr nMaxPairs, ImplKernPairData* ); virtual const ImplFontCharMap* GetImplFontCharMap() const; virtual void GetDevFontList( ImplDevFontList* ); virtual void GetDevFontSubstList( OutputDevice* ); @@ -287,9 +287,9 @@ public: virtual void drawPixel( long nX, long nY, SalColor nSalColor ); virtual void drawLine( long nX1, long nY1, long nX2, long nY2 ); virtual void drawRect( long nX, long nY, long nWidth, long nHeight ); - void drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry, bool bClose ); - virtual void drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ); - virtual void drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ); + void drawPolyLine( sal_uIntPtr nPoints, const SalPoint* pPtAry, bool bClose ); + virtual void drawPolyLine( sal_uIntPtr nPoints, const SalPoint* pPtAry ); + virtual void drawPolygon( sal_uIntPtr nPoints, const SalPoint* pPtAry ); virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ); @@ -298,10 +298,10 @@ public: virtual bool drawFilledTrapezoids( const ::basegfx::B2DTrapezoid*, int nTrapCount, double fTransparency ); #if 1 // TODO: remove these obselete methods - virtual sal_Bool drawPolyLineBezier( sal_uInt32 nPoints, + virtual sal_Bool drawPolyLineBezier( sal_uIntPtr nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ); - virtual sal_Bool drawPolygonBezier( sal_uInt32 nPoints, + virtual sal_Bool drawPolygonBezier( sal_uIntPtr nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ); virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly, @@ -333,9 +333,9 @@ public: virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight ); virtual SalColor getPixel( long nX, long nY ); virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags ); - virtual void invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalInvert nFlags ); + virtual void invert( sal_uIntPtr nPoints, const SalPoint* pPtAry, SalInvert nFlags ); - virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uInt32 nSize ); + virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uIntPtr nSize ); virtual bool drawAlphaBitmap( const SalTwoRect&, const SalBitmap& rSourceBitmap, diff --git a/vcl/unx/inc/salinst.h b/vcl/unx/inc/salinst.h index fab34429afb2..2f53a979a485 100644 --- a/vcl/unx/inc/salinst.h +++ b/vcl/unx/inc/salinst.h @@ -42,7 +42,7 @@ class VCL_DLLPUBLIC SalYieldMutex : public vos::OMutex { protected: - sal_uInt32 mnCount; + sal_uIntPtr mnCount; vos::OThread::TThreadIdentifier mnThreadId; public: @@ -52,7 +52,7 @@ public: virtual void release(); virtual sal_Bool tryToAcquire(); - sal_uInt32 GetAcquireCount() const { return mnCount; } + sal_uIntPtr GetAcquireCount() const { return mnCount; } vos::OThread::TThreadIdentifier GetThreadId() const { return mnThreadId; } }; @@ -70,8 +70,8 @@ public: {} virtual ~X11SalInstance(); - virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uInt32 nStyle ); - virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uInt32 nStyle ); + virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uIntPtr nStyle ); + virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uIntPtr nStyle ); virtual void DestroyFrame( SalFrame* pFrame ); virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True ); @@ -100,8 +100,8 @@ public: virtual SalSession* CreateSalSession(); virtual vos::IMutex* GetYieldMutex(); - virtual sal_uInt32 ReleaseYieldMutex(); - virtual void AcquireYieldMutex( sal_uInt32 nCount ); + virtual sal_uIntPtr ReleaseYieldMutex(); + virtual void AcquireYieldMutex( sal_uIntPtr nCount ); virtual bool CheckYieldMutex(); virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ); diff --git a/vcl/unx/inc/salobj.h b/vcl/unx/inc/salobj.h index 865b09f39a04..c843708f0c2e 100644 --- a/vcl/unx/inc/salobj.h +++ b/vcl/unx/inc/salobj.h @@ -41,7 +41,7 @@ public: SalClipRegion(); ~SalClipRegion(); - void BeginSetClipRegion( sal_uInt32 nRects ); + void BeginSetClipRegion( sal_uIntPtr nRects ); void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ); XRectangle *EndSetClipRegion() { @@ -84,7 +84,7 @@ public: // overload all pure virtual methods virtual void ResetClipRegion(); virtual sal_uInt16 GetClipRegionType(); - virtual void BeginSetClipRegion( sal_uInt32 nRects ); + virtual void BeginSetClipRegion( sal_uIntPtr nRects ); virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ); virtual void EndSetClipRegion(); diff --git a/vcl/unx/inc/salprn.h b/vcl/unx/inc/salprn.h index 8902f2efd497..7b42ad74c923 100644 --- a/vcl/unx/inc/salprn.h +++ b/vcl/unx/inc/salprn.h @@ -50,14 +50,14 @@ public: virtual void ReleaseGraphics( SalGraphics* pGraphics ); virtual sal_Bool Setup( SalFrame* pFrame, ImplJobSetup* pSetupData ); virtual sal_Bool SetPrinterData( ImplJobSetup* pSetupData ); - virtual sal_Bool SetData( sal_uInt32 nFlags, ImplJobSetup* pSetupData ); + virtual sal_Bool SetData( sal_uIntPtr nFlags, ImplJobSetup* pSetupData ); virtual void GetPageInfo( const ImplJobSetup* pSetupData, long& rOutWidth, long& rOutHeight, long& rPageOffX, long& rPageOffY, long& rPageWidth, long& rPageHeight ); - virtual sal_uInt32 GetCapabilities( const ImplJobSetup* pSetupData, sal_uInt16 nType ); - virtual sal_uInt32 GetPaperBinCount( const ImplJobSetup* pSetupData ); - virtual String GetPaperBinName( const ImplJobSetup* pSetupData, sal_uInt32 nPaperBin ); + virtual sal_uIntPtr GetCapabilities( const ImplJobSetup* pSetupData, sal_uInt16 nType ); + virtual sal_uIntPtr GetPaperBinCount( const ImplJobSetup* pSetupData ); + virtual String GetPaperBinName( const ImplJobSetup* pSetupData, sal_uIntPtr nPaperBin ); virtual void InitPaperFormats( const ImplJobSetup* pSetupData ); virtual int GetLandscapeAngle( const ImplJobSetup* pSetupData ); }; @@ -76,7 +76,7 @@ public: psp::PrinterJob m_aPrintJob; psp::JobData m_aJobData; psp::PrinterGfx m_aPrinterGfx; - sal_uInt32 m_nCopies; + sal_uIntPtr m_nCopies; bool m_bCollate; SalInfoPrinter* m_pInfoPrinter; @@ -88,7 +88,7 @@ public: virtual sal_Bool StartJob( const XubString* pFileName, const XubString& rJobName, const XubString& rAppName, - sal_uInt32 nCopies, + sal_uIntPtr nCopies, bool bCollate, bool bDirect, ImplJobSetup* pSetupData ); @@ -101,7 +101,7 @@ public: virtual sal_Bool AbortJob(); virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, sal_Bool bNewJobData ); virtual sal_Bool EndPage(); - virtual sal_uInt32 GetErrorCode(); + virtual sal_uIntPtr GetErrorCode(); }; class Timer; diff --git a/vcl/unx/inc/saltimer.h b/vcl/unx/inc/saltimer.h index 8f0512d47468..ba52b96c073a 100644 --- a/vcl/unx/inc/saltimer.h +++ b/vcl/unx/inc/saltimer.h @@ -37,7 +37,7 @@ public: virtual ~X11SalTimer(); // overload all pure virtual methods - void Start( sal_uInt32 nMS ); + void Start( sal_uIntPtr nMS ); void Stop(); }; diff --git a/vcl/unx/inc/salunx.h b/vcl/unx/inc/salunx.h index 8c543af39f29..8be91cbd3bce 100644 --- a/vcl/unx/inc/salunx.h +++ b/vcl/unx/inc/salunx.h @@ -95,7 +95,7 @@ inline timeval &operator += ( timeval &t1, const timeval &t2 ) return t1; } -inline timeval &operator += ( timeval &t1, sal_uInt32 t2 ) +inline timeval &operator += ( timeval &t1, sal_uIntPtr t2 ) { t1.tv_sec += t2 / 1000; t1.tv_usec += t2 ? (t2 % 1000) * 1000 : 500; @@ -113,7 +113,7 @@ inline timeval operator + ( const timeval &t1, const timeval &t2 ) return t0 += t2; } -inline timeval operator + ( const timeval &t1, sal_uInt32 t2 ) +inline timeval operator + ( const timeval &t1, sal_uIntPtr t2 ) { timeval t0 = t1; return t0 += t2; diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx index b92b05abc653..9d3dd511de19 100644 --- a/vcl/unx/kde/salnativewidgets-kde.cxx +++ b/vcl/unx/kde/salnativewidgets-kde.cxx @@ -1710,7 +1710,7 @@ sal_Bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart // KDESalFrame implementation // ----------------------------------------------------------------------- -KDESalFrame::KDESalFrame( SalFrame* pParent, sal_uInt32 nStyle ) : +KDESalFrame::KDESalFrame( SalFrame* pParent, sal_uIntPtr nStyle ) : X11SalFrame( pParent, nStyle ) { } @@ -2083,7 +2083,7 @@ KDESalFrame::GraphicsHolder::~GraphicsHolder() // ----------------------------------------------------------------------- SalFrame * -KDESalInstance::CreateFrame( SalFrame *pParent, sal_uInt32 nStyle ) +KDESalInstance::CreateFrame( SalFrame *pParent, sal_uIntPtr nStyle ) { return new KDESalFrame( pParent, nStyle ); } diff --git a/vcl/unx/source/app/i18n_status.cxx b/vcl/unx/source/app/i18n_status.cxx index 8937a71c905f..594cdf9c89de 100644 --- a/vcl/unx/source/app/i18n_status.cxx +++ b/vcl/unx/source/app/i18n_status.cxx @@ -102,7 +102,7 @@ class XIMStatusWindow : public StatusWindow // for delayed showing bool m_bDelayedShow; I18NStatus::ShowReason m_eDelayedReason; - sal_uInt32 m_nDelayedEvent; + sal_uIntPtr m_nDelayedEvent; // for toggling bool m_bOn; diff --git a/vcl/unx/source/app/salinst.cxx b/vcl/unx/source/app/salinst.cxx index 9284f6aaa293..431367deeef1 100644 --- a/vcl/unx/source/app/salinst.cxx +++ b/vcl/unx/source/app/salinst.cxx @@ -227,14 +227,14 @@ vos::IMutex* X11SalInstance::GetYieldMutex() // ----------------------------------------------------------------------- -sal_uInt32 X11SalInstance::ReleaseYieldMutex() +sal_uIntPtr X11SalInstance::ReleaseYieldMutex() { SalYieldMutex* pYieldMutex = mpSalYieldMutex; if ( pYieldMutex->GetThreadId() == vos::OThread::getCurrentIdentifier() ) { - sal_uInt32 nCount = pYieldMutex->GetAcquireCount(); - sal_uInt32 n = nCount; + sal_uIntPtr nCount = pYieldMutex->GetAcquireCount(); + sal_uIntPtr n = nCount; while ( n ) { pYieldMutex->release(); @@ -249,7 +249,7 @@ sal_uInt32 X11SalInstance::ReleaseYieldMutex() // ----------------------------------------------------------------------- -void X11SalInstance::AcquireYieldMutex( sal_uInt32 nCount ) +void X11SalInstance::AcquireYieldMutex( sal_uIntPtr nCount ) { SalYieldMutex* pYieldMutex = mpSalYieldMutex; while ( nCount ) @@ -288,14 +288,14 @@ void* X11SalInstance::GetConnectionIdentifier( ConnectionIdentifierType& rReturn return pDisplay ? (void*)pDisplay : (void*)""; } -SalFrame *X11SalInstance::CreateFrame( SalFrame *pParent, sal_uInt32 nSalFrameStyle ) +SalFrame *X11SalInstance::CreateFrame( SalFrame *pParent, sal_uIntPtr nSalFrameStyle ) { SalFrame *pFrame = new X11SalFrame( pParent, nSalFrameStyle ); return pFrame; } -SalFrame* X11SalInstance::CreateChildFrame( SystemParentData* pParentData, sal_uInt32 nStyle ) +SalFrame* X11SalInstance::CreateChildFrame( SystemParentData* pParentData, sal_uIntPtr nStyle ) { SalFrame* pFrame = new X11SalFrame( NULL, nStyle, pParentData ); diff --git a/vcl/unx/source/app/saltimer.cxx b/vcl/unx/source/app/saltimer.cxx index 7c4ec0676428..cb8f7d06f64e 100644 --- a/vcl/unx/source/app/saltimer.cxx +++ b/vcl/unx/source/app/saltimer.cxx @@ -58,7 +58,7 @@ void SalXLib::StopTimer() m_nTimeoutMS = 0; } -void SalXLib::StartTimer( sal_uInt32 nMS ) +void SalXLib::StartTimer( sal_uIntPtr nMS ) { timeval Timeout (m_aTimeout); // previous timeout. gettimeofday (&m_aTimeout, 0); @@ -89,7 +89,7 @@ void X11SalTimer::Stop() GetX11SalData()->GetLib()->StopTimer(); } -void X11SalTimer::Start( sal_uInt32 nMS ) +void X11SalTimer::Start( sal_uIntPtr nMS ) { GetX11SalData()->GetLib()->StartTimer( nMS ); } diff --git a/vcl/unx/source/gdi/gcach_xpeer.cxx b/vcl/unx/source/gdi/gcach_xpeer.cxx index 3d2af898c7e2..c3ff95b99082 100644 --- a/vcl/unx/source/gdi/gcach_xpeer.cxx +++ b/vcl/unx/source/gdi/gcach_xpeer.cxx @@ -465,13 +465,13 @@ Pixmap X11GlyphPeer::GetPixmap( ServerFont& rServerFont, int nGlyphIndex, int nR if( rServerFont.GetGlyphBitmap1( nGlyphIndex, maRawBitmap ) ) { // #94666# circumvent bug in some X11 systems, e.g. XF410.LynxEM.v163 - sal_uInt32 nPixmapWidth = 8 * maRawBitmap.mnScanlineSize - 1; + sal_uIntPtr nPixmapWidth = 8 * maRawBitmap.mnScanlineSize - 1; nPixmapWidth = Max( nPixmapWidth, maRawBitmap.mnWidth ); rGlyphData.SetSize( Size( nPixmapWidth, maRawBitmap.mnHeight ) ); rGlyphData.SetOffset( +maRawBitmap.mnXOffset, +maRawBitmap.mnYOffset ); - const sal_uInt32 nBytes = maRawBitmap.mnHeight * maRawBitmap.mnScanlineSize; + const sal_uIntPtr nBytes = maRawBitmap.mnHeight * maRawBitmap.mnScanlineSize; if( nBytes > 0 ) { // conversion table LSB<->MSB (for XCreatePixmapFromData) @@ -621,7 +621,7 @@ Glyph X11GlyphPeer::GetGlyphId( ServerFont& rServerFont, int nGlyphIndex ) GlyphSet aGlyphSet = GetGlyphSet( rServerFont, -1 ); aGlyphId = nGlyphIndex & 0x00FFFFFF; - const sal_uInt32 nBytes = maRawBitmap.mnScanlineSize * maRawBitmap.mnHeight; + const sal_uIntPtr nBytes = maRawBitmap.mnScanlineSize * maRawBitmap.mnHeight; XRenderPeer::GetInstance().AddGlyph( aGlyphSet, aGlyphId, aGlyphInfo, (char*)maRawBitmap.mpBits, nBytes ); mnBytesUsed += nBytes; diff --git a/vcl/unx/source/gdi/pspgraphics.cxx b/vcl/unx/source/gdi/pspgraphics.cxx index c7727dade852..57cbca3f1ae8 100644 --- a/vcl/unx/source/gdi/pspgraphics.cxx +++ b/vcl/unx/source/gdi/pspgraphics.cxx @@ -293,7 +293,7 @@ void PspGraphics::ResetClipRegion() m_pPrinterGfx->ResetClipRegion (); } -void PspGraphics::BeginSetClipRegion( sal_uInt32 n ) +void PspGraphics::BeginSetClipRegion( sal_uIntPtr n ) { m_pPrinterGfx->BeginSetClipRegion(n); } @@ -379,12 +379,12 @@ void PspGraphics::drawRect( long nX, long nY, long nDX, long nDY ) m_pPrinterGfx->DrawRect (Rectangle(Point(nX, nY), Size(nDX, nDY))); } -void PspGraphics::drawPolyLine( sal_uInt32 nPoints, const SalPoint *pPtAry ) +void PspGraphics::drawPolyLine( sal_uIntPtr nPoints, const SalPoint *pPtAry ) { m_pPrinterGfx->DrawPolyLine (nPoints, (Point*)pPtAry); } -void PspGraphics::drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ) +void PspGraphics::drawPolygon( sal_uIntPtr nPoints, const SalPoint* pPtAry ) { // Point must be equal to SalPoint! see vcl/inc/salgtype.hxx m_pPrinterGfx->DrawPolygon (nPoints, (Point*)pPtAry); @@ -409,13 +409,13 @@ bool PspGraphics::drawPolyLine( const basegfx::B2DPolygon&, double /*fTransparen return false; } -sal_Bool PspGraphics::drawPolyLineBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ) +sal_Bool PspGraphics::drawPolyLineBezier( sal_uIntPtr nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ) { m_pPrinterGfx->DrawPolyLineBezier (nPoints, (Point*)pPtAry, pFlgAry); return sal_True; } -sal_Bool PspGraphics::drawPolygonBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ) +sal_Bool PspGraphics::drawPolygonBezier( sal_uIntPtr nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ) { m_pPrinterGfx->DrawPolygonBezier (nPoints, (Point*)pPtAry, pFlgAry); return sal_True; @@ -431,13 +431,13 @@ sal_Bool PspGraphics::drawPolyPolygonBezier( sal_uInt32 nPoly, return sal_True; } -void PspGraphics::invert( sal_uInt32, +void PspGraphics::invert( sal_uIntPtr, const SalPoint*, SalInvert ) { DBG_ASSERT( 0, "Error: PrinterGfx::Invert() not implemented" ); } -sal_Bool PspGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uInt32 nSize ) +sal_Bool PspGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uIntPtr nSize ) { return m_pPrinterGfx->DrawEPS( Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) ), pPtr, nSize ); } @@ -915,10 +915,10 @@ void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric, int ) } } -sal_uInt32 PspGraphics::GetKernPairs( sal_uInt32 nPairs, ImplKernPairData *pKernPairs ) +sal_uInt32 PspGraphics::GetKernPairs( sal_uIntPtr nPairs, ImplKernPairData *pKernPairs ) { const ::std::list< ::psp::KernPair >& rPairs( m_pPrinterGfx->getKernPairs() ); - sal_uInt32 nHavePairs = rPairs.size(); + sal_uIntPtr nHavePairs = rPairs.size(); if( pKernPairs && nPairs ) { ::std::list< ::psp::KernPair >::const_iterator it; diff --git a/vcl/unx/source/gdi/salbmp.cxx b/vcl/unx/source/gdi/salbmp.cxx index 0b93333b91c3..5ddcd7d311b9 100644 --- a/vcl/unx/source/gdi/salbmp.cxx +++ b/vcl/unx/source/gdi/salbmp.cxx @@ -64,7 +64,7 @@ SalBitmap* X11SalInstance::CreateSalBitmap() } ImplSalBitmapCache* X11SalBitmap::mpCache = NULL; -sal_uInt32 X11SalBitmap::mnCacheInstCount = 0; +sal_uIntPtr X11SalBitmap::mnCacheInstCount = 0; // ----------------------------------------------------------------------------- @@ -214,7 +214,7 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable, { const SalTwoRect aTwoRect = { 0, 0, nWidth, nHeight, 0, 0, nWidth, nHeight }; BitmapBuffer aSrcBuf; - sal_uInt32 nDstFormat = BMP_FORMAT_BOTTOM_UP; + sal_uIntPtr nDstFormat = BMP_FORMAT_BOTTOM_UP; const BitmapPalette* pDstPal = NULL; aSrcBuf.mnFormat = BMP_FORMAT_TOP_DOWN; @@ -304,7 +304,7 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable, else if( aSrcBuf.mnBitCount <= 8 ) { const SalColormap& rColMap = pSalDisp->GetColormap( nScreen ); - const sal_uInt16 nCols = Min( (sal_uInt32)rColMap.GetUsed(), (sal_uInt32)(1 << nDrawableDepth) ); + const sal_uInt16 nCols = Min( (sal_uIntPtr)rColMap.GetUsed(), (sal_uIntPtr)(1 << nDrawableDepth) ); rPal.SetEntryCount( nCols ); pDstPal = &rPal; @@ -363,7 +363,7 @@ XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long if( pImage ) { BitmapBuffer* pDstBuf; - sal_uInt32 nDstFormat = BMP_FORMAT_TOP_DOWN; + sal_uIntPtr nDstFormat = BMP_FORMAT_TOP_DOWN; BitmapPalette* pPal = NULL; ColorMask* pMask = NULL; @@ -430,7 +430,7 @@ XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long else if( pImage->depth <= 8 ) { const SalColormap& rColMap = pSalDisp->GetColormap( nScreen ); - const sal_uInt16 nCols = Min( (sal_uInt32)rColMap.GetUsed(), (sal_uInt32)(1 << pImage->depth) ); + const sal_uInt16 nCols = Min( (sal_uIntPtr)rColMap.GetUsed(), (sal_uIntPtr)(1 << pImage->depth) ); pPal = new BitmapPalette( nCols ); @@ -1018,10 +1018,10 @@ void ImplSalDDB::ImplDraw( Drawable aSrcDrawable, long nSrcDrawableDepth, struct ImplBmpObj { X11SalBitmap* mpBmp; - sal_uInt32 mnMemSize; - sal_uInt32 mnFlags; + sal_uIntPtr mnMemSize; + sal_uIntPtr mnFlags; - ImplBmpObj( X11SalBitmap* pBmp, sal_uInt32 nMemSize, sal_uInt32 nFlags ) : + ImplBmpObj( X11SalBitmap* pBmp, sal_uIntPtr nMemSize, sal_uIntPtr nFlags ) : mpBmp( pBmp ), mnMemSize( nMemSize ), mnFlags( nFlags ) {} }; @@ -1041,7 +1041,7 @@ ImplSalBitmapCache::~ImplSalBitmapCache() // ----------------------------------------------------------------------------- -void ImplSalBitmapCache::ImplAdd( X11SalBitmap* pBmp, sal_uInt32 nMemSize, sal_uInt32 nFlags ) +void ImplSalBitmapCache::ImplAdd( X11SalBitmap* pBmp, sal_uIntPtr nMemSize, sal_uIntPtr nFlags ) { ImplBmpObj* pObj; bool bFound = sal_False; diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx index 3802f4f394ac..1b350e3460b8 100644 --- a/vcl/unx/source/gdi/salgdi.cxx +++ b/vcl/unx/source/gdi/salgdi.cxx @@ -67,21 +67,21 @@ class SalPolyLine XPoint Points_[STATIC_POINTS]; XPoint *pFirst_; public: - inline SalPolyLine( sal_uInt32 nPoints ); - inline SalPolyLine( sal_uInt32 nPoints, const SalPoint *p ); + inline SalPolyLine( sal_uIntPtr nPoints ); + inline SalPolyLine( sal_uIntPtr nPoints, const SalPoint *p ); inline ~SalPolyLine(); - inline XPoint &operator [] ( sal_uInt32 n ) const + inline XPoint &operator [] ( sal_uIntPtr n ) const { return pFirst_[n]; } }; -inline SalPolyLine::SalPolyLine( sal_uInt32 nPoints ) +inline SalPolyLine::SalPolyLine( sal_uIntPtr nPoints ) : pFirst_( nPoints+1 > STATIC_POINTS ? new XPoint[nPoints+1] : Points_ ) {} -inline SalPolyLine::SalPolyLine( sal_uInt32 nPoints, const SalPoint *p ) +inline SalPolyLine::SalPolyLine( sal_uIntPtr nPoints, const SalPoint *p ) : pFirst_( nPoints+1 > STATIC_POINTS ? new XPoint[nPoints+1] : Points_ ) { - for( sal_uInt32 i = 0; i < nPoints; i++ ) + for( sal_uIntPtr i = 0; i < nPoints; i++ ) { pFirst_[i].x = (short)p[i].mnX; pFirst_[i].y = (short)p[i].mnY; @@ -398,19 +398,19 @@ GC X11SalGraphics::GetTrackingGC() } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalGraphics::DrawLines( sal_uInt32 nPoints, +void X11SalGraphics::DrawLines( sal_uIntPtr nPoints, const SalPolyLine &rPoints, GC pGC, bool bClose ) { // errechne wie viele Linien XWindow auf einmal zeichnen kann - sal_uInt32 nMaxLines = (GetDisplay()->GetMaxRequestSize() - sizeof(xPolyPointReq)) + sal_uIntPtr nMaxLines = (GetDisplay()->GetMaxRequestSize() - sizeof(xPolyPointReq)) / sizeof(xPoint); if( nMaxLines > nPoints ) nMaxLines = nPoints; // gebe alle Linien aus, die XWindows zeichnen kann. - sal_uInt32 n; + sal_uIntPtr n; for( n = 0; nPoints - n > nMaxLines; n += nMaxLines - 1 ) XDrawLines( GetXDisplay(), GetDrawable(), @@ -597,7 +597,7 @@ void X11SalGraphics::ResetClipRegion() } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalGraphics::BeginSetClipRegion( sal_uInt32 ) +void X11SalGraphics::BeginSetClipRegion( sal_uIntPtr ) { if( pClipRegion_ ) XDestroyRegion( pClipRegion_ ); @@ -839,13 +839,13 @@ void X11SalGraphics::drawRect( long nX, long nY, long nDX, long nDY ) } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalGraphics::drawPolyLine( sal_uInt32 nPoints, const SalPoint *pPtAry ) +void X11SalGraphics::drawPolyLine( sal_uIntPtr nPoints, const SalPoint *pPtAry ) { drawPolyLine( nPoints, pPtAry, false ); } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalGraphics::drawPolyLine( sal_uInt32 nPoints, const SalPoint *pPtAry, bool bClose ) +void X11SalGraphics::drawPolyLine( sal_uIntPtr nPoints, const SalPoint *pPtAry, bool bClose ) { if( nPenColor_ != 0xFFFFFFFF ) { @@ -856,7 +856,7 @@ void X11SalGraphics::drawPolyLine( sal_uInt32 nPoints, const SalPoint *pPtAry, b } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalGraphics::drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ) +void X11SalGraphics::drawPolygon( sal_uIntPtr nPoints, const SalPoint* pPtAry ) { if( nPoints == 0 ) return; @@ -972,14 +972,14 @@ void X11SalGraphics::drawPolyPolygon( sal_uInt32 nPoly, // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -sal_Bool X11SalGraphics::drawPolyLineBezier( sal_uInt32, const SalPoint*, const BYTE* ) +sal_Bool X11SalGraphics::drawPolyLineBezier( sal_uIntPtr, const SalPoint*, const BYTE* ) { return sal_False; } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -sal_Bool X11SalGraphics::drawPolygonBezier( sal_uInt32, const SalPoint*, const BYTE* ) +sal_Bool X11SalGraphics::drawPolygonBezier( sal_uIntPtr, const SalPoint*, const BYTE* ) { return sal_False; } @@ -994,7 +994,7 @@ sal_Bool X11SalGraphics::drawPolyPolygonBezier( sal_uInt32, const sal_uInt32*, // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalGraphics::invert( sal_uInt32 nPoints, +void X11SalGraphics::invert( sal_uIntPtr nPoints, const SalPoint* pPtAry, SalInvert nFlags ) { @@ -1021,7 +1021,7 @@ void X11SalGraphics::invert( sal_uInt32 nPoints, // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -BOOL X11SalGraphics::drawEPS( long,long,long,long,void*,sal_uInt32 ) +BOOL X11SalGraphics::drawEPS( long,long,long,long,void*,sal_uIntPtr ) { return sal_False; } diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx index e570e0e02bc6..a80f9e7ef011 100644 --- a/vcl/unx/source/gdi/salgdi3.cxx +++ b/vcl/unx/source/gdi/salgdi3.cxx @@ -1777,14 +1777,14 @@ X11SalGraphics::GetFontMetric( ImplFontMetricData *pMetric, int nFallbackLevel ) // --------------------------------------------------------------------------- sal_uInt32 -X11SalGraphics::GetKernPairs( sal_uInt32 nPairs, ImplKernPairData *pKernPairs ) +X11SalGraphics::GetKernPairs( sal_uIntPtr nPairs, ImplKernPairData *pKernPairs ) { if( ! bPrinter_ ) { if( mpServerFont[0] != NULL ) { ImplKernPairData* pTmpKernPairs; - sal_uInt32 nGotPairs = mpServerFont[0]->GetKernPairs( &pTmpKernPairs ); + sal_uIntPtr nGotPairs = mpServerFont[0]->GetKernPairs( &pTmpKernPairs ); for( unsigned int i = 0; i < nPairs && i < nGotPairs; ++i ) pKernPairs[ i ] = pTmpKernPairs[ i ]; delete[] pTmpKernPairs; diff --git a/vcl/unx/source/gdi/salprnpsp.cxx b/vcl/unx/source/gdi/salprnpsp.cxx index c8a0f6532133..35d01e7cb5ca 100644 --- a/vcl/unx/source/gdi/salprnpsp.cxx +++ b/vcl/unx/source/gdi/salprnpsp.cxx @@ -662,7 +662,7 @@ sal_Bool PspSalInfoPrinter::SetPrinterData( ImplJobSetup* pJobSetup ) // Only the data must be changed, where the bit // in nGetDataFlags is set sal_Bool PspSalInfoPrinter::SetData( - sal_uInt32 nSetDataFlags, + sal_uIntPtr nSetDataFlags, ImplJobSetup* pJobSetup ) { JobData aData; @@ -823,7 +823,7 @@ void PspSalInfoPrinter::GetPageInfo( // ----------------------------------------------------------------------- -sal_uInt32 PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup ) +sal_uIntPtr PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup ) { if( ! pJobSetup ) return 0; @@ -837,7 +837,7 @@ sal_uInt32 PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup ) // ----------------------------------------------------------------------- -String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, sal_uInt32 nPaperBin ) +String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, sal_uIntPtr nPaperBin ) { JobData aData; JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData ); @@ -846,7 +846,7 @@ String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, sal_uI if( aData.m_pParser ) { const PPDKey* pKey = aData.m_pParser ? aData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "InputSlot" ) ) ): NULL; - if( ! pKey || nPaperBin >= (sal_uInt32)pKey->countValues() ) + if( ! pKey || nPaperBin >= (sal_uIntPtr)pKey->countValues() ) aRet = aData.m_pParser->getDefaultInputSlot(); else { @@ -861,7 +861,7 @@ String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, sal_uI // ----------------------------------------------------------------------- -sal_uInt32 PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, sal_uInt16 nType ) +sal_uIntPtr PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, sal_uInt16 nType ) { switch( nType ) { @@ -959,7 +959,7 @@ sal_Bool PspSalPrinter::StartJob( const XubString* pFileName, const XubString& rJobName, const XubString& rAppName, - sal_uInt32 nCopies, + sal_uIntPtr nCopies, bool bCollate, bool bDirect, ImplJobSetup* pJobSetup ) @@ -1111,7 +1111,7 @@ sal_Bool PspSalPrinter::EndPage() // ----------------------------------------------------------------------- -sal_uInt32 PspSalPrinter::GetErrorCode() +sal_uIntPtr PspSalPrinter::GetErrorCode() { return 0; } diff --git a/vcl/unx/source/window/salframe.cxx b/vcl/unx/source/window/salframe.cxx index 0e0c5f6c03c7..64ea220a6cde 100644 --- a/vcl/unx/source/window/salframe.cxx +++ b/vcl/unx/source/window/salframe.cxx @@ -209,7 +209,7 @@ void X11SalFrame::askForXEmbedFocus( sal_Int32 i_nTimeCode ) // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalFrame::Init( sal_uInt32 nSalFrameStyle, int nScreen, SystemParentData* pParentData, bool bUseGeometry ) +void X11SalFrame::Init( sal_uIntPtr nSalFrameStyle, int nScreen, SystemParentData* pParentData, bool bUseGeometry ) { if( nScreen < 0 || nScreen >= GetDisplay()->GetScreenCount() ) nScreen = GetDisplay()->GetDefaultScreenNumber(); @@ -645,7 +645,7 @@ void X11SalFrame::Init( sal_uInt32 nSalFrameStyle, int nScreen, SystemParentData } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -X11SalFrame::X11SalFrame( SalFrame *pParent, sal_uInt32 nSalFrameStyle, SystemParentData* pSystemParent ) +X11SalFrame::X11SalFrame( SalFrame *pParent, sal_uIntPtr nSalFrameStyle, SystemParentData* pSystemParent ) { X11SalData* pSalData = GetX11SalData(); @@ -3062,7 +3062,7 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent ) if( pEvent->type == ButtonRelease ) return 0; - static sal_uInt32 nLines = 0; + static sal_uIntPtr nLines = 0; if( ! nLines ) { char* pEnv = getenv( "SAL_WHEELLINES" ); @@ -3600,7 +3600,7 @@ long X11SalFrame::HandleFocusEvent( XFocusChangeEvent *pEvent ) if ((mpParent != NULL && nStyle_ == 0) && pSVData->maWinData.mpFirstFloat ) { - sal_uInt32 nMode = pSVData->maWinData.mpFirstFloat->GetPopupModeFlags(); + sal_uIntPtr nMode = pSVData->maWinData.mpFirstFloat->GetPopupModeFlags(); pSVData->maWinData.mpFirstFloat->SetPopupModeFlags( nMode & ~(FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE)); } @@ -4477,7 +4477,7 @@ void X11SalFrame::ResetClipRegion() op, ordering ); } -void X11SalFrame::BeginSetClipRegion( sal_uInt32 nRects ) +void X11SalFrame::BeginSetClipRegion( sal_uIntPtr nRects ) { if( m_pClipRectangles ) delete [] m_pClipRectangles; diff --git a/vcl/unx/source/window/salobj.cxx b/vcl/unx/source/window/salobj.cxx index 730eab142415..782b4aae897f 100644 --- a/vcl/unx/source/window/salobj.cxx +++ b/vcl/unx/source/window/salobj.cxx @@ -219,7 +219,7 @@ SalClipRegion::~SalClipRegion() void -SalClipRegion::BeginSetClipRegion( sal_uInt32 nRects ) +SalClipRegion::BeginSetClipRegion( sal_uIntPtr nRects ) { if (ClipRectangleList) delete [] ClipRectangleList; @@ -324,7 +324,7 @@ X11SalObject::ResetClipRegion() void -X11SalObject::BeginSetClipRegion( sal_uInt32 nRectCount ) +X11SalObject::BeginSetClipRegion( sal_uIntPtr nRectCount ) { maClipRegion.BeginSetClipRegion ( nRectCount ); } -- cgit From ca18a18102f0cb0f6550c0e7c50356556ae6bfcb Mon Sep 17 00:00:00 2001 From: Bjoern Michaelsen Date: Tue, 11 Jan 2011 13:36:29 +0100 Subject: gnumake3: updated module support for checks and subsequent checks, improved error reporting --- vcl/unx/inc/dtint.hxx | 7 ------- 1 file changed, 7 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/inc/dtint.hxx b/vcl/unx/inc/dtint.hxx index 75f197c81e13..ebe2cae90803 100644 --- a/vcl/unx/inc/dtint.hxx +++ b/vcl/unx/inc/dtint.hxx @@ -36,13 +36,6 @@ class SalBitmap; class SalDisplay; class AllSettings; -#ifndef _XLIB_H_ -// forwards from X -struct Display; -struct XEvent; -#define Atom UINT32 -#define XLIB_Window UINT32 -#endif enum DtType { DtGeneric, -- cgit From ccc7d6ccee67327417c3ef29f688ca1e8c8371ae Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Tue, 11 Jan 2011 17:09:16 +0100 Subject: #removetooltypes01: Exchange of ULONG to sal_uIntPtr --- vcl/unx/headless/svpdummies.cxx | 2 +- vcl/unx/source/printer/jobdata.cxx | 2 +- vcl/unx/source/printer/ppdparser.cxx | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/headless/svpdummies.cxx b/vcl/unx/headless/svpdummies.cxx index b58571131bda..6aed05bf135b 100644 --- a/vcl/unx/headless/svpdummies.cxx +++ b/vcl/unx/headless/svpdummies.cxx @@ -51,7 +51,7 @@ SvpSalObject::~SvpSalObject() void SvpSalObject::ResetClipRegion() {} sal_uInt16 SvpSalObject::GetClipRegionType() { return 0; } -void SvpSalObject::BeginSetClipRegion( sal_uInt32 ) {} +void SvpSalObject::BeginSetClipRegion( sal_uIntPtr ) {} void SvpSalObject::UnionClipRegion( long, long, long, long ) {} void SvpSalObject::EndSetClipRegion() {} void SvpSalObject::SetPosSize( long, long, long, long ) {} diff --git a/vcl/unx/source/printer/jobdata.cxx b/vcl/unx/source/printer/jobdata.cxx index 046c7fd681b9..b3aceffcad6d 100644 --- a/vcl/unx/source/printer/jobdata.cxx +++ b/vcl/unx/source/printer/jobdata.cxx @@ -167,7 +167,7 @@ bool JobData::getStreamBuffer( void*& pData, int& bytes ) // now append the PPDContext stream buffer aStream.WriteLine( "PPDContexData" ); - sal_uInt32 nBytes; + sal_uIntPtr nBytes; void* pContextBuffer = m_aContext.getStreamableBuffer( nBytes ); if( nBytes ) aStream.Write( pContextBuffer, nBytes ); diff --git a/vcl/unx/source/printer/ppdparser.cxx b/vcl/unx/source/printer/ppdparser.cxx index 3cdd4c35f3ec..14bd83add924 100644 --- a/vcl/unx/source/printer/ppdparser.cxx +++ b/vcl/unx/source/printer/ppdparser.cxx @@ -311,7 +311,7 @@ void PPDDecompressStream::Open( const rtl::OUString& i_rFile ) mpFileStream->Seek( 0 ); // check for compress'ed or gzip'ed file - sal_uInt32 nCompressMethod = 0; + sal_uIntPtr nCompressMethod = 0; if( aLine.Len() > 1 && static_cast(aLine.GetChar( 0 )) == 0x1f ) { if( static_cast(aLine.GetChar( 1 )) == 0x8b ) // check for gzip @@ -1417,7 +1417,7 @@ String PPDParser::getSlot( int nSlot ) const if( nSlot > 0 && nSlot < m_pInputSlots->countValues() ) return m_pInputSlots->getValue( nSlot )->m_aOption; else if( m_pInputSlots->countValues() > 0 ) - return m_pInputSlots->getValue( (sal_uInt32)0 )->m_aOption; + return m_pInputSlots->getValue( (sal_uIntPtr)0 )->m_aOption; return String(); } @@ -1430,7 +1430,7 @@ String PPDParser::getSlotCommand( int nSlot ) const if( nSlot > 0 && nSlot < m_pInputSlots->countValues() ) return m_pInputSlots->getValue( nSlot )->m_aValue; else if( m_pInputSlots->countValues() > 0 ) - return m_pInputSlots->getValue( (sal_uInt32)0 )->m_aValue; + return m_pInputSlots->getValue( (sal_uIntPtr)0 )->m_aValue; return String(); } @@ -1457,7 +1457,7 @@ String PPDParser::getPaperDimension( int nPaperDimension ) const if( nPaperDimension > 0 && nPaperDimension < m_pPaperDimensions->countValues() ) return m_pPaperDimensions->getValue( nPaperDimension )->m_aOption; else if( m_pPaperDimensions->countValues() > 0 ) - return m_pPaperDimensions->getValue( (sal_uInt32)0 )->m_aOption; + return m_pPaperDimensions->getValue( (sal_uIntPtr)0 )->m_aOption; return String(); } @@ -1470,7 +1470,7 @@ String PPDParser::getPaperDimensionCommand( int nPaperDimension ) const if( nPaperDimension > 0 && nPaperDimension < m_pPaperDimensions->countValues() ) return m_pPaperDimensions->getValue( nPaperDimension )->m_aValue; else if( m_pPaperDimensions->countValues() > 0 ) - return m_pPaperDimensions->getValue( (sal_uInt32)0 )->m_aValue; + return m_pPaperDimensions->getValue( (sal_uIntPtr)0 )->m_aValue; return String(); } @@ -1578,7 +1578,7 @@ String PPDParser::getDuplex( int nDuplex ) const if( nDuplex > 0 && nDuplex < m_pDuplexTypes->countValues() ) return m_pDuplexTypes->getValue( nDuplex )->m_aOption; else if( m_pDuplexTypes->countValues() > 0 ) - return m_pDuplexTypes->getValue( (sal_uInt32)0 )->m_aOption; + return m_pDuplexTypes->getValue( (sal_uIntPtr)0 )->m_aOption; return String(); } @@ -1591,7 +1591,7 @@ String PPDParser::getDuplexCommand( int nDuplex ) const if( nDuplex > 0 && nDuplex < m_pDuplexTypes->countValues() ) return m_pDuplexTypes->getValue( nDuplex )->m_aValue; else if( m_pDuplexTypes->countValues() > 0 ) - return m_pDuplexTypes->getValue( (sal_uInt32)0 )->m_aValue; + return m_pDuplexTypes->getValue( (sal_uIntPtr)0 )->m_aValue; return String(); } @@ -2033,7 +2033,7 @@ void PPDContext::getUnconstrainedValues( const PPDKey* pKey, ::std::list< const // ------------------------------------------------------------------- -void* PPDContext::getStreamableBuffer( sal_uInt32& rBytes ) const +void* PPDContext::getStreamableBuffer( sal_uIntPtr& rBytes ) const { rBytes = 0; if( ! m_aCurrentValues.size() ) @@ -2079,7 +2079,7 @@ void* PPDContext::getStreamableBuffer( sal_uInt32& rBytes ) const // ------------------------------------------------------------------- -void PPDContext::rebuildFromStreamBuffer( void* pBuffer, sal_uInt32 nBytes ) +void PPDContext::rebuildFromStreamBuffer( void* pBuffer, sal_uIntPtr nBytes ) { if( ! m_pParser ) return; -- cgit From b7f5f44df674c7e47a8c1597bf082a8292b14efd Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Wed, 12 Jan 2011 15:07:10 +0100 Subject: removetooltypes01: Exchange misleading type sal_uIntPtr with sal_uLong --- vcl/unx/gtk/app/gtkdata.cxx | 4 ++-- vcl/unx/gtk/app/gtkinst.cxx | 6 +++--- vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 2 +- vcl/unx/gtk/window/gtkframe.cxx | 16 +++++++-------- vcl/unx/gtk/window/gtkobject.cxx | 2 +- vcl/unx/headless/svpdummies.cxx | 2 +- vcl/unx/headless/svpdummies.hxx | 2 +- vcl/unx/headless/svpframe.cxx | 4 ++-- vcl/unx/headless/svpframe.hxx | 6 +++--- vcl/unx/headless/svpgdi.cxx | 20 +++++++++---------- vcl/unx/headless/svpgdi.hxx | 16 +++++++-------- vcl/unx/headless/svpinst.cxx | 20 +++++++++---------- vcl/unx/headless/svpinst.hxx | 18 ++++++++--------- vcl/unx/headless/svpprn.cxx | 12 +++++------ vcl/unx/headless/svpprn.hxx | 14 ++++++------- vcl/unx/headless/svppspgraphics.cxx | 18 ++++++++--------- vcl/unx/headless/svppspgraphics.hxx | 16 +++++++-------- vcl/unx/headless/svptext.cxx | 6 +++--- vcl/unx/inc/plugins/gtk/gtkframe.hxx | 10 +++++----- vcl/unx/inc/plugins/gtk/gtkgdi.hxx | 2 +- vcl/unx/inc/plugins/gtk/gtkinst.hxx | 6 +++--- vcl/unx/inc/plugins/gtk/gtkobject.hxx | 2 +- vcl/unx/inc/plugins/kde/kdedata.hxx | 4 ++-- vcl/unx/inc/saldata.hxx | 4 ++-- vcl/unx/inc/saldisp.hxx | 12 +++++------ vcl/unx/kde/salnativewidgets-kde.cxx | 4 ++-- vcl/unx/source/app/i18n_status.cxx | 2 +- vcl/unx/source/app/salinst.cxx | 12 +++++------ vcl/unx/source/app/saltimer.cxx | 4 ++-- vcl/unx/source/gdi/gcach_xpeer.cxx | 6 +++--- vcl/unx/source/gdi/pspgraphics.cxx | 18 ++++++++--------- vcl/unx/source/gdi/salbmp.cxx | 18 ++++++++--------- vcl/unx/source/gdi/salgdi.cxx | 34 ++++++++++++++++---------------- vcl/unx/source/gdi/salgdi3.cxx | 4 ++-- vcl/unx/source/gdi/salprnpsp.cxx | 14 ++++++------- vcl/unx/source/printer/jobdata.cxx | 2 +- vcl/unx/source/printer/ppdparser.cxx | 18 ++++++++--------- vcl/unx/source/window/salframe.cxx | 10 +++++----- vcl/unx/source/window/salobj.cxx | 4 ++-- 39 files changed, 187 insertions(+), 187 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx index 104aa2e80dd3..36d475b8795b 100644 --- a/vcl/unx/gtk/app/gtkdata.cxx +++ b/vcl/unx/gtk/app/gtkdata.cxx @@ -527,7 +527,7 @@ public: YieldFunc handle ); virtual void Remove( int fd ); - virtual void StartTimer( sal_uIntPtr nMS ); + virtual void StartTimer( sal_uLong nMS ); virtual void StopTimer(); virtual void Wakeup(); virtual void PostUserEvent(); @@ -727,7 +727,7 @@ gboolean GtkXLib::timeoutFn(gpointer data) return FALSE; } -void GtkXLib::StartTimer( sal_uIntPtr nMS ) +void GtkXLib::StartTimer( sal_uLong nMS ) { m_nTimeoutMS = nMS; // for restarting diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx index df7ce072bde7..2b0e90dc9bc0 100644 --- a/vcl/unx/gtk/app/gtkinst.cxx +++ b/vcl/unx/gtk/app/gtkinst.cxx @@ -65,7 +65,7 @@ void GtkHookedYieldMutex::ThreadsEnter() acquire(); if( !aYieldStack.empty() ) { /* Previously called ThreadsLeave() */ - sal_uIntPtr nCount = aYieldStack.front(); + sal_uLong nCount = aYieldStack.front(); aYieldStack.pop_front(); while( nCount-- > 1 ) acquire(); @@ -188,12 +188,12 @@ GtkInstance::~GtkInstance() DeInitAtkBridge(); } -SalFrame* GtkInstance::CreateFrame( SalFrame* pParent, sal_uIntPtr nStyle ) +SalFrame* GtkInstance::CreateFrame( SalFrame* pParent, sal_uLong nStyle ) { return new GtkSalFrame( pParent, nStyle ); } -SalFrame* GtkInstance::CreateChildFrame( SystemParentData* pParentData, sal_uIntPtr ) +SalFrame* GtkInstance::CreateChildFrame( SystemParentData* pParentData, sal_uLong ) { SalFrame* pFrame = new GtkSalFrame( pParentData ); diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index dfb311fa9c8d..bb5326292a3c 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -479,7 +479,7 @@ void GtkSalGraphics::ResetClipRegion() X11SalGraphics::ResetClipRegion(); } -void GtkSalGraphics::BeginSetClipRegion( sal_uIntPtr nCount ) +void GtkSalGraphics::BeginSetClipRegion( sal_uLong nCount ) { m_aClipRegion.SetNull(); X11SalGraphics::BeginSetClipRegion( nCount ); diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index 4ef66f746b49..a164e9f658fc 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -392,7 +392,7 @@ GtkSalFrame::GraphicsHolder::~GraphicsHolder() delete pGraphics; } -GtkSalFrame::GtkSalFrame( SalFrame* pParent, sal_uIntPtr nStyle ) +GtkSalFrame::GtkSalFrame( SalFrame* pParent, sal_uLong nStyle ) { m_nScreen = getDisplay()->GetDefaultScreenNumber(); getDisplay()->registerFrame( this ); @@ -755,7 +755,7 @@ GtkSalFrame *GtkSalFrame::getFromWindow( GtkWindow *pWindow ) return (GtkSalFrame *) g_object_get_data( G_OBJECT( pWindow ), "SalFrame" ); } -void GtkSalFrame::Init( SalFrame* pParent, sal_uIntPtr nStyle ) +void GtkSalFrame::Init( SalFrame* pParent, sal_uLong nStyle ) { if( nStyle & SAL_FRAME_STYLE_DEFAULT ) // ensure default style { @@ -1043,7 +1043,7 @@ void GtkSalFrame::SetTitle( const String& rTitle ) } static inline sal_uInt8 * -getRow( BitmapBuffer *pBuffer, sal_uIntPtr nRow ) +getRow( BitmapBuffer *pBuffer, sal_uLong nRow ) { if( BMP_SCANLINE_ADJUSTMENT( pBuffer->mnFormat ) == BMP_FORMAT_TOP_DOWN ) return pBuffer->mpBits + nRow * pBuffer->mnScanlineSize; @@ -1602,7 +1602,7 @@ void GtkSalFrame::SetWindowState( const SalFrameState* pState ) if( ! m_pWindow || ! pState || isChild( true, false ) ) return; - const sal_uIntPtr nMaxGeometryMask = + const sal_uLong nMaxGeometryMask = SAL_FRAMESTATE_MASK_X | SAL_FRAMESTATE_MASK_Y | SAL_FRAMESTATE_MASK_WIDTH | SAL_FRAMESTATE_MASK_HEIGHT | SAL_FRAMESTATE_MASK_MAXIMIZED_X | SAL_FRAMESTATE_MASK_MAXIMIZED_Y | @@ -2462,7 +2462,7 @@ void GtkSalFrame::ResetClipRegion() gdk_window_shape_combine_region( m_pWindow->window, NULL, 0, 0 ); } -void GtkSalFrame::BeginSetClipRegion( sal_uIntPtr ) +void GtkSalFrame::BeginSetClipRegion( sal_uLong ) { if( m_pRegion ) gdk_region_destroy( m_pRegion ); @@ -2702,7 +2702,7 @@ gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEvent* pEvent, gpointer frame GtkSalFrame* pThis = (GtkSalFrame*)frame; GdkEventScroll* pSEvent = (GdkEventScroll*)pEvent; - static sal_uIntPtr nLines = 0; + static sal_uLong nLines = 0; if( ! nLines ) { char* pEnv = getenv( "SAL_WHEELLINES" ); @@ -2714,8 +2714,8 @@ gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEvent* pEvent, gpointer frame bool bNeg = (pSEvent->direction == GDK_SCROLL_DOWN || pSEvent->direction == GDK_SCROLL_RIGHT ); SalWheelMouseEvent aEvent; aEvent.mnTime = pSEvent->time; - aEvent.mnX = (sal_uIntPtr)pSEvent->x; - aEvent.mnY = (sal_uIntPtr)pSEvent->y; + aEvent.mnX = (sal_uLong)pSEvent->x; + aEvent.mnY = (sal_uLong)pSEvent->y; aEvent.mnDelta = bNeg ? -120 : 120; aEvent.mnNotchDelta = bNeg ? -1 : 1; aEvent.mnScrollLines = nLines; diff --git a/vcl/unx/gtk/window/gtkobject.cxx b/vcl/unx/gtk/window/gtkobject.cxx index 96648ce02d30..f7ef753dc628 100644 --- a/vcl/unx/gtk/window/gtkobject.cxx +++ b/vcl/unx/gtk/window/gtkobject.cxx @@ -109,7 +109,7 @@ sal_uInt16 GtkSalObject::GetClipRegionType() return SAL_OBJECT_CLIP_INCLUDERECTS; } -void GtkSalObject::BeginSetClipRegion( sal_uIntPtr ) +void GtkSalObject::BeginSetClipRegion( sal_uLong ) { if( m_pRegion ) gdk_region_destroy( m_pRegion ); diff --git a/vcl/unx/headless/svpdummies.cxx b/vcl/unx/headless/svpdummies.cxx index 6aed05bf135b..162b3c5f755c 100644 --- a/vcl/unx/headless/svpdummies.cxx +++ b/vcl/unx/headless/svpdummies.cxx @@ -51,7 +51,7 @@ SvpSalObject::~SvpSalObject() void SvpSalObject::ResetClipRegion() {} sal_uInt16 SvpSalObject::GetClipRegionType() { return 0; } -void SvpSalObject::BeginSetClipRegion( sal_uIntPtr ) {} +void SvpSalObject::BeginSetClipRegion( sal_uLong ) {} void SvpSalObject::UnionClipRegion( long, long, long, long ) {} void SvpSalObject::EndSetClipRegion() {} void SvpSalObject::SetPosSize( long, long, long, long ) {} diff --git a/vcl/unx/headless/svpdummies.hxx b/vcl/unx/headless/svpdummies.hxx index 48b3ffc5de19..a72ba11e5c12 100644 --- a/vcl/unx/headless/svpdummies.hxx +++ b/vcl/unx/headless/svpdummies.hxx @@ -45,7 +45,7 @@ public: // overload all pure virtual methods virtual void ResetClipRegion(); virtual sal_uInt16 GetClipRegionType(); - virtual void BeginSetClipRegion( sal_uIntPtr nRects ); + virtual void BeginSetClipRegion( sal_uLong nRects ); virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ); virtual void EndSetClipRegion(); diff --git a/vcl/unx/headless/svpframe.cxx b/vcl/unx/headless/svpframe.cxx index b4835dbcf133..9fb54cf29ef1 100644 --- a/vcl/unx/headless/svpframe.cxx +++ b/vcl/unx/headless/svpframe.cxx @@ -39,7 +39,7 @@ SvpSalFrame* SvpSalFrame::s_pFocusFrame = NULL; SvpSalFrame::SvpSalFrame( SvpSalInstance* pInstance, SalFrame* pParent, - sal_uIntPtr nSalFrameStyle, + sal_uLong nSalFrameStyle, SystemParentData* ) : m_pInstance( pInstance ), m_pParent( static_cast(pParent) ), @@ -435,7 +435,7 @@ void SvpSalFrame::ResetClipRegion() { } -void SvpSalFrame::BeginSetClipRegion( sal_uIntPtr ) +void SvpSalFrame::BeginSetClipRegion( sal_uLong ) { } diff --git a/vcl/unx/headless/svpframe.hxx b/vcl/unx/headless/svpframe.hxx index 37a9a02cde4e..af40fb66fb7f 100644 --- a/vcl/unx/headless/svpframe.hxx +++ b/vcl/unx/headless/svpframe.hxx @@ -42,7 +42,7 @@ class SvpSalFrame : public SalFrame, public SvpElement SvpSalInstance* m_pInstance; SvpSalFrame* m_pParent; // pointer to parent frame std::list< SvpSalFrame* > m_aChildren; // List of child frames - sal_uIntPtr m_nStyle; + sal_uLong m_nStyle; bool m_bVisible; long m_nMinWidth; long m_nMinHeight; @@ -58,7 +58,7 @@ class SvpSalFrame : public SalFrame, public SvpElement public: SvpSalFrame( SvpSalInstance* pInstance, SalFrame* pParent, - sal_uIntPtr nSalFrameStyle, + sal_uLong nSalFrameStyle, SystemParentData* pSystemParent = NULL ); virtual ~SvpSalFrame(); @@ -116,7 +116,7 @@ public: virtual bool SetPluginParent( SystemParentData* pNewParent ); virtual void SetBackgroundBitmap( SalBitmap* pBitmap ); virtual void ResetClipRegion(); - virtual void BeginSetClipRegion( sal_uIntPtr nRects ); + virtual void BeginSetClipRegion( sal_uLong nRects ); virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ); virtual void EndSetClipRegion(); diff --git a/vcl/unx/headless/svpgdi.cxx b/vcl/unx/headless/svpgdi.cxx index 5485347213f3..95ce1bb45a1d 100644 --- a/vcl/unx/headless/svpgdi.cxx +++ b/vcl/unx/headless/svpgdi.cxx @@ -152,7 +152,7 @@ void SvpSalGraphics::ResetClipRegion() m_aClipMap.reset(); } -void SvpSalGraphics::BeginSetClipRegion( sal_uIntPtr n ) +void SvpSalGraphics::BeginSetClipRegion( sal_uLong n ) { if( n <= 1 ) { @@ -309,13 +309,13 @@ void SvpSalGraphics::drawRect( long nX, long nY, long nWidth, long nHeight ) dbgOut( m_aDevice ); } -void SvpSalGraphics::drawPolyLine( sal_uIntPtr nPoints, const SalPoint* pPtAry ) +void SvpSalGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry ) { if( m_bUseLineColor && nPoints ) { B2DPolygon aPoly; aPoly.append( B2DPoint( pPtAry->mnX, pPtAry->mnY ), nPoints ); - for( sal_uIntPtr i = 1; i < nPoints; i++ ) + for( sal_uLong i = 1; i < nPoints; i++ ) aPoly.setB2DPoint( i, B2DPoint( pPtAry[i].mnX, pPtAry[i].mnY ) ); aPoly.setClosed( false ); m_aDevice->drawPolygon( aPoly, m_aLineColor, m_aDrawMode, m_aClipMap ); @@ -323,13 +323,13 @@ void SvpSalGraphics::drawPolyLine( sal_uIntPtr nPoints, const SalPoint* pPtAry ) dbgOut( m_aDevice ); } -void SvpSalGraphics::drawPolygon( sal_uIntPtr nPoints, const SalPoint* pPtAry ) +void SvpSalGraphics::drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry ) { if( ( m_bUseLineColor || m_bUseFillColor ) && nPoints ) { B2DPolygon aPoly; aPoly.append( B2DPoint( pPtAry->mnX, pPtAry->mnY ), nPoints ); - for( sal_uIntPtr i = 1; i < nPoints; i++ ) + for( sal_uLong i = 1; i < nPoints; i++ ) aPoly.setB2DPoint( i, B2DPoint( pPtAry[i].mnX, pPtAry[i].mnY ) ); if( m_bUseFillColor ) { @@ -388,14 +388,14 @@ bool SvpSalGraphics::drawPolyLine( const ::basegfx::B2DPolygon&, double /*fTrans return false; } -sal_Bool SvpSalGraphics::drawPolyLineBezier( sal_uIntPtr, +sal_Bool SvpSalGraphics::drawPolyLineBezier( sal_uLong, const SalPoint*, const sal_uInt8* ) { return sal_False; } -sal_Bool SvpSalGraphics::drawPolygonBezier( sal_uIntPtr, +sal_Bool SvpSalGraphics::drawPolygonBezier( sal_uLong, const SalPoint*, const sal_uInt8* ) { @@ -538,19 +538,19 @@ void SvpSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalInv dbgOut( m_aDevice ); } -void SvpSalGraphics::invert( sal_uIntPtr nPoints, const SalPoint* pPtAry, SalInvert /*nFlags*/ ) +void SvpSalGraphics::invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert /*nFlags*/ ) { // FIXME: handle SAL_INVERT_50 and SAL_INVERT_TRACKFRAME B2DPolygon aPoly; aPoly.append( B2DPoint( pPtAry->mnX, pPtAry->mnY ), nPoints ); - for( sal_uIntPtr i = 1; i < nPoints; i++ ) + for( sal_uLong i = 1; i < nPoints; i++ ) aPoly.setB2DPoint( i, B2DPoint( pPtAry[i].mnX, pPtAry[i].mnY ) ); aPoly.setClosed( true ); m_aDevice->fillPolyPolygon( B2DPolyPolygon(aPoly), basebmp::Color( 0xffffff ), DrawMode_XOR, m_aClipMap ); dbgOut( m_aDevice ); } -sal_Bool SvpSalGraphics::drawEPS( long, long, long, long, void*, sal_uIntPtr ) +sal_Bool SvpSalGraphics::drawEPS( long, long, long, long, void*, sal_uLong ) { return sal_False; } diff --git a/vcl/unx/headless/svpgdi.hxx b/vcl/unx/headless/svpgdi.hxx index 2510d505f6b1..a7486a55198f 100644 --- a/vcl/unx/headless/svpgdi.hxx +++ b/vcl/unx/headless/svpgdi.hxx @@ -68,7 +68,7 @@ public: virtual long GetGraphicsWidth() const; virtual void ResetClipRegion(); - virtual void BeginSetClipRegion( sal_uIntPtr nCount ); + virtual void BeginSetClipRegion( sal_uLong nCount ); virtual sal_Bool unionClipRegion( long nX, long nY, long nWidth, long nHeight ); virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& ); virtual void EndSetClipRegion(); @@ -87,7 +87,7 @@ public: virtual void SetTextColor( SalColor nSalColor ); virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel ); virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); - virtual sal_uIntPtr GetKernPairs( sal_uIntPtr nPairs, ImplKernPairData* pKernPairs ); + virtual sal_uLong GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs ); virtual const ImplFontCharMap* GetImplFontCharMap() const; virtual void GetDevFontList( ImplDevFontList* ); virtual void GetDevFontSubstList( OutputDevice* ); @@ -122,15 +122,15 @@ public: virtual void drawRect( long nX, long nY, long nWidth, long nHeight ); virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ); virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ); - virtual void drawPolyLine( sal_uIntPtr nPoints, const SalPoint* pPtAry ); - virtual void drawPolygon( sal_uIntPtr nPoints, const SalPoint* pPtAry ); + virtual void drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry ); + virtual void drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry ); virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ); - virtual sal_Bool drawPolyLineBezier( sal_uIntPtr nPoints, + virtual sal_Bool drawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ); - virtual sal_Bool drawPolygonBezier( sal_uIntPtr nPoints, + virtual sal_Bool drawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ); virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly, @@ -161,9 +161,9 @@ public: virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight ); virtual SalColor getPixel( long nX, long nY ); virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags ); - virtual void invert( sal_uIntPtr nPoints, const SalPoint* pPtAry, SalInvert nFlags ); + virtual void invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags ); - virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uIntPtr nSize ); + virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize ); virtual SystemGraphicsData GetGraphicsData() const; virtual SystemFontData GetSysFontData( int nFallbacklevel ) const; diff --git a/vcl/unx/headless/svpinst.cxx b/vcl/unx/headless/svpinst.cxx index b6665550563d..f9ac7e7e2a1e 100644 --- a/vcl/unx/headless/svpinst.cxx +++ b/vcl/unx/headless/svpinst.cxx @@ -192,7 +192,7 @@ inline int operator >= ( const timeval &t1, const timeval &t2 ) return t1.tv_usec >= t2.tv_usec; return t1.tv_sec > t2.tv_sec; } -inline timeval &operator += ( timeval &t1, sal_uIntPtr t2 ) +inline timeval &operator += ( timeval &t1, sal_uLong t2 ) { t1.tv_sec += t2 / 1000; t1.tv_usec += t2 ? (t2 % 1000) * 1000 : 500; @@ -235,12 +235,12 @@ bool SvpSalInstance::CheckTimeout( bool bExecuteTimers ) return bRet; } -SalFrame* SvpSalInstance::CreateChildFrame( SystemParentData* pParent, sal_uIntPtr nStyle ) +SalFrame* SvpSalInstance::CreateChildFrame( SystemParentData* pParent, sal_uLong nStyle ) { return new SvpSalFrame( this, NULL, nStyle, pParent ); } -SalFrame* SvpSalInstance::CreateFrame( SalFrame* pParent, sal_uIntPtr nStyle ) +SalFrame* SvpSalInstance::CreateFrame( SalFrame* pParent, sal_uLong nStyle ) { return new SvpSalFrame( this, pParent, nStyle ); } @@ -299,13 +299,13 @@ vos::IMutex* SvpSalInstance::GetYieldMutex() return &m_aYieldMutex; } -sal_uIntPtr SvpSalInstance::ReleaseYieldMutex() +sal_uLong SvpSalInstance::ReleaseYieldMutex() { if ( m_aYieldMutex.GetThreadId() == vos::OThread::getCurrentIdentifier() ) { - sal_uIntPtr nCount = m_aYieldMutex.GetAcquireCount(); - sal_uIntPtr n = nCount; + sal_uLong nCount = m_aYieldMutex.GetAcquireCount(); + sal_uLong n = nCount; while ( n ) { m_aYieldMutex.release(); @@ -318,7 +318,7 @@ sal_uIntPtr SvpSalInstance::ReleaseYieldMutex() return 0; } -void SvpSalInstance::AcquireYieldMutex( sal_uIntPtr nCount ) +void SvpSalInstance::AcquireYieldMutex( sal_uLong nCount ) { while ( nCount ) { @@ -346,7 +346,7 @@ void SvpSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents ) // release yield mutex std::list< SalUserEvent > aEvents; - sal_uIntPtr nAcquireCount = ReleaseYieldMutex(); + sal_uLong nAcquireCount = ReleaseYieldMutex(); if( osl_acquireMutex( m_aEventGuard ) ) { if( ! m_aUserEvents.empty() ) @@ -497,7 +497,7 @@ void SvpSalInstance::StopTimer() m_nTimeoutMS = 0; } -void SvpSalInstance::StartTimer( sal_uIntPtr nMS ) +void SvpSalInstance::StartTimer( sal_uLong nMS ) { timeval Timeout (m_aTimeout); // previous timeout. gettimeofday (&m_aTimeout, 0); @@ -525,7 +525,7 @@ void SvpSalTimer::Stop() m_pInstance->StopTimer(); } -void SvpSalTimer::Start( sal_uIntPtr nMS ) +void SvpSalTimer::Start( sal_uLong nMS ) { m_pInstance->StartTimer( nMS ); } diff --git a/vcl/unx/headless/svpinst.hxx b/vcl/unx/headless/svpinst.hxx index 05f3c01f5bb5..736916bbaced 100644 --- a/vcl/unx/headless/svpinst.hxx +++ b/vcl/unx/headless/svpinst.hxx @@ -49,7 +49,7 @@ class SvpSalYieldMutex : public vos::OMutex { protected: - sal_uIntPtr mnCount; + sal_uLong mnCount; vos::OThread::TThreadIdentifier mnThreadId; public: @@ -59,7 +59,7 @@ public: virtual void release(); virtual sal_Bool tryToAcquire(); - sal_uIntPtr GetAcquireCount() const { return mnCount; } + sal_uLong GetAcquireCount() const { return mnCount; } vos::OThread::TThreadIdentifier GetThreadId() const { return mnThreadId; } }; @@ -75,7 +75,7 @@ public: virtual ~SvpSalTimer(); // overload all pure virtual methods - virtual void Start( sal_uIntPtr nMS ); + virtual void Start( sal_uLong nMS ); virtual void Stop(); }; @@ -86,7 +86,7 @@ class SvpSalFrame; class SvpSalInstance : public SalInstance { timeval m_aTimeout; - sal_uIntPtr m_nTimeoutMS; + sal_uLong m_nTimeoutMS; int m_pTimeoutFDS[2]; SvpSalYieldMutex m_aYieldMutex; @@ -120,7 +120,7 @@ public: void PostEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent ); void CancelEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent ); - void StartTimer( sal_uIntPtr nMS ); + void StartTimer( sal_uLong nMS ); void StopTimer(); void Wakeup(); @@ -131,8 +131,8 @@ public: bool CheckTimeout( bool bExecuteTimers = true ); // Frame - virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uIntPtr nStyle ); - virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uIntPtr nStyle ); + virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uLong nStyle ); + virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle ); virtual void DestroyFrame( SalFrame* pFrame ); // Object (System Child Window) @@ -174,8 +174,8 @@ public: // YieldMutex virtual vos::IMutex* GetYieldMutex(); - virtual sal_uIntPtr ReleaseYieldMutex(); - virtual void AcquireYieldMutex( sal_uIntPtr nCount ); + virtual sal_uLong ReleaseYieldMutex(); + virtual void AcquireYieldMutex( sal_uLong nCount ); virtual bool CheckYieldMutex(); // wait next event and dispatch diff --git a/vcl/unx/headless/svpprn.cxx b/vcl/unx/headless/svpprn.cxx index a81f894e4505..0c8a119806af 100644 --- a/vcl/unx/headless/svpprn.cxx +++ b/vcl/unx/headless/svpprn.cxx @@ -558,7 +558,7 @@ sal_Bool PspSalInfoPrinter::SetPrinterData( ImplJobSetup* pJobSetup ) // Only the data must be changed, where the bit // in nGetDataFlags is set sal_Bool PspSalInfoPrinter::SetData( - sal_uIntPtr nSetDataFlags, + sal_uLong nSetDataFlags, ImplJobSetup* pJobSetup ) { JobData aData; @@ -707,7 +707,7 @@ void PspSalInfoPrinter::GetPageInfo( // ----------------------------------------------------------------------- -sal_uIntPtr PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup ) +sal_uLong PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup ) { if( ! pJobSetup ) return 0; @@ -721,7 +721,7 @@ sal_uIntPtr PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup ) // ----------------------------------------------------------------------- -String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, sal_uIntPtr nPaperBin ) +String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, sal_uLong nPaperBin ) { JobData aData; JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData ); @@ -745,7 +745,7 @@ String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, sal_uI // ----------------------------------------------------------------------- -sal_uIntPtr PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, sal_uInt16 nType ) +sal_uLong PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, sal_uInt16 nType ) { switch( nType ) { @@ -845,7 +845,7 @@ sal_Bool PspSalPrinter::StartJob( const XubString* pFileName, const XubString& rJobName, const XubString& rAppName, - sal_uIntPtr nCopies, + sal_uLong nCopies, bool bCollate, bool /*bDirect*/, ImplJobSetup* pJobSetup ) @@ -990,7 +990,7 @@ sal_Bool PspSalPrinter::EndPage() // ----------------------------------------------------------------------- -sal_uIntPtr PspSalPrinter::GetErrorCode() +sal_uLong PspSalPrinter::GetErrorCode() { return 0; } diff --git a/vcl/unx/headless/svpprn.hxx b/vcl/unx/headless/svpprn.hxx index 8c7372115cde..84dbf8277054 100644 --- a/vcl/unx/headless/svpprn.hxx +++ b/vcl/unx/headless/svpprn.hxx @@ -50,14 +50,14 @@ public: virtual void ReleaseGraphics( SalGraphics* pGraphics ); virtual sal_Bool Setup( SalFrame* pFrame, ImplJobSetup* pSetupData ); virtual sal_Bool SetPrinterData( ImplJobSetup* pSetupData ); - virtual sal_Bool SetData( sal_uIntPtr nFlags, ImplJobSetup* pSetupData ); + virtual sal_Bool SetData( sal_uLong nFlags, ImplJobSetup* pSetupData ); virtual void GetPageInfo( const ImplJobSetup* pSetupData, long& rOutWidth, long& rOutHeight, long& rPageOffX, long& rPageOffY, long& rPageWidth, long& rPageHeight ); - virtual sal_uIntPtr GetCapabilities( const ImplJobSetup* pSetupData, sal_uInt16 nType ); - virtual sal_uIntPtr GetPaperBinCount( const ImplJobSetup* pSetupData ); - virtual String GetPaperBinName( const ImplJobSetup* pSetupData, sal_uIntPtr nPaperBin ); + virtual sal_uLong GetCapabilities( const ImplJobSetup* pSetupData, sal_uInt16 nType ); + virtual sal_uLong GetPaperBinCount( const ImplJobSetup* pSetupData ); + virtual String GetPaperBinName( const ImplJobSetup* pSetupData, sal_uLong nPaperBin ); virtual void InitPaperFormats( const ImplJobSetup* pSetupData ); virtual int GetLandscapeAngle( const ImplJobSetup* pSetupData ); }; @@ -75,7 +75,7 @@ public: psp::PrinterJob m_aPrintJob; psp::JobData m_aJobData; psp::PrinterGfx m_aPrinterGfx; - sal_uIntPtr m_nCopies; + sal_uLong m_nCopies; bool m_bCollate; SalInfoPrinter* m_pInfoPrinter; @@ -87,7 +87,7 @@ public: virtual sal_Bool StartJob( const XubString* pFileName, const XubString& rJobName, const XubString& rAppName, - sal_uIntPtr nCopies, + sal_uLong nCopies, bool bCollate, bool bDirect, ImplJobSetup* pSetupData ); @@ -95,7 +95,7 @@ public: virtual sal_Bool AbortJob(); virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, sal_Bool bNewJobData ); virtual sal_Bool EndPage(); - virtual sal_uIntPtr GetErrorCode(); + virtual sal_uLong GetErrorCode(); }; class Timer; diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx index fe9a883fa583..fda458c5c73e 100644 --- a/vcl/unx/headless/svppspgraphics.cxx +++ b/vcl/unx/headless/svppspgraphics.cxx @@ -219,7 +219,7 @@ void PspGraphics::ResetClipRegion() m_pPrinterGfx->ResetClipRegion (); } -void PspGraphics::BeginSetClipRegion( sal_uIntPtr n ) +void PspGraphics::BeginSetClipRegion( sal_uLong n ) { m_pPrinterGfx->BeginSetClipRegion(n); } @@ -305,12 +305,12 @@ void PspGraphics::drawRect( long nX, long nY, long nDX, long nDY ) m_pPrinterGfx->DrawRect (Rectangle(Point(nX, nY), Size(nDX, nDY))); } -void PspGraphics::drawPolyLine( sal_uIntPtr nPoints, const SalPoint *pPtAry ) +void PspGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint *pPtAry ) { m_pPrinterGfx->DrawPolyLine (nPoints, (Point*)pPtAry); } -void PspGraphics::drawPolygon( sal_uIntPtr nPoints, const SalPoint* pPtAry ) +void PspGraphics::drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry ) { // Point must be equal to SalPoint! see vcl/inc/salgtype.hxx m_pPrinterGfx->DrawPolygon (nPoints, (Point*)pPtAry); @@ -329,13 +329,13 @@ bool PspGraphics::drawPolyLine( const ::basegfx::B2DPolygon&, double /*fTranspar return false; } -sal_Bool PspGraphics::drawPolyLineBezier( sal_uIntPtr nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ) +sal_Bool PspGraphics::drawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ) { m_pPrinterGfx->DrawPolyLineBezier (nPoints, (Point*)pPtAry, pFlgAry); return sal_True; } -sal_Bool PspGraphics::drawPolygonBezier( sal_uIntPtr nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ) +sal_Bool PspGraphics::drawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ) { m_pPrinterGfx->DrawPolygonBezier (nPoints, (Point*)pPtAry, pFlgAry); return sal_True; @@ -357,13 +357,13 @@ bool PspGraphics::drawPolyPolygon( const basegfx::B2DPolyPolygon&, double /*fTra return false; } -void PspGraphics::invert( sal_uIntPtr /*nPoints*/, +void PspGraphics::invert( sal_uLong /*nPoints*/, const SalPoint* /*pPtAry*/, SalInvert /*nFlags*/ ) { DBG_ASSERT( 0, "Error: PrinterGfx::Invert() not implemented" ); } -sal_Bool PspGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uIntPtr nSize ) +sal_Bool PspGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize ) { return m_pPrinterGfx->DrawEPS( Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) ), pPtr, nSize ); } @@ -817,10 +817,10 @@ void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric, int ) } } -sal_uInt32 PspGraphics::GetKernPairs( sal_uIntPtr nPairs, ImplKernPairData *pKernPairs ) +sal_uInt32 PspGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData *pKernPairs ) { const ::std::list< ::psp::KernPair >& rPairs( m_pPrinterGfx->getKernPairs() ); - sal_uIntPtr nHavePairs = rPairs.size(); + sal_uLong nHavePairs = rPairs.size(); if( pKernPairs && nPairs ) { ::std::list< ::psp::KernPair >::const_iterator it; diff --git a/vcl/unx/headless/svppspgraphics.hxx b/vcl/unx/headless/svppspgraphics.hxx index ee6f5bc25570..fe9352c1fd8b 100644 --- a/vcl/unx/headless/svppspgraphics.hxx +++ b/vcl/unx/headless/svppspgraphics.hxx @@ -90,7 +90,7 @@ public: virtual long GetGraphicsWidth() const; virtual void ResetClipRegion(); - virtual void BeginSetClipRegion( sal_uIntPtr nCount ); + virtual void BeginSetClipRegion( sal_uLong nCount ); virtual sal_Bool unionClipRegion( long nX, long nY, long nWidth, long nHeight ); virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& ); virtual void EndSetClipRegion(); @@ -106,7 +106,7 @@ public: virtual void SetTextColor( SalColor nSalColor ); virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel ); virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); - virtual sal_uIntPtr GetKernPairs( sal_uIntPtr nPairs, ImplKernPairData* pKernPairs ); + virtual sal_uLong GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs ); virtual const ImplFontCharMap* GetImplFontCharMap() const; virtual void GetDevFontList( ImplDevFontList* ); virtual void GetDevFontSubstList( OutputDevice* ); @@ -139,17 +139,17 @@ public: virtual void drawPixel( long nX, long nY, SalColor nSalColor ); virtual void drawLine( long nX1, long nY1, long nX2, long nY2 ); virtual void drawRect( long nX, long nY, long nWidth, long nHeight ); - virtual void drawPolyLine( sal_uIntPtr nPoints, const SalPoint* pPtAry ); - virtual void drawPolygon( sal_uIntPtr nPoints, const SalPoint* pPtAry ); + virtual void drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry ); + virtual void drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry ); virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ); virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ); virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ); - virtual sal_Bool drawPolyLineBezier( sal_uIntPtr nPoints, + virtual sal_Bool drawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ); - virtual sal_Bool drawPolygonBezier( sal_uIntPtr nPoints, + virtual sal_Bool drawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ); virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly, @@ -180,9 +180,9 @@ public: virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight ); virtual SalColor getPixel( long nX, long nY ); virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags ); - virtual void invert( sal_uIntPtr nPoints, const SalPoint* pPtAry, SalInvert nFlags ); + virtual void invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags ); - virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uIntPtr nSize ); + virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize ); virtual bool filterText( const String& rOrigText, String& rNewText, xub_StrLen nIndex, xub_StrLen& rLen, xub_StrLen& rCutStart, xub_StrLen& rCutStop ); virtual SystemGraphicsData GetGraphicsData() const; diff --git a/vcl/unx/headless/svptext.cxx b/vcl/unx/headless/svptext.cxx index dbe1b2c4dc32..fba7fe4bf31d 100644 --- a/vcl/unx/headless/svptext.cxx +++ b/vcl/unx/headless/svptext.cxx @@ -254,15 +254,15 @@ void SvpSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLe // --------------------------------------------------------------------------- -sal_uIntPtr SvpSalGraphics::GetKernPairs( sal_uIntPtr nPairs, ImplKernPairData* pKernPairs ) +sal_uLong SvpSalGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs ) { - sal_uIntPtr nGotPairs = 0; + sal_uLong nGotPairs = 0; if( m_pServerFont[0] != NULL ) { ImplKernPairData* pTmpKernPairs = NULL; nGotPairs = m_pServerFont[0]->GetKernPairs( &pTmpKernPairs ); - for( sal_uIntPtr i = 0; i < nPairs && i < nGotPairs; ++i ) + for( sal_uLong i = 0; i < nPairs && i < nGotPairs; ++i ) pKernPairs[ i ] = pTmpKernPairs[ i ]; delete[] pTmpKernPairs; } diff --git a/vcl/unx/inc/plugins/gtk/gtkframe.hxx b/vcl/unx/inc/plugins/gtk/gtkframe.hxx index 528b08925ad4..1ddc9e24e4f1 100644 --- a/vcl/unx/inc/plugins/gtk/gtkframe.hxx +++ b/vcl/unx/inc/plugins/gtk/gtkframe.hxx @@ -167,7 +167,7 @@ class GtkSalFrame : public SalFrame GdkWindow* m_pForeignTopLevel; GdkNativeWindow m_aForeignTopLevelWindow; Pixmap m_hBackgroundPixmap; - sal_uIntPtr m_nStyle; + sal_uLong m_nStyle; SalExtStyle m_nExtStyle; GtkFixed* m_pFixedContainer; GtkSalFrame* m_pParent; @@ -199,7 +199,7 @@ class GtkSalFrame : public SalFrame GdkRegion* m_pRegion; - void Init( SalFrame* pParent, sal_uIntPtr nStyle ); + void Init( SalFrame* pParent, sal_uLong nStyle ); void Init( SystemParentData* pSysData ); void InitCommon(); @@ -251,7 +251,7 @@ class GtkSalFrame : public SalFrame bool isChild( bool bPlug = true, bool bSysChild = true ) { - sal_uIntPtr nMask = 0; + sal_uLong nMask = 0; if( bPlug ) nMask |= SAL_FRAME_STYLE_PLUG; if( bSysChild ) @@ -270,7 +270,7 @@ class GtkSalFrame : public SalFrame DECL_LINK( ImplDelayedFullScreenHdl, void* ); public: - GtkSalFrame( SalFrame* pParent, sal_uIntPtr nStyle ); + GtkSalFrame( SalFrame* pParent, sal_uLong nStyle ); GtkSalFrame( SystemParentData* pSysData ); // dispatches an event, returns true if dispatched @@ -386,7 +386,7 @@ public: // set clip region to none (-> rectangular windows, normal state) virtual void ResetClipRegion(); // start setting the clipregion consisting of nRects rectangles - virtual void BeginSetClipRegion( sal_uIntPtr nRects ); + virtual void BeginSetClipRegion( sal_uLong nRects ); // add a rectangle to the clip region virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ); // done setting up the clipregion diff --git a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx index 57e36ca5a2ed..0b4439e6881f 100644 --- a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx +++ b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx @@ -79,7 +79,7 @@ public: void updateSettings( AllSettings& rSettings ); virtual void ResetClipRegion(); - virtual void BeginSetClipRegion( sal_uIntPtr nCount ); + virtual void BeginSetClipRegion( sal_uLong nCount ); virtual sal_Bool unionClipRegion( long nX, long nY, long nWidth, long nHeight ); virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& ); virtual void EndSetClipRegion(); diff --git a/vcl/unx/inc/plugins/gtk/gtkinst.hxx b/vcl/unx/inc/plugins/gtk/gtkinst.hxx index 58c485ce6e20..a9f788831199 100644 --- a/vcl/unx/inc/plugins/gtk/gtkinst.hxx +++ b/vcl/unx/inc/plugins/gtk/gtkinst.hxx @@ -63,7 +63,7 @@ class GtkHookedYieldMutex : public GtkYieldMutex { virtual int Grab() { return 0; }; virtual void Ungrab(int ) {}; - std::list aYieldStack; + std::list aYieldStack; public: GtkHookedYieldMutex(); virtual void acquire(); @@ -84,8 +84,8 @@ public: {} virtual ~GtkInstance(); - virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uIntPtr nStyle ); - virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uIntPtr nStyle ); + virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle ); + virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uLong nStyle ); virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True ); virtual SalSystem* CreateSalSystem(); virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType); diff --git a/vcl/unx/inc/plugins/gtk/gtkobject.hxx b/vcl/unx/inc/plugins/gtk/gtkobject.hxx index fdba1bb9fd38..67434f038617 100644 --- a/vcl/unx/inc/plugins/gtk/gtkobject.hxx +++ b/vcl/unx/inc/plugins/gtk/gtkobject.hxx @@ -50,7 +50,7 @@ public: // overload all pure virtual methods virtual void ResetClipRegion(); virtual sal_uInt16 GetClipRegionType(); - virtual void BeginSetClipRegion( sal_uIntPtr nRects ); + virtual void BeginSetClipRegion( sal_uLong nRects ); virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ); virtual void EndSetClipRegion(); diff --git a/vcl/unx/inc/plugins/kde/kdedata.hxx b/vcl/unx/inc/plugins/kde/kdedata.hxx index e31c4b7cc8e7..210799493638 100644 --- a/vcl/unx/inc/plugins/kde/kdedata.hxx +++ b/vcl/unx/inc/plugins/kde/kdedata.hxx @@ -67,7 +67,7 @@ class KDESalFrame : public X11SalFrame GraphicsHolder m_aGraphics[ nMaxGraphics ]; public: - KDESalFrame( SalFrame* pParent, sal_uIntPtr ); + KDESalFrame( SalFrame* pParent, sal_uLong ); virtual ~KDESalFrame(); virtual SalGraphics* GetGraphics(); @@ -83,7 +83,7 @@ public: KDESalInstance( SalYieldMutex* pMutex ) : X11SalInstance( pMutex ) {} virtual ~KDESalInstance() {} - virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uIntPtr nStyle ); + virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle ); }; class KDEXLib : public SalXLib diff --git a/vcl/unx/inc/saldata.hxx b/vcl/unx/inc/saldata.hxx index 34180474e256..42240237a5ec 100644 --- a/vcl/unx/inc/saldata.hxx +++ b/vcl/unx/inc/saldata.hxx @@ -85,7 +85,7 @@ public: inline SalXLib* GetLib() const { return pXLib_; } inline pthread_t GetMainThread() const { return hMainThread_; } - void StartTimer( sal_uIntPtr nMS ); + void StartTimer( sal_uLong nMS ); inline void StopTimer(); void Timeout() const; @@ -114,7 +114,7 @@ inline void X11SalData::XError( Display *pDisplay, XErrorEvent *pEvent ) const class YieldMutexReleaser { - sal_uIntPtr m_nYieldCount; + sal_uLong m_nYieldCount; public: inline YieldMutexReleaser(); inline ~YieldMutexReleaser(); diff --git a/vcl/unx/inc/saldisp.hxx b/vcl/unx/inc/saldisp.hxx index 2c35ce4445ed..2b2f6ff6f3d7 100644 --- a/vcl/unx/inc/saldisp.hxx +++ b/vcl/unx/inc/saldisp.hxx @@ -212,7 +212,7 @@ class VCL_DLLPUBLIC SalXLib { protected: timeval m_aTimeout; - sal_uIntPtr m_nTimeoutMS; + sal_uLong m_nTimeoutMS; int m_pTimeoutFDS[2]; bool m_bHaveSystemChildFrames; @@ -254,7 +254,7 @@ public: void PushXErrorLevel( bool bIgnore ); void PopXErrorLevel(); - virtual void StartTimer( sal_uIntPtr nMS ); + virtual void StartTimer( sal_uLong nMS ); virtual void StopTimer(); bool CheckTimeout( bool bExecuteTimers = true ); @@ -358,11 +358,11 @@ protected: ScreenData m_aInvalidScreenData; Pair aResolution_; // [dpi] bool mbExactResolution; - sal_uIntPtr nMaxRequestSize_; // [byte] + sal_uLong nMaxRequestSize_; // [byte] srv_vendor_t meServerVendor; SalWM eWindowManager_; - sal_uIntPtr nProperties_; // PROPERTY_SUPPORT, BUG, FEATURE + sal_uLong nProperties_; // PROPERTY_SUPPORT, BUG, FEATURE sal_Bool bLocal_; // Server==Client? Init // in SalDisplay::IsLocal() sal_Bool mbLocalIsValid; // bLocal_ is valid ? @@ -493,8 +493,8 @@ public: RenderEntryMap& GetRenderEntries( int nScreen ) const { return getDataForScreen(nScreen).m_aRenderData; } const Pair &GetResolution() const { return aResolution_; } bool GetExactResolution() const { return mbExactResolution; } - sal_uIntPtr GetProperties() const { return nProperties_; } - sal_uIntPtr GetMaxRequestSize() const { return nMaxRequestSize_; } + sal_uLong GetProperties() const { return nProperties_; } + sal_uLong GetMaxRequestSize() const { return nMaxRequestSize_; } XLIB_Time GetLastUserEventTime( bool bAlwaysReget = false ) const; bool XIfEventWithTimeout( XEvent*, XPointer, X_if_predicate, long i_nTimeout = 1000 ) const; diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx index 9d3dd511de19..30cbb0cea365 100644 --- a/vcl/unx/kde/salnativewidgets-kde.cxx +++ b/vcl/unx/kde/salnativewidgets-kde.cxx @@ -1710,7 +1710,7 @@ sal_Bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart // KDESalFrame implementation // ----------------------------------------------------------------------- -KDESalFrame::KDESalFrame( SalFrame* pParent, sal_uIntPtr nStyle ) : +KDESalFrame::KDESalFrame( SalFrame* pParent, sal_uLong nStyle ) : X11SalFrame( pParent, nStyle ) { } @@ -2083,7 +2083,7 @@ KDESalFrame::GraphicsHolder::~GraphicsHolder() // ----------------------------------------------------------------------- SalFrame * -KDESalInstance::CreateFrame( SalFrame *pParent, sal_uIntPtr nStyle ) +KDESalInstance::CreateFrame( SalFrame *pParent, sal_uLong nStyle ) { return new KDESalFrame( pParent, nStyle ); } diff --git a/vcl/unx/source/app/i18n_status.cxx b/vcl/unx/source/app/i18n_status.cxx index 594cdf9c89de..844775779935 100644 --- a/vcl/unx/source/app/i18n_status.cxx +++ b/vcl/unx/source/app/i18n_status.cxx @@ -102,7 +102,7 @@ class XIMStatusWindow : public StatusWindow // for delayed showing bool m_bDelayedShow; I18NStatus::ShowReason m_eDelayedReason; - sal_uIntPtr m_nDelayedEvent; + sal_uLong m_nDelayedEvent; // for toggling bool m_bOn; diff --git a/vcl/unx/source/app/salinst.cxx b/vcl/unx/source/app/salinst.cxx index 431367deeef1..b67988605673 100644 --- a/vcl/unx/source/app/salinst.cxx +++ b/vcl/unx/source/app/salinst.cxx @@ -227,14 +227,14 @@ vos::IMutex* X11SalInstance::GetYieldMutex() // ----------------------------------------------------------------------- -sal_uIntPtr X11SalInstance::ReleaseYieldMutex() +sal_uLong X11SalInstance::ReleaseYieldMutex() { SalYieldMutex* pYieldMutex = mpSalYieldMutex; if ( pYieldMutex->GetThreadId() == vos::OThread::getCurrentIdentifier() ) { - sal_uIntPtr nCount = pYieldMutex->GetAcquireCount(); - sal_uIntPtr n = nCount; + sal_uLong nCount = pYieldMutex->GetAcquireCount(); + sal_uLong n = nCount; while ( n ) { pYieldMutex->release(); @@ -249,7 +249,7 @@ sal_uIntPtr X11SalInstance::ReleaseYieldMutex() // ----------------------------------------------------------------------- -void X11SalInstance::AcquireYieldMutex( sal_uIntPtr nCount ) +void X11SalInstance::AcquireYieldMutex( sal_uLong nCount ) { SalYieldMutex* pYieldMutex = mpSalYieldMutex; while ( nCount ) @@ -288,14 +288,14 @@ void* X11SalInstance::GetConnectionIdentifier( ConnectionIdentifierType& rReturn return pDisplay ? (void*)pDisplay : (void*)""; } -SalFrame *X11SalInstance::CreateFrame( SalFrame *pParent, sal_uIntPtr nSalFrameStyle ) +SalFrame *X11SalInstance::CreateFrame( SalFrame *pParent, sal_uLong nSalFrameStyle ) { SalFrame *pFrame = new X11SalFrame( pParent, nSalFrameStyle ); return pFrame; } -SalFrame* X11SalInstance::CreateChildFrame( SystemParentData* pParentData, sal_uIntPtr nStyle ) +SalFrame* X11SalInstance::CreateChildFrame( SystemParentData* pParentData, sal_uLong nStyle ) { SalFrame* pFrame = new X11SalFrame( NULL, nStyle, pParentData ); diff --git a/vcl/unx/source/app/saltimer.cxx b/vcl/unx/source/app/saltimer.cxx index cb8f7d06f64e..1085967f74a2 100644 --- a/vcl/unx/source/app/saltimer.cxx +++ b/vcl/unx/source/app/saltimer.cxx @@ -58,7 +58,7 @@ void SalXLib::StopTimer() m_nTimeoutMS = 0; } -void SalXLib::StartTimer( sal_uIntPtr nMS ) +void SalXLib::StartTimer( sal_uLong nMS ) { timeval Timeout (m_aTimeout); // previous timeout. gettimeofday (&m_aTimeout, 0); @@ -89,7 +89,7 @@ void X11SalTimer::Stop() GetX11SalData()->GetLib()->StopTimer(); } -void X11SalTimer::Start( sal_uIntPtr nMS ) +void X11SalTimer::Start( sal_uLong nMS ) { GetX11SalData()->GetLib()->StartTimer( nMS ); } diff --git a/vcl/unx/source/gdi/gcach_xpeer.cxx b/vcl/unx/source/gdi/gcach_xpeer.cxx index c3ff95b99082..9b876eb329b8 100644 --- a/vcl/unx/source/gdi/gcach_xpeer.cxx +++ b/vcl/unx/source/gdi/gcach_xpeer.cxx @@ -465,13 +465,13 @@ Pixmap X11GlyphPeer::GetPixmap( ServerFont& rServerFont, int nGlyphIndex, int nR if( rServerFont.GetGlyphBitmap1( nGlyphIndex, maRawBitmap ) ) { // #94666# circumvent bug in some X11 systems, e.g. XF410.LynxEM.v163 - sal_uIntPtr nPixmapWidth = 8 * maRawBitmap.mnScanlineSize - 1; + sal_uLong nPixmapWidth = 8 * maRawBitmap.mnScanlineSize - 1; nPixmapWidth = Max( nPixmapWidth, maRawBitmap.mnWidth ); rGlyphData.SetSize( Size( nPixmapWidth, maRawBitmap.mnHeight ) ); rGlyphData.SetOffset( +maRawBitmap.mnXOffset, +maRawBitmap.mnYOffset ); - const sal_uIntPtr nBytes = maRawBitmap.mnHeight * maRawBitmap.mnScanlineSize; + const sal_uLong nBytes = maRawBitmap.mnHeight * maRawBitmap.mnScanlineSize; if( nBytes > 0 ) { // conversion table LSB<->MSB (for XCreatePixmapFromData) @@ -621,7 +621,7 @@ Glyph X11GlyphPeer::GetGlyphId( ServerFont& rServerFont, int nGlyphIndex ) GlyphSet aGlyphSet = GetGlyphSet( rServerFont, -1 ); aGlyphId = nGlyphIndex & 0x00FFFFFF; - const sal_uIntPtr nBytes = maRawBitmap.mnScanlineSize * maRawBitmap.mnHeight; + const sal_uLong nBytes = maRawBitmap.mnScanlineSize * maRawBitmap.mnHeight; XRenderPeer::GetInstance().AddGlyph( aGlyphSet, aGlyphId, aGlyphInfo, (char*)maRawBitmap.mpBits, nBytes ); mnBytesUsed += nBytes; diff --git a/vcl/unx/source/gdi/pspgraphics.cxx b/vcl/unx/source/gdi/pspgraphics.cxx index 57cbca3f1ae8..422c547fca45 100644 --- a/vcl/unx/source/gdi/pspgraphics.cxx +++ b/vcl/unx/source/gdi/pspgraphics.cxx @@ -293,7 +293,7 @@ void PspGraphics::ResetClipRegion() m_pPrinterGfx->ResetClipRegion (); } -void PspGraphics::BeginSetClipRegion( sal_uIntPtr n ) +void PspGraphics::BeginSetClipRegion( sal_uLong n ) { m_pPrinterGfx->BeginSetClipRegion(n); } @@ -379,12 +379,12 @@ void PspGraphics::drawRect( long nX, long nY, long nDX, long nDY ) m_pPrinterGfx->DrawRect (Rectangle(Point(nX, nY), Size(nDX, nDY))); } -void PspGraphics::drawPolyLine( sal_uIntPtr nPoints, const SalPoint *pPtAry ) +void PspGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint *pPtAry ) { m_pPrinterGfx->DrawPolyLine (nPoints, (Point*)pPtAry); } -void PspGraphics::drawPolygon( sal_uIntPtr nPoints, const SalPoint* pPtAry ) +void PspGraphics::drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry ) { // Point must be equal to SalPoint! see vcl/inc/salgtype.hxx m_pPrinterGfx->DrawPolygon (nPoints, (Point*)pPtAry); @@ -409,13 +409,13 @@ bool PspGraphics::drawPolyLine( const basegfx::B2DPolygon&, double /*fTransparen return false; } -sal_Bool PspGraphics::drawPolyLineBezier( sal_uIntPtr nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ) +sal_Bool PspGraphics::drawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ) { m_pPrinterGfx->DrawPolyLineBezier (nPoints, (Point*)pPtAry, pFlgAry); return sal_True; } -sal_Bool PspGraphics::drawPolygonBezier( sal_uIntPtr nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ) +sal_Bool PspGraphics::drawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ) { m_pPrinterGfx->DrawPolygonBezier (nPoints, (Point*)pPtAry, pFlgAry); return sal_True; @@ -431,13 +431,13 @@ sal_Bool PspGraphics::drawPolyPolygonBezier( sal_uInt32 nPoly, return sal_True; } -void PspGraphics::invert( sal_uIntPtr, +void PspGraphics::invert( sal_uLong, const SalPoint*, SalInvert ) { DBG_ASSERT( 0, "Error: PrinterGfx::Invert() not implemented" ); } -sal_Bool PspGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uIntPtr nSize ) +sal_Bool PspGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize ) { return m_pPrinterGfx->DrawEPS( Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) ), pPtr, nSize ); } @@ -915,10 +915,10 @@ void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric, int ) } } -sal_uInt32 PspGraphics::GetKernPairs( sal_uIntPtr nPairs, ImplKernPairData *pKernPairs ) +sal_uInt32 PspGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData *pKernPairs ) { const ::std::list< ::psp::KernPair >& rPairs( m_pPrinterGfx->getKernPairs() ); - sal_uIntPtr nHavePairs = rPairs.size(); + sal_uLong nHavePairs = rPairs.size(); if( pKernPairs && nPairs ) { ::std::list< ::psp::KernPair >::const_iterator it; diff --git a/vcl/unx/source/gdi/salbmp.cxx b/vcl/unx/source/gdi/salbmp.cxx index 5ddcd7d311b9..42d657b431bd 100644 --- a/vcl/unx/source/gdi/salbmp.cxx +++ b/vcl/unx/source/gdi/salbmp.cxx @@ -64,7 +64,7 @@ SalBitmap* X11SalInstance::CreateSalBitmap() } ImplSalBitmapCache* X11SalBitmap::mpCache = NULL; -sal_uIntPtr X11SalBitmap::mnCacheInstCount = 0; +sal_uLong X11SalBitmap::mnCacheInstCount = 0; // ----------------------------------------------------------------------------- @@ -214,7 +214,7 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable, { const SalTwoRect aTwoRect = { 0, 0, nWidth, nHeight, 0, 0, nWidth, nHeight }; BitmapBuffer aSrcBuf; - sal_uIntPtr nDstFormat = BMP_FORMAT_BOTTOM_UP; + sal_uLong nDstFormat = BMP_FORMAT_BOTTOM_UP; const BitmapPalette* pDstPal = NULL; aSrcBuf.mnFormat = BMP_FORMAT_TOP_DOWN; @@ -304,7 +304,7 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable, else if( aSrcBuf.mnBitCount <= 8 ) { const SalColormap& rColMap = pSalDisp->GetColormap( nScreen ); - const sal_uInt16 nCols = Min( (sal_uIntPtr)rColMap.GetUsed(), (sal_uIntPtr)(1 << nDrawableDepth) ); + const sal_uInt16 nCols = Min( (sal_uLong)rColMap.GetUsed(), (sal_uLong)(1 << nDrawableDepth) ); rPal.SetEntryCount( nCols ); pDstPal = &rPal; @@ -363,7 +363,7 @@ XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long if( pImage ) { BitmapBuffer* pDstBuf; - sal_uIntPtr nDstFormat = BMP_FORMAT_TOP_DOWN; + sal_uLong nDstFormat = BMP_FORMAT_TOP_DOWN; BitmapPalette* pPal = NULL; ColorMask* pMask = NULL; @@ -430,7 +430,7 @@ XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long else if( pImage->depth <= 8 ) { const SalColormap& rColMap = pSalDisp->GetColormap( nScreen ); - const sal_uInt16 nCols = Min( (sal_uIntPtr)rColMap.GetUsed(), (sal_uIntPtr)(1 << pImage->depth) ); + const sal_uInt16 nCols = Min( (sal_uLong)rColMap.GetUsed(), (sal_uLong)(1 << pImage->depth) ); pPal = new BitmapPalette( nCols ); @@ -1018,10 +1018,10 @@ void ImplSalDDB::ImplDraw( Drawable aSrcDrawable, long nSrcDrawableDepth, struct ImplBmpObj { X11SalBitmap* mpBmp; - sal_uIntPtr mnMemSize; - sal_uIntPtr mnFlags; + sal_uLong mnMemSize; + sal_uLong mnFlags; - ImplBmpObj( X11SalBitmap* pBmp, sal_uIntPtr nMemSize, sal_uIntPtr nFlags ) : + ImplBmpObj( X11SalBitmap* pBmp, sal_uLong nMemSize, sal_uLong nFlags ) : mpBmp( pBmp ), mnMemSize( nMemSize ), mnFlags( nFlags ) {} }; @@ -1041,7 +1041,7 @@ ImplSalBitmapCache::~ImplSalBitmapCache() // ----------------------------------------------------------------------------- -void ImplSalBitmapCache::ImplAdd( X11SalBitmap* pBmp, sal_uIntPtr nMemSize, sal_uIntPtr nFlags ) +void ImplSalBitmapCache::ImplAdd( X11SalBitmap* pBmp, sal_uLong nMemSize, sal_uLong nFlags ) { ImplBmpObj* pObj; bool bFound = sal_False; diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx index 1b350e3460b8..a3f3a4fb264e 100644 --- a/vcl/unx/source/gdi/salgdi.cxx +++ b/vcl/unx/source/gdi/salgdi.cxx @@ -67,21 +67,21 @@ class SalPolyLine XPoint Points_[STATIC_POINTS]; XPoint *pFirst_; public: - inline SalPolyLine( sal_uIntPtr nPoints ); - inline SalPolyLine( sal_uIntPtr nPoints, const SalPoint *p ); + inline SalPolyLine( sal_uLong nPoints ); + inline SalPolyLine( sal_uLong nPoints, const SalPoint *p ); inline ~SalPolyLine(); - inline XPoint &operator [] ( sal_uIntPtr n ) const + inline XPoint &operator [] ( sal_uLong n ) const { return pFirst_[n]; } }; -inline SalPolyLine::SalPolyLine( sal_uIntPtr nPoints ) +inline SalPolyLine::SalPolyLine( sal_uLong nPoints ) : pFirst_( nPoints+1 > STATIC_POINTS ? new XPoint[nPoints+1] : Points_ ) {} -inline SalPolyLine::SalPolyLine( sal_uIntPtr nPoints, const SalPoint *p ) +inline SalPolyLine::SalPolyLine( sal_uLong nPoints, const SalPoint *p ) : pFirst_( nPoints+1 > STATIC_POINTS ? new XPoint[nPoints+1] : Points_ ) { - for( sal_uIntPtr i = 0; i < nPoints; i++ ) + for( sal_uLong i = 0; i < nPoints; i++ ) { pFirst_[i].x = (short)p[i].mnX; pFirst_[i].y = (short)p[i].mnY; @@ -398,19 +398,19 @@ GC X11SalGraphics::GetTrackingGC() } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalGraphics::DrawLines( sal_uIntPtr nPoints, +void X11SalGraphics::DrawLines( sal_uLong nPoints, const SalPolyLine &rPoints, GC pGC, bool bClose ) { // errechne wie viele Linien XWindow auf einmal zeichnen kann - sal_uIntPtr nMaxLines = (GetDisplay()->GetMaxRequestSize() - sizeof(xPolyPointReq)) + sal_uLong nMaxLines = (GetDisplay()->GetMaxRequestSize() - sizeof(xPolyPointReq)) / sizeof(xPoint); if( nMaxLines > nPoints ) nMaxLines = nPoints; // gebe alle Linien aus, die XWindows zeichnen kann. - sal_uIntPtr n; + sal_uLong n; for( n = 0; nPoints - n > nMaxLines; n += nMaxLines - 1 ) XDrawLines( GetXDisplay(), GetDrawable(), @@ -597,7 +597,7 @@ void X11SalGraphics::ResetClipRegion() } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalGraphics::BeginSetClipRegion( sal_uIntPtr ) +void X11SalGraphics::BeginSetClipRegion( sal_uLong ) { if( pClipRegion_ ) XDestroyRegion( pClipRegion_ ); @@ -839,13 +839,13 @@ void X11SalGraphics::drawRect( long nX, long nY, long nDX, long nDY ) } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalGraphics::drawPolyLine( sal_uIntPtr nPoints, const SalPoint *pPtAry ) +void X11SalGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint *pPtAry ) { drawPolyLine( nPoints, pPtAry, false ); } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalGraphics::drawPolyLine( sal_uIntPtr nPoints, const SalPoint *pPtAry, bool bClose ) +void X11SalGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint *pPtAry, bool bClose ) { if( nPenColor_ != 0xFFFFFFFF ) { @@ -856,7 +856,7 @@ void X11SalGraphics::drawPolyLine( sal_uIntPtr nPoints, const SalPoint *pPtAry, } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalGraphics::drawPolygon( sal_uIntPtr nPoints, const SalPoint* pPtAry ) +void X11SalGraphics::drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry ) { if( nPoints == 0 ) return; @@ -972,14 +972,14 @@ void X11SalGraphics::drawPolyPolygon( sal_uInt32 nPoly, // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -sal_Bool X11SalGraphics::drawPolyLineBezier( sal_uIntPtr, const SalPoint*, const BYTE* ) +sal_Bool X11SalGraphics::drawPolyLineBezier( sal_uLong, const SalPoint*, const BYTE* ) { return sal_False; } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -sal_Bool X11SalGraphics::drawPolygonBezier( sal_uIntPtr, const SalPoint*, const BYTE* ) +sal_Bool X11SalGraphics::drawPolygonBezier( sal_uLong, const SalPoint*, const BYTE* ) { return sal_False; } @@ -994,7 +994,7 @@ sal_Bool X11SalGraphics::drawPolyPolygonBezier( sal_uInt32, const sal_uInt32*, // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalGraphics::invert( sal_uIntPtr nPoints, +void X11SalGraphics::invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags ) { @@ -1021,7 +1021,7 @@ void X11SalGraphics::invert( sal_uIntPtr nPoints, // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -BOOL X11SalGraphics::drawEPS( long,long,long,long,void*,sal_uIntPtr ) +BOOL X11SalGraphics::drawEPS( long,long,long,long,void*,sal_uLong ) { return sal_False; } diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx index a80f9e7ef011..f4af3b4256ee 100644 --- a/vcl/unx/source/gdi/salgdi3.cxx +++ b/vcl/unx/source/gdi/salgdi3.cxx @@ -1777,14 +1777,14 @@ X11SalGraphics::GetFontMetric( ImplFontMetricData *pMetric, int nFallbackLevel ) // --------------------------------------------------------------------------- sal_uInt32 -X11SalGraphics::GetKernPairs( sal_uIntPtr nPairs, ImplKernPairData *pKernPairs ) +X11SalGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData *pKernPairs ) { if( ! bPrinter_ ) { if( mpServerFont[0] != NULL ) { ImplKernPairData* pTmpKernPairs; - sal_uIntPtr nGotPairs = mpServerFont[0]->GetKernPairs( &pTmpKernPairs ); + sal_uLong nGotPairs = mpServerFont[0]->GetKernPairs( &pTmpKernPairs ); for( unsigned int i = 0; i < nPairs && i < nGotPairs; ++i ) pKernPairs[ i ] = pTmpKernPairs[ i ]; delete[] pTmpKernPairs; diff --git a/vcl/unx/source/gdi/salprnpsp.cxx b/vcl/unx/source/gdi/salprnpsp.cxx index 35d01e7cb5ca..f3b50db6a9d9 100644 --- a/vcl/unx/source/gdi/salprnpsp.cxx +++ b/vcl/unx/source/gdi/salprnpsp.cxx @@ -662,7 +662,7 @@ sal_Bool PspSalInfoPrinter::SetPrinterData( ImplJobSetup* pJobSetup ) // Only the data must be changed, where the bit // in nGetDataFlags is set sal_Bool PspSalInfoPrinter::SetData( - sal_uIntPtr nSetDataFlags, + sal_uLong nSetDataFlags, ImplJobSetup* pJobSetup ) { JobData aData; @@ -823,7 +823,7 @@ void PspSalInfoPrinter::GetPageInfo( // ----------------------------------------------------------------------- -sal_uIntPtr PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup ) +sal_uLong PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup ) { if( ! pJobSetup ) return 0; @@ -837,7 +837,7 @@ sal_uIntPtr PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup ) // ----------------------------------------------------------------------- -String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, sal_uIntPtr nPaperBin ) +String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, sal_uLong nPaperBin ) { JobData aData; JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData ); @@ -846,7 +846,7 @@ String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, sal_uI if( aData.m_pParser ) { const PPDKey* pKey = aData.m_pParser ? aData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "InputSlot" ) ) ): NULL; - if( ! pKey || nPaperBin >= (sal_uIntPtr)pKey->countValues() ) + if( ! pKey || nPaperBin >= (sal_uLong)pKey->countValues() ) aRet = aData.m_pParser->getDefaultInputSlot(); else { @@ -861,7 +861,7 @@ String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, sal_uI // ----------------------------------------------------------------------- -sal_uIntPtr PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, sal_uInt16 nType ) +sal_uLong PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, sal_uInt16 nType ) { switch( nType ) { @@ -959,7 +959,7 @@ sal_Bool PspSalPrinter::StartJob( const XubString* pFileName, const XubString& rJobName, const XubString& rAppName, - sal_uIntPtr nCopies, + sal_uLong nCopies, bool bCollate, bool bDirect, ImplJobSetup* pJobSetup ) @@ -1111,7 +1111,7 @@ sal_Bool PspSalPrinter::EndPage() // ----------------------------------------------------------------------- -sal_uIntPtr PspSalPrinter::GetErrorCode() +sal_uLong PspSalPrinter::GetErrorCode() { return 0; } diff --git a/vcl/unx/source/printer/jobdata.cxx b/vcl/unx/source/printer/jobdata.cxx index b3aceffcad6d..811f93bcb826 100644 --- a/vcl/unx/source/printer/jobdata.cxx +++ b/vcl/unx/source/printer/jobdata.cxx @@ -167,7 +167,7 @@ bool JobData::getStreamBuffer( void*& pData, int& bytes ) // now append the PPDContext stream buffer aStream.WriteLine( "PPDContexData" ); - sal_uIntPtr nBytes; + sal_uLong nBytes; void* pContextBuffer = m_aContext.getStreamableBuffer( nBytes ); if( nBytes ) aStream.Write( pContextBuffer, nBytes ); diff --git a/vcl/unx/source/printer/ppdparser.cxx b/vcl/unx/source/printer/ppdparser.cxx index 14bd83add924..9a85d02db894 100644 --- a/vcl/unx/source/printer/ppdparser.cxx +++ b/vcl/unx/source/printer/ppdparser.cxx @@ -311,7 +311,7 @@ void PPDDecompressStream::Open( const rtl::OUString& i_rFile ) mpFileStream->Seek( 0 ); // check for compress'ed or gzip'ed file - sal_uIntPtr nCompressMethod = 0; + sal_uLong nCompressMethod = 0; if( aLine.Len() > 1 && static_cast(aLine.GetChar( 0 )) == 0x1f ) { if( static_cast(aLine.GetChar( 1 )) == 0x8b ) // check for gzip @@ -1417,7 +1417,7 @@ String PPDParser::getSlot( int nSlot ) const if( nSlot > 0 && nSlot < m_pInputSlots->countValues() ) return m_pInputSlots->getValue( nSlot )->m_aOption; else if( m_pInputSlots->countValues() > 0 ) - return m_pInputSlots->getValue( (sal_uIntPtr)0 )->m_aOption; + return m_pInputSlots->getValue( (sal_uLong)0 )->m_aOption; return String(); } @@ -1430,7 +1430,7 @@ String PPDParser::getSlotCommand( int nSlot ) const if( nSlot > 0 && nSlot < m_pInputSlots->countValues() ) return m_pInputSlots->getValue( nSlot )->m_aValue; else if( m_pInputSlots->countValues() > 0 ) - return m_pInputSlots->getValue( (sal_uIntPtr)0 )->m_aValue; + return m_pInputSlots->getValue( (sal_uLong)0 )->m_aValue; return String(); } @@ -1457,7 +1457,7 @@ String PPDParser::getPaperDimension( int nPaperDimension ) const if( nPaperDimension > 0 && nPaperDimension < m_pPaperDimensions->countValues() ) return m_pPaperDimensions->getValue( nPaperDimension )->m_aOption; else if( m_pPaperDimensions->countValues() > 0 ) - return m_pPaperDimensions->getValue( (sal_uIntPtr)0 )->m_aOption; + return m_pPaperDimensions->getValue( (sal_uLong)0 )->m_aOption; return String(); } @@ -1470,7 +1470,7 @@ String PPDParser::getPaperDimensionCommand( int nPaperDimension ) const if( nPaperDimension > 0 && nPaperDimension < m_pPaperDimensions->countValues() ) return m_pPaperDimensions->getValue( nPaperDimension )->m_aValue; else if( m_pPaperDimensions->countValues() > 0 ) - return m_pPaperDimensions->getValue( (sal_uIntPtr)0 )->m_aValue; + return m_pPaperDimensions->getValue( (sal_uLong)0 )->m_aValue; return String(); } @@ -1578,7 +1578,7 @@ String PPDParser::getDuplex( int nDuplex ) const if( nDuplex > 0 && nDuplex < m_pDuplexTypes->countValues() ) return m_pDuplexTypes->getValue( nDuplex )->m_aOption; else if( m_pDuplexTypes->countValues() > 0 ) - return m_pDuplexTypes->getValue( (sal_uIntPtr)0 )->m_aOption; + return m_pDuplexTypes->getValue( (sal_uLong)0 )->m_aOption; return String(); } @@ -1591,7 +1591,7 @@ String PPDParser::getDuplexCommand( int nDuplex ) const if( nDuplex > 0 && nDuplex < m_pDuplexTypes->countValues() ) return m_pDuplexTypes->getValue( nDuplex )->m_aValue; else if( m_pDuplexTypes->countValues() > 0 ) - return m_pDuplexTypes->getValue( (sal_uIntPtr)0 )->m_aValue; + return m_pDuplexTypes->getValue( (sal_uLong)0 )->m_aValue; return String(); } @@ -2033,7 +2033,7 @@ void PPDContext::getUnconstrainedValues( const PPDKey* pKey, ::std::list< const // ------------------------------------------------------------------- -void* PPDContext::getStreamableBuffer( sal_uIntPtr& rBytes ) const +void* PPDContext::getStreamableBuffer( sal_uLong& rBytes ) const { rBytes = 0; if( ! m_aCurrentValues.size() ) @@ -2079,7 +2079,7 @@ void* PPDContext::getStreamableBuffer( sal_uIntPtr& rBytes ) const // ------------------------------------------------------------------- -void PPDContext::rebuildFromStreamBuffer( void* pBuffer, sal_uIntPtr nBytes ) +void PPDContext::rebuildFromStreamBuffer( void* pBuffer, sal_uLong nBytes ) { if( ! m_pParser ) return; diff --git a/vcl/unx/source/window/salframe.cxx b/vcl/unx/source/window/salframe.cxx index 64ea220a6cde..f456ccc8d628 100644 --- a/vcl/unx/source/window/salframe.cxx +++ b/vcl/unx/source/window/salframe.cxx @@ -209,7 +209,7 @@ void X11SalFrame::askForXEmbedFocus( sal_Int32 i_nTimeCode ) // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalFrame::Init( sal_uIntPtr nSalFrameStyle, int nScreen, SystemParentData* pParentData, bool bUseGeometry ) +void X11SalFrame::Init( sal_uLong nSalFrameStyle, int nScreen, SystemParentData* pParentData, bool bUseGeometry ) { if( nScreen < 0 || nScreen >= GetDisplay()->GetScreenCount() ) nScreen = GetDisplay()->GetDefaultScreenNumber(); @@ -645,7 +645,7 @@ void X11SalFrame::Init( sal_uIntPtr nSalFrameStyle, int nScreen, SystemParentDat } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -X11SalFrame::X11SalFrame( SalFrame *pParent, sal_uIntPtr nSalFrameStyle, SystemParentData* pSystemParent ) +X11SalFrame::X11SalFrame( SalFrame *pParent, sal_uLong nSalFrameStyle, SystemParentData* pSystemParent ) { X11SalData* pSalData = GetX11SalData(); @@ -3062,7 +3062,7 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent ) if( pEvent->type == ButtonRelease ) return 0; - static sal_uIntPtr nLines = 0; + static sal_uLong nLines = 0; if( ! nLines ) { char* pEnv = getenv( "SAL_WHEELLINES" ); @@ -3600,7 +3600,7 @@ long X11SalFrame::HandleFocusEvent( XFocusChangeEvent *pEvent ) if ((mpParent != NULL && nStyle_ == 0) && pSVData->maWinData.mpFirstFloat ) { - sal_uIntPtr nMode = pSVData->maWinData.mpFirstFloat->GetPopupModeFlags(); + sal_uLong nMode = pSVData->maWinData.mpFirstFloat->GetPopupModeFlags(); pSVData->maWinData.mpFirstFloat->SetPopupModeFlags( nMode & ~(FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE)); } @@ -4477,7 +4477,7 @@ void X11SalFrame::ResetClipRegion() op, ordering ); } -void X11SalFrame::BeginSetClipRegion( sal_uIntPtr nRects ) +void X11SalFrame::BeginSetClipRegion( sal_uLong nRects ) { if( m_pClipRectangles ) delete [] m_pClipRectangles; diff --git a/vcl/unx/source/window/salobj.cxx b/vcl/unx/source/window/salobj.cxx index 782b4aae897f..93aeeba66ee8 100644 --- a/vcl/unx/source/window/salobj.cxx +++ b/vcl/unx/source/window/salobj.cxx @@ -219,7 +219,7 @@ SalClipRegion::~SalClipRegion() void -SalClipRegion::BeginSetClipRegion( sal_uIntPtr nRects ) +SalClipRegion::BeginSetClipRegion( sal_uLong nRects ) { if (ClipRectangleList) delete [] ClipRectangleList; @@ -324,7 +324,7 @@ X11SalObject::ResetClipRegion() void -X11SalObject::BeginSetClipRegion( sal_uIntPtr nRectCount ) +X11SalObject::BeginSetClipRegion( sal_uLong nRectCount ) { maClipRegion.BeginSetClipRegion ( nRectCount ); } -- cgit From 20a8cc813f0b12c5a0be5f1fbb6ef47f539ae589 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 17 Jan 2011 16:24:56 +0100 Subject: vcl118: #i116133# convert to greyscale for PDFWriter --- vcl/unx/source/gdi/salprnpsp.cxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'vcl/unx') diff --git a/vcl/unx/source/gdi/salprnpsp.cxx b/vcl/unx/source/gdi/salprnpsp.cxx index ece724d717cb..750c390bbcbc 100644 --- a/vcl/unx/source/gdi/salprnpsp.cxx +++ b/vcl/unx/source/gdi/salprnpsp.cxx @@ -1188,6 +1188,8 @@ BOOL PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJobNam aContext.Tagged = false; aContext.EmbedStandardFonts = true; aContext.DocumentLocale = Application::GetSettings().GetLocale(); + aContext.ColorMode = i_rController.getPrinter()->GetPrinterOptions().IsConvertToGreyscales() + ? vcl::PDFWriter::DrawGreyscale : vcl::PDFWriter::DrawColor; // prepare doc info aContext.DocumentInfo.Title = i_rJobName; -- cgit From a6813969c3f073cae588d43e502154d148b982a2 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Tue, 18 Jan 2011 10:58:00 +0100 Subject: removetooltypes01: #i112600# fixes for solaris --- vcl/unx/source/gdi/cdeint.cxx | 6 +++--- vcl/unx/source/window/salframe.cxx | 24 ++++++++++++------------ 2 files changed, 15 insertions(+), 15 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/source/gdi/cdeint.cxx b/vcl/unx/source/gdi/cdeint.cxx index caa4867af874..ee0054814761 100644 --- a/vcl/unx/source/gdi/cdeint.cxx +++ b/vcl/unx/source/gdi/cdeint.cxx @@ -231,9 +231,9 @@ void CDEIntegrator::GetSystemLook( AllSettings& rSettings ) { // calculate Checked color Color aColor2 = aStyleSettings.GetLightColor(); - BYTE nRed = (BYTE)(((USHORT)aColors[1].GetRed() + (USHORT)aColor2.GetRed())/2); - BYTE nGreen = (BYTE)(((USHORT)aColors[1].GetGreen() + (USHORT)aColor2.GetGreen())/2); - BYTE nBlue = (BYTE)(((USHORT)aColors[1].GetBlue() + (USHORT)aColor2.GetBlue())/2); + sal_uInt8 nRed = (sal_uInt8)(((sal_uInt16)aColors[1].GetRed() + (sal_uInt16)aColor2.GetRed())/2); + sal_uInt8 nGreen = (sal_uInt8)(((sal_uInt16)aColors[1].GetGreen() + (sal_uInt16)aColor2.GetGreen())/2); + sal_uInt8 nBlue = (sal_uInt8)(((sal_uInt16)aColors[1].GetBlue() + (sal_uInt16)aColor2.GetBlue())/2); aStyleSettings.SetCheckedColor( Color( nRed, nGreen, nBlue ) ); } } diff --git a/vcl/unx/source/window/salframe.cxx b/vcl/unx/source/window/salframe.cxx index f456ccc8d628..816265296660 100644 --- a/vcl/unx/source/window/salframe.cxx +++ b/vcl/unx/source/window/salframe.cxx @@ -956,7 +956,7 @@ void X11SalFrame::updateGraphics( bool bClear ) // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalFrame::Enable( BOOL /*bEnable*/ ) +void X11SalFrame::Enable( sal_Bool /*bEnable*/ ) { // NYI: enable/disable frame } @@ -1065,7 +1065,7 @@ void X11SalFrame::SetIcon( sal_uInt16 nIcon ) } pHints = &Hints; - BOOL bOk = SelectAppIconPixmap( GetDisplay(), m_nScreen, + sal_Bool bOk = SelectAppIconPixmap( GetDisplay(), m_nScreen, nIcon, iconSize, pHints->icon_pixmap, pHints->icon_mask ); if ( !bOk ) @@ -1138,7 +1138,7 @@ void X11SalFrame::SetMinClientSize( long nWidth, long nHeight ) // Show + Pos (x,y,z) + Size (width,height) // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalFrame::Show( BOOL bVisible, BOOL bNoActivate ) +void X11SalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate ) { if( ( bVisible && bMapped_ ) || ( !bVisible && !bMapped_ ) ) @@ -1631,7 +1631,7 @@ void X11SalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_u } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalFrame::SetAlwaysOnTop( BOOL bOnTop ) +void X11SalFrame::SetAlwaysOnTop( sal_Bool bOnTop ) { if( ! IsOverrideRedirect() ) { @@ -1812,7 +1812,7 @@ void X11SalFrame::SetWindowState( const SalFrameState *pState ) } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -BOOL X11SalFrame::GetWindowState( SalFrameState* pState ) +sal_Bool X11SalFrame::GetWindowState( SalFrameState* pState ) { if( SHOWSTATE_MINIMIZED == nShowState_ ) pState->mnState = SAL_FRAMESTATE_MINIMIZED; @@ -2192,7 +2192,7 @@ void X11SalFrame::SetScreenNumber( unsigned int nNewScreen ) // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen ) +void X11SalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nScreen ) { if( GetDisplay()->IsXinerama() && GetDisplay()->GetXineramaScreens().size() > 1 ) { @@ -2362,7 +2362,7 @@ void X11SalFrame::StartPresentation( sal_Bool bStart ) static bool DPMSExtensionAvailable = #ifndef SOLARIS (DPMSQueryExtension(GetXDisplay(), &dummy, &dummy) != 0); - static BOOL DPMSEnabled = false; + static sal_Bool DPMSEnabled = false; #else false; bool DPMSEnabled = false; @@ -2541,7 +2541,7 @@ X11SalFrame::HandleExtTextEvent (XClientMessageEvent *pEvent) // PostEvent // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -BOOL X11SalFrame::PostEvent( void *pData ) +sal_Bool X11SalFrame::PostEvent( void *pData ) { GetDisplay()->SendInternalEvent( this, pData ); return sal_True; @@ -2634,7 +2634,7 @@ XubString X11SalFrame::GetSymbolKeyName( const XubString&, sal_uInt16 nKeyCode ) return GetKeyName( nKeyCode ); } -BOOL X11SalFrame::MapUnicodeToKeyCode( sal_Unicode , LanguageType , KeyCode& ) +sal_Bool X11SalFrame::MapUnicodeToKeyCode( sal_Unicode , LanguageType , KeyCode& ) { // not supported yet return sal_False; @@ -2665,7 +2665,7 @@ void X11SalFrame::UpdateSettings( AllSettings& rSettings ) pIntegrator->GetSystemLook( rSettings ); } -void X11SalFrame::CaptureMouse( BOOL bCapture ) +void X11SalFrame::CaptureMouse( sal_Bool bCapture ) { nCaptured_ = pDisplay_->CaptureMouse( bCapture ? this : NULL ); } @@ -3814,9 +3814,9 @@ long X11SalFrame::HandleReparentEvent( XReparentEvent *pEvent ) XLIB_Window hWM_Parent; XLIB_Window hRoot, *Children, hDummy; unsigned int nChildren; - BOOL bNone = pDisplay_->GetProperties() + sal_Bool bNone = pDisplay_->GetProperties() & PROPERTY_SUPPORT_WM_Parent_Pixmap_None; - BOOL bAccessParentWindow = ! (pDisplay_->GetProperties() + sal_Bool bAccessParentWindow = ! (pDisplay_->GetProperties() & PROPERTY_FEATURE_TrustedSolaris); static const char* pDisableStackingCheck = getenv( "SAL_DISABLE_STACKING_CHECK" ); -- cgit From ffd600e777970df0908125da66b280e1b00dbec9 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Mon, 24 Jan 2011 13:31:41 +0100 Subject: masterfix: #i10000# #i116562# kde patch --- vcl/unx/kde4/KDESalGraphics.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vcl/unx') diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx index 2c04af384c51..5a5cd11c52d9 100644 --- a/vcl/unx/kde4/KDESalGraphics.cxx +++ b/vcl/unx/kde4/KDESalGraphics.cxx @@ -556,7 +556,7 @@ BOOL KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, if (returnVal) { - GC gc = SelectFont(); + GC gc = GetFontGC(); if( gc ) { -- cgit From 5b6e356986103177707f6362847ecc4906f0c7f4 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Thu, 27 Jan 2011 15:02:01 +0100 Subject: removetooltypes01: #i112600# Fix build problem on Linux x64 --- vcl/unx/inc/salgdi.h | 2 +- vcl/unx/source/gdi/salgdi3.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/inc/salgdi.h b/vcl/unx/inc/salgdi.h index 8da83fd16408..c40a85741c5d 100644 --- a/vcl/unx/inc/salgdi.h +++ b/vcl/unx/inc/salgdi.h @@ -247,7 +247,7 @@ public: virtual void SetTextColor( SalColor nSalColor ); virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel ); virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); - virtual sal_uIntPtr GetKernPairs( sal_uIntPtr nMaxPairs, ImplKernPairData* ); + virtual sal_uLong GetKernPairs( sal_uLong nMaxPairs, ImplKernPairData* ); virtual const ImplFontCharMap* GetImplFontCharMap() const; virtual void GetDevFontList( ImplDevFontList* ); virtual void GetDevFontSubstList( OutputDevice* ); diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx index 15bb672e4594..c719b33a1fbf 100644 --- a/vcl/unx/source/gdi/salgdi3.cxx +++ b/vcl/unx/source/gdi/salgdi3.cxx @@ -1218,7 +1218,7 @@ X11SalGraphics::GetFontMetric( ImplFontMetricData *pMetric, int nFallbackLevel ) // --------------------------------------------------------------------------- -sal_uInt32 +sal_uLong X11SalGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData *pKernPairs ) { if( ! bPrinter_ ) -- cgit From 6615f81d3411d4506f16b8eb392a4c7c61bfc360 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Fri, 28 Jan 2011 11:13:03 +0100 Subject: removetooltypes01: #i112600# Fix build problems with gcc on Linux x64 --- vcl/unx/headless/svppspgraphics.cxx | 2 +- vcl/unx/inc/pspgraphics.h | 2 +- vcl/unx/source/gdi/pspgraphics.cxx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'vcl/unx') diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx index fda458c5c73e..6fdc8aac75d0 100644 --- a/vcl/unx/headless/svppspgraphics.cxx +++ b/vcl/unx/headless/svppspgraphics.cxx @@ -817,7 +817,7 @@ void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric, int ) } } -sal_uInt32 PspGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData *pKernPairs ) +sal_uLong PspGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData *pKernPairs ) { const ::std::list< ::psp::KernPair >& rPairs( m_pPrinterGfx->getKernPairs() ); sal_uLong nHavePairs = rPairs.size(); diff --git a/vcl/unx/inc/pspgraphics.h b/vcl/unx/inc/pspgraphics.h index 08d5918cf7bd..143c628eb178 100644 --- a/vcl/unx/inc/pspgraphics.h +++ b/vcl/unx/inc/pspgraphics.h @@ -103,7 +103,7 @@ public: virtual void SetTextColor( SalColor nSalColor ); virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel ); virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); - virtual sal_uIntPtr GetKernPairs( sal_uIntPtr nMaxPairs, ImplKernPairData* ); + virtual sal_uLong GetKernPairs( sal_uLong nMaxPairs, ImplKernPairData* ); virtual const ImplFontCharMap* GetImplFontCharMap() const; virtual void GetDevFontList( ImplDevFontList* ); virtual void GetDevFontSubstList( OutputDevice* ); diff --git a/vcl/unx/source/gdi/pspgraphics.cxx b/vcl/unx/source/gdi/pspgraphics.cxx index 422c547fca45..0edf2326b58d 100644 --- a/vcl/unx/source/gdi/pspgraphics.cxx +++ b/vcl/unx/source/gdi/pspgraphics.cxx @@ -915,7 +915,7 @@ void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric, int ) } } -sal_uInt32 PspGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData *pKernPairs ) +sal_uLong PspGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData *pKernPairs ) { const ::std::list< ::psp::KernPair >& rPairs( m_pPrinterGfx->getKernPairs() ); sal_uLong nHavePairs = rPairs.size(); -- cgit