From 83a5d1ee63390da689740b88393d04fe07ca7d62 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 15 Jun 2011 16:42:27 +0100 Subject: figure out how to make new-style cursors from ye-oldy xbms --- vcl/unx/gtk/app/gtkdata.cxx | 71 +++++++++++++++++++++++++++++++++-------- vcl/unx/gtk/window/gtkframe.cxx | 2 ++ 2 files changed, 60 insertions(+), 13 deletions(-) (limited to 'vcl') diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx index 0a71ad01dab0..8550cc39b484 100644 --- a/vcl/unx/gtk/app/gtkdata.cxx +++ b/vcl/unx/gtk/app/gtkdata.cxx @@ -333,25 +333,70 @@ long GtkSalDisplay::Dispatch( XEvent* pEvent ) return GDK_FILTER_CONTINUE; } +#if GTK_CHECK_VERSION(3,0,0) +namespace +{ + //cairo annoyingly won't take raw xbm data unless it fits + //the required cairo stride + unsigned char* ensurePaddedForCairo(const unsigned char *pXBM, + int nWidth, int nHeight, int nStride) + { + unsigned char *pPaddedXBM = const_cast(pXBM); + + int bytes_per_row = (nWidth + 7) / 8; + + if (nStride != bytes_per_row) + { + pPaddedXBM = new unsigned char[nStride * nHeight]; + for (int row = 0; row < nHeight; ++row) + { + memcpy(pPaddedXBM + (nStride * row), + pXBM + (bytes_per_row * row), bytes_per_row); + memset(pPaddedXBM + (nStride * row) + bytes_per_row, + 0, nStride - bytes_per_row); + } + } + + return pPaddedXBM; + } +} +#endif + GdkCursor* GtkSalDisplay::getFromXPM( const unsigned char *pBitmap, const unsigned char *pMask, int nWidth, int nHeight, int nXHot, int nYHot ) { #if GTK_CHECK_VERSION(3,0,0) - g_warning ("FIXME: to use gdk_cursor_new_from_pixbuf instead of spiders"); - // We need to do something like: - /* - GdkPixbuf *pPix = gdk_pixbuf_new_from_xpm_data (pBitmap); - GdkPixbuf *pMask = gdk_pixbuf_new_from_xpm_data (pMask); - - GdkCursor* gdk_cursor_new_from_pixbuf (GdkDisplay *display, - GdkPixbuf *pixbuf, - gint x, - gint y); - */ - return gdk_cursor_new_for_display (gdk_display_get_default(), - GDK_SPIDER); + int cairo_stride = cairo_format_stride_for_width(CAIRO_FORMAT_A1, nWidth); + + unsigned char *pPaddedXBM = ensurePaddedForCairo(pBitmap, nWidth, nHeight, cairo_stride); + cairo_surface_t *s = cairo_image_surface_create_for_data( + pPaddedXBM, + CAIRO_FORMAT_A1, nWidth, nHeight, + cairo_stride); + + cairo_t *cr = cairo_create(s); + unsigned char *pPaddedMaskXBM = ensurePaddedForCairo(pMask, nWidth, nHeight, cairo_stride); + cairo_surface_t *mask = cairo_image_surface_create_for_data( + pPaddedMaskXBM, + CAIRO_FORMAT_A1, nWidth, nHeight, + cairo_stride); + cairo_mask_surface(cr, mask, 0, 0); + cairo_destroy(cr); + cairo_surface_destroy(mask); + if (pPaddedMaskXBM != pMask) + delete [] pPaddedMaskXBM; + + GdkPixbuf *pixbuf = gdk_pixbuf_get_from_surface(s, 0, 0, nWidth, nHeight); + cairo_surface_destroy(s); + if (pPaddedXBM != pBitmap) + delete [] pPaddedXBM; + + GdkCursor *cursor = gdk_cursor_new_from_pixbuf(m_pGdkDisplay, pixbuf, nXHot, nYHot); + g_object_unref(pixbuf); + + return cursor; #else GdkScreen *pScreen = gdk_display_get_default_screen( m_pGdkDisplay ); GdkDrawable *pDrawable = GDK_DRAWABLE( gdk_screen_get_root_window (pScreen) ); diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index 8c151e782153..b0988f6fb1b1 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -2371,6 +2371,8 @@ void GtkSalFrame::UpdateSettings( AllSettings& rSettings ) #ifndef GTK_GRAPHICS_DISABLED pGraphics->updateSettings( rSettings ); +#else + (void)rSettings; #endif if( bFreeGraphics ) -- cgit v1.2.3 From 0bdfde69aa01ced2461ac889037155726607bbee Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 15 Jun 2011 16:45:09 +0100 Subject: they are xbms, not xpms, hence my bafflement --- vcl/inc/unx/gtk/gtkdata.hxx | 2 +- vcl/unx/gtk/app/gtkdata.cxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/unx/gtk/gtkdata.hxx b/vcl/inc/unx/gtk/gtkdata.hxx index 307a3f2b3e01..28e0f3298fb9 100644 --- a/vcl/inc/unx/gtk/gtkdata.hxx +++ b/vcl/inc/unx/gtk/gtkdata.hxx @@ -95,7 +95,7 @@ class GtkSalDisplay : public SalDisplay bool m_bStartupCompleted; std::vector< int > m_aXineramaScreenIndexMap; - GdkCursor* getFromXPM( const unsigned char *pBitmap, const unsigned char *pMask, + GdkCursor* getFromXBM( const unsigned char *pBitmap, const unsigned char *pMask, int nWidth, int nHeight, int nXHot, int nYHot ); public: GtkSalDisplay( GdkDisplay* pDisplay ); diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx index 8550cc39b484..dde909ff27f2 100644 --- a/vcl/unx/gtk/app/gtkdata.cxx +++ b/vcl/unx/gtk/app/gtkdata.cxx @@ -362,7 +362,7 @@ namespace } #endif -GdkCursor* GtkSalDisplay::getFromXPM( const unsigned char *pBitmap, +GdkCursor* GtkSalDisplay::getFromXBM( const unsigned char *pBitmap, const unsigned char *pMask, int nWidth, int nHeight, int nXHot, int nYHot ) @@ -420,7 +420,7 @@ GdkCursor* GtkSalDisplay::getFromXPM( const unsigned char *pBitmap, #define MAKE_CURSOR( vcl_name, name ) \ case vcl_name: \ - pCursor = getFromXPM( name##curs##_bits, name##mask##_bits, \ + pCursor = getFromXBM( name##curs##_bits, name##mask##_bits, \ name##curs_width, name##curs_height, \ name##curs_x_hot, name##curs_y_hot ); \ break -- cgit v1.2.3 From 89bdbffaaa26e95619e2f52a86e58ef0c2419011 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 16 Jun 2011 01:17:35 +0300 Subject: Use DESKTOP and NATIVE where appropriate --- dtrans/prj/build.lst | 2 +- svl/prj/build.lst | 2 +- vcl/prj/build.lst | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'vcl') diff --git a/dtrans/prj/build.lst b/dtrans/prj/build.lst index 6ee2b47d53af..f93333ff9dfd 100644 --- a/dtrans/prj/build.lst +++ b/dtrans/prj/build.lst @@ -1,4 +1,4 @@ -dr dtrans : unotools offapi offuh rdbmaker stoc LIBXSLT:libxslt NULL +dr dtrans : unotools offapi offuh DESKTOP:rdbmaker stoc LIBXSLT:libxslt NULL dr dtrans usr1 - all dr_mkout NULL dr dtrans\inc nmake - all dr_inc NULL dr dtrans\source\cnttype nmake - all dr_cnttype dr_generic dr_inc NULL diff --git a/svl/prj/build.lst b/svl/prj/build.lst index 67366a6aee68..58c150563e5e 100644 --- a/svl/prj/build.lst +++ b/svl/prj/build.lst @@ -1,3 +1,3 @@ -sl svl : TRANSLATIONS:translations rsc offuh ucbhelper unotools cppu cppuhelper comphelper sal sot LIBXSLT:libxslt NULL +sl svl : TRANSLATIONS:translations DESKTOP:rsc offuh ucbhelper unotools cppu cppuhelper comphelper sal sot LIBXSLT:libxslt NULL sl svl\prj nmake - all svl_prj NULL # sl svl\qa\unit nmake - all svl_qa_cppunit svl_util NULL diff --git a/vcl/prj/build.lst b/vcl/prj/build.lst index 9e0ccdba440b..1b32995ae668 100644 --- a/vcl/prj/build.lst +++ b/vcl/prj/build.lst @@ -1,4 +1,4 @@ -vc vcl : TRANSLATIONS:translations apple_remote BOOST:boost rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offuh basegfx basebmp tools l10ntools icc cpputools svl LIBXSLT:libxslt NULL +vc vcl : TRANSLATIONS:translations apple_remote BOOST:boost DESKTOP:rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offuh basegfx basebmp tools DESKTOP:l10ntools icc cpputools svl LIBXSLT:libxslt NULL vc vcl usr1 - all vc_mkout NULL vc vcl\prj nmake - all vc_prj NULL -- cgit v1.2.3 From ce68a70755f970ee702a13b330415d7c97c7415b Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 16 Jun 2011 02:10:37 +0300 Subject: Add svsys.h file for iOS --- vcl/inc/ios/svsys.h | 36 ++++++++++++++++++++++++++++++++++++ vcl/inc/svsys.h | 2 ++ 2 files changed, 38 insertions(+) create mode 100644 vcl/inc/ios/svsys.h (limited to 'vcl') diff --git a/vcl/inc/ios/svsys.h b/vcl/inc/ios/svsys.h new file mode 100644 index 000000000000..0d01631c09f0 --- /dev/null +++ b/vcl/inc/ios/svsys.h @@ -0,0 +1,36 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is Tor Lillqvist + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#ifndef _SV_SVSYS_H +#define _SV_SVSYS_H + + +// ? + +#endif // _SV_SVSYS_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/svsys.h b/vcl/inc/svsys.h index df0b58c548ca..fb9a9215be7a 100644 --- a/vcl/inc/svsys.h +++ b/vcl/inc/svsys.h @@ -34,6 +34,8 @@ #include "aqua/svsys.h" #elif defined OS2 #include "os2/svsys.h" +#elif defined IOS +#include "ios/svsys.h" #else #include "unx/svsys.h" #endif -- cgit v1.2.3 From f30169f7f7873ac3174f6218dc8c1573ca839aef Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 16 Jun 2011 21:34:11 +0100 Subject: let the caller own this --- vcl/source/app/svapp.cxx | 4 ---- 1 file changed, 4 deletions(-) (limited to 'vcl') diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index fe536addac98..fad5ad84ac7d 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -2067,13 +2067,9 @@ void Application::Property( ApplicationProperty& rProp ) void Application::SetPropertyHandler( PropertyHandler* p ) { - if ( pHandler ) - delete pHandler; pHandler = p; } - - void Application::AppEvent( const ApplicationEvent& /*rAppEvent*/ ) { } -- cgit v1.2.3 From e178d5a97fd3949f3bf3eb02da73390b6e727291 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 16 Jun 2011 22:28:08 +0100 Subject: ByteString -> rtl::OString --- vcl/unx/generic/app/wmadaptor.cxx | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'vcl') diff --git a/vcl/unx/generic/app/wmadaptor.cxx b/vcl/unx/generic/app/wmadaptor.cxx index ad9b5ee22d6c..7ad584953069 100644 --- a/vcl/unx/generic/app/wmadaptor.cxx +++ b/vcl/unx/generic/app/wmadaptor.cxx @@ -228,8 +228,9 @@ WMAdaptor* WMAdaptor::createWMAdaptor( SalDisplay* pSalDisplay ) pAdaptor = new WMAdaptor( pSalDisplay ); #if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "Window Manager's name is \"%s\"\n", - ByteString( pAdaptor->getWindowManagerName(), RTL_TEXTENCODING_ISO_8859_1 ).GetBuffer() ); + fprintf(stderr, "Window Manager's name is \"%s\"\n", + rtl::OUStringToOString(pAdaptor->getWindowManagerName(), + RTL_TEXTENCODING_UTF8).getStr()); #endif return pAdaptor; } @@ -1075,10 +1076,11 @@ void GnomeWMAdaptor::initAtoms() void WMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const { - ByteString aTitle( rWMName, osl_getThreadTextEncoding() ); + rtl::OString aTitle(rtl::OUStringToOString(rWMName, + osl_getThreadTextEncoding())); if( ! rWMName.Len() && m_aWMName.EqualsAscii( "Dtwm" ) ) - aTitle = " "; + aTitle = rtl::OString(' '); ::rtl::OString aWMLocale; rtl_Locale* pLocale = NULL; @@ -1140,7 +1142,7 @@ void WMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const } #endif - char* pT = const_cast(aTitle.GetBuffer()); + char* pT = const_cast(aTitle.getStr()); XTextProperty aProp = { NULL, None, 0, 0 }; if( bTrustXmb ) { @@ -1151,10 +1153,10 @@ void WMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const &aProp ); } - unsigned char* pData = aProp.nitems ? aProp.value : (unsigned char*)aTitle.GetBuffer(); - Atom nType = aProp.nitems ? aProp.encoding : XA_STRING; - int nFormat = aProp.nitems ? aProp.format : 8; - int nBytes = aProp.nitems ? aProp.nitems : aTitle.Len(); + unsigned char* pData = aProp.nitems ? aProp.value : (unsigned char*)aTitle.getStr(); + Atom nType = aProp.nitems ? aProp.encoding : XA_STRING; + int nFormat = aProp.nitems ? aProp.format : 8; + int nBytes = aProp.nitems ? aProp.nitems : aTitle.getLength(); const SystemEnvData* pEnv = pFrame->GetSystemData(); XChangeProperty( m_pDisplay, (XLIB_Window)pEnv->aShellWindow, @@ -1195,7 +1197,7 @@ void NetWMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const { WMAdaptor::setWMName( pFrame, rWMName ); - ByteString aTitle( rWMName, RTL_TEXTENCODING_UTF8 ); + rtl::OString aTitle(rtl::OUStringToOString(rWMName, RTL_TEXTENCODING_UTF8)); const SystemEnvData* pEnv = pFrame->GetSystemData(); if( m_aWMAtoms[ NET_WM_NAME ] ) XChangeProperty( m_pDisplay, @@ -1204,8 +1206,8 @@ void NetWMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const m_aWMAtoms[ UTF8_STRING ], 8, PropModeReplace, - (unsigned char*)aTitle.GetBuffer(), - aTitle.Len()+1 ); + (unsigned char*)aTitle.getStr(), + aTitle.getLength()+1 ); if( m_aWMAtoms[ NET_WM_ICON_NAME ] ) XChangeProperty( m_pDisplay, (XLIB_Window)pEnv->aShellWindow, @@ -1213,8 +1215,8 @@ void NetWMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const m_aWMAtoms[ UTF8_STRING ], 8, PropModeReplace, - (unsigned char*)aTitle.GetBuffer(), - aTitle.Len()+1 ); + (unsigned char*)aTitle.getStr(), + aTitle.getLength()+1 ); // The +1 copies the terminating null byte. Although // the spec says, this should not be necessary // at least the kwin implementation seems to depend -- cgit v1.2.3 From 6e613c590bdd7c6643616ac897533323ff77ebff Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 16 Jun 2011 22:49:31 +0100 Subject: ByteString -> rtl::OString --- vcl/unx/generic/plugadapt/salplug.cxx | 2 +- vcl/unx/gtk/app/gtksys.cxx | 25 +++++++++++++++---------- vcl/unx/headless/svppspgraphics.cxx | 8 +++++--- 3 files changed, 21 insertions(+), 14 deletions(-) (limited to 'vcl') diff --git a/vcl/unx/generic/plugadapt/salplug.cxx b/vcl/unx/generic/plugadapt/salplug.cxx index 3235aa9a58fa..8cadab79b0a7 100644 --- a/vcl/unx/generic/plugadapt/salplug.cxx +++ b/vcl/unx/generic/plugadapt/salplug.cxx @@ -272,7 +272,7 @@ void SalAbort( const XubString& rErrorText ) if( !rErrorText.Len() ) std::fprintf( stderr, "Application Error\n" ); else - std::fprintf( stderr, "%s\n", ByteString( rErrorText, gsl_getSystemTextEncoding() ).GetBuffer() ); + std::fprintf( stderr, "%s\n", rtl::OUStringToOString(rErrorText, gsl_getSystemTextEncoding()).getStr() ); exit(-1); } diff --git a/vcl/unx/gtk/app/gtksys.cxx b/vcl/unx/gtk/app/gtksys.cxx index 2076d39cc229..66987ef533e1 100644 --- a/vcl/unx/gtk/app/gtksys.cxx +++ b/vcl/unx/gtk/app/gtksys.cxx @@ -55,11 +55,11 @@ GtkSalSystem::~GtkSalSystem() } // convert ~ to indicate mnemonic to '_' -static ByteString MapToGtkAccelerator (const String &rStr) +static rtl::OString MapToGtkAccelerator(const String &rStr) { String aRet( rStr ); aRet.SearchAndReplaceAscii("~", String::CreateFromAscii("_")); - return ByteString( aRet, RTL_TEXTENCODING_UTF8 ); + return rtl::OUStringToOString(aRet, RTL_TEXTENCODING_UTF8); } int GtkSalSystem::ShowNativeDialog( const String& rTitle, @@ -76,14 +76,16 @@ int GtkSalSystem::ShowNativeDialog( const String& rTitle, std::fprintf( stderr, "GtkSalSystem::ShowNativeDialog\n"); #endif - ByteString aTitle( rTitle, RTL_TEXTENCODING_UTF8 ); - ByteString aMessage( rMessage, RTL_TEXTENCODING_UTF8 ); + rtl::OString aTitle(rtl::OUStringToOString(rTitle, + RTL_TEXTENCODING_UTF8)); + rtl::OString aMessage(rtl::OUStringToOString(rMessage, + RTL_TEXTENCODING_UTF8)); /* Create the dialogue */ GtkWidget* mainwin = gtk_message_dialog_new ( NULL, (GtkDialogFlags)0, GTK_MESSAGE_WARNING, - GTK_BUTTONS_NONE, aMessage.GetBuffer(), NULL ); - gtk_window_set_title( GTK_WINDOW( mainwin ), aTitle.GetBuffer() ); + GTK_BUTTONS_NONE, aMessage.getStr(), NULL ); + gtk_window_set_title( GTK_WINDOW( mainwin ), aTitle.getStr() ); gint nButtons = 0, nResponse; @@ -92,13 +94,16 @@ int GtkSalSystem::ShowNativeDialog( const String& rTitle, { if( nButton == nDefButton ) { - gtk_dialog_add_button( GTK_DIALOG( mainwin ), MapToGtkAccelerator(*it).GetBuffer(), nButtons ); - gtk_dialog_set_default_response( GTK_DIALOG( mainwin ), nButtons ); + gtk_dialog_add_button(GTK_DIALOG( mainwin ), + MapToGtkAccelerator(*it).getStr(), nButtons); + gtk_dialog_set_default_response(GTK_DIALOG(mainwin), nButtons); } else { - ByteString aLabel( *it, RTL_TEXTENCODING_UTF8 ); - gtk_dialog_add_button( GTK_DIALOG( mainwin ), aLabel.GetBuffer(), nButtons ); + rtl::OString aLabel(rtl::OUStringToOString(*it, + RTL_TEXTENCODING_UTF8)); + gtk_dialog_add_button(GTK_DIALOG(mainwin), aLabel.getStr(), + nButtons); } nButtons++; } diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx index 93fb0ced68b2..82f3ac43df96 100644 --- a/vcl/unx/headless/svppspgraphics.cxx +++ b/vcl/unx/headless/svppspgraphics.cxx @@ -1135,10 +1135,12 @@ ImplDevFontAttributes PspGraphics::Info2DevFontAttributes( const psp::FastPrintF #if OSL_DEBUG_LEVEL > 2 if( bHasMapNames ) { - ByteString aOrigName( aDFA.maName, osl_getThreadTextEncoding() ); - ByteString aAliasNames( aDFA.maMapNames, osl_getThreadTextEncoding() ); + rtl::OString aOrigName(rtl::OUStringToOString(aDFA.maName, + osl_getThreadTextEncoding())); + rtl::OString aAliasNames(rtl::OUStringToOString(aDFA.maMapNames, + osl_getThreadTextEncoding())); fprintf( stderr, "using alias names \"%s\" for font family \"%s\"\n", - aAliasNames.GetBuffer(), aOrigName.GetBuffer() ); + aAliasNames.getStr(), aOrigName.getStr() ); } #endif -- cgit v1.2.3 From b33ae7fc706c6f9a8130e34d5eafb0ffbf938905 Mon Sep 17 00:00:00 2001 From: Takeshi Abe Date: Sat, 18 Jun 2011 00:00:52 +0900 Subject: remove dead code --- regexp/source/reclass.cxx | 7 ------- svl/source/numbers/zformat.cxx | 17 +---------------- svl/source/svdde/ddesvr.cxx | 29 ----------------------------- svtools/source/contnr/imivctl1.cxx | 7 ------- toolkit/source/layout/vcl/wbutton.cxx | 4 ---- vcl/aqua/source/gdi/salatslayout.cxx | 2 -- vcl/unx/kde4/KDESalFrame.cxx | 2 -- 7 files changed, 1 insertion(+), 67 deletions(-) (limited to 'vcl') diff --git a/regexp/source/reclass.cxx b/regexp/source/reclass.cxx index 79457e6c1fd3..b296230ead9f 100644 --- a/regexp/source/reclass.cxx +++ b/regexp/source/reclass.cxx @@ -1362,13 +1362,6 @@ Regexpr::regex_compile() case (sal_Unicode)')': goto normal_backslash; - // unreachable (after goto): -#if 0 - if (COMPILE_STACK_EMPTY) { - FREE_STACK_RETURN(REG_ERPAREN); - } -#endif - handle_close: if (fixup_alt_jump) { /* Push a dummy failure point at the end of the diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 00ebf41a3dd7..cfc916993885 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -2007,15 +2007,7 @@ sal_Bool SvNumberformat::GetOutputString(String& sString, } return sal_False; } -/* -void SvNumberformat::GetNextFareyNumber(sal_uLong nPrec, sal_uLong x0, sal_uLong x1, - sal_uLong y0, sal_uLong y1, - sal_uLong& x2,sal_uLong& y2) -{ - x2 = ((y0+nPrec)/y1)*x1 - x0; - y2 = ((y0+nPrec)/y1)*y1 - y0; -} -*/ + sal_uLong SvNumberformat::ImpGGT(sal_uLong x, sal_uLong y) { if (y == 0) @@ -2417,7 +2409,6 @@ sal_Bool SvNumberformat::GetOutputString(double fNumber, { sal_uLong x2 = ((y0+nBasis)/y1)*x1 - x0; // naechste Farey-Zahl sal_uLong y2 = ((y0+nBasis)/y1)*y1 - y0; -// GetNextFareyNumber(nBasis, x0, x1, y0, y1, x2, y2); x0 = x1; y0 = y1; x1 = x2; @@ -2446,11 +2437,6 @@ sal_Bool SvNumberformat::GetOutputString(double fNumber, else // grosse Nenner { // 0,1234->123/1000 sal_uLong nGgt; -/* - nDiv = nBasis+1; - nFrac = ((sal_uLong)floor(0.5 + fNumber * - pow(10.0,rInfo.nCntExp))); -*/ nDiv = 10000000; nFrac = ((sal_uLong)floor(0.5 + fNumber * 10000000.0)); nGgt = ImpGGT(nDiv, nFrac); @@ -4421,7 +4407,6 @@ String SvNumberformat::GetMappedFormatstring( case NF_SYMBOLTYPE_CALDEL : if ( pStr[j+1].EqualsAscii("buddhist") ) { - //aStr.InsertAscii( "[$-", aStr.Len() ); aStr.InsertAscii( "[$-", 0 ); if ( rNum.IsSet() && rNum.GetNatNum() == 1 && MsLangId::getRealLanguage( rNum.GetLang() ) == diff --git a/svl/source/svdde/ddesvr.cxx b/svl/source/svdde/ddesvr.cxx index 99b8cce0ae71..08894db00556 100644 --- a/svl/source/svdde/ddesvr.cxx +++ b/svl/source/svdde/ddesvr.cxx @@ -88,7 +88,6 @@ HDDEDATA CALLBACK _export DdeInternal::SvrCallback( { int nTopics = 0; -#if 1 TCHAR chTopicBuf[250]; if( hText1 ) DdeQueryString( pInst->hDdeInstSvr, hText1, chTopicBuf, @@ -117,20 +116,6 @@ HDDEDATA CALLBACK _export DdeInternal::SvrCallback( } } -#else - for( pService = rAll.First();pService;pService = rAll.Next() ) - { - if ( !hText2 || ( *pService->pName == hText2 ) ) - { - std::vector::const_iterator iter; - for (iter = pService->aTopics.begin(); iter != pService->aTopics.end(); ++iter) - { - if ( !hText1 || iter->pName == hText1 ) - nTopics++; - } - } - } -#endif if( !nTopics ) return (HDDEDATA)NULL; @@ -143,18 +128,6 @@ HDDEDATA CALLBACK _export DdeInternal::SvrCallback( { if ( !hText2 || (*pService->pName == hText2 ) ) { -#if 0 - for ( pTopic = pService->aTopics.First(); pTopic; - pTopic = pService->aTopics.Next() ) - { - if ( !hText1 || (*pTopic->pName == hText1) ) - { - q->hszSvc = *pService->pName; - q->hszTopic = *pTopic->pName; - q++; - } - } -#else String sTopics( pService->Topics() ); sal_uInt16 n = 0; while( STRING_NOTFOUND != n ) @@ -173,8 +146,6 @@ HDDEDATA CALLBACK _export DdeInternal::SvrCallback( } } } - -#endif } } diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx index 640f6c5ae923..cdb95366d560 100644 --- a/svtools/source/contnr/imivctl1.cxx +++ b/svtools/source/contnr/imivctl1.cxx @@ -2754,15 +2754,8 @@ void SvxIconChoiceCtrl_Impl::Command( const CommandEvent& rCEvt ) (rCEvt.GetCommand() == COMMAND_STARTAUTOSCROLL) || (rCEvt.GetCommand() == COMMAND_AUTOSCROLL) ) { -#if 1 if( HandleScrollCommand( rCEvt ) ) return; -#else - ScrollBar* pHor = aHorSBar.IsVisible() ? &aHorSBar : 0; - ScrollBar* pVer = aVerSBar.IsVisible() ? &aVerSBar : 0; - if( pView->HandleScrollCommand( rCEvt, pHor, pVer ) ) - return; -#endif } } diff --git a/toolkit/source/layout/vcl/wbutton.cxx b/toolkit/source/layout/vcl/wbutton.cxx index 5e303ada03ba..96e6aeb5d251 100644 --- a/toolkit/source/layout/vcl/wbutton.cxx +++ b/toolkit/source/layout/vcl/wbutton.cxx @@ -276,7 +276,6 @@ public: if ( !mxRadioButton.is() ) return; -#if 1 // Have setState fire item event for // RadioGroups::RadioGroup::itemStateChanged () ::RadioButton *r = static_cast(mpWindow)->GetRadioButton (); @@ -284,9 +283,6 @@ public: r->EnableRadioCheck(); mxRadioButton->setState( !!bCheck ); r->EnableRadioCheck (state); -#else - mxRadioButton->setState( !!bCheck ); -#endif fireToggle(); } diff --git a/vcl/aqua/source/gdi/salatslayout.cxx b/vcl/aqua/source/gdi/salatslayout.cxx index 94022b763a03..1c193378b9cf 100644 --- a/vcl/aqua/source/gdi/salatslayout.cxx +++ b/vcl/aqua/source/gdi/salatslayout.cxx @@ -1043,7 +1043,6 @@ bool ATSLayout::GetDeltaY() const if( mpDeltaY != NULL ) return true; -#if 1 if( !maATSULayout ) return false; @@ -1069,7 +1068,6 @@ bool ATSLayout::GetDeltaY() const mpDeltaY = NULL; return false; } -#endif return true; } diff --git a/vcl/unx/kde4/KDESalFrame.cxx b/vcl/unx/kde4/KDESalFrame.cxx index 98b84ce54d7a..10e73502927c 100644 --- a/vcl/unx/kde4/KDESalFrame.cxx +++ b/vcl/unx/kde4/KDESalFrame.cxx @@ -88,8 +88,6 @@ static OUString readEntryUntranslated( KConfigGroup *pGroup, const char *pKey ) return OUString::createFromAscii( (const char *) pGroup->readEntryUntranslated( pKey ).toAscii() ); } -#if 0 -#endif /** Helper function to add information to Font from QFont. Mostly grabbed from the Gtk+ vclplug (salnativewidgets-gtk.cxx). -- cgit v1.2.3 From 0e6ab013f7def9891c2e982bec76458a64953c20 Mon Sep 17 00:00:00 2001 From: Hans-Joachim Lankenau Date: Mon, 30 May 2011 18:09:09 +0200 Subject: ause130: #i117218# change .idl handling to gnu make --- basegfx/prj/build.lst | 2 +- canvas/prj/build.lst | 2 +- comphelper/Library_comphelp.mk | 6 +++++- comphelper/prj/build.lst | 2 +- cppcanvas/prj/build.lst | 2 +- dtrans/prj/build.lst | 2 +- i18nutil/prj/build.lst | 2 +- padmin/Executable_spadmin.bin.mk | 6 +++++- padmin/Library_spa.mk | 10 +++++----- sot/Library_sot.mk | 6 +++++- svl/Library_fsstorage.mk | 6 +++++- svl/Library_passwordcontainer.mk | 6 +++++- svl/Library_svl.mk | 7 ++++++- svl/prj/build.lst | 2 +- svtools/Executable_bmp.mk | 6 +++++- svtools/Executable_bmpsum.mk | 6 +++++- svtools/Executable_g2g.mk | 6 +++++- svtools/Library_hatchwindowfactory.mk | 6 +++++- svtools/Library_productregistration.mk | 6 +++++- svtools/Library_svt.mk | 8 ++++++-- svtools/prj/build.lst | 2 +- toolkit/Library_tk.mk | 6 +++++- tools/Library_tl.mk | 6 +++++- tools/StaticLibrary_ooopathutils.mk | 2 +- tools/prj/build.lst | 2 +- ucbhelper/prj/build.lst | 2 +- unotools/prj/build.lst | 2 +- vcl/prj/build.lst | 2 +- 28 files changed, 90 insertions(+), 33 deletions(-) (limited to 'vcl') diff --git a/basegfx/prj/build.lst b/basegfx/prj/build.lst index fe3354b3f256..01a39b6d964f 100644 --- a/basegfx/prj/build.lst +++ b/basegfx/prj/build.lst @@ -1,4 +1,4 @@ -fx basegfx : o3tl sal offuh cppuhelper cppu CPPUNIT:cppunit NULL +fx basegfx : o3tl sal offapi cppuhelper cppu CPPUNIT:cppunit NULL fx basegfx usr1 - all fx_mkout NULL fx basegfx\inc nmake - all fx_inc NULL fx basegfx\prj get - all fx_prj NULL diff --git a/canvas/prj/build.lst b/canvas/prj/build.lst index 121be382208f..dad6e28c0ea5 100644 --- a/canvas/prj/build.lst +++ b/canvas/prj/build.lst @@ -1,4 +1,4 @@ -cv canvas : javaunohelper comphelper cppuhelper offuh unoil tools svtools vcl basegfx CAIRO:cairo LIBXSLT:libxslt NULL +cv canvas : javaunohelper comphelper cppuhelper offapi unoil tools svtools vcl basegfx CAIRO:cairo LIBXSLT:libxslt NULL cv canvas usr1 - all cv_mkout NULL cv canvas\inc nmake - all cv_inc NULL cv canvas\source\tools nmake - all cv_tools cv_inc NULL diff --git a/comphelper/Library_comphelp.mk b/comphelper/Library_comphelp.mk index 8336b8cb2124..64c58cc65623 100644 --- a/comphelper/Library_comphelp.mk +++ b/comphelper/Library_comphelp.mk @@ -37,7 +37,6 @@ $(eval $(call gb_Library_set_include,comphelper,\ -I$(realpath $(SRCDIR)/comphelper/inc/pch) \ -I$(realpath $(SRCDIR)/comphelper/source/inc) \ $$(INCLUDE) \ - -I$(OUTDIR)/inc/offuh \ )) $(eval $(call gb_Library_set_defs,comphelper,\ @@ -53,6 +52,11 @@ $(eval $(call gb_Library_add_linked_libs,comphelper,\ $(gb_STDLIBS) \ )) +$(eval $(call gb_Library_add_api,comphelper,\ + udkapi \ + offapi \ +)) + $(eval $(call gb_Library_add_exception_objects,comphelper,\ comphelper/source/compare/AnyCompareFactory \ comphelper/source/container/IndexedPropertyValuesContainer \ diff --git a/comphelper/prj/build.lst b/comphelper/prj/build.lst index a828870f2dbf..7dde46c47c7e 100644 --- a/comphelper/prj/build.lst +++ b/comphelper/prj/build.lst @@ -1,2 +1,2 @@ -ph comphelper : cppuhelper ucbhelper offuh salhelper LIBXSLT:libxslt NULL +ph comphelper : cppuhelper ucbhelper offapi salhelper LIBXSLT:libxslt NULL ch comphelper\prj nmake - all ch_all NULL diff --git a/cppcanvas/prj/build.lst b/cppcanvas/prj/build.lst index 317e3276c249..143af130f39b 100644 --- a/cppcanvas/prj/build.lst +++ b/cppcanvas/prj/build.lst @@ -1,4 +1,4 @@ -cx cppcanvas : comphelper cppuhelper offuh tools vcl basegfx canvas NULL +cx cppcanvas : comphelper cppuhelper offapi tools vcl basegfx canvas NULL cx cppcanvas usr1 - all cx_mkout NULL cx cppcanvas\inc nmake - all cx_inc NULL cx cppcanvas\source\tools nmake - all cx_tools cx_inc NULL diff --git a/dtrans/prj/build.lst b/dtrans/prj/build.lst index f93333ff9dfd..519e1fda37c8 100644 --- a/dtrans/prj/build.lst +++ b/dtrans/prj/build.lst @@ -1,4 +1,4 @@ -dr dtrans : unotools offapi offuh DESKTOP:rdbmaker stoc LIBXSLT:libxslt NULL +dr dtrans : unotools offapi DESKTOP:rdbmaker stoc LIBXSLT:libxslt NULL dr dtrans usr1 - all dr_mkout NULL dr dtrans\inc nmake - all dr_inc NULL dr dtrans\source\cnttype nmake - all dr_cnttype dr_generic dr_inc NULL diff --git a/i18nutil/prj/build.lst b/i18nutil/prj/build.lst index 311b6d572943..55c86ad3038f 100644 --- a/i18nutil/prj/build.lst +++ b/i18nutil/prj/build.lst @@ -1,3 +1,3 @@ -inu i18nutil : sal cppu offuh NULL +inu i18nutil : sal cppu offapi NULL inu i18nutil usr1 - all inu_mkout NULL inu i18nutil\source\utility nmake - all inu_utility NULL diff --git a/padmin/Executable_spadmin.bin.mk b/padmin/Executable_spadmin.bin.mk index bcb69b28e748..4ec56f2cf7e0 100644 --- a/padmin/Executable_spadmin.bin.mk +++ b/padmin/Executable_spadmin.bin.mk @@ -30,7 +30,6 @@ $(eval $(call gb_Executable_Executable,spadmin.bin)) $(eval $(call gb_Executable_set_include,spadmin.bin,\ $$(INCLUDE) \ -I$(OUTDIR)/inc \ - -I$(OUTDIR)/inc/offuh \ )) $(eval $(call gb_Executable_set_cxxflags,spadmin.bin,\ @@ -41,6 +40,11 @@ $(eval $(call gb_Executable_add_linked_static_libs,spadmin.bin,\ vclmain \ )) +$(eval $(call gb_Executable_add_api,spadmin.bin,\ + udkapi \ + offapi \ +)) + $(eval $(call gb_Executable_add_linked_libs,spadmin.bin,\ spa \ svt \ diff --git a/padmin/Library_spa.mk b/padmin/Library_spa.mk index 3cd9dc7c271e..e72c676b57eb 100644 --- a/padmin/Library_spa.mk +++ b/padmin/Library_spa.mk @@ -27,16 +27,16 @@ $(eval $(call gb_Library_Library,spa)) -$(eval $(call gb_Library_set_include,spa,\ - $$(INCLUDE) \ - -I$(OUTDIR)/inc/offuh \ -)) - $(eval $(call gb_Library_set_defs,spa,\ $$(DEFS) \ -DSPA_DLLIMPLEMENTATION \ )) +$(eval $(call gb_Library_add_api,spa,\ + udkapi \ + offapi \ +)) + $(eval $(call gb_Library_add_linked_libs,spa,\ svt \ vcl \ diff --git a/sot/Library_sot.mk b/sot/Library_sot.mk index 51679534763c..927fdc001045 100644 --- a/sot/Library_sot.mk +++ b/sot/Library_sot.mk @@ -36,7 +36,11 @@ $(eval $(call gb_Library_set_componentfile,sot,sot/util/sot)) $(eval $(call gb_Library_set_include,sot,\ -I$(realpath $(SRCDIR)/sot/inc/pch) \ $$(INCLUDE) \ - -I$(OUTDIR)/inc/offuh \ +)) + +$(eval $(call gb_Library_add_api,sot,\ + udkapi \ + offapi \ )) $(eval $(call gb_Library_set_defs,sot,\ diff --git a/svl/Library_fsstorage.mk b/svl/Library_fsstorage.mk index 3e27ae8f4357..121049b9cff7 100644 --- a/svl/Library_fsstorage.mk +++ b/svl/Library_fsstorage.mk @@ -37,10 +37,14 @@ $(eval $(call gb_Library_set_include,fsstorage,\ -I$(realpath $(SRCDIR)/svl/inc/svl) \ -I$(realpath $(SRCDIR)/svl/source/inc) \ -I$(realpath $(SRCDIR)/svl/inc/pch) \ - -I$(OUTDIR)/inc/offuh \ -I$(OUTDIR)/inc \ )) +$(eval $(call gb_Library_add_api,fsstorage,\ + udkapi \ + offapi \ +)) + $(eval $(call gb_Library_add_linked_libs,fsstorage,\ comphelper \ cppu \ diff --git a/svl/Library_passwordcontainer.mk b/svl/Library_passwordcontainer.mk index 58b4b6edb6a7..3826dca597dd 100644 --- a/svl/Library_passwordcontainer.mk +++ b/svl/Library_passwordcontainer.mk @@ -37,10 +37,14 @@ $(eval $(call gb_Library_set_include,passwordcontainer,\ -I$(realpath $(SRCDIR)/svl/inc/svl) \ -I$(realpath $(SRCDIR)/svl/source/inc) \ -I$(realpath $(SRCDIR)/svl/inc/pch) \ - -I$(OUTDIR)/inc/offuh \ -I$(OUTDIR)/inc \ )) +$(eval $(call gb_Library_add_api,passwordcontainer,\ + udkapi \ + offapi \ +)) + $(eval $(call gb_Library_add_linked_libs,passwordcontainer,\ cppu \ cppuhelper \ diff --git a/svl/Library_svl.mk b/svl/Library_svl.mk index 246530a22bb3..638ab9c89832 100644 --- a/svl/Library_svl.mk +++ b/svl/Library_svl.mk @@ -37,7 +37,12 @@ $(eval $(call gb_Library_set_include,svl,\ $$(SOLARINC) \ -I$(realpath $(SRCDIR)/svl/source/inc) \ -I$(realpath $(SRCDIR)/svl/inc/pch) \ - -I$(OUTDIR)/inc/offuh \ + -I$(SRCDIR)/svl/inc/pch \ +)) + +$(eval $(call gb_Library_add_api,svl,\ + udkapi \ + offapi \ )) $(eval $(call gb_Library_set_defs,svl,\ diff --git a/svl/prj/build.lst b/svl/prj/build.lst index 58c150563e5e..5fc7d0e223a3 100644 --- a/svl/prj/build.lst +++ b/svl/prj/build.lst @@ -1,3 +1,3 @@ -sl svl : TRANSLATIONS:translations DESKTOP:rsc offuh ucbhelper unotools cppu cppuhelper comphelper sal sot LIBXSLT:libxslt NULL +sl svl : TRANSLATIONS:translations DESKTOP:rsc offapi ucbhelper unotools cppu cppuhelper comphelper sal sot LIBXSLT:libxslt NULL sl svl\prj nmake - all svl_prj NULL # sl svl\qa\unit nmake - all svl_qa_cppunit svl_util NULL diff --git a/svtools/Executable_bmp.mk b/svtools/Executable_bmp.mk index 3b2fd2a1203c..f05013df4170 100644 --- a/svtools/Executable_bmp.mk +++ b/svtools/Executable_bmp.mk @@ -36,7 +36,11 @@ $(eval $(call gb_Executable_set_include,bmp,\ -I$(realpath $(SRCDIR)/svtools/inc/svtools) \ -I$(realpath $(SRCDIR)/svtools/source/inc) \ -I$(realpath $(SRCDIR)/svtools/inc/pch) \ - -I$(OUTDIR)/inc/offuh \ +)) + +$(eval $(call gb_Executable_add_api,bmp,\ + udkapi \ + offapi \ )) $(eval $(call gb_Executable_add_linked_libs,bmp,\ diff --git a/svtools/Executable_bmpsum.mk b/svtools/Executable_bmpsum.mk index 492dabeb58f8..1bef32c970de 100644 --- a/svtools/Executable_bmpsum.mk +++ b/svtools/Executable_bmpsum.mk @@ -30,12 +30,16 @@ $(eval $(call gb_Executable_Executable,bmpsum)) $(eval $(call gb_Executable_set_include,bmpsum,\ $$(INCLUDE) \ -I$(OUTDIR)/inc/ \ - -I$(OUTDIR)/inc/offuh/ \ -I$(realpath $(SRCDIR)/svtools/inc) \ -I$(realpath $(SRCDIR)/svtools/inc/pch) \ -I$(realpath $(SRCDIR)/svtools/inc/svtools) \ )) +$(eval $(call gb_Executable_add_api,bmpsum,\ + udkapi \ + offapi \ +)) + $(eval $(call gb_Executable_add_linked_libs,bmpsum,\ sal \ tl \ diff --git a/svtools/Executable_g2g.mk b/svtools/Executable_g2g.mk index c817cff43ccd..c41dae777dbd 100644 --- a/svtools/Executable_g2g.mk +++ b/svtools/Executable_g2g.mk @@ -30,12 +30,16 @@ $(eval $(call gb_Executable_Executable,g2g)) $(eval $(call gb_Executable_set_include,g2g,\ $$(INCLUDE) \ -I$(OUTDIR)/inc/ \ - -I$(OUTDIR)/inc/offuh/ \ -I$(realpath $(SRCDIR)/svtools/inc) \ -I$(realpath $(SRCDIR)/svtools/inc/pch) \ -I$(realpath $(SRCDIR)/svtools/inc/svtools) \ )) +$(eval $(call gb_Executable_add_api,g2g,\ + udkapi \ + offapi \ +)) + $(eval $(call gb_Executable_add_linked_libs,g2g,\ jvmfwk \ sal \ diff --git a/svtools/Library_hatchwindowfactory.mk b/svtools/Library_hatchwindowfactory.mk index 96e8f10c3306..91b92267ddd5 100644 --- a/svtools/Library_hatchwindowfactory.mk +++ b/svtools/Library_hatchwindowfactory.mk @@ -36,10 +36,14 @@ $(eval $(call gb_Library_set_include,hatchwindowfactory,\ -I$(realpath $(SRCDIR)/svtools/inc/pch) \ -I$(OUTDIR)/inc/ \ -I$(realpath $(SRCDIR)/svtools/inc) \ - -I$(OUTDIR)/inc/offuh \ -I$(OUTDIR)/inc \ )) +$(eval $(call gb_Library_add_api,hatchwindowfactory,\ + udkapi \ + offapi \ +)) + $(eval $(call gb_Library_add_linked_libs,hatchwindowfactory,\ cppu \ cppuhelper \ diff --git a/svtools/Library_productregistration.mk b/svtools/Library_productregistration.mk index 726e5a3b664b..44867f4530e3 100644 --- a/svtools/Library_productregistration.mk +++ b/svtools/Library_productregistration.mk @@ -36,10 +36,14 @@ $(eval $(call gb_Library_set_include,productregistration,\ -I$(realpath $(SRCDIR)/svtools/inc/pch) \ -I$(OUTDIR)/inc/ \ -I$(realpath $(SRCDIR)/svtools/inc) \ - -I$(OUTDIR)/inc/offuh \ -I$(OUTDIR)/inc \ )) +$(eval $(call gb_Library_add_api,productregistration,\ + udkapi \ + offapi \ +)) + $(eval $(call gb_Library_add_linked_libs,productregistration,\ cppu \ cppuhelper \ diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk index def31f0d121f..2dee92a7dceb 100644 --- a/svtools/Library_svt.mk +++ b/svtools/Library_svt.mk @@ -33,17 +33,21 @@ $(eval $(call gb_Library_add_precompiled_header,svt,$(SRCDIR)/svtools/inc/pch/pr $(eval $(call gb_Library_set_componentfile,svt,svtools/util/svt)) +$(eval $(call gb_Library_add_api,svt,\ + udkapi \ + offapi \ +)) + $(eval $(call gb_Library_set_include,svt,\ -I$(OUTDIR)/inc/external/jpeg \ $$(INCLUDE) \ -I$(WORKDIR)/inc/svtools \ -I$(WORKDIR)/inc/ \ -I$(OUTDIR)/inc/ \ - -I$(realpath $(SRCDIR)/svtools/inc) \ -I$(realpath $(SRCDIR)/svtools/inc/svtools) \ -I$(realpath $(SRCDIR)/svtools/source/inc) \ -I$(realpath $(SRCDIR)/svtools/inc/pch) \ - -I$(OUTDIR)/inc/offuh \ + -I$(realpath $(SRCDIR)/svtools/inc) \ )) $(eval $(call gb_Library_set_defs,svt,\ diff --git a/svtools/prj/build.lst b/svtools/prj/build.lst index 7ac223ae1588..a438456220a0 100644 --- a/svtools/prj/build.lst +++ b/svtools/prj/build.lst @@ -1,2 +1,2 @@ -st svtools : TRANSLATIONS:translations svl offuh toolkit ucbhelper unotools JPEG:jpeg cppu cppuhelper comphelper sal salhelper sot jvmfwk LIBXSLT:libxslt NULL +st svtools : TRANSLATIONS:translations svl offapi toolkit ucbhelper unotools JPEG:jpeg cppu cppuhelper comphelper sal salhelper sot jvmfwk LIBXSLT:libxslt NULL st svtools\prj nmake - all st_prj NULL diff --git a/toolkit/Library_tk.mk b/toolkit/Library_tk.mk index 1a94bbd21ab1..84c05eb752ab 100644 --- a/toolkit/Library_tk.mk +++ b/toolkit/Library_tk.mk @@ -38,7 +38,6 @@ $(eval $(call gb_Library_set_include,tk,\ -I$(realpath $(SRCDIR)/toolkit/inc) \ -I$(realpath $(SRCDIR)/toolkit/inc/pch) \ -I$(realpath $(SRCDIR)/toolkit/source) \ - -I$(OUTDIR)/inc/offuh \ )) $(eval $(call gb_Library_set_defs,tk,\ @@ -46,6 +45,11 @@ $(eval $(call gb_Library_set_defs,tk,\ -DTOOLKIT_DLLIMPLEMENTATION \ )) +$(eval $(call gb_Library_add_api,tk,\ + udkapi \ + offapi \ +)) + $(eval $(call gb_Library_add_linked_libs,tk,\ comphelper \ cppu \ diff --git a/tools/Library_tl.mk b/tools/Library_tl.mk index da3e0276f521..ad3c9c4ec682 100644 --- a/tools/Library_tl.mk +++ b/tools/Library_tl.mk @@ -38,7 +38,6 @@ $(eval $(call gb_Library_set_include,tl,\ -I$(realpath $(SRCDIR)/tools/inc/pch) \ -I$(SRCDIR)/solenv/inc \ -I$(SRCDIR)/solenv/inc/Xp31 \ - -I$(OUTDIR)/inc/offuh \ -I$(WORKDIR)/CustomTarget/tools/source/reversemap \ )) @@ -48,6 +47,11 @@ $(eval $(call gb_Library_set_defs,tl,\ -DVCL \ )) +$(eval $(call gb_Library_add_api,tl,\ + udkapi \ + offapi \ +)) + $(eval $(call gb_Library_add_linked_libs,tl,\ basegfx \ comphelper \ diff --git a/tools/StaticLibrary_ooopathutils.mk b/tools/StaticLibrary_ooopathutils.mk index e58becb175d3..c5b2ea6ad846 100644 --- a/tools/StaticLibrary_ooopathutils.mk +++ b/tools/StaticLibrary_ooopathutils.mk @@ -39,7 +39,7 @@ $(eval $(call gb_StaticLibrary_add_exception_objects,ooopathutils,\ # Instead of this evil linking of an object from $(OUTDIR) define StaticLibrary_ooopathutils_hack $(call gb_StaticLibrary_get_target,ooopathutils) : $(OUTDIR)/lib/$(1) -$$(eval $$(call gb_Deliver_add_deliverable,$(OUTDIR)/lib/$(1),$(call gb_CxxObject_get_target,tools/source/misc/pathutils))) +$$(eval $$(call gb_Deliver_add_deliverable,$(OUTDIR)/lib/$(1),$(call gb_CxxObject_get_target,tools/source/misc/pathutils),$(1))) $(OUTDIR)/lib/$(1) : $(call gb_CxxObject_get_target,tools/source/misc/pathutils) $$(call gb_Deliver_deliver,$$<,$$@) diff --git a/tools/prj/build.lst b/tools/prj/build.lst index eeb470c384d6..ee6803567843 100644 --- a/tools/prj/build.lst +++ b/tools/prj/build.lst @@ -1,3 +1,3 @@ -tl tools : cppu external offuh ZLIB:zlib EXPAT:expat basegfx comphelper i18npool NULL +tl tools : cppu external offapi ZLIB:zlib EXPAT:expat basegfx comphelper i18npool NULL tl tools\prj nmake - all tl_prj NULL # tl tools\qa nmake - all tl_qa tl_utl NULL diff --git a/ucbhelper/prj/build.lst b/ucbhelper/prj/build.lst index bbd01df9022a..f97173305622 100644 --- a/ucbhelper/prj/build.lst +++ b/ucbhelper/prj/build.lst @@ -1,4 +1,4 @@ -uh ucbhelper : offuh sal cppu cppuhelper salhelper NULL +uh ucbhelper : offapi sal cppu cppuhelper salhelper NULL uh ucbhelper usr1 - all uh_mkout NULL uh ucbhelper\inc nmake - all uh_inc NULL uh ucbhelper\source\client nmake - all uh_client uh_inc NULL diff --git a/unotools/prj/build.lst b/unotools/prj/build.lst index b7883fa2e3dd..8e182910f277 100644 --- a/unotools/prj/build.lst +++ b/unotools/prj/build.lst @@ -1,3 +1,3 @@ -ut unotools : LIBXSLT:libxslt comphelper cppuhelper offuh tools ucbhelper NULL +ut unotools : LIBXSLT:libxslt comphelper cppuhelper offapi tools ucbhelper NULL ut unotools\prj nmake - all ut_prj NULL diff --git a/vcl/prj/build.lst b/vcl/prj/build.lst index 1b32995ae668..6db5d660f085 100644 --- a/vcl/prj/build.lst +++ b/vcl/prj/build.lst @@ -1,4 +1,4 @@ -vc vcl : TRANSLATIONS:translations apple_remote BOOST:boost DESKTOP:rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offuh basegfx basebmp tools DESKTOP:l10ntools icc cpputools svl LIBXSLT:libxslt NULL +vc vcl : TRANSLATIONS:translations apple_remote BOOST:boost DESKTOP:rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offapi basegfx basebmp tools l10ntools icc cpputools svl LIBXSLT:libxslt NULL vc vcl usr1 - all vc_mkout NULL vc vcl\prj nmake - all vc_prj NULL -- cgit v1.2.3 From 254cb2dc95c29e0ddf250db5daf775f9897f5790 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Mon, 30 May 2011 18:47:58 +0200 Subject: remove all traces of offuh from makefiles --- unotools/Library_utl.mk | 6 +++++- vcl/Library_desktop_detector.mk | 6 +++++- vcl/Library_vcl.mk | 6 +++++- vcl/Library_vclplug_gen.mk | 6 +++++- vcl/Library_vclplug_gtk.mk | 6 +++++- vcl/Library_vclplug_kde.mk | 6 +++++- vcl/Library_vclplug_kde4.mk | 6 +++++- vcl/Library_vclplug_svp.mk | 6 +++++- vcl/StaticLibrary_vclmain.mk | 5 ++++- 9 files changed, 44 insertions(+), 9 deletions(-) (limited to 'vcl') diff --git a/unotools/Library_utl.mk b/unotools/Library_utl.mk index 1a86c469996c..b77a8ebb6826 100644 --- a/unotools/Library_utl.mk +++ b/unotools/Library_utl.mk @@ -35,7 +35,6 @@ $(eval $(call gb_Library_set_include,utl,\ $$(INCLUDE) \ -I$(realpath $(SRCDIR)/unotools/inc/pch) \ -I$(OUTDIR)/inc \ - -I$(OUTDIR)/inc/offuh \ )) $(eval $(call gb_Library_set_defs,utl,\ @@ -43,6 +42,11 @@ $(eval $(call gb_Library_set_defs,utl,\ -DUNOTOOLS_DLLIMPLEMENTATION \ )) +$(eval $(call gb_Library_add_api,utl,\ + offapi \ + udkapi \ +)) + $(eval $(call gb_Library_add_linked_libs,utl,\ comphelper \ cppu \ diff --git a/vcl/Library_desktop_detector.mk b/vcl/Library_desktop_detector.mk index c7e1cd087d4e..7a34ee739461 100644 --- a/vcl/Library_desktop_detector.mk +++ b/vcl/Library_desktop_detector.mk @@ -36,7 +36,6 @@ $(eval $(call gb_Library_set_include,desktop_detector,\ -I$(realpath $(SRCDIR)/vcl/inc) \ -I$(realpath $(SRCDIR)/vcl/inc/pch) \ -I$(SRCDIR)/solenv/inc \ - -I$(OUTDIR)/inc/offuh \ -I$(OUTDIR)/inc \ )) @@ -45,6 +44,11 @@ $(eval $(call gb_Library_set_defs,desktop_detector,\ -DDESKTOP_DETECTOR_IMPLEMENTATION \ )) +$(eval $(call gb_Library_add_api,desktop_detector,\ + offapi \ + udkapi \ +)) + $(eval $(call gb_Library_add_linked_libs,desktop_detector,\ vcl \ tl \ diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index d663d462d972..c8292cf7ac71 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -43,7 +43,6 @@ $(eval $(call gb_Library_set_include,vcl,\ -I$(realpath $(SRCDIR)/vcl/inc) \ -I$(realpath $(SRCDIR)/vcl/inc/pch) \ -I$(SRCDIR)/solenv/inc \ - -I$(OUTDIR)/inc/offuh \ -I$(OUTDIR)/inc \ -I$(WORKDIR)/CustomTarget/vcl/unx/generic/fontmanager \ )) @@ -61,6 +60,11 @@ $(eval $(call gb_Library_set_defs,vcl,\ -DDLLPOSTFIX=$(subst $(or $(gb_Library_DLLEXT),$(gb_Library_PLAINEXT)),,$(gb_Library_OOOEXT)) \ )) +$(eval $(call gb_Library_add_api,vcl,\ + offapi \ + udkapi \ +)) + $(eval $(call gb_Library_add_linked_libs,vcl,\ tl \ utl \ diff --git a/vcl/Library_vclplug_gen.mk b/vcl/Library_vclplug_gen.mk index 494f36acc349..b5cca31d365f 100644 --- a/vcl/Library_vclplug_gen.mk +++ b/vcl/Library_vclplug_gen.mk @@ -32,10 +32,14 @@ $(eval $(call gb_Library_set_include,vclplug_gen,\ -I$(SRCDIR)/vcl/inc \ -I$(SRCDIR)/vcl/inc/pch \ -I$(SRCDIR)/solenv/inc \ - -I$(OUTDIR)/inc/offuh \ -I$(OUTDIR)/inc \ )) +$(eval $(call gb_Library_add_api,vclplug_gen,\ + offapi \ + udkapi \ +)) + $(eval $(call gb_Library_add_linked_libs,vclplug_gen,\ vcl \ tl \ diff --git a/vcl/Library_vclplug_gtk.mk b/vcl/Library_vclplug_gtk.mk index 838df57d1d8e..da001a220565 100644 --- a/vcl/Library_vclplug_gtk.mk +++ b/vcl/Library_vclplug_gtk.mk @@ -32,7 +32,6 @@ $(eval $(call gb_Library_set_include,vclplug_gtk,\ -I$(SRCDIR)/vcl/inc \ -I$(SRCDIR)/vcl/inc/pch \ -I$(SRCDIR)/solenv/inc \ - -I$(OUTDIR)/inc/offuh \ -I$(OUTDIR)/inc \ )) @@ -62,6 +61,11 @@ $(eval $(call gb_Library_set_ldflags,vclplug_gtk,\ )) endif +$(eval $(call gb_Library_add_api,vclplug_gtk,\ + offapi \ + udkapi \ +)) + $(eval $(call gb_Library_set_ldflags,vclplug_gtk,\ $$(LDFLAGS) \ $$(GTK_LIBS) \ diff --git a/vcl/Library_vclplug_kde.mk b/vcl/Library_vclplug_kde.mk index efb134d912ac..bcec46732b7d 100644 --- a/vcl/Library_vclplug_kde.mk +++ b/vcl/Library_vclplug_kde.mk @@ -32,7 +32,6 @@ $(eval $(call gb_Library_set_include,vclplug_kde,\ -I$(SRCDIR)/vcl/inc \ -I$(SRCDIR)/vcl/inc/pch \ -I$(SRCDIR)/solenv/inc \ - -I$(OUTDIR)/inc/offuh \ -I$(OUTDIR)/inc \ )) @@ -46,6 +45,11 @@ $(eval $(call gb_Library_set_defs,vclplug_kde,\ -DVCLPLUG_KDE_IMPLEMENTATION \ )) +$(eval $(call gb_Library_add_api,vclplug_kde,\ + offapi \ + udkapi \ +)) + $(eval $(call gb_Library_set_ldflags,vclplug_kde,\ $$(KDE_LIBS)\ $$(LDFLAGS) \ diff --git a/vcl/Library_vclplug_kde4.mk b/vcl/Library_vclplug_kde4.mk index 0f7f3e78696b..c075ca3ba4e1 100644 --- a/vcl/Library_vclplug_kde4.mk +++ b/vcl/Library_vclplug_kde4.mk @@ -34,7 +34,6 @@ $(eval $(call gb_Library_set_include,vclplug_kde4,\ -I$(SRCDIR)/vcl/inc \ -I$(SRCDIR)/vcl/inc/pch \ -I$(SRCDIR)/solenv/inc \ - -I$(OUTDIR)/inc/offuh \ -I$(OUTDIR)/inc \ -I$(WORKDIR)/CustomTarget/vcl/unx/kde4 \ )) @@ -49,6 +48,11 @@ $(eval $(call gb_Library_set_defs,vclplug_kde4,\ -DVCLPLUG_KDE4_IMPLEMENTATION \ )) +$(eval $(call gb_Library_add_api,vclplug_kde4,\ + offapi \ + udkapi \ +)) + $(eval $(call gb_Library_set_ldflags,vclplug_kde4,\ $$(KDE4_LIBS)\ $$(LDFLAGS) \ diff --git a/vcl/Library_vclplug_svp.mk b/vcl/Library_vclplug_svp.mk index 5ba89f3568db..8c222ad05b9b 100644 --- a/vcl/Library_vclplug_svp.mk +++ b/vcl/Library_vclplug_svp.mk @@ -32,7 +32,6 @@ $(eval $(call gb_Library_set_include,vclplug_svp,\ -I$(SRCDIR)/vcl/inc \ -I$(SRCDIR)/vcl/inc/pch \ -I$(SRCDIR)/solenv/inc \ - -I$(OUTDIR)/inc/offuh \ -I$(OUTDIR)/inc \ )) @@ -41,6 +40,11 @@ $(eval $(call gb_Library_set_defs,vclplug_svp,\ -DVCLPLUG_SVP_IMPLEMENTATION \ )) +$(eval $(call gb_Library_add_api,vclplug_svp,\ + offapi \ + udkapi \ +)) + $(eval $(call gb_Library_add_linked_libs,vclplug_svp,\ vcl \ vclplug_gen \ diff --git a/vcl/StaticLibrary_vclmain.mk b/vcl/StaticLibrary_vclmain.mk index 044ce10ca40c..1b6496ce2623 100644 --- a/vcl/StaticLibrary_vclmain.mk +++ b/vcl/StaticLibrary_vclmain.mk @@ -32,10 +32,13 @@ $(eval $(call gb_StaticLibrary_set_include,vclmain,\ -I$(realpath $(SRCDIR)/vcl/inc) \ -I$(realpath $(SRCDIR)/vcl/inc/pch) \ -I$(SRCDIR)/solenv/inc \ - -I$(OUTDIR)/inc/offuh \ -I$(OUTDIR)/inc \ )) +$(eval $(call gb_StaticLibrary_add_api,vclmain,\ + udkapi \ +)) + $(eval $(call gb_StaticLibrary_add_exception_objects,vclmain,\ vcl/source/salmain/salmain \ )) -- cgit v1.2.3 From 00ed6f6f71dd6615d37c84f878196582038a15aa Mon Sep 17 00:00:00 2001 From: David Tardon Date: Tue, 31 May 2011 17:08:42 +0200 Subject: gb_Deliver_add_deliverable takes 3 params now --- vcl/StaticLibrary_vclmain.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vcl') diff --git a/vcl/StaticLibrary_vclmain.mk b/vcl/StaticLibrary_vclmain.mk index 1b6496ce2623..79b3ddd3ad5f 100644 --- a/vcl/StaticLibrary_vclmain.mk +++ b/vcl/StaticLibrary_vclmain.mk @@ -48,7 +48,7 @@ $(eval $(call gb_StaticLibrary_add_exception_objects,vclmain,\ # Instead of this evil linking of an object from $(OUTDIR) define StaticLibrary_salmain_hack $(call gb_StaticLibrary_get_target,vclmain) : $(OUTDIR)/lib/$(1) -$$(eval $$(call gb_Deliver_add_deliverable,$(OUTDIR)/lib/$(1),$(call gb_CxxObject_get_target,vcl/source/salmain/salmain))) +$$(eval $$(call gb_Deliver_add_deliverable,$(OUTDIR)/lib/$(1),$(call gb_CxxObject_get_target,vcl/source/salmain/salmain),$(OUTDIR)/lib/$(1))) $(OUTDIR)/lib/$(1) : $(call gb_CxxObject_get_target,vcl/source/salmain/salmain) $$(call gb_Deliver_deliver,$$<,$$@) -- cgit v1.2.3 From 03db851b12a77326926ecfdf0543aa2da2205c52 Mon Sep 17 00:00:00 2001 From: Jesús Corrius Date: Sat, 18 Jun 2011 18:36:57 +0200 Subject: Remove obsolete Win95/NT code --- vcl/win/source/window/salframe.cxx | 125 +++++++++++++------------------------ 1 file changed, 45 insertions(+), 80 deletions(-) (limited to 'vcl') diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index 9ed173ee6170..ed428e473aae 100644 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -232,9 +232,6 @@ static void ImplSaveFrameState( WinSalFrame* pFrame ) // if pParentRect is set, the workarea of the monitor that contains pParentRect is returned void ImplSalGetWorkArea( HWND hWnd, RECT *pRect, const RECT *pParentRect ) { - static int winVerChecked = 0; - static int winVerOk = 0; - // check if we or our parent is fullscreen, then the taskbar should be ignored bool bIgnoreTaskbar = false; WinSalFrame* pFrame = GetWindowPtr( hWnd ); @@ -254,96 +251,64 @@ void ImplSalGetWorkArea( HWND hWnd, RECT *pRect, const RECT *pParentRect ) } } - if( !winVerChecked ) + // calculates the work area taking multiple monitors into account + static int nMonitors = GetSystemMetrics( SM_CMONITORS ); + if( nMonitors == 1 ) { - winVerChecked = 1; - winVerOk = 1; - - // multi monitor calls not available on Win95/NT - if ( aSalShlData.maVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT ) - { - if ( aSalShlData.maVersionInfo.dwMajorVersion <= 4 ) - winVerOk = 0; // NT - } - else if( aSalShlData.maVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ) + if( bIgnoreTaskbar ) { - if ( aSalShlData.maVersionInfo.dwMajorVersion == 4 && aSalShlData.maVersionInfo.dwMinorVersion == 0 ) - winVerOk = 0; // Win95 + pRect->left = pRect->top = 0; + pRect->right = GetSystemMetrics( SM_CXSCREEN ); + pRect->bottom = GetSystemMetrics( SM_CYSCREEN ); } + else + SystemParametersInfo( SPI_GETWORKAREA, 0, pRect, 0 ); } - - // calculates the work area taking multiple monitors into account - if( winVerOk ) + else { - static int nMonitors = GetSystemMetrics( SM_CMONITORS ); - if( nMonitors == 1 ) + if( pParentRect != NULL ) { - if( bIgnoreTaskbar ) - { - pRect->left = pRect->top = 0; - pRect->right = GetSystemMetrics( SM_CXSCREEN ); - pRect->bottom = GetSystemMetrics( SM_CYSCREEN ); - } + // return the size of the monitor where pParentRect lives + HMONITOR hMonitor; + MONITORINFO mi; + + // get the nearest monitor to the passed rect. + hMonitor = MonitorFromRect(pParentRect, MONITOR_DEFAULTTONEAREST); + + // get the work area or entire monitor rect. + mi.cbSize = sizeof(mi); + GetMonitorInfo(hMonitor, &mi); + if( !bIgnoreTaskbar ) + *pRect = mi.rcWork; else - SystemParametersInfo( SPI_GETWORKAREA, 0, pRect, 0 ); + *pRect = mi.rcMonitor; } else { - if( pParentRect != NULL ) + // return the union of all monitors + pRect->left = GetSystemMetrics( SM_XVIRTUALSCREEN ); + pRect->top = GetSystemMetrics( SM_YVIRTUALSCREEN ); + pRect->right = pRect->left + GetSystemMetrics( SM_CXVIRTUALSCREEN ); + pRect->bottom = pRect->top + GetSystemMetrics( SM_CYVIRTUALSCREEN ); + + // virtualscreen does not take taskbar into account, so use the corresponding + // diffs between screen and workarea from the default screen + // however, this is still not perfect: the taskbar might not be on the primary screen + if( !bIgnoreTaskbar ) { - // return the size of the monitor where pParentRect lives - HMONITOR hMonitor; - MONITORINFO mi; - - // get the nearest monitor to the passed rect. - hMonitor = MonitorFromRect(pParentRect, MONITOR_DEFAULTTONEAREST); - - // get the work area or entire monitor rect. - mi.cbSize = sizeof(mi); - GetMonitorInfo(hMonitor, &mi); - if( !bIgnoreTaskbar ) - *pRect = mi.rcWork; - else - *pRect = mi.rcMonitor; + RECT wRect, scrRect; + SystemParametersInfo( SPI_GETWORKAREA, 0, &wRect, 0 ); + scrRect.left = 0; + scrRect.top = 0; + scrRect.right = GetSystemMetrics( SM_CXSCREEN ); + scrRect.bottom = GetSystemMetrics( SM_CYSCREEN ); + + pRect->left += wRect.left; + pRect->top += wRect.top; + pRect->right -= scrRect.right - wRect.right; + pRect->bottom -= scrRect.bottom - wRect.bottom; } - else - { - // return the union of all monitors - pRect->left = GetSystemMetrics( SM_XVIRTUALSCREEN ); - pRect->top = GetSystemMetrics( SM_YVIRTUALSCREEN ); - pRect->right = pRect->left + GetSystemMetrics( SM_CXVIRTUALSCREEN ); - pRect->bottom = pRect->top + GetSystemMetrics( SM_CYVIRTUALSCREEN ); - - // virtualscreen does not take taskbar into account, so use the corresponding - // diffs between screen and workarea from the default screen - // however, this is still not perfect: the taskbar might not be on the primary screen - if( !bIgnoreTaskbar ) - { - RECT wRect, scrRect; - SystemParametersInfo( SPI_GETWORKAREA, 0, &wRect, 0 ); - scrRect.left = 0; - scrRect.top = 0; - scrRect.right = GetSystemMetrics( SM_CXSCREEN ); - scrRect.bottom = GetSystemMetrics( SM_CYSCREEN ); - - pRect->left += wRect.left; - pRect->top += wRect.top; - pRect->right -= scrRect.right - wRect.right; - pRect->bottom -= scrRect.bottom - wRect.bottom; - } - } - } - } - else - { - if( bIgnoreTaskbar ) - { - pRect->left = pRect->top = 0; - pRect->right = GetSystemMetrics( SM_CXSCREEN ); - pRect->bottom = GetSystemMetrics( SM_CYSCREEN ); } - else - SystemParametersInfo( SPI_GETWORKAREA, 0, pRect, 0 ); } } -- cgit v1.2.3 From e7355a7d5c1c9f35de4758cd74f29ded768c65fe Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 18 Jun 2011 00:01:50 +0100 Subject: catch by const reference --- vcl/source/app/svdata.cxx | 17 ++---- vcl/source/gdi/print3.cxx | 4 +- vcl/source/window/dndlcon.cxx | 30 ++++------ vcl/source/window/window.cxx | 12 ++-- vcl/unx/gtk/a11y/atkutil.cxx | 136 +++++++++++++++++++++--------------------- 5 files changed, 91 insertions(+), 108 deletions(-) (limited to 'vcl') diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx index 7648dbbae75c..10f7e50d9aad 100644 --- a/vcl/source/app/svdata.cxx +++ b/vcl/source/app/svdata.cxx @@ -410,8 +410,7 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) return bSuccess; } - - catch(::com::sun::star::java::JavaNotConfiguredException e) + catch (const ::com::sun::star::java::JavaNotConfiguredException&) { ResMgr *pResMgr = ImplGetResMgr(); if( bErrorMessage && bAllowCancel && pResMgr ) @@ -435,8 +434,7 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) return false; } - - catch(::com::sun::star::java::JavaVMCreationFailureException e) + catch (const ::com::sun::star::java::JavaVMCreationFailureException&) { ResMgr *pResMgr = ImplGetResMgr(); if( bErrorMessage && bAllowCancel && pResMgr ) @@ -460,8 +458,7 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) return false; } - - catch(::com::sun::star::java::MissingJavaRuntimeException e) + catch (const ::com::sun::star::java::MissingJavaRuntimeException&) { ResMgr *pResMgr = ImplGetResMgr(); if( bErrorMessage && bAllowCancel && pResMgr ) @@ -485,8 +482,7 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) return false; } - - catch(::com::sun::star::java::JavaDisabledException e) + catch (const ::com::sun::star::java::JavaDisabledException&) { ResMgr *pResMgr = ImplGetResMgr(); if( bErrorMessage && bAllowCancel && pResMgr ) @@ -510,9 +506,7 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) return false; } - - - catch(::com::sun::star::uno::RuntimeException e) + catch (const ::com::sun::star::uno::RuntimeException& e) { ResMgr *pResMgr = ImplGetResMgr(); if( bErrorMessage && pResMgr ) @@ -564,7 +558,6 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) return false; } - catch (...) { return false; diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index 61a40af43bdd..dfe5bfb2aa73 100644 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -250,7 +250,7 @@ static rtl::OUString queryFile( Printer* pPrinter ) // add arbitrary files xFilterMgr->appendFilter( String( VclResId( SV_STDTEXT_ALLFILETYPES ) ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*.*" ) ) ); } - catch( lang::IllegalArgumentException ) + catch (const lang::IllegalArgumentException&) { DBG_ERRORFILE( "caught IllegalArgumentException when registering filter\n" ); } @@ -460,7 +460,7 @@ void Printer::ImplPrintJob( const boost::shared_ptr& i_pContr makeAny( sal_True ) ); } } - catch( std::bad_alloc& ) + catch (const std::bad_alloc&) { } } diff --git a/vcl/source/window/dndlcon.cxx b/vcl/source/window/dndlcon.cxx index 977e8611e70a..08c8e4d24c3b 100644 --- a/vcl/source/window/dndlcon.cxx +++ b/vcl/source/window/dndlcon.cxx @@ -193,8 +193,7 @@ sal_uInt32 DNDListenerContainer::fireDropEvent( const Reference< XDropTargetDrop nRet++; } } - - catch( RuntimeException ) + catch (const RuntimeException&) { pContainer->removeInterface( xElement ); } @@ -209,8 +208,7 @@ sal_uInt32 DNDListenerContainer::fireDropEvent( const Reference< XDropTargetDrop { context->rejectDrop(); } - - catch( RuntimeException exc ) + catch (const RuntimeException&) { } } @@ -253,8 +251,7 @@ sal_uInt32 DNDListenerContainer::fireDragExitEvent() nRet++; } } - - catch( RuntimeException ) + catch (const RuntimeException&) { pContainer->removeInterface( xElement ); } @@ -305,8 +302,7 @@ sal_uInt32 DNDListenerContainer::fireDragOverEvent( const Reference< XDropTarget nRet++; } } - - catch( RuntimeException ) + catch (const RuntimeException&) { pContainer->removeInterface( xElement ); } @@ -321,8 +317,7 @@ sal_uInt32 DNDListenerContainer::fireDragOverEvent( const Reference< XDropTarget { context->rejectDrag(); } - - catch( RuntimeException exc ) + catch (const RuntimeException&) { } } @@ -373,8 +368,7 @@ sal_uInt32 DNDListenerContainer::fireDragEnterEvent( const Reference< XDropTarge nRet++; } } - - catch( RuntimeException ) + catch (const RuntimeException&) { pContainer->removeInterface( xElement ); } @@ -389,8 +383,7 @@ sal_uInt32 DNDListenerContainer::fireDragEnterEvent( const Reference< XDropTarge { context->rejectDrag(); } - - catch( RuntimeException exc ) + catch (const RuntimeException&) { } } @@ -440,8 +433,7 @@ sal_uInt32 DNDListenerContainer::fireDropActionChangedEvent( const Reference< XD nRet++; } } - - catch( RuntimeException ) + catch (const RuntimeException&) { pContainer->removeInterface( xElement ); } @@ -456,8 +448,7 @@ sal_uInt32 DNDListenerContainer::fireDropActionChangedEvent( const Reference< XD { context->rejectDrag(); } - - catch( RuntimeException exc ) + catch (const RuntimeException&) { } } @@ -502,8 +493,7 @@ sal_uInt32 DNDListenerContainer::fireDragGestureEvent( sal_Int8 dragAction, sal_ nRet++; } } - - catch( RuntimeException ) + catch (const RuntimeException&) { pContainer->removeInterface( xElement ); } diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index b8457d1267a5..1ab898011672 100755 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -4340,8 +4340,7 @@ Window::~Window() if( xComponent.is() ) xComponent->dispose(); } - - catch ( Exception ) + catch (const Exception&) { // can be safely ignored here. } @@ -8378,8 +8377,7 @@ uno::Reference< XDropTarget > Window::GetDropTarget() mpWindowImpl->mpFrameData->mbInternalDragGestureRecognizer = sal_True; } - - catch( RuntimeException ) + catch (const RuntimeException&) { // release all instances mpWindowImpl->mpFrameData->mxDropTarget.clear(); @@ -8452,7 +8450,7 @@ uno::Reference< XDragSource > Window::GetDragSource() } // createInstance can throw any exception - catch( Exception ) + catch (const Exception&) { // release all instances mpWindowImpl->mpFrameData->mxDropTarget.clear(); @@ -8532,7 +8530,7 @@ uno::Reference< XClipboard > Window::GetClipboard() } // createInstance can throw any exception - catch( Exception ) + catch (const Exception&) { // release all instances mpWindowImpl->mpFrameData->mxClipboard.clear(); @@ -8584,7 +8582,7 @@ uno::Reference< XClipboard > Window::GetPrimarySelection() } // createInstance can throw any exception - catch( Exception ) + catch (const Exception&) { // release all instances mpWindowImpl->mpFrameData->mxSelection.clear(); diff --git a/vcl/unx/gtk/a11y/atkutil.cxx b/vcl/unx/gtk/a11y/atkutil.cxx index 78e0cb05d4de..8514e4417ca3 100644 --- a/vcl/unx/gtk/a11y/atkutil.cxx +++ b/vcl/unx/gtk/a11y/atkutil.cxx @@ -224,7 +224,7 @@ void DocumentFocusListener::notifyEvent( const accessibility::AccessibleEventObj if( accessibility::AccessibleStateType::FOCUSED == nState ) atk_wrapper_focus_tracker_notify_when_idle( getAccessible(aEvent) ); } - catch(const lang::IndexOutOfBoundsException &e) + catch (const lang::IndexOutOfBoundsException&) { g_warning("Focused object has invalid index in parent"); } @@ -559,7 +559,7 @@ static void handle_get_focus(::VclWindowEvent const * pEvent) { aDocumentFocusListener->attachRecursive(xAccessible, xContext, xStateSet); } - catch( const uno::Exception &e ) + catch (const uno::Exception&) { g_warning( "Exception caught processing focus events" ); } @@ -593,7 +593,7 @@ static void handle_menu_highlighted(::VclMenuEvent const * pEvent) } } } - catch( const uno::Exception& e ) + catch (const uno::Exception&) { g_warning( "Exception caught processing menu highlight events" ); } @@ -603,74 +603,76 @@ static void handle_menu_highlighted(::VclMenuEvent const * pEvent) long WindowEventHandler(void *, ::VclSimpleEvent const * pEvent) { - try { - switch (pEvent->GetId()) + try { - case VCLEVENT_WINDOW_SHOW: - break; - case VCLEVENT_WINDOW_HIDE: - break; - case VCLEVENT_WINDOW_CLOSE: - break; - case VCLEVENT_WINDOW_GETFOCUS: - handle_get_focus(static_cast< ::VclWindowEvent const * >(pEvent)); - break; - case VCLEVENT_WINDOW_LOSEFOCUS: - break; - case VCLEVENT_WINDOW_MINIMIZE: - break; - case VCLEVENT_WINDOW_NORMALIZE: - break; - case VCLEVENT_WINDOW_KEYINPUT: - case VCLEVENT_WINDOW_KEYUP: - case VCLEVENT_WINDOW_COMMAND: - case VCLEVENT_WINDOW_MOUSEMOVE: - break; - - case VCLEVENT_MENU_HIGHLIGHT: - if (const VclMenuEvent* pMenuEvent = dynamic_cast(pEvent)) - { - handle_menu_highlighted(pMenuEvent); - } - else if (const VclAccessibleEvent* pAccEvent = dynamic_cast(pEvent)) + switch (pEvent->GetId()) { - uno::Reference< accessibility::XAccessible > xAccessible = pAccEvent->GetAccessible(); - if (xAccessible.is()) - atk_wrapper_focus_tracker_notify_when_idle(xAccessible); + case VCLEVENT_WINDOW_SHOW: + break; + case VCLEVENT_WINDOW_HIDE: + break; + case VCLEVENT_WINDOW_CLOSE: + break; + case VCLEVENT_WINDOW_GETFOCUS: + handle_get_focus(static_cast< ::VclWindowEvent const * >(pEvent)); + break; + case VCLEVENT_WINDOW_LOSEFOCUS: + break; + case VCLEVENT_WINDOW_MINIMIZE: + break; + case VCLEVENT_WINDOW_NORMALIZE: + break; + case VCLEVENT_WINDOW_KEYINPUT: + case VCLEVENT_WINDOW_KEYUP: + case VCLEVENT_WINDOW_COMMAND: + case VCLEVENT_WINDOW_MOUSEMOVE: + break; + + case VCLEVENT_MENU_HIGHLIGHT: + if (const VclMenuEvent* pMenuEvent = dynamic_cast(pEvent)) + { + handle_menu_highlighted(pMenuEvent); + } + else if (const VclAccessibleEvent* pAccEvent = dynamic_cast(pEvent)) + { + uno::Reference< accessibility::XAccessible > xAccessible = pAccEvent->GetAccessible(); + if (xAccessible.is()) + atk_wrapper_focus_tracker_notify_when_idle(xAccessible); + } + break; + + case VCLEVENT_TOOLBOX_HIGHLIGHT: + handle_toolbox_highlight(static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow()); + break; + + case VCLEVENT_TOOLBOX_BUTTONSTATECHANGED: + handle_toolbox_buttonchange(static_cast< ::VclWindowEvent const * >(pEvent)); + break; + + case VCLEVENT_OBJECT_DYING: + g_aWindowList.erase( static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow() ); + // fallthrough intentional ! + case VCLEVENT_TOOLBOX_HIGHLIGHTOFF: + handle_toolbox_highlightoff(static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow()); + break; + + case VCLEVENT_TABPAGE_ACTIVATE: + handle_tabpage_activated(static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow()); + break; + + case VCLEVENT_COMBOBOX_SETTEXT: + // This looks quite strange to me. Stumbled over this when fixing #i104290#. + // This kicked in when leaving the combobox in the toolbar, after that the events worked. + // I guess this was a try to work around missing combobox events, which didn't do the full job, and shouldn't be necessary anymore. + // Fix for #i104290# was done in toolkit/source/awt/vclxaccessiblecomponent, FOCUSED state for compound controls in general. + // create_wrapper_for_children(static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow()); + break; + + default: + break; } - break; - - case VCLEVENT_TOOLBOX_HIGHLIGHT: - handle_toolbox_highlight(static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow()); - break; - - case VCLEVENT_TOOLBOX_BUTTONSTATECHANGED: - handle_toolbox_buttonchange(static_cast< ::VclWindowEvent const * >(pEvent)); - break; - - case VCLEVENT_OBJECT_DYING: - g_aWindowList.erase( static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow() ); - // fallthrough intentional ! - case VCLEVENT_TOOLBOX_HIGHLIGHTOFF: - handle_toolbox_highlightoff(static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow()); - break; - - case VCLEVENT_TABPAGE_ACTIVATE: - handle_tabpage_activated(static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow()); - break; - - case VCLEVENT_COMBOBOX_SETTEXT: - // This looks quite strange to me. Stumbled over this when fixing #i104290#. - // This kicked in when leaving the combobox in the toolbar, after that the events worked. - // I guess this was a try to work around missing combobox events, which didn't do the full job, and shouldn't be necessary anymore. - // Fix for #i104290# was done in toolkit/source/awt/vclxaccessiblecomponent, FOCUSED state for compound controls in general. - // create_wrapper_for_children(static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow()); - break; - - default: - break; } - } catch(lang::IndexOutOfBoundsException) + catch (const lang::IndexOutOfBoundsException&) { g_warning("Focused object has invalid index in parent"); } -- cgit v1.2.3 From c481fc6bb8ba7777e4890b9f76d68827f46beb77 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Mon, 20 Jun 2011 17:08:12 +0200 Subject: add missing newline to the end of file to silence the compiler --- svtools/inc/svtools/grfmgr.hxx | 2 +- svtools/source/filter/exportdialog.cxx | 2 +- svtools/source/filter/filter2.cxx | 2 +- svtools/source/graphic/grfmgr.cxx | 2 +- svtools/source/graphic/grfmgr2.cxx | 2 +- vcl/inc/vcl/gdimtf.hxx | 2 +- vcl/inc/vcl/graph.hxx | 2 +- vcl/inc/vcl/svgread.hxx | 2 +- vcl/source/gdi/metaact.cxx | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) (limited to 'vcl') diff --git a/svtools/inc/svtools/grfmgr.hxx b/svtools/inc/svtools/grfmgr.hxx index c99ea7a55bcd..e81458644d50 100644 --- a/svtools/inc/svtools/grfmgr.hxx +++ b/svtools/inc/svtools/grfmgr.hxx @@ -574,4 +574,4 @@ public: #endif // _GRFMGR_HXX -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/filter/exportdialog.cxx b/svtools/source/filter/exportdialog.cxx index 0a03904cf176..47a7a690153f 100644 --- a/svtools/source/filter/exportdialog.cxx +++ b/svtools/source/filter/exportdialog.cxx @@ -1512,4 +1512,4 @@ IMPL_LINK( ExportDialog, OK, void *, EMPTYARG ) return 0; } -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/filter/filter2.cxx b/svtools/source/filter/filter2.cxx index d34825312470..b973c9bdb3b0 100644 --- a/svtools/source/filter/filter2.cxx +++ b/svtools/source/filter/filter2.cxx @@ -1352,4 +1352,4 @@ String GraphicDescriptor::GetImportFormatShortName( sal_uInt16 nFormat ) return String( aKeyName, RTL_TEXTENCODING_ASCII_US ); } -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx index 19b09e8f67a7..fdfa92a72b00 100644 --- a/svtools/source/graphic/grfmgr.cxx +++ b/svtools/source/graphic/grfmgr.cxx @@ -1232,4 +1232,4 @@ GraphicObject GraphicObject::CreateGraphicObjectFromURL( const ::rtl::OUString & } } -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx index 1115635157a8..fbd00913607b 100644 --- a/svtools/source/graphic/grfmgr2.cxx +++ b/svtools/source/graphic/grfmgr2.cxx @@ -2384,4 +2384,4 @@ void GraphicObject::ImplTransformBitmap( BitmapEx& rBmpEx, } } -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/vcl/gdimtf.hxx b/vcl/inc/vcl/gdimtf.hxx index 86f8dc5cbc77..e15a536ced0f 100644 --- a/vcl/inc/vcl/gdimtf.hxx +++ b/vcl/inc/vcl/gdimtf.hxx @@ -291,4 +291,4 @@ MetaCommentAction* makePluggableRendererAction( const rtl::OUString& rRendererSe #endif // _SV_GDIMTF_HXX -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/vcl/graph.hxx b/vcl/inc/vcl/graph.hxx index 61da922acce6..d613c2d8432b 100644 --- a/vcl/inc/vcl/graph.hxx +++ b/vcl/inc/vcl/graph.hxx @@ -222,4 +222,4 @@ public: #endif // _SV_GRAPH_HXX -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/vcl/svgread.hxx b/vcl/inc/vcl/svgread.hxx index 4427198eeb5a..cf4f8008c7ef 100644 --- a/vcl/inc/vcl/svgread.hxx +++ b/vcl/inc/vcl/svgread.hxx @@ -80,4 +80,4 @@ namespace vcl #endif -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx index 2ffa3c68e4f7..32c4a589f54d 100644 --- a/vcl/source/gdi/metaact.cxx +++ b/vcl/source/gdi/metaact.cxx @@ -4409,4 +4409,4 @@ void MetaRenderGraphicAction::Read( SvStream& rIStm, ImplMetaReadData* ) rIStm >> maRenderGraphic >> maPoint >> maSize >> mfRotateAngle >> mfShearAngleX >> mfShearAngleY; } -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From 6bc21bfd345c80a6b3a9cb8b966326e603a1bae1 Mon Sep 17 00:00:00 2001 From: Jesús Corrius Date: Mon, 20 Jun 2011 22:21:13 +0200 Subject: Avoid possible null pointer dereference --- vcl/win/source/window/salframe.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'vcl') diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index ed428e473aae..9541593a5c51 100644 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -5239,7 +5239,11 @@ static void ImplHandleInputLangChange( HWND hWnd, WPARAM, LPARAM lParam ) // Feststellen, ob wir IME unterstuetzen WinSalFrame* pFrame = GetWindowPtr( hWnd ); - if ( pFrame && pFrame->mbIME && pFrame->mhDefIMEContext ) + + if ( !pFrame ) + return; + + if ( pFrame->mbIME && pFrame->mhDefIMEContext ) { HKL hKL = (HKL)lParam; UINT nImeProps = ImmGetProperty( hKL, IGP_PROPERTY ); -- cgit v1.2.3 From 74948277ffe67a5bd03822a8c04e69d5915816c1 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 21 Jun 2011 03:07:58 +0300 Subject: Mark l10ntools for DESKTOP builds only --- vcl/prj/build.lst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vcl') diff --git a/vcl/prj/build.lst b/vcl/prj/build.lst index 6db5d660f085..646a45563dde 100644 --- a/vcl/prj/build.lst +++ b/vcl/prj/build.lst @@ -1,4 +1,4 @@ -vc vcl : TRANSLATIONS:translations apple_remote BOOST:boost DESKTOP:rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offapi basegfx basebmp tools l10ntools icc cpputools svl LIBXSLT:libxslt NULL +vc vcl : TRANSLATIONS:translations apple_remote BOOST:boost DESKTOP:rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offapi basegfx basebmp tools DESKTOP:l10ntools icc cpputools svl LIBXSLT:libxslt NULL vc vcl usr1 - all vc_mkout NULL vc vcl\prj nmake - all vc_prj NULL -- cgit v1.2.3 From ce404da339abcf0e8495ccad2e4a235e10a68454 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 20 Jun 2011 23:06:57 +0100 Subject: convert string --- vcl/inc/vcl/field.hxx | 10 ++-- vcl/source/control/field2.cxx | 107 ++++++++++++++++++++++-------------------- 2 files changed, 60 insertions(+), 57 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/field.hxx b/vcl/inc/vcl/field.hxx index fd0ce90cb0d7..9271df88ba86 100644 --- a/vcl/inc/vcl/field.hxx +++ b/vcl/inc/vcl/field.hxx @@ -111,7 +111,7 @@ public: class VCL_DLLPUBLIC PatternFormatter : public FormatterBase { private: - ByteString maEditMask; + rtl::OString m_aEditMask; XubString maFieldString; XubString maLiteralMask; sal_uInt16 mnFormatFlags; @@ -122,7 +122,8 @@ protected: PatternFormatter(); SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId ); - SAL_DLLPRIVATE void ImplSetMask( const ByteString& rEditMask, const XubString& rLiteralMask ); + SAL_DLLPRIVATE void ImplSetMask(const rtl::OString& rEditMask, + const XubString& rLiteralMask); SAL_DLLPRIVATE sal_Bool ImplIsSameMask() const { return mbSameMask; } SAL_DLLPRIVATE sal_Bool& ImplGetInPattKeyInput() { return mbInPattKeyInput; } @@ -131,9 +132,8 @@ public: virtual void Reformat(); - void SetMask( const ByteString& rEditMask, - const XubString& rLiteralMask ); - const ByteString& GetEditMask() const { return maEditMask; } + void SetMask(const rtl::OString& rEditMask, const XubString& rLiteralMask ); + const rtl::OString& GetEditMask() const { return m_aEditMask; } const XubString& GetLiteralMask() const { return maLiteralMask; } void SetFormatFlags( sal_uInt16 nFlags ) { mnFormatFlags = nFlags; } diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index 69a3fdbdce9d..74241bef0f1b 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -241,11 +241,11 @@ static int ImplKommaPointCharEqual( xub_Unicode c1, xub_Unicode c2 ) // ----------------------------------------------------------------------- static XubString ImplPatternReformat( const XubString& rStr, - const ByteString& rEditMask, + const rtl::OString& rEditMask, const XubString& rLiteralMask, sal_uInt16 nFormatFlags ) { - if ( !rEditMask.Len() ) + if (rEditMask.isEmpty()) return rStr; XubString aStr = rStr; @@ -258,14 +258,14 @@ static XubString ImplPatternReformat( const XubString& rStr, xub_StrLen i = 0; xub_StrLen n; - while ( i < rEditMask.Len() ) + while ( i < rEditMask.getLength() ) { if ( nStrIndex >= aStr.Len() ) break; cChar = aStr.GetChar(nStrIndex); cLiteral = rLiteralMask.GetChar(i); - cMask = rEditMask.GetChar(i); + cMask = rEditMask[i]; // Aktuelle Position ein Literal if ( cMask == EDITMASK_LITERAL ) @@ -281,11 +281,11 @@ static XubString ImplPatternReformat( const XubString& rStr, // Dies ist dann der Fall, wenn es nicht in das Muster // des naechsten nicht Literal-Zeichens passt n = i+1; - while ( n < rEditMask.Len() ) + while ( n < rEditMask.getLength() ) { - if ( rEditMask.GetChar(n) != EDITMASK_LITERAL ) + if ( rEditMask[n] != EDITMASK_LITERAL ) { - if ( !ImplIsPatternChar( cChar, rEditMask.GetChar(n) ) ) + if ( !ImplIsPatternChar( cChar, rEditMask[n] ) ) nStrIndex++; break; } @@ -318,9 +318,9 @@ static XubString ImplPatternReformat( const XubString& rStr, if ( nFormatFlags & PATTERN_FORMAT_EMPTYLITERALS ) { n = i; - while ( n < rEditMask.Len() ) + while ( n < rEditMask.getLength() ) { - if ( rEditMask.GetChar( n ) == EDITMASK_LITERAL ) + if ( rEditMask[n] == EDITMASK_LITERAL ) { if ( ImplKommaPointCharEqual( cChar, rLiteralMask.GetChar( n ) ) ) i = n+1; @@ -346,7 +346,7 @@ static XubString ImplPatternReformat( const XubString& rStr, // ----------------------------------------------------------------------- -static void ImplPatternMaxPos( const XubString rStr, const ByteString& rEditMask, +static void ImplPatternMaxPos( const XubString rStr, const rtl::OString& rEditMask, sal_uInt16 nFormatFlags, sal_Bool bSameMask, sal_uInt16 nCursorPos, sal_uInt16& rPos ) { @@ -360,7 +360,7 @@ static void ImplPatternMaxPos( const XubString rStr, const ByteString& rEditMask { while ( nMaxPos ) { - if ( (rEditMask.GetChar(nMaxPos-1) != EDITMASK_LITERAL) && + if ( (rEditMask[nMaxPos-1] != EDITMASK_LITERAL) && (rStr.GetChar(nMaxPos-1) != ' ') ) break; nMaxPos--; @@ -369,9 +369,9 @@ static void ImplPatternMaxPos( const XubString rStr, const ByteString& rEditMask // Wenn wir vor einem Literal stehen, dann solange weitersuchen, // bis erste Stelle nach Literal xub_StrLen nTempPos = nMaxPos; - while ( nTempPos < rEditMask.Len() ) + while ( nTempPos < rEditMask.getLength() ) { - if ( rEditMask.GetChar(nTempPos) != EDITMASK_LITERAL ) + if ( rEditMask[nTempPos] != EDITMASK_LITERAL ) { nMaxPos = nTempPos; break; @@ -390,7 +390,7 @@ static void ImplPatternMaxPos( const XubString rStr, const ByteString& rEditMask // ----------------------------------------------------------------------- static void ImplPatternProcessStrictModify( Edit* pEdit, - const ByteString& rEditMask, + const rtl::OString& rEditMask, const XubString& rLiteralMask, sal_uInt16 nFormatFlags, sal_Bool bSameMask ) { @@ -403,14 +403,14 @@ static void ImplPatternProcessStrictModify( Edit* pEdit, xub_StrLen nMaxLen = aText.Len(); while ( i < nMaxLen ) { - if ( (rEditMask.GetChar( i ) != EDITMASK_LITERAL) && + if ( (rEditMask[i] != EDITMASK_LITERAL) && (aText.GetChar( i ) != ' ') ) break; i++; } // Alle Literalzeichen beibehalten - while ( i && (rEditMask.GetChar( i ) == EDITMASK_LITERAL) ) + while ( i && (rEditMask[i] == EDITMASK_LITERAL) ) i--; aText.Erase( 0, i ); } @@ -442,14 +442,14 @@ static void ImplPatternProcessStrictModify( Edit* pEdit, // ----------------------------------------------------------------------- -static xub_StrLen ImplPatternLeftPos( const ByteString& rEditMask, xub_StrLen nCursorPos ) +static xub_StrLen ImplPatternLeftPos(const rtl::OString& rEditMask, xub_StrLen nCursorPos) { // Vorheriges Zeichen suchen, was kein Literal ist xub_StrLen nNewPos = nCursorPos; xub_StrLen nTempPos = nNewPos; while ( nTempPos ) { - if ( rEditMask.GetChar(nTempPos-1) != EDITMASK_LITERAL ) + if ( rEditMask[nTempPos-1] != EDITMASK_LITERAL ) { nNewPos = nTempPos-1; break; @@ -461,16 +461,16 @@ static xub_StrLen ImplPatternLeftPos( const ByteString& rEditMask, xub_StrLen nC // ----------------------------------------------------------------------- -static xub_StrLen ImplPatternRightPos( const XubString& rStr, const ByteString& rEditMask, +static xub_StrLen ImplPatternRightPos( const XubString& rStr, const rtl::OString& rEditMask, sal_uInt16 nFormatFlags, sal_Bool bSameMask, xub_StrLen nCursorPos ) { // Naechstes Zeichen suchen, was kein Literal ist xub_StrLen nNewPos = nCursorPos; xub_StrLen nTempPos = nNewPos; - while ( nTempPos < rEditMask.Len() ) + while ( nTempPos < rEditMask.getLength() ) { - if ( rEditMask.GetChar(nTempPos+1) != EDITMASK_LITERAL ) + if ( rEditMask[nTempPos+1] != EDITMASK_LITERAL ) { nNewPos = nTempPos+1; break; @@ -484,14 +484,14 @@ static xub_StrLen ImplPatternRightPos( const XubString& rStr, const ByteString& // ----------------------------------------------------------------------- static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, - const ByteString& rEditMask, + const rtl::OString& rEditMask, const XubString& rLiteralMask, sal_Bool bStrictFormat, sal_uInt16 nFormatFlags, sal_Bool bSameMask, sal_Bool& rbInKeyInput ) { - if ( !rEditMask.Len() || !bStrictFormat ) + if ( rEditMask.isEmpty() || !bStrictFormat ) return sal_False; Selection aOldSel = pEdit->GetSelection(); @@ -533,8 +533,8 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, { // Home ist Position des ersten nicht literalen Zeichens nNewPos = 0; - while ( (nNewPos < rEditMask.Len()) && - (rEditMask.GetChar(nNewPos) == EDITMASK_LITERAL) ) + while ( (nNewPos < rEditMask.getLength()) && + (rEditMask[nNewPos] == EDITMASK_LITERAL) ) nNewPos++; // Home sollte nicht nach rechts wandern if ( nCursorPos < nNewPos ) @@ -548,9 +548,9 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, else if ( nKeyCode == KEY_END ) { // End ist die Position des letzten nicht literalen Zeichens - nNewPos = rEditMask.Len(); + nNewPos = rEditMask.getLength(); while ( nNewPos && - (rEditMask.GetChar(nNewPos-1) == EDITMASK_LITERAL) ) + (rEditMask[nNewPos-1] == EDITMASK_LITERAL) ) nNewPos--; // Hier nehmen wir Selectionsanfang als minimum, da falls durch // Focus alles selektiert ist, ist eine kleine Position schon @@ -601,7 +601,7 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, { if ( bSameMask ) { - if ( rEditMask.GetChar( nNewPos ) != EDITMASK_LITERAL ) + if ( rEditMask[nNewPos] != EDITMASK_LITERAL ) aStr.Erase( nNewPos, 1 ); } else @@ -647,9 +647,9 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, aSel.Justify(); nNewPos = (xub_StrLen)aSel.Min(); - if ( nNewPos < rEditMask.Len() ) + if ( nNewPos < rEditMask.getLength() ) { - xub_Unicode cPattChar = ImplPatternChar( cChar, rEditMask.GetChar(nNewPos) ); + xub_Unicode cPattChar = ImplPatternChar( cChar, rEditMask[nNewPos] ); if ( cPattChar ) cChar = cPattChar; else @@ -661,17 +661,17 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, // nicht dazu fuehren, das der Anwender dann da steht, wo // er nicht stehen wollte. if ( nNewPos && - (rEditMask.GetChar(nNewPos-1) != EDITMASK_LITERAL) && + (rEditMask[nNewPos-1] != EDITMASK_LITERAL) && !aSel.Len() ) { // Naechstes Zeichen suchen, was kein Literal ist nTempPos = nNewPos; - while ( nTempPos < rEditMask.Len() ) + while ( nTempPos < rEditMask.getLength() ) { - if ( rEditMask.GetChar(nTempPos) == EDITMASK_LITERAL ) + if ( rEditMask[nTempPos] == EDITMASK_LITERAL ) { // Gilt nur, wenn ein Literalzeichen vorhanden - if ( (rEditMask.GetChar(nTempPos+1) != EDITMASK_LITERAL ) && + if ( (rEditMask[nTempPos+1] != EDITMASK_LITERAL ) && ImplKommaPointCharEqual( cChar, rLiteralMask.GetChar(nTempPos) ) ) { nTempPos++; @@ -705,7 +705,7 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, while ( n && (n > nNewPos) ) { if ( (aStr.GetChar( n-1 ) != ' ') && - ((n > rEditMask.Len()) || (rEditMask.GetChar(n-1) != EDITMASK_LITERAL)) ) + ((n > rEditMask.getLength()) || (rEditMask[n-1] != EDITMASK_LITERAL)) ) break; n--; @@ -715,14 +715,14 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, if ( aSel.Len() ) aStr.Erase( (xub_StrLen)aSel.Min(), (xub_StrLen)aSel.Len() ); - if ( aStr.Len() < rEditMask.Len() ) + if ( aStr.Len() < rEditMask.getLength() ) { // String evtl. noch bis Cursor-Position erweitern if ( aStr.Len() < nNewPos ) aStr += rLiteralMask.Copy( aStr.Len(), nNewPos-aStr.Len() ); if ( nNewPos < aStr.Len() ) aStr.Insert( cChar, nNewPos ); - else if ( nNewPos < rEditMask.Len() ) + else if ( nNewPos < rEditMask.getLength() ) aStr += cChar; aStr = ImplPatternReformat( aStr, rEditMask, rLiteralMask, nFormatFlags ); } @@ -740,7 +740,7 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, if ( nNewPos < aStr.Len() ) aStr.SetChar( nNewPos, cChar ); - else if ( nNewPos < rEditMask.Len() ) + else if ( nNewPos < rEditMask.getLength() ) aStr += cChar; } @@ -764,19 +764,19 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, // ----------------------------------------------------------------------- -void PatternFormatter::ImplSetMask( const ByteString& rEditMask, - const XubString& rLiteralMask ) +void PatternFormatter::ImplSetMask(const rtl::OString& rEditMask, + const XubString& rLiteralMask) { - maEditMask = rEditMask; + m_aEditMask = rEditMask; maLiteralMask = rLiteralMask; mbSameMask = sal_True; - if ( maEditMask.Len() != maLiteralMask.Len() ) + if ( m_aEditMask.getLength() != maLiteralMask.Len() ) { - if ( maEditMask.Len() < maLiteralMask.Len() ) - maLiteralMask.Erase( maEditMask.Len() ); + if ( m_aEditMask.getLength() < maLiteralMask.Len() ) + maLiteralMask.Erase(m_aEditMask.getLength()); else - maLiteralMask.Expand( maEditMask.Len(), ' ' ); + maLiteralMask.Expand(m_aEditMask.getLength(), ' '); } // StrictModus erlaubt nur Input-Mode, wenn als Maske nur @@ -785,9 +785,9 @@ void PatternFormatter::ImplSetMask( const ByteString& rEditMask, // nicht zugelassen sind xub_StrLen i = 0; sal_Char c = 0; - while ( i < rEditMask.Len() ) + while ( i < rEditMask.getLength() ) { - sal_Char cTemp = rEditMask.GetChar( i ); + sal_Char cTemp = rEditMask[i]; if ( cTemp != EDITMASK_LITERAL ) { if ( (cTemp == EDITMASK_ALLCHAR) || @@ -830,7 +830,7 @@ PatternFormatter::PatternFormatter() void PatternFormatter::ImplLoadRes( const ResId& rResId ) { - ByteString aEditMask; + rtl::OString aEditMask; XubString aLiteralMask; ResMgr* pMgr = rResId.GetResMgr(); if( pMgr ) @@ -841,7 +841,10 @@ void PatternFormatter::ImplLoadRes( const ResId& rResId ) SetStrictFormat( (sal_Bool)pMgr->ReadShort() ); if ( PATTERNFORMATTER_EDITMASK & nMask ) - aEditMask = ByteString( pMgr->ReadString(), RTL_TEXTENCODING_ASCII_US ); + { + aEditMask = rtl::OUStringToOString(pMgr->ReadString(), + RTL_TEXTENCODING_ASCII_US); + } if ( PATTERNFORMATTER_LITTERALMASK & nMask ) aLiteralMask = pMgr->ReadString(); @@ -859,7 +862,7 @@ PatternFormatter::~PatternFormatter() // ----------------------------------------------------------------------- -void PatternFormatter::SetMask( const ByteString& rEditMask, +void PatternFormatter::SetMask( const rtl::OString& rEditMask, const XubString& rLiteralMask ) { ImplSetMask( rEditMask, rLiteralMask ); @@ -885,7 +888,7 @@ XubString PatternFormatter::GetString() const if ( !GetField() ) return ImplGetSVEmptyStr(); else - return ImplPatternReformat( GetField()->GetText(), maEditMask, maLiteralMask, mnFormatFlags ); + return ImplPatternReformat( GetField()->GetText(), m_aEditMask, maLiteralMask, mnFormatFlags ); } // ----------------------------------------------------------------------- @@ -894,7 +897,7 @@ void PatternFormatter::Reformat() { if ( GetField() ) { - ImplSetText( ImplPatternReformat( GetField()->GetText(), maEditMask, maLiteralMask, mnFormatFlags ) ); + ImplSetText( ImplPatternReformat( GetField()->GetText(), m_aEditMask, maLiteralMask, mnFormatFlags ) ); if ( !mbSameMask && IsStrictFormat() && !GetField()->IsReadOnly() ) GetField()->SetInsertMode( sal_False ); } -- cgit v1.2.3 From 1b74a59a35ca36d6eb52a0a043f385c5f67e8c39 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 21 Jun 2011 10:47:07 +0100 Subject: WaE: short-reads/writes --- vcl/unx/generic/gdi/salprnpsp.cxx | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'vcl') diff --git a/vcl/unx/generic/gdi/salprnpsp.cxx b/vcl/unx/generic/gdi/salprnpsp.cxx index 009621a9e22e..dbee65c589dc 100644 --- a/vcl/unx/generic/gdi/salprnpsp.cxx +++ b/vcl/unx/generic/gdi/salprnpsp.cxx @@ -271,11 +271,16 @@ static bool passFileToCommandLine( const String& rFilename, const String& rComma close( fd[0] ); char aBuffer[ 2048 ]; FILE* fp = fopen( aFilename.GetBuffer(), "r" ); - while( fp && ! feof( fp ) ) + while (fp && !feof(fp)) { - int nBytes = fread( aBuffer, 1, sizeof( aBuffer ), fp ); - if( nBytes ) - write( fd[ 1 ], aBuffer, nBytes ); + size_t nBytesRead = fread(aBuffer, 1, sizeof( aBuffer ), fp); + if (nBytesRead ) + { + size_t nBytesWritten = write(fd[1], aBuffer, nBytesRead); + OSL_ENSURE(nBytesWritten == nBytesRead, "short write"); + if (nBytesWritten != nBytesRead) + break; + } } fclose( fp ); close( fd[ 1 ] ); @@ -1342,7 +1347,12 @@ sal_Bool PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJo { osl_readFile( pFile, &buffer[0], buffer.size(), &nBytesRead ); if( nBytesRead > 0 ) - fwrite( &buffer[0], 1, nBytesRead, fp ); + { + size_t nBytesWritten = fwrite(&buffer[0], 1, nBytesRead, fp); + OSL_ENSURE(nBytesRead == nBytesWritten, "short write"); + if (nBytesRead != nBytesWritten) + break; + } } while( nBytesRead == buffer.size() ); rtl::OUStringBuffer aBuf( i_rJobName.Len() + 8 ); aBuf.append( i_rJobName ); -- cgit v1.2.3 From 2062cdd6ca671fb6a1b0d3bfb4146de02bfb15d2 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 21 Jun 2011 23:40:13 +0300 Subject: Add (dummy) svsys.h file for Android --- vcl/inc/android/svsys.h | 36 ++++++++++++++++++++++++++++++++++++ vcl/inc/ios/svsys.h | 8 ++++---- vcl/inc/svsys.h | 2 ++ 3 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 vcl/inc/android/svsys.h (limited to 'vcl') diff --git a/vcl/inc/android/svsys.h b/vcl/inc/android/svsys.h new file mode 100644 index 000000000000..9dabc7187400 --- /dev/null +++ b/vcl/inc/android/svsys.h @@ -0,0 +1,36 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is Tor Lillqvist + * Portions created by the Initial Developer are Copyright (C) 2011 the + * Initial Developer. All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#ifndef _VCL_ANDROID_SVSYS_H +#define _VCL_ANDROID_SVSYS_H + + +// ? + +#endif // _VCL_ANDROID_SVSYS_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/svsys.h b/vcl/inc/ios/svsys.h index 0d01631c09f0..a8edcab96eef 100644 --- a/vcl/inc/ios/svsys.h +++ b/vcl/inc/ios/svsys.h @@ -13,7 +13,7 @@ * License. * * The Initial Developer of the Original Code is Tor Lillqvist - * Portions created by the Initial Developer are Copyright (C) 2010 the + * Portions created by the Initial Developer are Copyright (C) 2011 the * Initial Developer. All Rights Reserved. * * For minor contributions see the git repository. @@ -25,12 +25,12 @@ * instead of those above. */ -#ifndef _SV_SVSYS_H -#define _SV_SVSYS_H +#ifndef _VCL_IOS_SVSYS_H +#define _VCL_IOS_SVSYS_H // ? -#endif // _SV_SVSYS_H +#endif // _VCL_IOS_SVSYS_H /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/svsys.h b/vcl/inc/svsys.h index fb9a9215be7a..ce65f4ab95fb 100644 --- a/vcl/inc/svsys.h +++ b/vcl/inc/svsys.h @@ -36,6 +36,8 @@ #include "os2/svsys.h" #elif defined IOS #include "ios/svsys.h" +#elif defined ANDROID +#include "android/svsys.h" #else #include "unx/svsys.h" #endif -- cgit v1.2.3 From 93d8410023f659c324d1249f6500134b51edf242 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Wed, 22 Jun 2011 10:06:34 +0200 Subject: use the new way of specifying UNO API includes --- vcl/Library_vclplug_gtk3.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'vcl') diff --git a/vcl/Library_vclplug_gtk3.mk b/vcl/Library_vclplug_gtk3.mk index 83fb8306468d..587d69376500 100644 --- a/vcl/Library_vclplug_gtk3.mk +++ b/vcl/Library_vclplug_gtk3.mk @@ -32,7 +32,6 @@ $(eval $(call gb_Library_set_include,vclplug_gtk3,\ -I$(SRCDIR)/vcl/inc \ -I$(SRCDIR)/vcl/inc/pch \ -I$(SRCDIR)/solenv/inc \ - -I$(OUTDIR)/inc/offuh \ -I$(OUTDIR)/inc \ )) @@ -47,6 +46,11 @@ $(eval $(call gb_Library_set_defs,vclplug_gtk3,\ -DVERSION=\"$(UPD)$(LAST_MINOR)\" \ )) +$(eval $(call gb_Library_add_api,vclplug_gtk3,\ + offapi \ + udkapi \ +)) + ifneq ($(ENABLE_DBUS),) $(eval $(call gb_Library_set_include,vclplug_gtk3,\ $$(INCLUDE) \ -- cgit v1.2.3 From ac96c998b9ed4cff056a05d343a2ec0a3ce15a60 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 21 Jun 2011 23:19:02 +0100 Subject: take advantage of default arguments --- vcl/inc/vcl/strhelper.hxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/strhelper.hxx b/vcl/inc/vcl/strhelper.hxx index 450139b0ba14..9a6cc0cca634 100644 --- a/vcl/inc/vcl/strhelper.hxx +++ b/vcl/inc/vcl/strhelper.hxx @@ -58,14 +58,12 @@ ByteString VCL_DLLPUBLIC WhitespaceToSpace( const ByteString&, sal_Bool bProtect // parses the first double in the string; decimal is '.' only inline double VCL_DLLPUBLIC StringToDouble( const String& rStr ) { - rtl_math_ConversionStatus eStatus; - return rtl::math::stringToDouble( rStr, sal_Unicode('.'), sal_Unicode(0), &eStatus, NULL); + return rtl::math::stringToDouble(rStr, sal_Unicode('.'), sal_Unicode(0)); } inline double VCL_DLLPUBLIC StringToDouble( const ByteString& rStr ) { - rtl_math_ConversionStatus eStatus; - return rtl::math::stringToDouble( rtl::OStringToOUString( rStr, osl_getThreadTextEncoding() ), sal_Unicode('.'), sal_Unicode(0), &eStatus, NULL); + return rtl::math::stringToDouble(rtl::OStringToOUString( rStr, osl_getThreadTextEncoding() ), sal_Unicode('.'), sal_Unicode(0)); } // fills a character buffer with the string representation of a double -- cgit v1.2.3 From 30a53d4ea9f554fed283245fb02ae6c1437dd0fe Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 21 Jun 2011 23:53:45 +0100 Subject: simplify this now --- vcl/inc/vcl/strhelper.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/strhelper.hxx b/vcl/inc/vcl/strhelper.hxx index 9a6cc0cca634..6f1ec6646a6f 100644 --- a/vcl/inc/vcl/strhelper.hxx +++ b/vcl/inc/vcl/strhelper.hxx @@ -63,7 +63,7 @@ inline double VCL_DLLPUBLIC StringToDouble( const String& rStr ) inline double VCL_DLLPUBLIC StringToDouble( const ByteString& rStr ) { - return rtl::math::stringToDouble(rtl::OStringToOUString( rStr, osl_getThreadTextEncoding() ), sal_Unicode('.'), sal_Unicode(0)); + return rtl::math::stringToDouble(rStr, '.', static_cast(0)); } // fills a character buffer with the string representation of a double -- cgit v1.2.3 From 32cc00e9bcd01ff1864ddb3e8727aa4bfa0d4775 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 22 Jun 2011 00:00:52 +0100 Subject: ditch old string --- vcl/inc/unx/saldisp.hxx | 2 +- vcl/unx/generic/app/keysymnames.cxx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/unx/saldisp.hxx b/vcl/inc/unx/saldisp.hxx index 6687762c1e9d..7248f87fbd35 100644 --- a/vcl/inc/unx/saldisp.hxx +++ b/vcl/inc/unx/saldisp.hxx @@ -372,7 +372,7 @@ protected: KeySym nShiftKeySym_; // first shift modifier KeySym nCtrlKeySym_; // first control modifier KeySym nMod1KeySym_; // first mod1 modifier - ByteString m_aKeyboardName; + rtl::OString m_aKeyboardName; vcl_sal::WMAdaptor* m_pWMAdaptor; DtIntegrator* m_pDtIntegrator; diff --git a/vcl/unx/generic/app/keysymnames.cxx b/vcl/unx/generic/app/keysymnames.cxx index e164d06d5d07..c2db38c2a13a 100644 --- a/vcl/unx/generic/app/keysymnames.cxx +++ b/vcl/unx/generic/app/keysymnames.cxx @@ -583,7 +583,7 @@ static const keyboard_layout type6_layout[] = const char* SalDisplay::GetKeyboardName( bool bRefresh ) { - if( bRefresh || ! m_aKeyboardName.Len() ) + if (bRefresh || m_aKeyboardName.isEmpty()) { #if defined(SOLARIS) if( IsLocal() ) @@ -665,10 +665,10 @@ const char* SalDisplay::GetKeyboardName( bool bRefresh ) } } #endif - if( ! m_aKeyboardName.Len() ) + if (m_aKeyboardName.isEmpty()) m_aKeyboardName = ""; } - return m_aKeyboardName.GetBuffer(); + return m_aKeyboardName.getStr(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From 7ccf55e61d8b56b223e72045ed1bf6290269d1bb Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 22 Jun 2011 00:49:30 +0100 Subject: ByteString->osl::OString[Buffer] --- vcl/inc/vcl/syswin.hxx | 4 +- vcl/source/window/syswin.cxx | 120 ++++++++++++++++++++++--------------------- 2 files changed, 64 insertions(+), 60 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/syswin.hxx b/vcl/inc/vcl/syswin.hxx index 0fd2fd8d1512..c8062e3dc352 100644 --- a/vcl/inc/vcl/syswin.hxx +++ b/vcl/inc/vcl/syswin.hxx @@ -231,8 +231,8 @@ public: const Size& GetMaxOutputSizePixel() const; Size GetResizeOutputSizePixel() const; - void SetWindowState( const ByteString& rStr ); - ByteString GetWindowState( sal_uLong nMask = WINDOWSTATE_MASK_ALL ) const; + void SetWindowState(const rtl::OString& rStr); + rtl::OString GetWindowState(sal_uLong nMask = WINDOWSTATE_MASK_ALL) const; void SetMenuBar( MenuBar* pMenuBar ); MenuBar* GetMenuBar() const { return mpMenuBar; } diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index f6c7e422cc3b..53c277e06bb1 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -39,6 +39,8 @@ #include #include +#include + #include #include #include @@ -498,16 +500,17 @@ Size SystemWindow::GetResizeOutputSizePixel() const // ----------------------------------------------------------------------- -static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rStr ) +static void ImplWindowStateFromStr(WindowStateData& rData, + const rtl::OString& rStr) { sal_uLong nValidMask = 0; - xub_StrLen nIndex = 0; - ByteString aTokenStr; + sal_Int32 nIndex = 0; + rtl::OString aTokenStr; - aTokenStr = rStr.GetToken( 0, ',', nIndex ); - if ( aTokenStr.Len() ) + aTokenStr = rStr.getToken(0, ',', nIndex); + if (!aTokenStr.isEmpty()) { - rData.SetX( aTokenStr.ToInt32() ); + rData.SetX(aTokenStr.toInt32()); if( rData.GetX() > -16384 && rData.GetX() < 16384 ) nValidMask |= WINDOWSTATE_MASK_X; else @@ -515,10 +518,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS } else rData.SetX( 0 ); - aTokenStr = rStr.GetToken( 0, ',', nIndex ); - if ( aTokenStr.Len() ) + aTokenStr = rStr.getToken(0, ',', nIndex); + if (!aTokenStr.isEmpty()) { - rData.SetY( aTokenStr.ToInt32() ); + rData.SetY(aTokenStr.toInt32()); if( rData.GetY() > -16384 && rData.GetY() < 16384 ) nValidMask |= WINDOWSTATE_MASK_Y; else @@ -526,10 +529,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS } else rData.SetY( 0 ); - aTokenStr = rStr.GetToken( 0, ',', nIndex ); - if ( aTokenStr.Len() ) + aTokenStr = rStr.getToken(0, ',', nIndex); + if (!aTokenStr.isEmpty()) { - rData.SetWidth( aTokenStr.ToInt32() ); + rData.SetWidth(aTokenStr.toInt32()); if( rData.GetWidth() > 0 && rData.GetWidth() < 16384 ) nValidMask |= WINDOWSTATE_MASK_WIDTH; else @@ -537,10 +540,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS } else rData.SetWidth( 0 ); - aTokenStr = rStr.GetToken( 0, ';', nIndex ); - if ( aTokenStr.Len() ) + aTokenStr = rStr.getToken(0, ';', nIndex); + if (!aTokenStr.isEmpty()) { - rData.SetHeight( aTokenStr.ToInt32() ); + rData.SetHeight(aTokenStr.toInt32()); if( rData.GetHeight() > 0 && rData.GetHeight() < 16384 ) nValidMask |= WINDOWSTATE_MASK_HEIGHT; else @@ -548,12 +551,12 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS } else rData.SetHeight( 0 ); - aTokenStr = rStr.GetToken( 0, ';', nIndex ); - if ( aTokenStr.Len() ) + aTokenStr = rStr.getToken(0, ';', nIndex); + if (!aTokenStr.isEmpty()) { // #94144# allow Minimize again, should be masked out when read from configuration // 91625 - ignore Minimize - sal_uLong nState = (sal_uLong)aTokenStr.ToInt32(); + sal_uInt32 nState = (sal_uInt32)aTokenStr.toInt32(); //nState &= ~(WINDOWSTATE_STATE_MINIMIZED); rData.SetState( nState ); nValidMask |= WINDOWSTATE_MASK_STATE; @@ -562,10 +565,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS rData.SetState( 0 ); // read maximized pos/size - aTokenStr = rStr.GetToken( 0, ',', nIndex ); - if ( aTokenStr.Len() ) + aTokenStr = rStr.getToken(0, ',', nIndex); + if (!aTokenStr.isEmpty()) { - rData.SetMaximizedX( aTokenStr.ToInt32() ); + rData.SetMaximizedX(aTokenStr.toInt32()); if( rData.GetMaximizedX() > -16384 && rData.GetMaximizedX() < 16384 ) nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_X; else @@ -573,10 +576,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS } else rData.SetMaximizedX( 0 ); - aTokenStr = rStr.GetToken( 0, ',', nIndex ); - if ( aTokenStr.Len() ) + aTokenStr = rStr.getToken(0, ',', nIndex); + if (!aTokenStr.isEmpty()) { - rData.SetMaximizedY( aTokenStr.ToInt32() ); + rData.SetMaximizedY(aTokenStr.toInt32()); if( rData.GetMaximizedY() > -16384 && rData.GetMaximizedY() < 16384 ) nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_Y; else @@ -584,10 +587,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS } else rData.SetMaximizedY( 0 ); - aTokenStr = rStr.GetToken( 0, ',', nIndex ); - if ( aTokenStr.Len() ) + aTokenStr = rStr.getToken(0, ',', nIndex); + if (!aTokenStr.isEmpty()) { - rData.SetMaximizedWidth( aTokenStr.ToInt32() ); + rData.SetMaximizedWidth(aTokenStr.toInt32()); if( rData.GetMaximizedWidth() > 0 && rData.GetMaximizedWidth() < 16384 ) nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_WIDTH; else @@ -595,10 +598,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS } else rData.SetMaximizedWidth( 0 ); - aTokenStr = rStr.GetToken( 0, ';', nIndex ); - if ( aTokenStr.Len() ) + aTokenStr = rStr.getToken(0, ';', nIndex); + if (!aTokenStr.isEmpty()) { - rData.SetMaximizedHeight( aTokenStr.ToInt32() ); + rData.SetMaximizedHeight(aTokenStr.toInt32()); if( rData.GetMaximizedHeight() > 0 && rData.GetMaximizedHeight() < 16384 ) nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_HEIGHT; else @@ -613,45 +616,48 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS // ----------------------------------------------------------------------- -static void ImplWindowStateToStr( const WindowStateData& rData, ByteString& rStr ) +static rtl::OString ImplWindowStateToStr(const WindowStateData& rData) { sal_uLong nValidMask = rData.GetMask(); if ( !nValidMask ) - return; + return rtl::OString(); + + rtl::OStringBuffer rStrBuf; if ( nValidMask & WINDOWSTATE_MASK_X ) - rStr.Append( ByteString::CreateFromInt32( rData.GetX() ) ); - rStr.Append( ',' ); + rStrBuf.append(rData.GetX()); + rStrBuf.append(','); if ( nValidMask & WINDOWSTATE_MASK_Y ) - rStr.Append( ByteString::CreateFromInt32( rData.GetY() ) ); - rStr.Append( ',' ); + rStrBuf.append(rData.GetY()); + rStrBuf.append(','); if ( nValidMask & WINDOWSTATE_MASK_WIDTH ) - rStr.Append( ByteString::CreateFromInt32( rData.GetWidth() ) ); - rStr.Append( ',' ); + rStrBuf.append(static_cast(rData.GetWidth())); + rStrBuf.append(','); if ( nValidMask & WINDOWSTATE_MASK_HEIGHT ) - rStr.Append( ByteString::CreateFromInt32( rData.GetHeight() ) ); - rStr.Append( ';' ); + rStrBuf.append(static_cast(rData.GetHeight())); + rStrBuf.append( ';' ); if ( nValidMask & WINDOWSTATE_MASK_STATE ) { // #94144# allow Minimize again, should be masked out when read from configuration // 91625 - ignore Minimize - sal_uLong nState = rData.GetState(); - //nState &= ~(WINDOWSTATE_STATE_MINIMIZED); - rStr.Append( ByteString::CreateFromInt32( (long)nState ) ); + sal_uInt32 nState = rData.GetState(); + rStrBuf.append(static_cast(nState)); } - rStr.Append( ';' ); + rStrBuf.append(';'); if ( nValidMask & WINDOWSTATE_MASK_MAXIMIZED_X ) - rStr.Append( ByteString::CreateFromInt32( rData.GetMaximizedX() ) ); - rStr.Append( ',' ); + rStrBuf.append(rData.GetMaximizedX()); + rStrBuf.append(','); if ( nValidMask & WINDOWSTATE_MASK_MAXIMIZED_Y ) - rStr.Append( ByteString::CreateFromInt32( rData.GetMaximizedY() ) ); - rStr.Append( ',' ); + rStrBuf.append(rData.GetMaximizedY()); + rStrBuf.append( ',' ); if ( nValidMask & WINDOWSTATE_MASK_MAXIMIZED_WIDTH ) - rStr.Append( ByteString::CreateFromInt32( rData.GetMaximizedWidth() ) ); - rStr.Append( ',' ); + rStrBuf.append(static_cast(rData.GetMaximizedWidth())); + rStrBuf.append(','); if ( nValidMask & WINDOWSTATE_MASK_MAXIMIZED_HEIGHT ) - rStr.Append( ByteString::CreateFromInt32( rData.GetMaximizedHeight() ) ); - rStr.Append( ';' ); + rStrBuf.append(static_cast(rData.GetMaximizedHeight())); + rStrBuf.append(';'); + + return rStrBuf.makeStringAndClear(); } // ----------------------------------------------------------------------- @@ -955,9 +961,9 @@ void SystemWindow::GetWindowStateData( WindowStateData& rData ) const // ----------------------------------------------------------------------- -void SystemWindow::SetWindowState( const ByteString& rStr ) +void SystemWindow::SetWindowState(const rtl::OString& rStr) { - if ( !rStr.Len() ) + if (rStr.isEmpty()) return; WindowStateData aData; @@ -967,15 +973,13 @@ void SystemWindow::SetWindowState( const ByteString& rStr ) // ----------------------------------------------------------------------- -ByteString SystemWindow::GetWindowState( sal_uLong nMask ) const +rtl::OString SystemWindow::GetWindowState( sal_uLong nMask ) const { WindowStateData aData; aData.SetMask( nMask ); GetWindowStateData( aData ); - ByteString aStr; - ImplWindowStateToStr( aData, aStr ); - return aStr; + return ImplWindowStateToStr(aData); } // ----------------------------------------------------------------------- -- cgit v1.2.3 From 0c6f8003581ea03460f54c5ada00936ec5d341c5 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 22 Jun 2011 10:38:44 +0100 Subject: fix build errors --- vcl/source/window/syswin.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'vcl') diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index 53c277e06bb1..51258f73e77f 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -625,10 +625,10 @@ static rtl::OString ImplWindowStateToStr(const WindowStateData& rData) rtl::OStringBuffer rStrBuf; if ( nValidMask & WINDOWSTATE_MASK_X ) - rStrBuf.append(rData.GetX()); + rStrBuf.append(static_cast(rData.GetX())); rStrBuf.append(','); if ( nValidMask & WINDOWSTATE_MASK_Y ) - rStrBuf.append(rData.GetY()); + rStrBuf.append(static_cast(rData.GetY())); rStrBuf.append(','); if ( nValidMask & WINDOWSTATE_MASK_WIDTH ) rStrBuf.append(static_cast(rData.GetWidth())); @@ -645,10 +645,10 @@ static rtl::OString ImplWindowStateToStr(const WindowStateData& rData) } rStrBuf.append(';'); if ( nValidMask & WINDOWSTATE_MASK_MAXIMIZED_X ) - rStrBuf.append(rData.GetMaximizedX()); + rStrBuf.append(static_cast(rData.GetMaximizedX())); rStrBuf.append(','); if ( nValidMask & WINDOWSTATE_MASK_MAXIMIZED_Y ) - rStrBuf.append(rData.GetMaximizedY()); + rStrBuf.append(static_cast(rData.GetMaximizedY())); rStrBuf.append( ',' ); if ( nValidMask & WINDOWSTATE_MASK_MAXIMIZED_WIDTH ) rStrBuf.append(static_cast(rData.GetMaximizedWidth())); -- cgit v1.2.3 From fb18147a63061e719c35f32d5adf7699bc021972 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 22 Jun 2011 11:19:06 +0100 Subject: make fontconfig non-optional on non-MacOSX unix --- vcl/Library_vcl.mk | 7 -- vcl/unx/generic/fontmanager/fontconfig.cxx | 131 +++++++---------------------- 2 files changed, 31 insertions(+), 107 deletions(-) (limited to 'vcl') diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index c8292cf7ac71..c0eb89e04eeb 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -177,12 +177,6 @@ $(eval $(call gb_Library_set_defs,vcl,\ -DSAL_DLLPOSTFIX=\"$(gb_Library_OOOEXT)\" \ -D_XSALSET_LIBNAME=\"$(call gb_Library_get_runtime_filename,spa)\" \ )) -## handle fontconfig -ifneq ($(ENABLE_FONTCONFIG),) -$(eval $(call gb_Library_set_defs,vcl,\ - $$(DEFS) \ - -DENABLE_FONTCONFIG \ -)) ## handle CUPS ifneq ($(ENABLE_CUPS),) $(eval $(call gb_Library_set_defs,vcl,\ @@ -190,7 +184,6 @@ $(eval $(call gb_Library_set_defs,vcl,\ -DENABLE_CUPS \ )) endif -endif $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/source/glyphs/gcach_ftyp \ vcl/source/glyphs/gcach_layout \ diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx index c1d506d91d83..1dc100159778 100644 --- a/vcl/unx/generic/fontmanager/fontconfig.cxx +++ b/vcl/unx/generic/fontmanager/fontconfig.cxx @@ -36,53 +36,37 @@ using namespace psp; -#ifdef ENABLE_FONTCONFIG - #include - #include - #include - // allow compile on baseline (currently with fontconfig 2.2.0) - #ifndef FC_WEIGHT_BOOK // TODO: remove when baseline moves to fc>=2.2.1 - #define FC_WEIGHT_BOOK 75 - #endif - #ifndef FC_EMBEDDED_BITMAP // TODO: remove when baseline moves to fc>=2.3.92 - #define FC_EMBEDDED_BITMAP "embeddedbitmap" - #endif - #ifndef FC_FAMILYLANG // TODO: remove when baseline moves to fc>=2.2.97 - #define FC_FAMILYLANG "familylang" - #endif - #ifndef FC_CAPABILITY // TODO: remove when baseline moves to fc>=2.2.97 - #define FC_CAPABILITY "capability" - #endif - #ifndef FC_STYLELANG // TODO: remove when baseline moves to fc>=2.2.97 - #define FC_STYLELANG "stylelang" - #endif - #ifndef FC_HINT_STYLE // TODO: remove when baseline moves to fc>=2.2.91 - #define FC_HINT_STYLE "hintstyle" - #define FC_HINT_NONE 0 - #define FC_HINT_SLIGHT 1 - #define FC_HINT_MEDIUM 2 - #define FC_HINT_FULL 3 - #endif - #ifndef FC_FT_FACE - #define FC_FT_FACE "ftface" - #endif - #ifndef FC_EMBOLDEN - #define FC_EMBOLDEN "embolden" - #endif -#else - typedef void FcConfig; - typedef void FcObjectSet; - typedef void FcPattern; - typedef void FcFontSet; - typedef void FcCharSet; - typedef int FcResult; - typedef int FcBool; - typedef int FcMatchKind; - typedef char FcChar8; - typedef int FcChar32; - typedef unsigned int FT_UInt; - typedef void* FT_Face; - typedef int FcSetName; +#include +#include +#include +// allow compile on baseline (currently with fontconfig 2.2.0) +#ifndef FC_WEIGHT_BOOK // TODO: remove when baseline moves to fc>=2.2.1 + #define FC_WEIGHT_BOOK 75 +#endif +#ifndef FC_EMBEDDED_BITMAP // TODO: remove when baseline moves to fc>=2.3.92 + #define FC_EMBEDDED_BITMAP "embeddedbitmap" +#endif +#ifndef FC_FAMILYLANG // TODO: remove when baseline moves to fc>=2.2.97 + #define FC_FAMILYLANG "familylang" +#endif +#ifndef FC_CAPABILITY // TODO: remove when baseline moves to fc>=2.2.97 + #define FC_CAPABILITY "capability" +#endif +#ifndef FC_STYLELANG // TODO: remove when baseline moves to fc>=2.2.97 + #define FC_STYLELANG "stylelang" +#endif +#ifndef FC_HINT_STYLE // TODO: remove when baseline moves to fc>=2.2.91 + #define FC_HINT_STYLE "hintstyle" + #define FC_HINT_NONE 0 + #define FC_HINT_SLIGHT 1 + #define FC_HINT_MEDIUM 2 + #define FC_HINT_FULL 3 +#endif +#ifndef FC_FT_FACE + #define FC_FT_FACE "ftface" +#endif +#ifndef FC_EMBOLDEN + #define FC_EMBOLDEN "embolden" #endif #include @@ -483,7 +467,6 @@ FontCfgWrapper::FontCfgWrapper() void FontCfgWrapper::addFontSet( FcSetName eSetName ) { - #ifdef ENABLE_FONTCONFIG /* add only acceptable outlined fonts to our config, for future fontconfig use @@ -506,12 +489,8 @@ void FontCfgWrapper::addFontSet( FcSetName eSetName ) } // TODO?: FcFontSetDestroy( pOrig ); - #else - (void)eSetName; // prevent compiler warning about unused parameter - #endif } -#ifdef ENABLE_FONTCONFIG namespace { int compareFontNames(FontCfgWrapper& rWrapper, const FcPattern *a, const FcPattern *b) @@ -593,11 +572,9 @@ namespace return bIsDup; } } -#endif FcFontSet* FontCfgWrapper::getFontSet() { - #ifdef ENABLE_FONTCONFIG if( !m_pOutlineSet ) { m_pOutlineSet = FcFontSetCreate(); @@ -607,7 +584,6 @@ FcFontSet* FontCfgWrapper::getFontSet() ::std::sort(m_pOutlineSet->fonts,m_pOutlineSet->fonts+m_pOutlineSet->nfont,SortFont(*this)); } - #endif return m_pOutlineSet; } @@ -639,7 +615,6 @@ void FontCfgWrapper::release() } } -#ifdef ENABLE_FONTCONFIG namespace { class localizedsorter @@ -1262,10 +1237,6 @@ public: ImplFontOptions* PrintFontManager::getFontOptions( const FastPrintFontInfo& rInfo, int nSize, void (*subcallback)(void*)) const { -#ifndef ENABLE_FONTCONFIG - (void)rInfo;(void)nSize;(void)subcallback;(void)rOptions; - return NULL; -#else // ENABLE_FONTCONFIG FontCfgWrapper& rWrapper = FontCfgWrapper::get(); if( ! rWrapper.isValid() ) return NULL; @@ -1334,7 +1305,6 @@ ImplFontOptions* PrintFontManager::getFontOptions( rWrapper.FcPatternDestroy( pPattern ); return pOptions; -#endif } bool PrintFontManager::matchFont( FastPrintFontInfo& rInfo, const com::sun::star::lang::Locale& rLocale ) @@ -1404,43 +1374,4 @@ bool PrintFontManager::matchFont( FastPrintFontInfo& rInfo, const com::sun::star return bSuccess; } -#else // ENABLE_FONTCONFIG not defined - -bool PrintFontManager::initFontconfig() -{ - return false; -} - -int PrintFontManager::countFontconfigFonts( boost::unordered_map& ) -{ - return 0; -} - -void PrintFontManager::deinitFontconfig() -{} - -bool PrintFontManager::addFontconfigDir( const rtl::OString& ) -{ - return false; -} - -bool PrintFontManager::matchFont( FastPrintFontInfo&, const com::sun::star::lang::Locale& ) -{ - return false; -} - -int PrintFontManager::FreeTypeCharIndex( void*, sal_uInt32 ) -{ - return 0; -} - -rtl::OUString PrintFontManager::Substitute( const rtl::OUString&, - rtl::OUString&, const rtl::OString&, FontItalic, FontWeight, FontWidth, FontPitch) const -{ - rtl::OUString aName; - return aName; -} - -#endif // ENABLE_FONTCONFIG - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From 8fdcbfe58681752727e658071937177f6ee79ceb Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 22 Jun 2011 12:26:48 +0100 Subject: dewrap fontconfig and link directly, remove non-fontconfig paths --- vcl/Library_vcl.mk | 15 +- vcl/unx/generic/fontmanager/fontconfig.cxx | 576 ++++++----------------------- vcl/unx/generic/printer/cupsmgr.cxx | 2 +- 3 files changed, 115 insertions(+), 478 deletions(-) (limited to 'vcl') diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index c0eb89e04eeb..8811bda29661 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -49,6 +49,7 @@ $(eval $(call gb_Library_set_include,vcl,\ ifeq ($(GUIBASE),unx) $(eval $(call gb_Library_set_cxxflags,vcl,\ $$(CXXFLAGS) \ + $$(FONTCONFIG_CFLAGS) \ $$(FREETYPE_CFLAGS) \ )) endif @@ -84,12 +85,6 @@ $(eval $(call gb_Library_add_linked_libs,vcl,\ $(gb_STDLIBS) \ )) -ifeq ($(GUIBASE),unx) -$(eval $(call gb_Library_add_linked_libs,vcl,\ - freetype \ -)) -endif - ifeq ($(GUIBASE),aqua) $(eval $(call gb_Library_set_cxxflags,vcl,\ $$(CXXFLAGS) \ @@ -444,6 +439,14 @@ $(eval $(call gb_Library_add_linked_libs,vcl,\ endif endif +ifeq ($(GUIBASE),unx) +$(eval $(call gb_Library_set_ldflags,vcl,\ + $$(LDFLAGS) \ + $$(FONTCONFIG_LIBS) \ + $$(FREETYPE_LIBS) \ +)) +endif + ifeq ($(OS),LINUX) $(eval $(call gb_Library_add_linked_libs,vcl,\ dl \ diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx index 1dc100159778..693bf3b6a3d5 100644 --- a/vcl/unx/generic/fontmanager/fontconfig.cxx +++ b/vcl/unx/generic/fontmanager/fontconfig.cxx @@ -98,53 +98,8 @@ namespace class FontCfgWrapper { - oslModule m_pLib; FcFontSet* m_pOutlineSet; - int m_nFcVersion; - FcBool (*m_pFcInit)(); - void (*m_pFcFini)(); - int (*m_pFcGetVersion)(); - FcConfig* (*m_pFcConfigGetCurrent)(); - FcObjectSet* (*m_pFcObjectSetVaBuild)(const char*,va_list); - void (*m_pFcObjectSetDestroy)(FcObjectSet* pSet); - FcPattern* (*m_pFcPatternCreate)(); - void (*m_pFcPatternDestroy)(FcPattern*); - FcBool (*m_pFcPatternEqual)(const FcPattern*,const FcPattern*); - FcFontSet* (*m_pFcConfigGetFonts)(FcConfig*,FcSetName); - FcFontSet* (*m_pFcFontSetCreate)(); - FcCharSet* (*m_pFcCharSetCreate)(); - FcBool (*m_pFcCharSetAddChar)(FcCharSet *, FcChar32); - FcBool (*m_pFcCharSetHasChar)(FcCharSet *, FcChar32); - void (*m_pFcCharSetDestroy)(FcCharSet*); - void (*m_pFcFontSetDestroy)(FcFontSet*); - FcBool (*m_pFcFontSetAdd)(FcFontSet*,FcPattern*); - void (*m_pFcPatternReference)(FcPattern*); - FcResult (*m_pFcPatternGetCharSet)(const FcPattern*,const char*,int,FcCharSet**); - FcResult (*m_pFcPatternGetString)(const FcPattern*,const char*,int,FcChar8**); - FcResult (*m_pFcPatternGetInteger)(const FcPattern*,const char*,int,int*); - FcResult (*m_pFcPatternGetDouble)(const FcPattern*,const char*,int,double*); - 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); - 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); - FcBool (*m_pFcPatternAddFTFace)(FcPattern*,const char*,const FT_Face); - - oslGenericFunction loadSymbol( const char* ); void addFontSet( FcSetName ); FontCfgWrapper(); @@ -154,127 +109,8 @@ public: static FontCfgWrapper& get(); static void release(); - bool isValid() const - { return m_pLib != NULL;} - FcFontSet* getFontSet(); - FcBool FcInit() - { return m_pFcInit(); } - - void FcFini() - { - //To-Do: get gtk vclplug smoketest to pass - //if (m_pFcFini) m_pFcFini(); - } - - int FcGetVersion() - { return m_pFcGetVersion(); } - - FcConfig* FcConfigGetCurrent() - { return m_pFcConfigGetCurrent(); } - - FcObjectSet* FcObjectSetBuild( const char* first, ... ) - { - va_list ap; - va_start( ap, first ); - FcObjectSet* pSet = m_pFcObjectSetVaBuild( first, ap ); - va_end( ap ); - return pSet; - } - - void FcObjectSetDestroy( FcObjectSet* pSet ) - { m_pFcObjectSetDestroy( pSet ); } - - FcPattern* FcPatternCreate() - { return m_pFcPatternCreate(); } - - void FcPatternDestroy( FcPattern* pPattern ) - { if (m_pFcPatternDestroy) m_pFcPatternDestroy( pPattern ); } - - FcBool FcPatternEqual( const FcPattern* pPatternA, const FcPattern *pPatternB ) - { return m_pFcPatternEqual( pPatternA, pPatternB ); } - - FcFontSet* FcConfigGetFonts( FcConfig* pConfig, FcSetName eSet) - { return m_pFcConfigGetFonts( pConfig, eSet ); } - - FcFontSet* FcFontSetCreate() - { return m_pFcFontSetCreate(); } - - FcCharSet* FcCharSetCreate() - { return m_pFcCharSetCreate(); } - - FcBool FcCharSetAddChar(FcCharSet *fcs, FcChar32 ucs4) - { return m_pFcCharSetAddChar(fcs, ucs4); } - - FcBool FcCharSetHasChar(FcCharSet *fcs, FcChar32 ucs4) - { return m_pFcCharSetHasChar(fcs, ucs4); } - - void FcCharSetDestroy( FcCharSet* pSet ) - { m_pFcCharSetDestroy( pSet );} - - void FcFontSetDestroy( FcFontSet* pSet ) - { m_pFcFontSetDestroy( pSet );} - - FcBool FcFontSetAdd( FcFontSet* pSet, FcPattern* pPattern ) - { return m_pFcFontSetAdd( pSet, pPattern ); } - - void FcPatternReference( FcPattern* pPattern ) - { m_pFcPatternReference( pPattern ); } - - FcResult FcPatternGetCharSet( const FcPattern* pPattern, const char* object, int n, FcCharSet** s ) - { return m_pFcPatternGetCharSet( pPattern, object, n, s ); } - - FcResult FcPatternGetString( const FcPattern* pPattern, const char* object, int n, FcChar8** s ) - { return m_pFcPatternGetString( pPattern, object, n, s ); } - - FcResult FcPatternGetInteger( const FcPattern* pPattern, const char* object, int n, int* s ) - { return m_pFcPatternGetInteger( pPattern, object, n, s ); } - - FcResult FcPatternGetDouble( const FcPattern* pPattern, const char* object, int n, double* s ) - { return m_pFcPatternGetDouble( pPattern, object, n, s ); } - - FcResult FcPatternGetBool( const FcPattern* pPattern, const char* object, int n, FcBool* s ) - { return m_pFcPatternGetBool( pPattern, object, n, s ); } - FcBool FcConfigAppFontAddFile( FcConfig* pConfig, const FcChar8* pFileName ) - { return m_pFcConfigAppFontAddFile( pConfig, pFileName ); } - FcBool FcConfigAppFontAddDir(FcConfig* pConfig, const FcChar8* pDirName ) - { return m_pFcConfigAppFontAddDir( pConfig, pDirName ); } - FcBool FcConfigParseAndLoad( FcConfig* pConfig, const FcChar8* pFileName, FcBool bComplain ) - { return m_pFcConfigParseAndLoad( pConfig, pFileName, bComplain ); } - - void FcDefaultSubstitute( FcPattern* pPattern ) - { 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 ) - { return m_pFcPatternAddDouble( pPattern, pObject, nValue ); } - FcBool FcPatternAddString( FcPattern* pPattern, const char* pObject, const FcChar8* pString ) - { return m_pFcPatternAddString( pPattern, pObject, pString ); } - FcBool FcPatternAddBool( FcPattern* pPattern, const char* pObject, bool nValue ) - { 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; } - FcBool FcPatternAddFTFace( FcPattern* pPattern, const char* pObject, const FT_Face nValue ) - { - return m_pFcPatternAddFTFace - ? m_pFcPatternAddFTFace( pPattern, pObject, nValue ) - : false; - } public: FcResult LocalizedElementFromPattern(FcPattern* pPattern, FcChar8 **family, const char *elementtype, const char *elementlangtype); @@ -285,184 +121,10 @@ private: void cacheLocalizedFontNames(FcChar8 *origfontname, FcChar8 *bestfontname, const std::vector< lang_and_element > &lang_and_elements); }; -oslGenericFunction FontCfgWrapper::loadSymbol( const char* pSymbol ) -{ - OUString aSym( OUString::createFromAscii( pSymbol ) ); - oslGenericFunction pSym = osl_getFunctionSymbol( m_pLib, aSym.pData ); -#if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "%s %s\n", pSymbol, pSym ? "found" : "not found" ); -#endif - return pSym; -} - FontCfgWrapper::FontCfgWrapper() - : m_pLib( NULL ), - m_pOutlineSet( NULL ), - m_nFcVersion( 0 ) + : m_pOutlineSet( NULL ) { - OUString aLib( RTL_CONSTASCII_USTRINGPARAM( "libfontconfig.so.1" ) ); - m_pLib = osl_loadModule( aLib.pData, SAL_LOADMODULE_LAZY ); - if( !m_pLib ) - { - aLib = OUString( RTL_CONSTASCII_USTRINGPARAM( "libfontconfig.so" ) ); - m_pLib = osl_loadModule( aLib.pData, SAL_LOADMODULE_LAZY ); - } - - if( ! m_pLib ) - { -#if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "no libfontconfig\n" ); -#endif - return; - } - - m_pFcInit = (FcBool(*)()) - loadSymbol( "FcInit" ); - m_pFcFini = (void(*)()) - loadSymbol( "FcFini" ); - m_pFcGetVersion = (int(*)()) - loadSymbol( "FcGetVersion" ); - m_pFcConfigGetCurrent = (FcConfig *(*)()) - loadSymbol( "FcConfigGetCurrent" ); - m_pFcObjectSetVaBuild = (FcObjectSet*(*)(const char*,va_list)) - loadSymbol( "FcObjectSetVaBuild" ); - m_pFcObjectSetDestroy = (void(*)(FcObjectSet*)) - loadSymbol( "FcObjectSetDestroy" ); - m_pFcPatternCreate = (FcPattern*(*)()) - loadSymbol( "FcPatternCreate" ); - m_pFcPatternDestroy = (void(*)(FcPattern*)) - loadSymbol( "FcPatternDestroy" ); - m_pFcPatternEqual = (FcBool(*)(const FcPattern*,const FcPattern*)) - loadSymbol( "FcPatternEqual" ); - m_pFcConfigGetFonts = (FcFontSet*(*)(FcConfig*,FcSetName)) - loadSymbol( "FcConfigGetFonts" ); - m_pFcFontSetCreate = (FcFontSet*(*)()) - loadSymbol( "FcFontSetCreate" ); - m_pFcCharSetCreate = (FcCharSet*(*)()) - loadSymbol( "FcCharSetCreate" ); - m_pFcCharSetAddChar = (FcBool(*)(FcCharSet*, FcChar32)) - loadSymbol( "FcCharSetAddChar" ); - m_pFcCharSetHasChar = (FcBool(*)(FcCharSet*, FcChar32)) - loadSymbol( "FcCharSetHasChar" ); - m_pFcCharSetDestroy = (void(*)(FcCharSet*)) - loadSymbol( "FcCharSetDestroy" ); - m_pFcFontSetDestroy = (void(*)(FcFontSet*)) - loadSymbol( "FcFontSetDestroy" ); - m_pFcFontSetAdd = (FcBool(*)(FcFontSet*,FcPattern*)) - loadSymbol( "FcFontSetAdd" ); - m_pFcPatternReference = (void(*)(FcPattern*)) - loadSymbol( "FcPatternReference" ); - m_pFcPatternGetCharSet = (FcResult(*)(const FcPattern*,const char*,int,FcCharSet**)) - loadSymbol( "FcPatternGetCharSet" ); - m_pFcPatternGetString = (FcResult(*)(const FcPattern*,const char*,int,FcChar8**)) - loadSymbol( "FcPatternGetString" ); - m_pFcPatternGetInteger = (FcResult(*)(const FcPattern*,const char*,int,int*)) - loadSymbol( "FcPatternGetInteger" ); - m_pFcPatternGetDouble = (FcResult(*)(const FcPattern*,const char*,int,double*)) - loadSymbol( "FcPatternGetDouble" ); - m_pFcPatternGetBool = (FcResult(*)(const FcPattern*,const char*,int,FcBool*)) - loadSymbol( "FcPatternGetBool" ); - m_pFcConfigAppFontAddFile = (FcBool(*)(FcConfig*, const FcChar8*)) - loadSymbol( "FcConfigAppFontAddFile" ); - m_pFcConfigAppFontAddDir = (FcBool(*)(FcConfig*, const FcChar8*)) - loadSymbol( "FcConfigAppFontAddDir" ); - m_pFcConfigParseAndLoad = (FcBool(*)(FcConfig*, const FcChar8*, FcBool)) - loadSymbol( "FcConfigParseAndLoad" ); - m_pFcDefaultSubstitute = (void(*)(FcPattern *)) - 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)) - loadSymbol( "FcPatternAddDouble" ); - m_pFcPatternAddBool = (FcBool(*)(FcPattern*,const char*,FcBool)) - loadSymbol( "FcPatternAddBool" ); - m_pFcPatternAddCharSet = (FcBool(*)(FcPattern*,const char*,const FcCharSet *)) - 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" ); - m_pFcPatternAddFTFace = (FcBool(*)(FcPattern*,const char*,const FT_Face)) - loadSymbol( "FcPatternAddFTFace" ); - - m_nFcVersion = FcGetVersion(); -#if (OSL_DEBUG_LEVEL > 1) - fprintf( stderr,"FC_VERSION = %05d\n", m_nFcVersion ); -#endif - // make minimum version configurable - const char* pMinFcVersion = getenv( "SAL_MIN_FC_VERSION"); - if( pMinFcVersion ) - { - const int nMinFcVersion = atoi( pMinFcVersion ); - if( m_nFcVersion < nMinFcVersion ) - m_pFcInit = NULL; - } - - if( ! ( - m_pFcInit && - m_pFcGetVersion && - m_pFcConfigGetCurrent && - m_pFcObjectSetVaBuild && - m_pFcObjectSetDestroy && - m_pFcPatternCreate && - m_pFcPatternDestroy && - m_pFcPatternEqual && - m_pFcConfigGetFonts && - m_pFcFontSetCreate && - m_pFcCharSetCreate && - m_pFcCharSetAddChar && - m_pFcCharSetHasChar && - m_pFcCharSetDestroy && - m_pFcFontSetDestroy && - m_pFcFontSetAdd && - m_pFcPatternReference && - m_pFcPatternGetCharSet && - m_pFcPatternGetString && - m_pFcPatternGetInteger && - m_pFcPatternGetDouble && - m_pFcPatternGetBool && - m_pFcConfigAppFontAddFile && - m_pFcConfigAppFontAddDir && - m_pFcConfigParseAndLoad && - m_pFcFontMatch && - m_pFcDefaultSubstitute && - m_pFcConfigSubstitute && - m_pFcPatternDuplicate && - m_pFcPatternAddInteger && - m_pFcPatternAddDouble && - m_pFcPatternAddCharSet && - m_pFcPatternAddBool && - m_pFcPatternAddString && - m_pFcPatternDel - ) ) - { - osl_unloadModule( (oslModule)m_pLib ); - m_pLib = NULL; -#if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "not all needed symbols were found in libfontconfig\n" ); -#endif - return; - } - - FcInit(); - if( ! FcConfigGetCurrent() ) - { - osl_unloadModule( (oslModule)m_pLib ); - m_pLib = NULL; - } } void FontCfgWrapper::addFontSet( FcSetName eSetName ) @@ -493,12 +155,12 @@ void FontCfgWrapper::addFontSet( FcSetName eSetName ) namespace { - int compareFontNames(FontCfgWrapper& rWrapper, const FcPattern *a, const FcPattern *b) + int compareFontNames(const FcPattern *a, const FcPattern *b) { FcChar8 *pNameA=NULL, *pNameB=NULL; - bool bHaveA = rWrapper.FcPatternGetString(a, FC_FAMILY, 0, &pNameA) == FcResultMatch; - bool bHaveB = rWrapper.FcPatternGetString(b, FC_FAMILY, 0, &pNameB) == FcResultMatch; + bool bHaveA = FcPatternGetString(a, FC_FAMILY, 0, &pNameA) == FcResultMatch; + bool bHaveB = FcPatternGetString(b, FC_FAMILY, 0, &pNameB) == FcResultMatch; if (bHaveA && bHaveB) return strcmp((const char*)pNameA, (const char*)pNameB); @@ -510,21 +172,17 @@ namespace //those with higher version numbers first class SortFont : public ::std::binary_function< const FcPattern*, const FcPattern*, bool > { - private: - FontCfgWrapper& m_rWrapper; public: - SortFont(FontCfgWrapper& rWrapper) : m_rWrapper(rWrapper) {} - bool operator()(const FcPattern *a, const FcPattern *b) { - int comp = compareFontNames(m_rWrapper, a, b); + int comp = compareFontNames(a, b); if (comp != 0) return comp < 0; int nVersionA=0, nVersionB=0; - bool bHaveA = m_rWrapper.FcPatternGetInteger(a, FC_FONTVERSION, 0, &nVersionA) == FcResultMatch; - bool bHaveB = m_rWrapper.FcPatternGetInteger(b, FC_FONTVERSION, 0, &nVersionB) == FcResultMatch; + bool bHaveA = FcPatternGetInteger(a, FC_FONTVERSION, 0, &nVersionA) == FcResultMatch; + bool bHaveB = FcPatternGetInteger(b, FC_FONTVERSION, 0, &nVersionB) == FcResultMatch; if (bHaveA && bHaveB) return nVersionA > nVersionB; @@ -539,7 +197,7 @@ namespace //See if this font is a duplicate with equal attributes which has already been //inserted, or if it an older version of an inserted fonts. Depends on FcFontSet //on being sorted with SortFont - bool isPreviouslyDuplicateOrObsoleted(FontCfgWrapper& rWrapper, FcFontSet *pFSet, int i) + bool isPreviouslyDuplicateOrObsoleted(FcFontSet *pFSet, int i) { if (i == 0) return false; @@ -547,27 +205,25 @@ namespace const FcPattern *a = pFSet->fonts[i]; const FcPattern *b = pFSet->fonts[i-1]; - if (compareFontNames(rWrapper, a, b) != 0) + if (compareFontNames(a, b) != 0) return false; - FcPattern* pTestPatternA = rWrapper.FcPatternDuplicate(a); - rWrapper.FcPatternDel(pTestPatternA, FC_FILE); - rWrapper.FcPatternDel(pTestPatternA, FC_CHARSET); - rWrapper.FcPatternDel(pTestPatternA, FC_CAPABILITY); - rWrapper.FcPatternDel(pTestPatternA, FC_FONTVERSION); + FcPattern* pTestPatternA = FcPatternDuplicate(a); + FcPatternDel(pTestPatternA, FC_FILE); + FcPatternDel(pTestPatternA, FC_CHARSET); + FcPatternDel(pTestPatternA, FC_CAPABILITY); + FcPatternDel(pTestPatternA, FC_FONTVERSION); - FcPattern* pTestPatternB = rWrapper.FcPatternDuplicate(b); - rWrapper.FcPatternDel(pTestPatternB, FC_FILE); - rWrapper.FcPatternDel(pTestPatternB, FC_CHARSET); - rWrapper.FcPatternDel(pTestPatternB, FC_CAPABILITY); - rWrapper.FcPatternDel(pTestPatternB, FC_FONTVERSION); + FcPattern* pTestPatternB = FcPatternDuplicate(b); + FcPatternDel(pTestPatternB, FC_FILE); + FcPatternDel(pTestPatternB, FC_CHARSET); + FcPatternDel(pTestPatternB, FC_CAPABILITY); + FcPatternDel(pTestPatternB, FC_FONTVERSION); - bool bIsDup = false; - if (rWrapper.FcPatternEqual(pTestPatternA, pTestPatternB)) - bIsDup = true; + bool bIsDup = FcPatternEqual(pTestPatternA, pTestPatternB); - rWrapper.FcPatternDestroy(pTestPatternB); - rWrapper.FcPatternDestroy(pTestPatternA); + FcPatternDestroy(pTestPatternB); + FcPatternDestroy(pTestPatternA); return bIsDup; } @@ -579,10 +235,10 @@ FcFontSet* FontCfgWrapper::getFontSet() { m_pOutlineSet = FcFontSetCreate(); addFontSet( FcSetSystem ); - if( m_nFcVersion > 20400 ) // #i85462# prevent crashes + if( FcGetVersion() > 20400 ) // #i85462# prevent crashes addFontSet( FcSetApplication ); - ::std::sort(m_pOutlineSet->fonts,m_pOutlineSet->fonts+m_pOutlineSet->nfont,SortFont(*this)); + ::std::sort(m_pOutlineSet->fonts,m_pOutlineSet->fonts+m_pOutlineSet->nfont,SortFont()); } return m_pOutlineSet; @@ -592,9 +248,8 @@ FontCfgWrapper::~FontCfgWrapper() { if( m_pOutlineSet ) FcFontSetDestroy( m_pOutlineSet ); - FcFini(); - if( m_pLib ) - osl_unloadModule( (oslModule)m_pLib ); + //To-Do: get gtk vclplug smoketest to pass + //FcFini(); } static FontCfgWrapper* pOneInstance = NULL; @@ -724,9 +379,7 @@ FcResult FontCfgWrapper::LocalizedElementFromPattern(FcPattern* pPattern, FcChar */ bool PrintFontManager::initFontconfig() { - FontCfgWrapper& rWrapper = FontCfgWrapper::get(); - if( ! rWrapper.isValid() ) - return false; + FontCfgWrapper::get(); return true; } @@ -802,8 +455,6 @@ int PrintFontManager::countFontconfigFonts( boost::unordered_mapfonts[i], FC_FILE, 0, &file ); + FcResult eFileRes = FcPatternGetString(pFSet->fonts[i], FC_FILE, 0, &file); FcResult eFamilyRes = rWrapper.LocalizedElementFromPattern( pFSet->fonts[i], &family, FC_FAMILY, FC_FAMILYLANG ); FcResult eStyleRes = rWrapper.LocalizedElementFromPattern( pFSet->fonts[i], &style, FC_STYLE, FC_STYLELANG ); - FcResult eSlantRes = rWrapper.FcPatternGetInteger( pFSet->fonts[i], FC_SLANT, 0, &slant ); - FcResult eWeightRes = rWrapper.FcPatternGetInteger( pFSet->fonts[i], FC_WEIGHT, 0, &weight ); - FcResult eSpacRes = rWrapper.FcPatternGetInteger( pFSet->fonts[i], FC_SPACING, 0, &spacing ); - FcResult eOutRes = rWrapper.FcPatternGetBool( pFSet->fonts[i], FC_OUTLINE, 0, &outline ); - FcResult eIndexRes = rWrapper.FcPatternGetInteger( pFSet->fonts[i], FC_INDEX, 0, &nCollectionEntry ); + FcResult eSlantRes = FcPatternGetInteger(pFSet->fonts[i], FC_SLANT, 0, &slant); + FcResult eWeightRes = FcPatternGetInteger(pFSet->fonts[i], FC_WEIGHT, 0, &weight); + FcResult eSpacRes = FcPatternGetInteger(pFSet->fonts[i], FC_SPACING, 0, &spacing); + FcResult eOutRes = FcPatternGetBool(pFSet->fonts[i], FC_OUTLINE, 0, &outline); + FcResult eIndexRes = FcPatternGetInteger(pFSet->fonts[i], FC_INDEX, 0, &nCollectionEntry); if( eFileRes != FcResultMatch || eFamilyRes != FcResultMatch || eOutRes != FcResultMatch ) continue; @@ -853,7 +504,7 @@ int PrintFontManager::countFontconfigFonts( boost::unordered_map 2 fprintf(stderr, "Ditching %s as duplicate/obsolete\n", file); @@ -979,25 +630,15 @@ void PrintFontManager::deinitFontconfig() FontCfgWrapper::release(); } -int PrintFontManager::FreeTypeCharIndex( void *pFace, sal_uInt32 aChar ) -{ - FontCfgWrapper& rWrapper = FontCfgWrapper::get(); - return rWrapper.isValid() ? rWrapper.FcFreeTypeCharIndex( (FT_Face)pFace, aChar ) : 0; -} - bool PrintFontManager::addFontconfigDir( const rtl::OString& rDirName ) { - FontCfgWrapper& rWrapper = FontCfgWrapper::get(); - if( ! rWrapper.isValid() ) - return false; - // workaround for a stability problems in older FC versions // when handling application specifc fonts - const int nVersion = rWrapper.FcGetVersion(); + const int nVersion = FcGetVersion(); if( nVersion <= 20400 ) return false; const char* pDirName = (const char*)rDirName.getStr(); - bool bDirOk = (rWrapper.FcConfigAppFontAddDir( rWrapper.FcConfigGetCurrent(), (FcChar8*)pDirName ) == FcTrue); + bool bDirOk = (FcConfigAppFontAddDir(FcConfigGetCurrent(), (FcChar8*)pDirName ) == FcTrue); #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "FcConfigAppFontAddDir( \"%s\") => %d\n", pDirName, bDirOk ); @@ -1012,8 +653,8 @@ bool PrintFontManager::addFontconfigDir( const rtl::OString& rDirName ) if( pCfgFile ) { fclose( pCfgFile); - bool bCfgOk = rWrapper.FcConfigParseAndLoad( rWrapper.FcConfigGetCurrent(), - (FcChar8*)aConfFileName.getStr(), FcTrue ); + bool bCfgOk = FcConfigParseAndLoad(FcConfigGetCurrent(), + (FcChar8*)aConfFileName.getStr(), FcTrue); if( !bCfgOk ) fprintf( stderr, "FcConfigParseAndLoad( \"%s\") => %d\n", aConfFileName.getStr(), bCfgOk ); } @@ -1021,7 +662,7 @@ bool PrintFontManager::addFontconfigDir( const rtl::OString& rDirName ) return true; } -static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern, +static void addtopattern(FcPattern *pPattern, FontItalic eItalic, FontWeight eWeight, FontWidth eWidth, FontPitch ePitch) { if( eItalic != ITALIC_DONTKNOW ) @@ -1029,12 +670,16 @@ static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern, int nSlant = FC_SLANT_ROMAN; switch( eItalic ) { - case ITALIC_NORMAL: nSlant = FC_SLANT_ITALIC;break; - case ITALIC_OBLIQUE: nSlant = FC_SLANT_OBLIQUE;break; + case ITALIC_NORMAL: + nSlant = FC_SLANT_ITALIC; + break; + case ITALIC_OBLIQUE: + nSlant = FC_SLANT_OBLIQUE; + break; default: break; } - rWrapper.FcPatternAddInteger( pPattern, FC_SLANT, nSlant ); + FcPatternAddInteger(pPattern, FC_SLANT, nSlant); } if( eWeight != WEIGHT_DONTKNOW ) { @@ -1054,7 +699,7 @@ static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern, default: break; } - rWrapper.FcPatternAddInteger( pPattern, FC_WEIGHT, nWeight ); + FcPatternAddInteger(pPattern, FC_WEIGHT, nWeight); } if( eWidth != WIDTH_DONTKNOW ) { @@ -1073,7 +718,7 @@ static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern, default: break; } - rWrapper.FcPatternAddInteger( pPattern, FC_WIDTH, nWidth ); + FcPatternAddInteger(pPattern, FC_WIDTH, nWidth); } if( ePitch != PITCH_DONTKNOW ) { @@ -1085,9 +730,9 @@ static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern, default: break; } - rWrapper.FcPatternAddInteger( pPattern, FC_SPACING, nSpacing ); + FcPatternAddInteger(pPattern, FC_SPACING, nSpacing); if (nSpacing == FC_MONO) - rWrapper.FcPatternAddString( pPattern, FC_FAMILY, (FcChar8*)"monospace"); + FcPatternAddString(pPattern, FC_FAMILY, (FcChar8*)"monospace"); } } @@ -1098,18 +743,16 @@ rtl::OUString PrintFontManager::Substitute(const rtl::OUString& rFontName, { rtl::OUString aName; FontCfgWrapper& rWrapper = FontCfgWrapper::get(); - if( ! rWrapper.isValid() ) - return aName; // build pattern argument for fontconfig query - FcPattern* pPattern = rWrapper.FcPatternCreate(); + FcPattern* pPattern = FcPatternCreate(); // Prefer scalable fonts - rWrapper.FcPatternAddBool( pPattern, FC_SCALABLE, FcTrue ); + FcPatternAddBool(pPattern, FC_SCALABLE, FcTrue); const rtl::OString aTargetName = rtl::OUStringToOString( rFontName, RTL_TEXTENCODING_UTF8 ); const FcChar8* pTargetNameUtf8 = (FcChar8*)aTargetName.getStr(); - rWrapper.FcPatternAddString( pPattern, FC_FAMILY, pTargetNameUtf8 ); + FcPatternAddString(pPattern, FC_FAMILY, pTargetNameUtf8); if( rLangAttrib.getLength() ) { @@ -1118,42 +761,42 @@ rtl::OUString PrintFontManager::Substitute(const rtl::OUString& rFontName, pLangAttribUtf8 = (FcChar8*)"pa"; else pLangAttribUtf8 = (FcChar8*)rLangAttrib.getStr(); - rWrapper.FcPatternAddString( pPattern, FC_LANG, pLangAttribUtf8 ); + FcPatternAddString(pPattern, FC_LANG, pLangAttribUtf8); } // Add required Unicode characters, if any if ( rMissingCodes.getLength() ) { - FcCharSet *unicodes = rWrapper.FcCharSetCreate(); + FcCharSet *unicodes = FcCharSetCreate(); for( sal_Int32 nStrIndex = 0; nStrIndex < rMissingCodes.getLength(); ) { // also handle unicode surrogates const sal_uInt32 nCode = rMissingCodes.iterateCodePoints( &nStrIndex ); - rWrapper.FcCharSetAddChar( unicodes, nCode ); + FcCharSetAddChar( unicodes, nCode ); } - rWrapper.FcPatternAddCharSet( pPattern, FC_CHARSET, unicodes); - rWrapper.FcCharSetDestroy( unicodes ); + FcPatternAddCharSet(pPattern, FC_CHARSET, unicodes); + FcCharSetDestroy(unicodes); } - addtopattern(rWrapper, pPattern, rItalic, rWeight, rWidth, rPitch); + addtopattern(pPattern, rItalic, rWeight, rWidth, rPitch); // query fontconfig for a substitute - rWrapper.FcConfigSubstitute( rWrapper.FcConfigGetCurrent(), pPattern, FcMatchPattern ); - rWrapper.FcDefaultSubstitute( pPattern ); + FcConfigSubstitute(FcConfigGetCurrent(), pPattern, FcMatchPattern); + FcDefaultSubstitute(pPattern); // process the result of the fontconfig query FcResult eResult = FcResultNoMatch; FcFontSet* pFontSet = rWrapper.getFontSet(); - FcPattern* pResult = rWrapper.FcFontSetMatch( rWrapper.FcConfigGetCurrent(), &pFontSet, 1, pPattern, &eResult ); - rWrapper.FcPatternDestroy( pPattern ); + FcPattern* pResult = FcFontSetMatch(FcConfigGetCurrent(), &pFontSet, 1, pPattern, &eResult); + FcPatternDestroy( pPattern ); FcFontSet* pSet = NULL; if( pResult ) { - pSet = rWrapper.FcFontSetCreate(); + pSet = FcFontSetCreate(); // info: destroying the pSet destroys pResult implicitly // since pResult was "added" to pSet - rWrapper.FcFontSetAdd( pSet, pResult ); + FcFontSetAdd( pSet, pResult ); } if( pSet ) @@ -1162,7 +805,7 @@ rtl::OUString PrintFontManager::Substitute(const rtl::OUString& rFontName, { //extract the closest match FcChar8* family = NULL; - FcResult eFileRes = rWrapper.FcPatternGetString( pSet->fonts[0], FC_FAMILY, 0, &family ); + FcResult eFileRes = FcPatternGetString( pSet->fonts[0], FC_FAMILY, 0, &family ); // get the family name if( eFileRes == FcResultMatch ) @@ -1175,13 +818,13 @@ rtl::OUString PrintFontManager::Substitute(const rtl::OUString& rFontName, int val = 0; - if ( FcResultMatch == rWrapper.FcPatternGetInteger( pSet->fonts[0], FC_WEIGHT, 0, &val)) + if (FcResultMatch == FcPatternGetInteger(pSet->fonts[0], FC_WEIGHT, 0, &val)) rWeight = convertWeight(val); - if ( FcResultMatch == rWrapper.FcPatternGetInteger( pSet->fonts[0], FC_SLANT, 0, &val)) + if (FcResultMatch == FcPatternGetInteger(pSet->fonts[0], FC_SLANT, 0, &val)) rItalic = convertSlant(val); - if ( FcResultMatch == rWrapper.FcPatternGetInteger( pSet->fonts[0], FC_SPACING, 0, &val)) + if (FcResultMatch == FcPatternGetInteger(pSet->fonts[0], FC_SPACING, 0, &val)) rPitch = convertSpacing(val); - if ( FcResultMatch == rWrapper.FcPatternGetInteger( pSet->fonts[0], FC_WIDTH, 0, &val)) + if (FcResultMatch == FcPatternGetInteger(pSet->fonts[0], FC_WIDTH, 0, &val)) rWidth = convertWidth(val); } @@ -1191,13 +834,13 @@ rtl::OUString PrintFontManager::Substitute(const rtl::OUString& rFontName, sal_uInt32* pRemainingCodes = (sal_uInt32*)alloca( rMissingCodes.getLength() * sizeof(sal_uInt32) ); int nRemainingLen = 0; FcCharSet* unicodes; - if( !rWrapper.FcPatternGetCharSet( pSet->fonts[0], FC_CHARSET, 0, &unicodes ) ) + if (!FcPatternGetCharSet(pSet->fonts[0], FC_CHARSET, 0, &unicodes)) { for( sal_Int32 nStrIndex = 0; nStrIndex < rMissingCodes.getLength(); ) { // also handle unicode surrogates const sal_uInt32 nCode = rMissingCodes.iterateCodePoints( &nStrIndex ); - if( rWrapper.FcCharSetHasChar( unicodes, nCode ) != FcTrue ) + if (FcCharSetHasChar(unicodes, nCode) != FcTrue) pRemainingCodes[ nRemainingLen++ ] = nCode; } } @@ -1205,7 +848,7 @@ rtl::OUString PrintFontManager::Substitute(const rtl::OUString& rFontName, } } - rWrapper.FcFontSetDestroy( pSet ); + FcFontSetDestroy( pSet ); } return aName; @@ -1217,18 +860,12 @@ public: FontConfigFontOptions() : mpPattern(0) {} ~FontConfigFontOptions() { - FontCfgWrapper& rWrapper = FontCfgWrapper::get(); - if( rWrapper.isValid() ) - rWrapper.FcPatternDestroy( mpPattern ); + FcPatternDestroy(mpPattern); } virtual void *GetPattern(void * face, bool bEmbolden) const { - FontCfgWrapper& rWrapper = FontCfgWrapper::get(); - if( rWrapper.isValid() ) - { - rWrapper.FcPatternAddFTFace(mpPattern, FC_FT_FACE, static_cast(face)); - rWrapper.FcPatternAddBool(mpPattern, FC_EMBOLDEN, bEmbolden ? FcTrue : FcFalse); - } + FcPatternAddFTFace(mpPattern, FC_FT_FACE, static_cast(face)); + FcPatternAddBool(mpPattern, FC_EMBOLDEN, bEmbolden ? FcTrue : FcFalse); return mpPattern; } FcPattern* mpPattern; @@ -1238,12 +875,10 @@ ImplFontOptions* PrintFontManager::getFontOptions( const FastPrintFontInfo& rInfo, int nSize, void (*subcallback)(void*)) const { FontCfgWrapper& rWrapper = FontCfgWrapper::get(); - if( ! rWrapper.isValid() ) - return NULL; FontConfigFontOptions* pOptions = NULL; - FcConfig* pConfig = rWrapper.FcConfigGetCurrent(); - FcPattern* pPattern = rWrapper.FcPatternCreate(); + FcConfig* pConfig = FcConfigGetCurrent(); + FcPattern* pPattern = FcPatternCreate(); OString sFamily = OUStringToOString( rInfo.m_aFamilyName, RTL_TEXTENCODING_UTF8 ); @@ -1251,32 +886,33 @@ ImplFontOptions* PrintFontManager::getFontOptions( if (aI != rWrapper.m_aLocalizedToCanonical.end()) sFamily = aI->second; if( sFamily.getLength() ) - rWrapper.FcPatternAddString( pPattern, FC_FAMILY, (FcChar8*)sFamily.getStr() ); + FcPatternAddString(pPattern, FC_FAMILY, (FcChar8*)sFamily.getStr()); - addtopattern(rWrapper, pPattern, rInfo.m_eItalic, rInfo.m_eWeight, rInfo.m_eWidth, rInfo.m_ePitch); - rWrapper.FcPatternAddDouble( pPattern, FC_PIXEL_SIZE, nSize); + addtopattern(pPattern, rInfo.m_eItalic, rInfo.m_eWeight, rInfo.m_eWidth, rInfo.m_ePitch); + FcPatternAddDouble(pPattern, FC_PIXEL_SIZE, nSize); FcBool embitmap = true, antialias = true, autohint = true, hinting = true; int hintstyle = FC_HINT_FULL; - rWrapper.FcConfigSubstitute( pConfig, pPattern, FcMatchPattern ); - if (subcallback) subcallback(pPattern); - rWrapper.FcDefaultSubstitute( pPattern ); + FcConfigSubstitute(pConfig, pPattern, FcMatchPattern); + if (subcallback) + subcallback(pPattern); + FcDefaultSubstitute(pPattern); FcResult eResult = FcResultNoMatch; FcFontSet* pFontSet = rWrapper.getFontSet(); - FcPattern* pResult = rWrapper.FcFontSetMatch( pConfig, &pFontSet, 1, pPattern, &eResult ); + FcPattern* pResult = FcFontSetMatch( pConfig, &pFontSet, 1, pPattern, &eResult ); if( pResult ) { - FcResult eEmbeddedBitmap = rWrapper.FcPatternGetBool(pResult, + FcResult eEmbeddedBitmap = FcPatternGetBool(pResult, FC_EMBEDDED_BITMAP, 0, &embitmap); - FcResult eAntialias = rWrapper.FcPatternGetBool(pResult, + FcResult eAntialias = FcPatternGetBool(pResult, FC_ANTIALIAS, 0, &antialias); - FcResult eAutoHint = rWrapper.FcPatternGetBool(pResult, + FcResult eAutoHint = FcPatternGetBool(pResult, FC_AUTOHINT, 0, &autohint); - FcResult eHinting = rWrapper.FcPatternGetBool(pResult, + FcResult eHinting = FcPatternGetBool(pResult, FC_HINTING, 0, &hinting); - /*FcResult eHintStyle =*/ rWrapper.FcPatternGetInteger(pResult, + /*FcResult eHintStyle =*/ FcPatternGetInteger(pResult, FC_HINT_STYLE, 0, &hintstyle); pOptions = new FontConfigFontOptions; @@ -1302,7 +938,7 @@ ImplFontOptions* PrintFontManager::getFontOptions( } // cleanup - rWrapper.FcPatternDestroy( pPattern ); + FcPatternDestroy( pPattern ); return pOptions; } @@ -1310,11 +946,9 @@ ImplFontOptions* PrintFontManager::getFontOptions( bool PrintFontManager::matchFont( FastPrintFontInfo& rInfo, const com::sun::star::lang::Locale& rLocale ) { FontCfgWrapper& rWrapper = FontCfgWrapper::get(); - if( ! rWrapper.isValid() ) - return false; - FcConfig* pConfig = rWrapper.FcConfigGetCurrent(); - FcPattern* pPattern = rWrapper.FcPatternCreate(); + FcConfig* pConfig = FcConfigGetCurrent(); + FcPattern* pPattern = FcPatternCreate(); OString aLangAttrib; // populate pattern with font characteristics @@ -1330,29 +964,29 @@ bool PrintFontManager::matchFont( FastPrintFontInfo& rInfo, const com::sun::star aLangAttrib = OUStringToOString( aLang.makeStringAndClear(), RTL_TEXTENCODING_UTF8 ); } if( aLangAttrib.getLength() ) - rWrapper.FcPatternAddString( pPattern, FC_LANG, (FcChar8*)aLangAttrib.getStr() ); + FcPatternAddString(pPattern, FC_LANG, (FcChar8*)aLangAttrib.getStr()); OString aFamily = OUStringToOString( rInfo.m_aFamilyName, RTL_TEXTENCODING_UTF8 ); if( aFamily.getLength() ) - rWrapper.FcPatternAddString( pPattern, FC_FAMILY, (FcChar8*)aFamily.getStr() ); + FcPatternAddString(pPattern, FC_FAMILY, (FcChar8*)aFamily.getStr()); - addtopattern(rWrapper, pPattern, rInfo.m_eItalic, rInfo.m_eWeight, rInfo.m_eWidth, rInfo.m_ePitch); + addtopattern(pPattern, rInfo.m_eItalic, rInfo.m_eWeight, rInfo.m_eWidth, rInfo.m_ePitch); - rWrapper.FcConfigSubstitute( pConfig, pPattern, FcMatchPattern ); - rWrapper.FcDefaultSubstitute( pPattern ); + FcConfigSubstitute(pConfig, pPattern, FcMatchPattern); + FcDefaultSubstitute(pPattern); FcResult eResult = FcResultNoMatch; FcFontSet *pFontSet = rWrapper.getFontSet(); - FcPattern* pResult = rWrapper.FcFontSetMatch( pConfig, &pFontSet, 1, pPattern, &eResult ); + FcPattern* pResult = FcFontSetMatch(pConfig, &pFontSet, 1, pPattern, &eResult); bool bSuccess = false; if( pResult ) { - FcFontSet* pSet = rWrapper.FcFontSetCreate(); - rWrapper.FcFontSetAdd( pSet, pResult ); + FcFontSet* pSet = FcFontSetCreate(); + FcFontSetAdd( pSet, pResult ); if( pSet->nfont > 0 ) { //extract the closest match FcChar8* file = NULL; - FcResult eFileRes = rWrapper.FcPatternGetString( pSet->fonts[0], FC_FILE, 0, &file ); + FcResult eFileRes = FcPatternGetString(pSet->fonts[0], FC_FILE, 0, &file); if( eFileRes == FcResultMatch ) { OString aDir, aBase, aOrgPath( (sal_Char*)file ); @@ -1365,11 +999,11 @@ bool PrintFontManager::matchFont( FastPrintFontInfo& rInfo, const com::sun::star } // info: destroying the pSet destroys pResult implicitly // since pResult was "added" to pSet - rWrapper.FcFontSetDestroy( pSet ); + FcFontSetDestroy( pSet ); } // cleanup - rWrapper.FcPatternDestroy( pPattern ); + FcPatternDestroy( pPattern ); return bSuccess; } diff --git a/vcl/unx/generic/printer/cupsmgr.cxx b/vcl/unx/generic/printer/cupsmgr.cxx index a850ec14bb28..1e8c378c8166 100644 --- a/vcl/unx/generic/printer/cupsmgr.cxx +++ b/vcl/unx/generic/printer/cupsmgr.cxx @@ -436,7 +436,7 @@ extern "C" { static void lcl_signal_action(int nSignal) { - fprintf( stderr, "Signal %d during fontconfig initialization called, ignoring fontconfig\n", nSignal ); + fprintf( stderr, "Signal %d during cups initialization called, ignoring cups\n", nSignal ); siglongjmp( aViolationBuffer, 1 ); } } -- cgit v1.2.3 From ace57f2d4ac15557667127d64ac43136fd1d7858 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 22 Jun 2011 22:38:54 +0100 Subject: ditch unused inline methods --- vcl/inc/vcl/svapp.hxx | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/svapp.hxx b/vcl/inc/vcl/svapp.hxx index 85e902161a48..231d754ab7fb 100644 --- a/vcl/inc/vcl/svapp.hxx +++ b/vcl/inc/vcl/svapp.hxx @@ -184,10 +184,6 @@ public: const UniString& GetData() const { return aData; } const ApplicationAddress& GetAppAddress() const { return aAppAddr; } - sal_Bool IsOpenEvent() const; - sal_Bool IsPrintEvent() const; - sal_Bool IsDiskInsertEvent() const; - sal_uInt16 GetParamCount() const { return aData.GetTokenCount( APPEVENT_PARAM_DELIMITER ); } UniString GetParam( sal_uInt16 nParam ) const { return aData.GetToken( nParam, APPEVENT_PARAM_DELIMITER ); } }; @@ -203,30 +199,6 @@ inline ApplicationEvent::ApplicationEvent( const UniString& rSenderAppName, { } -inline sal_Bool ApplicationEvent::IsOpenEvent() const -{ - if ( aEvent.Equals( APPEVENT_OPEN_STRING )) - return sal_True; - else - return sal_False; -} - -inline sal_Bool ApplicationEvent::IsPrintEvent() const -{ - if ( aEvent.Equals( APPEVENT_PRINT_STRING )) - return sal_True; - else - return sal_False; -} - -inline sal_Bool ApplicationEvent::IsDiskInsertEvent() const -{ - if ( aEvent.Equals( APPEVENT_DISKINSERT_STRING )) - return sal_True; - else - return sal_False; -} - class VCL_DLLPUBLIC PropertyHandler { public: -- cgit v1.2.3 From 2d73bf30420c72b63413c27d9484a242b55259e1 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 22 Jun 2011 22:39:39 +0100 Subject: ditch unused APPEVENT strings --- vcl/inc/vcl/svapp.hxx | 2 -- 1 file changed, 2 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/svapp.hxx b/vcl/inc/vcl/svapp.hxx index 231d754ab7fb..baeb3044abf7 100644 --- a/vcl/inc/vcl/svapp.hxx +++ b/vcl/inc/vcl/svapp.hxx @@ -161,8 +161,6 @@ inline sal_Bool ApplicationAddress::IsConnectToSame( const ApplicationAddress& r #define APPEVENT_OPEN_STRING "Open" #define APPEVENT_PRINT_STRING "Print" -#define APPEVENT_DISKINSERT_STRING "DiskInsert" -#define APPEVENT_SAVEDOCUMENTS_STRING "SaveDocuments" class VCL_DLLPUBLIC ApplicationEvent { -- cgit v1.2.3 From 9eca65e23a126f8c74e4f0dd0552a019b837feea Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 22 Jun 2011 23:11:00 +0100 Subject: ByteString->rtl::OString --- vcl/inc/vcl/svapp.hxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/svapp.hxx b/vcl/inc/vcl/svapp.hxx index baeb3044abf7..d78d42cf1d52 100644 --- a/vcl/inc/vcl/svapp.hxx +++ b/vcl/inc/vcl/svapp.hxx @@ -166,7 +166,7 @@ class VCL_DLLPUBLIC ApplicationEvent { private: UniString aSenderAppName; // Absender Applikationsname - ByteString aEvent; // Event + rtl::OString m_aEvent; // Event UniString aData; // Uebertragene Daten ApplicationAddress aAppAddr; // Absender Addresse @@ -174,11 +174,11 @@ public: ApplicationEvent() {} ApplicationEvent( const UniString& rSenderAppName, const ApplicationAddress& rAppAddr, - const ByteString& rEvent, + const rtl::OString& rEvent, const UniString& rData ); const UniString& GetSenderAppName() const { return aSenderAppName; } - const ByteString& GetEvent() const { return aEvent; } + const rtl::OString& GetEvent() const { return m_aEvent; } const UniString& GetData() const { return aData; } const ApplicationAddress& GetAppAddress() const { return aAppAddr; } @@ -188,10 +188,10 @@ public: inline ApplicationEvent::ApplicationEvent( const UniString& rSenderAppName, const ApplicationAddress& rAppAddr, - const ByteString& rEvent, + const rtl::OString& rEvent, const UniString& rData ) : aSenderAppName( rSenderAppName ), - aEvent( rEvent ), + m_aEvent( rEvent ), aData( rData ), aAppAddr( rAppAddr ) { -- cgit v1.2.3 From a34626180887aa9f5d453924982b8ad04c546cda Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 22 Jun 2011 23:35:43 +0100 Subject: this method is debugging only --- vcl/inc/unx/saldisp.hxx | 5 +++-- vcl/unx/generic/app/saldisp.cxx | 12 ++++++------ vcl/unx/generic/window/salframe.cxx | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/unx/saldisp.hxx b/vcl/inc/unx/saldisp.hxx index 7248f87fbd35..194e050df2b0 100644 --- a/vcl/inc/unx/saldisp.hxx +++ b/vcl/inc/unx/saldisp.hxx @@ -420,8 +420,9 @@ public: bool DispatchInternalEvent(); void PrintInfo() const; - void PrintEvent( const ByteString &rComment, - XEvent *pEvent ) const; +#ifdef DBG_UTIL + void DbgPrintDisplayEvent(const char *pComment, XEvent *pEvent) const; +#endif void Beep() const; diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx index 358bbc205004..90d65efbd921 100644 --- a/vcl/unx/generic/app/saldisp.cxx +++ b/vcl/unx/generic/app/saldisp.cxx @@ -2358,7 +2358,7 @@ void SalX11Display::Yield() if( pXLib_->HasXErrorOccurred() ) { XFlush( pDisp_ ); - PrintEvent( "SalDisplay::Yield (WasXError)", &aEvent ); + DbgPrintDisplayEvent("SalDisplay::Yield (WasXError)", &aEvent); } #endif pXLib_->ResetXErrorOccurred(); @@ -2475,14 +2475,13 @@ long SalX11Display::Dispatch( XEvent *pEvent ) return 0; } -// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void SalDisplay::PrintEvent( const ByteString &rComment, - XEvent *pEvent ) const +#ifdef DBG_UTIL +void SalDisplay::DbgPrintDisplayEvent(const char *pComment, XEvent *pEvent) const { if( pEvent->type <= MappingNotify ) { fprintf( stderr, "[%s] %s s=%d w=%ld\n", - rComment.GetBuffer(), + pComment, EventNames[pEvent->type], pEvent->xany.send_event, pEvent->xany.window ); @@ -2609,11 +2608,12 @@ void SalDisplay::PrintEvent( const ByteString &rComment, } else fprintf( stderr, "[%s] %d s=%d w=%ld\n", - rComment.GetBuffer(), + pComment, pEvent->type, pEvent->xany.send_event, pEvent->xany.window ); } +#endif // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= void SalDisplay::PrintInfo() const diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index 1fdfc02c3916..2c1c94ae46c3 100644 --- a/vcl/unx/generic/window/salframe.cxx +++ b/vcl/unx/generic/window/salframe.cxx @@ -4241,7 +4241,7 @@ long X11SalFrame::Dispatch( XEvent *pEvent ) CaptureMouse( sal_True ); #ifdef DBG_UTIL if( -1 != nCaptured_ ) - pDisplay_->PrintEvent( "Captured", pEvent ); + pDisplay_->DbgPrintDisplayEvent("Captured", pEvent); #endif } -- cgit v1.2.3 From 921fd5f5d533c1aae8fd339b7ce35189e21fb5cb Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 23 Jun 2011 09:02:47 +0100 Subject: Resolves: fdo#33509 Context menu in spellcheck in RTL UI closes too early --- vcl/source/window/floatwin.cxx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'vcl') diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index 118c60f214cc..72847ab17bc7 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -697,13 +697,22 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, sal_uLong nFlags ) // so they can be compared across different frames // !!! rRect is expected to be in screen coordinates of the parent frame window !!! maFloatRect = rRect; - if( GetParent()->ImplHasMirroredGraphics() ) + + Window *pReference = GetParent(); + + // compare coordinates in absolute screen coordinates + // Keep in sync with FloatingWindow::ImplFloatHitTest, e.g. fdo#33509 + if( pReference->ImplHasMirroredGraphics() ) { - maFloatRect.SetPos( GetParent()->ScreenToOutputPixel( rRect.TopLeft() ) ); - maFloatRect = GetParent()->ImplOutputToUnmirroredAbsoluteScreenPixel( maFloatRect ); + if(!pReference->IsRTLEnabled() ) + // --- RTL --- re-mirror back to get device coordiantes + pReference->ImplReMirror(maFloatRect); + + maFloatRect.SetPos(pReference->ScreenToOutputPixel(maFloatRect.TopLeft())); + maFloatRect = pReference->ImplOutputToUnmirroredAbsoluteScreenPixel(maFloatRect); } else - maFloatRect.SetPos( GetParent()->OutputToAbsoluteScreenPixel( GetParent()->ScreenToOutputPixel( rRect.TopLeft() ) ) ); + maFloatRect.SetPos(pReference->OutputToAbsoluteScreenPixel(pReference->ScreenToOutputPixel(rRect.TopLeft()))); maFloatRect.Left() -= 2; maFloatRect.Top() -= 2; -- cgit v1.2.3 From 8ade517f3d7d30c048cae3bf218e7f4df6ed83d9 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Tue, 21 Jun 2011 13:25:16 +0200 Subject: fix crash when changing screen resolution - m_aXineramaScreenIndexMap in GtkSalDisplay was shadowing the same field in SalDisplay, which led to crash in saldisp.cxx code in SalDisplay::addXineramaScreenUnique --- vcl/inc/unx/gtk/gtkdata.hxx | 1 - 1 file changed, 1 deletion(-) (limited to 'vcl') diff --git a/vcl/inc/unx/gtk/gtkdata.hxx b/vcl/inc/unx/gtk/gtkdata.hxx index 28e0f3298fb9..24860b8f80df 100644 --- a/vcl/inc/unx/gtk/gtkdata.hxx +++ b/vcl/inc/unx/gtk/gtkdata.hxx @@ -93,7 +93,6 @@ class GtkSalDisplay : public SalDisplay GdkDisplay* m_pGdkDisplay; GdkCursor *m_aCursors[ POINTER_COUNT ]; bool m_bStartupCompleted; - std::vector< int > m_aXineramaScreenIndexMap; GdkCursor* getFromXBM( const unsigned char *pBitmap, const unsigned char *pMask, int nWidth, int nHeight, int nXHot, int nYHot ); -- cgit v1.2.3 From 270e7e9dd759ab82b98ebfab62b4c7d5d8951f09 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 23 Jun 2011 13:35:01 +0200 Subject: make sure we send resize event to fullscreen windows - this fixes regression of i#86302 fix. it happens when screen is resized (by xrandr for example) and the fullscreen windows are not notified about their size change, because they don't have sizeable style set --- vcl/unx/gtk/window/gtkframe.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vcl') diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index b0988f6fb1b1..089a67344271 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -3069,7 +3069,7 @@ gboolean GtkSalFrame::signalConfigure( GtkWidget*, GdkEventConfigure* pEvent, gp * - which is not good since the window manager will now size the window back to this * wrong size at some point. */ - if( (pThis->m_nStyle & (SAL_FRAME_STYLE_SIZEABLE | SAL_FRAME_STYLE_PLUG)) == SAL_FRAME_STYLE_SIZEABLE ) + if( pThis->m_bFullscreen || (pThis->m_nStyle & (SAL_FRAME_STYLE_SIZEABLE | SAL_FRAME_STYLE_PLUG)) == SAL_FRAME_STYLE_SIZEABLE ) { if( pEvent->width != (int)pThis->maGeometry.nWidth || pEvent->height != (int)pThis->maGeometry.nHeight ) { -- cgit v1.2.3 From 301d17aa879d7225edf4eb18716479182f7f4299 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 23 Jun 2011 23:41:54 +0100 Subject: rtl::ByteString->rtl::OString --- vcl/inc/vcl/ppdparser.hxx | 2 +- vcl/unx/generic/printer/ppdparser.cxx | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/ppdparser.hxx b/vcl/inc/vcl/ppdparser.hxx index 7082c020c7a2..806677a0e621 100644 --- a/vcl/inc/vcl/ppdparser.hxx +++ b/vcl/inc/vcl/ppdparser.hxx @@ -186,7 +186,7 @@ private: PPDParser( const String& rFile ); ~PPDParser(); - void parseOrderDependency( const ByteString& rLine ); + void parseOrderDependency(const rtl::OString& rLine); void parseOpenUI( const ByteString& rLine ); void parseConstraint( const ByteString& rLine ); void parse( std::list< ByteString >& rLines ); diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx index 3246e18fc806..8d6b9c302193 100644 --- a/vcl/unx/generic/printer/ppdparser.cxx +++ b/vcl/unx/generic/printer/ppdparser.cxx @@ -1211,12 +1211,12 @@ void PPDParser::parseOpenUI( const ByteString& rLine ) pKey->m_eUIType = PPDKey::PickOne; } -void PPDParser::parseOrderDependency( const ByteString& rLine ) +void PPDParser::parseOrderDependency(const rtl::OString& rLine) { - ByteString aLine( rLine ); - int nPos = aLine.Search( ':' ); - if( nPos != STRING_NOTFOUND ) - aLine.Erase( 0, nPos+1 ); + rtl::OString aLine(rLine); + sal_Int32 nPos = aLine.indexOf(':'); + if( nPos != -1 ) + aLine = aLine.copy( nPos+1 ); int nOrder = GetCommandLineToken( 0, aLine ).ToInt32(); ByteString aSetup = GetCommandLineToken( 1, aLine ); -- cgit v1.2.3 From 6ea5ea262b8e6b18ed62165ef559d26ae7ee222a Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 24 Jun 2011 00:18:15 +0100 Subject: rtl::ByteString->rtl::OString --- vcl/inc/vcl/ppdparser.hxx | 8 ++++---- vcl/inc/vcl/strhelper.hxx | 8 ++++---- vcl/source/helper/strhelper.cxx | 29 ++++++++++++++--------------- vcl/unx/generic/printer/ppdparser.cxx | 35 +++++++++++++++++++---------------- 4 files changed, 41 insertions(+), 39 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/ppdparser.hxx b/vcl/inc/vcl/ppdparser.hxx index 806677a0e621..474d847e2607 100644 --- a/vcl/inc/vcl/ppdparser.hxx +++ b/vcl/inc/vcl/ppdparser.hxx @@ -187,11 +187,11 @@ private: ~PPDParser(); void parseOrderDependency(const rtl::OString& rLine); - void parseOpenUI( const ByteString& rLine ); - void parseConstraint( const ByteString& rLine ); - void parse( std::list< ByteString >& rLines ); + void parseOpenUI(const rtl::OString& rLine); + void parseConstraint(const rtl::OString& rLine); + void parse( std::list< rtl::OString >& rLines ); - String handleTranslation( const ByteString& i_rString, bool i_bIsGlobalized ); + String handleTranslation(const rtl::OString& i_rString, bool i_bIsGlobalized); static void scanPPDDir( const String& rDir ); static void initPPDFiles(); diff --git a/vcl/inc/vcl/strhelper.hxx b/vcl/inc/vcl/strhelper.hxx index 6f1ec6646a6f..62e4fc072bdd 100644 --- a/vcl/inc/vcl/strhelper.hxx +++ b/vcl/inc/vcl/strhelper.hxx @@ -38,17 +38,17 @@ namespace psp { String VCL_DLLPUBLIC GetCommandLineToken( int, const String& ); -ByteString VCL_DLLPUBLIC GetCommandLineToken( int, const ByteString& ); +rtl::OString VCL_DLLPUBLIC GetCommandLineToken(int, const rtl::OString&); // gets one token of a unix command line style string // doublequote, singlequote and singleleftquote protect their respective // contents int VCL_DLLPUBLIC GetCommandLineTokenCount( const String& ); -int VCL_DLLPUBLIC GetCommandLineTokenCount( const ByteString& ); +int VCL_DLLPUBLIC GetCommandLineTokenCount(const rtl::OString&); // returns number of tokens (zero if empty or whitespace only) String VCL_DLLPUBLIC WhitespaceToSpace( const String&, sal_Bool bProtect = sal_True ); -ByteString VCL_DLLPUBLIC WhitespaceToSpace( const ByteString&, sal_Bool bProtect = sal_True ); +rtl::OString VCL_DLLPUBLIC WhitespaceToSpace(const rtl::OString&, sal_Bool bProtect = sal_True); // returns a string with multiple adjacent occurrences of whitespace // converted to a single space. if bProtect is sal_True (nonzero), then // doublequote, singlequote and singleleftquote protect their respective @@ -61,7 +61,7 @@ inline double VCL_DLLPUBLIC StringToDouble( const String& rStr ) return rtl::math::stringToDouble(rStr, sal_Unicode('.'), sal_Unicode(0)); } -inline double VCL_DLLPUBLIC StringToDouble( const ByteString& rStr ) +inline double VCL_DLLPUBLIC StringToDouble(const rtl::OString& rStr) { return rtl::math::stringToDouble(rStr, '.', static_cast(0)); } diff --git a/vcl/source/helper/strhelper.cxx b/vcl/source/helper/strhelper.cxx index c8b5cc7fbf22..c192431e87e6 100644 --- a/vcl/source/helper/strhelper.cxx +++ b/vcl/source/helper/strhelper.cxx @@ -173,15 +173,15 @@ String GetCommandLineToken( int nToken, const String& rLine ) return aRet; } -ByteString GetCommandLineToken( int nToken, const ByteString& rLine ) +rtl::OString GetCommandLineToken(int nToken, const rtl::OString& rLine) { - int nLen = rLine.Len(); - if( ! nLen ) - return ByteString(); + sal_Int32 nLen = rLine.getLength(); + if (!nLen) + return rLine; int nActualToken = 0; char* pBuffer = (char*)alloca( nLen + 1 ); - const char* pRun = rLine.GetBuffer(); + const char* pRun = rLine.getStr(); char* pLeap = NULL; while( *pRun && nActualToken <= nToken ) @@ -275,13 +275,13 @@ int GetCommandLineTokenCount( const String& rLine ) return nTokenCount; } -int GetCommandLineTokenCount( const ByteString& rLine ) +int GetCommandLineTokenCount(const rtl::OString& rLine) { - if( ! rLine.Len() ) + if (rLine.isEmpty()) return 0; int nTokenCount = 0; - const char *pRun = rLine.GetBuffer(); + const char *pRun = rLine.getStr(); while( *pRun ) @@ -383,14 +383,14 @@ String WhitespaceToSpace( const String& rLine, sal_Bool bProtect ) return aRet; } -ByteString WhitespaceToSpace( const ByteString& rLine, sal_Bool bProtect ) +rtl::OString WhitespaceToSpace(const rtl::OString& rLine, sal_Bool bProtect) { - int nLen = rLine.Len(); - if( ! nLen ) - return ByteString(); + sal_Int32 nLen = rLine.getLength(); + if (!nLen) + return rLine; char *pBuffer = (char*)alloca( nLen + 1 ); - const char *pRun = rLine.GetBuffer(); + const char *pRun = rLine.getStr(); char *pLeap = pBuffer; while( *pRun ) @@ -436,8 +436,7 @@ ByteString WhitespaceToSpace( const ByteString& rLine, sal_Bool bProtect ) if( *pLeap == ' ' ) *pLeap = 0; - ByteString aRet( *pBuffer == ' ' ? pBuffer+1 : pBuffer ); - return aRet; + return rtl::OString(*pBuffer == ' ' ? pBuffer+1 : pBuffer); } } // namespace diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx index 8d6b9c302193..91643d6646b2 100644 --- a/vcl/unx/generic/printer/ppdparser.cxx +++ b/vcl/unx/generic/printer/ppdparser.cxx @@ -696,7 +696,7 @@ PPDParser::PPDParser( const String& rFile ) : m_pTranslator( new PPDTranslator() ) { // read in the file - std::list< ByteString > aLines; + std::list< rtl::OString > aLines; PPDDecompressStream aStream( m_aFile ); bool bLanguageEncoding = false; if( aStream.IsOpen() ) @@ -897,11 +897,11 @@ static sal_uInt8 getNibble( sal_Char cChar ) return nRet; } -String PPDParser::handleTranslation( const ByteString& i_rString, bool bIsGlobalized ) +String PPDParser::handleTranslation(const rtl::OString& i_rString, bool bIsGlobalized) { - int nOrigLen = i_rString.Len(); + sal_Int32 nOrigLen = i_rString.getLength(); OStringBuffer aTrans( nOrigLen ); - const sal_Char* pStr = i_rString.GetBuffer(); + const sal_Char* pStr = i_rString.getStr(); const sal_Char* pEnd = pStr + nOrigLen; while( pStr < pEnd ) { @@ -923,9 +923,9 @@ String PPDParser::handleTranslation( const ByteString& i_rString, bool bIsGlobal return OStringToOUString( aTrans.makeStringAndClear(), bIsGlobalized ? RTL_TEXTENCODING_UTF8 : m_aFileEncoding ); } -void PPDParser::parse( ::std::list< ByteString >& rLines ) +void PPDParser::parse( ::std::list< rtl::OString >& rLines ) { - std::list< ByteString >::iterator line = rLines.begin(); + std::list< rtl::OString >::iterator line = rLines.begin(); PPDParser::hash_type::const_iterator keyit; while( line != rLines.end() ) { @@ -1027,7 +1027,7 @@ void PPDParser::parse( ::std::list< ByteString >& rLines ) { // copy the newlines also aLine += '\n'; - aLine += *line; + aLine += ByteString(*line); ++line; } } @@ -1142,7 +1142,9 @@ void PPDParser::parse( ::std::list< ByteString >& rLines ) if( nPos != STRING_NOTFOUND ) { aKey.Erase( nPos ); - String aOption( WhitespaceToSpace( aLine.Copy( nPos+9 ) ), RTL_TEXTENCODING_MS_1252 ); + rtl::OUString aOption(rtl::OStringToOUString( + WhitespaceToSpace(aLine.Copy(nPos+9)), + RTL_TEXTENCODING_MS_1252)); keyit = m_aKeys.find( aKey ); if( keyit != m_aKeys.end() ) { @@ -1171,7 +1173,7 @@ void PPDParser::parse( ::std::list< ByteString >& rLines ) } } -void PPDParser::parseOpenUI( const ByteString& rLine ) +void PPDParser::parseOpenUI(const rtl::OString& rLine) { String aTranslation; ByteString aKey = rLine; @@ -1202,7 +1204,8 @@ void PPDParser::parseOpenUI( const ByteString& rLine ) pKey->m_bUIOption = true; m_pTranslator->insertKey( pKey->getKey(), aTranslation ); - ByteString aValue = WhitespaceToSpace( rLine.GetToken( 1, ':' ) ); + sal_Int32 nIndex = 0; + ByteString aValue = WhitespaceToSpace( rLine.getToken( 1, ':', nIndex ) ); if( aValue.CompareIgnoreCaseToAscii( "boolean" ) == COMPARE_EQUAL ) pKey->m_eUIType = PPDKey::Boolean; else if( aValue.CompareIgnoreCaseToAscii( "pickmany" ) == COMPARE_EQUAL ) @@ -1218,9 +1221,9 @@ void PPDParser::parseOrderDependency(const rtl::OString& rLine) if( nPos != -1 ) aLine = aLine.copy( nPos+1 ); - int nOrder = GetCommandLineToken( 0, aLine ).ToInt32(); + sal_Int32 nOrder = GetCommandLineToken( 0, aLine ).toInt32(); ByteString aSetup = GetCommandLineToken( 1, aLine ); - String aKey( GetCommandLineToken( 2, aLine ), RTL_TEXTENCODING_MS_1252 ); + String aKey(rtl::OStringToOUString(GetCommandLineToken(2, aLine), RTL_TEXTENCODING_MS_1252)); if( aKey.GetChar( 0 ) != '*' ) return; // invalid order depency aKey.Erase( 0, 1 ); @@ -1250,12 +1253,12 @@ void PPDParser::parseOrderDependency(const rtl::OString& rLine) pKey->m_eSetupType = PPDKey::AnySetup; } -void PPDParser::parseConstraint( const ByteString& rLine ) +void PPDParser::parseConstraint( const rtl::OString& rLine ) { bool bFailed = false; - String aLine( rLine, RTL_TEXTENCODING_MS_1252 ); - aLine.Erase( 0, rLine.Search( ':' )+1 ); + String aLine(rtl::OStringToOUString(rLine, RTL_TEXTENCODING_MS_1252)); + aLine.Erase(0, rLine.indexOf(':') + 1); PPDConstraint aConstraint; int nTokens = GetCommandLineTokenCount( aLine ); for( int i = 0; i < nTokens; i++ ) @@ -1291,7 +1294,7 @@ void PPDParser::parseConstraint( const ByteString& rLine ) if( ! aConstraint.m_pKey1 || ! aConstraint.m_pKey2 || bFailed ) { #ifdef __DEBUG - fprintf( stderr, "Warning: constraint \"%s\" is invalid\n", rLine.GetStr() ); + fprintf( stderr, "Warning: constraint \"%s\" is invalid\n", rLine.getStr() ); #endif } else -- cgit v1.2.3 From 115feb261aec2d396b7a26f59da084860d7e550a Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Thu, 16 Jun 2011 11:46:48 +0100 Subject: make svp / headless backend's headers more public --- vcl/inc/unx/gtk/gtkgdi.hxx | 3 +- vcl/inc/unx/headless/svpbmp.hxx | 72 +++++++++ vcl/inc/unx/headless/svpdummies.hxx | 100 +++++++++++++ vcl/inc/unx/headless/svpelement.hxx | 49 +++++++ vcl/inc/unx/headless/svpframe.hxx | 132 +++++++++++++++++ vcl/inc/unx/headless/svpgdi.hxx | 174 ++++++++++++++++++++++ vcl/inc/unx/headless/svpinst.hxx | 204 ++++++++++++++++++++++++++ vcl/inc/unx/headless/svpprn.hxx | 57 +++++++ vcl/inc/unx/headless/svppspgraphics.hxx | 189 ++++++++++++++++++++++++ vcl/inc/unx/headless/svpvd.hxx | 62 ++++++++ vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx | 4 +- vcl/unx/headless/svpbmp.cxx | 2 +- vcl/unx/headless/svpbmp.hxx | 72 --------- vcl/unx/headless/svpdummies.cxx | 4 +- vcl/unx/headless/svpdummies.hxx | 100 ------------- vcl/unx/headless/svpelement.cxx | 8 +- vcl/unx/headless/svpelement.hxx | 49 ------- vcl/unx/headless/svpframe.cxx | 6 +- vcl/unx/headless/svpframe.hxx | 132 ----------------- vcl/unx/headless/svpgdi.cxx | 6 +- vcl/unx/headless/svpgdi.hxx | 174 ---------------------- vcl/unx/headless/svpinst.cxx | 10 +- vcl/unx/headless/svpinst.hxx | 204 -------------------------- vcl/unx/headless/svpprn.cxx | 6 +- vcl/unx/headless/svpprn.hxx | 57 ------- vcl/unx/headless/svppspgraphics.cxx | 4 +- vcl/unx/headless/svppspgraphics.hxx | 189 ------------------------ vcl/unx/headless/svptext.cxx | 6 +- vcl/unx/headless/svpvd.cxx | 4 +- vcl/unx/headless/svpvd.hxx | 62 -------- 30 files changed, 1072 insertions(+), 1069 deletions(-) create mode 100644 vcl/inc/unx/headless/svpbmp.hxx create mode 100644 vcl/inc/unx/headless/svpdummies.hxx create mode 100644 vcl/inc/unx/headless/svpelement.hxx create mode 100644 vcl/inc/unx/headless/svpframe.hxx create mode 100644 vcl/inc/unx/headless/svpgdi.hxx create mode 100644 vcl/inc/unx/headless/svpinst.hxx create mode 100644 vcl/inc/unx/headless/svpprn.hxx create mode 100644 vcl/inc/unx/headless/svppspgraphics.hxx create mode 100644 vcl/inc/unx/headless/svpvd.hxx delete mode 100644 vcl/unx/headless/svpbmp.hxx delete mode 100644 vcl/unx/headless/svpdummies.hxx delete mode 100644 vcl/unx/headless/svpelement.hxx delete mode 100644 vcl/unx/headless/svpframe.hxx delete mode 100644 vcl/unx/headless/svpgdi.hxx delete mode 100644 vcl/unx/headless/svpinst.hxx delete mode 100644 vcl/unx/headless/svpprn.hxx delete mode 100644 vcl/unx/headless/svppspgraphics.hxx delete mode 100644 vcl/unx/headless/svpvd.hxx (limited to 'vcl') diff --git a/vcl/inc/unx/gtk/gtkgdi.hxx b/vcl/inc/unx/gtk/gtkgdi.hxx index 41e500c49027..83d4aa827da9 100644 --- a/vcl/inc/unx/gtk/gtkgdi.hxx +++ b/vcl/inc/unx/gtk/gtkgdi.hxx @@ -39,6 +39,8 @@ #if GTK_CHECK_VERSION(3,0,0) +#include + // Disabled for gtk3 - use legacy theming code #define GTK_GRAPHICS_DISABLED class GtkSalFrame; @@ -46,7 +48,6 @@ class GtkSalGraphics : public X11SalGraphics { public: GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow ); }; - #else class GtkSalGraphics : public X11SalGraphics diff --git a/vcl/inc/unx/headless/svpbmp.hxx b/vcl/inc/unx/headless/svpbmp.hxx new file mode 100644 index 000000000000..b3adb3b9951f --- /dev/null +++ b/vcl/inc/unx/headless/svpbmp.hxx @@ -0,0 +1,72 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 SVP_SVBMP_HXX +#define SVP_SVBMP_HXX + +#include +#include "svpelement.hxx" + +class SvpSalBitmap : public SalBitmap, public SvpElement +{ + basebmp::BitmapDeviceSharedPtr m_aBitmap; +public: + SvpSalBitmap() {} + virtual ~SvpSalBitmap(); + + const basebmp::BitmapDeviceSharedPtr& getBitmap() const { return m_aBitmap; } + void setBitmap( const basebmp::BitmapDeviceSharedPtr& rSrc ) { m_aBitmap = rSrc; } + + // SvpElement + virtual const basebmp::BitmapDeviceSharedPtr& getDevice() const { return m_aBitmap; } + + // SalBitmap + virtual bool Create( const Size& rSize, + 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, + sal_uInt16 nNewBitCount ); + virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas, + Size& rSize, + bool bMask = false ); + virtual void Destroy(); + virtual Size GetSize() const; + virtual sal_uInt16 GetBitCount() const; + + virtual BitmapBuffer* AcquireBuffer( bool bReadOnly ); + virtual void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly ); + virtual bool GetSystemData( BitmapSystemData& rData ); + +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/unx/headless/svpdummies.hxx b/vcl/inc/unx/headless/svpdummies.hxx new file mode 100644 index 000000000000..bc46e9b22f70 --- /dev/null +++ b/vcl/inc/unx/headless/svpdummies.hxx @@ -0,0 +1,100 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 _SVP_SVPDUMMIES_HXX + +#include + +#include +#include +#include + +class SalGraphics; + +class SvpSalObject : public SalObject +{ +public: + SystemChildData m_aSystemChildData; + + SvpSalObject(); + virtual ~SvpSalObject(); + + // overload all pure virtual methods + virtual void ResetClipRegion(); + virtual sal_uInt16 GetClipRegionType(); + virtual void BeginSetClipRegion( sal_uLong 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( sal_Bool bVisible ); + virtual void Enable( sal_Bool nEnable ); + virtual void GrabFocus(); + + virtual void SetBackground(); + virtual void SetBackground( SalColor nSalColor ); + + virtual const SystemEnvData* GetSystemData() const; + + virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept ); +}; + +class SvpImeStatus : public SalI18NImeStatus +{ + public: + SvpImeStatus() {} + virtual ~SvpImeStatus(); + + virtual bool canToggle(); + virtual void toggle(); +}; + +class SvpSalSystem : public SalSystem +{ + public: + SvpSalSystem() {} + virtual ~SvpSalSystem(); + // get info about the display + virtual unsigned int GetDisplayScreenCount(); + virtual bool IsMultiDisplay(); + virtual unsigned int GetDefaultDisplayNumber(); + virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen ); + virtual Rectangle GetDisplayWorkAreaPosSizePixel( unsigned int nScreen ); + virtual rtl::OUString GetScreenName( unsigned int nScreen ); + + + virtual int ShowNativeMessageBox( const String& rTitle, + const String& rMessage, + int nButtonCombination, + int nDefaultButton); +}; + + +#endif // _SVP_SVPDUMMIES_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/unx/headless/svpelement.hxx b/vcl/inc/unx/headless/svpelement.hxx new file mode 100644 index 000000000000..c7f647cf3a03 --- /dev/null +++ b/vcl/inc/unx/headless/svpelement.hxx @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 _SVP_SVPELEMENT_HXX +#define _SVP_SVPELEMENT_HXX + +#include + +#define SVP_DEFAULT_BITMAP_FORMAT basebmp::Format::TWENTYFOUR_BIT_TC_MASK + +class SvpElement +{ + protected: + SvpElement(); + virtual ~SvpElement(); + public: + virtual const basebmp::BitmapDeviceSharedPtr& getDevice() const = 0; + + static sal_uInt32 getBitCountFromScanlineFormat( sal_Int32 nFormat ); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/unx/headless/svpframe.hxx b/vcl/inc/unx/headless/svpframe.hxx new file mode 100644 index 000000000000..e57381780f61 --- /dev/null +++ b/vcl/inc/unx/headless/svpframe.hxx @@ -0,0 +1,132 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 _SVP_SVPFRAME_HXX + +#include + +#include +#include "svpelement.hxx" + +#include + +class SvpSalInstance; +class SvpSalGraphics; + +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_uLong m_nStyle; + bool m_bVisible; + long m_nMinWidth; + long m_nMinHeight; + long m_nMaxWidth; + long m_nMaxHeight; + + SystemEnvData m_aSystemChildData; + + basebmp::BitmapDeviceSharedPtr m_aFrame; + std::list< SvpSalGraphics* > m_aGraphics; + + static SvpSalFrame* s_pFocusFrame; +public: + SvpSalFrame( SvpSalInstance* pInstance, + SalFrame* pParent, + sal_uLong nSalFrameStyle, + SystemParentData* pSystemParent = NULL ); + virtual ~SvpSalFrame(); + + void GetFocus(); + void LoseFocus(); + void PostPaint() const; + + // SvpElement + virtual const basebmp::BitmapDeviceSharedPtr& getDevice() const { return m_aFrame; } + + // SalFrame + virtual SalGraphics* GetGraphics(); + virtual void ReleaseGraphics( SalGraphics* pGraphics ); + + virtual sal_Bool PostEvent( void* pData ); + + virtual void SetTitle( const XubString& rTitle ); + virtual void SetIcon( sal_uInt16 nIcon ); + virtual void SetMenu( SalMenu* pMenu ); + virtual void DrawMenuBar(); + + virtual void SetExtendedFrameStyle( SalExtStyle nExtStyle ); + 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, 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 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( 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( 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 ); + virtual void Beep( SoundType eSoundType ); + virtual const SystemEnvData* GetSystemData() const; + virtual SalPointerState GetPointerState(); + virtual SalIndicatorState GetIndicatorState(); + virtual void SimulateKeyPress( sal_uInt16 nKeyCode ); + virtual void SetParent( SalFrame* pNewParent ); + virtual bool SetPluginParent( SystemParentData* pNewParent ); + virtual void SetBackgroundBitmap( SalBitmap* pBitmap ); + virtual void ResetClipRegion(); + virtual void BeginSetClipRegion( sal_uLong nRects ); + virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ); + virtual void EndSetClipRegion(); + + /*TODO: functional implementation */ + virtual void SetScreenNumber( unsigned int nScreen ) { (void)nScreen; } + virtual void SetApplicationID(const rtl::OUString &rApplicationID) { (void) rApplicationID; } +}; +#endif // _SVP_SVPFRAME_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/unx/headless/svpgdi.hxx b/vcl/inc/unx/headless/svpgdi.hxx new file mode 100644 index 000000000000..8291a3c2f7bc --- /dev/null +++ b/vcl/inc/unx/headless/svpgdi.hxx @@ -0,0 +1,174 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 _SVP_SVPGDI_HXX + +#include +#include + +#include +#include + +class ServerFont; + +class SvpSalGraphics : public SalGraphics +{ + basebmp::BitmapDeviceSharedPtr m_aDevice; + basebmp::BitmapDeviceSharedPtr m_aOrigDevice; + basebmp::BitmapDeviceSharedPtr m_aClipMap; + + bool m_bUseLineColor; + basebmp::Color m_aLineColor; + bool m_bUseFillColor; + basebmp::Color m_aFillColor; + basebmp::Color m_aTextColor; + + basebmp::DrawMode m_aDrawMode; + + ServerFont* m_pServerFont[ MAX_FALLBACK ]; + sal_uInt32 m_eTextFmt; + +protected: + virtual bool drawAlphaBitmap( const SalTwoRect&, const SalBitmap& rSourceBitmap, const SalBitmap& rAlphaBitmap ); + virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency ); + +public: + SvpSalGraphics(); + virtual ~SvpSalGraphics(); + + const basebmp::BitmapDeviceSharedPtr& getDevice() const { return m_aDevice; } + void setDevice( basebmp::BitmapDeviceSharedPtr& rDevice ); + + // overload all pure virtual methods + virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ); + virtual sal_uInt16 GetBitCount() const; + virtual long GetGraphicsWidth() const; + + virtual void ResetClipRegion(); + virtual bool setClipRegion( const Region& ); + + virtual void SetLineColor(); + virtual void SetLineColor( SalColor nSalColor ); + virtual void SetFillColor(); + + virtual void SetFillColor( SalColor nSalColor ); + + virtual void SetXORMode( bool bSet, bool ); + + virtual void SetROPLineColor( SalROPColor nROPColor ); + virtual void SetROPFillColor( SalROPColor nROPColor ); + + virtual void SetTextColor( SalColor nSalColor ); + virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel ); + virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); + virtual sal_uLong GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs ); + virtual const ImplFontCharMap* GetImplFontCharMap() const; + virtual bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const; + virtual void GetDevFontList( ImplDevFontList* ); + virtual void GetDevFontSubstList( OutputDevice* ); + virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName ); + virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile, + const ImplFontData*, + sal_Int32* pGlyphIDs, + sal_uInt8* pEncoding, + sal_Int32* pWidths, + int nGlyphs, + FontSubsetInfo& rInfo + ); + virtual const Ucs2SIntMap* GetFontEncodingVector( const ImplFontData*, const Ucs2OStrMap** ppNonEncoded ); + virtual const void* GetEmbedFontData( const ImplFontData*, + const sal_Ucs* pUnicodes, + sal_Int32* pWidths, + FontSubsetInfo& rInfo, + long* pDataLen ); + virtual void FreeEmbedFontData( const void* pData, long nDataLen ); + virtual void GetGlyphWidths( const ImplFontData*, + bool bVertical, + Int32Vector& rWidths, + Ucs2UIntMap& rUnicodeEnc ); + virtual sal_Bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ); + virtual sal_Bool GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& ); + virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ); + virtual void DrawServerFontLayout( const ServerFontLayout& ); + virtual bool supportsOperation( OutDevSupportType ) const; + virtual void drawPixel( long nX, long nY ); + 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 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_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_uLong nPoints, + const SalPoint* pPtAry, + const sal_uInt8* pFlgAry ); + virtual sal_Bool drawPolygonBezier( sal_uLong nPoints, + const SalPoint* pPtAry, + const sal_uInt8* pFlgAry ); + virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly, + const sal_uInt32* pPoints, + const SalPoint* const* pPtAry, + const sal_uInt8* const* pFlgAry ); + + virtual void copyArea( long nDestX, + long nDestY, + long nSrcX, + long nSrcY, + long nSrcWidth, + long nSrcHeight, + sal_uInt16 nFlags ); + virtual void copyBits( const SalTwoRect* pPosAry, + SalGraphics* pSrcGraphics ); + virtual void drawBitmap( const SalTwoRect* pPosAry, + const SalBitmap& rSalBitmap ); + virtual void drawBitmap( const SalTwoRect* pPosAry, + const SalBitmap& rSalBitmap, + SalColor nTransparentColor ); + virtual void drawBitmap( const SalTwoRect* pPosAry, + const SalBitmap& rSalBitmap, + const SalBitmap& rTransparentBitmap ); + virtual void drawMask( const SalTwoRect* pPosAry, + const SalBitmap& rSalBitmap, + SalColor nMaskColor ); + 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_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags ); + + 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; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/unx/headless/svpinst.hxx b/vcl/inc/unx/headless/svpinst.hxx new file mode 100644 index 000000000000..6fcafe0c7f66 --- /dev/null +++ b/vcl/inc/unx/headless/svpinst.hxx @@ -0,0 +1,204 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 _SVP_SALINST_HXX +#define _SVP_SALINST_HXX + +#include + +#include +#include +#include +#include +#include + +#include + +#include // timeval + +#define VIRTUAL_DESKTOP_WIDTH 1024 +#define VIRTUAL_DESKTOP_HEIGHT 768 +#define VIRTUAL_DESKTOP_DEPTH 24 + +// ------------------------------------------------------------------------- +// SalYieldMutex +// ------------------------------------------------------------------------- + +class SvpSalYieldMutex : public ::vcl::SolarMutexObject +{ +protected: + sal_uLong mnCount; + oslThreadIdentifier mnThreadId; + +public: + SvpSalYieldMutex(); + + virtual void acquire(); + virtual void release(); + virtual sal_Bool tryToAcquire(); + + sal_uLong GetAcquireCount() const { return mnCount; } + oslThreadIdentifier GetThreadId() const { return mnThreadId; } +}; + +// --------------- +// - SalTimer - +// --------------- +class SvpSalInstance; +class SvpSalTimer : public SalTimer +{ + SvpSalInstance* m_pInstance; +public: + SvpSalTimer( SvpSalInstance* pInstance ) : m_pInstance( pInstance ) {} + virtual ~SvpSalTimer(); + + // overload all pure virtual methods + virtual void Start( sal_uLong nMS ); + virtual void Stop(); +}; + +// --------------- +// - SalInstance - +// --------------- +class SvpSalFrame; +class SvpSalInstance : public SalInstance +{ + timeval m_aTimeout; + sal_uLong m_nTimeoutMS; + int m_pTimeoutFDS[2]; + SvpSalYieldMutex m_aYieldMutex; + + // internal event queue + struct SalUserEvent + { + const SalFrame* m_pFrame; + void* m_pData; + sal_uInt16 m_nEvent; + + SalUserEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent = SALEVENT_USEREVENT ) + : m_pFrame( pFrame ), + m_pData( pData ), + m_nEvent( nEvent ) + {} + }; + + oslMutex m_aEventGuard; + std::list< SalUserEvent > m_aUserEvents; + + std::list< SalFrame* > m_aFrames; + + bool isFrameAlive( const SalFrame* pFrame ) const; + +public: + static SvpSalInstance* s_pDefaultInstance; + + SvpSalInstance(); + virtual ~SvpSalInstance(); + + void PostEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent ); + void CancelEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent ); + + void StartTimer( sal_uLong nMS ); + void StopTimer(); + void Wakeup(); + + void registerFrame( SalFrame* pFrame ) { m_aFrames.push_back( pFrame ); } + void deregisterFrame( SalFrame* pFrame ); + const std::list< SalFrame* >& getFrames() const { return m_aFrames; } + + bool CheckTimeout( bool bExecuteTimers = true ); + + // Frame + 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) + virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True ); + virtual void DestroyObject( SalObject* pObject ); + + // VirtualDevice + // nDX and nDY in Pixel + // nBitCount: 0 == Default(=as window) / 1 == Mono + // pData allows for using a system dependent graphics or device context + virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics, + long nDX, long nDY, + sal_uInt16 nBitCount, const SystemGraphicsData *pData = NULL ); + virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice ); + + // Printer + // pSetupData->mpDriverData can be 0 + // pSetupData must be updatet with the current + // JobSetup + virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo, + ImplJobSetup* pSetupData ); + virtual void DestroyInfoPrinter( SalInfoPrinter* pPrinter ); + virtual SalPrinter* CreatePrinter( SalInfoPrinter* pInfoPrinter ); + virtual void DestroyPrinter( SalPrinter* pPrinter ); + + virtual void GetPrinterQueueInfo( ImplPrnQueueList* pList ); + virtual void GetPrinterQueueState( SalPrinterQueueInfo* pInfo ); + virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo ); + virtual String GetDefaultPrinter(); + + // SalTimer + virtual SalTimer* CreateSalTimer(); + // SalI18NImeStatus + virtual SalI18NImeStatus* CreateI18NImeStatus(); + // SalSystem + virtual SalSystem* CreateSalSystem(); + // SalBitmap + virtual SalBitmap* CreateSalBitmap(); + + // YieldMutex + virtual osl::SolarMutex* GetYieldMutex(); + virtual sal_uLong ReleaseYieldMutex(); + virtual void AcquireYieldMutex( sal_uLong 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( sal_uInt16 nType ); + + // may return NULL to disable session management + virtual SalSession* CreateSalSession(); + + virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ); + + virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType); + + virtual void updatePrinterUpdate(); + virtual void jobStartedPrinterUpdate(); + virtual void jobEndedPrinterUpdate(); +}; + +#endif // _SV_SALINST_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/unx/headless/svpprn.hxx b/vcl/inc/unx/headless/svpprn.hxx new file mode 100644 index 000000000000..f7e6a671f4b3 --- /dev/null +++ b/vcl/inc/unx/headless/svpprn.hxx @@ -0,0 +1,57 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 _SVP_SVPPRN_HXX +#define _SVP_SVPPRN_HXX + +#include "vcl/jobdata.hxx" + +#include "printergfx.hxx" +#include "printerjob.hxx" +#include + +#include "vclpluginapi.h" + +class PspGraphics; + +class SvpSalInfoPrinter : public PspSalInfoPrinter +{ +public: + virtual sal_Bool Setup( SalFrame* pFrame, ImplJobSetup* pSetupData ); +}; + +class SvpSalPrinter : public PspSalPrinter +{ +public: + SvpSalPrinter( SalInfoPrinter* pInfoPrinter ) : PspSalPrinter(pInfoPrinter) {} +}; + +#endif // _SVP_SVPPRN_HXX + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/unx/headless/svppspgraphics.hxx b/vcl/inc/unx/headless/svppspgraphics.hxx new file mode 100644 index 000000000000..1ce9109918d5 --- /dev/null +++ b/vcl/inc/unx/headless/svppspgraphics.hxx @@ -0,0 +1,189 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 _SVP_PSPGRAPHICS_HXX +#define _SVP_PSPGRAPHICS_HXX + + +#include "vcl/fontmanager.hxx" + +#include "sallayout.hxx" +#include "salgdi.hxx" + +namespace psp { struct JobData; class PrinterGfx; } + +class ServerFont; +class ImplDevFontAttributes; +class SalInfoPrinter; + +class PspGraphics : public SalGraphics +{ + psp::JobData* m_pJobData; + psp::PrinterGfx* m_pPrinterGfx; + String* m_pPhoneNr; + bool m_bSwallowFaxNo; + String m_aPhoneCollection; + bool m_bPhoneCollectionActive; + + ServerFont* m_pServerFont[ MAX_FALLBACK ]; + bool m_bFontVertical; + SalInfoPrinter* m_pInfoPrinter; + +protected: + virtual bool drawAlphaBitmap( const SalTwoRect&, const SalBitmap& rSourceBitmap, const SalBitmap& rAlphaBitmap ); + virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency ); + +public: + PspGraphics( psp::JobData* pJob, psp::PrinterGfx* pGfx, String* pPhone, bool bSwallow, SalInfoPrinter* pInfoPrinter ) + : m_pJobData( pJob ), + m_pPrinterGfx( pGfx ), + m_pPhoneNr( pPhone ), + m_bSwallowFaxNo( bSwallow ), + m_bPhoneCollectionActive( false ), + m_bFontVertical( false ), + m_pInfoPrinter( pInfoPrinter ) + { for( int i = 0; i < MAX_FALLBACK; i++ ) m_pServerFont[i] = 0; } + virtual ~PspGraphics(); + + // helper methods for sharing with X11SalGraphics + static const void* DoGetEmbedFontData( psp::fontID aFont, const sal_Ucs* pUnicodes, sal_Int32* pWidths, FontSubsetInfo& rInfo, long* pDataLen ); + static void DoFreeEmbedFontData( const void* pData, long nLen ); + static const Ucs2SIntMap* DoGetFontEncodingVector( psp::fontID aFont, const Ucs2OStrMap** pNonEncoded ); + static void DoGetGlyphWidths( psp::fontID aFont, + bool bVertical, + Int32Vector& rWidths, + Ucs2UIntMap& rUnicodeEnc ); + static ImplDevFontAttributes Info2DevFontAttributes( const psp::FastPrintFontInfo& ); + static void AnnounceFonts( ImplDevFontList*, const psp::FastPrintFontInfo& ); + + // overload all pure virtual methods + virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ); + virtual sal_uInt16 GetBitCount() const; + virtual long GetGraphicsWidth() const; + + virtual void ResetClipRegion(); + virtual bool setClipRegion( const Region& ); + + virtual void SetLineColor(); + virtual void SetLineColor( SalColor nSalColor ); + virtual void SetFillColor(); + virtual void SetFillColor( SalColor nSalColor ); + virtual void SetXORMode( bool bSet, bool ); + virtual void SetROPLineColor( SalROPColor nROPColor ); + virtual void SetROPFillColor( SalROPColor nROPColor ); + + virtual void SetTextColor( SalColor nSalColor ); + virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel ); + virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); + virtual sal_uLong GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs ); + virtual const ImplFontCharMap* GetImplFontCharMap() const; + virtual bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const; + virtual void GetDevFontList( ImplDevFontList* ); + virtual void GetDevFontSubstList( OutputDevice* ); + virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName ); + virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile, + const ImplFontData*, + sal_Int32* pGlyphIDs, + sal_uInt8* pEncoding, + sal_Int32* pWidths, + int nGlyphs, + FontSubsetInfo& rInfo + ); + virtual const Ucs2SIntMap* GetFontEncodingVector( const ImplFontData*, const Ucs2OStrMap** ppNonEncoded ); + virtual const void* GetEmbedFontData( const ImplFontData*, + const sal_Ucs* pUnicodes, + sal_Int32* pWidths, + FontSubsetInfo& rInfo, + long* pDataLen ); + virtual void FreeEmbedFontData( const void* pData, long nDataLen ); + virtual void GetGlyphWidths( const ImplFontData*, + bool bVertical, + Int32Vector& rWidths, + Ucs2UIntMap& rUnicodeEnc ); + virtual sal_Bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ); + virtual sal_Bool GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& ); + virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ); + virtual void DrawServerFontLayout( const ServerFontLayout& ); + virtual bool supportsOperation( OutDevSupportType ) const; + virtual void drawPixel( long nX, long nY ); + 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_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_uLong nPoints, + const SalPoint* pPtAry, + const sal_uInt8* pFlgAry ); + virtual sal_Bool drawPolygonBezier( sal_uLong nPoints, + const SalPoint* pPtAry, + const sal_uInt8* pFlgAry ); + virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly, + const sal_uInt32* pPoints, + const SalPoint* const* pPtAry, + const sal_uInt8* const* pFlgAry ); + + virtual void copyArea( long nDestX, + long nDestY, + long nSrcX, + long nSrcY, + long nSrcWidth, + long nSrcHeight, + sal_uInt16 nFlags ); + virtual void copyBits( const SalTwoRect* pPosAry, + SalGraphics* pSrcGraphics ); + virtual void drawBitmap( const SalTwoRect* pPosAry, + const SalBitmap& rSalBitmap ); + virtual void drawBitmap( const SalTwoRect* pPosAry, + const SalBitmap& rSalBitmap, + SalColor nTransparentColor ); + virtual void drawBitmap( const SalTwoRect* pPosAry, + const SalBitmap& rSalBitmap, + const SalBitmap& rTransparentBitmap ); + virtual void drawMask( const SalTwoRect* pPosAry, + const SalBitmap& rSalBitmap, + SalColor nMaskColor ); + 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_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags ); + + 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; + virtual SystemFontData GetSysFontData( int nFallbacklevel ) const; +}; + +#endif // _SVP_PSPGRAPHICS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/unx/headless/svpvd.hxx b/vcl/inc/unx/headless/svpvd.hxx new file mode 100644 index 000000000000..211cf36846f9 --- /dev/null +++ b/vcl/inc/unx/headless/svpvd.hxx @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 _SVP_SVPVD_HXX +#define _SVP_SVPVD_HXX + +#include +#include "svpelement.hxx" + +#include + +class SvpSalGraphics; + +class SvpSalVirtualDevice : public SalVirtualDevice, public SvpElement +{ + sal_uInt16 m_nBitCount; + basebmp::BitmapDeviceSharedPtr m_aDevice; + std::list< SvpSalGraphics* > m_aGraphics; + +public: + SvpSalVirtualDevice( sal_uInt16 nBitCount ) : SvpElement(), m_nBitCount(nBitCount) {} + virtual ~SvpSalVirtualDevice(); + + // SvpElement + virtual const basebmp::BitmapDeviceSharedPtr& getDevice() const { return m_aDevice; } + + // SalVirtualDevice + virtual SalGraphics* GetGraphics(); + virtual void ReleaseGraphics( SalGraphics* pGraphics ); + + virtual sal_Bool SetSize( long nNewDX, long nNewDY ); + virtual void GetSize( long& rWidth, long& rHeight ); +}; + +#endif // _SVP_SVPVD_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx index 07dc4e58d395..d6a181a77f30 100644 --- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx @@ -25,4 +25,6 @@ * instead of those above. */ -#include "../../gtk/gdi/salnativewidgets-gtk.cxx" +#include "../../headless/svpdi.hxx" +#include "../../headless/svpdi.hxx" + diff --git a/vcl/unx/headless/svpbmp.cxx b/vcl/unx/headless/svpbmp.cxx index 2d8309af5eba..eccdd2bb97b3 100644 --- a/vcl/unx/headless/svpbmp.cxx +++ b/vcl/unx/headless/svpbmp.cxx @@ -26,7 +26,7 @@ * ************************************************************************/ -#include "svpbmp.hxx" +#include "unx/headless/svpbmp.hxx" #include #include diff --git a/vcl/unx/headless/svpbmp.hxx b/vcl/unx/headless/svpbmp.hxx deleted file mode 100644 index b3adb3b9951f..000000000000 --- a/vcl/unx/headless/svpbmp.hxx +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * 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 SVP_SVBMP_HXX -#define SVP_SVBMP_HXX - -#include -#include "svpelement.hxx" - -class SvpSalBitmap : public SalBitmap, public SvpElement -{ - basebmp::BitmapDeviceSharedPtr m_aBitmap; -public: - SvpSalBitmap() {} - virtual ~SvpSalBitmap(); - - const basebmp::BitmapDeviceSharedPtr& getBitmap() const { return m_aBitmap; } - void setBitmap( const basebmp::BitmapDeviceSharedPtr& rSrc ) { m_aBitmap = rSrc; } - - // SvpElement - virtual const basebmp::BitmapDeviceSharedPtr& getDevice() const { return m_aBitmap; } - - // SalBitmap - virtual bool Create( const Size& rSize, - 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, - sal_uInt16 nNewBitCount ); - virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas, - Size& rSize, - bool bMask = false ); - virtual void Destroy(); - virtual Size GetSize() const; - virtual sal_uInt16 GetBitCount() const; - - virtual BitmapBuffer* AcquireBuffer( bool bReadOnly ); - virtual void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly ); - virtual bool GetSystemData( BitmapSystemData& rData ); - -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/headless/svpdummies.cxx b/vcl/unx/headless/svpdummies.cxx index 3bf1a4da9cc0..326ad814651f 100644 --- a/vcl/unx/headless/svpdummies.cxx +++ b/vcl/unx/headless/svpdummies.cxx @@ -26,8 +26,8 @@ * ************************************************************************/ -#include "svpdummies.hxx" -#include "svpinst.hxx" +#include "unx/headless/svpdummies.hxx" +#include "unx/headless/svpinst.hxx" #include // SalObject diff --git a/vcl/unx/headless/svpdummies.hxx b/vcl/unx/headless/svpdummies.hxx deleted file mode 100644 index bc46e9b22f70..000000000000 --- a/vcl/unx/headless/svpdummies.hxx +++ /dev/null @@ -1,100 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * 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 _SVP_SVPDUMMIES_HXX - -#include - -#include -#include -#include - -class SalGraphics; - -class SvpSalObject : public SalObject -{ -public: - SystemChildData m_aSystemChildData; - - SvpSalObject(); - virtual ~SvpSalObject(); - - // overload all pure virtual methods - virtual void ResetClipRegion(); - virtual sal_uInt16 GetClipRegionType(); - virtual void BeginSetClipRegion( sal_uLong 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( sal_Bool bVisible ); - virtual void Enable( sal_Bool nEnable ); - virtual void GrabFocus(); - - virtual void SetBackground(); - virtual void SetBackground( SalColor nSalColor ); - - virtual const SystemEnvData* GetSystemData() const; - - virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept ); -}; - -class SvpImeStatus : public SalI18NImeStatus -{ - public: - SvpImeStatus() {} - virtual ~SvpImeStatus(); - - virtual bool canToggle(); - virtual void toggle(); -}; - -class SvpSalSystem : public SalSystem -{ - public: - SvpSalSystem() {} - virtual ~SvpSalSystem(); - // get info about the display - virtual unsigned int GetDisplayScreenCount(); - virtual bool IsMultiDisplay(); - virtual unsigned int GetDefaultDisplayNumber(); - virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen ); - virtual Rectangle GetDisplayWorkAreaPosSizePixel( unsigned int nScreen ); - virtual rtl::OUString GetScreenName( unsigned int nScreen ); - - - virtual int ShowNativeMessageBox( const String& rTitle, - const String& rMessage, - int nButtonCombination, - int nDefaultButton); -}; - - -#endif // _SVP_SVPDUMMIES_H - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/headless/svpelement.cxx b/vcl/unx/headless/svpelement.cxx index b6bf4822b576..785f3377e9af 100644 --- a/vcl/unx/headless/svpelement.cxx +++ b/vcl/unx/headless/svpelement.cxx @@ -26,7 +26,7 @@ * ************************************************************************/ -#include "svpelement.hxx" +#include "unx/headless/svpelement.hxx" #include #include @@ -39,9 +39,9 @@ #include #include -#include "svpvd.hxx" -#include "svpbmp.hxx" -#include "svpframe.hxx" +#include "unx/headless/svpvd.hxx" +#include "unx/headless/svpbmp.hxx" +#include "unx/headless/svpframe.hxx" #include #include diff --git a/vcl/unx/headless/svpelement.hxx b/vcl/unx/headless/svpelement.hxx deleted file mode 100644 index c7f647cf3a03..000000000000 --- a/vcl/unx/headless/svpelement.hxx +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * 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 _SVP_SVPELEMENT_HXX -#define _SVP_SVPELEMENT_HXX - -#include - -#define SVP_DEFAULT_BITMAP_FORMAT basebmp::Format::TWENTYFOUR_BIT_TC_MASK - -class SvpElement -{ - protected: - SvpElement(); - virtual ~SvpElement(); - public: - virtual const basebmp::BitmapDeviceSharedPtr& getDevice() const = 0; - - static sal_uInt32 getBitCountFromScanlineFormat( sal_Int32 nFormat ); -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/headless/svpframe.cxx b/vcl/unx/headless/svpframe.cxx index 1b8455557fac..bd15389cb1c0 100644 --- a/vcl/unx/headless/svpframe.cxx +++ b/vcl/unx/headless/svpframe.cxx @@ -26,9 +26,9 @@ * ************************************************************************/ -#include "svpframe.hxx" -#include "svpinst.hxx" -#include "svpgdi.hxx" +#include "unx/headless/svpframe.hxx" +#include "unx/headless/svpinst.hxx" +#include "unx/headless/svpgdi.hxx" #include #include diff --git a/vcl/unx/headless/svpframe.hxx b/vcl/unx/headless/svpframe.hxx deleted file mode 100644 index e57381780f61..000000000000 --- a/vcl/unx/headless/svpframe.hxx +++ /dev/null @@ -1,132 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * 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 _SVP_SVPFRAME_HXX - -#include - -#include -#include "svpelement.hxx" - -#include - -class SvpSalInstance; -class SvpSalGraphics; - -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_uLong m_nStyle; - bool m_bVisible; - long m_nMinWidth; - long m_nMinHeight; - long m_nMaxWidth; - long m_nMaxHeight; - - SystemEnvData m_aSystemChildData; - - basebmp::BitmapDeviceSharedPtr m_aFrame; - std::list< SvpSalGraphics* > m_aGraphics; - - static SvpSalFrame* s_pFocusFrame; -public: - SvpSalFrame( SvpSalInstance* pInstance, - SalFrame* pParent, - sal_uLong nSalFrameStyle, - SystemParentData* pSystemParent = NULL ); - virtual ~SvpSalFrame(); - - void GetFocus(); - void LoseFocus(); - void PostPaint() const; - - // SvpElement - virtual const basebmp::BitmapDeviceSharedPtr& getDevice() const { return m_aFrame; } - - // SalFrame - virtual SalGraphics* GetGraphics(); - virtual void ReleaseGraphics( SalGraphics* pGraphics ); - - virtual sal_Bool PostEvent( void* pData ); - - virtual void SetTitle( const XubString& rTitle ); - virtual void SetIcon( sal_uInt16 nIcon ); - virtual void SetMenu( SalMenu* pMenu ); - virtual void DrawMenuBar(); - - virtual void SetExtendedFrameStyle( SalExtStyle nExtStyle ); - 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, 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 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( 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( 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 ); - virtual void Beep( SoundType eSoundType ); - virtual const SystemEnvData* GetSystemData() const; - virtual SalPointerState GetPointerState(); - virtual SalIndicatorState GetIndicatorState(); - virtual void SimulateKeyPress( sal_uInt16 nKeyCode ); - virtual void SetParent( SalFrame* pNewParent ); - virtual bool SetPluginParent( SystemParentData* pNewParent ); - virtual void SetBackgroundBitmap( SalBitmap* pBitmap ); - virtual void ResetClipRegion(); - virtual void BeginSetClipRegion( sal_uLong nRects ); - virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ); - virtual void EndSetClipRegion(); - - /*TODO: functional implementation */ - virtual void SetScreenNumber( unsigned int nScreen ) { (void)nScreen; } - virtual void SetApplicationID(const rtl::OUString &rApplicationID) { (void) rApplicationID; } -}; -#endif // _SVP_SVPFRAME_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/headless/svpgdi.cxx b/vcl/unx/headless/svpgdi.cxx index 0a7041661d4e..7025b7d18b7d 100644 --- a/vcl/unx/headless/svpgdi.cxx +++ b/vcl/unx/headless/svpgdi.cxx @@ -26,8 +26,8 @@ * ************************************************************************/ -#include "svpgdi.hxx" -#include "svpbmp.hxx" +#include "unx/headless/svpgdi.hxx" +#include "unx/headless/svpbmp.hxx" #include #include @@ -46,7 +46,7 @@ #include #endif -#include +#include "unx/headless/svppspgraphics.hxx" #include using namespace basegfx; diff --git a/vcl/unx/headless/svpgdi.hxx b/vcl/unx/headless/svpgdi.hxx deleted file mode 100644 index 8291a3c2f7bc..000000000000 --- a/vcl/unx/headless/svpgdi.hxx +++ /dev/null @@ -1,174 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * 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 _SVP_SVPGDI_HXX - -#include -#include - -#include -#include - -class ServerFont; - -class SvpSalGraphics : public SalGraphics -{ - basebmp::BitmapDeviceSharedPtr m_aDevice; - basebmp::BitmapDeviceSharedPtr m_aOrigDevice; - basebmp::BitmapDeviceSharedPtr m_aClipMap; - - bool m_bUseLineColor; - basebmp::Color m_aLineColor; - bool m_bUseFillColor; - basebmp::Color m_aFillColor; - basebmp::Color m_aTextColor; - - basebmp::DrawMode m_aDrawMode; - - ServerFont* m_pServerFont[ MAX_FALLBACK ]; - sal_uInt32 m_eTextFmt; - -protected: - virtual bool drawAlphaBitmap( const SalTwoRect&, const SalBitmap& rSourceBitmap, const SalBitmap& rAlphaBitmap ); - virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency ); - -public: - SvpSalGraphics(); - virtual ~SvpSalGraphics(); - - const basebmp::BitmapDeviceSharedPtr& getDevice() const { return m_aDevice; } - void setDevice( basebmp::BitmapDeviceSharedPtr& rDevice ); - - // overload all pure virtual methods - virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ); - virtual sal_uInt16 GetBitCount() const; - virtual long GetGraphicsWidth() const; - - virtual void ResetClipRegion(); - virtual bool setClipRegion( const Region& ); - - virtual void SetLineColor(); - virtual void SetLineColor( SalColor nSalColor ); - virtual void SetFillColor(); - - virtual void SetFillColor( SalColor nSalColor ); - - virtual void SetXORMode( bool bSet, bool ); - - virtual void SetROPLineColor( SalROPColor nROPColor ); - virtual void SetROPFillColor( SalROPColor nROPColor ); - - virtual void SetTextColor( SalColor nSalColor ); - virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel ); - virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); - virtual sal_uLong GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs ); - virtual const ImplFontCharMap* GetImplFontCharMap() const; - virtual bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const; - virtual void GetDevFontList( ImplDevFontList* ); - virtual void GetDevFontSubstList( OutputDevice* ); - virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName ); - virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile, - const ImplFontData*, - sal_Int32* pGlyphIDs, - sal_uInt8* pEncoding, - sal_Int32* pWidths, - int nGlyphs, - FontSubsetInfo& rInfo - ); - virtual const Ucs2SIntMap* GetFontEncodingVector( const ImplFontData*, const Ucs2OStrMap** ppNonEncoded ); - virtual const void* GetEmbedFontData( const ImplFontData*, - const sal_Ucs* pUnicodes, - sal_Int32* pWidths, - FontSubsetInfo& rInfo, - long* pDataLen ); - virtual void FreeEmbedFontData( const void* pData, long nDataLen ); - virtual void GetGlyphWidths( const ImplFontData*, - bool bVertical, - Int32Vector& rWidths, - Ucs2UIntMap& rUnicodeEnc ); - virtual sal_Bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ); - virtual sal_Bool GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& ); - virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ); - virtual void DrawServerFontLayout( const ServerFontLayout& ); - virtual bool supportsOperation( OutDevSupportType ) const; - virtual void drawPixel( long nX, long nY ); - 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 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_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_uLong nPoints, - const SalPoint* pPtAry, - const sal_uInt8* pFlgAry ); - virtual sal_Bool drawPolygonBezier( sal_uLong nPoints, - const SalPoint* pPtAry, - const sal_uInt8* pFlgAry ); - virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly, - const sal_uInt32* pPoints, - const SalPoint* const* pPtAry, - const sal_uInt8* const* pFlgAry ); - - virtual void copyArea( long nDestX, - long nDestY, - long nSrcX, - long nSrcY, - long nSrcWidth, - long nSrcHeight, - sal_uInt16 nFlags ); - virtual void copyBits( const SalTwoRect* pPosAry, - SalGraphics* pSrcGraphics ); - virtual void drawBitmap( const SalTwoRect* pPosAry, - const SalBitmap& rSalBitmap ); - virtual void drawBitmap( const SalTwoRect* pPosAry, - const SalBitmap& rSalBitmap, - SalColor nTransparentColor ); - virtual void drawBitmap( const SalTwoRect* pPosAry, - const SalBitmap& rSalBitmap, - const SalBitmap& rTransparentBitmap ); - virtual void drawMask( const SalTwoRect* pPosAry, - const SalBitmap& rSalBitmap, - SalColor nMaskColor ); - 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_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags ); - - 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; -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/headless/svpinst.cxx b/vcl/unx/headless/svpinst.cxx index c9e011c1a67a..41d268a7a437 100644 --- a/vcl/unx/headless/svpinst.cxx +++ b/vcl/unx/headless/svpinst.cxx @@ -35,11 +35,11 @@ #include -#include "svpinst.hxx" -#include "svpframe.hxx" -#include "svpdummies.hxx" -#include "svpvd.hxx" -#include "svpbmp.hxx" +#include "unx/headless/svpinst.hxx" +#include "unx/headless/svpframe.hxx" +#include "unx/headless/svpdummies.hxx" +#include "unx/headless/svpvd.hxx" +#include "unx/headless/svpbmp.hxx" #include #include diff --git a/vcl/unx/headless/svpinst.hxx b/vcl/unx/headless/svpinst.hxx deleted file mode 100644 index 6fcafe0c7f66..000000000000 --- a/vcl/unx/headless/svpinst.hxx +++ /dev/null @@ -1,204 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * 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 _SVP_SALINST_HXX -#define _SVP_SALINST_HXX - -#include - -#include -#include -#include -#include -#include - -#include - -#include // timeval - -#define VIRTUAL_DESKTOP_WIDTH 1024 -#define VIRTUAL_DESKTOP_HEIGHT 768 -#define VIRTUAL_DESKTOP_DEPTH 24 - -// ------------------------------------------------------------------------- -// SalYieldMutex -// ------------------------------------------------------------------------- - -class SvpSalYieldMutex : public ::vcl::SolarMutexObject -{ -protected: - sal_uLong mnCount; - oslThreadIdentifier mnThreadId; - -public: - SvpSalYieldMutex(); - - virtual void acquire(); - virtual void release(); - virtual sal_Bool tryToAcquire(); - - sal_uLong GetAcquireCount() const { return mnCount; } - oslThreadIdentifier GetThreadId() const { return mnThreadId; } -}; - -// --------------- -// - SalTimer - -// --------------- -class SvpSalInstance; -class SvpSalTimer : public SalTimer -{ - SvpSalInstance* m_pInstance; -public: - SvpSalTimer( SvpSalInstance* pInstance ) : m_pInstance( pInstance ) {} - virtual ~SvpSalTimer(); - - // overload all pure virtual methods - virtual void Start( sal_uLong nMS ); - virtual void Stop(); -}; - -// --------------- -// - SalInstance - -// --------------- -class SvpSalFrame; -class SvpSalInstance : public SalInstance -{ - timeval m_aTimeout; - sal_uLong m_nTimeoutMS; - int m_pTimeoutFDS[2]; - SvpSalYieldMutex m_aYieldMutex; - - // internal event queue - struct SalUserEvent - { - const SalFrame* m_pFrame; - void* m_pData; - sal_uInt16 m_nEvent; - - SalUserEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent = SALEVENT_USEREVENT ) - : m_pFrame( pFrame ), - m_pData( pData ), - m_nEvent( nEvent ) - {} - }; - - oslMutex m_aEventGuard; - std::list< SalUserEvent > m_aUserEvents; - - std::list< SalFrame* > m_aFrames; - - bool isFrameAlive( const SalFrame* pFrame ) const; - -public: - static SvpSalInstance* s_pDefaultInstance; - - SvpSalInstance(); - virtual ~SvpSalInstance(); - - void PostEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent ); - void CancelEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent ); - - void StartTimer( sal_uLong nMS ); - void StopTimer(); - void Wakeup(); - - void registerFrame( SalFrame* pFrame ) { m_aFrames.push_back( pFrame ); } - void deregisterFrame( SalFrame* pFrame ); - const std::list< SalFrame* >& getFrames() const { return m_aFrames; } - - bool CheckTimeout( bool bExecuteTimers = true ); - - // Frame - 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) - virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True ); - virtual void DestroyObject( SalObject* pObject ); - - // VirtualDevice - // nDX and nDY in Pixel - // nBitCount: 0 == Default(=as window) / 1 == Mono - // pData allows for using a system dependent graphics or device context - virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics, - long nDX, long nDY, - sal_uInt16 nBitCount, const SystemGraphicsData *pData = NULL ); - virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice ); - - // Printer - // pSetupData->mpDriverData can be 0 - // pSetupData must be updatet with the current - // JobSetup - virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo, - ImplJobSetup* pSetupData ); - virtual void DestroyInfoPrinter( SalInfoPrinter* pPrinter ); - virtual SalPrinter* CreatePrinter( SalInfoPrinter* pInfoPrinter ); - virtual void DestroyPrinter( SalPrinter* pPrinter ); - - virtual void GetPrinterQueueInfo( ImplPrnQueueList* pList ); - virtual void GetPrinterQueueState( SalPrinterQueueInfo* pInfo ); - virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo ); - virtual String GetDefaultPrinter(); - - // SalTimer - virtual SalTimer* CreateSalTimer(); - // SalI18NImeStatus - virtual SalI18NImeStatus* CreateI18NImeStatus(); - // SalSystem - virtual SalSystem* CreateSalSystem(); - // SalBitmap - virtual SalBitmap* CreateSalBitmap(); - - // YieldMutex - virtual osl::SolarMutex* GetYieldMutex(); - virtual sal_uLong ReleaseYieldMutex(); - virtual void AcquireYieldMutex( sal_uLong 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( sal_uInt16 nType ); - - // may return NULL to disable session management - virtual SalSession* CreateSalSession(); - - virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ); - - virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType); - - virtual void updatePrinterUpdate(); - virtual void jobStartedPrinterUpdate(); - virtual void jobEndedPrinterUpdate(); -}; - -#endif // _SV_SALINST_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/headless/svpprn.cxx b/vcl/unx/headless/svpprn.cxx index 6f30f2d38969..64929876de17 100644 --- a/vcl/unx/headless/svpprn.cxx +++ b/vcl/unx/headless/svpprn.cxx @@ -41,9 +41,9 @@ #include "print.h" #include "salptype.hxx" -#include "svpprn.hxx" -#include "svppspgraphics.hxx" -#include "svpinst.hxx" +#include "unx/headless/svpprn.hxx" +#include "unx/headless/svppspgraphics.hxx" +#include "unx/headless/svpinst.hxx" using namespace psp; diff --git a/vcl/unx/headless/svpprn.hxx b/vcl/unx/headless/svpprn.hxx deleted file mode 100644 index f7e6a671f4b3..000000000000 --- a/vcl/unx/headless/svpprn.hxx +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * 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 _SVP_SVPPRN_HXX -#define _SVP_SVPPRN_HXX - -#include "vcl/jobdata.hxx" - -#include "printergfx.hxx" -#include "printerjob.hxx" -#include - -#include "vclpluginapi.h" - -class PspGraphics; - -class SvpSalInfoPrinter : public PspSalInfoPrinter -{ -public: - virtual sal_Bool Setup( SalFrame* pFrame, ImplJobSetup* pSetupData ); -}; - -class SvpSalPrinter : public PspSalPrinter -{ -public: - SvpSalPrinter( SalInfoPrinter* pInfoPrinter ) : PspSalPrinter(pInfoPrinter) {} -}; - -#endif // _SVP_SVPPRN_HXX - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx index 82f3ac43df96..7b463a338e13 100644 --- a/vcl/unx/headless/svppspgraphics.cxx +++ b/vcl/unx/headless/svppspgraphics.cxx @@ -54,8 +54,8 @@ #include "outfont.hxx" #include "fontsubset.hxx" #include "printergfx.hxx" -#include "svppspgraphics.hxx" -#include "svpbmp.hxx" +#include "unx/headless/svppspgraphics.hxx" +#include "unx/headless/svpbmp.hxx" #include "region.h" using namespace psp; diff --git a/vcl/unx/headless/svppspgraphics.hxx b/vcl/unx/headless/svppspgraphics.hxx deleted file mode 100644 index 1ce9109918d5..000000000000 --- a/vcl/unx/headless/svppspgraphics.hxx +++ /dev/null @@ -1,189 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * 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 _SVP_PSPGRAPHICS_HXX -#define _SVP_PSPGRAPHICS_HXX - - -#include "vcl/fontmanager.hxx" - -#include "sallayout.hxx" -#include "salgdi.hxx" - -namespace psp { struct JobData; class PrinterGfx; } - -class ServerFont; -class ImplDevFontAttributes; -class SalInfoPrinter; - -class PspGraphics : public SalGraphics -{ - psp::JobData* m_pJobData; - psp::PrinterGfx* m_pPrinterGfx; - String* m_pPhoneNr; - bool m_bSwallowFaxNo; - String m_aPhoneCollection; - bool m_bPhoneCollectionActive; - - ServerFont* m_pServerFont[ MAX_FALLBACK ]; - bool m_bFontVertical; - SalInfoPrinter* m_pInfoPrinter; - -protected: - virtual bool drawAlphaBitmap( const SalTwoRect&, const SalBitmap& rSourceBitmap, const SalBitmap& rAlphaBitmap ); - virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency ); - -public: - PspGraphics( psp::JobData* pJob, psp::PrinterGfx* pGfx, String* pPhone, bool bSwallow, SalInfoPrinter* pInfoPrinter ) - : m_pJobData( pJob ), - m_pPrinterGfx( pGfx ), - m_pPhoneNr( pPhone ), - m_bSwallowFaxNo( bSwallow ), - m_bPhoneCollectionActive( false ), - m_bFontVertical( false ), - m_pInfoPrinter( pInfoPrinter ) - { for( int i = 0; i < MAX_FALLBACK; i++ ) m_pServerFont[i] = 0; } - virtual ~PspGraphics(); - - // helper methods for sharing with X11SalGraphics - static const void* DoGetEmbedFontData( psp::fontID aFont, const sal_Ucs* pUnicodes, sal_Int32* pWidths, FontSubsetInfo& rInfo, long* pDataLen ); - static void DoFreeEmbedFontData( const void* pData, long nLen ); - static const Ucs2SIntMap* DoGetFontEncodingVector( psp::fontID aFont, const Ucs2OStrMap** pNonEncoded ); - static void DoGetGlyphWidths( psp::fontID aFont, - bool bVertical, - Int32Vector& rWidths, - Ucs2UIntMap& rUnicodeEnc ); - static ImplDevFontAttributes Info2DevFontAttributes( const psp::FastPrintFontInfo& ); - static void AnnounceFonts( ImplDevFontList*, const psp::FastPrintFontInfo& ); - - // overload all pure virtual methods - virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ); - virtual sal_uInt16 GetBitCount() const; - virtual long GetGraphicsWidth() const; - - virtual void ResetClipRegion(); - virtual bool setClipRegion( const Region& ); - - virtual void SetLineColor(); - virtual void SetLineColor( SalColor nSalColor ); - virtual void SetFillColor(); - virtual void SetFillColor( SalColor nSalColor ); - virtual void SetXORMode( bool bSet, bool ); - virtual void SetROPLineColor( SalROPColor nROPColor ); - virtual void SetROPFillColor( SalROPColor nROPColor ); - - virtual void SetTextColor( SalColor nSalColor ); - virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel ); - virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); - virtual sal_uLong GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs ); - virtual const ImplFontCharMap* GetImplFontCharMap() const; - virtual bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const; - virtual void GetDevFontList( ImplDevFontList* ); - virtual void GetDevFontSubstList( OutputDevice* ); - virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName ); - virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile, - const ImplFontData*, - sal_Int32* pGlyphIDs, - sal_uInt8* pEncoding, - sal_Int32* pWidths, - int nGlyphs, - FontSubsetInfo& rInfo - ); - virtual const Ucs2SIntMap* GetFontEncodingVector( const ImplFontData*, const Ucs2OStrMap** ppNonEncoded ); - virtual const void* GetEmbedFontData( const ImplFontData*, - const sal_Ucs* pUnicodes, - sal_Int32* pWidths, - FontSubsetInfo& rInfo, - long* pDataLen ); - virtual void FreeEmbedFontData( const void* pData, long nDataLen ); - virtual void GetGlyphWidths( const ImplFontData*, - bool bVertical, - Int32Vector& rWidths, - Ucs2UIntMap& rUnicodeEnc ); - virtual sal_Bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ); - virtual sal_Bool GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& ); - virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ); - virtual void DrawServerFontLayout( const ServerFontLayout& ); - virtual bool supportsOperation( OutDevSupportType ) const; - virtual void drawPixel( long nX, long nY ); - 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_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_uLong nPoints, - const SalPoint* pPtAry, - const sal_uInt8* pFlgAry ); - virtual sal_Bool drawPolygonBezier( sal_uLong nPoints, - const SalPoint* pPtAry, - const sal_uInt8* pFlgAry ); - virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly, - const sal_uInt32* pPoints, - const SalPoint* const* pPtAry, - const sal_uInt8* const* pFlgAry ); - - virtual void copyArea( long nDestX, - long nDestY, - long nSrcX, - long nSrcY, - long nSrcWidth, - long nSrcHeight, - sal_uInt16 nFlags ); - virtual void copyBits( const SalTwoRect* pPosAry, - SalGraphics* pSrcGraphics ); - virtual void drawBitmap( const SalTwoRect* pPosAry, - const SalBitmap& rSalBitmap ); - virtual void drawBitmap( const SalTwoRect* pPosAry, - const SalBitmap& rSalBitmap, - SalColor nTransparentColor ); - virtual void drawBitmap( const SalTwoRect* pPosAry, - const SalBitmap& rSalBitmap, - const SalBitmap& rTransparentBitmap ); - virtual void drawMask( const SalTwoRect* pPosAry, - const SalBitmap& rSalBitmap, - SalColor nMaskColor ); - 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_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags ); - - 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; - virtual SystemFontData GetSysFontData( int nFallbacklevel ) const; -}; - -#endif // _SVP_PSPGRAPHICS_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/headless/svptext.cxx b/vcl/unx/headless/svptext.cxx index 18531baf1b52..4d3424605ba2 100644 --- a/vcl/unx/headless/svptext.cxx +++ b/vcl/unx/headless/svptext.cxx @@ -43,9 +43,9 @@ #include #include -#include "svpgdi.hxx" -#include "svpbmp.hxx" -#include "svppspgraphics.hxx" +#include "unx/headless/svpgdi.hxx" +#include "unx/headless/svpbmp.hxx" +#include "unx/headless/svppspgraphics.hxx" using namespace basegfx; using namespace basebmp; diff --git a/vcl/unx/headless/svpvd.cxx b/vcl/unx/headless/svpvd.cxx index 8477da7b3bfc..c1de04b8d865 100644 --- a/vcl/unx/headless/svpvd.cxx +++ b/vcl/unx/headless/svpvd.cxx @@ -26,8 +26,8 @@ * ************************************************************************/ -#include "svpvd.hxx" -#include "svpgdi.hxx" +#include "unx/headless/svpvd.hxx" +#include "unx/headless/svpgdi.hxx" #include #include diff --git a/vcl/unx/headless/svpvd.hxx b/vcl/unx/headless/svpvd.hxx deleted file mode 100644 index 211cf36846f9..000000000000 --- a/vcl/unx/headless/svpvd.hxx +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * 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 _SVP_SVPVD_HXX -#define _SVP_SVPVD_HXX - -#include -#include "svpelement.hxx" - -#include - -class SvpSalGraphics; - -class SvpSalVirtualDevice : public SalVirtualDevice, public SvpElement -{ - sal_uInt16 m_nBitCount; - basebmp::BitmapDeviceSharedPtr m_aDevice; - std::list< SvpSalGraphics* > m_aGraphics; - -public: - SvpSalVirtualDevice( sal_uInt16 nBitCount ) : SvpElement(), m_nBitCount(nBitCount) {} - virtual ~SvpSalVirtualDevice(); - - // SvpElement - virtual const basebmp::BitmapDeviceSharedPtr& getDevice() const { return m_aDevice; } - - // SalVirtualDevice - virtual SalGraphics* GetGraphics(); - virtual void ReleaseGraphics( SalGraphics* pGraphics ); - - virtual sal_Bool SetSize( long nNewDX, long nNewDY ); - virtual void GetSize( long& rWidth, long& rHeight ); -}; - -#endif // _SVP_SVPVD_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From ec2ba4881538f485ed17dd1c44c2a9fd0a5d971a Mon Sep 17 00:00:00 2001 From: Matus Kukan Date: Fri, 24 Jun 2011 14:56:31 +0100 Subject: update component factory methods to use new prefixes, to add lib merging --- sot/source/unoolestorage/register.cxx | 4 ++-- sot/util/sot.component | 2 +- svl/source/fsstor/fsfactory.cxx | 4 ++-- svl/source/fsstor/fsstorage.component | 2 +- svl/source/passwordcontainer/passwordcontainer.component | 2 +- svl/source/passwordcontainer/passwordcontainer.cxx | 4 ++-- svl/source/uno/registerservices.cxx | 4 ++-- svl/util/svl.component | 2 +- svtools/source/hatchwindow/hatchwindowfactory.component | 2 +- svtools/source/hatchwindow/hatchwindowfactory.cxx | 4 ++-- svtools/source/productregistration/productregistration.cxx | 4 ++-- svtools/source/productregistration/productregistration.uno.component | 2 +- svtools/source/uno/miscservices.cxx | 4 ++-- svtools/util/svt.component | 2 +- toolkit/source/helper/registerservices.cxx | 4 ++-- toolkit/util/tk.component | 2 +- unotools/source/ucbhelper/xtempfile.cxx | 4 ++-- unotools/util/utl.component | 2 +- vcl/source/components/factory.cxx | 4 ++-- vcl/vcl.macosx.component | 2 +- vcl/vcl.unx.component | 2 +- vcl/vcl.windows.component | 2 +- 22 files changed, 32 insertions(+), 32 deletions(-) (limited to 'vcl') diff --git a/sot/source/unoolestorage/register.cxx b/sot/source/unoolestorage/register.cxx index 696e0cefed93..30f417b29625 100644 --- a/sot/source/unoolestorage/register.cxx +++ b/sot/source/unoolestorage/register.cxx @@ -41,12 +41,12 @@ using namespace ::com::sun::star; extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) +SAL_DLLPUBLIC_EXPORT void SAL_CALL sot_component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) +SAL_DLLPUBLIC_EXPORT void * SAL_CALL sot_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) { void * pRet = 0; diff --git a/sot/util/sot.component b/sot/util/sot.component index 7d17c7d54475..44ca8cea7a9a 100644 --- a/sot/util/sot.component +++ b/sot/util/sot.component @@ -26,7 +26,7 @@ * **********************************************************************--> - diff --git a/svl/source/fsstor/fsfactory.cxx b/svl/source/fsstor/fsfactory.cxx index a641a5d80c04..db6fc301a0d0 100644 --- a/svl/source/fsstor/fsfactory.cxx +++ b/svl/source/fsstor/fsfactory.cxx @@ -235,13 +235,13 @@ uno::Sequence< ::rtl::OUString > SAL_CALL FSStorageFactory::getSupportedServiceN extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment ( +SAL_DLLPUBLIC_EXPORT void SAL_CALL fsstorage_component_getImplementationEnvironment ( const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */) { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory ( +SAL_DLLPUBLIC_EXPORT void * SAL_CALL fsstorage_component_getFactory ( const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */) { void * pResult = 0; diff --git a/svl/source/fsstor/fsstorage.component b/svl/source/fsstor/fsstorage.component index 3ef0be825972..f9f08487b8a5 100644 --- a/svl/source/fsstor/fsstorage.component +++ b/svl/source/fsstor/fsstorage.component @@ -26,7 +26,7 @@ * **********************************************************************--> - diff --git a/svl/source/passwordcontainer/passwordcontainer.component b/svl/source/passwordcontainer/passwordcontainer.component index 42eb47cf14dd..3fc55af1861e 100644 --- a/svl/source/passwordcontainer/passwordcontainer.component +++ b/svl/source/passwordcontainer/passwordcontainer.component @@ -26,7 +26,7 @@ * **********************************************************************--> - diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx index 6e922ea29cd7..d584a1c77725 100644 --- a/svl/source/passwordcontainer/passwordcontainer.cxx +++ b/svl/source/passwordcontainer/passwordcontainer.cxx @@ -1538,13 +1538,13 @@ MasterPasswordRequest_Impl::MasterPasswordRequest_Impl( PasswordRequestMode Mode extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment ( +SAL_DLLPUBLIC_EXPORT void SAL_CALL passwordcontainer_component_getImplementationEnvironment ( const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */) { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory ( +SAL_DLLPUBLIC_EXPORT void * SAL_CALL passwordcontainer_component_getFactory ( const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */) { void * pResult = 0; diff --git a/svl/source/uno/registerservices.cxx b/svl/source/uno/registerservices.cxx index 5caca580694f..3fa8b0e7ebef 100644 --- a/svl/source/uno/registerservices.cxx +++ b/svl/source/uno/registerservices.cxx @@ -55,13 +55,13 @@ DECLARE_CREATEINSTANCE( PathService ) extern "C" { -SVL_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment ( +SVL_DLLPUBLIC void SAL_CALL svl_component_getImplementationEnvironment ( const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */) { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -SVL_DLLPUBLIC void* SAL_CALL component_getFactory ( +SVL_DLLPUBLIC void* SAL_CALL svl_component_getFactory ( const sal_Char * pImplementationName, void * _pServiceManager, void * /* _pRegistryKey*/) { void * pResult = 0; diff --git a/svl/util/svl.component b/svl/util/svl.component index 4af1a31f5782..78fc22928ac5 100644 --- a/svl/util/svl.component +++ b/svl/util/svl.component @@ -26,7 +26,7 @@ * **********************************************************************--> - diff --git a/svtools/source/hatchwindow/hatchwindowfactory.component b/svtools/source/hatchwindow/hatchwindowfactory.component index 153fc8796281..b9ebbaefdd04 100644 --- a/svtools/source/hatchwindow/hatchwindowfactory.component +++ b/svtools/source/hatchwindow/hatchwindowfactory.component @@ -26,7 +26,7 @@ * **********************************************************************--> - diff --git a/svtools/source/hatchwindow/hatchwindowfactory.cxx b/svtools/source/hatchwindow/hatchwindowfactory.cxx index a0ff0d4daf17..13f78b3e353b 100644 --- a/svtools/source/hatchwindow/hatchwindowfactory.cxx +++ b/svtools/source/hatchwindow/hatchwindowfactory.cxx @@ -109,13 +109,13 @@ uno::Sequence< ::rtl::OUString > SAL_CALL OHatchWindowFactory::getSupportedServi extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment ( +SAL_DLLPUBLIC_EXPORT void SAL_CALL hatchwindowfactory_component_getImplementationEnvironment ( const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */) { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory ( +SAL_DLLPUBLIC_EXPORT void * SAL_CALL hatchwindowfactory_component_getFactory ( const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */) { void * pResult = 0; diff --git a/svtools/source/productregistration/productregistration.cxx b/svtools/source/productregistration/productregistration.cxx index a4251652aac2..ebedda0ad071 100644 --- a/svtools/source/productregistration/productregistration.cxx +++ b/svtools/source/productregistration/productregistration.cxx @@ -453,13 +453,13 @@ namespace svt extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment ( +SAL_DLLPUBLIC_EXPORT void SAL_CALL productregistration_component_getImplementationEnvironment ( const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */) { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory ( +SAL_DLLPUBLIC_EXPORT void * SAL_CALL productregistration_component_getFactory ( const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */) { void * pResult = 0; diff --git a/svtools/source/productregistration/productregistration.uno.component b/svtools/source/productregistration/productregistration.uno.component index da2cfd37c483..f57860ef6463 100644 --- a/svtools/source/productregistration/productregistration.uno.component +++ b/svtools/source/productregistration/productregistration.uno.component @@ -26,7 +26,7 @@ * **********************************************************************--> - diff --git a/svtools/source/uno/miscservices.cxx b/svtools/source/uno/miscservices.cxx index c652b6028bf0..1b20ef518683 100644 --- a/svtools/source/uno/miscservices.cxx +++ b/svtools/source/uno/miscservices.cxx @@ -96,13 +96,13 @@ DECLARE_CREATEINSTANCE_NAMESPACE( unographic, GraphicRendererVCL ) extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment ( +SAL_DLLPUBLIC_EXPORT void SAL_CALL svt_component_getImplementationEnvironment ( const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */) { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory ( +SAL_DLLPUBLIC_EXPORT void * SAL_CALL svt_component_getFactory ( const sal_Char * pImplementationName, void * _pServiceManager, void * pRegistryKey) { void * pResult = 0; diff --git a/svtools/util/svt.component b/svtools/util/svt.component index e15970547a38..2ba695d72e92 100644 --- a/svtools/util/svt.component +++ b/svtools/util/svt.component @@ -26,7 +26,7 @@ * **********************************************************************--> - diff --git a/toolkit/source/helper/registerservices.cxx b/toolkit/source/helper/registerservices.cxx index cadd228d1c4b..6e11e72970be 100644 --- a/toolkit/source/helper/registerservices.cxx +++ b/toolkit/source/helper/registerservices.cxx @@ -236,12 +236,12 @@ extern void * SAL_CALL comp_Layout_component_getFactory( const char * implName, extern "C" { -TOOLKIT_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment( const sal_Char** ppEnvTypeName, uno_Environment** ) +TOOLKIT_DLLPUBLIC void SAL_CALL tk_component_getImplementationEnvironment( const sal_Char** ppEnvTypeName, uno_Environment** ) { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -TOOLKIT_DLLPUBLIC void* SAL_CALL component_getFactory( const sal_Char* sImplementationName, void* _pServiceManager, void* _pRegistryKey ) +TOOLKIT_DLLPUBLIC void* SAL_CALL tk_component_getFactory( const sal_Char* sImplementationName, void* _pServiceManager, void* _pRegistryKey ) { void* pRet = NULL; diff --git a/toolkit/util/tk.component b/toolkit/util/tk.component index 4d4713e87c45..f6638794de12 100644 --- a/toolkit/util/tk.component +++ b/toolkit/util/tk.component @@ -26,7 +26,7 @@ * **********************************************************************--> - diff --git a/unotools/source/ucbhelper/xtempfile.cxx b/unotools/source/ucbhelper/xtempfile.cxx index 7883a3e85cb2..d73981670d5d 100644 --- a/unotools/source/ucbhelper/xtempfile.cxx +++ b/unotools/source/ucbhelper/xtempfile.cxx @@ -486,7 +486,7 @@ throw ( ::css::uno::RuntimeException ) // C functions to implement this as a component -extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( +extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL utl_component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; @@ -499,7 +499,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnviron * @param pRegistryKey registry data key to read and write component persistent data * @return a component factory (generic uno interface) */ -extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( +extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL utl_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) { void * pRet = 0; diff --git a/unotools/util/utl.component b/unotools/util/utl.component index 8c8198741f55..ab4b67b61da4 100644 --- a/unotools/util/utl.component +++ b/unotools/util/utl.component @@ -26,7 +26,7 @@ * **********************************************************************--> - diff --git a/vcl/source/components/factory.cxx b/vcl/source/components/factory.cxx index 04b0e122cbce..f4665832a9a8 100644 --- a/vcl/source/components/factory.cxx +++ b/vcl/source/components/factory.cxx @@ -83,14 +83,14 @@ namespace rsvg extern "C" { - VCL_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment( + VCL_DLLPUBLIC void SAL_CALL vcl_component_getImplementationEnvironment( const sal_Char** ppEnvTypeName, uno_Environment** /*ppEnv*/ ) { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } - VCL_DLLPUBLIC void* SAL_CALL component_getFactory( + VCL_DLLPUBLIC void* SAL_CALL vcl_component_getFactory( const sal_Char* pImplementationName, void* pXUnoSMgr, void* /*pXUnoKey*/ diff --git a/vcl/vcl.macosx.component b/vcl/vcl.macosx.component index 023f805672bd..a4f551c63a79 100644 --- a/vcl/vcl.macosx.component +++ b/vcl/vcl.macosx.component @@ -26,7 +26,7 @@ * **********************************************************************--> - diff --git a/vcl/vcl.unx.component b/vcl/vcl.unx.component index ea14667d17c1..c58bb8fa3c47 100644 --- a/vcl/vcl.unx.component +++ b/vcl/vcl.unx.component @@ -26,7 +26,7 @@ * **********************************************************************--> - diff --git a/vcl/vcl.windows.component b/vcl/vcl.windows.component index df786c4d832b..5dd80ebe0029 100644 --- a/vcl/vcl.windows.component +++ b/vcl/vcl.windows.component @@ -26,7 +26,7 @@ * **********************************************************************--> - -- cgit v1.2.3 From 74ce447f370de298f88e0907c4283ee941c69505 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sun, 26 Jun 2011 00:54:31 +0300 Subject: Include also for Android --- vcl/inc/unx/saldata.hxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'vcl') diff --git a/vcl/inc/unx/saldata.hxx b/vcl/inc/unx/saldata.hxx index 7bce61cc9ce7..825c148cfa1f 100644 --- a/vcl/inc/unx/saldata.hxx +++ b/vcl/inc/unx/saldata.hxx @@ -46,7 +46,8 @@ class SalPrinter; // -=-= typedefs -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= #if defined LINUX || defined NETBSD || defined AIX || \ - defined FREEBSD || defined OPENBSD || defined DRAGONFLY + defined FREEBSD || defined OPENBSD || defined DRAGONFLY || \ + defined ANDROID #include #else typedef unsigned int pthread_t; -- cgit v1.2.3 From 27ba00f563353033369ad325b5cb45a3fafa9749 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Mon, 27 Jun 2011 17:34:15 +0200 Subject: do not set minimal size for fullscreen windows - otherwise they cannot shrink when downsizing resolution of the screen --- vcl/unx/gtk/window/gtkframe.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'vcl') diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index 089a67344271..faa8a719b331 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -1431,7 +1431,7 @@ void GtkSalFrame::setMinMaxSize() int aHints = 0; if( m_nStyle & SAL_FRAME_STYLE_SIZEABLE ) { - if( m_aMinSize.Width() && m_aMinSize.Height() ) + if( m_aMinSize.Width() && m_aMinSize.Height() && ! m_bFullscreen ) { aGeo.min_width = m_aMinSize.Width()+CONTAINER_ADJUSTMENT; aGeo.min_height = m_aMinSize.Height()+CONTAINER_ADJUSTMENT; @@ -1446,11 +1446,12 @@ void GtkSalFrame::setMinMaxSize() } else { - aGeo.min_width = maGeometry.nWidth; - aGeo.min_height = maGeometry.nHeight; - aHints |= GDK_HINT_MIN_SIZE; if( ! m_bFullscreen ) { + aGeo.min_width = maGeometry.nWidth; + aGeo.min_height = maGeometry.nHeight; + aHints |= GDK_HINT_MIN_SIZE; + aGeo.max_width = maGeometry.nWidth; aGeo.max_height = maGeometry.nHeight; aHints |= GDK_HINT_MAX_SIZE; -- cgit v1.2.3 From 7fe95cc52cf08b9351bd9af0a0a99941e4795233 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 29 Jun 2011 09:02:15 +0100 Subject: remove deprecated ByteString::CreateFromInt64 --- l10ntools/source/export.cxx | 6 +- svtools/bmpmaker/bmpsum.cxx | 2 +- svtools/source/svhtml/htmlout.cxx | 2 +- tools/source/ref/pstm.cxx | 12 +-- tools/source/stream/strmunx.cxx | 25 +++--- vcl/unx/generic/fontmanager/fontcache.cxx | 121 +++++++++++++++--------------- 6 files changed, 89 insertions(+), 79 deletions(-) (limited to 'vcl') diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx index 69f1e967b13c..6d08da4144f7 100644 --- a/l10ntools/source/export.cxx +++ b/l10ntools/source/export.cxx @@ -1268,7 +1268,7 @@ sal_Bool Export::WriteData( ResData *pResData, sal_Bool bCreateNew ) sOutput += sLID; sOutput += "\t"; sOutput += pResData->sHelpId; sOutput += "\t"; sOutput += pResData->sPForm; sOutput += "\t"; - sOutput += ByteString::CreateFromInt64( pResData->nWidth ); sOutput += "\t"; + sOutput += ByteString(rtl::OString::valueOf(static_cast(pResData->nWidth))); sOutput += "\t"; sOutput += sCur; sOutput += "\t"; @@ -1369,7 +1369,7 @@ sal_Bool Export::WriteExportList( ResData *pResData, ExportList *pExportList, // ByteString a("Export::WriteExportList::pEntry"); // Export::DumpMap( a, *pEntry ); - ByteString sLID( ByteString::CreateFromInt64( i + 1 )); + ByteString sLID(rtl::OString::valueOf(static_cast(i + 1))); for( unsigned int n = 0; n < aLanguages.size(); n++ ){ sCur = aLanguages[ n ]; if ( (*pEntry)[ SOURCE_LANGUAGE ].Len() ) @@ -1520,7 +1520,7 @@ void Export::InsertListEntry( const ByteString &rText, const ByteString &rLine ) a.Append( "." ); a.Append( pResData->sId ); sal_Int64 x = nListIndex+1; - ByteString b( ByteString::CreateFromInt64( x ) ); + ByteString b(rtl::OString::valueOf(x)); ByteString sKey = MergeDataFile::CreateKey( sPlist , a , b , sFilename ); pResData->addFallbackData( sKey , rText ); } diff --git a/svtools/bmpmaker/bmpsum.cxx b/svtools/bmpmaker/bmpsum.cxx index 8d7d34240d94..215329aa41ff 100644 --- a/svtools/bmpmaker/bmpsum.cxx +++ b/svtools/bmpmaker/bmpsum.cxx @@ -411,7 +411,7 @@ void BmpSum::ProcessFileList( const String& rInFileList, // write new entries for( sal_uInt32 i = 0; i < aFileNameVector.size(); ++i ) { - ByteString aStr( ByteString::CreateFromInt64( aPair.first ) ); + ByteString aStr(rtl::OString::valueOf(static_cast(aPair.first))); ByteString aFileName( aFileNameVector[ i ] ); DirEntry aSrcFile( aFileName ); diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx index 31e60e1ab1a1..b1b428d8fd3b 100644 --- a/svtools/source/svhtml/htmlout.cxx +++ b/svtools/source/svhtml/htmlout.cxx @@ -485,7 +485,7 @@ void lcl_ConvertCharToHTML( sal_Unicode c, ByteString& rDest, rDest += *pBuffer++; (((rDest += '&') += '#') += - ByteString::CreateFromInt64( (sal_uInt32)c )) += ';'; + ByteString(rtl::OString::valueOf(static_cast(c)))) += ';'; if( pNonConvertableChars && STRING_NOTFOUND == pNonConvertableChars->Search( c ) ) pNonConvertableChars->Append( c ); diff --git a/tools/source/ref/pstm.cxx b/tools/source/ref/pstm.cxx index 75781b427c89..0507048ad12c 100644 --- a/tools/source/ref/pstm.cxx +++ b/tools/source/ref/pstm.cxx @@ -31,6 +31,7 @@ #include #include +#include #define STOR_NO_OPTIMIZE @@ -152,11 +153,12 @@ SvPersistStream& operator >> ( SvPersistStream & rStm, #ifdef DBG_UTIL if( nObjLen + nObjPos != rStm.Tell() ) { - ByteString aStr( "false list len: read = " ); - aStr += ByteString::CreateFromInt32( (long)(rStm.Tell() - nObjPos) ); - aStr += ", should = "; - aStr += ByteString::CreateFromInt64(nObjLen); - OSL_FAIL( aStr.GetBuffer() ); + rtl::OStringBuffer aStr( + RTL_CONSTASCII_STRINGPARAM("false list len: read = ")); + aStr.append(static_cast(rStm.Tell() - nObjPos)); + aStr.append(RTL_CONSTASCII_STRINGPARAM(", should = ")); + aStr.append(static_cast(nObjLen)); + OSL_FAIL(aStr.getStr()); } #else (void)nObjLen; diff --git a/tools/source/stream/strmunx.cxx b/tools/source/stream/strmunx.cxx index d9d177ce9658..9c84eeae54f8 100644 --- a/tools/source/stream/strmunx.cxx +++ b/tools/source/stream/strmunx.cxx @@ -48,6 +48,7 @@ // class FileBase #include #include +#include using namespace osl; @@ -355,11 +356,13 @@ sal_uInt16 SvFileStream::IsA() const sal_Size SvFileStream::GetData( void* pData, sal_Size nSize ) { #ifdef DBG_UTIL - ByteString aTraceStr( "SvFileStream::GetData(): " ); - aTraceStr += ByteString::CreateFromInt64(nSize); - aTraceStr += " Bytes from "; - aTraceStr += ByteString(aFilename, osl_getThreadTextEncoding()); - OSL_TRACE( "%s", aTraceStr.GetBuffer() ); + rtl::OStringBuffer aTraceStr( + RTL_CONSTASCII_STRINGPARAM("SvFileStream::GetData(): ")); + aTraceStr.append(static_cast(nSize)); + aTraceStr.append(RTL_CONSTASCII_STRINGPARAM(" Bytes from ")); + aTraceStr.append(rtl::OUStringToOString(aFilename, + osl_getThreadTextEncoding())); + OSL_TRACE("%s", aTraceStr.getStr()); #endif int nRead = 0; @@ -381,11 +384,13 @@ sal_Size SvFileStream::GetData( void* pData, sal_Size nSize ) sal_Size SvFileStream::PutData( const void* pData, sal_Size nSize ) { #ifdef DBG_UTIL - ByteString aTraceStr( "SvFileStrean::PutData: " ); - aTraceStr += ByteString::CreateFromInt64(nSize); - aTraceStr += " Bytes to "; - aTraceStr += ByteString(aFilename, osl_getThreadTextEncoding()); - OSL_TRACE( "%s", aTraceStr.GetBuffer() ); + rtl::OStringBuffer aTraceStr( + RTL_CONSTASCII_STRINGPARAM("SvFileStream::PutData(): ")); + aTraceStr.append(static_cast(nSize)); + aTraceStr.append(RTL_CONSTASCII_STRINGPARAM(" Bytes to ")); + aTraceStr.append(rtl::OUStringToOString(aFilename, + osl_getThreadTextEncoding())); + OSL_TRACE("%s", aTraceStr.getStr()); #endif int nWrite = 0; diff --git a/vcl/unx/generic/fontmanager/fontcache.cxx b/vcl/unx/generic/fontmanager/fontcache.cxx index e7a4008f07f0..e47c95ec07ca 100644 --- a/vcl/unx/generic/fontmanager/fontcache.cxx +++ b/vcl/unx/generic/fontmanager/fontcache.cxx @@ -40,6 +40,8 @@ #include "tools/stream.hxx" +#include + #include #include @@ -132,13 +134,14 @@ void FontCache::flush() const FontDirMap& rDir( dir_it->second.m_aEntries ); ByteString aDirectory( rManager.getDirectory( dir_it->first ) ); - ByteString aLine( "FontCacheDirectory:" ); - aLine.Append( ByteString::CreateFromInt64( dir_it->second.m_nTimestamp ) ); - aLine.Append( ':' ); - aLine.Append( aDirectory ); + rtl::OStringBuffer aLine( + RTL_CONSTASCII_STRINGPARAM("FontCacheDirectory:")); + aLine.append(dir_it->second.m_nTimestamp); + aLine.append(':'); + aLine.append(aDirectory); if( rDir.empty() && dir_it->second.m_bNoFiles ) - aLine.Insert( "Empty", 0 ); - aStream.WriteLine( aLine ); + aLine.insert(0, RTL_CONSTASCII_STRINGPARAM("Empty")); + aStream.WriteLine(ByteString(aLine.makeStringAndClear())); for( FontDirMap::const_iterator entry_it = rDir.begin(); entry_it != rDir.end(); ++entry_it ) { @@ -147,16 +150,16 @@ void FontCache::flush() if( rEntry.begin() == rEntry.end() ) continue; - aLine = "File:"; - aLine.Append( ByteString( entry_it->first ) ); - aStream.WriteLine( aLine ); + aLine.append(RTL_CONSTASCII_STRINGPARAM("File:")); + aLine.append(entry_it->first); + aStream.WriteLine(ByteString(aLine.makeStringAndClear())); int nEntrySize = entry_it->second.m_aEntry.size(); // write: type;nfonts - aLine = ByteString::CreateFromInt32( rEntry.front()->m_eType ); - aLine.Append( ';' ); - aLine.Append( ByteString::CreateFromInt32( nEntrySize ) ); - aStream.WriteLine( aLine ); + aLine.append(static_cast(rEntry.front()->m_eType)); + aLine.append(';'); + aLine.append(static_cast(nEntrySize)); + aStream.WriteLine(ByteString(aLine.makeStringAndClear())); sal_Int32 nSubEntry = 0; for( FontCacheEntry::const_iterator it = rEntry.begin(); it != rEntry.end(); ++it, nSubEntry++ ) @@ -171,73 +174,73 @@ void FontCache::flush() else nSubEntry = -1; - aLine = OUStringToOString( pAtoms->getString( ATOM_FAMILYNAME, (*it)->m_nFamilyName ), RTL_TEXTENCODING_UTF8 ); + aLine.append(OUStringToOString(pAtoms->getString( ATOM_FAMILYNAME, (*it)->m_nFamilyName), RTL_TEXTENCODING_UTF8)); for( ::std::list< int >::const_iterator name_it = (*it)->m_aAliases.begin(); name_it != (*it)->m_aAliases.end(); ++name_it ) { const OUString& rAdd( pAtoms->getString( ATOM_FAMILYNAME, *name_it ) ); if( rAdd.getLength() ) { - aLine.Append( ';' ); - aLine.Append( ByteString( String( rAdd ), RTL_TEXTENCODING_UTF8 ) ); + aLine.append(';'); + aLine.append(OUStringToOString(rAdd, RTL_TEXTENCODING_UTF8)); } } - aStream.WriteLine( aLine ); + aStream.WriteLine(ByteString(aLine.makeStringAndClear())); const OUString& rPSName( pAtoms->getString( ATOM_PSNAME, (*it)->m_nPSName ) ); - aLine = ByteString::CreateFromInt32( nSubEntry ); - aLine.Append( ';' ); - aLine.Append( ByteString( String( rPSName ), RTL_TEXTENCODING_UTF8 ) ); - aLine.Append( ';' ); - aLine.Append( ByteString::CreateFromInt32( (*it)->m_eItalic ) ); - aLine.Append( ';' ); - aLine.Append( ByteString::CreateFromInt32( (*it)->m_eWeight ) ); - aLine.Append( ';' ); - aLine.Append( ByteString::CreateFromInt32( (*it)->m_eWidth ) ); - aLine.Append( ';' ); - aLine.Append( ByteString::CreateFromInt32( (*it)->m_ePitch ) ); - aLine.Append( ';' ); - aLine.Append( ByteString::CreateFromInt32( (*it)->m_aEncoding ) ); - aLine.Append( ';' ); - aLine.Append( ByteString::CreateFromInt32( (*it)->m_nAscend ) ); - aLine.Append( ';' ); - aLine.Append( ByteString::CreateFromInt32( (*it)->m_nDescend ) ); - aLine.Append( ';' ); - aLine.Append( ByteString::CreateFromInt32( (*it)->m_nLeading ) ); - aLine.Append( ';' ); - aLine.Append( (*it)->m_bHaveVerticalSubstitutedGlyphs ? "1" : "0" ); - aLine.Append( ';' ); - aLine.Append( ByteString::CreateFromInt32( (*it)->m_aGlobalMetricX.width ) ); - aLine.Append( ';' ); - aLine.Append( ByteString::CreateFromInt32( (*it)->m_aGlobalMetricX.height ) ); - aLine.Append( ';' ); - aLine.Append( ByteString::CreateFromInt32( (*it)->m_aGlobalMetricY.width ) ); - aLine.Append( ';' ); - aLine.Append( ByteString::CreateFromInt32( (*it)->m_aGlobalMetricY.height ) ); - aLine.Append( ';' ); - aLine.Append( (*it)->m_bUserOverride ? "1" : "0" ); - aLine.Append( ';' ); - aLine.Append( ByteString::CreateFromInt32( 0 ) ); - aLine.Append( ';' ); - aLine.Append( ByteString::CreateFromInt32( 0 ) ); + aLine.append(nSubEntry); + aLine.append(';'); + aLine.append(OUStringToOString(rPSName, RTL_TEXTENCODING_UTF8)); + aLine.append(';'); + aLine.append(static_cast((*it)->m_eItalic)); + aLine.append(';'); + aLine.append(static_cast((*it)->m_eWeight)); + aLine.append(';'); + aLine.append(static_cast((*it)->m_eWidth)); + aLine.append(';'); + aLine.append(static_cast((*it)->m_ePitch)); + aLine.append(';'); + aLine.append(static_cast((*it)->m_aEncoding)); + aLine.append(';'); + aLine.append(static_cast((*it)->m_nAscend)); + aLine.append(';'); + aLine.append(static_cast((*it)->m_nDescend)); + aLine.append(';'); + aLine.append(static_cast((*it)->m_nLeading)); + aLine.append(';'); + aLine.append((*it)->m_bHaveVerticalSubstitutedGlyphs ? '1' : '0'); + aLine.append(';'); + aLine.append(static_cast((*it)->m_aGlobalMetricX.width )); + aLine.append(';'); + aLine.append(static_cast((*it)->m_aGlobalMetricX.height)); + aLine.append(';'); + aLine.append(static_cast((*it)->m_aGlobalMetricY.width )); + aLine.append(';'); + aLine.append(static_cast((*it)->m_aGlobalMetricY.height)); + aLine.append(';'); + aLine.append((*it)->m_bUserOverride ? '1' : '0'); + aLine.append(';'); + aLine.append(static_cast(0)); + aLine.append(';'); + aLine.append(static_cast(0)); switch( (*it)->m_eType ) { case fonttype::Type1: - aLine.Append( ';' ); - aLine.Append( ByteString( static_cast(*it)->m_aMetricFile ) ); + aLine.append(';'); + aLine.append(static_cast(*it)->m_aMetricFile); break; case fonttype::TrueType: - aLine.Append( ';' ); - aLine.Append( ByteString::CreateFromInt32( static_cast(*it)->m_nTypeFlags ) ); + aLine.append(';'); + aLine.append(static_cast(static_cast(*it)->m_nTypeFlags)); break; default: break; } if( (*it)->m_aStyleName.getLength() ) { - aLine.Append( ';' ); - aLine.Append( ByteString( String( (*it)->m_aStyleName ), RTL_TEXTENCODING_UTF8 ) ); + aLine.append(';'); + aLine.append(OUStringToOString((*it)->m_aStyleName, RTL_TEXTENCODING_UTF8)); } - aStream.WriteLine( aLine ); + aStream.WriteLine(ByteString(aLine.makeStringAndClear())); } aStream.WriteLine( ByteString() ); } -- cgit v1.2.3 From 9e1dfa577973ba8bbe71159e76b1e7925c23f32a Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 29 Jun 2011 10:24:43 +0100 Subject: Related: fdo#38704 make simpleMapNativeRoleFrom::accessibleContext safer --- vcl/aqua/source/a11y/aqua11yrolehelper.mm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'vcl') diff --git a/vcl/aqua/source/a11y/aqua11yrolehelper.mm b/vcl/aqua/source/a11y/aqua11yrolehelper.mm index cfc052e96beb..9e6536da98bd 100644 --- a/vcl/aqua/source/a11y/aqua11yrolehelper.mm +++ b/vcl/aqua/source/a11y/aqua11yrolehelper.mm @@ -42,6 +42,10 @@ using namespace ::com::sun::star::uno; +(id)simpleMapNativeRoleFrom: (XAccessibleContext *) accessibleContext { id nativeRole = nil; + + if (accessibleContext == NULL) + return nativeRole; + switch( accessibleContext -> getAccessibleRole() ) { #define MAP(a,b) \ case a: nativeRole = b; break -- cgit v1.2.3 From 1e409eadc59ac9164b1af01a821ea26c1167cdb2 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 29 Jun 2011 16:22:09 +0100 Subject: make cairo an unconditional requirement for text rendering --- canvas/prj/build.lst | 2 +- canvas/source/cairo/makefile.mk | 6 - vcl/Library_vcl.mk | 6 - vcl/Library_vclplug_gen.mk | 16 +++ vcl/aqua/source/gdi/salbmp.cxx | 2 - vcl/prj/build.lst | 2 +- vcl/unx/generic/gdi/salgdi3.cxx | 256 ++++++---------------------------------- 7 files changed, 51 insertions(+), 239 deletions(-) (limited to 'vcl') diff --git a/canvas/prj/build.lst b/canvas/prj/build.lst index dad6e28c0ea5..4719f157dfca 100644 --- a/canvas/prj/build.lst +++ b/canvas/prj/build.lst @@ -4,7 +4,7 @@ cv canvas\inc nmake - all cv_inc NULL cv canvas\source\tools nmake - all cv_tools cv_inc NULL cv canvas\source\vcl nmake - all cv_vcl cv_tools cv_inc NULL cv canvas\source\simplecanvas nmake - all cv_simplecanvas cv_tools cv_inc NULL -cv canvas\source\cairo nmake - all cv_cairo cv_tools cv_inc NULL +cv canvas\source\cairo nmake - u cv_cairo cv_tools cv_inc NULL cv canvas\source\directx nmake - w cv_directx cv_tools cv_inc NULL cv canvas\source\null nmake - all cv_null cv_tools cv_inc NULL cv canvas\source\factory nmake - all cv_factory cv_inc NULL diff --git a/canvas/source/cairo/makefile.mk b/canvas/source/cairo/makefile.mk index bde5fac59a2e..3be1d52e6c3b 100644 --- a/canvas/source/cairo/makefile.mk +++ b/canvas/source/cairo/makefile.mk @@ -37,17 +37,11 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk DLLPRE = -# --- Nothing to do if we're compiling with --disable-cairo ----------- -.IF "$(ENABLE_CAIRO)" != "TRUE" -@all: - @echo "Building without cairo support..." -.ELSE # --- X11 Mac build currently doesn't work with cairo ----------- .IF "$(OS)" == "MACOSX" && "$(GUIBASE)" == "unx" @all: @echo "Cannot build cairocanvas with X11..." .ENDIF -.ENDIF # --- Common ---------------------------------------------------------- diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 8811bda29661..e012d7129452 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -90,12 +90,6 @@ $(eval $(call gb_Library_set_cxxflags,vcl,\ $$(CXXFLAGS) \ $$(OBJCXXFLAGS) \ )) -ifeq ($(ENABLE_CAIRO),TRUE) -$(eval $(call gb_Library_set_defs,vclplug_gen,\ - $$(DEFS) \ - -DCAIRO \ -)) -endif $(eval $(call gb_Library_add_objcxxobjects,vcl,\ vcl/aqua/source/a11y/aqua11yactionwrapper \ vcl/aqua/source/a11y/aqua11ycomponentwrapper \ diff --git a/vcl/Library_vclplug_gen.mk b/vcl/Library_vclplug_gen.mk index b5cca31d365f..783d56b61f65 100644 --- a/vcl/Library_vclplug_gen.mk +++ b/vcl/Library_vclplug_gen.mk @@ -64,6 +64,17 @@ $(eval $(call gb_Library_add_linked_libs,vclplug_gen,\ $(gb_STDLIBS) \ )) +ifeq ($(SYSTEM_CAIRO),YES) +$(eval $(call gb_Library_set_ldflags,vclplug_gen,\ + $$(LDFLAGS) \ + $$(CAIRO_LIBS) \ +)) +else +$(eval $(call gb_Library_add_linked_libs,vclplug_gen,\ + cairo \ +)) +endif + $(eval $(call gb_Library_add_exception_objects,vclplug_gen,\ vcl/unx/generic/app/i18n_cb \ vcl/unx/generic/app/i18n_ic \ @@ -119,6 +130,11 @@ $(eval $(call gb_Library_set_defs,vclplug_gen,\ -DVCLPLUG_GEN_IMPLEMENTATION \ )) +## unconditional cairo +$(eval $(call gb_Library_set_cxxflags,vclplug_gen,\ + $$(CXXFLAGS) \ + $$(CAIRO_CFLAGS) \ +)) ## handle RandR ifneq ($(ENABLE_RANDR),) diff --git a/vcl/aqua/source/gdi/salbmp.cxx b/vcl/aqua/source/gdi/salbmp.cxx index bfb15f0a8076..6afad341e5b0 100644 --- a/vcl/aqua/source/gdi/salbmp.cxx +++ b/vcl/aqua/source/gdi/salbmp.cxx @@ -871,7 +871,6 @@ bool AquaSalBitmap::GetSystemData( BitmapSystemData& rData ) { bRet = true; -#ifdef CAIRO if ((CGBitmapContextGetBitsPerPixel(mxGraphicContext) == 32) && (CGBitmapContextGetBitmapInfo(mxGraphicContext) & kCGBitmapByteOrderMask) != kCGBitmapByteOrder32Host) { /** @@ -904,7 +903,6 @@ bool AquaSalBitmap::GetSystemData( BitmapSystemData& rData ) CGImageRelease( xImage ); mxGraphicContext = mxGraphicContextNew; } -#endif rData.rImageContext = (void *) mxGraphicContext; rData.mnWidth = mnWidth; diff --git a/vcl/prj/build.lst b/vcl/prj/build.lst index 646a45563dde..4b0ece6b1d46 100644 --- a/vcl/prj/build.lst +++ b/vcl/prj/build.lst @@ -1,4 +1,4 @@ -vc vcl : TRANSLATIONS:translations apple_remote BOOST:boost DESKTOP:rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offapi basegfx basebmp tools DESKTOP:l10ntools icc cpputools svl LIBXSLT:libxslt NULL +vc vcl : TRANSLATIONS:translations apple_remote BOOST:boost DESKTOP:rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offapi basegfx basebmp tools DESKTOP:l10ntools icc cpputools svl LIBXSLT:libxslt CAIRO:cairo NULL vc vcl usr1 - all vc_mkout NULL vc vcl\prj nmake - all vc_prj NULL diff --git a/vcl/unx/generic/gdi/salgdi3.cxx b/vcl/unx/generic/gdi/salgdi3.cxx index 67874ff2c7d2..17240c90080a 100644 --- a/vcl/unx/generic/gdi/salgdi3.cxx +++ b/vcl/unx/generic/gdi/salgdi3.cxx @@ -78,28 +78,15 @@ #include "salframe.hxx" #include "outdev.h" - - #ifdef ENABLE_GRAPHITE #include #include #endif -struct cairo_surface_t; -struct cairo_t; -struct cairo_font_face_t; -typedef void* FT_Face; -struct cairo_matrix_t { - double xx; double yx; - double xy; double yy; - double x0; double y0; -}; -struct cairo_glyph_t -{ - unsigned long index; - double x; - double y; -}; +#include +#include +#include + struct BOX { short x1, x2, y1, y2; @@ -249,183 +236,12 @@ void ImplServerFontEntry::HandleFontOptions( void ) //-------------------------------------------------------------------------- -namespace { - -class CairoWrapper +namespace { -private: - osl::Module mpCairoLib; - - cairo_surface_t* (*mp_xlib_surface_create_with_xrender_format)(Display *, Drawable , Screen *, XRenderPictFormat *, int , int ); - void (*mp_surface_destroy)(cairo_surface_t *); - cairo_t* (*mp_create)(cairo_surface_t *); - void (*mp_destroy)(cairo_t*); - void (*mp_clip)(cairo_t*); - void (*mp_rectangle)(cairo_t*, double, double, double, double); - cairo_font_face_t * (*mp_ft_font_face_create_for_ft_face)(FT_Face, int); - cairo_font_face_t * (*mp_ft_font_face_create_for_pattern)(void*); - void (*mp_set_font_face)(cairo_t *, cairo_font_face_t *); - void (*mp_font_face_destroy)(cairo_font_face_t *); - void (*mp_matrix_init_identity)(cairo_matrix_t *); - void (*mp_matrix_scale)(cairo_matrix_t *, double, double); - void (*mp_matrix_rotate)(cairo_matrix_t *, double); - void (*mp_set_font_matrix)(cairo_t *, const cairo_matrix_t *); - void (*mp_show_glyphs)(cairo_t *, const cairo_glyph_t *, int ); - void (*mp_set_source_rgb)(cairo_t *, double , double , double ); - void (*mp_set_font_options)(cairo_t *, const void *); - void (*mp_ft_font_options_substitute)(const void*, void*); - - bool canEmbolden() const { return mp_ft_font_face_create_for_pattern != NULL; } - - CairoWrapper(); -public: - static CairoWrapper& get(); - bool isValid() const { return (mpCairoLib != NULL); } - bool isCairoRenderable(const ServerFont& rFont); - - cairo_surface_t* xlib_surface_create_with_xrender_format(Display *pDisplay, Drawable drawable, Screen *pScreen, XRenderPictFormat *pFormat, int width, int height) - { return (*mp_xlib_surface_create_with_xrender_format)(pDisplay, drawable, pScreen, pFormat, width, height); } - void surface_destroy(cairo_surface_t *surface) { (*mp_surface_destroy)(surface); } - cairo_t* create(cairo_surface_t *surface) { return (*mp_create)(surface); } - void destroy(cairo_t *cr) { (*mp_destroy)(cr); } - void clip(cairo_t *cr) { (*mp_clip)(cr); } - void rectangle(cairo_t *cr, double x, double y, double width, double height) - { (*mp_rectangle)(cr, x, y, width, height); } - cairo_font_face_t* ft_font_face_create_for_ft_face(FT_Face face, int load_flags) - { return (*mp_ft_font_face_create_for_ft_face)(face, load_flags); } - cairo_font_face_t* ft_font_face_create_for_pattern(void *pattern) + bool isCairoRenderable(const ServerFont& rFont) { - return mp_ft_font_face_create_for_pattern - ? (*mp_ft_font_face_create_for_pattern)(pattern) - : NULL; + return rFont.GetFtFace() && rFont.GetAntialiasAdvice(); } - void set_font_face(cairo_t *cr, cairo_font_face_t *font_face) - { (*mp_set_font_face)(cr, font_face); } - void font_face_destroy(cairo_font_face_t *font_face) - { (*mp_font_face_destroy)(font_face); } - void matrix_init_identity(cairo_matrix_t *matrix) - { (*mp_matrix_init_identity)(matrix); } - void matrix_scale(cairo_matrix_t *matrix, double sx, double sy) - { (*mp_matrix_scale)(matrix, sx, sy); } - void matrix_rotate(cairo_matrix_t *matrix, double radians) - { (*mp_matrix_rotate)(matrix, radians); } - void set_font_matrix(cairo_t *cr, const cairo_matrix_t *matrix) - { (*mp_set_font_matrix)(cr, matrix); } - void show_glyphs(cairo_t *cr, const cairo_glyph_t *glyphs, int no_glyphs) - { (*mp_show_glyphs)(cr, glyphs, no_glyphs); } - void set_source_rgb(cairo_t *cr, double red, double green, double blue) - { (*mp_set_source_rgb)(cr, red, green, blue); } - void set_font_options(cairo_t *cr, const void *options) - { (*mp_set_font_options)(cr, options); } - void ft_font_options_substitute(const void *options, void *pattern) - { (*mp_ft_font_options_substitute)(options, pattern); } -}; - -static CairoWrapper* pCairoInstance = NULL; - -CairoWrapper& CairoWrapper::get() -{ - if( ! pCairoInstance ) - pCairoInstance = new CairoWrapper(); - return *pCairoInstance; -} - -CairoWrapper::CairoWrapper() -{ - static const char* pDisableCairoText = getenv( "SAL_DISABLE_CAIROTEXT" ); - if( pDisableCairoText && (pDisableCairoText[0] != '0') ) - return; - - int nDummy; - if( !XQueryExtension( GetX11SalData()->GetDisplay()->GetDisplay(), "RENDER", &nDummy, &nDummy, &nDummy ) ) - return; - -#ifdef MACOSX - OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( "libcairo.2.dylib" )); -#else - OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( "libcairo.so.2" )); -#endif - if ( !mpCairoLib.load( aLibName, SAL_LOADMODULE_DEFAULT ) ) - return; - -#ifdef DEBUG - // check cairo version - int (*p_version)(); - p_version = (int(*)()) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_version" ); - const int nVersion = p_version ? (*p_version)() : 0; - fprintf( stderr, "CAIRO version=%d\n", nVersion ); -#endif - - mp_xlib_surface_create_with_xrender_format = (cairo_surface_t* (*)(Display *, Drawable , Screen *, XRenderPictFormat *, int , int )) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_xlib_surface_create_with_xrender_format" ); - mp_surface_destroy = (void(*)(cairo_surface_t*)) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_surface_destroy" ); - mp_create = (cairo_t*(*)(cairo_surface_t*)) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_create" ); - mp_destroy = (void(*)(cairo_t*)) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_destroy" ); - mp_clip = (void(*)(cairo_t*)) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_clip" ); - mp_rectangle = (void(*)(cairo_t*, double, double, double, double)) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_rectangle" ); - mp_ft_font_face_create_for_ft_face = (cairo_font_face_t * (*)(FT_Face, int)) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_ft_font_face_create_for_ft_face" ); - mp_ft_font_face_create_for_pattern = (cairo_font_face_t * (*)(void*)) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_ft_font_face_create_for_pattern" ); - mp_set_font_face = (void (*)(cairo_t *, cairo_font_face_t *)) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_set_font_face" ); - mp_font_face_destroy = (void (*)(cairo_font_face_t *)) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_font_face_destroy" ); - mp_matrix_init_identity = (void (*)(cairo_matrix_t *)) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_matrix_init_identity" ); - mp_matrix_scale = (void (*)(cairo_matrix_t *, double, double)) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_matrix_scale" ); - mp_matrix_rotate = (void (*)(cairo_matrix_t *, double)) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_matrix_rotate" ); - mp_set_font_matrix = (void (*)(cairo_t *, const cairo_matrix_t *)) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_set_font_matrix" ); - mp_show_glyphs = (void (*)(cairo_t *, const cairo_glyph_t *, int )) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_show_glyphs" ); - mp_set_source_rgb = (void (*)(cairo_t *, double , double , double )) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_set_source_rgb" ); - mp_set_font_options = (void (*)(cairo_t *, const void *options )) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_set_font_options" ); - mp_ft_font_options_substitute = (void (*)(const void *, void *)) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_ft_font_options_substitute" ); - - if( !( - mp_xlib_surface_create_with_xrender_format && - mp_surface_destroy && - mp_create && - mp_destroy && - mp_clip && - mp_rectangle && - mp_ft_font_face_create_for_ft_face && - mp_set_font_face && - mp_font_face_destroy && - mp_matrix_init_identity && - mp_matrix_scale && - mp_matrix_rotate && - mp_set_font_matrix && - mp_show_glyphs && - mp_set_source_rgb && - mp_set_font_options && - mp_ft_font_options_substitute - ) ) - { - mpCairoLib.unload(); -#if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "not all needed symbols were found\n" ); -#endif - } -} - -bool CairoWrapper::isCairoRenderable(const ServerFont& rFont) -{ - return rFont.GetFtFace() && isValid() && rFont.GetAntialiasAdvice() && - (rFont.NeedsArtificialBold() ? canEmbolden() : true); -} - } //namespace CairoFontsCache::LRUFonts CairoFontsCache::maLRUFonts; @@ -441,10 +257,9 @@ CairoFontsCache::~CairoFontsCache() --mnRefCount; if (!mnRefCount && !maLRUFonts.empty()) { - CairoWrapper &rCairo = CairoWrapper::get(); LRUFonts::iterator aEnd = maLRUFonts.end(); for (LRUFonts::iterator aI = maLRUFonts.begin(); aI != aEnd; ++aI) - rCairo.font_face_destroy((cairo_font_face_t*)aI->first); + cairo_font_face_destroy((cairo_font_face_t*)aI->first); } } @@ -453,8 +268,7 @@ void CairoFontsCache::CacheFont(void *pFont, const CairoFontsCache::CacheId &rId maLRUFonts.push_front( std::pair(pFont, rId) ); if (maLRUFonts.size() > 8) { - CairoWrapper &rCairo = CairoWrapper::get(); - rCairo.font_face_destroy((cairo_font_face_t*)maLRUFonts.back().first); + cairo_font_face_destroy((cairo_font_face_t*)maLRUFonts.back().first); maLRUFonts.pop_back(); } } @@ -493,11 +307,9 @@ void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout ) if( !pVisualFormat ) return; - CairoWrapper &rCairo = CairoWrapper::get(); - Display* pDisplay = GetXDisplay(); - cairo_surface_t *surface = rCairo.xlib_surface_create_with_xrender_format (pDisplay, + cairo_surface_t *surface = cairo_xlib_surface_create_with_xrender_format (pDisplay, hDrawable_, ScreenOfDisplay(pDisplay, m_nScreen), pVisualFormat, SAL_MAX_INT16, SAL_MAX_INT16); /* @@ -506,26 +318,26 @@ void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout ) * least change the SalFrame etc impls to dtor the SalGraphics *before* the * destruction of the windows they reference */ - cairo_t *cr = rCairo.create(surface); - rCairo.surface_destroy(surface); + cairo_t *cr = cairo_create(surface); + cairo_surface_destroy(surface); if (const void *pOptions = Application::GetSettings().GetStyleSettings().GetCairoFontOptions()) - rCairo.set_font_options( cr, pOptions); + cairo_set_font_options(cr, static_cast(pOptions)); if( mpClipRegion && !XEmptyRegion( mpClipRegion ) ) { for (long i = 0; i < mpClipRegion->numRects; ++i) { - rCairo.rectangle(cr, - mpClipRegion->rects[i].x1, - mpClipRegion->rects[i].y1, - mpClipRegion->rects[i].x2 - mpClipRegion->rects[i].x1, - mpClipRegion->rects[i].y2 - mpClipRegion->rects[i].y1); + cairo_rectangle(cr, + 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); + cairo_clip(cr); } - rCairo.set_source_rgb(cr, + cairo_set_source_rgb(cr, SALCOLOR_RED(nTextColor_)/255.0, SALCOLOR_GREEN(nTextColor_)/255.0, SALCOLOR_BLUE(nTextColor_)/255.0); @@ -545,30 +357,30 @@ void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout ) const ImplFontOptions *pOptions = rFont.GetFontOptions().get(); void *pPattern = pOptions ? pOptions->GetPattern(pFace, aId.mbEmbolden) : NULL; if (pPattern) - font_face = rCairo.ft_font_face_create_for_pattern(pPattern); + font_face = cairo_ft_font_face_create_for_pattern(reinterpret_cast(pPattern)); if (!font_face) - font_face = rCairo.ft_font_face_create_for_ft_face(pFace, rFont.GetLoadFlags()); + font_face = cairo_ft_font_face_create_for_ft_face(reinterpret_cast(pFace), rFont.GetLoadFlags()); m_aCairoFontsCache.CacheFont(font_face, aId); } - rCairo.set_font_face(cr, font_face); + cairo_set_font_face(cr, font_face); cairo_matrix_t m; const ImplFontSelectData& rFSD = rFont.GetFontSelData(); int nWidth = rFSD.mnWidth ? rFSD.mnWidth : rFSD.mnHeight; - rCairo.matrix_init_identity(&m); + cairo_matrix_init_identity(&m); if (rLayout.GetOrientation()) - rCairo.matrix_rotate(&m, (3600 - rLayout.GetOrientation()) * M_PI / 1800.0); + cairo_matrix_rotate(&m, (3600 - rLayout.GetOrientation()) * M_PI / 1800.0); - rCairo.matrix_scale(&m, nWidth, rFSD.mnHeight); + cairo_matrix_scale(&m, nWidth, rFSD.mnHeight); if (rFont.NeedsArtificialItalic()) m.xy = -m.xx * 0x6000L / 0x10000L; - rCairo.set_font_matrix(cr, &m); - rCairo.show_glyphs(cr, &cairo_glyphs[0], cairo_glyphs.size()); - rCairo.destroy(cr); + cairo_set_font_matrix(cr, &m); + cairo_show_glyphs(cr, &cairo_glyphs[0], cairo_glyphs.size()); + cairo_destroy(cr); } //-------------------------------------------------------------------------- @@ -928,7 +740,7 @@ void X11SalGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout ) ServerFont& rFont = rLayout.GetServerFont(); const bool bVertical = rFont.GetFontSelData().mbVertical; - if( !bVertical && CairoWrapper::get().isCairoRenderable(rFont) ) + if( !bVertical && isCairoRenderable(rFont) ) DrawCairoAAFontString( rLayout ); else { @@ -1087,16 +899,14 @@ void X11SalGraphics::GetDevFontSubstList( OutputDevice* ) // ---------------------------------------------------------------------------- -void cairosubcallback( void* pPattern ) +void cairosubcallback(void* pPattern) { - CairoWrapper& rCairo = CairoWrapper::get(); - if( !rCairo.isValid() ) - return; const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); const void* pFontOptions = rStyleSettings.GetCairoFontOptions(); if( !pFontOptions ) return; - rCairo.ft_font_options_substitute( pFontOptions, pPattern ); + cairo_ft_font_options_substitute(static_cast(pFontOptions), + static_cast(pPattern)); } ImplFontOptions* GetFCFontOptions( const ImplFontAttributes& rFontAttributes, int nSize) -- cgit v1.2.3 From 9302fd5dc62c4e04bc19f1e993f83baa21f14c98 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 29 Jun 2011 16:29:39 +0100 Subject: dead pre-gbuild makefile.mks --- vcl/source/components/makefile.mk | 55 ----- vcl/source/gdi/makefile.mk | 127 ----------- vcl/util/makefile.mk | 465 -------------------------------------- 3 files changed, 647 deletions(-) delete mode 100644 vcl/source/components/makefile.mk delete mode 100755 vcl/source/gdi/makefile.mk delete mode 100755 vcl/util/makefile.mk (limited to 'vcl') diff --git a/vcl/source/components/makefile.mk b/vcl/source/components/makefile.mk deleted file mode 100644 index 41f21bfa3749..000000000000 --- a/vcl/source/components/makefile.mk +++ /dev/null @@ -1,55 +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. -# -#************************************************************************* - -PRJ=..$/.. - -PRJNAME=vcl -TARGET=components -ENABLE_EXCEPTIONS=TRUE - -# --- Settings ----------------------------------------------------- - -.INCLUDE : $(PRJ)$/util$/makefile.pmk -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/makefile2.pmk - -# --- Files -------------------------------------------------------- - -SLOFILES= $(SLO)$/display.obj \ - $(SLO)$/dtranscomp.obj \ - $(SLO)$/fontident.obj \ - $(SLO)$/stringmirror.obj \ - $(SLO)$/rasterizer_rsvg.obj \ - $(SLO)$/factory.obj - -EXCEPTIONSFILES= $(SLO)$/rasterizer_rsvg.obj - - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk -.INCLUDE : $(PRJ)$/util$/target.pmk diff --git a/vcl/source/gdi/makefile.mk b/vcl/source/gdi/makefile.mk deleted file mode 100755 index e124dc343eba..000000000000 --- a/vcl/source/gdi/makefile.mk +++ /dev/null @@ -1,127 +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. -# -#************************************************************************* - -PRJ=..$/.. - -PRJNAME=vcl -TARGET=gdi - -.INCLUDE : $(PRJ)$/util$/makefile.pmk - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk - -.INCLUDE : $(PRJ)$/util$/makefile2.pmk - -.IF "$(COM)"=="ICC" -CDEFS+=-D_STD_NO_NAMESPACE -D_VOS_NO_NAMESPACE -D_UNO_NO_NAMESPACE -.ENDIF -.IF "$(ENABLE_GRAPHITE)" == "TRUE" -CDEFS+=-DENABLE_GRAPHITE -.IF "$(SYSTEM_GRAPHITE)" != "YES" -CDEFS+=-DGR2_STATIC -.ENDIF -.ENDIF - -# --- Files -------------------------------------------------------- - -EXCEPTIONSFILES= $(SLO)$/salmisc.obj \ - $(SLO)$/animate.obj \ - $(SLO)$/base14.obj \ - $(SLO)$/bitmap.obj \ - $(SLO)$/bitmap2.obj \ - $(SLO)$/bitmapex.obj \ - $(SLO)$/bmpconv.obj \ - $(SLO)$/configsettings.obj \ - $(SLO)$/cvtgrf.obj \ - $(SLO)$/cvtsvm.obj \ - $(SLO)$/gdimtf.obj \ - $(SLO)$/gfxlink.obj \ - $(SLO)$/graph.obj \ - $(SLO)$/graphictools.obj \ - $(SLO)$/image.obj \ - $(SLO)$/imagerepository.obj \ - $(SLO)$/impanmvw.obj \ - $(SLO)$/impgraph.obj \ - $(SLO)$/impimage.obj \ - $(SLO)$/impimagetree.obj \ - $(SLO)$/impvect.obj \ - $(SLO)$/jobset.obj \ - $(SLO)$/lineinfo.obj \ - $(SLO)$/metaact.obj \ - $(SLO)$/metric.obj \ - $(SLO)$/oldprintadaptor.obj \ - $(SLO)$/outdev.obj \ - $(SLO)$/outdev2.obj \ - $(SLO)$/outdev3.obj \ - $(SLO)$/outdev4.obj \ - $(SLO)$/outdev5.obj \ - $(SLO)$/outdev6.obj \ - $(SLO)$/outdevnative.obj \ - $(SLO)$/outmap.obj \ - $(SLO)$/pdfextoutdevdata.obj \ - $(SLO)$/pdffontcache.obj\ - $(SLO)$/pdfwriter.obj \ - $(SLO)$/pdfwriter_impl.obj \ - $(SLO)$/pdfwriter_impl2.obj \ - $(SLO)$/pngread.obj \ - $(SLO)$/pngwrite.obj \ - $(SLO)$/print.obj \ - $(SLO)$/print2.obj \ - $(SLO)$/print3.obj \ - $(SLO)$/rendergraphic.obj \ - $(SLO)$/rendergraphicrasterizer.obj \ - $(SLO)$/salgdilayout.obj \ - $(SLO)$/sallayout.obj \ - $(SLO)$/salnativewidgets-none.obj \ - $(SLO)$/svgread.obj \ - $(SLO)$/textlayout.obj \ - $(SLO)$/virdev.obj \ - $(SLO)$/wall.obj - -SLOFILES= $(EXCEPTIONSFILES) \ - $(SLO)$/bitmap3.obj \ - $(SLO)$/bitmap4.obj \ - $(SLO)$/alpha.obj \ - $(SLO)$/bmpacc.obj \ - $(SLO)$/bmpacc2.obj \ - $(SLO)$/bmpacc3.obj \ - $(SLO)$/bmpfast.obj \ - $(SLO)$/font.obj \ - $(SLO)$/gradient.obj \ - $(SLO)$/hatch.obj \ - $(SLO)$/impbmp.obj \ - $(SLO)$/mapmod.obj \ - $(SLO)$/octree.obj \ - $(SLO)$/regband.obj \ - $(SLO)$/region.obj \ - $(SLO)$/extoutdevdata.obj - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk diff --git a/vcl/util/makefile.mk b/vcl/util/makefile.mk deleted file mode 100755 index c8dc1012dd8f..000000000000 --- a/vcl/util/makefile.mk +++ /dev/null @@ -1,465 +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. -# -#************************************************************************* - -PRJ=.. - -PRJNAME=vcl -TARGET=vcl -TARGETTYPE=GUI -USE_DEFFILE=TRUE -GEN_HID_OTHER=TRUE - -.IF "$(SNDFILE_LIBS)"!="" -SNDFILELIB=$(SNDFILE_LIBS) -.ENDIF - -# --- Settings ----------------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : makefile.pmk -.INCLUDE : makefile2.pmk - -.IF "$(OS)" == "SOLARIS" -.IF "$(CPUNAME)" == "SPARC" && "$(CPU)" == "U" -LINKFLAGSRUNPATH_OOO := -R/usr/sfw/lib/64 $(LINKFLAGSRUNPATH_OOO) -.ELSE -LINKFLAGSRUNPATH_OOO := -R/usr/sfw/lib $(LINKFLAGSRUNPATH_OOO) -.ENDIF -.ENDIF - -# --- Allgemein ---------------------------------------------------------- - -HXXDEPNLST= $(INC)$/vcl$/accel.hxx \ - $(INC)$/vcl$/animate.hxx \ - $(INC)$/vcl$/apptypes.hxx \ - $(INC)$/vcl$/bitmap.hxx \ - $(INC)$/vcl$/bitmapex.hxx \ - $(INC)$/vcl$/bmpacc.hxx \ - $(INC)$/vcl$/btndlg.hxx \ - $(INC)$/vcl$/button.hxx \ - $(INC)$/vcl$/ctrl.hxx \ - $(INC)$/vcl$/cursor.hxx \ - $(INC)$/vcl$/cmdevt.hxx \ - $(INC)$/vcl$/decoview.hxx \ - $(INC)$/vcl$/dialog.hxx \ - $(INC)$/vcl$/dllapi.h \ - $(INC)$/vcl$/dockwin.hxx \ - $(INC)$/vcl$/edit.hxx \ - $(INC)$/vcl$/event.hxx \ - $(INC)$/vcl$/field.hxx \ - $(INC)$/vcl$/fixed.hxx \ - $(INC)$/vcl$/floatwin.hxx \ - $(INC)$/vcl$/font.hxx \ - $(INC)$/vcl$/floatwin.hxx \ - $(INC)$/vcl$/graph.hxx \ - $(INC)$/vcl$/group.hxx \ - $(INC)$/vcl$/help.hxx \ - $(INC)$/vcl$/jobset.hxx \ - $(INC)$/vcl$/keycodes.hxx \ - $(INC)$/vcl$/keycod.hxx \ - $(INC)$/vcl$/image.hxx \ - $(INC)$/vcl$/lstbox.h \ - $(INC)$/vcl$/lstbox.hxx \ - $(INC)$/vcl$/mapmod.hxx \ - $(INC)$/vcl$/metaact.hxx \ - $(INC)$/vcl$/menu.hxx \ - $(INC)$/vcl$/menubtn.hxx \ - $(INC)$/vcl$/metric.hxx \ - $(INC)$/vcl$/morebtn.hxx \ - $(INC)$/vcl$/msgbox.hxx \ - $(INC)$/vcl$/octree.hxx \ - $(INC)$/vcl$/outdev.hxx \ - $(INC)$/vcl$/pointr.hxx \ - $(INC)$/vcl$/ptrstyle.hxx \ - $(INC)$/vcl$/prntypes.hxx \ - $(INC)$/vcl$/print.hxx \ - $(INC)$/vcl$/prndlg.hxx \ - $(INC)$/vcl$/region.hxx \ - $(INC)$/vcl$/rendergraphic.hxx \ - $(INC)$/vcl$/rendergraphicrasterizer.hxx \ - $(INC)$/vcl$/salbtype.hxx \ - $(INC)$/vcl$/scrbar.hxx \ - $(INC)$/vcl$/slider.hxx \ - $(INC)$/vcl$/seleng.hxx \ - $(INC)$/vcl$/settings.hxx \ - $(INC)$/vcl$/sound.hxx \ - $(INC)$/vcl$/sndstyle.hxx \ - $(INC)$/vcl$/split.hxx \ - $(INC)$/vcl$/splitwin.hxx \ - $(INC)$/vcl$/spin.hxx \ - $(INC)$/vcl$/spinfld.hxx \ - $(INC)$/vcl$/status.hxx \ - $(INC)$/vcl$/stdtext.hxx \ - $(INC)$/vcl$/sv.h \ - $(INC)$/vcl$/svapp.hxx \ - $(INC)$/vcl$/syschild.hxx \ - $(INC)$/vcl$/sysdata.hxx \ - $(INC)$/vcl$/syswin.hxx \ - $(INC)$/vcl$/tabctrl.hxx \ - $(INC)$/vcl$/tabdlg.hxx \ - $(INC)$/vcl$/tabpage.hxx \ - $(INC)$/vcl$/toolbox.hxx \ - $(INC)$/vcl$/timer.hxx \ - $(INC)$/vcl$/virdev.hxx \ - $(INC)$/vcl$/wall.hxx \ - $(INC)$/vcl$/waitobj.hxx \ - $(INC)$/vcl$/window.hxx \ - $(INC)$/vcl$/wrkwin.hxx - -.IF "$(linkinc)" != "" -SHL11FILE= $(MISC)$/app.slo -SHL12FILE= $(MISC)$/gdi.slo -SHL13FILE= $(MISC)$/win.slo -SHL14FILE= $(MISC)$/ctrl.slo -SHL16FILE= $(MISC)$/salapp.slo -SHL17FILE= $(MISC)$/salwin.slo -SHL18FILE= $(MISC)$/salgdi.slo -.ENDIF - -LIB1TARGET= $(SLB)$/$(TARGET).lib -LIB1FILES= $(SLB)$/app.lib \ - $(SLB)$/gdi.lib \ - $(SLB)$/win.lib \ - $(SLB)$/ctrl.lib \ - $(SLB)$/helper.lib \ - $(SLB)$/fontsubset.lib \ - $(SLB)$/components.lib - -.IF "$(GUI)" == "UNX" && "$(GUIBASE)"!="aqua" -LIB1FILES+= $(SLB)$/salplug.lib \ - $(SLB)$/fontman.lib \ - $(SLB)$/printer.lib -.ELSE -LIB1FILES+= \ - $(SLB)$/salwin.lib \ - $(SLB)$/salgdi.lib \ - $(SLB)$/salapp.lib -.IF "$(GUIBASE)" == "aqua" -LIB1FILES+= $(SLB)$/dtransaqua.lib -.ENDIF -.ENDIF - -SHL1TARGET= vcl$(DLLPOSTFIX) -SHL1IMPLIB= ivcl -SHL1STDLIBS+=\ - $(SOTLIB) \ - $(UNOTOOLSLIB) \ - $(TOOLSLIB) \ - $(I18NPAPERLIB) \ - $(I18NISOLANGLIB) \ - $(I18NUTILLIB) \ - $(COMPHELPERLIB) \ - $(UCBHELPERLIB) \ - $(CPPUHELPERLIB) \ - $(CPPULIB) \ - $(SALLIB) \ - $(BASEGFXLIB) \ - $(ICUUCLIB) \ - $(ICUDATALIB) \ - $(ICULELIB) \ - $(JVMACCESSLIB) - -.IF "$(GUI)" == "UNX" -.IF "$(ENABLE_GRAPHITE)" != "" -.IF "$(SYSTEM_GRAPHITE)" == "YES" -SHL1STDLIBS+= $(GRAPHITE_LIBS) -.ELSE -SHL1STDLIBS+= -lgraphite2_off -.ENDIF -.ENDIF -.ENDIF -SHL1USE_EXPORTS=name - -.IF "$(GUIBASE)"=="aqua" -SHL1STDLIBS+= \ - $(BASEBMPLIB) \ - -lAppleRemote$(DLLPOSTFIX) \ - -framework QuickTime - -LIB1FILES+= \ - $(SLB)$/sala11y.lib -.ENDIF - -.IF "$(USE_BUILTIN_RASTERIZER)"!="" - LIB1FILES += $(SLB)$/glyphs.lib - SHL1STDLIBS+= $(FREETYPELIB) -.ELSE -.IF "$(ENABLE_GRAPHITE)" == "TRUE" - LIB1FILES += $(SLB)$/glyphs.lib -.ENDIF -.ENDIF # USE_BUILTIN_RASTERIZER - -SHL1LIBS= $(LIB1TARGET) - -.IF "$(GUI)" != "UNX" -SHL1RES= $(RES)$/salsrc.res -.ENDIF - -SHL1DEF= $(MISC)$/$(SHL1TARGET).def - -DEF1NAME =$(SHL1TARGET) -DEF1DEPN = $(HXXDEPNLST) \ - $(LIB1TARGET) -DEF1DES =VCL -DEFLIB1NAME =vcl - -# --- W32 ---------------------------------------------------------------- - -.IF "$(GUI)" == "WNT" - -.IF "$(ENABLE_GRAPHITE)" == "TRUE" -.IF "$(COM)" == "GCC" -SHL1STDLIBS += -Wl,-Bstatic -lgraphite2_off -Wl,-Bdynamic -#SHL1STDLIBS += -lgraphite2_off -.ELSE -SHL1STDLIBS += graphite2_off.lib -.ENDIF -.ENDIF - -SHL1STDLIBS += $(UWINAPILIB) \ - $(GDI32LIB) \ - $(GDIPLUSLIB) \ - $(MSIMG32LIB) \ - $(WINSPOOLLIB) \ - $(OLE32LIB) \ - $(SHELL32LIB) \ - $(ADVAPI32LIB) \ - $(VERSIONLIB) - -SHL1STDLIBS += $(IMM32LIB) - -.IF "$(GUI)$(COM)$(CPU)" == "WNTMSCI" -LINKFLAGSSHL += /ENTRY:LibMain@12 -.ENDIF -.ENDIF - -# --- UNX ---------------------------------------------------------------- - -# UNX sal plugins -.IF "$(GUI)" == "UNX" && "$(GUIBASE)" != "aqua" - -# desktop detector -LIB7TARGET=$(SLB)$/idet -LIB7FILES=$(SLB)$/dtdetect.lib -SHL7TARGET=desktop_detector$(DLLPOSTFIX) -SHL7STDLIBS=\ - $(SALLIB) \ - $(X11LINK_DYNAMIC) -SHL7IMPLIB=idet -SHL7LIBS=$(LIB7TARGET) - -# basic pure X11 plugin -LIB2TARGET=$(SLB)$/ipure_x -LIB2FILES= \ - $(SLB)$/dtransX11.lib \ - $(SLB)$/printergfx.lib \ - $(SLB)$/salwin.lib \ - $(SLB)$/salgdi.lib \ - $(SLB)$/salapp.lib -SHL2TARGET=vclplug_gen$(DLLPOSTFIX) -SHL2IMPLIB=ipure_x -SHL2LIBS=$(LIB2TARGET) -SHL2DEPN=$(SHL1IMPLIBN) $(SHL1TARGETN) - -# libs for generic plugin -SHL2STDLIBS=\ - $(VCLLIB)\ - $(I18NPAPERLIB) \ - $(I18NISOLANGLIB) \ - $(TOOLSLIB) \ - $(BASEGFXLIB) \ - $(UNOTOOLSLIB) \ - $(COMPHELPERLIB) \ - $(CPPUHELPERLIB) \ - $(CPPULIB) \ - $(SALLIB) - -# prepare linking of Xinerama -.IF "$(USE_XINERAMA)" != "NO" - -.IF "$(OS)"=="MACOSX" || "$(OS)$(CPU)" == "LINUXX" -XINERAMALIBS=-lXinerama -.ELSE -.IF "$(OS)" != "SOLARIS" || "$(USE_XINERAMA_VERSION)" == "Xorg" -.IF "$(XINERAMA_LINK)" == "dynamic" -XINERAMALIBS= -lXinerama -.ELSE -XINERAMALIBS= -Wl,-Bstatic -lXinerama -Wl,-Bdynamic -.ENDIF # XINERAMA_LINK == dynamic -.ENDIF # OS == SOLARIS -.ENDIF # OS == MACOSX - -SHL2STDLIBS += $(XINERAMALIBS) -.ENDIF # USE_XINERAMA != NO - -.IF "$(XRENDER_LINK)" == "YES" -SHL2STDLIBS+=`pkg-config --libs xrender` -.ENDIF - -.IF "$(GUIBASE)"=="unx" - -SHL2STDLIBS += -lXext -lSM -lICE -lX11 -.IF "$(OS)"!="MACOSX" && "$(OS)"!="FREEBSD" && "$(OS)"!="NETBSD" && \ - && "$(OS)"!="OPENBSD" "$(OS)"!="DRAGONFLY" -# needed by salprnpsp.cxx -SHL2STDLIBS+= -ldl -.ENDIF - -.IF "$(ENABLE_RANDR)" != "" -.IF "$(XRANDR_DLOPEN)" == "FALSE" -SHL2STDLIBS+= $(XRANDR_LIBS) -.ENDIF -.ENDIF - -.ENDIF # "$(GUIBASE)"=="unx" - -# gtk plugin -.IF "$(ENABLE_GTK)" != "" -PKGCONFIG_MODULES=gtk+-2.0 gthread-2.0 -.IF "$(ENABLE_DBUS)" != "" -PKGCONFIG_MODULES+= dbus-glib-1 -.ENDIF -.INCLUDE: pkg_config.mk - -LIB4TARGET=$(SLB)$/igtk_plug_ -LIB4FILES=\ - $(SLB)$/gtkapp.lib\ - $(SLB)$/gtka11y.lib \ - $(SLB)$/gtkgdi.lib\ - $(SLB)$/gtkwin.lib - -SHL4TARGET=vclplug_gtk$(DLLPOSTFIX) -SHL4IMPLIB=igtk_plug_ -SHL4LIBS=$(LIB4TARGET) -SHL4DEPN=$(SHL1IMPLIBN) $(SHL1TARGETN) $(SHL2IMPLIBN) $(SHL2TARGETN) -# libs for gtk plugin -SHL4STDLIBS+=$(PKGCONFIG_LIBS:s/ -lpangoxft-1.0//) -# hack for faked SO environment -.IF "$(PKGCONFIG_ROOT)"!="" -SHL4SONAME+=-z nodefs -SHL4NOCHECK=TRUE -.ENDIF # "$(PKGCONFIG_ROOT)"!="" - - -SHL4STDLIBS+=-l$(SHL2TARGET) -SHL4STDLIBS+=\ - $(VCLLIB) \ - $(TOOLSLIB) \ - $(CPPUHELPERLIB) \ - $(CPPULIB) \ - $(SALLIB) \ - $(X11LINK_DYNAMIC) - -.IF "$(ENABLE_RANDR)" != "" -.IF "$(XRANDR_DLOPEN)" == "FALSE" -SHL4STDLIBS+= $(XRANDR_LIBS) -.ENDIF -.ENDIF - -.ENDIF # "$(ENABLE_GTK)" != "" - -# KDE plugin -.IF "$(ENABLE_KDE)" != "" -.IF "$(KDE_ROOT)"!="" -EXTRALIBPATHS+=-L$(KDE_ROOT)$/lib -.IF "$(OS)$(CPU)" == "LINUXX" -EXTRALIBPATHS+=-L$(KDE_ROOT)$/lib64 -.ENDIF -.ENDIF -LIB5TARGET=$(SLB)$/ikde_plug_ -LIB5FILES=$(SLB)$/kdeplug.lib -SHL5TARGET=vclplug_kde$(DLLPOSTFIX) -SHL5IMPLIB=ikde_plug_ -SHL5LIBS=$(LIB5TARGET) -SHL5DEPN=$(SHL2TARGETN) -# libs for KDE plugin -SHL5STDLIBS+=-l$(SHL2TARGET) -SHL5STDLIBS+=\ - $(VCLLIB) \ - $(TOOLSLIB) \ - $(SALLIB) \ - $(X11LINK_DYNAMIC) - -.IF "$(ENABLE_RANDR)" != "" -.IF "$(XRANDR_DLOPEN)" == "FALSE" -SHL5STDLIBS+= $(XRANDR_LIBS) -.ENDIF -.ENDIF - -SHL5LINKFLAGS+=$(KDE_LIBS) - -.ENDIF # "$(ENABLE_KDE)" != "" - -# KDE4 plugin -.IF "$(ENABLE_KDE4)" != "" -.IF "$(KDE4_ROOT)"!="" -EXTRALIBPATHS+=-L$(KDE4_ROOT)$/lib -.ENDIF -LIB6TARGET=$(SLB)$/ikde4_plug_ -LIB6FILES=$(SLB)$/kde4plug.lib -SHL6TARGET=vclplug_kde4$(DLLPOSTFIX) -SHL6IMPLIB=ikde4_plug_ -SHL6LIBS=$(LIB6TARGET) -SHL6DEPN=$(SHL2TARGETN) -# libs for KDE4 plugin -SHL6STDLIBS+=-l$(SHL2TARGET) -SHL6STDLIBS+=\ - $(VCLLIB) \ - $(PSPLIB) \ - $(TOOLSLIB) \ - $(SALLIB) \ - $(X11LINK_DYNAMIC) - -.IF "$(ENABLE_RANDR)" != "" -.IF "$(XRANDR_DLOPEN)" == "FALSE" -SHL6STDLIBS+= $(XRANDR_LIBS) -.ENDIF -.ENDIF - -SHL6STDLIBS+=$(KDE4_LIBS) $(KDE_GLIB_LIBS) - -.ENDIF # "$(ENABLE_KDE4)" != "" - -.ENDIF # UNX - -# --- Allgemein ---------------------------------------------------------- - -.INCLUDE : target.mk - -ALLTAR : $(MISC)/vcl.component - -.IF "$(OS)" == "MACOSX" -my_platform = .macosx -.ELIF "$(OS)" == "WNT" -my_platform = .windows -.END - -$(MISC)/vcl.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ - vcl.component - $(XSLTPROC) --nonet --stringparam uri \ - '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ - $(SOLARENV)/bin/createcomponent.xslt vcl$(my_platform).component -- cgit v1.2.3 From ced906ea4d0b2ab93fc1c6417097db513fbef5a7 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 29 Jun 2011 16:40:32 +0100 Subject: tweak for internal cairo --- vcl/Library_vclplug_gen.mk | 16 ++++++++++------ vcl/unx/generic/gdi/salgdi3.cxx | 6 ++++++ 2 files changed, 16 insertions(+), 6 deletions(-) (limited to 'vcl') diff --git a/vcl/Library_vclplug_gen.mk b/vcl/Library_vclplug_gen.mk index 783d56b61f65..d1954004b3d3 100644 --- a/vcl/Library_vclplug_gen.mk +++ b/vcl/Library_vclplug_gen.mk @@ -65,11 +65,21 @@ $(eval $(call gb_Library_add_linked_libs,vclplug_gen,\ )) ifeq ($(SYSTEM_CAIRO),YES) +$(eval $(call gb_Library_set_cxxflags,vclplug_gen,\ + $$(CXXFLAGS) \ + $$(CAIRO_CFLAGS) \ + -DSYSTEM_CAIRO \ +)) $(eval $(call gb_Library_set_ldflags,vclplug_gen,\ $$(LDFLAGS) \ $$(CAIRO_LIBS) \ )) else +$(eval $(call gb_Library_set_cxxflags,vclplug_gen,\ + $$(CXXFLAGS) \ + $$(FONTCONFIG_CFLAGS) \ + $$(FREETYPE_CFLAGS) \ +)) $(eval $(call gb_Library_add_linked_libs,vclplug_gen,\ cairo \ )) @@ -130,12 +140,6 @@ $(eval $(call gb_Library_set_defs,vclplug_gen,\ -DVCLPLUG_GEN_IMPLEMENTATION \ )) -## unconditional cairo -$(eval $(call gb_Library_set_cxxflags,vclplug_gen,\ - $$(CXXFLAGS) \ - $$(CAIRO_CFLAGS) \ -)) - ## handle RandR ifneq ($(ENABLE_RANDR),) $(eval $(call gb_Library_set_defs,vclplug_gen,\ diff --git a/vcl/unx/generic/gdi/salgdi3.cxx b/vcl/unx/generic/gdi/salgdi3.cxx index 17240c90080a..25dc002cfdc5 100644 --- a/vcl/unx/generic/gdi/salgdi3.cxx +++ b/vcl/unx/generic/gdi/salgdi3.cxx @@ -83,9 +83,15 @@ #include #endif +#ifdef SYSTEM_CAIRO #include #include #include +#else +#include +#include +#include +#endif struct BOX { -- cgit v1.2.3 From fe26694b03e30c63952e54b1139a6009dc1448bb Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 29 Jun 2011 20:52:44 +0300 Subject: Add Emacs and vim mode lines to *.mm files, too --- vcl/aqua/source/a11y/aqua11yactionwrapper.mm | 3 +++ vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm | 3 +++ vcl/aqua/source/a11y/aqua11yfactory.mm | 3 +++ vcl/aqua/source/a11y/aqua11yrolehelper.mm | 3 +++ vcl/aqua/source/a11y/aqua11yselectionwrapper.mm | 3 +++ vcl/aqua/source/a11y/aqua11ytablewrapper.mm | 3 +++ vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm | 3 +++ vcl/aqua/source/a11y/aqua11ytextwrapper.mm | 3 +++ vcl/aqua/source/a11y/aqua11yutil.mm | 3 +++ vcl/aqua/source/a11y/aqua11yvaluewrapper.mm | 3 +++ vcl/aqua/source/a11y/aqua11ywrapper.mm | 3 +++ vcl/aqua/source/a11y/aqua11ywrapperbutton.mm | 3 +++ vcl/aqua/source/a11y/aqua11ywrappercheckbox.mm | 3 +++ vcl/aqua/source/a11y/aqua11ywrappercombobox.mm | 3 +++ vcl/aqua/source/a11y/aqua11ywrappergroup.mm | 3 +++ vcl/aqua/source/a11y/aqua11ywrapperlist.mm | 3 +++ vcl/aqua/source/a11y/aqua11ywrapperradiobutton.mm | 3 +++ vcl/aqua/source/a11y/aqua11ywrapperradiogroup.mm | 3 +++ vcl/aqua/source/a11y/aqua11ywrapperrow.mm | 3 +++ vcl/aqua/source/a11y/aqua11ywrapperscrollarea.mm | 3 +++ vcl/aqua/source/a11y/aqua11ywrapperscrollbar.mm | 3 +++ vcl/aqua/source/a11y/aqua11ywrappersplitter.mm | 3 +++ vcl/aqua/source/a11y/aqua11ywrapperstatictext.mm | 3 +++ vcl/aqua/source/a11y/aqua11ywrappertabgroup.mm | 3 +++ vcl/aqua/source/a11y/aqua11ywrappertextarea.mm | 3 +++ vcl/aqua/source/a11y/aqua11ywrappertoolbar.mm | 3 +++ vcl/aqua/source/app/salnstimer.mm | 2 ++ vcl/aqua/source/app/vclnsapp.mm | 2 ++ vcl/aqua/source/gdi/aquaprintaccessoryview.mm | 3 +++ vcl/aqua/source/gdi/aquaprintview.mm | 3 +++ vcl/aqua/source/window/salframeview.mm | 2 ++ vcl/aqua/source/window/salnsmenu.mm | 2 ++ 32 files changed, 92 insertions(+) mode change 100755 => 100644 vcl/aqua/source/app/salnstimer.mm mode change 100755 => 100644 vcl/aqua/source/app/vclnsapp.mm mode change 100755 => 100644 vcl/aqua/source/gdi/aquaprintview.mm mode change 100755 => 100644 vcl/aqua/source/window/salframeview.mm mode change 100755 => 100644 vcl/aqua/source/window/salnsmenu.mm (limited to 'vcl') diff --git a/vcl/aqua/source/a11y/aqua11yactionwrapper.mm b/vcl/aqua/source/a11y/aqua11yactionwrapper.mm index e49ad251faad..d0f8ca91c73d 100644 --- a/vcl/aqua/source/a11y/aqua11yactionwrapper.mm +++ b/vcl/aqua/source/a11y/aqua11yactionwrapper.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -82,3 +83,5 @@ } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm b/vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm index c66e7c3d8515..0f50dad02c0e 100644 --- a/vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm +++ b/vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -108,3 +109,5 @@ using namespace ::com::sun::star::uno; } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11yfactory.mm b/vcl/aqua/source/a11y/aqua11yfactory.mm index 41b66d19e578..944a8e9ea90a 100644 --- a/vcl/aqua/source/a11y/aqua11yfactory.mm +++ b/vcl/aqua/source/a11y/aqua11yfactory.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -198,3 +199,5 @@ static bool enabled = false; } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11yrolehelper.mm b/vcl/aqua/source/a11y/aqua11yrolehelper.mm index 9e6536da98bd..e989f38f4a1b 100644 --- a/vcl/aqua/source/a11y/aqua11yrolehelper.mm +++ b/vcl/aqua/source/a11y/aqua11yrolehelper.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -276,3 +277,5 @@ using namespace ::com::sun::star::uno; } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11yselectionwrapper.mm b/vcl/aqua/source/a11y/aqua11yselectionwrapper.mm index 5b8d604f3b1a..960afb384caa 100644 --- a/vcl/aqua/source/a11y/aqua11yselectionwrapper.mm +++ b/vcl/aqua/source/a11y/aqua11yselectionwrapper.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -94,3 +95,5 @@ using namespace ::com::sun::star::uno; } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ytablewrapper.mm b/vcl/aqua/source/a11y/aqua11ytablewrapper.mm index 110cb42ffee7..47b766df2223 100644 --- a/vcl/aqua/source/a11y/aqua11ytablewrapper.mm +++ b/vcl/aqua/source/a11y/aqua11ytablewrapper.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -210,3 +211,5 @@ using namespace ::com::sun::star::uno; } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm b/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm index 2122f56e9565..5a4628edb76e 100644 --- a/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm +++ b/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -254,3 +255,5 @@ using namespace ::rtl; } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ytextwrapper.mm b/vcl/aqua/source/a11y/aqua11ytextwrapper.mm index d956d2beb0b7..cb6fae77a7a9 100644 --- a/vcl/aqua/source/a11y/aqua11ytextwrapper.mm +++ b/vcl/aqua/source/a11y/aqua11ytextwrapper.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -299,3 +300,5 @@ using namespace ::rtl; } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11yutil.mm b/vcl/aqua/source/a11y/aqua11yutil.mm index 74de0a19aa41..b244f1f67855 100644 --- a/vcl/aqua/source/a11y/aqua11yutil.mm +++ b/vcl/aqua/source/a11y/aqua11yutil.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -52,3 +53,5 @@ using namespace ::com::sun::star::awt; } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11yvaluewrapper.mm b/vcl/aqua/source/a11y/aqua11yvaluewrapper.mm index fb257921b13e..fc10d44058d8 100644 --- a/vcl/aqua/source/a11y/aqua11yvaluewrapper.mm +++ b/vcl/aqua/source/a11y/aqua11yvaluewrapper.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -93,3 +94,5 @@ using namespace ::com::sun::star::uno; } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ywrapper.mm b/vcl/aqua/source/a11y/aqua11ywrapper.mm index bf8de98c3318..2376111eb427 100644 --- a/vcl/aqua/source/a11y/aqua11ywrapper.mm +++ b/vcl/aqua/source/a11y/aqua11ywrapper.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1145,3 +1146,5 @@ Reference < XAccessibleContext > hitTestRunner ( com::sun::star::awt::Point poin } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ywrapperbutton.mm b/vcl/aqua/source/a11y/aqua11ywrapperbutton.mm index e51ceff14af9..dd9b95901d13 100644 --- a/vcl/aqua/source/a11y/aqua11ywrapperbutton.mm +++ b/vcl/aqua/source/a11y/aqua11ywrapperbutton.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -60,3 +61,5 @@ } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ywrappercheckbox.mm b/vcl/aqua/source/a11y/aqua11ywrappercheckbox.mm index 6bf2aa2f8340..1c70d774d0eb 100644 --- a/vcl/aqua/source/a11y/aqua11ywrappercheckbox.mm +++ b/vcl/aqua/source/a11y/aqua11ywrappercheckbox.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -64,3 +65,5 @@ } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ywrappercombobox.mm b/vcl/aqua/source/a11y/aqua11ywrappercombobox.mm index 6f8e9d05d112..1fd7468f8858 100644 --- a/vcl/aqua/source/a11y/aqua11ywrappercombobox.mm +++ b/vcl/aqua/source/a11y/aqua11ywrappercombobox.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -161,3 +162,5 @@ using namespace ::com::sun::star::uno; } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ywrappergroup.mm b/vcl/aqua/source/a11y/aqua11ywrappergroup.mm index 536cc9bba8eb..f3e1dcf769c5 100644 --- a/vcl/aqua/source/a11y/aqua11ywrappergroup.mm +++ b/vcl/aqua/source/a11y/aqua11ywrappergroup.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -55,3 +56,5 @@ } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ywrapperlist.mm b/vcl/aqua/source/a11y/aqua11ywrapperlist.mm index d70679ed6966..9c7f5f6fe932 100644 --- a/vcl/aqua/source/a11y/aqua11ywrapperlist.mm +++ b/vcl/aqua/source/a11y/aqua11ywrapperlist.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -46,3 +47,5 @@ using namespace ::com::sun::star::accessibility; } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.mm b/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.mm index 4c1e9047d65e..af4fda68a86e 100644 --- a/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.mm +++ b/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -63,3 +64,5 @@ } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ywrapperradiogroup.mm b/vcl/aqua/source/a11y/aqua11ywrapperradiogroup.mm index 52e71620ceed..47668005376a 100644 --- a/vcl/aqua/source/a11y/aqua11ywrapperradiogroup.mm +++ b/vcl/aqua/source/a11y/aqua11ywrapperradiogroup.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -46,3 +47,5 @@ } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ywrapperrow.mm b/vcl/aqua/source/a11y/aqua11ywrapperrow.mm index 0fd65fd01365..8ecd37aafc1c 100644 --- a/vcl/aqua/source/a11y/aqua11ywrapperrow.mm +++ b/vcl/aqua/source/a11y/aqua11ywrapperrow.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -55,3 +56,5 @@ } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ywrapperscrollarea.mm b/vcl/aqua/source/a11y/aqua11ywrapperscrollarea.mm index 8a481b64926d..7c9c6f12fc63 100644 --- a/vcl/aqua/source/a11y/aqua11ywrapperscrollarea.mm +++ b/vcl/aqua/source/a11y/aqua11ywrapperscrollarea.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -83,3 +84,5 @@ } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ywrapperscrollbar.mm b/vcl/aqua/source/a11y/aqua11ywrapperscrollbar.mm index 42b67b739602..5087ae5e3f3e 100644 --- a/vcl/aqua/source/a11y/aqua11ywrapperscrollbar.mm +++ b/vcl/aqua/source/a11y/aqua11ywrapperscrollbar.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -49,3 +50,5 @@ using namespace ::com::sun::star::accessibility; } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ywrappersplitter.mm b/vcl/aqua/source/a11y/aqua11ywrappersplitter.mm index 37821f25e423..96f8c6413cc9 100644 --- a/vcl/aqua/source/a11y/aqua11ywrappersplitter.mm +++ b/vcl/aqua/source/a11y/aqua11ywrappersplitter.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -46,3 +47,5 @@ using namespace ::com::sun::star::accessibility; } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ywrapperstatictext.mm b/vcl/aqua/source/a11y/aqua11ywrapperstatictext.mm index d5afe0962904..d280264a36bd 100644 --- a/vcl/aqua/source/a11y/aqua11ywrapperstatictext.mm +++ b/vcl/aqua/source/a11y/aqua11ywrapperstatictext.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -54,3 +55,5 @@ } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ywrappertabgroup.mm b/vcl/aqua/source/a11y/aqua11ywrappertabgroup.mm index fb4e66ad9b90..09fa3d2b6947 100644 --- a/vcl/aqua/source/a11y/aqua11ywrappertabgroup.mm +++ b/vcl/aqua/source/a11y/aqua11ywrappertabgroup.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -48,3 +49,5 @@ } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ywrappertextarea.mm b/vcl/aqua/source/a11y/aqua11ywrappertextarea.mm index a90fe7ae28aa..074b6d84d427 100644 --- a/vcl/aqua/source/a11y/aqua11ywrappertextarea.mm +++ b/vcl/aqua/source/a11y/aqua11ywrappertextarea.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -46,3 +47,5 @@ } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ywrappertoolbar.mm b/vcl/aqua/source/a11y/aqua11ywrappertoolbar.mm index 29ddaf540266..636be7b2fd32 100644 --- a/vcl/aqua/source/a11y/aqua11ywrappertoolbar.mm +++ b/vcl/aqua/source/a11y/aqua11ywrappertoolbar.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -48,3 +49,5 @@ } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/app/salnstimer.mm b/vcl/aqua/source/app/salnstimer.mm old mode 100755 new mode 100644 index f44c3d698f73..d78a3ae8462e --- a/vcl/aqua/source/app/salnstimer.mm +++ b/vcl/aqua/source/app/salnstimer.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -55,3 +56,4 @@ } @end +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/app/vclnsapp.mm b/vcl/aqua/source/app/vclnsapp.mm old mode 100755 new mode 100644 index cfb4d5e62454..5206c17dd2d7 --- a/vcl/aqua/source/app/vclnsapp.mm +++ b/vcl/aqua/source/app/vclnsapp.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -506,3 +507,4 @@ @end +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm index 2bb67dcc1940..abe314f27f8f 100644 --- a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm +++ b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1389,3 +1390,5 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/gdi/aquaprintview.mm b/vcl/aqua/source/gdi/aquaprintview.mm old mode 100755 new mode 100644 index 692435fc00f0..a7a527a9289b --- a/vcl/aqua/source/gdi/aquaprintview.mm +++ b/vcl/aqua/source/gdi/aquaprintview.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -82,3 +83,5 @@ mpController->printFilteredPage( nPage-1 ); } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/window/salframeview.mm b/vcl/aqua/source/window/salframeview.mm old mode 100755 new mode 100644 index ade5594ec667..54ebe8090f1c --- a/vcl/aqua/source/window/salframeview.mm +++ b/vcl/aqua/source/window/salframeview.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /*n*********************************************************************** * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1728,3 +1729,4 @@ private: @end +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/window/salnsmenu.mm b/vcl/aqua/source/window/salnsmenu.mm old mode 100755 new mode 100644 index b86caa49d870..c2f182773ce6 --- a/vcl/aqua/source/window/salnsmenu.mm +++ b/vcl/aqua/source/window/salnsmenu.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -213,3 +214,4 @@ @end +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From 5e692599df6d47b614b488796747f5faadea63f7 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Wed, 29 Jun 2011 15:53:55 +0200 Subject: remove executable bit from .cxx files --- vcl/source/window/syschild.cxx | 0 vcl/source/window/toolbox.cxx | 0 vcl/source/window/window.cxx | 0 vcl/source/window/wrkwin.cxx | 0 4 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 vcl/source/window/syschild.cxx mode change 100755 => 100644 vcl/source/window/toolbox.cxx mode change 100755 => 100644 vcl/source/window/window.cxx mode change 100755 => 100644 vcl/source/window/wrkwin.cxx (limited to 'vcl') diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx old mode 100755 new mode 100644 diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx old mode 100755 new mode 100644 diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx old mode 100755 new mode 100644 diff --git a/vcl/source/window/wrkwin.cxx b/vcl/source/window/wrkwin.cxx old mode 100755 new mode 100644 -- cgit v1.2.3 From 0fa72e369349edf0084964a03d280668debe5975 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 2 Jul 2011 23:05:34 +0100 Subject: ByteString::CreateFromInt32->rtl::OString::valueOf --- vcl/source/gdi/cvtsvm.cxx | 10 ++-- vcl/unx/generic/printer/jobdata.cxx | 69 ++++++++++++++------------ vcl/unx/generic/printer/printerinfomanager.cxx | 41 ++++++++------- vcl/unx/generic/printergfx/common_gfx.cxx | 2 +- vcl/unx/generic/printergfx/printerjob.cxx | 11 ++-- 5 files changed, 72 insertions(+), 61 deletions(-) (limited to 'vcl') diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx index 21f977a45396..193c066b1d98 100644 --- a/vcl/source/gdi/cvtsvm.cxx +++ b/vcl/source/gdi/cvtsvm.cxx @@ -41,6 +41,7 @@ #include #include #include +#include // ----------- // - Defines - @@ -2431,10 +2432,11 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, #ifdef DBG_UTIL default: { - ByteString aStr( "Missing implementation for Action#: " ); - aStr += ByteString::CreateFromInt32( pAction->GetType() ); - aStr += '!'; - OSL_FAIL( aStr.GetBuffer() ); + rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM( + "Missing implementation for Action#: ")); + aStr.append(static_cast(pAction->GetType())); + aStr.append('!'); + OSL_FAIL(aStr.getStr()); } break; #endif diff --git a/vcl/unx/generic/printer/jobdata.cxx b/vcl/unx/generic/printer/jobdata.cxx index 03d676470ecb..872e880adc61 100644 --- a/vcl/unx/generic/printer/jobdata.cxx +++ b/vcl/unx/generic/printer/jobdata.cxx @@ -34,7 +34,8 @@ #include "tools/stream.hxx" -#include "sal/alloca.h" +#include +#include using namespace psp; @@ -122,48 +123,52 @@ bool JobData::getStreamBuffer( void*& pData, int& bytes ) return false; SvMemoryStream aStream; - ByteString aLine; // write header job data aStream.WriteLine( "JobData 1" ); - aLine = "printer="; - aLine += ByteString( String( m_aPrinterName ), RTL_TEXTENCODING_UTF8 ); - aStream.WriteLine( aLine ); + rtl::OStringBuffer aLine; + + aLine.append(RTL_CONSTASCII_STRINGPARAM("printer=")); + aLine.append(rtl::OUStringToOString(m_aPrinterName, RTL_TEXTENCODING_UTF8)); + aStream.WriteLine(aLine.makeStringAndClear()); - aLine = "orientation="; - aLine += m_eOrientation == orientation::Landscape ? "Landscape" : "Portrait"; - aStream.WriteLine( aLine ); + aLine.append(RTL_CONSTASCII_STRINGPARAM("orientation=")); + if (m_eOrientation == orientation::Landscape) + aLine.append(RTL_CONSTASCII_STRINGPARAM("Landscape")); + else + aLine.append(RTL_CONSTASCII_STRINGPARAM("Portrait")); + aStream.WriteLine(aLine.makeStringAndClear()); - aLine = "copies="; - aLine += ByteString::CreateFromInt32( m_nCopies ); - aStream.WriteLine( aLine ); + aLine.append(RTL_CONSTASCII_STRINGPARAM("copies=")); + aLine.append(static_cast(m_nCopies)); + aStream.WriteLine(aLine.makeStringAndClear()); - aLine = "margindajustment="; - aLine += ByteString::CreateFromInt32( m_nLeftMarginAdjust ); - aLine += ','; - aLine += ByteString::CreateFromInt32( m_nRightMarginAdjust ); - aLine += ','; - aLine += ByteString::CreateFromInt32( m_nTopMarginAdjust ); - aLine += ','; - aLine += ByteString::CreateFromInt32( m_nBottomMarginAdjust ); - aStream.WriteLine( aLine ); + aLine.append(RTL_CONSTASCII_STRINGPARAM("margindajustment=")); + aLine.append(static_cast(m_nLeftMarginAdjust)); + aLine.append(','); + aLine.append(static_cast(m_nRightMarginAdjust)); + aLine.append(','); + aLine.append(static_cast(m_nTopMarginAdjust)); + aLine.append(','); + aLine.append(static_cast(m_nBottomMarginAdjust)); + aStream.WriteLine(aLine.makeStringAndClear()); - aLine = "colordepth="; - aLine += ByteString::CreateFromInt32( m_nColorDepth ); - aStream.WriteLine( aLine ); + aLine.append(RTL_CONSTASCII_STRINGPARAM("colordepth=")); + aLine.append(static_cast(m_nColorDepth)); + aStream.WriteLine(aLine.makeStringAndClear()); - aLine = "pslevel="; - aLine += ByteString::CreateFromInt32( m_nPSLevel ); - aStream.WriteLine( aLine ); + aLine.append(RTL_CONSTASCII_STRINGPARAM("pslevel=")); + aLine.append(static_cast(m_nPSLevel)); + aStream.WriteLine(aLine.makeStringAndClear()); - aLine = "pdfdevice="; - aLine += ByteString::CreateFromInt32( m_nPDFDevice ); - aStream.WriteLine( aLine ); + aLine.append(RTL_CONSTASCII_STRINGPARAM("pdfdevice=")); + aLine.append(static_cast(m_nPDFDevice)); + aStream.WriteLine(aLine.makeStringAndClear()); - aLine = "colordevice="; - aLine += ByteString::CreateFromInt32( m_nColorDevice ); - aStream.WriteLine( aLine ); + aLine.append(RTL_CONSTASCII_STRINGPARAM("colordevice=")); + aLine.append(static_cast(m_nColorDevice)); + aStream.WriteLine(aLine.makeStringAndClear()); // now append the PPDContext stream buffer aStream.WriteLine( "PPDContexData" ); diff --git a/vcl/unx/generic/printer/printerinfomanager.cxx b/vcl/unx/generic/printer/printerinfomanager.cxx index e29855c939d1..144821173962 100644 --- a/vcl/unx/generic/printer/printerinfomanager.cxx +++ b/vcl/unx/generic/printer/printerinfomanager.cxx @@ -772,30 +772,30 @@ bool PrinterInfoManager::writePrinterConfig() pConfig->DeleteGroup( it->second.m_aGroup ); // else some old keys may remain pConfig->SetGroup( it->second.m_aGroup ); - ByteString aValue( String( it->second.m_aInfo.m_aDriverName ), RTL_TEXTENCODING_UTF8 ); - aValue += '/'; - aValue += ByteString( String( it->first ), RTL_TEXTENCODING_UTF8 ); - pConfig->WriteKey( "Printer", aValue ); + rtl::OStringBuffer aValue(rtl::OUStringToOString(it->second.m_aInfo.m_aDriverName, RTL_TEXTENCODING_UTF8)); + aValue.append('/'); + aValue.append(rtl::OUStringToOString(it->first, RTL_TEXTENCODING_UTF8)); + pConfig->WriteKey("Printer", aValue.makeStringAndClear()); pConfig->WriteKey( "DefaultPrinter", it->first == m_aDefaultPrinter ? "1" : "0" ); pConfig->WriteKey( "Location", ByteString( String( it->second.m_aInfo.m_aLocation ), RTL_TEXTENCODING_UTF8 ) ); pConfig->WriteKey( "Comment", ByteString( String( it->second.m_aInfo.m_aComment ), RTL_TEXTENCODING_UTF8 ) ); pConfig->WriteKey( "Command", ByteString( String( it->second.m_aInfo.m_aCommand ), RTL_TEXTENCODING_UTF8 ) ); pConfig->WriteKey( "QuickCommand", ByteString( String( it->second.m_aInfo.m_aQuickCommand ), RTL_TEXTENCODING_UTF8 ) ); pConfig->WriteKey( "Features", ByteString( String( it->second.m_aInfo.m_aFeatures ), RTL_TEXTENCODING_UTF8 ) ); - pConfig->WriteKey( "Copies", ByteString::CreateFromInt32( it->second.m_aInfo.m_nCopies ) ); + pConfig->WriteKey("Copies", rtl::OString::valueOf(static_cast(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 ); - aValue += ','; - aValue += ByteString::CreateFromInt32( it->second.m_aInfo.m_nRightMarginAdjust ); - aValue += ','; - aValue += ByteString::CreateFromInt32( it->second.m_aInfo.m_nTopMarginAdjust ); - aValue += ','; - aValue += ByteString::CreateFromInt32( it->second.m_aInfo.m_nBottomMarginAdjust ); - pConfig->WriteKey( "MarginAdjust", aValue ); + pConfig->WriteKey("PSLevel", rtl::OString::valueOf(static_cast(it->second.m_aInfo.m_nPSLevel))); + pConfig->WriteKey("PDFDevice", rtl::OString::valueOf(static_cast(it->second.m_aInfo.m_nPDFDevice))); + pConfig->WriteKey("ColorDevice", rtl::OString::valueOf(static_cast(it->second.m_aInfo.m_nColorDevice))); + pConfig->WriteKey("ColorDepth", rtl::OString::valueOf(static_cast(it->second.m_aInfo.m_nColorDepth))); + aValue.append(static_cast(it->second.m_aInfo.m_nLeftMarginAdjust)); + aValue.append(','); + aValue.append(static_cast(it->second.m_aInfo.m_nRightMarginAdjust)); + aValue.append(','); + aValue.append(static_cast(it->second.m_aInfo.m_nTopMarginAdjust)); + aValue.append(','); + aValue.append(static_cast(it->second.m_aInfo.m_nBottomMarginAdjust)); + pConfig->WriteKey("MarginAdjust", aValue.makeStringAndClear()); if( it->second.m_aInfo.m_aDriverName.compareToAscii( "CUPS:", 5 ) != 0 ) { @@ -807,8 +807,11 @@ bool PrinterInfoManager::writePrinterConfig() aKey += ByteString( pKey->getKey(), RTL_TEXTENCODING_ISO_8859_1 ); const PPDValue* pValue = it->second.m_aInfo.m_aContext.getValue( pKey ); - aValue = pValue ? ByteString( pValue->m_aOption, RTL_TEXTENCODING_ISO_8859_1 ) : ByteString( "*nil" ); - pConfig->WriteKey( aKey, aValue ); + if (pValue) + aValue.append(rtl::OUStringToOString(pValue->m_aOption, RTL_TEXTENCODING_ISO_8859_1)); + else + aValue.append(RTL_CONSTASCII_STRINGPARAM("*nil")); + pConfig->WriteKey(aKey, aValue.makeStringAndClear()); } } diff --git a/vcl/unx/generic/printergfx/common_gfx.cxx b/vcl/unx/generic/printergfx/common_gfx.cxx index 7cae4586bf6e..71ae6962ad73 100644 --- a/vcl/unx/generic/printergfx/common_gfx.cxx +++ b/vcl/unx/generic/printergfx/common_gfx.cxx @@ -1230,7 +1230,7 @@ PrinterGfx::DrawEPS( const Rectangle& rBoundingBox, void* pPtr, sal_uInt32 nSize static sal_uInt16 nEps = 0; if( ! aDocTitle.Len() ) - aDocTitle = ByteString::CreateFromInt32( (sal_Int32)(nEps++) ); + aDocTitle = rtl::OString::valueOf(static_cast(nEps++)); if( fLeft != fRight && fTop != fBottom ) { diff --git a/vcl/unx/generic/printergfx/printerjob.cxx b/vcl/unx/generic/printergfx/printerjob.cxx index 827b5c7cf269..9fb50947bcf4 100644 --- a/vcl/unx/generic/printergfx/printerjob.cxx +++ b/vcl/unx/generic/printergfx/printerjob.cxx @@ -1191,12 +1191,13 @@ bool PrinterJob::writeSetup( osl::File* pFile, const JobData& rJob ) if( ! bExternalDialog && rJob.m_nCopies > 1 ) { // setup code - ByteString aLine( "/#copies " ); - aLine += ByteString::CreateFromInt32( rJob.m_nCopies ); - aLine += " def\n"; + rtl::OStringBuffer aLine(RTL_CONSTASCII_STRINGPARAM("/#copies ")); + aLine.append(static_cast(rJob.m_nCopies)); + aLine.append(RTL_CONSTASCII_STRINGPARAM(" def\n")); sal_uInt64 nWritten = 0; - bSuccess = pFile->write( aLine.GetBuffer(), aLine.Len(), nWritten ) - || nWritten != aLine.Len() ? false : true; + bSuccess = pFile->write(aLine.getStr(), aLine.getLength(), nWritten) + || nWritten != static_cast(aLine.getLength()) ? + false : true; if( bSuccess && GetPostscriptLevel( &rJob ) >= 2 ) WritePS (pFile, "<< /NumCopies null /Policies << /NumCopies 1 >> >> setpagedevice\n" ); -- cgit v1.2.3 From e484593e2c3ef4005840bb409c76f40a6d2d57fd Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 4 Jul 2011 12:41:29 +0100 Subject: link unconditionally to cairo for librsvg --- vcl/Library_vcl.mk | 17 ++++ vcl/source/components/rasterizer_rsvg.cxx | 136 +++++------------------------- 2 files changed, 37 insertions(+), 116 deletions(-) (limited to 'vcl') diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index e012d7129452..7105599bde14 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -433,6 +433,23 @@ $(eval $(call gb_Library_add_linked_libs,vcl,\ endif endif +## handle Cairo +ifeq ($(SYSTEM_CAIRO),YES) +$(eval $(call gb_Library_set_cxxflags,vcl,\ + $$(CXXFLAGS) \ + $$(CAIRO_CFLAGS) \ + -DSYSTEM_CAIRO \ +)) +$(eval $(call gb_Library_set_ldflags,vcl,\ + $$(LDFLAGS) \ + $$(CAIRO_LIBS) \ +)) +else +$(eval $(call gb_Library_add_linked_libs,vcl,\ + cairo \ +)) +endif + ifeq ($(GUIBASE),unx) $(eval $(call gb_Library_set_ldflags,vcl,\ $$(LDFLAGS) \ diff --git a/vcl/source/components/rasterizer_rsvg.cxx b/vcl/source/components/rasterizer_rsvg.cxx index 006b30b28e28..b68aaa1fda8c 100644 --- a/vcl/source/components/rasterizer_rsvg.cxx +++ b/vcl/source/components/rasterizer_rsvg.cxx @@ -37,23 +37,25 @@ #include #include +#ifdef SYSTEM_CAIRO +#include +#else +#include +#endif + #include #if defined MACOSX #define VCL_RSVG_GOBJECT_LIBNAME "libgobject-2.0.0.dylib" - #define VCL_RSVG_CAIRO_LIBNAME "libcairo.2.dylib" #define VCL_RSVG_LIBRSVG_LIBNAME "librsvg-2.2.dylib" #elif defined UNX #define VCL_RSVG_GOBJECT_LIBNAME "libgobject-2.0.so" - #define VCL_RSVG_CAIRO_LIBNAME "libcairo.so" #define VCL_RSVG_LIBRSVG_LIBNAME "librsvg-2.so" #elif defined WNT #define VCL_RSVG_GOBJECT_LIBNAME "gobjectlo.dll" - #define VCL_RSVG_CAIRO_LIBNAME "cairo.dll" #define VCL_RSVG_LIBRSVG_LIBNAME "librsvg-2-2.dll" #else #define VCL_RSVG_GOBJECT_LIBNAME "nogobjectlib" - #define VCL_RSVG_CAIRO_LIBNAME "nocairolib" #define VCL_RSVG_LIBRSVG_LIBNAME "nolibrsvglib" #endif @@ -72,18 +74,6 @@ typedef void* gpointer; struct GError; -enum cairo_format_t { CAIRO_FORMAT_ARGB32 = 0 }; -enum cairo_status_t { CAIRO_STATUS_SUCCESS = 0 }; - -struct cairo_surface_t; -struct cairo_t; -struct cairo_matrix_t -{ - double xx; double yx; - double xy; double yy; - double x0; double y0; -}; - struct RsvgHandle; struct RsvgDimensionData { @@ -126,29 +116,11 @@ public: static LibraryWrapper& get(); - bool isValid() const { return( ( mpGObjectLib != NULL ) && ( mpCairoLib != NULL ) && ( mpRSVGLib != NULL ) ); } + bool isValid() const { return( ( mpGObjectLib != NULL ) && ( mpRSVGLib != NULL ) ); } // G-Object gpointer g_object_unref( gpointer pointer ) { return( (*mp_g_object_unref)( pointer ) ); }; - // LibRSVG - - // Cairo - cairo_surface_t* image_surface_create( cairo_format_t format, int width, int height ) { return( (*mp_image_surface_create)( format, width, height ) ); } - void surface_destroy( cairo_surface_t* surface ) { (*mp_surface_destroy)( surface ); } - cairo_status_t surface_status( cairo_surface_t* surface ) { return( (*mp_surface_status)( surface ) ); } - cairo_t* create( cairo_surface_t* surface ) { return( (*mp_create)( surface ) ); } - void destroy( cairo_t* cairo ) { (*mp_destroy )( cairo ); } - void matrix_init_identity( cairo_matrix_t* matrix ){ (*mp_matrix_init_identity)( matrix ); } - void matrix_translate( cairo_matrix_t* matrix, double nx, double ny ) { (*mp_matrix_translate)( matrix, nx, ny ); } - void matrix_scale( cairo_matrix_t* matrix, double sx, double sy ) {( *mp_matrix_scale )( matrix, sx, sy ); } - void matrix_rotate( cairo_matrix_t* matrix, double radians ) { ( *mp_matrix_rotate )( matrix, radians ); } - void transform( cairo_t* cairo, cairo_matrix_t *matrix ) { (*mp_transform)( cairo, matrix ); } - unsigned char* image_surface_get_data(cairo_surface_t* surface) { return( (*mp_image_surface_get_data)( surface ) ); } - int image_surface_get_width(cairo_surface_t* surface) { return( (*mp_image_surface_get_width)( surface ) ); } - int image_surface_get_height(cairo_surface_t* surface) { return( (*mp_image_surface_get_height)( surface ) ); } - int image_surface_get_stride(cairo_surface_t* surface) { return( (*mp_image_surface_get_stride)( surface ) ); } - // LibRSVG void rsvg_init() { (*mp_rsvg_init)(); } RsvgHandle* rsvg_handle_new_from_data( const guint8* data, gsize size, GError** error) { return( (*mp_rsvg_handle_new_from_data)( data, size, error ) ); } @@ -164,28 +136,11 @@ private: private: oslModule mpGObjectLib; - oslModule mpCairoLib; oslModule mpRSVGLib; // GObject gpointer (*mp_g_object_unref)( gpointer ); - // Cairo - cairo_surface_t* (*mp_image_surface_create)(cairo_format_t,int,int); - void (*mp_surface_destroy )(cairo_surface_t*); - cairo_status_t (*mp_surface_status)(cairo_surface_t*); - cairo_t* (*mp_create)(cairo_surface_t*); - void (*mp_destroy)(cairo_t*); - void (*mp_matrix_init_identity)(cairo_matrix_t*); - void (*mp_matrix_translate)( cairo_matrix_t*, double, double); - void (*mp_matrix_scale )( cairo_matrix_t*, double, double); - void (*mp_matrix_rotate)( cairo_matrix_t*, double); - void (*mp_transform)( cairo_t*, cairo_matrix_t*); - unsigned char* (*mp_image_surface_get_data)( cairo_surface_t* ); - int (*mp_image_surface_get_width)(cairo_surface_t* surface); - int (*mp_image_surface_get_height)(cairo_surface_t* surface); - int (*mp_image_surface_get_stride)(cairo_surface_t* surface); - // LibRSVG void (*mp_rsvg_init)( void ); RsvgHandle* (*mp_rsvg_handle_new_from_data)( const guint8*, gsize, GError** ); @@ -211,11 +166,9 @@ LibraryWrapper& LibraryWrapper::get() LibraryWrapper::LibraryWrapper() : mpGObjectLib( NULL ), - mpCairoLib( NULL ), mpRSVGLib( NULL ) { const ::rtl::OUString aGObjectLibName( RTL_CONSTASCII_USTRINGPARAM( VCL_RSVG_GOBJECT_LIBNAME ) ); - const ::rtl::OUString aCairoLibName( RTL_CONSTASCII_USTRINGPARAM( VCL_RSVG_CAIRO_LIBNAME ) ); const ::rtl::OUString aRSVGLibName( RTL_CONSTASCII_USTRINGPARAM( VCL_RSVG_LIBRSVG_LIBNAME ) ); bool bCont = true; @@ -235,47 +188,6 @@ LibraryWrapper::LibraryWrapper() : } } - // Cairo - if( bCont && ( NULL != ( mpCairoLib = osl_loadModule( aCairoLibName.pData, SAL_LOADMODULE_DEFAULT ) ) || - NULL != ( mpCairoLib = osl_loadModuleRelative( (oslGenericFunction)LibraryWrapper::get, - aCairoLibName.pData, SAL_LOADMODULE_DEFAULT ) ) - ) ) - { - mp_image_surface_create = ( cairo_surface_t* (*)( cairo_format_t, int, int ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_image_surface_create" ); - mp_surface_destroy = ( void (*)( cairo_surface_t* ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_surface_destroy" ); - mp_surface_status = ( cairo_status_t (*)( cairo_surface_t* ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_surface_status" ); - mp_create = ( cairo_t* (*)( cairo_surface_t* ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_create" ); - mp_destroy = ( void (*)( cairo_t* ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_destroy" ); - mp_matrix_init_identity = ( void (*)( cairo_matrix_t* ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_matrix_init_identity" ); - mp_matrix_translate = ( void (*)( cairo_matrix_t*, double, double ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_matrix_translate" ); - mp_matrix_scale = ( void (*)( cairo_matrix_t*, double, double ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_matrix_scale" ); - mp_matrix_rotate = ( void (*)( cairo_matrix_t*, double ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_matrix_rotate" ); - mp_transform = ( void (*)( cairo_t*, cairo_matrix_t* ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_transform" ); - mp_image_surface_get_data = ( unsigned char* (*)( cairo_surface_t* ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_image_surface_get_data" ); - mp_image_surface_get_width = ( int (*)( cairo_surface_t* ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_image_surface_get_width" ); - mp_image_surface_get_height = ( int (*)( cairo_surface_t* ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_image_surface_get_height" ); - mp_image_surface_get_stride = ( int (*)( cairo_surface_t* ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_image_surface_get_stride" ); - - if( !( mp_image_surface_create && - mp_surface_destroy && - mp_surface_status && - mp_create && - mp_destroy && - mp_matrix_init_identity && - mp_matrix_translate && - mp_matrix_scale && - mp_matrix_rotate && - mp_transform && - mp_image_surface_get_data && - mp_image_surface_get_width && - mp_image_surface_get_height && - mp_image_surface_get_stride ) ) - { - OSL_TRACE( "not all needed symbols were found in cairo library" ); - bCont = false; - } - } - // LibRSVG if( bCont && ( NULL != ( mpRSVGLib = osl_loadModule( aRSVGLibName.pData, SAL_LOADMODULE_DEFAULT ) ) || NULL != ( mpRSVGLib = osl_loadModuleRelative( (oslGenericFunction)LibraryWrapper::get, @@ -302,10 +214,9 @@ LibraryWrapper::LibraryWrapper() : } OSL_ENSURE( mpGObjectLib, "g-object library could not be loaded" ); - OSL_ENSURE( mpCairoLib, "cairo library could not be loaded" ); OSL_ENSURE( mpRSVGLib, "librsvg library could not be loaded" ); - bCont = bCont && mpGObjectLib != NULL && mpCairoLib != NULL && mpRSVGLib != NULL; + bCont = bCont && mpGObjectLib != NULL && mpRSVGLib != NULL; // unload all libraries in case of failure if( !bCont ) @@ -316,12 +227,6 @@ LibraryWrapper::LibraryWrapper() : mpRSVGLib = NULL; } - if( mpCairoLib ) - { - osl_unloadModule( mpCairoLib ); - mpCairoLib = NULL; - } - if( mpGObjectLib ) { osl_unloadModule( mpGObjectLib ); @@ -426,11 +331,10 @@ void Rasterizer::implFreeRsvgHandle() uno::Reference< graphic::XGraphic > Rasterizer::implGetXGraphicFromSurface( cairo_surface_t* pSurface ) const { - LibraryWrapper& rLib = LibraryWrapper::get(); - unsigned char* pData = rLib.image_surface_get_data( pSurface ); - const sal_Int32 nWidth = rLib.image_surface_get_width( pSurface ); - const sal_Int32 nHeight =rLib.image_surface_get_height( pSurface ); - const sal_Int32 nStride = rLib.image_surface_get_stride( pSurface ); + unsigned char* pData = cairo_image_surface_get_data( pSurface ); + const sal_Int32 nWidth = cairo_image_surface_get_width( pSurface ); + const sal_Int32 nHeight = cairo_image_surface_get_height( pSurface ); + const sal_Int32 nStride = cairo_image_surface_get_stride( pSurface ); uno::Reference< graphic::XGraphic > xRet; @@ -563,31 +467,31 @@ uno::Reference< graphic::XGraphic > SAL_CALL Rasterizer::rasterize( ::sal_uInt32 if( mpRsvgHandle && rLib.isValid() && nWidth && nHeight && mnDefaultWidth && mnDefaultHeight ) { - cairo_surface_t* pSurface = rLib.image_surface_create( CAIRO_FORMAT_ARGB32, nWidth, nHeight ); + cairo_surface_t* pSurface = cairo_image_surface_create( CAIRO_FORMAT_ARGB32, nWidth, nHeight ); - if( pSurface && ( CAIRO_STATUS_SUCCESS == rLib.surface_status( pSurface ) ) ) + if( pSurface && ( CAIRO_STATUS_SUCCESS == cairo_surface_status( pSurface ) ) ) { - cairo_t* pCr = rLib.create( pSurface ); + cairo_t* pCr = cairo_create( pSurface ); if( pCr ) { cairo_matrix_t aMatrix; - rLib.matrix_init_identity( &aMatrix ); - rLib.matrix_scale( &aMatrix, + cairo_matrix_init_identity( &aMatrix ); + cairo_matrix_scale( &aMatrix, static_cast< double >( nWidth ) / mnDefaultWidth, static_cast< double >( nHeight ) / mnDefaultHeight ); - rLib.transform( pCr, &aMatrix ); + cairo_transform( pCr, &aMatrix ); if( rLib.rsvg_handle_render_cairo( mpRsvgHandle, pCr ) ) { xRet = implGetXGraphicFromSurface( pSurface ); } - rLib.destroy( pCr ); + cairo_destroy( pCr ); } - rLib.surface_destroy( pSurface ); + cairo_surface_destroy( pSurface ); OSL_ENSURE( xRet.is(), "SVG *not* rendered successfully" ); } } -- cgit v1.2.3 From 64c7d47de69e2e7a249556d9322d40104fed72c1 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 4 Jul 2011 13:53:26 +0100 Subject: conditionalize this for librsvg --- vcl/Library_vcl.mk | 12 +++++++++++- vcl/source/components/factory.cxx | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'vcl') diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 7105599bde14..1bf73031d27d 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -245,7 +245,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/source/components/dtranscomp \ vcl/source/components/factory \ vcl/source/components/fontident \ - vcl/source/components/rasterizer_rsvg \ vcl/source/components/stringmirror \ vcl/source/control/button \ vcl/source/control/combobox \ @@ -434,6 +433,16 @@ endif endif ## handle Cairo +ifneq ($(ENABLE_LIBRSVG),NO) + +$(eval $(call gb_Library_add_exception_objects,vcl,\ + vcl/source/components/rasterizer_rsvg \ +)) + +$(eval $(call gb_Library_set_defs,vcl,\ + $$(DEFS) \ + -DENABLE_LIBRSVG \ +)) ifeq ($(SYSTEM_CAIRO),YES) $(eval $(call gb_Library_set_cxxflags,vcl,\ $$(CXXFLAGS) \ @@ -449,6 +458,7 @@ $(eval $(call gb_Library_add_linked_libs,vcl,\ cairo \ )) endif +endif ifeq ($(GUIBASE),unx) $(eval $(call gb_Library_set_ldflags,vcl,\ diff --git a/vcl/source/components/factory.cxx b/vcl/source/components/factory.cxx index f4665832a9a8..de76b6e84c58 100644 --- a/vcl/source/components/factory.cxx +++ b/vcl/source/components/factory.cxx @@ -144,12 +144,14 @@ extern "C" { xMgr, vcl::DropTarget_getImplementationName(), vcl::DropTarget_createInstance, vcl::DropTarget_getSupportedServiceNames() ); } +#ifdef ENABLE_LIBRSVG else if( vcl::rsvg::Rasterizer_getImplementationName().equalsAscii( pImplementationName ) ) { xFactory = ::cppu::createSingleFactory( xMgr, vcl::rsvg::Rasterizer_getImplementationName(), vcl::rsvg::Rasterizer_createInstance, vcl::rsvg::Rasterizer_getSupportedServiceNames() ); } +#endif if( xFactory.is() ) { xFactory->acquire(); -- cgit v1.2.3 From 4281dfd19a1f36f1bf286f3ea85d432b829bf175 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 4 Jul 2011 21:27:35 +0300 Subject: Experimental dummy hacks for Android and iOS --- vcl/Library_vcl.mk | 17 ++++++++++++++ vcl/null/printerinfomanager.cxx | 51 +++++++++++++++++++++++++++++++++++++++++ vcl/vcl.android.component | 43 ++++++++++++++++++++++++++++++++++ vcl/vcl.ios.component | 43 ++++++++++++++++++++++++++++++++++ 4 files changed, 154 insertions(+) create mode 100644 vcl/null/printerinfomanager.cxx create mode 100644 vcl/vcl.android.component create mode 100644 vcl/vcl.ios.component (limited to 'vcl') diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 1bf73031d27d..9ce6dee48124 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -31,6 +31,10 @@ ifeq ($(OS),MACOSX) $(eval $(call gb_Library_set_componentfile,vcl,vcl/vcl.macosx,vcl/vcl)) else ifeq ($(OS),WNT) $(eval $(call gb_Library_set_componentfile,vcl,vcl/vcl.windows,vcl/vcl)) +else ifeq ($(GUIBASE),android) +$(eval $(call gb_Library_set_componentfile,vcl,vcl/vcl.android,vcl/vcl)) +else ifeq ($(OS),IOS) +$(eval $(call gb_Library_set_componentfile,vcl,vcl/vcl.ios,vcl/vcl)) else $(eval $(call gb_Library_set_componentfile,vcl,vcl/vcl.unx,vcl/vcl)) endif @@ -191,6 +195,19 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ )) endif +ifeq ($(GUIBASE),android) +$(eval $(call gb_Library_set_defs,vcl,\ + $$(DEFS) \ + -DSAL_DLLPREFIX=\"$(gb_Library_SYSPRE)\" \ + -DSAL_DLLPOSTFIX=\"$(gb_Library_OOOEXT)\" \ + -D_XSALSET_LIBNAME=\"$(call gb_Library_get_runtime_filename,spa)\" \ +)) +$(eval $(call gb_Library_add_exception_objects,vcl,\ + vcl/unx/generic/plugadapt/salplug \ + vcl/null/printerinfomanager \ +)) +endif + ifeq ($(OS),WNT) $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/win/source/app/saldata \ diff --git a/vcl/null/printerinfomanager.cxx b/vcl/null/printerinfomanager.cxx new file mode 100644 index 000000000000..7361606c35b3 --- /dev/null +++ b/vcl/null/printerinfomanager.cxx @@ -0,0 +1,51 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 "vcl/printerinfomanager.hxx" + +#include "unx/saldata.hxx" + +using namespace psp; +using namespace osl; + +using ::rtl::OUString; +using ::rtl::OString; +using ::rtl::OStringToOUString; +using ::rtl::OUStringHash; + +void PrinterInfoManager::release() +{ + SalData* pSalData = GetSalData(); + delete pSalData->m_pPIManager; + pSalData->m_pPIManager = NULL; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/vcl.android.component b/vcl/vcl.android.component new file mode 100644 index 000000000000..5dd80ebe0029 --- /dev/null +++ b/vcl/vcl.android.component @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + diff --git a/vcl/vcl.ios.component b/vcl/vcl.ios.component new file mode 100644 index 000000000000..5dd80ebe0029 --- /dev/null +++ b/vcl/vcl.ios.component @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + -- cgit v1.2.3 From 30804502d9cd0a8c360d4aa1ab02643c4694b924 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 6 Jul 2011 20:58:09 +0300 Subject: Drop Win9x and NT4 code --- vcl/inc/win/saldata.hxx | 2 - vcl/inc/win/salprn.h | 3 - vcl/win/source/app/salinst.cxx | 4 - vcl/win/source/gdi/salprn.cxx | 746 ++++++------------------------------- vcl/win/source/window/salframe.cxx | 54 +-- 5 files changed, 123 insertions(+), 686 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/win/saldata.hxx b/vcl/inc/win/saldata.hxx index ca0a19f4361a..ba9068628c8c 100644 --- a/vcl/inc/win/saldata.hxx +++ b/vcl/inc/win/saldata.hxx @@ -162,8 +162,6 @@ struct SalShlData UINT mnWheelScrollChars; // WheelScrollChars UINT mnWheelMsgId; // Wheel-Message-Id fuer W95 BOOL mbWXP; // Windows XP - BOOL mbWPrinter; // true: use unicode printer functions - // false: use anis compat printer functions OSVERSIONINFO maVersionInfo; }; diff --git a/vcl/inc/win/salprn.h b/vcl/inc/win/salprn.h index 6b399f99f971..80399d5eb3e9 100755 --- a/vcl/inc/win/salprn.h +++ b/vcl/inc/win/salprn.h @@ -37,15 +37,12 @@ // WNT3 #define SAL_DRIVERDATA_SYSSIGN ((sal_uIntPtr)0x574E5433) -#define SAL_DRIVERDATA_VERSION_A 1 -#define SAL_DRIVERDATA_VERSION_W 2 #pragma pack( 1 ) struct SalDriverData { sal_uIntPtr mnSysSignature; - sal_uInt16 mnVersion; sal_uInt16 mnDriverOffset; BYTE maDriverData[1]; }; diff --git a/vcl/win/source/app/salinst.cxx b/vcl/win/source/app/salinst.cxx index 6db248c0ddb4..b06d3cc672d6 100644 --- a/vcl/win/source/app/salinst.cxx +++ b/vcl/win/source/app/salinst.cxx @@ -516,8 +516,6 @@ SalInstance* CreateSalInstance() // determine the windows version aSalShlData.mbWXP = 0; - aSalShlData.mbWPrinter = 0; - WORD nVer = (WORD)GetVersion(); rtl_zeroMemory( &aSalShlData.maVersionInfo, sizeof(aSalShlData.maVersionInfo) ); aSalShlData.maVersionInfo.dwOSVersionInfoSize = sizeof( aSalShlData.maVersionInfo ); if ( GetVersionEx( &aSalShlData.maVersionInfo ) ) @@ -526,8 +524,6 @@ SalInstance* CreateSalInstance() if ( aSalShlData.maVersionInfo.dwMajorVersion > 5 || ( aSalShlData.maVersionInfo.dwMajorVersion == 5 && aSalShlData.maVersionInfo.dwMinorVersion >= 1 ) ) aSalShlData.mbWXP = 1; - if( aSalShlData.maVersionInfo.dwMajorVersion >= 5 ) - aSalShlData.mbWPrinter = 1; } pSalData->mnAppThreadId = GetCurrentThreadId(); diff --git a/vcl/win/source/gdi/salprn.cxx b/vcl/win/source/gdi/salprn.cxx index 07a6b633e11b..ae8d93382985 100644 --- a/vcl/win/source/gdi/salprn.cxx +++ b/vcl/win/source/gdi/salprn.cxx @@ -110,24 +110,11 @@ static char aImplWindows[] = "windows"; static char aImplDevices[] = "devices"; static char aImplDevice[] = "device"; -static LPDEVMODEA SAL_DEVMODE_A( const ImplJobSetup* pSetupData ) -{ - LPDEVMODEA pRet = NULL; - SalDriverData* pDrv = (SalDriverData*)pSetupData->mpDriverData; - if( pDrv->mnVersion == SAL_DRIVERDATA_VERSION_A && - pSetupData->mnDriverDataLen >= sizeof(DEVMODEA)+sizeof(SalDriverData)-1 - ) - pRet = ((LPDEVMODEA)((pSetupData->mpDriverData) + (pDrv->mnDriverOffset))); - return pRet; -} - static LPDEVMODEW SAL_DEVMODE_W( const ImplJobSetup* pSetupData ) { LPDEVMODEW pRet = NULL; SalDriverData* pDrv = (SalDriverData*)pSetupData->mpDriverData; - if( pDrv->mnVersion == SAL_DRIVERDATA_VERSION_W && - pSetupData->mnDriverDataLen >= sizeof(DEVMODEW)+sizeof(SalDriverData)-1 - ) + if( pSetupData->mnDriverDataLen >= sizeof(DEVMODEW)+sizeof(SalDriverData)-1 ) pRet = ((LPDEVMODEW)((pSetupData->mpDriverData) + (pDrv->mnDriverOffset))); return pRet; } @@ -192,140 +179,8 @@ static sal_uLong ImplWinQueueStatusToSal( DWORD nWinStatus ) // ----------------------------------------------------------------------- -static void getPrinterQueueInfoOldStyle( ImplPrnQueueList* pList ) -{ - DWORD i; - DWORD n; - DWORD nBytes = 0; - DWORD nInfoPrn2; - sal_Bool bFound = FALSE; - PRINTER_INFO_2* pWinInfo2 = NULL; - PRINTER_INFO_2* pGetInfo2; - EnumPrintersA( PRINTER_ENUM_LOCAL, NULL, 2, NULL, 0, &nBytes, &nInfoPrn2 ); - if ( nBytes ) - { - pWinInfo2 = (PRINTER_INFO_2*) rtl_allocateMemory( nBytes ); - if ( EnumPrintersA( PRINTER_ENUM_LOCAL, NULL, 2, (LPBYTE)pWinInfo2, nBytes, &nBytes, &nInfoPrn2 ) ) - { - pGetInfo2 = pWinInfo2; - for ( i = 0; i < nInfoPrn2; i++ ) - { - SalPrinterQueueInfo* pInfo = new SalPrinterQueueInfo; - pInfo->maPrinterName = ImplSalGetUniString( pGetInfo2->pPrinterName ); - pInfo->maDriver = ImplSalGetUniString( pGetInfo2->pDriverName ); - XubString aPortName; - if ( pGetInfo2->pPortName ) - aPortName = ImplSalGetUniString( pGetInfo2->pPortName ); - // pLocation can be 0 (the Windows docu doesn't describe this) - if ( pGetInfo2->pLocation && strlen( pGetInfo2->pLocation ) ) - pInfo->maLocation = ImplSalGetUniString( pGetInfo2->pLocation ); - else - pInfo->maLocation = aPortName; - // pComment can be 0 (the Windows docu doesn't describe this) - if ( pGetInfo2->pComment ) - pInfo->maComment = ImplSalGetUniString( pGetInfo2->pComment ); - pInfo->mnStatus = ImplWinQueueStatusToSal( pGetInfo2->Status ); - pInfo->mnJobs = pGetInfo2->cJobs; - pInfo->mpSysData = new XubString( aPortName ); - pList->Add( pInfo ); - pGetInfo2++; - } - - bFound = TRUE; - } - } - - // read printers from win.ini - // TODO: MSDN: GetProfileString() should not be called from server - // code because it is just there for WIN16 compatibility - UINT nSize = 4096; - char* pBuf = new char[nSize]; - UINT nRead = GetProfileStringA( aImplDevices, NULL, "", pBuf, nSize ); - while ( nRead >= nSize-2 ) - { - nSize += 2048; - delete []pBuf; - pBuf = new char[nSize]; - nRead = GetProfileStringA( aImplDevices, NULL, "", pBuf, nSize ); - } - - // extract printer names from buffer and fill list - char* pName = pBuf; - while ( *pName ) - { - char* pPortName; - char* pTmp; - char aPortBuf[256]; - GetProfileStringA( aImplDevices, pName, "", aPortBuf, sizeof( aPortBuf ) ); - - pPortName = aPortBuf; - - // create name - xub_StrLen nNameLen = sal::static_int_cast(strlen( pName )); - XubString aName( ImplSalGetUniString( pName, nNameLen ) ); - - // get driver name - pTmp = pPortName; - while ( *pTmp != ',' ) - pTmp++; - XubString aDriver( ImplSalGetUniString( pPortName, (sal_uInt16)(pTmp-pPortName) ) ); - pPortName = pTmp; - - // get port names - do - { - pPortName++; - pTmp = pPortName; - while ( *pTmp && (*pTmp != ',') ) - pTmp++; - - String aPortName( ImplSalGetUniString( pPortName, (sal_uInt16)(pTmp-pPortName) ) ); - - // create new entry - // look up if printer was already found in first loop - sal_Bool bAdd = TRUE; - if ( pWinInfo2 ) - { - pGetInfo2 = pWinInfo2; - for ( n = 0; n < nInfoPrn2; n++ ) - { - if ( aName.EqualsIgnoreCaseAscii( pGetInfo2->pPrinterName ) ) - { - bAdd = FALSE; - break; - } - pGetInfo2++; - } - } - // if it's a new printer, add it - if ( bAdd ) - { - SalPrinterQueueInfo* pInfo = new SalPrinterQueueInfo; - pInfo->maPrinterName = aName; - pInfo->maDriver = aDriver; - pInfo->maLocation = aPortName; - pInfo->mnStatus = 0; - pInfo->mnJobs = QUEUE_JOBS_DONTKNOW; - pInfo->mpSysData = new XubString( aPortName ); - pList->Add( pInfo ); - } - } - while ( *pTmp == ',' ); - - pName += nNameLen + 1; - } - - delete []pBuf; - rtl_freeMemory( pWinInfo2 ); -} - void WinSalInstance::GetPrinterQueueInfo( ImplPrnQueueList* pList ) { - if( ! aSalShlData.mbWPrinter ) - { - getPrinterQueueInfoOldStyle( pList ); - return; - } DWORD i; DWORD nBytes = 0; DWORD nInfoPrn4 = 0; @@ -352,59 +207,8 @@ void WinSalInstance::GetPrinterQueueInfo( ImplPrnQueueList* pList ) // ----------------------------------------------------------------------- -static void getPrinterQueueStateOldStyle( SalPrinterQueueInfo* pInfo ) -{ - DWORD nBytes = 0; - DWORD nInfoRet; - PRINTER_INFO_2* pWinInfo2; - EnumPrintersA( PRINTER_ENUM_LOCAL, NULL, 2, NULL, 0, &nBytes, &nInfoRet ); - if ( nBytes ) - { - pWinInfo2 = (PRINTER_INFO_2*) rtl_allocateMemory( nBytes ); - if ( EnumPrintersA( PRINTER_ENUM_LOCAL, NULL, 2, (LPBYTE)pWinInfo2, nBytes, &nBytes, &nInfoRet ) ) - { - PRINTER_INFO_2* pGetInfo2 = pWinInfo2; - for ( DWORD i = 0; i < nInfoRet; i++ ) - { - if ( pInfo->maPrinterName.EqualsAscii( pGetInfo2->pPrinterName ) && - ( pInfo->maDriver.Len() == 0 || - pInfo->maDriver.EqualsAscii( pGetInfo2->pDriverName ) ) - ) - { - XubString aPortName; - if ( pGetInfo2->pPortName ) - aPortName = ImplSalGetUniString( pGetInfo2->pPortName ); - // pLocation can be 0 (the Windows docu doesn't describe this) - if ( pGetInfo2->pLocation && strlen( pGetInfo2->pLocation ) ) - pInfo->maLocation = ImplSalGetUniString( pGetInfo2->pLocation ); - else - pInfo->maLocation = aPortName; - // pComment can be 0 (the Windows docu doesn't describe this) - if ( pGetInfo2->pComment ) - pInfo->maComment = ImplSalGetUniString( pGetInfo2->pComment ); - pInfo->mnStatus = ImplWinQueueStatusToSal( pGetInfo2->Status ); - pInfo->mnJobs = pGetInfo2->cJobs; - if( ! pInfo->mpSysData ) - pInfo->mpSysData = new XubString( aPortName ); - break; - } - - pGetInfo2++; - } - } - - rtl_freeMemory( pWinInfo2 ); - } -} - void WinSalInstance::GetPrinterQueueState( SalPrinterQueueInfo* pInfo ) { - if( ! aSalShlData.mbWPrinter ) - { - getPrinterQueueStateOldStyle( pInfo ); - return; - } - HANDLE hPrinter = 0; LPWSTR pPrnName = reinterpret_cast(const_cast(pInfo->maPrinterName.GetBuffer())); if( OpenPrinterW( pPrnName, &hPrinter, NULL ) ) @@ -451,43 +255,19 @@ void WinSalInstance::DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo ) // ----------------------------------------------------------------------- XubString WinSalInstance::GetDefaultPrinter() { - static bool bGetDefPrtAPI = true; - static sal_Bool(WINAPI*pGetDefaultPrinter)(LPWSTR,LPDWORD) = NULL; - // try to use GetDefaultPrinter API (not available prior to W2000) - if( bGetDefPrtAPI ) + DWORD nChars = 0; + GetDefaultPrinterW( NULL, &nChars ); + if( nChars ) { - bGetDefPrtAPI = false; - // check for W2k and XP - if( aSalShlData.maVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT && aSalShlData.maVersionInfo.dwMajorVersion >= 5 ) + LPWSTR pStr = (LPWSTR)rtl_allocateMemory(nChars*sizeof(WCHAR)); + XubString aDefPrt; + if( GetDefaultPrinterW( pStr, &nChars ) ) { - OUString aLibraryName( RTL_CONSTASCII_USTRINGPARAM( "winspool.drv" ) ); - oslModule pLib = osl_loadModule( aLibraryName.pData, SAL_LOADMODULE_DEFAULT ); - oslGenericFunction pFunc = NULL; - if( pLib ) - { - OUString queryFuncName( RTL_CONSTASCII_USTRINGPARAM( "GetDefaultPrinterW" ) ); - pFunc = osl_getFunctionSymbol( pLib, queryFuncName.pData ); - } - - pGetDefaultPrinter = (sal_Bool(WINAPI*)(LPWSTR,LPDWORD)) pFunc; - } - } - if( pGetDefaultPrinter ) - { - DWORD nChars = 0; - pGetDefaultPrinter( NULL, &nChars ); - if( nChars ) - { - LPWSTR pStr = (LPWSTR)rtl_allocateMemory(nChars*sizeof(WCHAR)); - XubString aDefPrt; - if( pGetDefaultPrinter( pStr, &nChars ) ) - { - aDefPrt = reinterpret_cast(pStr); - } - rtl_freeMemory( pStr ); - if( aDefPrt.Len() ) - return aDefPrt; + aDefPrt = reinterpret_cast(pStr); } + rtl_freeMemory( pStr ); + if( aDefPrt.Len() ) + return aDefPrt; } // get default printer from win.ini @@ -511,30 +291,15 @@ XubString WinSalInstance::GetDefaultPrinter() static DWORD ImplDeviceCaps( WinSalInfoPrinter* pPrinter, WORD nCaps, BYTE* pOutput, const ImplJobSetup* pSetupData ) { - if( aSalShlData.mbWPrinter ) - { - DEVMODEW* pDevMode; - if ( !pSetupData || !pSetupData->mpDriverData ) - pDevMode = NULL; - else - pDevMode = SAL_DEVMODE_W( pSetupData ); - - return DeviceCapabilitiesW( reinterpret_cast(pPrinter->maDeviceName.GetBuffer()), - reinterpret_cast(pPrinter->maPortName.GetBuffer()), - nCaps, (LPWSTR)pOutput, pDevMode ); - } + DEVMODEW* pDevMode; + if ( !pSetupData || !pSetupData->mpDriverData ) + pDevMode = NULL; else - { - DEVMODEA* pDevMode; - if ( !pSetupData || !pSetupData->mpDriverData ) - pDevMode = NULL; - else - pDevMode = SAL_DEVMODE_A( pSetupData ); + pDevMode = SAL_DEVMODE_W( pSetupData ); - return DeviceCapabilitiesA( ImplSalGetWinAnsiString( pPrinter->maDeviceName, TRUE ).GetBuffer(), - ImplSalGetWinAnsiString( pPrinter->maPortName, TRUE ).GetBuffer(), - nCaps, (LPSTR)pOutput, pDevMode ); - } + return DeviceCapabilitiesW( reinterpret_cast(pPrinter->maDeviceName.GetBuffer()), + reinterpret_cast(pPrinter->maPortName.GetBuffer()), + nCaps, (LPWSTR)pOutput, pDevMode ); } // ----------------------------------------------------------------------- @@ -549,25 +314,15 @@ static sal_Bool ImplTestSalJobSetup( WinSalInfoPrinter* pPrinter, // initialize versions from jobsetup // those will be overwritten with driver's version - DEVMODEA* pDevModeA = NULL; DEVMODEW* pDevModeW = NULL; LONG dmSpecVersion = -1; LONG dmDriverVersion = -1; SalDriverData* pSalDriverData = (SalDriverData*)pSetupData->mpDriverData; BYTE* pDriverData = ((BYTE*)pSalDriverData) + pSalDriverData->mnDriverOffset; - if( pSalDriverData->mnVersion == SAL_DRIVERDATA_VERSION_W ) - { - if( aSalShlData.mbWPrinter ) - pDevModeW = (DEVMODEW*)pDriverData; - } - else if( pSalDriverData->mnVersion == SAL_DRIVERDATA_VERSION_A ) - { - if( ! aSalShlData.mbWPrinter ) - pDevModeA = (DEVMODEA*)pDriverData; - } + pDevModeW = (DEVMODEW*)pDriverData; long nSysJobSize = -1; - if( pPrinter && ( pDevModeA || pDevModeW ) ) + if( pPrinter && pDevModeW ) { // just too many driver crashes in that area -> check the dmSpecVersion and dmDriverVersion fields always !!! // this prevents using the jobsetup between different Windows versions (eg from XP to 9x) but we @@ -576,31 +331,16 @@ static sal_Bool ImplTestSalJobSetup( WinSalInfoPrinter* pPrinter, ByteString aPrinterNameA= ImplSalGetWinAnsiString( pPrinter->maDeviceName, TRUE ); HANDLE hPrn; LPWSTR pPrinterNameW = reinterpret_cast(const_cast(pPrinter->maDeviceName.GetBuffer())); - if ( ! aSalShlData.mbWPrinter ) - { - if ( !OpenPrinterA( (LPSTR)aPrinterNameA.GetBuffer(), &hPrn, NULL ) ) - return FALSE; - } - else - if ( !OpenPrinterW( pPrinterNameW, &hPrn, NULL ) ) - return FALSE; + if ( !OpenPrinterW( pPrinterNameW, &hPrn, NULL ) ) + return FALSE; // #131642# hPrn==HGDI_ERROR even though OpenPrinter() succeeded! if( hPrn == HGDI_ERROR ) return FALSE; - if( aSalShlData.mbWPrinter ) - { - nSysJobSize = DocumentPropertiesW( 0, hPrn, - pPrinterNameW, - NULL, NULL, 0 ); - } - else - { - nSysJobSize = DocumentPropertiesA( 0, hPrn, - (LPSTR)aPrinterNameA.GetBuffer(), - NULL, NULL, 0 ); - } + nSysJobSize = DocumentPropertiesW( 0, hPrn, + pPrinterNameW, + NULL, NULL, 0 ); if( nSysJobSize < 0 ) { @@ -609,18 +349,9 @@ static sal_Bool ImplTestSalJobSetup( WinSalInfoPrinter* pPrinter, } BYTE *pBuffer = (BYTE*)_alloca( nSysJobSize ); LONG nRet = -1; - if( aSalShlData.mbWPrinter ) - { - nRet = DocumentPropertiesW( 0, hPrn, - pPrinterNameW, - (LPDEVMODEW)pBuffer, NULL, DM_OUT_BUFFER ); - } - else - { - nRet = DocumentPropertiesA( 0, hPrn, - (LPSTR)aPrinterNameA.GetBuffer(), - (LPDEVMODEA)pBuffer, NULL, DM_OUT_BUFFER ); - } + nRet = DocumentPropertiesW( 0, hPrn, + pPrinterNameW, + (LPDEVMODEW)pBuffer, NULL, DM_OUT_BUFFER ); if( nRet < 0 ) { ClosePrinter( hPrn ); @@ -630,8 +361,8 @@ static sal_Bool ImplTestSalJobSetup( WinSalInfoPrinter* pPrinter, // the spec version differs between the windows platforms, ie 98,NT,2000/XP // this allows us to throw away printer settings from other platforms that might crash a buggy driver // we check the driver version as well - dmSpecVersion = aSalShlData.mbWPrinter ? ((DEVMODEW*)pBuffer)->dmSpecVersion : ((DEVMODEA*)pBuffer)->dmSpecVersion; - dmDriverVersion = aSalShlData.mbWPrinter ? ((DEVMODEW*)pBuffer)->dmDriverVersion : ((DEVMODEA*)pBuffer)->dmDriverVersion; + dmSpecVersion = ((DEVMODEW*)pBuffer)->dmSpecVersion; + dmDriverVersion = ((DEVMODEW*)pBuffer)->dmDriverVersion; ClosePrinter( hPrn ); } @@ -642,10 +373,6 @@ static sal_Bool ImplTestSalJobSetup( WinSalInfoPrinter* pPrinter, (long)(pSetupData->mnDriverDataLen - pSetupDriverData->mnDriverOffset) == nSysJobSize && pSetupDriverData->mnSysSignature == SAL_DRIVERDATA_SYSSIGN ) { - if( pDevModeA && - (dmSpecVersion == pDevModeA->dmSpecVersion) && - (dmDriverVersion == pDevModeA->dmDriverVersion) ) - return TRUE; if( pDevModeW && (dmSpecVersion == pDevModeW->dmSpecVersion) && (dmDriverVersion == pDevModeW->dmDriverVersion) ) @@ -670,16 +397,8 @@ static sal_Bool ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup ByteString aPrinterNameA = ImplSalGetWinAnsiString( pPrinter->maDeviceName, TRUE ); HANDLE hPrn; LPWSTR pPrinterNameW = reinterpret_cast(const_cast(pPrinter->maDeviceName.GetBuffer())); - if( aSalShlData.mbWPrinter ) - { - if ( !OpenPrinterW( pPrinterNameW, &hPrn, NULL ) ) - return FALSE; - } - else - { - if ( !OpenPrinterA( (LPSTR)aPrinterNameA.GetBuffer(), &hPrn, NULL ) ) - return FALSE; - } + if ( !OpenPrinterW( pPrinterNameW, &hPrn, NULL ) ) + return FALSE; // #131642# hPrn==HGDI_ERROR even though OpenPrinter() succeeded! if( hPrn == HGDI_ERROR ) return FALSE; @@ -692,16 +411,9 @@ static sal_Bool ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup SalDriverData* pOutBuffer = NULL; BYTE* pInBuffer = NULL; - if( aSalShlData.mbWPrinter ) - { - nSysJobSize = DocumentPropertiesW( hWnd, hPrn, - pPrinterNameW, - NULL, NULL, 0 ); - } - else - nSysJobSize = DocumentPropertiesA( hWnd, hPrn, - (LPSTR)ImplSalGetWinAnsiString( pPrinter->maDeviceName, TRUE ).GetBuffer(), - NULL, NULL, 0 ); + nSysJobSize = DocumentPropertiesW( hWnd, hPrn, + pPrinterNameW, + NULL, NULL, 0 ); if ( nSysJobSize < 0 ) { ClosePrinter( hPrn ); @@ -712,7 +424,6 @@ static sal_Bool ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup nDriverDataLen = sizeof(SalDriverData) + nSysJobSize-1; pOutBuffer = (SalDriverData*)rtl_allocateZeroMemory( nDriverDataLen ); pOutBuffer->mnSysSignature = SAL_DRIVERDATA_SYSSIGN; - pOutBuffer->mnVersion = aSalShlData.mbWPrinter ? SAL_DRIVERDATA_VERSION_W : SAL_DRIVERDATA_VERSION_A; // calculate driver data offset including structure padding pOutBuffer->mnDriverOffset = sal::static_int_cast( (char*)pOutBuffer->maDriverData - @@ -738,18 +449,9 @@ static sal_Bool ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup nMutexCount = ImplSalReleaseYieldMutex(); BYTE* pOutDevMode = (((BYTE*)pOutBuffer) + pOutBuffer->mnDriverOffset); - if( aSalShlData.mbWPrinter ) - { - nRet = DocumentPropertiesW( hWnd, hPrn, - pPrinterNameW, - (LPDEVMODEW)pOutDevMode, (LPDEVMODEW)pInBuffer, nMode ); - } - else - { - nRet = DocumentPropertiesA( hWnd, hPrn, - (LPSTR)ImplSalGetWinAnsiString( pPrinter->maDeviceName, TRUE ).GetBuffer(), - (LPDEVMODEA)pOutDevMode, (LPDEVMODEA)pInBuffer, nMode ); - } + nRet = DocumentPropertiesW( hWnd, hPrn, + pPrinterNameW, + (LPDEVMODEW)pOutDevMode, (LPDEVMODEW)pInBuffer, nMode ); if ( pVisibleDlgParent ) ImplSalAcquireYieldMutex( nMutexCount ); ClosePrinter( hPrn ); @@ -761,35 +463,17 @@ static sal_Bool ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup } // fill up string buffers with 0 so they do not influence a JobSetup's memcmp - if( aSalShlData.mbWPrinter ) + if( ((LPDEVMODEW)pOutDevMode)->dmSize >= 64 ) { - if( ((LPDEVMODEW)pOutDevMode)->dmSize >= 64 ) - { - sal_Int32 nLen = rtl_ustr_getLength( (const sal_Unicode*)((LPDEVMODEW)pOutDevMode)->dmDeviceName ); - if ( nLen < sizeof( ((LPDEVMODEW)pOutDevMode)->dmDeviceName )/sizeof(sal_Unicode) ) - memset( ((LPDEVMODEW)pOutDevMode)->dmDeviceName+nLen, 0, sizeof( ((LPDEVMODEW)pOutDevMode)->dmDeviceName )-(nLen*sizeof(sal_Unicode)) ); - } - if( ((LPDEVMODEW)pOutDevMode)->dmSize >= 166 ) - { - sal_Int32 nLen = rtl_ustr_getLength( (const sal_Unicode*)((LPDEVMODEW)pOutDevMode)->dmFormName ); - if ( nLen < sizeof( ((LPDEVMODEW)pOutDevMode)->dmFormName )/sizeof(sal_Unicode) ) - memset( ((LPDEVMODEW)pOutDevMode)->dmFormName+nLen, 0, sizeof( ((LPDEVMODEW)pOutDevMode)->dmFormName )-(nLen*sizeof(sal_Unicode)) ); - } + sal_Int32 nLen = rtl_ustr_getLength( (const sal_Unicode*)((LPDEVMODEW)pOutDevMode)->dmDeviceName ); + if ( nLen < sizeof( ((LPDEVMODEW)pOutDevMode)->dmDeviceName )/sizeof(sal_Unicode) ) + memset( ((LPDEVMODEW)pOutDevMode)->dmDeviceName+nLen, 0, sizeof( ((LPDEVMODEW)pOutDevMode)->dmDeviceName )-(nLen*sizeof(sal_Unicode)) ); } - else + if( ((LPDEVMODEW)pOutDevMode)->dmSize >= 166 ) { - if( ((LPDEVMODEA)pOutDevMode)->dmSize >= 32 ) - { - sal_Int32 nLen = strlen( (const char*)((LPDEVMODEA)pOutDevMode)->dmDeviceName ); - if ( nLen < sizeof( ((LPDEVMODEA)pOutDevMode)->dmDeviceName ) ) - memset( ((LPDEVMODEA)pOutDevMode)->dmDeviceName+nLen, 0, sizeof( ((LPDEVMODEA)pOutDevMode)->dmDeviceName )-nLen ); - } - if( ((LPDEVMODEA)pOutDevMode)->dmSize >= 102 ) - { - sal_Int32 nLen = strlen( (const char*)((LPDEVMODEA)pOutDevMode)->dmFormName ); - if ( nLen < sizeof( ((LPDEVMODEA)pOutDevMode)->dmFormName ) ) - memset( ((LPDEVMODEA)pOutDevMode)->dmFormName+nLen, 0, sizeof( ((LPDEVMODEA)pOutDevMode)->dmFormName )-nLen ); - } + sal_Int32 nLen = rtl_ustr_getLength( (const sal_Unicode*)((LPDEVMODEW)pOutDevMode)->dmFormName ); + if ( nLen < sizeof( ((LPDEVMODEW)pOutDevMode)->dmFormName )/sizeof(sal_Unicode) ) + memset( ((LPDEVMODEW)pOutDevMode)->dmFormName+nLen, 0, sizeof( ((LPDEVMODEW)pOutDevMode)->dmFormName )-(nLen*sizeof(sal_Unicode)) ); } // update data @@ -805,13 +489,12 @@ static sal_Bool ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup // ----------------------------------------------------------------------- #define DECLARE_DEVMODE( i )\ - DEVMODEA* pDevModeA = SAL_DEVMODE_A(i);\ DEVMODEW* pDevModeW = SAL_DEVMODE_W(i);\ - if( pDevModeA == NULL && pDevModeW == NULL )\ + if( pDevModeW == NULL )\ return #define CHOOSE_DEVMODE(i)\ - (pDevModeW ? pDevModeW->i : pDevModeA->i) + (pDevModeW->i) static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetupData, sal_uLong nFlags ) { @@ -1379,75 +1062,27 @@ static HDC ImplCreateICW_WithCatch( LPWSTR pDriver, return hDC; } -static HDC ImplCreateICA_WithCatch( char* pDriver, - char* pDevice, - LPDEVMODEA pDevMode ) -{ - HDC hDC = 0; - CATCH_DRIVER_EX_BEGIN; - hDC = CreateICA( pDriver, pDevice, 0, pDevMode ); - CATCH_DRIVER_EX_END_2( "exception in CreateICW" ); - return hDC; -} - - static HDC ImplCreateSalPrnIC( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetupData ) { HDC hDC = 0; - if( aSalShlData.mbWPrinter ) - { - LPDEVMODEW pDevMode; - if ( pSetupData && pSetupData->mpDriverData ) - pDevMode = SAL_DEVMODE_W( pSetupData ); - else - pDevMode = NULL; - // #95347 some buggy drivers (eg, OKI) write to those buffers in CreateIC, although declared const - so provide some space - // pl: does this hold true for Unicode functions ? - if( pPrinter->maDriverName.Len() > 2048 || pPrinter->maDeviceName.Len() > 2048 ) - return 0; - sal_Unicode pDriverName[ 4096 ]; - sal_Unicode pDeviceName[ 4096 ]; - rtl_copyMemory( pDriverName, pPrinter->maDriverName.GetBuffer(), pPrinter->maDriverName.Len()*sizeof(sal_Unicode)); - memset( pDriverName+pPrinter->maDriverName.Len(), 0, 32 ); - rtl_copyMemory( pDeviceName, pPrinter->maDeviceName.GetBuffer(), pPrinter->maDeviceName.Len()*sizeof(sal_Unicode)); - memset( pDeviceName+pPrinter->maDeviceName.Len(), 0, 32 ); - hDC = ImplCreateICW_WithCatch( reinterpret_cast< LPWSTR >(pDriverName), - reinterpret_cast< LPCWSTR >(pDeviceName), - pDevMode ); - } + LPDEVMODEW pDevMode; + if ( pSetupData && pSetupData->mpDriverData ) + pDevMode = SAL_DEVMODE_W( pSetupData ); else - { - LPDEVMODEA pDevMode; - if ( pSetupData && pSetupData->mpDriverData ) - pDevMode = SAL_DEVMODE_A( pSetupData ); - else - pDevMode = NULL; - // #95347 some buggy drivers (eg, OKI) write to those buffers in CreateIC, although declared const - so provide some space - ByteString aDriver ( ImplSalGetWinAnsiString( pPrinter->maDriverName, TRUE ) ); - ByteString aDevice ( ImplSalGetWinAnsiString( pPrinter->maDeviceName, TRUE ) ); - int n = aDriver.Len() > aDevice.Len() ? aDriver.Len() : aDevice.Len(); - // #125813# under some circumstances many printer drivers really - // seem to have a problem with the names and their conversions. - // We need to get on to of this, but haven't been able to reproduce - // the problem yet. Put the names on the stack so we get them - // with an eventual crash report. - if( n >= 2048 ) - return 0; - n += 2048; - char lpszDriverName[ 4096 ]; - char lpszDeviceName[ 4096 ]; - strncpy( lpszDriverName, aDriver.GetBuffer(), n ); - strncpy( lpszDeviceName, aDevice.GetBuffer(), n ); - // HDU: the crashes usually happen in a MBCS to unicode conversion, - // so I suspect the MBCS string's end is not properly recognized. - // The longest MBCS encoding I'm aware of has six bytes per code - // => add a couple of zeroes... - memset( lpszDriverName+aDriver.Len(), 0, 16 ); - memset( lpszDeviceName+aDevice.Len(), 0, 16 ); - hDC = ImplCreateICA_WithCatch( lpszDriverName, - lpszDeviceName, - pDevMode ); - } + pDevMode = NULL; + // #95347 some buggy drivers (eg, OKI) write to those buffers in CreateIC, although declared const - so provide some space + // pl: does this hold true for Unicode functions ? + if( pPrinter->maDriverName.Len() > 2048 || pPrinter->maDeviceName.Len() > 2048 ) + return 0; + sal_Unicode pDriverName[ 4096 ]; + sal_Unicode pDeviceName[ 4096 ]; + rtl_copyMemory( pDriverName, pPrinter->maDriverName.GetBuffer(), pPrinter->maDriverName.Len()*sizeof(sal_Unicode)); + memset( pDriverName+pPrinter->maDriverName.Len(), 0, 32 ); + rtl_copyMemory( pDeviceName, pPrinter->maDeviceName.GetBuffer(), pPrinter->maDeviceName.Len()*sizeof(sal_Unicode)); + memset( pDeviceName+pPrinter->maDeviceName.Len(), 0, 32 ); + hDC = ImplCreateICW_WithCatch( reinterpret_cast< LPWSTR >(pDriverName), + reinterpret_cast< LPCWSTR >(pDeviceName), + pDevMode ); return hDC; } @@ -1567,28 +1202,14 @@ void WinSalInfoPrinter::InitPaperFormats( const ImplJobSetup* pSetupData ) pPaperSizes = (POINT*)rtl_allocateZeroMemory(nCount*sizeof(POINT)); ImplDeviceCaps( this, DC_PAPERSIZE, (BYTE*)pPaperSizes, pSetupData ); - if( aSalShlData.mbWPrinter ) + sal_Unicode* pNamesBuffer = (sal_Unicode*)rtl_allocateMemory(nCount*64*sizeof(sal_Unicode)); + ImplDeviceCaps( this, DC_PAPERNAMES, (BYTE*)pNamesBuffer, pSetupData ); + for( DWORD i = 0; i < nCount; ++i ) { - sal_Unicode* pNamesBuffer = (sal_Unicode*)rtl_allocateMemory(nCount*64*sizeof(sal_Unicode)); - ImplDeviceCaps( this, DC_PAPERNAMES, (BYTE*)pNamesBuffer, pSetupData ); - for( DWORD i = 0; i < nCount; ++i ) - { - PaperInfo aInfo(pPaperSizes[i].x * 10, pPaperSizes[i].y * 10); - m_aPaperFormats.push_back( aInfo ); - } - rtl_freeMemory( pNamesBuffer ); - } - else - { - char* pNamesBuffer = (char*)rtl_allocateMemory(nCount*64); - ImplDeviceCaps( this, DC_PAPERNAMES, (BYTE*)pNamesBuffer, pSetupData ); - for( DWORD i = 0; i < nCount; ++i ) - { - PaperInfo aInfo(pPaperSizes[i].x * 10, pPaperSizes[i].y * 10); - m_aPaperFormats.push_back( aInfo ); - } - rtl_freeMemory( pNamesBuffer ); + PaperInfo aInfo(pPaperSizes[i].x * 10, pPaperSizes[i].y * 10); + m_aPaperFormats.push_back( aInfo ); } + rtl_freeMemory( pNamesBuffer ); rtl_freeMemory( pPaperSizes ); } @@ -1683,22 +1304,11 @@ XubString WinSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pSetupData, sa DWORD nBins = ImplDeviceCaps( this, DC_BINNAMES, NULL, pSetupData ); if ( (nPaperBin < nBins) && (nBins != GDI_ERROR) ) { - if( aSalShlData.mbWPrinter ) - { - sal_Unicode* pBuffer = new sal_Unicode[nBins*24]; - DWORD nRet = ImplDeviceCaps( this, DC_BINNAMES, (BYTE*)pBuffer, pSetupData ); - if ( nRet && (nRet != GDI_ERROR) ) - aPaperBinName = pBuffer + (nPaperBin*24); - delete [] pBuffer; - } - else - { - char* pBuffer = new char[nBins*24]; - DWORD nRet = ImplDeviceCaps( this, DC_BINNAMES, (BYTE*)pBuffer, pSetupData ); - if ( nRet && (nRet != GDI_ERROR) ) - aPaperBinName = ImplSalGetUniString( (const char*)(pBuffer + (nPaperBin*24)) ); - delete [] pBuffer; - } + sal_Unicode* pBuffer = new sal_Unicode[nBins*24]; + DWORD nRet = ImplDeviceCaps( this, DC_BINNAMES, (BYTE*)pBuffer, pSetupData ); + if ( nRet && (nRet != GDI_ERROR) ) + aPaperBinName = pBuffer + (nPaperBin*24); + delete [] pBuffer; } return aPaperBinName; @@ -1832,29 +1442,6 @@ BOOL CALLBACK SalPrintAbortProc( HDC hPrnDC, int /* nError */ ) // ----------------------------------------------------------------------- -static LPDEVMODEA ImplSalSetCopies( LPDEVMODEA pDevMode, sal_uLong nCopies, sal_Bool bCollate ) -{ - LPDEVMODEA pNewDevMode = pDevMode; - if ( pDevMode && (nCopies > 1) ) - { - if ( nCopies > 32765 ) - nCopies = 32765; - sal_uLong nDevSize = pDevMode->dmSize+pDevMode->dmDriverExtra; - pNewDevMode = (LPDEVMODEA)rtl_allocateMemory( nDevSize ); - memcpy( pNewDevMode, pDevMode, nDevSize ); - pDevMode = pNewDevMode; - pDevMode->dmFields |= DM_COPIES; - pDevMode->dmCopies = (short)(sal_uInt16)nCopies; - pDevMode->dmFields |= DM_COLLATE; - if ( bCollate ) - pDevMode->dmCollate = DMCOLLATE_TRUE; - else - pDevMode->dmCollate = DMCOLLATE_FALSE; - } - - return pNewDevMode; -} - static LPDEVMODEW ImplSalSetCopies( LPDEVMODEW pDevMode, sal_uLong nCopies, sal_Bool bCollate ) { LPDEVMODEW pNewDevMode = pDevMode; @@ -1951,15 +1538,6 @@ static int lcl_StartDocW( HDC hDC, DOCINFOW* pInfo, WinSalPrinter* pPrt ) return nRet; } -static int lcl_StartDocA( HDC hDC, DOCINFOA* pInfo, WinSalPrinter* pPrt ) -{ - int nRet = 0; - CATCH_DRIVER_EX_BEGIN; - nRet = ::StartDocA( hDC, pInfo ); - CATCH_DRIVER_EX_END( "exception in StartDocW", pPrt ); - return nRet; -} - sal_Bool WinSalPrinter::StartJob( const XubString* pFileName, const XubString& rJobName, const XubString&, @@ -1973,65 +1551,28 @@ sal_Bool WinSalPrinter::StartJob( const XubString* pFileName, mnCopies = nCopies; mbCollate = bCollate; - LPDEVMODEA pOrgDevModeA = NULL; - LPDEVMODEA pDevModeA = NULL; LPDEVMODEW pOrgDevModeW = NULL; LPDEVMODEW pDevModeW = NULL; HDC hDC = 0; - if( aSalShlData.mbWPrinter ) + if ( pSetupData && pSetupData->mpDriverData ) { - if ( pSetupData && pSetupData->mpDriverData ) - { - pOrgDevModeW = SAL_DEVMODE_W( pSetupData ); - pDevModeW = ImplSalSetCopies( pOrgDevModeW, nCopies, bCollate ); - } - else - pDevModeW = NULL; - - // #95347 some buggy drivers (eg, OKI) write to those buffers in CreateDC, although declared const - so provide some space - sal_Unicode aDrvBuf[4096]; - sal_Unicode aDevBuf[4096]; - rtl_copyMemory( aDrvBuf, mpInfoPrinter->maDriverName.GetBuffer(), (mpInfoPrinter->maDriverName.Len()+1)*sizeof(sal_Unicode)); - rtl_copyMemory( aDevBuf, mpInfoPrinter->maDeviceName.GetBuffer(), (mpInfoPrinter->maDeviceName.Len()+1)*sizeof(sal_Unicode)); - hDC = CreateDCW( reinterpret_cast(aDrvBuf), - reinterpret_cast(aDevBuf), - NULL, - pDevModeW ); - - if ( pDevModeW != pOrgDevModeW ) - rtl_freeMemory( pDevModeW ); - } - else - { - if ( pSetupData && pSetupData->mpDriverData ) - { - pOrgDevModeA = SAL_DEVMODE_A( pSetupData ); - pDevModeA = ImplSalSetCopies( pOrgDevModeA, nCopies, bCollate ); - } - else - pDevModeA = NULL; - - // #95347 some buggy drivers (eg, OKI) write to those buffers in CreateDC, although declared const - so provide some space - ByteString aDriver ( ImplSalGetWinAnsiString( mpInfoPrinter->maDriverName, TRUE ) ); - ByteString aDevice ( ImplSalGetWinAnsiString( mpInfoPrinter->maDeviceName, TRUE ) ); - int n = aDriver.Len() > aDevice.Len() ? aDriver.Len() : aDevice.Len(); - n += 2048; - char *lpszDriverName = new char[n]; - char *lpszDeviceName = new char[n]; - strncpy( lpszDriverName, aDriver.GetBuffer(), n ); - strncpy( lpszDeviceName, aDevice.GetBuffer(), n ); - hDC = CreateDCA( lpszDriverName, - lpszDeviceName, - NULL, - pDevModeA ); - - delete [] lpszDriverName; - delete [] lpszDeviceName; - - if ( pDevModeA != pOrgDevModeA ) - rtl_freeMemory( pDevModeA ); + pOrgDevModeW = SAL_DEVMODE_W( pSetupData ); + pDevModeW = ImplSalSetCopies( pOrgDevModeW, nCopies, bCollate ); } + // #95347 some buggy drivers (eg, OKI) write to those buffers in CreateDC, although declared const - so provide some space + sal_Unicode aDrvBuf[4096]; + sal_Unicode aDevBuf[4096]; + rtl_copyMemory( aDrvBuf, mpInfoPrinter->maDriverName.GetBuffer(), (mpInfoPrinter->maDriverName.Len()+1)*sizeof(sal_Unicode)); + rtl_copyMemory( aDevBuf, mpInfoPrinter->maDeviceName.GetBuffer(), (mpInfoPrinter->maDeviceName.Len()+1)*sizeof(sal_Unicode)); + hDC = CreateDCW( reinterpret_cast(aDrvBuf), + reinterpret_cast(aDevBuf), + NULL, + pDevModeW ); + + if ( pDevModeW != pOrgDevModeW ) + rtl_freeMemory( pDevModeW ); + if ( !hDC ) { mnError = SAL_PRINTER_ERROR_GENERALERROR; @@ -2112,71 +1653,33 @@ sal_Bool WinSalPrinter::StartJob( const XubString* pFileName, } } - if( aSalShlData.mbWPrinter ) + DOCINFOW aInfo; + memset( &aInfo, 0, sizeof( DOCINFOW ) ); + aInfo.cbSize = sizeof( aInfo ); + aInfo.lpszDocName = (LPWSTR)rJobName.GetBuffer(); + if ( pFileName || aOutFileName.getLength() ) { - DOCINFOW aInfo; - memset( &aInfo, 0, sizeof( DOCINFOW ) ); - aInfo.cbSize = sizeof( aInfo ); - aInfo.lpszDocName = (LPWSTR)rJobName.GetBuffer(); - if ( pFileName || aOutFileName.getLength() ) + if ( (pFileName && pFileName->Len()) || aOutFileName.getLength() ) { - if ( (pFileName && pFileName->Len()) || aOutFileName.getLength() ) - { - aInfo.lpszOutput = (LPWSTR)( (pFileName && pFileName->Len()) ? pFileName->GetBuffer() : aOutFileName.getStr()); - } - else - aInfo.lpszOutput = L"FILE:"; + aInfo.lpszOutput = (LPWSTR)( (pFileName && pFileName->Len()) ? pFileName->GetBuffer() : aOutFileName.getStr()); } else - aInfo.lpszOutput = NULL; - - // start Job - int nRet = lcl_StartDocW( hDC, &aInfo, this ); - - if ( nRet <= 0 ) - { - long nError = GetLastError(); - if ( (nRet == SP_USERABORT) || (nRet == SP_APPABORT) || (nError == ERROR_PRINT_CANCELLED) || (nError == ERROR_CANCELLED) ) - mnError = SAL_PRINTER_ERROR_ABORT; - else - mnError = SAL_PRINTER_ERROR_GENERALERROR; - return FALSE; - } + aInfo.lpszOutput = L"FILE:"; } else + aInfo.lpszOutput = NULL; + + // start Job + int nRet = lcl_StartDocW( hDC, &aInfo, this ); + + if ( nRet <= 0 ) { - // Both strings must exist, if StartJob() is called - ByteString aJobName( ImplSalGetWinAnsiString( rJobName, TRUE ) ); - ByteString aFileName; - - DOCINFOA aInfo; - memset( &aInfo, 0, sizeof( DOCINFOA ) ); - aInfo.cbSize = sizeof( aInfo ); - aInfo.lpszDocName = (LPCSTR)aJobName.GetBuffer(); - if ( pFileName || aOutFileName.getLength() ) - { - if ( pFileName->Len() || aOutFileName.getLength() ) - { - aFileName = ImplSalGetWinAnsiString( pFileName ? *pFileName : static_cast(aOutFileName), TRUE ); - aInfo.lpszOutput = (LPCSTR)aFileName.GetBuffer(); - } - else - aInfo.lpszOutput = "FILE:"; - } + long nError = GetLastError(); + if ( (nRet == SP_USERABORT) || (nRet == SP_APPABORT) || (nError == ERROR_PRINT_CANCELLED) || (nError == ERROR_CANCELLED) ) + mnError = SAL_PRINTER_ERROR_ABORT; else - aInfo.lpszOutput = NULL; - - // start Job - int nRet = lcl_StartDocA( hDC, &aInfo, this ); - if ( nRet <= 0 ) - { - long nError = GetLastError(); - if ( (nRet == SP_USERABORT) || (nRet == SP_APPABORT) || (nError == ERROR_PRINT_CANCELLED) || (nError == ERROR_CANCELLED) ) - mnError = SAL_PRINTER_ERROR_ABORT; - else - mnError = SAL_PRINTER_ERROR_GENERALERROR; - return FALSE; - } + mnError = SAL_PRINTER_ERROR_GENERALERROR; + return FALSE; } return TRUE; @@ -2285,26 +1788,13 @@ SalGraphics* WinSalPrinter::StartPage( ImplJobSetup* pSetupData, sal_Bool bNewJo HDC hDC = mhDC; if ( pSetupData && pSetupData->mpDriverData && bNewJobData ) { - if( aSalShlData.mbWPrinter ) - { - LPDEVMODEW pOrgDevModeW; - LPDEVMODEW pDevModeW; - pOrgDevModeW = SAL_DEVMODE_W( pSetupData ); - pDevModeW = ImplSalSetCopies( pOrgDevModeW, mnCopies, mbCollate ); - ResetDCW( hDC, pDevModeW ); - if ( pDevModeW != pOrgDevModeW ) - rtl_freeMemory( pDevModeW ); - } - else - { - LPDEVMODEA pOrgDevModeA; - LPDEVMODEA pDevModeA; - pOrgDevModeA = SAL_DEVMODE_A( pSetupData ); - pDevModeA = ImplSalSetCopies( pOrgDevModeA, mnCopies, mbCollate ); - ResetDCA( hDC, pDevModeA ); - if ( pDevModeA != pOrgDevModeA ) - rtl_freeMemory( pDevModeA ); - } + LPDEVMODEW pOrgDevModeW; + LPDEVMODEW pDevModeW; + pOrgDevModeW = SAL_DEVMODE_W( pSetupData ); + pDevModeW = ImplSalSetCopies( pOrgDevModeW, mnCopies, mbCollate ); + ResetDCW( hDC, pDevModeW ); + if ( pDevModeW != pOrgDevModeW ) + rtl_freeMemory( pDevModeW ); } int nRet = 0; CATCH_DRIVER_EX_BEGIN; diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index 9541593a5c51..2ccef60923b1 100644 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -107,10 +107,6 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::container; using namespace ::com::sun::star::beans; -// The following defines are newly added in Longhorn -#ifndef WM_MOUSEHWHEEL -# define WM_MOUSEHWHEEL 0x020E -#endif #ifndef SPI_GETWHEELSCROLLCHARS # define SPI_GETWHEELSCROLLCHARS 0x006C #endif @@ -118,19 +114,10 @@ using namespace ::com::sun::star::beans; # define SPI_SETWHEELSCROLLCHARS 0x006D #endif - - #if OSL_DEBUG_LEVEL > 1 void MyOutputDebugString( char *s) { OutputDebugString( s ); } #endif -// misssing prototypes and constants for LayeredWindows -extern "C" { - //WINUSERAPI sal_Bool WINAPI SetLayeredWindowAttributes(HWND,COLORREF,BYTE,DWORD); - typedef sal_Bool ( WINAPI * SetLayeredWindowAttributes_Proc_T ) (HWND,COLORREF,BYTE,DWORD); - static SetLayeredWindowAttributes_Proc_T lpfnSetLayeredWindowAttributes; -}; - // ======================================================================= const unsigned int WM_USER_SYSTEM_WINDOW_ACTIVATED = RegisterWindowMessageA("SYSTEM_WINDOW_ACTIVATED"); @@ -139,18 +126,6 @@ sal_Bool WinSalFrame::mbInReparent = FALSE; // ======================================================================= -// Wegen Fehler in Windows-Headerfiles -#ifndef IMN_OPENCANDIDATE -#define IMN_OPENCANDIDATE 0x0005 -#endif -#ifndef IMN_CLOSECANDIDATE -#define IMN_CLOSECANDIDATE 0x0004 -#endif - -#ifndef WM_THEMECHANGED -#define WM_THEMECHANGED 0x031A -#endif - // Macros for support of WM_UNICHAR & Keyman 6.0 #define Uni_UTF32ToSurrogate1(ch) (((unsigned long) (ch) - 0x10000) / 0x400 + 0xD800) #define Uni_UTF32ToSurrogate2(ch) (((unsigned long) (ch) - 0x10000) % 0x400 + 0xDC00) @@ -326,24 +301,6 @@ SalFrame* ImplSalCreateFrame( WinSalInstance* pInst, if( getenv( "SAL_SYNCHRONIZE" ) ) // no buffering of drawing commands GdiSetBatchLimit( 1 ); - static int bLayeredAPI = -1; - if( bLayeredAPI == -1 ) - { - bLayeredAPI = 0; - // check for W2k and XP - if ( aSalShlData.maVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT && aSalShlData.maVersionInfo.dwMajorVersion >= 5 ) - { - OUString aLibraryName( RTL_CONSTASCII_USTRINGPARAM( "user32" ) ); - oslModule pLib = osl_loadModule( aLibraryName.pData, SAL_LOADMODULE_DEFAULT ); - oslGenericFunction pFunc = NULL; - if( pLib ) - pFunc = osl_getAsciiFunctionSymbol( pLib, "SetLayeredWindowAttributes" ); - - lpfnSetLayeredWindowAttributes = ( SetLayeredWindowAttributes_Proc_T ) pFunc; - - bLayeredAPI = pFunc ? 1 : 0; - } - } static const char* pEnvTransparentFloats = getenv("SAL_TRANSPARENT_FLOATS" ); // determine creation data @@ -414,7 +371,7 @@ SalFrame* ImplSalCreateFrame( WinSalInstance* pInst, { pFrame->mbNoIcon = TRUE; nExSysStyle |= WS_EX_TOOLWINDOW; - if ( pEnvTransparentFloats && bLayeredAPI == 1 /*&& !(nSalFrameStyle & SAL_FRAME_STYLE_MOVEABLE) */) + if ( pEnvTransparentFloats /*&& !(nSalFrameStyle & SAL_FRAME_STYLE_MOVEABLE) */) nExSysStyle |= WS_EX_LAYERED; } } @@ -423,7 +380,7 @@ SalFrame* ImplSalCreateFrame( WinSalInstance* pInst, nExSysStyle |= WS_EX_TOOLWINDOW; pFrame->mbFloatWin = TRUE; - if ( (bLayeredAPI == 1) && (pEnvTransparentFloats /* does not work remote! || (nSalFrameStyle & SAL_FRAME_STYLE_FLOAT_FOCUSABLE) */ ) ) + if ( (pEnvTransparentFloats /* does not work remote! || (nSalFrameStyle & SAL_FRAME_STYLE_FLOAT_FOCUSABLE) */ ) ) nExSysStyle |= WS_EX_LAYERED; } @@ -493,8 +450,8 @@ SalFrame* ImplSalCreateFrame( WinSalInstance* pInst, ImplWriteLastError( GetLastError(), "CreateWindowEx" ); #if OSL_DEBUG_LEVEL > 1 // set transparency value - if( bLayeredAPI == 1 && GetWindowExStyle( hWnd ) & WS_EX_LAYERED ) - lpfnSetLayeredWindowAttributes( hWnd, 0, 230, 0x00000002 /*LWA_ALPHA*/ ); + if( GetWindowExStyle( hWnd ) & WS_EX_LAYERED ) + SetLayeredWindowAttributes( hWnd, 0, 230, 0x00000002 /*LWA_ALPHA*/ ); #endif if ( !hWnd ) { @@ -759,8 +716,7 @@ static UINT ImplSalGetWheelScrollChars() { // Depending on Windows version, use proper default or 1 (when // driver emulates hscroll) - if( VER_PLATFORM_WIN32_NT == aSalShlData.maVersionInfo.dwPlatformId && - aSalShlData.maVersionInfo.dwMajorVersion < 6 ) + if( aSalShlData.maVersionInfo.dwMajorVersion < 6 ) { // Windows 2000 & WinXP : emulating driver, use step size // of 1 -- cgit v1.2.3 From bf02d13352942ba1da54ae86888c034e71a5a50b Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 6 Jul 2011 20:59:44 +0300 Subject: chmod -x --- vcl/inc/win/salbmp.h | 0 vcl/inc/win/salframe.h | 0 vcl/inc/win/salmenu.h | 0 vcl/inc/win/salnativewidgets.h | 0 vcl/inc/win/salobj.h | 0 vcl/inc/win/salprn.h | 0 vcl/inc/win/salsys.h | 0 vcl/inc/win/saltimer.h | 0 vcl/inc/win/salvd.h | 0 vcl/inc/win/wincomp.hxx | 0 vcl/win/source/app/saldata.cxx | 0 vcl/win/source/app/salinfo.cxx | 0 vcl/win/source/app/salshl.cxx | 0 vcl/win/source/app/saltimer.cxx | 0 vcl/win/source/gdi/salbmp.cxx | 0 vcl/win/source/gdi/salvd.cxx | 0 vcl/win/source/src/salsrc.rc | 0 vcl/win/source/window/salobj.cxx | 0 18 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 vcl/inc/win/salbmp.h mode change 100755 => 100644 vcl/inc/win/salframe.h mode change 100755 => 100644 vcl/inc/win/salmenu.h mode change 100755 => 100644 vcl/inc/win/salnativewidgets.h mode change 100755 => 100644 vcl/inc/win/salobj.h mode change 100755 => 100644 vcl/inc/win/salprn.h mode change 100755 => 100644 vcl/inc/win/salsys.h mode change 100755 => 100644 vcl/inc/win/saltimer.h mode change 100755 => 100644 vcl/inc/win/salvd.h mode change 100755 => 100644 vcl/inc/win/wincomp.hxx mode change 100755 => 100644 vcl/win/source/app/saldata.cxx mode change 100755 => 100644 vcl/win/source/app/salinfo.cxx mode change 100755 => 100644 vcl/win/source/app/salshl.cxx mode change 100755 => 100644 vcl/win/source/app/saltimer.cxx mode change 100755 => 100644 vcl/win/source/gdi/salbmp.cxx mode change 100755 => 100644 vcl/win/source/gdi/salvd.cxx mode change 100755 => 100644 vcl/win/source/src/salsrc.rc mode change 100755 => 100644 vcl/win/source/window/salobj.cxx (limited to 'vcl') diff --git a/vcl/inc/win/salbmp.h b/vcl/inc/win/salbmp.h old mode 100755 new mode 100644 diff --git a/vcl/inc/win/salframe.h b/vcl/inc/win/salframe.h old mode 100755 new mode 100644 diff --git a/vcl/inc/win/salmenu.h b/vcl/inc/win/salmenu.h old mode 100755 new mode 100644 diff --git a/vcl/inc/win/salnativewidgets.h b/vcl/inc/win/salnativewidgets.h old mode 100755 new mode 100644 diff --git a/vcl/inc/win/salobj.h b/vcl/inc/win/salobj.h old mode 100755 new mode 100644 diff --git a/vcl/inc/win/salprn.h b/vcl/inc/win/salprn.h old mode 100755 new mode 100644 diff --git a/vcl/inc/win/salsys.h b/vcl/inc/win/salsys.h old mode 100755 new mode 100644 diff --git a/vcl/inc/win/saltimer.h b/vcl/inc/win/saltimer.h old mode 100755 new mode 100644 diff --git a/vcl/inc/win/salvd.h b/vcl/inc/win/salvd.h old mode 100755 new mode 100644 diff --git a/vcl/inc/win/wincomp.hxx b/vcl/inc/win/wincomp.hxx old mode 100755 new mode 100644 diff --git a/vcl/win/source/app/saldata.cxx b/vcl/win/source/app/saldata.cxx old mode 100755 new mode 100644 diff --git a/vcl/win/source/app/salinfo.cxx b/vcl/win/source/app/salinfo.cxx old mode 100755 new mode 100644 diff --git a/vcl/win/source/app/salshl.cxx b/vcl/win/source/app/salshl.cxx old mode 100755 new mode 100644 diff --git a/vcl/win/source/app/saltimer.cxx b/vcl/win/source/app/saltimer.cxx old mode 100755 new mode 100644 diff --git a/vcl/win/source/gdi/salbmp.cxx b/vcl/win/source/gdi/salbmp.cxx old mode 100755 new mode 100644 diff --git a/vcl/win/source/gdi/salvd.cxx b/vcl/win/source/gdi/salvd.cxx old mode 100755 new mode 100644 diff --git a/vcl/win/source/src/salsrc.rc b/vcl/win/source/src/salsrc.rc old mode 100755 new mode 100644 diff --git a/vcl/win/source/window/salobj.cxx b/vcl/win/source/window/salobj.cxx old mode 100755 new mode 100644 -- cgit v1.2.3 From 2d360f03978c310371c5565bdb6b94595ef189b8 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 7 Jul 2011 16:07:38 +0100 Subject: bodge this in to help people build for the moment --- vcl/Library_vcl.mk | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'vcl') diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 9ce6dee48124..70bdad3fecd9 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -474,6 +474,12 @@ else $(eval $(call gb_Library_add_linked_libs,vcl,\ cairo \ )) +ifeq ($(OS),LINUX) +$(eval $(call gb_Library_add_linked_libs,vcl,\ + freetype \ + fontconfig \ +)) +endif endif endif -- cgit v1.2.3 From 59c08b6f768ee8b797ec51a03d1d22c7bf6138bb Mon Sep 17 00:00:00 2001 From: Francois Tigeot Date: Fri, 8 Jul 2011 17:06:13 +0200 Subject: Stop pretending to stay compatible with non-XKB X servers --- tools/inc/tools/prex.h | 10 ---------- vcl/unx/generic/app/i18n_xkb.cxx | 34 +++------------------------------- 2 files changed, 3 insertions(+), 41 deletions(-) (limited to 'vcl') diff --git a/tools/inc/tools/prex.h b/tools/inc/tools/prex.h index 151b0fe46279..e1e11f256b5a 100644 --- a/tools/inc/tools/prex.h +++ b/tools/inc/tools/prex.h @@ -44,22 +44,12 @@ extern "C" { #endif -// FIXME: should really check for xfree86 or for X11R6.1 and higher -#if defined(LINUX) || defined(FREEBSD) || defined(MACOSX) || defined(NETBSD) || \ - defined(OPENBSD) || defined(DRAGONFLY) -#define __XKeyboardExtension__ 1 -#else -#define __XKeyboardExtension__ 0 -#endif - #include #include #include #include #include -#if __XKeyboardExtension__ #include -#endif typedef unsigned long Pixel; #undef DestroyAll diff --git a/vcl/unx/generic/app/i18n_xkb.cxx b/vcl/unx/generic/app/i18n_xkb.cxx index cb93f48b6bd7..c9e42dda6751 100644 --- a/vcl/unx/generic/app/i18n_xkb.cxx +++ b/vcl/unx/generic/app/i18n_xkb.cxx @@ -36,16 +36,10 @@ #include "unx/saldata.hxx" #include "unx/i18n_xkb.hxx" -SalI18N_KeyboardExtension::SalI18N_KeyboardExtension( Display* -#if __XKeyboardExtension__ -pDisplay -#endif -) - : mbUseExtension( (sal_Bool)__XKeyboardExtension__ ), +SalI18N_KeyboardExtension::SalI18N_KeyboardExtension( Display* pDisplay ) + : mbUseExtension( sal_True ), mnDefaultGroup( 0 ) { - #if __XKeyboardExtension__ - mpDisplay = pDisplay; // allow user to set the default keyboard group idx or to disable the usage @@ -94,19 +88,11 @@ pDisplay XkbGetState( mpDisplay, XkbUseCoreKbd, &aStateRecord ); mnGroup = aStateRecord.group; } - - #endif // __XKeyboardExtension__ } void -SalI18N_KeyboardExtension::Dispatch( XEvent* -#if __XKeyboardExtension__ -pEvent -#endif -) +SalI18N_KeyboardExtension::Dispatch( XEvent* pEvent ) { - #if __XKeyboardExtension__ - // must the event be handled? if ( !mbUseExtension || (pEvent->type != mnEventBase) ) @@ -130,21 +116,13 @@ pEvent #endif break; } - #endif // __XKeyboardExtension__ } -#if __XKeyboardExtension__ sal_uInt32 SalI18N_KeyboardExtension::LookupKeysymInGroup( sal_uInt32 nKeyCode, sal_uInt32 nShiftState, sal_uInt32 nGroup ) const -#else -sal_uInt32 -SalI18N_KeyboardExtension::LookupKeysymInGroup( sal_uInt32,sal_uInt32,sal_uInt32 ) const -#endif { - #if __XKeyboardExtension__ - if ( !mbUseExtension ) return NoSymbol; @@ -153,12 +131,6 @@ SalI18N_KeyboardExtension::LookupKeysymInGroup( sal_uInt32,sal_uInt32,sal_uInt32 KeySym nKeySymbol; nKeySymbol = XkbKeycodeToKeysym( mpDisplay, nKeyCode, nGroup, nShiftState ); return nKeySymbol; - - #else - - return NoSymbol; - - #endif // __XKeyboardExtension__ } -- cgit v1.2.3 From 648e382b3bf2e7986b4154ec86f63e3e1c5a7c8f Mon Sep 17 00:00:00 2001 From: Joseph Powers Date: Fri, 8 Jul 2011 21:20:12 -0700 Subject: Whitespace cleanup. I'm have a lot of Lists to cleanup; so lets just get the whitespace fixed first. --- vcl/inc/vcl/animate.hxx | 138 ++++++++++++++++++++++++++++-------------------- 1 file changed, 80 insertions(+), 58 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/animate.hxx b/vcl/inc/vcl/animate.hxx index e53a51e0e932..8196b9ffe6bd 100644 --- a/vcl/inc/vcl/animate.hxx +++ b/vcl/inc/vcl/animate.hxx @@ -71,20 +71,25 @@ struct VCL_DLLPUBLIC AnimationBitmap Size aSizePix; long nWait; Disposal eDisposal; - sal_Bool bUserInput; + sal_Bool bUserInput; AnimationBitmap() {} - AnimationBitmap( const BitmapEx& rBmpEx, const Point& rPosPix, - const Size& rSizePix, long _nWait = 0L, - Disposal _eDisposal = DISPOSE_NOT ) : - aBmpEx ( rBmpEx ), - aPosPix ( rPosPix ), - aSizePix ( rSizePix ), - nWait ( _nWait ), - eDisposal ( _eDisposal ), - bUserInput ( sal_False ) {} - - sal_Bool operator==( const AnimationBitmap& rAnimBmp ) const + AnimationBitmap( + const BitmapEx& rBmpEx, + const Point& rPosPix, + const Size& rSizePix, + long _nWait = 0L, + Disposal _eDisposal = DISPOSE_NOT + ) : + aBmpEx ( rBmpEx ), + aPosPix ( rPosPix ), + aSizePix ( rSizePix ), + nWait ( _nWait ), + eDisposal ( _eDisposal ), + bUserInput ( sal_False ) + {} + + sal_Bool operator==( const AnimationBitmap& rAnimBmp ) const { return( rAnimBmp.aBmpEx == aBmpEx && rAnimBmp.aPosPix == aPosPix && @@ -94,9 +99,10 @@ struct VCL_DLLPUBLIC AnimationBitmap rAnimBmp.bUserInput == bUserInput ); } - sal_Bool operator!=( const AnimationBitmap& rAnimBmp ) const { return !( *this == rAnimBmp ); } + sal_Bool operator!=( const AnimationBitmap& rAnimBmp ) const + { return !( *this == rAnimBmp ); } - sal_Bool IsEqual( const AnimationBitmap& rAnimBmp ) const + sal_Bool IsEqual( const AnimationBitmap& rAnimBmp ) const { return( rAnimBmp.aPosPix == aPosPix && rAnimBmp.aSizePix == aSizePix && @@ -106,7 +112,7 @@ struct VCL_DLLPUBLIC AnimationBitmap rAnimBmp.aBmpEx.IsEqual( aBmpEx ) ); } - sal_uLong GetChecksum() const; + sal_uLong GetChecksum() const; }; // ------------------- @@ -125,8 +131,8 @@ struct AInfo OutputDevice* pOutDev; void* pViewData; long nExtraData; - sal_Bool bWithSize; - sal_Bool bPause; + sal_Bool bWithSize; + sal_Bool bPause; AInfo() : pOutDev( NULL ), pViewData( NULL ), @@ -156,11 +162,11 @@ class VCL_DLLPUBLIC Animation long mnPos; Disposal meLastDisposal; CycleMode meCycleMode; - sal_Bool mbFirst; - sal_Bool mbIsInAnimation; - sal_Bool mbWithSize; - sal_Bool mbLoopTerminated; - sal_Bool mbIsWaiting; + sal_Bool mbFirst; + sal_Bool mbIsInAnimation; + sal_Bool mbWithSize; + sal_Bool mbLoopTerminated; + sal_Bool mbIsWaiting; SAL_DLLPRIVATE void ImplRestartTimer( sal_uLong nTimeout ); @@ -170,7 +176,7 @@ public: SAL_DLLPRIVATE static void ImplIncAnimCount() { mnAnimCount++; } SAL_DLLPRIVATE static void ImplDecAnimCount() { mnAnimCount--; } - SAL_DLLPRIVATE sal_uLong ImplGetCurPos() const { return mnPos; } + SAL_DLLPRIVATE sal_uLong ImplGetCurPos() const { return mnPos; } public: @@ -179,28 +185,38 @@ public: ~Animation(); Animation& operator=( const Animation& rAnimation ); - sal_Bool operator==( const Animation& rAnimation ) const; - sal_Bool operator!=( const Animation& rAnimation ) const { return !(*this==rAnimation); } + sal_Bool operator==( const Animation& rAnimation ) const; + sal_Bool operator!=( const Animation& rAnimation ) const + { return !(*this==rAnimation); } - sal_Bool IsEqual( const Animation& rAnimation ) const; + sal_Bool IsEqual( const Animation& rAnimation ) const; - sal_Bool IsEmpty() const; + sal_Bool IsEmpty() const; void SetEmpty(); void Clear(); - sal_Bool Start( OutputDevice* pOutDev, const Point& rDestPt, long nExtraData = 0, - OutputDevice* pFirstFrameOutDev = NULL ); - sal_Bool Start( OutputDevice* pOutDev, const Point& rDestPt, const Size& rDestSz, long nExtraData = 0, - OutputDevice* pFirstFrameOutDev = NULL ); + sal_Bool Start( + OutputDevice* pOutDev, + const Point& rDestPt, + long nExtraData = 0, + OutputDevice* pFirstFrameOutDev = NULL + ); + sal_Bool Start( + OutputDevice* pOutDev, + const Point& rDestPt, + const Size& rDestSz, + long nExtraData = 0, + OutputDevice* pFirstFrameOutDev = NULL + ); void Stop( OutputDevice* pOutDev = NULL, long nExtraData = 0 ); void Draw( OutputDevice* pOutDev, const Point& rDestPt ) const; void Draw( OutputDevice* pOutDev, const Point& rDestPt, const Size& rDestSz ) const; - sal_Bool IsInAnimation() const { return mbIsInAnimation; } - sal_Bool IsTransparent() const; - sal_Bool IsTerminated() const { return mbLoopTerminated; } + sal_Bool IsInAnimation() const { return mbIsInAnimation; } + sal_Bool IsTransparent() const; + sal_Bool IsTerminated() const { return mbLoopTerminated; } const Size& GetDisplaySizePixel() const { return maGlobalSize; } void SetDisplaySizePixel( const Size& rSize ) { maGlobalSize = rSize; } @@ -208,7 +224,7 @@ public: const BitmapEx& GetBitmapEx() const { return maBitmapEx; } void SetBitmapEx( const BitmapEx& rBmpEx ) { maBitmapEx = rBmpEx; } - sal_uLong GetLoopCount() const { return mnLoopCount; } + sal_uLong GetLoopCount() const { return mnLoopCount; } void SetLoopCount( const sal_uLong nLoopCount ); void ResetLoopCount(); @@ -218,36 +234,42 @@ public: void SetNotifyHdl( const Link& rLink ) { maNotifyLink = rLink; } const Link& GetNotifyHdl() const { return maNotifyLink; } - sal_uInt16 Count() const { return (sal_uInt16) maList.Count(); } - sal_Bool Insert( const AnimationBitmap& rAnimationBitmap ); + sal_uInt16 Count() const { return (sal_uInt16) maList.Count(); } + sal_Bool Insert( const AnimationBitmap& rAnimationBitmap ); const AnimationBitmap& Get( sal_uInt16 nAnimation ) const; void Replace( const AnimationBitmap& rNewAnimationBmp, sal_uInt16 nAnimation ); List* GetAInfoList() { return &maAInfoList; } - sal_uLong GetSizeBytes() const; - sal_uLong GetChecksum() const; + sal_uLong GetSizeBytes() const; + sal_uLong GetChecksum() const; public: - sal_Bool Convert( BmpConversion eConversion ); - sal_Bool ReduceColors( sal_uInt16 nNewColorCount, - BmpReduce eReduce = BMP_REDUCE_SIMPLE ); - sal_Bool Invert(); - sal_Bool Mirror( sal_uLong nMirrorFlags ); - sal_Bool Dither( sal_uLong nDitherFlags = BMP_DITHER_MATRIX ); - sal_Bool Adjust( short nLuminancePercent = 0, - short nContrastPercent = 0, - short nChannelRPercent = 0, - short nChannelGPercent = 0, - short nChannelBPercent = 0, - double fGamma = 1.0, - sal_Bool bInvert = sal_False ); - sal_Bool Filter( BmpFilter eFilter, - const BmpFilterParam* pFilterParam = NULL, - const Link* pProgress = NULL ); - - friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStream, Animation& rAnimation ); - friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStream, const Animation& rAnimation ); + sal_Bool Convert( BmpConversion eConversion ); + sal_Bool ReduceColors( + sal_uInt16 nNewColorCount, + BmpReduce eReduce = BMP_REDUCE_SIMPLE + ); + sal_Bool Invert(); + sal_Bool Mirror( sal_uLong nMirrorFlags ); + sal_Bool Dither( sal_uLong nDitherFlags = BMP_DITHER_MATRIX ); + sal_Bool Adjust( + short nLuminancePercent = 0, + short nContrastPercent = 0, + short nChannelRPercent = 0, + short nChannelGPercent = 0, + short nChannelBPercent = 0, + double fGamma = 1.0, + sal_Bool bInvert = sal_False + ); + sal_Bool Filter( + BmpFilter eFilter, + const BmpFilterParam* pFilterParam = NULL, + const Link* pProgress = NULL + ); + + friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStream, Animation& rAnimation ); + friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStream, const Animation& rAnimation ); }; #endif // _SV_ANIMATE_HXX -- cgit v1.2.3 From 1203a32cb6c424db599e74c11c4ea2a321938ab0 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sat, 9 Jul 2011 15:07:39 +0300 Subject: Build cpputools only for desktop OSes --- i18npool/prj/build.lst | 2 +- vcl/prj/build.lst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'vcl') diff --git a/i18npool/prj/build.lst b/i18npool/prj/build.lst index 3a2e0c2d2b9c..113a9fa6c111 100644 --- a/i18npool/prj/build.lst +++ b/i18npool/prj/build.lst @@ -1,4 +1,4 @@ -inp i18npool : bridges sax stoc comphelper CPPUNIT:cppunit ICU:icu i18nutil regexp cpputools LIBXSLT:libxslt NULL +inp i18npool : bridges sax stoc comphelper CPPUNIT:cppunit ICU:icu i18nutil regexp DESKTOP:cpputools LIBXSLT:libxslt NULL inp i18npool usr1 - all inp_mkout NULL inp i18npool\inc nmake - all inp_inc NULL inp i18npool\source\registerservices nmake - all inp_rserv inp_inc NULL diff --git a/vcl/prj/build.lst b/vcl/prj/build.lst index 4b0ece6b1d46..29b3a4031e86 100644 --- a/vcl/prj/build.lst +++ b/vcl/prj/build.lst @@ -1,4 +1,4 @@ -vc vcl : TRANSLATIONS:translations apple_remote BOOST:boost DESKTOP:rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offapi basegfx basebmp tools DESKTOP:l10ntools icc cpputools svl LIBXSLT:libxslt CAIRO:cairo NULL +vc vcl : TRANSLATIONS:translations apple_remote BOOST:boost DESKTOP:rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offapi basegfx basebmp tools DESKTOP:l10ntools icc DESKTOP:cpputools svl LIBXSLT:libxslt CAIRO:cairo NULL vc vcl usr1 - all vc_mkout NULL vc vcl\prj nmake - all vc_prj NULL -- cgit v1.2.3 From 2da3b7076c00d510b2e2010bba2f362ba7df54d1 Mon Sep 17 00:00:00 2001 From: Joseph Powers Date: Sat, 9 Jul 2011 07:12:22 -0700 Subject: Replace List with std::vector< AnimationBitmap* > --- vcl/inc/vcl/animate.hxx | 10 ++- vcl/source/gdi/animate.cxx | 183 +++++++++++++++++++++++++-------------------- 2 files changed, 107 insertions(+), 86 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/animate.hxx b/vcl/inc/vcl/animate.hxx index 8196b9ffe6bd..687a4300cb3e 100644 --- a/vcl/inc/vcl/animate.hxx +++ b/vcl/inc/vcl/animate.hxx @@ -145,11 +145,13 @@ struct AInfo // - AnimationBitmap - // ------------------- +typedef ::std::vector< AnimationBitmap* > AnimationBitmapList_impl; + class VCL_DLLPUBLIC Animation { - SAL_DLLPRIVATE static sal_uLong mnAnimCount; + SAL_DLLPRIVATE static sal_uLong mnAnimCount; - List maList; + AnimationBitmapList_impl maList; List maAInfoList; Link maNotifyLink; BitmapEx maBitmapEx; @@ -159,7 +161,7 @@ class VCL_DLLPUBLIC Animation void* mpExtraData; long mnLoopCount; long mnLoops; - long mnPos; + size_t mnPos; Disposal meLastDisposal; CycleMode meCycleMode; sal_Bool mbFirst; @@ -234,7 +236,7 @@ public: void SetNotifyHdl( const Link& rLink ) { maNotifyLink = rLink; } const Link& GetNotifyHdl() const { return maNotifyLink; } - sal_uInt16 Count() const { return (sal_uInt16) maList.Count(); } + size_t Count() const { return maList.size(); } sal_Bool Insert( const AnimationBitmap& rAnimationBitmap ); const AnimationBitmap& Get( sal_uInt16 nAnimation ) const; void Replace( const AnimationBitmap& rNewAnimationBmp, sal_uInt16 nAnimation ); diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx index 63d0010bd5d2..ce05dc1b2ca7 100644 --- a/vcl/source/gdi/animate.cxx +++ b/vcl/source/gdi/animate.cxx @@ -117,8 +117,8 @@ Animation::Animation( const Animation& rAnimation ) : { DBG_CTOR( Animation, NULL ); - for( long i = 0, nCount = rAnimation.maList.Count(); i < nCount; i++ ) - maList.Insert( new AnimationBitmap( *(AnimationBitmap*) rAnimation.maList.GetObject( i ) ), LIST_APPEND ); + for( size_t i = 0, nCount = rAnimation.maList.size(); i < nCount; i++ ) + maList.push_back( new AnimationBitmap( *rAnimation.maList[ i ] ) ); maTimer.SetTimeoutHdl( LINK( this, Animation, ImplTimeoutHdl ) ); mpViewList = new List; @@ -134,8 +134,8 @@ Animation::~Animation() if( mbIsInAnimation ) Stop(); - for( void* pStepBmp = maList.First(); pStepBmp; pStepBmp = maList.Next() ) - delete (AnimationBitmap*) pStepBmp; + for( size_t i = 0, n = maList.size(); i < n; ++i ) + delete maList[ i ]; for( void* pView = mpViewList->First(); pView; pView = mpViewList->Next() ) delete (ImplAnimView*) pView; @@ -149,8 +149,8 @@ Animation& Animation::operator=( const Animation& rAnimation ) { Clear(); - for( long i = 0, nCount = rAnimation.maList.Count(); i < nCount; i++ ) - maList.Insert( new AnimationBitmap( *(AnimationBitmap*) rAnimation.maList.GetObject( i ) ), LIST_APPEND ); + for( size_t i = 0, nCount = rAnimation.maList.size(); i < nCount; i++ ) + maList.push_back( new AnimationBitmap( *rAnimation.maList[ i ] ) ); maGlobalSize = rAnimation.maGlobalSize; maBitmapEx = rAnimation.maBitmapEx; @@ -168,20 +168,20 @@ Animation& Animation::operator=( const Animation& rAnimation ) sal_Bool Animation::operator==( const Animation& rAnimation ) const { - const sal_uLong nCount = maList.Count(); - sal_Bool bRet = sal_False; + const size_t nCount = maList.size(); + sal_Bool bRet = sal_False; - if( rAnimation.maList.Count() == nCount && - rAnimation.maBitmapEx == maBitmapEx && - rAnimation.maGlobalSize == maGlobalSize && - rAnimation.meCycleMode == meCycleMode ) + if( rAnimation.maList.size() == nCount + && rAnimation.maBitmapEx == maBitmapEx + && rAnimation.maGlobalSize == maGlobalSize + && rAnimation.meCycleMode == meCycleMode + ) { bRet = sal_True; - for( sal_uLong n = 0; n < nCount; n++ ) + for( size_t n = 0; n < nCount; n++ ) { - if( ( *(AnimationBitmap*) maList.GetObject( n ) ) != - ( *(AnimationBitmap*) rAnimation.maList.GetObject( n ) ) ) + if( ( *maList[ n ] ) != ( *rAnimation.maList[ n ] ) ) { bRet = sal_False; break; @@ -196,16 +196,17 @@ sal_Bool Animation::operator==( const Animation& rAnimation ) const sal_Bool Animation::IsEqual( const Animation& rAnimation ) const { - const sal_uLong nCount = maList.Count(); - sal_Bool bRet = sal_False; + const size_t nCount = maList.size(); + sal_Bool bRet = sal_False; - if( rAnimation.maList.Count() == nCount && - rAnimation.maBitmapEx.IsEqual( maBitmapEx ) && - rAnimation.maGlobalSize == maGlobalSize && - rAnimation.meCycleMode == meCycleMode ) + if( rAnimation.maList.size() == nCount + && rAnimation.maBitmapEx.IsEqual( maBitmapEx ) + && rAnimation.maGlobalSize == maGlobalSize + && rAnimation.meCycleMode == meCycleMode + ) { - for( sal_uLong n = 0; ( n < nCount ) && !bRet; n++ ) - if( ( (AnimationBitmap*) maList.GetObject( n ) )->IsEqual( *(AnimationBitmap*) rAnimation.maList.GetObject( n ) ) ) + for( size_t n = 0; ( n < nCount ) && !bRet; n++ ) + if( maList[ n ]->IsEqual( *rAnimation.maList[ n ] ) ) bRet = sal_True; } @@ -216,7 +217,7 @@ sal_Bool Animation::IsEqual( const Animation& rAnimation ) const sal_Bool Animation::IsEmpty() const { - return( maBitmapEx.IsEmpty() && !maList.Count() ); + return( maBitmapEx.IsEmpty() && maList.empty() ); } // ------------------------------------------------------------------ @@ -228,9 +229,9 @@ void Animation::SetEmpty() maGlobalSize = Size(); maBitmapEx.SetEmpty(); - for( void* pStepBmp = maList.First(); pStepBmp; pStepBmp = maList.Next() ) - delete (AnimationBitmap*) pStepBmp; - maList.Clear(); + for( size_t i = 0, n = maList.size(); i < n; ++i ) + delete maList[ i ]; + maList.clear(); for( void* pView = mpViewList->First(); pView; pView = mpViewList->Next() ) delete (ImplAnimView*) pView; @@ -256,11 +257,13 @@ sal_Bool Animation::IsTransparent() const // ersetzt werden soll, muessen wir 'transparent' sein, um // richtig dargestellt zu werden, da die Appl. aus Optimierungsgruenden // kein Invalidate auf nicht-transp. Grafiken ausfuehren - for( long i = 0, nCount = maList.Count(); i < nCount; i++ ) + for( size_t i = 0, nCount = maList.size(); i < nCount; i++ ) { - const AnimationBitmap* pAnimBmp = (AnimationBitmap*) maList.GetObject( i ); + const AnimationBitmap* pAnimBmp = maList[ i ]; - if( DISPOSE_BACK == pAnimBmp->eDisposal && Rectangle( pAnimBmp->aPosPix, pAnimBmp->aSizePix ) != aRect ) + if( DISPOSE_BACK == pAnimBmp->eDisposal + && Rectangle( pAnimBmp->aPosPix, pAnimBmp->aSizePix ) != aRect + ) { bRet = sal_True; break; @@ -279,9 +282,9 @@ sal_uLong Animation::GetSizeBytes() const { sal_uLong nSizeBytes = GetBitmapEx().GetSizeBytes(); - for( long i = 0, nCount = maList.Count(); i < nCount; i++ ) + for( size_t i = 0, nCount = maList.size(); i < nCount; i++ ) { - const AnimationBitmap* pAnimBmp = (AnimationBitmap*) maList.GetObject( i ); + const AnimationBitmap* pAnimBmp = maList[ i ]; nSizeBytes += pAnimBmp->aBmpEx.GetSizeBytes(); } @@ -295,7 +298,7 @@ sal_uLong Animation::GetChecksum() const SVBT32 aBT32; sal_uInt32 nCrc = GetBitmapEx().GetChecksum(); - UInt32ToSVBT32( maList.Count(), aBT32 ); + UInt32ToSVBT32( maList.size(), aBT32 ); nCrc = rtl_crc32( nCrc, aBT32, 4 ); UInt32ToSVBT32( maGlobalSize.Width(), aBT32 ); @@ -307,9 +310,9 @@ sal_uLong Animation::GetChecksum() const UInt32ToSVBT32( (long) meCycleMode, aBT32 ); nCrc = rtl_crc32( nCrc, aBT32, 4 ); - for( long i = 0, nCount = maList.Count(); i < nCount; i++ ) + for( size_t i = 0, nCount = maList.size(); i < nCount; i++ ) { - UInt32ToSVBT32( ( (AnimationBitmap*) maList.GetObject( i ) )->GetChecksum(), aBT32 ); + UInt32ToSVBT32( maList[ i ]->GetChecksum(), aBT32 ); nCrc = rtl_crc32( nCrc, aBT32, 4 ); } @@ -331,10 +334,12 @@ sal_Bool Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size& { sal_Bool bRet = sal_False; - if( maList.Count() ) + if( !maList.empty() ) { - if( ( pOut->GetOutDevType() == OUTDEV_WINDOW ) && !mbLoopTerminated && - ( ANIMATION_TIMEOUT_ON_CLICK != ( (AnimationBitmap*) maList.GetObject( mnPos ) )->nWait ) ) + if( ( pOut->GetOutDevType() == OUTDEV_WINDOW ) + && !mbLoopTerminated + && ( ANIMATION_TIMEOUT_ON_CLICK != maList[ mnPos ]->nWait ) + ) { ImplAnimView* pView; ImplAnimView* pMatch = NULL; @@ -371,7 +376,7 @@ sal_Bool Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size& if( !mbIsInAnimation ) { - ImplRestartTimer( ( (AnimationBitmap*) maList.GetObject( mnPos ) )->nWait ); + ImplRestartTimer( maList[ mnPos ]->nWait ); mbIsInAnimation = sal_True; } } @@ -419,19 +424,21 @@ void Animation::Draw( OutputDevice* pOut, const Point& rDestPt ) const void Animation::Draw( OutputDevice* pOut, const Point& rDestPt, const Size& rDestSz ) const { - const sal_uLong nCount = maList.Count(); + const size_t nCount = maList.size(); if( nCount ) { - AnimationBitmap* pObj = (AnimationBitmap*) maList.GetObject( Min( mnPos, (long) nCount - 1L ) ); + AnimationBitmap* pObj = maList[ Min( mnPos, nCount - 1 ) ]; - if( pOut->GetConnectMetaFile() || ( pOut->GetOutDevType() == OUTDEV_PRINTER ) ) - ( (AnimationBitmap*) maList.GetObject( 0 ) )->aBmpEx.Draw( pOut, rDestPt, rDestSz ); + if( pOut->GetConnectMetaFile() + || ( pOut->GetOutDevType() == OUTDEV_PRINTER ) + ) + maList[ 0 ]->aBmpEx.Draw( pOut, rDestPt, rDestSz ); else if( ANIMATION_TIMEOUT_ON_CLICK == pObj->nWait ) pObj->aBmpEx.Draw( pOut, rDestPt, rDestSz ); else { - const sal_uLong nOldPos = mnPos; + const size_t nOldPos = mnPos; ( (Animation*) this )->mnPos = mbLoopTerminated ? ( nCount - 1UL ) : mnPos; delete new ImplAnimView( (Animation*) this, pOut, rDestPt, rDestSz, 0 ); ( (Animation*) this )->mnPos = nOldPos; @@ -451,12 +458,12 @@ void Animation::ImplRestartTimer( sal_uLong nTimeout ) IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG ) { - const sal_uLong nAnimCount = maList.Count(); + const size_t nAnimCount = maList.size(); if( nAnimCount ) { ImplAnimView* pView; - sal_Bool bGlobalPause = sal_True; + sal_Bool bGlobalPause = sal_True; if( maNotifyLink.IsSet() ) { @@ -518,7 +525,7 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG ) ImplRestartTimer( 10 ); else { - AnimationBitmap* pStepBmp = (AnimationBitmap*) maList.GetObject( ++mnPos ); + AnimationBitmap* pStepBmp = (++mnPos < maList.size()) ? maList[ mnPos ] : NULL; if( !pStepBmp ) { @@ -527,7 +534,7 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG ) Stop(); mbLoopTerminated = sal_True; mnPos = nAnimCount - 1UL; - maBitmapEx = ( (AnimationBitmap*) maList.GetObject( mnPos ) )->aBmpEx; + maBitmapEx = maList[ mnPos ]->aBmpEx; return 0L; } else @@ -536,7 +543,7 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG ) mnLoops--; mnPos = 0; - pStepBmp = (AnimationBitmap*) maList.GetObject( mnPos ); + pStepBmp = maList[ mnPos ]; } } @@ -583,10 +590,10 @@ sal_Bool Animation::Insert( const AnimationBitmap& rStepBmp ) Rectangle aGlobalRect( aPoint, maGlobalSize ); maGlobalSize = aGlobalRect.Union( Rectangle( rStepBmp.aPosPix, rStepBmp.aSizePix ) ).GetSize(); - maList.Insert( new AnimationBitmap( rStepBmp ), LIST_APPEND ); + maList.push_back( new AnimationBitmap( rStepBmp ) ); // zunaechst nehmen wir die erste BitmapEx als Ersatz-BitmapEx - if( maList.Count() == 1 ) + if( maList.size() == 1 ) maBitmapEx = rStepBmp.aBmpEx; bRet = sal_True; @@ -599,24 +606,33 @@ sal_Bool Animation::Insert( const AnimationBitmap& rStepBmp ) const AnimationBitmap& Animation::Get( sal_uInt16 nAnimation ) const { - DBG_ASSERT( ( nAnimation < maList.Count() ), "No object at this position" ); - return *(AnimationBitmap*) maList.GetObject( nAnimation ); + DBG_ASSERT( ( nAnimation < maList.size() ), "No object at this position" ); + return *maList[ nAnimation ]; } // ----------------------------------------------------------------------- void Animation::Replace( const AnimationBitmap& rNewAnimationBitmap, sal_uInt16 nAnimation ) { - DBG_ASSERT( ( nAnimation < maList.Count() ), "No object at this position" ); + DBG_ASSERT( ( nAnimation < maList.size() ), "No object at this position" ); - delete (AnimationBitmap*) maList.Replace( new AnimationBitmap( rNewAnimationBitmap ), nAnimation ); + delete maList[ nAnimation ]; + maList[ nAnimation ] = new AnimationBitmap( rNewAnimationBitmap ); // Falls wir an erster Stelle einfuegen, // muessen wir natuerlich auch, // auch die Ersatzdarstellungs-BitmapEx // aktualisieren; - if ( ( !nAnimation && ( !mbLoopTerminated || ( maList.Count() == 1 ) ) ) || - ( ( nAnimation == maList.Count() - 1 ) && mbLoopTerminated ) ) + if ( ( !nAnimation + && ( !mbLoopTerminated + || ( maList.size() == 1 ) + ) + ) + || + ( ( nAnimation == maList.size() - 1 ) + && mbLoopTerminated + ) + ) { maBitmapEx = rNewAnimationBitmap.aBmpEx; } @@ -646,12 +662,12 @@ sal_Bool Animation::Convert( BmpConversion eConversion ) sal_Bool bRet; - if( !IsInAnimation() && maList.Count() ) + if( !IsInAnimation() && !maList.empty() ) { bRet = sal_True; - for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() ) - bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.Convert( eConversion ); + for( size_t i = 0, n = maList.size(); ( i < n ) && bRet; ++i ) + bRet = maList[ i ]->aBmpEx.Convert( eConversion ); maBitmapEx.Convert( eConversion ); } @@ -669,12 +685,12 @@ sal_Bool Animation::ReduceColors( sal_uInt16 nNewColorCount, BmpReduce eReduce ) sal_Bool bRet; - if( !IsInAnimation() && maList.Count() ) + if( !IsInAnimation() && !maList.empty() ) { bRet = sal_True; - for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() ) - bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.ReduceColors( nNewColorCount, eReduce ); + for( size_t i = 0, n = maList.size(); ( i < n ) && bRet; ++i ) + bRet = maList[ i ]->aBmpEx.ReduceColors( nNewColorCount, eReduce ); maBitmapEx.ReduceColors( nNewColorCount, eReduce ); } @@ -692,12 +708,12 @@ sal_Bool Animation::Invert() sal_Bool bRet; - if( !IsInAnimation() && maList.Count() ) + if( !IsInAnimation() && !maList.empty() ) { bRet = sal_True; - for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() ) - bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.Invert(); + for( size_t i = 0, n = maList.size(); ( i < n ) && bRet; ++i ) + bRet = maList[ i ]->aBmpEx.Invert(); maBitmapEx.Invert(); } @@ -715,16 +731,15 @@ sal_Bool Animation::Mirror( sal_uLong nMirrorFlags ) sal_Bool bRet; - if( !IsInAnimation() && maList.Count() ) + if( !IsInAnimation() && !maList.empty() ) { bRet = sal_True; if( nMirrorFlags ) { - for( AnimationBitmap* pStepBmp = (AnimationBitmap*) maList.First(); - pStepBmp && bRet; - pStepBmp = (AnimationBitmap*) maList.Next() ) + for( size_t i = 0, n = maList.size(); ( i < n ) && bRet; ++i ) { + AnimationBitmap* pStepBmp = maList[ i ]; if( ( bRet = pStepBmp->aBmpEx.Mirror( nMirrorFlags ) ) == sal_True ) { if( nMirrorFlags & BMP_MIRROR_HORZ ) @@ -752,12 +767,12 @@ sal_Bool Animation::Dither( sal_uLong nDitherFlags ) sal_Bool bRet; - if( !IsInAnimation() && maList.Count() ) + if( !IsInAnimation() && !maList.empty() ) { bRet = sal_True; - for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() ) - bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.Dither( nDitherFlags ); + for( size_t i = 0, n = maList.size(); ( i < n ) && bRet; ++i ) + bRet = maList[ i ]->aBmpEx.Dither( nDitherFlags ); maBitmapEx.Dither( nDitherFlags ); } @@ -777,15 +792,19 @@ sal_Bool Animation::Adjust( short nLuminancePercent, short nContrastPercent, sal_Bool bRet; - if( !IsInAnimation() && maList.Count() ) + if( !IsInAnimation() && !maList.empty() ) { bRet = sal_True; - for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() ) + for( size_t i = 0, n = maList.size(); ( i < n ) && bRet; ++i ) { - bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.Adjust( nLuminancePercent, nContrastPercent, - nChannelRPercent, nChannelGPercent, nChannelBPercent, - fGamma, bInvert ); + bRet = maList[ i ]->aBmpEx.Adjust( nLuminancePercent, + nContrastPercent, + nChannelRPercent, + nChannelGPercent, + nChannelBPercent, + fGamma, bInvert + ); } maBitmapEx.Adjust( nLuminancePercent, nContrastPercent, @@ -806,12 +825,12 @@ sal_Bool Animation::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterPara sal_Bool bRet; - if( !IsInAnimation() && maList.Count() ) + if( !IsInAnimation() && !maList.empty() ) { bRet = sal_True; - for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() ) - bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.Filter( eFilter, pFilterParam, pProgress ); + for( size_t i = 0, n = maList.size(); ( i < n ) && bRet; ++i ) + bRet = maList[ i ]->aBmpEx.Filter( eFilter, pFilterParam, pProgress ); maBitmapEx.Filter( eFilter, pFilterParam, pProgress ); } @@ -830,7 +849,7 @@ SvStream& operator<<( SvStream& rOStm, const Animation& rAnimation ) if( nCount ) { const ByteString aDummyStr; - const sal_uInt32 nDummy32 = 0UL; + const sal_uInt32 nDummy32 = 0UL; // Falls keine BitmapEx gesetzt wurde, schreiben wir // einfach die erste Bitmap der Animation -- cgit v1.2.3 From 7d1a41c189e800c453c4855d2b38843bbd2dd209 Mon Sep 17 00:00:00 2001 From: Joseph Powers Date: Sat, 9 Jul 2011 16:01:45 -0700 Subject: Replace List with std::vector< AInfo* > I actually moved the List member from the class to a class method. I think this is safe because the member was only used in one method and it's life- span was limited to the one method (populate, process, dispose - all in one "if" block. I also removed all the member's export methods since no one used them. --- svtools/inc/svtools/grfmgr.hxx | 1 - svtools/source/graphic/grfmgr.cxx | 5 ----- vcl/inc/impgraph.hxx | 2 -- vcl/inc/vcl/animate.hxx | 2 -- vcl/inc/vcl/graph.hxx | 2 -- vcl/source/gdi/animate.cxx | 13 ++++++++----- vcl/source/gdi/graph.cxx | 7 ------- vcl/source/gdi/impgraph.cxx | 7 ------- 8 files changed, 8 insertions(+), 31 deletions(-) (limited to 'vcl') diff --git a/svtools/inc/svtools/grfmgr.hxx b/svtools/inc/svtools/grfmgr.hxx index e81458644d50..0395a9d5afe5 100644 --- a/svtools/inc/svtools/grfmgr.hxx +++ b/svtools/inc/svtools/grfmgr.hxx @@ -409,7 +409,6 @@ public: sal_Bool HasRenderGraphic() const { return mbHasRenderGraphic; } void ResetAnimationLoopCount(); - List* GetAnimationInfoList() const; Link GetAnimationNotifyHdl() const { return maGraphic.GetAnimationNotifyHdl(); } void SetAnimationNotifyHdl( const Link& rLink ); diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx index fdfa92a72b00..63df21b3993d 100644 --- a/svtools/source/graphic/grfmgr.cxx +++ b/svtools/source/graphic/grfmgr.cxx @@ -547,11 +547,6 @@ void GraphicObject::SetAnimationNotifyHdl( const Link& rLink ) maGraphic.SetAnimationNotifyHdl( rLink ); } -List* GraphicObject::GetAnimationInfoList() const -{ - return maGraphic.GetAnimationInfoList(); -} - sal_Bool GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz, const GraphicAttr* pAttr, sal_uLong nFlags ) { diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx index 6b6bce184770..592f6a73c050 100644 --- a/vcl/inc/impgraph.hxx +++ b/vcl/inc/impgraph.hxx @@ -144,8 +144,6 @@ private: sal_uLong ImplGetAnimationLoopCount() const; void ImplResetAnimationLoopCount(); - List* ImplGetAnimationInfoList() const; - private: GraphicReader* ImplGetContext(); diff --git a/vcl/inc/vcl/animate.hxx b/vcl/inc/vcl/animate.hxx index 687a4300cb3e..90a49de5d023 100644 --- a/vcl/inc/vcl/animate.hxx +++ b/vcl/inc/vcl/animate.hxx @@ -152,7 +152,6 @@ class VCL_DLLPUBLIC Animation SAL_DLLPRIVATE static sal_uLong mnAnimCount; AnimationBitmapList_impl maList; - List maAInfoList; Link maNotifyLink; BitmapEx maBitmapEx; Timer maTimer; @@ -241,7 +240,6 @@ public: const AnimationBitmap& Get( sal_uInt16 nAnimation ) const; void Replace( const AnimationBitmap& rNewAnimationBmp, sal_uInt16 nAnimation ); - List* GetAInfoList() { return &maAInfoList; } sal_uLong GetSizeBytes() const; sal_uLong GetChecksum() const; diff --git a/vcl/inc/vcl/graph.hxx b/vcl/inc/vcl/graph.hxx index d613c2d8432b..2ca801cfb97b 100644 --- a/vcl/inc/vcl/graph.hxx +++ b/vcl/inc/vcl/graph.hxx @@ -178,8 +178,6 @@ public: sal_uLong GetAnimationLoopCount() const; void ResetAnimationLoopCount(); - List* GetAnimationInfoList() const; - sal_uLong GetChecksum() const; public: diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx index ce05dc1b2ca7..cfc8656dfc0b 100644 --- a/vcl/source/gdi/animate.cxx +++ b/vcl/source/gdi/animate.cxx @@ -455,10 +455,12 @@ void Animation::ImplRestartTimer( sal_uLong nTimeout ) } // ----------------------------------------------------------------------- +typedef ::std::vector< AInfo* > AInfoList_impl; IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG ) { const size_t nAnimCount = maList.size(); + AInfoList_impl aAInfoList; if( nAnimCount ) { @@ -471,13 +473,14 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG ) // create AInfo-List for( pView = (ImplAnimView*) mpViewList->First(); pView; pView = (ImplAnimView*) mpViewList->Next() ) - maAInfoList.Insert( pView->ImplCreateAInfo() ); + aAInfoList.push_back( pView->ImplCreateAInfo() ); maNotifyLink.Call( this ); // set view state from AInfo structure - for( pAInfo = (AInfo*) maAInfoList.First(); pAInfo; pAInfo = (AInfo*) maAInfoList.Next() ) + for( size_t i = 0, n = aAInfoList.size(); i < n; ++i ) { + pAInfo = aAInfoList[ i ]; if( !pAInfo->pViewData ) { pView = new ImplAnimView( this, pAInfo->pOutDev, @@ -493,9 +496,9 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG ) } // delete AInfo structures - for( pAInfo = (AInfo*) maAInfoList.First(); pAInfo; pAInfo = (AInfo*) maAInfoList.Next() ) - delete (AInfo*) pAInfo; - maAInfoList.Clear(); + for( size_t i = 0, n = aAInfoList.size(); i < n; ++i ) + delete aAInfoList[ i ]; + aAInfoList.clear(); // delete all unmarked views and reset marked state pView = (ImplAnimView*) mpViewList->First(); diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx index eb22d31937df..8fa11e969aa8 100644 --- a/vcl/source/gdi/graph.cxx +++ b/vcl/source/gdi/graph.cxx @@ -662,13 +662,6 @@ void Graphic::ResetAnimationLoopCount() // ------------------------------------------------------------------------ -List* Graphic::GetAnimationInfoList() const -{ - return mpImpGraphic->ImplGetAnimationInfoList(); -} - -// ------------------------------------------------------------------------ - GraphicReader* Graphic::GetContext() { return mpImpGraphic->ImplGetContext(); diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index 9d995f361329..bd457f3fda22 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -928,13 +928,6 @@ void ImpGraphic::ImplResetAnimationLoopCount() // ------------------------------------------------------------------------ -List* ImpGraphic::ImplGetAnimationInfoList() const -{ - return( mpAnimation ? mpAnimation->GetAInfoList() : NULL ); -} - -// ------------------------------------------------------------------------ - GraphicReader* ImpGraphic::ImplGetContext() { return mpContext; -- cgit v1.2.3 From dd1e686fed8dddf641266637c51b48754c75d280 Mon Sep 17 00:00:00 2001 From: Joseph Powers Date: Sat, 9 Jul 2011 19:55:39 -0700 Subject: Replace List with std::vector< ImplAnimView* > Ok, the list was a pointer to the list; however, the constructor always created one and it was never replaced. Thus, I don't see a reason for the member to be a pointer. --- vcl/inc/vcl/animate.hxx | 4 ++- vcl/source/gdi/animate.cxx | 69 +++++++++++++++++++++++----------------------- 2 files changed, 37 insertions(+), 36 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/animate.hxx b/vcl/inc/vcl/animate.hxx index 90a49de5d023..aaf88c8b6e76 100644 --- a/vcl/inc/vcl/animate.hxx +++ b/vcl/inc/vcl/animate.hxx @@ -145,18 +145,20 @@ struct AInfo // - AnimationBitmap - // ------------------- +class ImplAnimView; typedef ::std::vector< AnimationBitmap* > AnimationBitmapList_impl; +typedef ::std::vector< ImplAnimView* > AnimViewList_impl; class VCL_DLLPUBLIC Animation { SAL_DLLPRIVATE static sal_uLong mnAnimCount; AnimationBitmapList_impl maList; + AnimViewList_impl maViewList; Link maNotifyLink; BitmapEx maBitmapEx; Timer maTimer; Size maGlobalSize; - List* mpViewList; void* mpExtraData; long mnLoopCount; long mnLoops; diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx index cfc8656dfc0b..8cb6a47d902e 100644 --- a/vcl/source/gdi/animate.cxx +++ b/vcl/source/gdi/animate.cxx @@ -100,7 +100,6 @@ Animation::Animation() : { DBG_CTOR( Animation, NULL ); maTimer.SetTimeoutHdl( LINK( this, Animation, ImplTimeoutHdl ) ); - mpViewList = new List; } // ----------------------------------------------------------------------- @@ -121,7 +120,6 @@ Animation::Animation( const Animation& rAnimation ) : maList.push_back( new AnimationBitmap( *rAnimation.maList[ i ] ) ); maTimer.SetTimeoutHdl( LINK( this, Animation, ImplTimeoutHdl ) ); - mpViewList = new List; mnLoops = mbLoopTerminated ? 0 : mnLoopCount; } @@ -137,10 +135,8 @@ Animation::~Animation() for( size_t i = 0, n = maList.size(); i < n; ++i ) delete maList[ i ]; - for( void* pView = mpViewList->First(); pView; pView = mpViewList->Next() ) - delete (ImplAnimView*) pView; - - delete mpViewList; + for( size_t i = 0, n = maViewList.size(); i < n; ++i ) + delete maViewList[ i ]; } // ----------------------------------------------------------------------- @@ -233,9 +229,9 @@ void Animation::SetEmpty() delete maList[ i ]; maList.clear(); - for( void* pView = mpViewList->First(); pView; pView = mpViewList->Next() ) - delete (ImplAnimView*) pView; - mpViewList->Clear(); + for( size_t i = 0, n = maViewList.size(); i < n; ++i ) + delete maViewList[ i ]; + maViewList.clear(); } // ----------------------------------------------------------------------- @@ -344,8 +340,9 @@ sal_Bool Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size& ImplAnimView* pView; ImplAnimView* pMatch = NULL; - for( pView = (ImplAnimView*) mpViewList->First(); pView; pView = (ImplAnimView*) mpViewList->Next() ) + for( size_t i = 0; i < maViewList.size(); ++i ) { + pView = maViewList[ i ]; if( pView->ImplMatches( pOut, nExtraData ) ) { if( pView->ImplGetOutPos() == rDestPt && @@ -356,7 +353,8 @@ sal_Bool Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size& } else { - delete (ImplAnimView*) mpViewList->Remove( pView ); + delete maViewList[ i ]; + maViewList.erase( maViewList.begin() + i ); pView = NULL; } @@ -364,7 +362,7 @@ sal_Bool Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size& } } - if( !mpViewList->Count() ) + if( maViewList.empty() ) { maTimer.Stop(); mbIsInAnimation = sal_False; @@ -372,7 +370,7 @@ sal_Bool Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size& } if( !pMatch ) - mpViewList->Insert( new ImplAnimView( this, pOut, rDestPt, rDestSz, nExtraData, pFirstFrameOutDev ), LIST_APPEND ); + maViewList.push_back( new ImplAnimView( this, pOut, rDestPt, rDestSz, nExtraData, pFirstFrameOutDev ) ); if( !mbIsInAnimation ) { @@ -393,20 +391,21 @@ sal_Bool Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size& void Animation::Stop( OutputDevice* pOut, long nExtraData ) { - ImplAnimView* pView = (ImplAnimView*) mpViewList->First(); - - while( pView ) + for( size_t i = 0; i < maViewList.size(); ) { + + + ImplAnimView* pView = maViewList[ i ]; if( pView->ImplMatches( pOut, nExtraData ) ) { - delete (ImplAnimView*) mpViewList->Remove( pView ); - pView = (ImplAnimView*) mpViewList->GetCurObject(); + delete pView; + maViewList.erase( maViewList.begin() + i ); } else - pView = (ImplAnimView*) mpViewList->Next(); + i++; } - if( !mpViewList->Count() ) + if( maViewList.empty() ) { maTimer.Stop(); mbIsInAnimation = sal_False; @@ -472,8 +471,8 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG ) AInfo* pAInfo; // create AInfo-List - for( pView = (ImplAnimView*) mpViewList->First(); pView; pView = (ImplAnimView*) mpViewList->Next() ) - aAInfoList.push_back( pView->ImplCreateAInfo() ); + for( size_t i = 0, n = maViewList.size(); i < n; ++i ) + aAInfoList.push_back( maViewList[ i ]->ImplCreateAInfo() ); maNotifyLink.Call( this ); @@ -486,7 +485,7 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG ) pView = new ImplAnimView( this, pAInfo->pOutDev, pAInfo->aStartOrg, pAInfo->aStartSize, pAInfo->nExtraData ); - mpViewList->Insert( pView, LIST_APPEND ); + maViewList.push_back( pView ); } else pView = (ImplAnimView*) pAInfo->pViewData; @@ -501,13 +500,13 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG ) aAInfoList.clear(); // delete all unmarked views and reset marked state - pView = (ImplAnimView*) mpViewList->First(); - while( pView ) + for( size_t i = 0; i < maViewList.size(); ) { + pView = maViewList[ i ]; if( !pView->ImplIsMarked() ) { - delete (ImplAnimView*) mpViewList->Remove( pView ); - pView = (ImplAnimView*) mpViewList->GetCurObject(); + delete pView; + maViewList.erase( maViewList.begin() + i ); } else { @@ -515,14 +514,14 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG ) bGlobalPause = sal_False; pView->ImplSetMarked( sal_False ); - pView = (ImplAnimView*) mpViewList->Next(); + i++; } } } else bGlobalPause = sal_False; - if( !mpViewList->Count() ) + if( maViewList.empty() ) Stop(); else if( bGlobalPause ) ImplRestartTimer( 10 ); @@ -554,22 +553,22 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG ) // marked; in this case remove view, because area of output // lies out of display area of window; mark state is // set from view itself - pView = (ImplAnimView*) mpViewList->First(); - while( pView ) + for( size_t i = 0; i < maViewList.size(); ) { + pView = maViewList[ i ]; pView->ImplDraw( mnPos ); if( pView->ImplIsMarked() ) { - delete (ImplAnimView*) mpViewList->Remove( pView ); - pView = (ImplAnimView*) mpViewList->GetCurObject(); + delete pView; + maViewList.erase( maViewList.begin() + i ); } else - pView = (ImplAnimView*) mpViewList->Next(); + i++; } // stop or restart timer - if( !mpViewList->Count() ) + if( maViewList.empty() ) Stop(); else ImplRestartTimer( pStepBmp->nWait ); -- cgit v1.2.3 From 53fea04d6a827bb47294c7a26685755ca459dc43 Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Mon, 11 Jul 2011 09:11:08 +0200 Subject: FcPatternAddFTFace is 2.4.x feature and our baseline is 2.2.0 --- vcl/unx/generic/fontmanager/fontconfig.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'vcl') diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx index 693bf3b6a3d5..66faa526872c 100644 --- a/vcl/unx/generic/fontmanager/fontconfig.cxx +++ b/vcl/unx/generic/fontmanager/fontconfig.cxx @@ -864,7 +864,10 @@ public: } virtual void *GetPattern(void * face, bool bEmbolden) const { - FcPatternAddFTFace(mpPattern, FC_FT_FACE, static_cast(face)); + FcValue value; + value.type = FcTypeFTFace; + value.u.f = face; + FcPatternAdd (mpPattern, FC_FT_FACE, value, FcTrue); FcPatternAddBool(mpPattern, FC_EMBOLDEN, bEmbolden ? FcTrue : FcFalse); return mpPattern; } -- cgit v1.2.3 From 2d3796fcd3053f9e58f018f6a11072b4e2a775f7 Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Mon, 11 Jul 2011 09:23:08 +0200 Subject: Include cairo.h explicitely for builds with cairoless gtk+ --- vcl/inc/unx/gtk/gtkframe.hxx | 1 + 1 file changed, 1 insertion(+) (limited to 'vcl') diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx index 6caf39dc9644..78aea06017a8 100644 --- a/vcl/inc/unx/gtk/gtkframe.hxx +++ b/vcl/inc/unx/gtk/gtkframe.hxx @@ -30,6 +30,7 @@ #define _VCL_GTKFRAME_HXX #include +#include #include #include #include -- cgit v1.2.3 From 6c4a4c200eda74ab0f958a10f38d3808df423e02 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 00:05:56 +0100 Subject: callcatcher: remove unused IsHighContrastBlackAndWhite --- vcl/inc/vcl/settings.hxx | 1 - vcl/source/app/settings.cxx | 40 ---------------------------------------- 2 files changed, 41 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/settings.hxx b/vcl/inc/vcl/settings.hxx index 0ade4c63f295..2494f4fa5d08 100644 --- a/vcl/inc/vcl/settings.hxx +++ b/vcl/inc/vcl/settings.hxx @@ -713,7 +713,6 @@ public: { CopyData(); mpData->mnHighContrast = bHighContrast; } sal_Bool GetHighContrastMode() const { return (sal_Bool) mpData->mnHighContrast; } - sal_Bool IsHighContrastBlackAndWhite() const; void SetUseSystemUIFonts( sal_Bool bUseSystemUIFonts ) { CopyData(); mpData->mnUseSystemUIFonts = bUseSystemUIFonts; } sal_Bool GetUseSystemUIFonts() const diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index 9ffb8bc373da..1683faf1613a 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -964,46 +964,6 @@ inline sal_Bool ImplIsBackOrWhite( const Color& rColor ) return ( nLuminance < 8 ) || ( nLuminance > 250 ); } -sal_Bool StyleSettings::IsHighContrastBlackAndWhite() const -{ - sal_Bool bBWOnly = sal_True; - - // Only use B&W if fully B&W, like on GNOME. - // Some colors like CheckedColor and HighlightColor are not B&W in Windows Standard HC Black, - // and we don't want to be B&W then, so check these color first, very probably not B&W. - - // Unfortunately, GNOME uses a very very dark color (0x000033) instead of BLACK (0x000000) - - if ( !ImplIsBackOrWhite( GetFaceColor() ) ) - bBWOnly = sal_False; - else if ( !ImplIsBackOrWhite( GetHighlightTextColor() ) ) - bBWOnly = sal_False; - else if ( !ImplIsBackOrWhite( GetWindowColor() ) ) - bBWOnly = sal_False; - else if ( !ImplIsBackOrWhite( GetWindowTextColor() ) ) - bBWOnly = sal_False; - else if ( !ImplIsBackOrWhite( GetButtonTextColor() ) ) - bBWOnly = sal_False; - else if ( !ImplIsBackOrWhite( GetButtonTextColor() ) ) - bBWOnly = sal_False; - else if ( !ImplIsBackOrWhite( GetGroupTextColor() ) ) - bBWOnly = sal_False; - else if ( !ImplIsBackOrWhite( GetLabelTextColor() ) ) - bBWOnly = sal_False; - else if ( !ImplIsBackOrWhite( GetDialogColor() ) ) - bBWOnly = sal_False; - else if ( !ImplIsBackOrWhite( GetFieldColor() ) ) - bBWOnly = sal_False; - else if ( !ImplIsBackOrWhite( GetMenuColor() ) ) - bBWOnly = sal_False; - else if ( !ImplIsBackOrWhite( GetMenuBarColor() ) ) - bBWOnly = sal_False; - else if ( !ImplIsBackOrWhite( GetMenuHighlightColor() ) ) - bBWOnly = sal_False; - - return bBWOnly; -} - // ----------------------------------------------------------------------- sal_Bool StyleSettings::operator ==( const StyleSettings& rSet ) const -- cgit v1.2.3 From 1568e883ecfa789e3e8f1e637d37c5adf47fa277 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 00:11:35 +0100 Subject: callcatcher: remove unused setGrad* methods --- vcl/inc/vcl/graphictools.hxx | 12 ------------ vcl/source/gdi/graphictools.cxx | 20 -------------------- 2 files changed, 32 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/graphictools.hxx b/vcl/inc/vcl/graphictools.hxx index edd29ab9db01..333c9163d57a 100644 --- a/vcl/inc/vcl/graphictools.hxx +++ b/vcl/inc/vcl/graphictools.hxx @@ -424,18 +424,6 @@ public: void setHatchType ( HatchType aHatchType ); /// Set color used for drawing the hatch void setHatchColor ( Color aHatchColor ); - /// Set type of gradient used - void setGradientType ( GradientType aGradType ); - /// Set start color of the gradient - void setGradient1stColor ( Color aColor ); - /// Set end color of the gradient - void setGradient2ndColor ( Color aColor ); - /** Set the numbers of steps to render the gradient. - - @param aCount - The step count. gradientStepsInfinite means use infinitely many. - */ - void setGradientStepCount( int aCount ); /// Set the texture graphic used void setGraphic ( const Graphic& rGraphic ); diff --git a/vcl/source/gdi/graphictools.cxx b/vcl/source/gdi/graphictools.cxx index 2e20a3639790..251261d0943e 100644 --- a/vcl/source/gdi/graphictools.cxx +++ b/vcl/source/gdi/graphictools.cxx @@ -675,26 +675,6 @@ void SvtGraphicFill::setHatchColor( Color aHatchColor ) maHatchColor = aHatchColor; } -void SvtGraphicFill::setGradientType( GradientType aGradType ) -{ - maGradientType = aGradType; -} - -void SvtGraphicFill::setGradient1stColor( Color aColor ) -{ - maGradient1stColor = aColor; -} - -void SvtGraphicFill::setGradient2ndColor( Color aColor ) -{ - maGradient2ndColor = aColor; -} - -void SvtGraphicFill::setGradientStepCount( int aCount ) -{ - maGradientStepCount = aCount; -} - void SvtGraphicFill::setGraphic( const Graphic& rGraphic ) { maFillGraphic = rGraphic; -- cgit v1.2.3 From 75b074f7875448a811750865eaa8e7dc69bbd7fc Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 00:34:00 +0100 Subject: callcatcher: unused listPositionAt --- vcl/inc/list.h | 1 - vcl/source/fontsubset/list.c | 15 --------------- 2 files changed, 16 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/list.h b/vcl/inc/list.h index 78c7edce2839..6651deab846a 100644 --- a/vcl/inc/list.h +++ b/vcl/inc/list.h @@ -75,7 +75,6 @@ extern "C" int listSkipForward(list, int n); int listToFirst(list); int listToLast(list); - int listPositionAt(list, int n); /* Expensive! */ /*- adding and removing elements */ list listAppend(list, void *); diff --git a/vcl/source/fontsubset/list.c b/vcl/source/fontsubset/list.c index def5faa7b553..90a075466447 100644 --- a/vcl/source/fontsubset/list.c +++ b/vcl/source/fontsubset/list.c @@ -201,21 +201,6 @@ int listToLast(list this) return 0; } -int listPositionAt(list this, int n) /*- returns the actual position number */ -{ - int m = 0; - assert(this != 0); - - this->cptr = this->head; - while (n != 0) { - if (this->cptr->next == 0) break; - this->cptr = this->cptr->next; - n--; - m++; - } - return m; -} - list listAppend(list this, void *el) { assert(this != 0); -- cgit v1.2.3 From 2fcd82ae659ef8a61da08748f684ca928a2d3dc3 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 00:34:35 +0100 Subject: callcatcher: unused listPositionAt --- vcl/inc/list.h | 2 -- vcl/source/fontsubset/list.c | 18 ------------------ 2 files changed, 20 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/list.h b/vcl/inc/list.h index 6651deab846a..34e9cee266b1 100644 --- a/vcl/inc/list.h +++ b/vcl/inc/list.h @@ -66,8 +66,6 @@ extern "C" int listAtLast(list); int listPosition(list); /* Expensive! */ #endif -/*- search */ - int listFind(list, void *); /* Returns true/false */ /*- positioning functions */ /*- return the number of elements by which the current position in the list changes */ diff --git a/vcl/source/fontsubset/list.c b/vcl/source/fontsubset/list.c index 90a075466447..8b0b0f827a20 100644 --- a/vcl/source/fontsubset/list.c +++ b/vcl/source/fontsubset/list.c @@ -140,24 +140,6 @@ int listIsEmpty(list this) return this->aCount == 0; } -int listFind(list this, void *el) -{ - lnode *ptr; - assert(this != 0); - - ptr = this->head; - - while (ptr) { - if (ptr->value == el) { - this->cptr = ptr; - return 1; - } - ptr = ptr->next; - } - - return 0; -} - int listNext(list this) { return listSkipForward(this, 1); -- cgit v1.2.3 From 403f458b9511230801c2b26bfeb29d9f3f939094 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 00:51:32 +0100 Subject: remove unused TraceBands --- vcl/source/gdi/region.cxx | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'vcl') diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx index 3992b774630d..e4c1a3a7c4f7 100644 --- a/vcl/source/gdi/region.cxx +++ b/vcl/source/gdi/region.cxx @@ -382,34 +382,6 @@ const char* ImplDbgTestRegion( const void* pObj ) return NULL; } -void TraceBands (const ImplRegionBand* pFirstBand) -{ - int nBandIndex (0); - const ImplRegionBand* pBand = pFirstBand; - while (pBand != NULL) - { - OSL_TRACE(" band %d %d->%d : ", nBandIndex++, - pBand->mnYTop, pBand->mnYBottom); - - ImplRegionBandPoint* pPoint = pBand->mpFirstBandPoint; - while (pPoint != NULL) - { - OSL_TRACE(" %d ", pPoint->mnX); - pPoint = pPoint->mpNextBandPoint; - } - OSL_TRACE(" | "); - - ImplRegionBandSep* pSep = pBand->mpFirstSep; - while (pSep != NULL) - { - OSL_TRACE(" %d->%d ", pSep->mnXLeft, pSep->mnXRight); - pSep = pSep->mpNextSep; - } - OSL_TRACE("\n"); - - pBand = pBand->mpNextBand; - } -} #endif // ======================================================================= -- cgit v1.2.3 From 9615f8797f7a1cb18b4e185042579e4b3b416ace Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 01:11:38 +0100 Subject: callcatcher: GetAutofallback unused --- vcl/inc/sallayout.hxx | 1 - vcl/source/gdi/sallayout.cxx | 85 -------------------------------------------- 2 files changed, 86 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx index b91185769b27..9c727a895581 100644 --- a/vcl/inc/sallayout.hxx +++ b/vcl/inc/sallayout.hxx @@ -149,7 +149,6 @@ sal_UCS4 GetVerticalChar( sal_UCS4 ); // #i80090# GetMirroredChar also needed outside vcl, moved to svapp.hxx // VCL_DLLPUBLIC sal_UCS4 GetMirroredChar( sal_UCS4 ); sal_UCS4 GetLocalizedChar( sal_UCS4, LanguageType ); -VCL_PLUGIN_PUBLIC const char* GetAutofallback( sal_UCS4 ) ; // ------------- // - SalLayout - diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx index 9679170df9b9..8b04476a1bea 100644 --- a/vcl/source/gdi/sallayout.cxx +++ b/vcl/source/gdi/sallayout.cxx @@ -159,91 +159,6 @@ VCL_DLLPUBLIC sal_UCS4 GetMirroredChar( sal_UCS4 nChar ) // ----------------------------------------------------------------------- -// Get simple approximations for unicodes -const char* GetAutofallback( sal_UCS4 nChar ) -{ - const char* pStr = NULL; - switch( nChar ) - { - case 0x01C0: - case 0x2223: - case 0x2758: - pStr = "|"; break; - case 0x02DC: - pStr = "~"; break; - case 0x037E: - pStr = ";"; break; - case 0x2000: - case 0x2001: - case 0x2002: - case 0x2003: - case 0x2004: - case 0x2005: - case 0x2006: - case 0x2007: - case 0x2008: - case 0x2009: - case 0x200A: - case 0x202F: - pStr = " "; break; - case 0x2010: - case 0x2011: - case 0x2012: - case 0x2013: - case 0x2014: - pStr = "-"; break; - case 0x2015: - pStr = "--"; break; - case 0x2016: - pStr = "||"; break; - case 0x2017: - pStr = "_"; break; - case 0x2018: - case 0x2019: - case 0x201B: - pStr = "\'"; break; - case 0x201A: - pStr = ","; break; - case 0x201C: - case 0x201D: - case 0x201E: - case 0x201F: - case 0x2033: - pStr = "\""; break; - case 0x2039: - pStr = "<"; break; - case 0x203A: - pStr = ">"; break; - case 0x203C: - pStr = "!!"; break; - case 0x203D: - pStr = "?"; break; - case 0x2044: - case 0x2215: - pStr = "/"; break; - case 0x2048: - pStr = "?!"; break; - case 0x2049: - pStr = "!?"; break; - case 0x2216: - pStr = "\\"; break; - case 0x2217: - pStr = "*"; break; - case 0x2236: - pStr = ":"; break; - case 0x2264: - pStr = "<="; break; - case 0x2265: - pStr = "<="; break; - case 0x2303: - pStr = "^"; break; - } - - return pStr; -} - -// ----------------------------------------------------------------------- - sal_UCS4 GetLocalizedChar( sal_UCS4 nChar, LanguageType eLang ) { // currently only conversion from ASCII digits is interesting -- cgit v1.2.3 From 426aecc30ee6ab987a69a31ffc40779f69b2d8f0 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 11 Jul 2011 01:11:53 +0100 Subject: callcatcher: unused IsKeyCodeValid --- vcl/inc/vcl/accel.hxx | 1 - vcl/source/window/accel.cxx | 10 ---------- 2 files changed, 11 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/accel.hxx b/vcl/inc/vcl/accel.hxx index a7bf623cb20a..cf21000ee08a 100644 --- a/vcl/inc/vcl/accel.hxx +++ b/vcl/inc/vcl/accel.hxx @@ -98,7 +98,6 @@ public: sal_uInt16 GetItemId( const KeyCode& rKeyCode ) const; KeyCode GetKeyCode( sal_uInt16 nItemId ) const; sal_Bool IsIdValid( sal_uInt16 nItemId ) const; - sal_Bool IsKeyCodeValid( const KeyCode rKeyCode ) const; sal_Bool Call( const KeyCode& rKeyCode, sal_uInt16 nRepeat = 0 ); void SetAccel( sal_uInt16 nItemId, Accelerator* pAccel ); diff --git a/vcl/source/window/accel.cxx b/vcl/source/window/accel.cxx index 525c8ad5a76a..ebf15497b229 100644 --- a/vcl/source/window/accel.cxx +++ b/vcl/source/window/accel.cxx @@ -560,16 +560,6 @@ sal_Bool Accelerator::IsIdValid( sal_uInt16 nItemId ) const // ----------------------------------------------------------------------- -sal_Bool Accelerator::IsKeyCodeValid( const KeyCode rKeyCode ) const -{ - DBG_CHKTHIS( Accelerator, NULL ); - - ImplAccelEntry* pEntry = ImplGetAccelData( rKeyCode ); - return (pEntry != NULL); -} - -// ----------------------------------------------------------------------- - sal_Bool Accelerator::Call( const KeyCode& rKeyCode, sal_uInt16 nRepeat ) { DBG_CHKTHIS( Accelerator, NULL ); -- cgit v1.2.3 From 0a01387f059357600cf3dbccdab65cdae517c709 Mon Sep 17 00:00:00 2001 From: Joseph Powers Date: Mon, 11 Jul 2011 05:34:30 -0700 Subject: Replace List with std::vector< VCLXGraphics* > --- toolkit/source/awt/vclxgraphics.cxx | 16 ++++++++++++---- toolkit/source/helper/unowrapper.cxx | 6 +++--- vcl/inc/vcl/outdev.hxx | 23 +++++++++++++++-------- 3 files changed, 30 insertions(+), 15 deletions(-) (limited to 'vcl') diff --git a/toolkit/source/awt/vclxgraphics.cxx b/toolkit/source/awt/vclxgraphics.cxx index dc2c84702664..8f29a5e5e86f 100644 --- a/toolkit/source/awt/vclxgraphics.cxx +++ b/toolkit/source/awt/vclxgraphics.cxx @@ -73,9 +73,17 @@ VCLXGraphics::VCLXGraphics() VCLXGraphics::~VCLXGraphics() { - List* pLst = mpOutputDevice ? mpOutputDevice->GetUnoGraphicsList() : NULL; + VCLXGraphicsList_impl* pLst = mpOutputDevice ? mpOutputDevice->GetUnoGraphicsList() : NULL; if ( pLst ) - pLst->Remove( this ); + { + for( VCLXGraphicsList_impl::iterator it = pLst->begin(); it < pLst->end(); ++it ) + { + if( *it == this ) { + pLst->erase( it ); + break; + } + } + } delete mpClipRegion; } @@ -100,10 +108,10 @@ void VCLXGraphics::Init( OutputDevice* pOutDev ) mpClipRegion = NULL; // Register at OutputDevice - List* pLst = mpOutputDevice->GetUnoGraphicsList(); + VCLXGraphicsList_impl* pLst = mpOutputDevice->GetUnoGraphicsList(); if ( !pLst ) pLst = mpOutputDevice->CreateUnoGraphicsList(); - pLst->Insert( this, LIST_APPEND ); + pLst->push_back( this ); } void VCLXGraphics::InitOutputDevice( sal_uInt16 nFlags ) diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx index b5abb11d632e..cc4992d250e0 100644 --- a/toolkit/source/helper/unowrapper.cxx +++ b/toolkit/source/helper/unowrapper.cxx @@ -206,12 +206,12 @@ void UnoWrapper::SetWindowInterface( Window* pWindow, ::com::sun::star::uno::Ref void UnoWrapper::ReleaseAllGraphics( OutputDevice* pOutDev ) { - List* pLst = pOutDev->GetUnoGraphicsList(); + VCLXGraphicsList_impl* pLst = pOutDev->GetUnoGraphicsList(); if ( pLst ) { - for ( sal_uInt32 n = 0; n < pLst->Count(); n++ ) + for ( size_t n = 0; n < pLst->size(); n++ ) { - VCLXGraphics* pGrf = (VCLXGraphics*)pLst->GetObject( n ); + VCLXGraphics* pGrf = (*pLst)[ n ]; pGrf->SetOutputDevice( NULL ); } } diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx index b0d694c5e75e..78c7ad938d1a 100644 --- a/vcl/inc/vcl/outdev.hxx +++ b/vcl/inc/vcl/outdev.hxx @@ -282,6 +282,9 @@ class VirtualDevice; class Printer; class ImplFontSelectData; class ImplFontMetricData; +class VCLXGraphics; + +typedef ::std::vector< VCLXGraphics* > VCLXGraphicsList_impl; const char* ImplDbgCheckOutputDevice( const void* pObj ); @@ -305,17 +308,17 @@ private: mutable SalGraphics* mpGraphics; mutable OutputDevice* mpPrevGraphics; mutable OutputDevice* mpNextGraphics; - GDIMetaFile* mpMetaFile; + GDIMetaFile* mpMetaFile; mutable ImplFontEntry* mpFontEntry; mutable ImplFontCache* mpFontCache; mutable ImplDevFontList* mpFontList; mutable ImplGetDevFontList* mpGetDevFontList; mutable ImplGetDevSizeList* mpGetDevSizeList; - ImplObjStack* mpObjStack; - ImplOutDevData* mpOutDevData; - List* mpUnoGraphicsList; - vcl::PDFWriterImpl* mpPDFWriter; - vcl::ExtOutDevData* mpExtOutDevData; + ImplObjStack* mpObjStack; + ImplOutDevData* mpOutDevData; + VCLXGraphicsList_impl* mpUnoGraphicsList; + vcl::PDFWriterImpl* mpPDFWriter; + vcl::ExtOutDevData* mpExtOutDevData; // TEMP TEMP TEMP VirtualDevice* mpAlphaVDev; @@ -1141,8 +1144,12 @@ public: ::com::sun::star::rendering::XCanvas > GetCanvas() const; ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics > CreateUnoGraphics(); - List* GetUnoGraphicsList() const { return mpUnoGraphicsList; } - List* CreateUnoGraphicsList() { mpUnoGraphicsList = new List; return mpUnoGraphicsList; } + VCLXGraphicsList_impl* GetUnoGraphicsList() const { return mpUnoGraphicsList; } + VCLXGraphicsList_impl* CreateUnoGraphicsList() + { + mpUnoGraphicsList = new VCLXGraphicsList_impl(); + return mpUnoGraphicsList; + } static void BeginFontSubstitution(); static void EndFontSubstitution(); -- cgit v1.2.3 From 28dfd3a2e2c6a39626c55fce2303c83eea210e55 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 11 Jul 2011 13:17:20 +0100 Subject: callcatcher: remove unused Application::GetReservedKeyCodeDescription --- vcl/inc/vcl/svapp.hxx | 1 - vcl/source/app/svapp.cxx | 12 ------------ 2 files changed, 13 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/svapp.hxx b/vcl/inc/vcl/svapp.hxx index d78d42cf1d52..20eec8a9811e 100644 --- a/vcl/inc/vcl/svapp.hxx +++ b/vcl/inc/vcl/svapp.hxx @@ -379,7 +379,6 @@ public: static sal_uLong GetReservedKeyCodeCount(); static const KeyCode* GetReservedKeyCode( sal_uLong i ); - static String GetReservedKeyCodeDescription( sal_uLong i ); static void SetDefDialogParent( Window* pWindow ); static Window* GetDefDialogParent(); diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index fad5ad84ac7d..e6619cbfd20b 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -417,18 +417,6 @@ const KeyCode* Application::GetReservedKeyCode( sal_uLong i ) return &ImplReservedKeys::get()->first[i].mKeyCode; } -String Application::GetReservedKeyCodeDescription( sal_uLong i ) -{ - ResMgr* pResMgr = ImplGetResMgr(); - if( ! pResMgr ) - return String(); - ImplReservedKey *pImplReservedKeys = ImplReservedKeys::get()->first; - if( i >= GetReservedKeyCodeCount() || ! pImplReservedKeys[i].mnResId ) - return String(); - else - return String( ResId( pImplReservedKeys[i].mnResId, *pResMgr ) ); -} - // ----------------------------------------------------------------------- void Application::Execute() -- cgit v1.2.3 From 468de84e52821728cb46035f252fac57df3b334e Mon Sep 17 00:00:00 2001 From: Francois Tigeot Date: Fri, 8 Jul 2011 23:01:55 +0200 Subject: Cleanup some old X11 code, remove useless tests --- vcl/unx/generic/app/saldisp.cxx | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'vcl') diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx index 90d65efbd921..8156b86cab08 100644 --- a/vcl/unx/generic/app/saldisp.cxx +++ b/vcl/unx/generic/app/saldisp.cxx @@ -885,10 +885,7 @@ void SalDisplay::Init() sscanf( pProperties, "%li", &nProperties_ ); else { -#if defined DBG_UTIL || defined SUN || defined LINUX || defined FREEBSD || \ - defined NETBSD || defined OPENBSD || defined DRAGONFLY nProperties_ |= PROPERTY_FEATURE_Maximize; -#endif // Server Bugs & Properties if( GetServerVendor() == vendor_excursion ) { @@ -909,31 +906,6 @@ void SalDisplay::Init() if( otherwm == eWindowManager_ ) eWindowManager_ = mwm; } else - if( GetServerVendor() == vendor_xfree ) - { - nProperties_ |= PROPERTY_BUG_XCopyArea_GXxor; -#if defined LINUX || defined FREEBSD || defined NETBSD || defined OPENBSD || \ - defined DRAGONFLY - // otherwm and olwm are a kind of default, which are not detected - // carefully. if we are running linux (i.e. not netbsd) on an xfree - // display, fvwm is most probable the wm to choose, confusing with mwm - // doesn't harm. #57791# start maximized if possible - if( (otherwm == eWindowManager_) - || (olwm == eWindowManager_ )) - { - eWindowManager_ = fvwm; // ??? - nProperties_ |= PROPERTY_FEATURE_Maximize; - } -#else - if( otherwm == eWindowManager_ ) eWindowManager_ = winmgr; -#endif -#if defined SOLARIS && defined SPARC - nProperties_ |= PROPERTY_BUG_Bitmap_Bit_Order; - // solaris xlib seems to have problems with putting images - // in correct bit order to xfree 8 bit displays -#endif - } - else if( GetServerVendor() == vendor_sun ) { // nicht alle! (bekannt: nur Sparc II CG3, CG6?) -- cgit v1.2.3 From d0587241ebf9fefa0834b903e69bcb4acc1c2a94 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Mon, 11 Jul 2011 16:46:32 +0200 Subject: callcatcher: remove unused Image::GetColorTransformArrays --- vcl/inc/vcl/image.hxx | 1 - vcl/source/gdi/image.cxx | 30 ------------------------------ 2 files changed, 31 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/image.hxx b/vcl/inc/vcl/image.hxx index d536d6bd03d7..7b64582f4a2e 100644 --- a/vcl/inc/vcl/image.hxx +++ b/vcl/inc/vcl/image.hxx @@ -87,7 +87,6 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > GetXGraphic() const; Image GetColorTransformedImage( ImageColorTransform eColorTransform ) const; - static void GetColorTransformArrays( ImageColorTransform eColorTransform, Color*& rpSrcColor, Color*& rpDstColor, sal_uLong& rColorCount ); void Invert(); diff --git a/vcl/source/gdi/image.cxx b/vcl/source/gdi/image.cxx index 18f927e5b0ff..2e8459725907 100644 --- a/vcl/source/gdi/image.cxx +++ b/vcl/source/gdi/image.cxx @@ -285,36 +285,6 @@ void Image::Invert() // ----------------------------------------------------------------------- -void Image::GetColorTransformArrays( ImageColorTransform eColorTransform, - Color*& rpSrcColor, Color*& rpDstColor, sal_uLong& rColorCount ) -{ - if( IMAGECOLORTRANSFORM_HIGHCONTRAST == eColorTransform ) - { - rpSrcColor = new Color[ 4 ]; - rpDstColor = new Color[ 4 ]; - rColorCount = 4; - - rpSrcColor[ 0 ] = Color( COL_BLACK ); - rpDstColor[ 0 ] = Color( COL_WHITE ); - - rpSrcColor[ 1 ] = Color( COL_WHITE ); - rpDstColor[ 1 ] = Color( COL_BLACK ); - - rpSrcColor[ 2 ] = Color( COL_BLUE ); - rpDstColor[ 2 ] = Color( COL_WHITE ); - - rpSrcColor[ 3 ] = Color( COL_LIGHTBLUE ); - rpDstColor[ 3 ] = Color( COL_WHITE ); - } - else - { - rpSrcColor = rpDstColor = NULL; - rColorCount = 0; - } -} - -// ----------------------------------------------------------------------- - Image& Image::operator=( const Image& rImage ) { DBG_CHKTHIS( Image, NULL ); -- cgit v1.2.3 From e5bcbc7fb2903504d967a8a1f0218de2acb11170 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Mon, 11 Jul 2011 16:47:00 +0200 Subject: callcatcher: remove unused Image::Invert --- vcl/inc/vcl/image.hxx | 2 -- vcl/source/gdi/image.cxx | 9 --------- 2 files changed, 11 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/image.hxx b/vcl/inc/vcl/image.hxx index 7b64582f4a2e..301af44bead9 100644 --- a/vcl/inc/vcl/image.hxx +++ b/vcl/inc/vcl/image.hxx @@ -88,8 +88,6 @@ public: Image GetColorTransformedImage( ImageColorTransform eColorTransform ) const; - void Invert(); - sal_Bool operator!() const { return( !mpImplData ? true : false ); } Image& operator=( const Image& rImage ); sal_Bool operator==( const Image& rImage ) const; diff --git a/vcl/source/gdi/image.cxx b/vcl/source/gdi/image.cxx index 2e8459725907..f587bc29d2e9 100644 --- a/vcl/source/gdi/image.cxx +++ b/vcl/source/gdi/image.cxx @@ -276,15 +276,6 @@ uno::Reference< graphic::XGraphic > Image::GetXGraphic() const // ----------------------------------------------------------------------- -void Image::Invert() -{ - BitmapEx aInvertedBmp( GetBitmapEx() ); - aInvertedBmp.Invert(); - *this = aInvertedBmp; -} - -// ----------------------------------------------------------------------- - Image& Image::operator=( const Image& rImage ) { DBG_CHKTHIS( Image, NULL ); -- cgit v1.2.3 From 22f299b12e1c874a43b38f7efdda0d1b952d09a0 Mon Sep 17 00:00:00 2001 From: Matus Kukan Date: Sun, 3 Jul 2011 17:43:02 +0200 Subject: Remove component_getImplementationEnvironment methods --- canvas/source/cairo/exports.dxp | 1 - canvas/source/directx/exports.dxp | 1 - canvas/source/factory/cf_service.cxx | 6 ------ canvas/source/null/exports.dxp | 1 - canvas/source/simplecanvas/exports.dxp | 3 +-- canvas/source/vcl/exports.dxp | 3 +-- comphelper/inc/comphelper/componentmodule.hxx | 5 ----- comphelper/inc/comphelper/servicedecl.hxx | 6 ------ cppcanvas/source/uno/exports.dxp | 1 - cppcanvas/source/uno/exports.map | 1 - dtrans/source/cnttype/exports.dxp | 1 - dtrans/source/cnttype/mctfentry.cxx | 15 --------------- dtrans/source/generic/dtrans.cxx | 8 -------- dtrans/source/generic/exports.dxp | 1 - dtrans/source/win32/clipb/exports.dxp | 2 -- dtrans/source/win32/clipb/wcbentry.cxx | 15 --------------- dtrans/source/win32/dnd/dndentry.cxx | 10 ---------- dtrans/source/win32/dnd/exports.dxp | 1 - dtrans/source/win32/ftransl/exports.dxp | 1 - dtrans/source/win32/ftransl/ftranslentry.cxx | 15 --------------- dtrans/util/exports.dxp | 1 - i18npool/source/registerservices/registerservices.cxx | 5 ----- i18npool/source/search/textsearch.cxx | 6 ------ sax/source/expatwrap/sax_expat.cxx | 6 ------ sax/source/fastparser/facreg.cxx | 6 ------ sax/test/sax/exports.dxp | 3 +-- sax/test/sax/testsax.cxx | 8 -------- sot/source/unoolestorage/register.cxx | 5 ----- svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx | 7 ------- svl/source/fsstor/fsfactory.cxx | 6 ------ svl/source/passwordcontainer/passwordcontainer.cxx | 6 ------ svl/source/uno/registerservices.cxx | 6 ------ svtools/source/hatchwindow/hatchwindowfactory.cxx | 6 ------ .../source/productregistration/productregistration.cxx | 6 ------ svtools/source/uno/miscservices.cxx | 6 ------ toolkit/source/helper/registerservices.cxx | 5 ----- ucbhelper/workben/myucp/myucp_services.cxx | 7 ------- unotools/source/ucbhelper/xtempfile.cxx | 8 -------- vcl/source/components/factory.cxx | 7 ------- 39 files changed, 3 insertions(+), 204 deletions(-) (limited to 'vcl') diff --git a/canvas/source/cairo/exports.dxp b/canvas/source/cairo/exports.dxp index f0e1c69934bc..70033078921a 100644 --- a/canvas/source/cairo/exports.dxp +++ b/canvas/source/cairo/exports.dxp @@ -1,2 +1 @@ -component_getImplementationEnvironment component_getFactory diff --git a/canvas/source/directx/exports.dxp b/canvas/source/directx/exports.dxp index f0e1c69934bc..70033078921a 100644 --- a/canvas/source/directx/exports.dxp +++ b/canvas/source/directx/exports.dxp @@ -1,2 +1 @@ -component_getImplementationEnvironment component_getFactory diff --git a/canvas/source/factory/cf_service.cxx b/canvas/source/factory/cf_service.cxx index e96f31f5ba7a..316c4b7aecff 100644 --- a/canvas/source/factory/cf_service.cxx +++ b/canvas/source/factory/cf_service.cxx @@ -527,12 +527,6 @@ const ::cppu::ImplementationEntry s_entries [] = { extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( - const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( sal_Char const * pImplName, lang::XMultiServiceFactory * pServiceManager, diff --git a/canvas/source/null/exports.dxp b/canvas/source/null/exports.dxp index f0e1c69934bc..70033078921a 100644 --- a/canvas/source/null/exports.dxp +++ b/canvas/source/null/exports.dxp @@ -1,2 +1 @@ -component_getImplementationEnvironment component_getFactory diff --git a/canvas/source/simplecanvas/exports.dxp b/canvas/source/simplecanvas/exports.dxp index 0cb5620a1603..70033078921a 100644 --- a/canvas/source/simplecanvas/exports.dxp +++ b/canvas/source/simplecanvas/exports.dxp @@ -1,2 +1 @@ -component_getImplementationEnvironment -component_getFactory \ No newline at end of file +component_getFactory diff --git a/canvas/source/vcl/exports.dxp b/canvas/source/vcl/exports.dxp index 0cb5620a1603..70033078921a 100644 --- a/canvas/source/vcl/exports.dxp +++ b/canvas/source/vcl/exports.dxp @@ -1,2 +1 @@ -component_getImplementationEnvironment -component_getFactory \ No newline at end of file +component_getFactory diff --git a/comphelper/inc/comphelper/componentmodule.hxx b/comphelper/inc/comphelper/componentmodule.hxx index 4bc917ef13d3..198d6c37bb20 100644 --- a/comphelper/inc/comphelper/componentmodule.hxx +++ b/comphelper/inc/comphelper/componentmodule.hxx @@ -355,11 +355,6 @@ namespace comphelper //= implementing the API of a component library (component_*) #define IMPLEMENT_COMPONENT_LIBRARY_API( module_class, initializer_function ) \ - extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( \ - const sal_Char **ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) \ - { \ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; \ - } \ extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( \ const sal_Char* pImplementationName, void* pServiceManager, void* pRegistryKey ) \ { \ diff --git a/comphelper/inc/comphelper/servicedecl.hxx b/comphelper/inc/comphelper/servicedecl.hxx index b025cc7ffdce..c5ab4b79f5f7 100644 --- a/comphelper/inc/comphelper/servicedecl.hxx +++ b/comphelper/inc/comphelper/servicedecl.hxx @@ -387,12 +387,6 @@ BOOST_PP_REPEAT_FROM_TO(1, COMPHELPER_SERVICEDECL_COMPONENT_HELPER_MAX_ARGS, #define COMPHELPER_SERVICEDECL_make_exports(varargs_ ) \ extern "C" \ { \ - SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char** ppEnvTypeName, \ - uno_Environment** /*ppEnv*/ ) \ - { \ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; \ - } \ - \ SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( sal_Char const* pImplName, \ ::com::sun::star::lang::XMultiServiceFactory* pServiceManager, \ ::com::sun::star::registry::XRegistryKey* pRegistryKey ) \ diff --git a/cppcanvas/source/uno/exports.dxp b/cppcanvas/source/uno/exports.dxp index f0e1c69934bc..70033078921a 100644 --- a/cppcanvas/source/uno/exports.dxp +++ b/cppcanvas/source/uno/exports.dxp @@ -1,2 +1 @@ -component_getImplementationEnvironment component_getFactory diff --git a/cppcanvas/source/uno/exports.map b/cppcanvas/source/uno/exports.map index a488d5d06a43..f1ded4b70d9a 100644 --- a/cppcanvas/source/uno/exports.map +++ b/cppcanvas/source/uno/exports.map @@ -1,7 +1,6 @@ UDK_3_0_0 { global: _ZTI*; _ZTS*; # weak RTTI symbols for C++ exceptions - component_getImplementationEnvironment; component_getFactory; local: *; diff --git a/dtrans/source/cnttype/exports.dxp b/dtrans/source/cnttype/exports.dxp index f0e1c69934bc..70033078921a 100644 --- a/dtrans/source/cnttype/exports.dxp +++ b/dtrans/source/cnttype/exports.dxp @@ -1,2 +1 @@ -component_getImplementationEnvironment component_getFactory diff --git a/dtrans/source/cnttype/mctfentry.cxx b/dtrans/source/cnttype/mctfentry.cxx index 5a4df1c21798..6b09a8e69ce6 100644 --- a/dtrans/source/cnttype/mctfentry.cxx +++ b/dtrans/source/cnttype/mctfentry.cxx @@ -83,23 +83,8 @@ namespace } } -//----------------------------------------------------------------------------------------------------------- -// the 3 important functions which will be exported -//----------------------------------------------------------------------------------------------------------- - extern "C" { - -//---------------------------------------------------------------------- -// component_getImplementationEnvironment -//---------------------------------------------------------------------- - -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( - const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - //---------------------------------------------------------------------- // component_getFactory // returns a factory to create XFilePicker-Services diff --git a/dtrans/source/generic/dtrans.cxx b/dtrans/source/generic/dtrans.cxx index 7a47d12920a6..c9295644ea80 100644 --- a/dtrans/source/generic/dtrans.cxx +++ b/dtrans/source/generic/dtrans.cxx @@ -46,14 +46,6 @@ extern "C" //================================================================================================== -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(const sal_Char ** ppEnvTypeName, - uno_Environment ** /*ppEnv*/ ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - -//================================================================================================== - SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, diff --git a/dtrans/source/generic/exports.dxp b/dtrans/source/generic/exports.dxp index f0e1c69934bc..70033078921a 100644 --- a/dtrans/source/generic/exports.dxp +++ b/dtrans/source/generic/exports.dxp @@ -1,2 +1 @@ -component_getImplementationEnvironment component_getFactory diff --git a/dtrans/source/win32/clipb/exports.dxp b/dtrans/source/win32/clipb/exports.dxp index 926e49f5f1a5..70033078921a 100644 --- a/dtrans/source/win32/clipb/exports.dxp +++ b/dtrans/source/win32/clipb/exports.dxp @@ -1,3 +1 @@ -component_getImplementationEnvironment component_getFactory - diff --git a/dtrans/source/win32/clipb/wcbentry.cxx b/dtrans/source/win32/clipb/wcbentry.cxx index cd0de3ebf9ff..5c61e6c3557f 100644 --- a/dtrans/source/win32/clipb/wcbentry.cxx +++ b/dtrans/source/win32/clipb/wcbentry.cxx @@ -81,23 +81,8 @@ namespace } } -//----------------------------------------------------------------------------------------------------------- -// the 3 important functions which will be exported -//----------------------------------------------------------------------------------------------------------- - extern "C" { - -//---------------------------------------------------------------------- -// component_getImplementationEnvironment -//---------------------------------------------------------------------- - -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( - const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - //---------------------------------------------------------------------- // component_getFactory // returns a factory to create XFilePicker-Services diff --git a/dtrans/source/win32/dnd/dndentry.cxx b/dtrans/source/win32/dnd/dndentry.cxx index b089f95b6472..e7b56fcc5cf7 100644 --- a/dtrans/source/win32/dnd/dndentry.cxx +++ b/dtrans/source/win32/dnd/dndentry.cxx @@ -63,16 +63,6 @@ sal_Bool SAL_CALL component_canUnload( TimeValue *pTime ) return g_moduleCount.canUnload( &g_moduleCount , pTime ); } -//---------------------------------------------------------------------- -// component_getImplementationEnvironment -//---------------------------------------------------------------------- - -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( - const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - //---------------------------------------------------------------------- // component_getFactory // returns a factory to create XFilePicker-Services diff --git a/dtrans/source/win32/dnd/exports.dxp b/dtrans/source/win32/dnd/exports.dxp index f0e1c69934bc..70033078921a 100644 --- a/dtrans/source/win32/dnd/exports.dxp +++ b/dtrans/source/win32/dnd/exports.dxp @@ -1,2 +1 @@ -component_getImplementationEnvironment component_getFactory diff --git a/dtrans/source/win32/ftransl/exports.dxp b/dtrans/source/win32/ftransl/exports.dxp index f0e1c69934bc..70033078921a 100644 --- a/dtrans/source/win32/ftransl/exports.dxp +++ b/dtrans/source/win32/ftransl/exports.dxp @@ -1,2 +1 @@ -component_getImplementationEnvironment component_getFactory diff --git a/dtrans/source/win32/ftransl/ftranslentry.cxx b/dtrans/source/win32/ftransl/ftranslentry.cxx index fb0655ead9cd..e519b5361102 100644 --- a/dtrans/source/win32/ftransl/ftranslentry.cxx +++ b/dtrans/source/win32/ftransl/ftranslentry.cxx @@ -84,23 +84,8 @@ namespace } } -//----------------------------------------------------------------------------------------------------------- -// the 3 important functions which will be exported -//----------------------------------------------------------------------------------------------------------- - extern "C" { - -//---------------------------------------------------------------------- -// component_getImplementationEnvironment -//---------------------------------------------------------------------- - -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( - const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - //---------------------------------------------------------------------- // component_getFactory // returns a factory to create XFilePicker-Services diff --git a/dtrans/util/exports.dxp b/dtrans/util/exports.dxp index f0e1c69934bc..70033078921a 100644 --- a/dtrans/util/exports.dxp +++ b/dtrans/util/exports.dxp @@ -1,2 +1 @@ -component_getImplementationEnvironment component_getFactory diff --git a/i18npool/source/registerservices/registerservices.cxx b/i18npool/source/registerservices/registerservices.cxx index fd08933af2fa..5df7bb931b7c 100644 --- a/i18npool/source/registerservices/registerservices.cxx +++ b/i18npool/source/registerservices/registerservices.cxx @@ -576,11 +576,6 @@ static const struct InstancesArray { extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char** ppEnvTypeName, uno_Environment** /*ppEnv*/ ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* sImplementationName, void* _pServiceManager, void* /*_pRegistryKey*/ ) { void* pRet = NULL; diff --git a/i18npool/source/search/textsearch.cxx b/i18npool/source/search/textsearch.cxx index 756d6c863ff9..f407a614ed1f 100644 --- a/i18npool/source/search/textsearch.cxx +++ b/i18npool/source/search/textsearch.cxx @@ -982,12 +982,6 @@ SAL_CALL TextSearch_CreateInstance( extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( - const sal_Char** ppEnvTypeName, uno_Environment** /*ppEnv*/ ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* sImplementationName, void* _pServiceManager, void* /*_pRegistryKey*/ ) { diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx index 06258510ceca..34df91a83a26 100644 --- a/sax/source/expatwrap/sax_expat.cxx +++ b/sax/source/expatwrap/sax_expat.cxx @@ -1029,12 +1029,6 @@ using namespace sax_expatwrap; extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( - const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) { diff --git a/sax/source/fastparser/facreg.cxx b/sax/source/fastparser/facreg.cxx index e4152cfc1b58..8352b0cf4824 100644 --- a/sax/source/fastparser/facreg.cxx +++ b/sax/source/fastparser/facreg.cxx @@ -35,12 +35,6 @@ Reference< XInterface > SAL_CALL FastSaxSerializer_CreateInstance( const Referen extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( - const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) { void * pRet = 0; diff --git a/sax/test/sax/exports.dxp b/sax/test/sax/exports.dxp index ce95ae0f8deb..86214860d555 100644 --- a/sax/test/sax/exports.dxp +++ b/sax/test/sax/exports.dxp @@ -1,3 +1,2 @@ -component_getImplementationEnvironment component_getFactory -component_writeInfo \ No newline at end of file +component_writeInfo diff --git a/sax/test/sax/testsax.cxx b/sax/test/sax/testsax.cxx index db58f193088f..aad3b9ed5f7c 100644 --- a/sax/test/sax/testsax.cxx +++ b/sax/test/sax/testsax.cxx @@ -786,14 +786,6 @@ using namespace sax_test; extern "C" { - -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( - const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - - sal_Bool SAL_CALL component_writeInfo( void * pServiceManager, void * pRegistryKey ) { diff --git a/sot/source/unoolestorage/register.cxx b/sot/source/unoolestorage/register.cxx index 30f417b29625..2738a8054af3 100644 --- a/sot/source/unoolestorage/register.cxx +++ b/sot/source/unoolestorage/register.cxx @@ -41,11 +41,6 @@ using namespace ::com::sun::star; extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL sot_component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL sot_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) { void * pRet = 0; diff --git a/svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx b/svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx index 3172fd9322d6..a287fa499886 100644 --- a/svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx +++ b/svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx @@ -221,13 +221,6 @@ static ::cppu::ImplementationEntry const lRegEntries[] = { 0, 0, 0, 0, 0, 0 } }; -//============================================================================= -extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(const char** pEnvTypeName, - uno_Environment** ) -{ - *pEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - //============================================================================= extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(const char* sImplName , void* pServiceManager, diff --git a/svl/source/fsstor/fsfactory.cxx b/svl/source/fsstor/fsfactory.cxx index db6fc301a0d0..61a8f7f15048 100644 --- a/svl/source/fsstor/fsfactory.cxx +++ b/svl/source/fsstor/fsfactory.cxx @@ -235,12 +235,6 @@ uno::Sequence< ::rtl::OUString > SAL_CALL FSStorageFactory::getSupportedServiceN extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL fsstorage_component_getImplementationEnvironment ( - const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL fsstorage_component_getFactory ( const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */) { diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx index d584a1c77725..86c72fb3619b 100644 --- a/svl/source/passwordcontainer/passwordcontainer.cxx +++ b/svl/source/passwordcontainer/passwordcontainer.cxx @@ -1538,12 +1538,6 @@ MasterPasswordRequest_Impl::MasterPasswordRequest_Impl( PasswordRequestMode Mode extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL passwordcontainer_component_getImplementationEnvironment ( - const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL passwordcontainer_component_getFactory ( const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */) { diff --git a/svl/source/uno/registerservices.cxx b/svl/source/uno/registerservices.cxx index 3fa8b0e7ebef..d001c73da633 100644 --- a/svl/source/uno/registerservices.cxx +++ b/svl/source/uno/registerservices.cxx @@ -55,12 +55,6 @@ DECLARE_CREATEINSTANCE( PathService ) extern "C" { -SVL_DLLPUBLIC void SAL_CALL svl_component_getImplementationEnvironment ( - const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - SVL_DLLPUBLIC void* SAL_CALL svl_component_getFactory ( const sal_Char * pImplementationName, void * _pServiceManager, void * /* _pRegistryKey*/) { diff --git a/svtools/source/hatchwindow/hatchwindowfactory.cxx b/svtools/source/hatchwindow/hatchwindowfactory.cxx index 13f78b3e353b..93401d8f8f43 100644 --- a/svtools/source/hatchwindow/hatchwindowfactory.cxx +++ b/svtools/source/hatchwindow/hatchwindowfactory.cxx @@ -109,12 +109,6 @@ uno::Sequence< ::rtl::OUString > SAL_CALL OHatchWindowFactory::getSupportedServi extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL hatchwindowfactory_component_getImplementationEnvironment ( - const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL hatchwindowfactory_component_getFactory ( const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */) { diff --git a/svtools/source/productregistration/productregistration.cxx b/svtools/source/productregistration/productregistration.cxx index ebedda0ad071..a3312c107a52 100644 --- a/svtools/source/productregistration/productregistration.cxx +++ b/svtools/source/productregistration/productregistration.cxx @@ -453,12 +453,6 @@ namespace svt extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL productregistration_component_getImplementationEnvironment ( - const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL productregistration_component_getFactory ( const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */) { diff --git a/svtools/source/uno/miscservices.cxx b/svtools/source/uno/miscservices.cxx index 1b20ef518683..e49672bbac52 100644 --- a/svtools/source/uno/miscservices.cxx +++ b/svtools/source/uno/miscservices.cxx @@ -96,12 +96,6 @@ DECLARE_CREATEINSTANCE_NAMESPACE( unographic, GraphicRendererVCL ) extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL svt_component_getImplementationEnvironment ( - const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL svt_component_getFactory ( const sal_Char * pImplementationName, void * _pServiceManager, void * pRegistryKey) { diff --git a/toolkit/source/helper/registerservices.cxx b/toolkit/source/helper/registerservices.cxx index 6e11e72970be..3a532b83de14 100644 --- a/toolkit/source/helper/registerservices.cxx +++ b/toolkit/source/helper/registerservices.cxx @@ -236,11 +236,6 @@ extern void * SAL_CALL comp_Layout_component_getFactory( const char * implName, extern "C" { -TOOLKIT_DLLPUBLIC void SAL_CALL tk_component_getImplementationEnvironment( const sal_Char** ppEnvTypeName, uno_Environment** ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - TOOLKIT_DLLPUBLIC void* SAL_CALL tk_component_getFactory( const sal_Char* sImplementationName, void* _pServiceManager, void* _pRegistryKey ) { void* pRet = NULL; diff --git a/ucbhelper/workben/myucp/myucp_services.cxx b/ucbhelper/workben/myucp/myucp_services.cxx index 6551ca755a12..c455addd1a22 100644 --- a/ucbhelper/workben/myucp/myucp_services.cxx +++ b/ucbhelper/workben/myucp/myucp_services.cxx @@ -80,13 +80,6 @@ sal_Bool writeInfo( void * pRegistryKey, } -//========================================================================= -extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( - const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - //========================================================================= extern "C" sal_Bool SAL_CALL component_writeInfo( void * /*pServiceManager*/, void * pRegistryKey ) diff --git a/unotools/source/ucbhelper/xtempfile.cxx b/unotools/source/ucbhelper/xtempfile.cxx index d73981670d5d..bf4a88112929 100644 --- a/unotools/source/ucbhelper/xtempfile.cxx +++ b/unotools/source/ucbhelper/xtempfile.cxx @@ -484,14 +484,6 @@ throw ( ::css::uno::RuntimeException ) return ::cppu::createSingleComponentFactory( XTempFile_createInstance, getImplementationName_Static(), getSupportedServiceNames_Static() ); } -// C functions to implement this as a component - -extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL utl_component_getImplementationEnvironment( - const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - /** * This function is called to get service factories for an implementation. * @param pImplName name of implementation diff --git a/vcl/source/components/factory.cxx b/vcl/source/components/factory.cxx index de76b6e84c58..9701e83e886a 100644 --- a/vcl/source/components/factory.cxx +++ b/vcl/source/components/factory.cxx @@ -83,13 +83,6 @@ namespace rsvg extern "C" { - VCL_DLLPUBLIC void SAL_CALL vcl_component_getImplementationEnvironment( - const sal_Char** ppEnvTypeName, - uno_Environment** /*ppEnv*/ ) - { - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; - } - VCL_DLLPUBLIC void* SAL_CALL vcl_component_getFactory( const sal_Char* pImplementationName, void* pXUnoSMgr, -- cgit v1.2.3 From 32096886c88a7bb97e8c6fd30cce2fff2a598d17 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Tue, 12 Jul 2011 23:23:04 +0200 Subject: callcatcher: remove unused TimeBox::Foo --- vcl/inc/vcl/field.hxx | 7 ---- vcl/source/control/field2.cxx | 74 ------------------------------------------- 2 files changed, 81 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/field.hxx b/vcl/inc/vcl/field.hxx index 9271df88ba86..639f33afae4e 100644 --- a/vcl/inc/vcl/field.hxx +++ b/vcl/inc/vcl/field.hxx @@ -866,7 +866,6 @@ class VCL_DLLPUBLIC TimeBox : public ComboBox, public TimeFormatter { public: TimeBox( Window* pParent, WinBits nWinStyle ); - TimeBox( Window* pParent, const ResId& rResId ); ~TimeBox(); virtual long PreNotify( NotifyEvent& rNEvt ); @@ -876,12 +875,6 @@ public: virtual void Modify(); virtual void ReformatAll(); - - void InsertTime( const Time& rTime, sal_uInt16 nPos = COMBOBOX_APPEND ); - void RemoveTime( const Time& rTime ); - using TimeFormatter::GetTime; - Time GetTime( sal_uInt16 nPos ) const; - sal_uInt16 GetTimePos( const Time& rTime ) const; }; #endif // _SV_FIELD_HXX diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index 74241bef0f1b..63e4cd80f199 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -3323,26 +3323,6 @@ TimeBox::TimeBox( Window* pParent, WinBits nWinStyle ) : // ----------------------------------------------------------------------- -TimeBox::TimeBox( Window* pParent, const ResId& rResId ) : - ComboBox( WINDOW_TIMEBOX ) -{ - rResId.SetRT( RSC_TIMEBOX ); - WinBits nStyle = ImplInitRes( rResId ); - ComboBox::ImplInit( pParent, nStyle ); - SetField( this ); - SetText( ImplGetLocaleDataWrapper().getTime( maFieldTime, sal_False, sal_False ) ); - ComboBox::ImplLoadRes( rResId ); - ResMgr* pMgr = rResId.GetResMgr(); - if( pMgr ) - TimeFormatter::ImplLoadRes( ResId( (RSHEADER_TYPE *)GetClassRes(), *pMgr ) ); - Reformat(); - - if ( !(nStyle & WB_HIDE) ) - Show(); -} - -// ----------------------------------------------------------------------- - TimeBox::~TimeBox() { } @@ -3414,58 +3394,4 @@ void TimeBox::ReformatAll() SetUpdateMode( sal_True ); } -// ----------------------------------------------------------------------- - -void TimeBox::InsertTime( const Time& rTime, sal_uInt16 nPos ) -{ - Time aTime = rTime; - if ( aTime > GetMax() ) - aTime = GetMax(); - else if ( aTime < GetMin() ) - aTime = GetMin(); - - sal_Bool bSec = sal_False; - sal_Bool b100Sec = sal_False; - if ( GetFormat() == TIMEF_SEC ) - bSec = sal_True; - if ( GetFormat() == TIMEF_100TH_SEC || GetFormat() == TIMEF_SEC_CS ) - bSec = b100Sec = sal_True; - ComboBox::InsertEntry( ImplGetLocaleDataWrapper().getTime( aTime, bSec, b100Sec ), nPos ); -} - -// ----------------------------------------------------------------------- - -void TimeBox::RemoveTime( const Time& rTime ) -{ - sal_Bool bSec = sal_False; - sal_Bool b100Sec = sal_False; - if ( GetFormat() == TIMEF_SEC ) - bSec = sal_True; - if ( GetFormat() == TIMEF_100TH_SEC || TIMEF_SEC_CS ) - bSec = b100Sec = sal_True; - ComboBox::RemoveEntry( ImplGetLocaleDataWrapper().getTime( rTime, bSec, b100Sec ) ); -} - -// ----------------------------------------------------------------------- - -Time TimeBox::GetTime( sal_uInt16 nPos ) const -{ - Time aTime( 0, 0, 0 ); - ImplTimeGetValue( ComboBox::GetEntry( nPos ), aTime, GetFormat(), IsDuration(), ImplGetLocaleDataWrapper() ); - return aTime; -} - -// ----------------------------------------------------------------------- - -sal_uInt16 TimeBox::GetTimePos( const Time& rTime ) const -{ - sal_Bool bSec = sal_False; - sal_Bool b100Sec = sal_False; - if ( GetFormat() == TIMEF_SEC ) - bSec = sal_True; - if ( GetFormat() == TIMEF_100TH_SEC || TIMEF_SEC_CS ) - bSec = b100Sec = sal_True; - return ComboBox::GetEntryPos( ImplGetLocaleDataWrapper().getTime( rTime, bSec, b100Sec ) ); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From fa8eff8cb7c8c11b2a210009d97636d4af29050e Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Tue, 12 Jul 2011 23:24:44 +0200 Subject: callcatcher: remove unused TimeFormatter::Foo --- vcl/inc/vcl/field.hxx | 2 -- vcl/source/control/field2.cxx | 29 ----------------------------- 2 files changed, 31 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/field.hxx b/vcl/inc/vcl/field.hxx index 639f33afae4e..4af5e1a6128b 100644 --- a/vcl/inc/vcl/field.hxx +++ b/vcl/inc/vcl/field.hxx @@ -475,8 +475,6 @@ public: void SetTime( const Time& rNewTime ); void SetUserTime( const Time& rNewTime ); Time GetTime() const; - Time GetRealTime() const; - sal_Bool IsTimeModified() const; void SetEmptyTime() { FormatterBase::SetEmptyFieldValue(); } sal_Bool IsEmptyTime() const { return FormatterBase::IsEmptyFieldValue(); } Time GetCorrectedTime() const { return maCorrectedTime; } diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index 63e4cd80f199..4929a8bfa01a 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -3050,35 +3050,6 @@ Time TimeFormatter::GetTime() const // ----------------------------------------------------------------------- -Time TimeFormatter::GetRealTime() const -{ - Time aTime( 0, 0, 0 ); - - if ( GetField() ) - { - sal_Bool bAllowMailformed = ImplAllowMalformedInput(); - if ( !ImplTimeGetValue( GetField()->GetText(), aTime, GetFormat(), IsDuration(), ImplGetLocaleDataWrapper(), !bAllowMailformed ) ) - if ( bAllowMailformed ) - aTime = GetInvalidTime(); - } - - return aTime; -} - -// ----------------------------------------------------------------------- - -sal_Bool TimeFormatter::IsTimeModified() const -{ - if ( ImplGetEmptyFieldValue() ) - return !IsEmptyTime(); - else if ( GetTime() != maFieldTime ) - return sal_True; - else - return sal_False; -} - -// ----------------------------------------------------------------------- - void TimeFormatter::Reformat() { if ( !GetField() ) -- cgit v1.2.3 From 44fb00ef676e12d1be3cc552c35efde6ea1fca71 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 13 Jul 2011 20:42:27 +0300 Subject: Bin dead MacOSX X11 code --- vcl/source/app/svmainhook.cxx | 78 +------------------------------------------ 1 file changed, 1 insertion(+), 77 deletions(-) (limited to 'vcl') diff --git a/vcl/source/app/svmainhook.cxx b/vcl/source/app/svmainhook.cxx index dd446125a7aa..47c3854a2987 100644 --- a/vcl/source/app/svmainhook.cxx +++ b/vcl/source/app/svmainhook.cxx @@ -31,89 +31,13 @@ #include #ifndef MACOSX +// MacOSX implementation of ImplSVMainHook is in aqua/source/app/salinst.cxx sal_Bool ImplSVMainHook( int * ) { return sal_False; // indicate that ImplSVMainHook is not implemented } -#else -// MACOSX cocoa implementation of ImplSVMainHook is in aqua/source/app/salinst.cxx -#ifndef QUARTZ // MACOSX (X11) needs the CFRunLoop() -#include -#include -#include -#include -#include - -extern sal_Bool ImplSVMain(); - -// ============================================================================ - - -static void SourceContextCallBack( void *pInfo ) -{ -} - -struct ThreadContext -{ - int* pRet; - CFRunLoopRef* pRunLoopRef; -}; - -static void RunSVMain(void *pData) -{ - ThreadContext* tcx = reinterpret_cast(pData); - - // busy waiting (ok in this case) until the run loop is - // running - while (!CFRunLoopIsWaiting(*tcx->pRunLoopRef)) - usleep(100); - - *tcx->pRet = ImplSVMain(); - - // Force exit since some JVMs won't shutdown when only exit() is invoked - _exit( 0 ); -} - -sal_Bool ImplSVMainHook( int *pnInit ) -{ - // Mac OS X requires that any Cocoa code have a CFRunLoop started in the - // primordial thread. Since all of the AWT classes in Java 1.4 and higher - // are written in Cocoa, we need to start the CFRunLoop here and run - // ImplSVMain() in a secondary thread. - // See http://developer.apple.com/samplecode/simpleJavaLauncher/listing3.html - // for further details and an example - - CFRunLoopRef runLoopRef = CFRunLoopGetCurrent(); - ThreadContext tcx; - tcx.pRet = pnInit; // the return value - tcx.pRunLoopRef = &runLoopRef; - oslThread hThreadID = osl_createThread(RunSVMain, &tcx); - - // Start the CFRunLoop - CFRunLoopSourceContext aSourceContext; - aSourceContext.version = 0; - aSourceContext.info = NULL; - aSourceContext.retain = NULL; - aSourceContext.release = NULL; - aSourceContext.copyDescription = NULL; - aSourceContext.equal = NULL; - aSourceContext.hash = NULL; - aSourceContext.schedule = NULL; - aSourceContext.cancel = NULL; - aSourceContext.perform = &SourceContextCallBack; - CFRunLoopSourceRef aSourceRef = CFRunLoopSourceCreate(NULL, 0, &aSourceContext); - CFRunLoopAddSource(runLoopRef, aSourceRef, kCFRunLoopCommonModes); - CFRunLoopRun(); - - osl_joinWithThread( hThreadID ); - osl_destroyThread( hThreadID ); - - return sal_True; // indicate that ImplSVMainHook is implemented -} - -#endif // MACOSX #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From ecf04369ec7b2d08f2553cc3207aa2640972c766 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 13 Jul 2011 21:09:43 +0300 Subject: Add a comment about the VCL_NSApplication magic --- vcl/aqua/source/app/vclnsapp.mm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'vcl') diff --git a/vcl/aqua/source/app/vclnsapp.mm b/vcl/aqua/source/app/vclnsapp.mm index 5206c17dd2d7..e103a6b3e387 100644 --- a/vcl/aqua/source/app/vclnsapp.mm +++ b/vcl/aqua/source/app/vclnsapp.mm @@ -58,6 +58,10 @@ } @end +// If you wonder how this VCL_NSApplication stuff works, one thing you +// might have missed is that the NSPrincipalClass property in +// desktop/macosx/Info.plist has the value VCL_NSApplication. + @implementation VCL_NSApplication -(void)sendEvent:(NSEvent*)pEvent { -- cgit v1.2.3 From f0f8be40da13833cc518711251fcd990ea91e032 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 12:57:44 +0200 Subject: callcatcher: remove unused SystemWindow::Foo --- vcl/inc/vcl/syswin.hxx | 4 ---- vcl/source/window/syswin.cxx | 49 -------------------------------------------- 2 files changed, 53 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/syswin.hxx b/vcl/inc/vcl/syswin.hxx index c8062e3dc352..19cce93d44dd 100644 --- a/vcl/inc/vcl/syswin.hxx +++ b/vcl/inc/vcl/syswin.hxx @@ -204,10 +204,6 @@ public: // for systems like MacOSX which can display the URL a document is loaded from // separately from the window title void SetRepresentedURL( const rtl::OUString& ); - const rtl::OUString& GetRepresentedURL() const; - - void SetZLevel( sal_uInt8 nLevel ); - sal_uInt8 GetZLevel() const; void EnableSaveBackground( sal_Bool bSave = sal_True ); sal_Bool IsSaveBackgroundEnabled() const; diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index 51258f73e77f..77cfb7044740 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -244,36 +244,6 @@ void SystemWindow::Resizing( Size& ) // ----------------------------------------------------------------------- -void SystemWindow::SetZLevel( sal_uInt8 nLevel ) -{ - Window* pWindow = this; - while ( pWindow->mpWindowImpl->mpBorderWindow ) - pWindow = pWindow->mpWindowImpl->mpBorderWindow; - if ( pWindow->mpWindowImpl->mbOverlapWin && !pWindow->mpWindowImpl->mbFrame ) - { - sal_uInt8 nOldLevel = pWindow->mpWindowImpl->mpOverlapData->mnTopLevel; - pWindow->mpWindowImpl->mpOverlapData->mnTopLevel = nLevel; - // Wenn der neue Level groesser als der alte ist, schieben - // wir das Fenster nach hinten - if ( !IsReallyVisible() && (nLevel > nOldLevel) && pWindow->mpWindowImpl->mpNext ) - { - // Fenster aus der Liste entfernen - if ( pWindow->mpWindowImpl->mpPrev ) - pWindow->mpWindowImpl->mpPrev->mpWindowImpl->mpNext = pWindow->mpWindowImpl->mpNext; - else - pWindow->mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpFirstOverlap = pWindow->mpWindowImpl->mpNext; - pWindow->mpWindowImpl->mpNext->mpWindowImpl->mpPrev = pWindow->mpWindowImpl->mpPrev; - pWindow->mpWindowImpl->mpNext = NULL; - // und Fenster wieder in die Liste am Ende eintragen - pWindow->mpWindowImpl->mpPrev = pWindow->mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpLastOverlap; - pWindow->mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpLastOverlap = pWindow; - pWindow->mpWindowImpl->mpPrev->mpWindowImpl->mpNext = pWindow; - } - } -} - -// ----------------------------------------------------------------------- - void SystemWindow::SetRepresentedURL( const rtl::OUString& i_rURL ) { bool bChanged = (i_rURL != mpImplData->maRepresentedURL); @@ -288,12 +258,6 @@ void SystemWindow::SetRepresentedURL( const rtl::OUString& i_rURL ) pWindow->mpWindowImpl->mpFrame->SetRepresentedURL( i_rURL ); } } -// ----------------------------------------------------------------------- - -const rtl::OUString& SystemWindow::GetRepresentedURL() const -{ - return mpImplData->maRepresentedURL; -} // ----------------------------------------------------------------------- @@ -317,19 +281,6 @@ void SystemWindow::SetIcon( sal_uInt16 nIcon ) // ----------------------------------------------------------------------- -sal_uInt8 SystemWindow::GetZLevel() const -{ - const Window* pWindow = this; - while ( pWindow->mpWindowImpl->mpBorderWindow ) - pWindow = pWindow->mpWindowImpl->mpBorderWindow; - if ( pWindow->mpWindowImpl->mpOverlapData ) - return pWindow->mpWindowImpl->mpOverlapData->mnTopLevel; - else - return sal_False; -} - -// ----------------------------------------------------------------------- - void SystemWindow::EnableSaveBackground( sal_Bool bSave ) { if( ImplGetSVData()->maWinData.mbNoSaveBackground ) -- cgit v1.2.3 From e41f1df72991619a9a4b5f0015397d36c2353ee7 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 12:59:11 +0200 Subject: callcatcher: remove unused SystemChildWindow::IsEraseBackgroundEnabled --- vcl/inc/vcl/syschild.hxx | 1 - vcl/source/window/syschild.cxx | 10 ---------- 2 files changed, 11 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/syschild.hxx b/vcl/inc/vcl/syschild.hxx index 275e41312f17..3a55d0b45a2c 100644 --- a/vcl/inc/vcl/syschild.hxx +++ b/vcl/inc/vcl/syschild.hxx @@ -63,7 +63,6 @@ public: // per default systemchildwindows erase their background for better plugin support // however, this might not always be required void EnableEraseBackground( sal_Bool bEnable = sal_True ); - sal_Bool IsEraseBackgroundEnabled(); void SetForwardKey( sal_Bool bEnable ); // return the platform specific handle/id of this window; // in case the flag bUseJava is set, a java compatible overlay window diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx index 341d7f3bfff8..f72decce183e 100644 --- a/vcl/source/window/syschild.cxx +++ b/vcl/source/window/syschild.cxx @@ -198,16 +198,6 @@ void SystemChildWindow::EnableEraseBackground( sal_Bool bEnable ) // ----------------------------------------------------------------------- -sal_Bool SystemChildWindow::IsEraseBackgroundEnabled() -{ - if ( mpWindowImpl->mpSysObj ) - return mpWindowImpl->mpSysObj->IsEraseBackgroundEnabled(); - else - return sal_False; -} - -// ----------------------------------------------------------------------- - void SystemChildWindow::ImplTestJavaException( void* pEnv ) { #ifdef SOLAR_JAVA -- cgit v1.2.3 From b6d0d593b65d0b1b8f4611d0eea27a88af68bedf Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 13:09:51 +0200 Subject: callcatcher: remove unused TabControl::Foo --- vcl/inc/vcl/tabctrl.hxx | 3 --- vcl/source/control/tabctrl.cxx | 30 ------------------------------ 2 files changed, 33 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/tabctrl.hxx b/vcl/inc/vcl/tabctrl.hxx index c6525138f73b..380fb2e70883 100644 --- a/vcl/inc/vcl/tabctrl.hxx +++ b/vcl/inc/vcl/tabctrl.hxx @@ -158,7 +158,6 @@ public: void SetTabPage( sal_uInt16 nPageId, TabPage* pPage ); TabPage* GetTabPage( sal_uInt16 nPageId ) const; - sal_uInt16 GetTabPageResId( sal_uInt16 nPageId ) const; void SetPageText( sal_uInt16 nPageId, const XubString& rText ); XubString GetPageText( sal_uInt16 nPageId ) const; @@ -166,11 +165,9 @@ public: void SetHelpText( sal_uInt16 nPageId, const XubString& rText ); const XubString& GetHelpText( sal_uInt16 nPageId ) const; - void SetHelpId( sal_uInt16 nPageId, const rtl::OString& rHelpId ); rtl::OString GetHelpId( sal_uInt16 nPageId ) const; void SetPageImage( sal_uInt16 nPageId, const Image& rImage ); - const Image* GetPageImage( sal_uInt16 nPageId ) const; void SetHelpText( const XubString& rText ) { Control::SetHelpText( rText ); } diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index 765907721ed6..7bdd0d3af0bf 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -1981,18 +1981,6 @@ TabPage* TabControl::GetTabPage( sal_uInt16 nPageId ) const // ----------------------------------------------------------------------- -sal_uInt16 TabControl::GetTabPageResId( sal_uInt16 nPageId ) const -{ - ImplTabItem* pItem = ImplGetItem( nPageId ); - - if ( pItem ) - return pItem->mnTabPageResId; - else - return 0; -} - -// ----------------------------------------------------------------------- - void TabControl::SetPageText( sal_uInt16 nPageId, const XubString& rText ) { ImplTabItem* pItem = ImplGetItem( nPageId ); @@ -2059,16 +2047,6 @@ const XubString& TabControl::GetHelpText( sal_uInt16 nPageId ) const // ----------------------------------------------------------------------- -void TabControl::SetHelpId( sal_uInt16 nPageId, const rtl::OString& rHelpId ) -{ - ImplTabItem* pItem = ImplGetItem( nPageId ); - - if ( pItem ) - pItem->maHelpId = rHelpId; -} - -// ----------------------------------------------------------------------- - rtl::OString TabControl::GetHelpId( sal_uInt16 nPageId ) const { rtl::OString aRet; @@ -2097,14 +2075,6 @@ void TabControl::SetPageImage( sal_uInt16 i_nPageId, const Image& i_rImage ) // ----------------------------------------------------------------------- -const Image* TabControl::GetPageImage( sal_uInt16 i_nPageId ) const -{ - const ImplTabItem* pItem = ImplGetItem( i_nPageId ); - return pItem ? &pItem->maTabImage : NULL; -} - -// ----------------------------------------------------------------------- - Rectangle TabControl::GetCharacterBounds( sal_uInt16 nPageId, long nIndex ) const { Rectangle aRet; -- cgit v1.2.3 From edf835031f1adad05dfc22153a52779a943a9f0a Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 13:17:14 +0200 Subject: callcatcher: remove unused TaskPaneList::FindNextPane --- vcl/inc/vcl/taskpanelist.hxx | 1 - vcl/source/window/taskpanelist.cxx | 35 ----------------------------------- 2 files changed, 36 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/taskpanelist.hxx b/vcl/inc/vcl/taskpanelist.hxx index 102f755554f2..9042169e9898 100644 --- a/vcl/inc/vcl/taskpanelist.hxx +++ b/vcl/inc/vcl/taskpanelist.hxx @@ -37,7 +37,6 @@ class VCL_DLLPUBLIC TaskPaneList { ::std::vector mTaskPanes; - Window *FindNextPane( Window *pWindow, sal_Bool bForward = sal_True ); Window *FindNextFloat( Window *pWindow, sal_Bool bForward = sal_True ); Window *FindNextSplitter( Window *pWindow, sal_Bool bForward = sal_True ); diff --git a/vcl/source/window/taskpanelist.cxx b/vcl/source/window/taskpanelist.cxx index 24c8ded6e4b4..bfb3be82b70f 100644 --- a/vcl/source/window/taskpanelist.cxx +++ b/vcl/source/window/taskpanelist.cxx @@ -262,41 +262,6 @@ sal_Bool TaskPaneList::HandleKeyEvent( KeyEvent aKeyEvent ) // -------------------------------------------------- -// returns next valid pane -Window* TaskPaneList::FindNextPane( Window *pWindow, sal_Bool bForward ) -{ - if( bForward ) - ::std::stable_sort( mTaskPanes.begin(), mTaskPanes.end(), LTRSort() ); - else - ::std::stable_sort( mTaskPanes.begin(), mTaskPanes.end(), LTRSortBackward() ); - - ::std::vector< Window* >::iterator p = mTaskPanes.begin(); - while( p != mTaskPanes.end() ) - { - if( *p == pWindow ) - { - unsigned n = mTaskPanes.size(); - while( --n ) - { - if( ++p == mTaskPanes.end() ) - p = mTaskPanes.begin(); - if( (*p)->IsReallyVisible() && !(*p)->IsDialog() && !(*p)->ImplIsSplitter() ) - { - pWindow = *p; - break; - } - } - break; - } - else - ++p; - } - - return pWindow; -} - -// -------------------------------------------------- - // returns next splitter Window* TaskPaneList::FindNextSplitter( Window *pWindow, sal_Bool bForward ) { -- cgit v1.2.3 From 28ee3e903dfed99d66b0dd190ccef91306d0c8c1 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 14:20:14 +0200 Subject: callcatcher: ToolBox cleanup --- vcl/inc/vcl/toolbox.hxx | 29 ------- vcl/source/window/toolbox.cxx | 132 ------------------------------ vcl/source/window/toolbox2.cxx | 182 ----------------------------------------- 3 files changed, 343 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/toolbox.hxx b/vcl/inc/vcl/toolbox.hxx index 5badbc2d13bd..4542a51984b7 100644 --- a/vcl/inc/vcl/toolbox.hxx +++ b/vcl/inc/vcl/toolbox.hxx @@ -274,7 +274,6 @@ private: SAL_DLLPRIVATE sal_Bool ImplChangeHighlightUpDn( sal_Bool bUp, sal_Bool bNoCycle = sal_False ); SAL_DLLPRIVATE sal_uInt16 ImplGetItemLine( ImplToolItem* pCurrentItem ); SAL_DLLPRIVATE ImplToolItem* ImplGetFirstValidItem( sal_uInt16 nLine ); - SAL_DLLPRIVATE ImplToolItem* ImplGetLastValidItem( sal_uInt16 nLine ); SAL_DLLPRIVATE sal_Bool ImplOpenItem( KeyCode aKeyCode ); SAL_DLLPRIVATE sal_Bool ImplActivateItem( KeyCode aKeyCode ); SAL_DLLPRIVATE void ImplShowFocus(); @@ -332,9 +331,6 @@ public: static SAL_DLLPRIVATE void ImplDrawToolArrow( ToolBox* pBox, long nX, long nY, sal_Bool bBlack, sal_Bool bColTransform, sal_Bool bLeft = sal_False, sal_Bool bTop = sal_False, long nSize = 6 ); - static SAL_DLLPRIVATE void SetToolArrowClipregion( ToolBox* pBox, long nX, long nY, - sal_Bool bLeft = sal_False, sal_Bool bTop = sal_False, - long nSize = 6 ); static SAL_DLLPRIVATE void ImplDrawMenubutton( ToolBox *pThis, sal_Bool bHighlight ); static SAL_DLLPRIVATE sal_uInt16 ImplCountLineBreaks( const ToolBox *pThis ); SAL_DLLPRIVATE ImplToolBoxPrivateData* ImplGetToolBoxPrivateData() const { return mpData; } @@ -401,12 +397,9 @@ public: sal_uInt16 nPixSize = 0 ); void InsertBreak( sal_uInt16 nPos = TOOLBOX_APPEND ); void RemoveItem( sal_uInt16 nPos ); - void MoveItem( sal_uInt16 nItemId, sal_uInt16 nNewPos = TOOLBOX_APPEND ); void CopyItem( const ToolBox& rToolBox, sal_uInt16 nItemId, sal_uInt16 nNewPos = TOOLBOX_APPEND ); - void CopyItems( const ToolBox& rToolBox ); void Clear(); - void RecalcItems(); const ImageList& GetImageList() const { return maImageList; } void SetImageList( const ImageList& rImageList ); @@ -429,7 +422,6 @@ public: // Used to enable/disable scrolling one page at a time for toolbar void SetPageScroll( sal_Bool b ); - sal_Bool GetPageScroll(); void SetNextToolBox( const XubString& rStr ); const XubString& GetNextToolBox() const { return maNextToolBoxStr; } @@ -442,14 +434,12 @@ public: sal_uInt16 GetItemId( const Point& rPos ) const; Rectangle GetItemRect( sal_uInt16 nItemId ) const; Rectangle GetItemPosRect( sal_uInt16 nPos ) const; - Rectangle GetItemDropDownRect( sal_uInt16 nItemId ) const; Rectangle GetItemPosDropDownRect( sal_uInt16 nPos ) const; // retrieves the optimal position to place a popup window for this item (subtoolbar or dropdown) Point GetItemPopupPosition( sal_uInt16 nItemId, const Size& rSize ) const; Rectangle GetScrollRect() const; - Rectangle GetMenubuttonRect() const; sal_uInt16 GetCurItemId() const { return mnCurItemId; } sal_uInt16 GetDownItemId() const { return mnDownItemId; } sal_uInt16 GetClicks() const { return mnMouseClicks; } @@ -464,11 +454,7 @@ public: void SetItemImage( sal_uInt16 nItemId, const Image& rImage ); Image GetItemImage( sal_uInt16 nItemId ) const; void SetItemImageAngle( sal_uInt16 nItemId, long nAngle10 ); - long GetItemImageAngle( sal_uInt16 nItemId ) const; void SetItemImageMirrorMode( sal_uInt16 nItemId, sal_Bool bMirror ); - sal_Bool GetItemImageMirrorMode( sal_uInt16 ) const; - void SetItemHighImage( sal_uInt16 nItemId, const Image& rImage ); - Image GetItemHighImage( sal_uInt16 nItemId ) const; void SetItemText( sal_uInt16 nItemId, const XubString& rText ); const XubString& GetItemText( sal_uInt16 nItemId ) const; void SetItemWindow( sal_uInt16 nItemId, Window* pNewWindow ); @@ -479,7 +465,6 @@ public: void EndSelection(); void SetItemDown( sal_uInt16 nItemId, sal_Bool bDown, sal_Bool bRelease = sal_True ); - sal_Bool IsItemDown( sal_uInt16 nItemId ) const; void SetItemState( sal_uInt16 nItemId, TriState eState ); TriState GetItemState( sal_uInt16 nItemId ) const; @@ -552,14 +537,8 @@ public: void EnableCustomize( sal_Bool bEnable = sal_True ); sal_Bool IsCustomize() { return mbCustomize; } - void StartCustomize( const Rectangle& rRect, void* pData = NULL ); - void SetCustomizeMode( sal_Bool ); sal_Bool IsInCustomizeMode() const { return mbCustomizeMode; } - static void StartCustomizeMode(); - static void EndCustomizeMode(); - static sal_Bool IsCustomizeMode(); - void SetHelpText( const XubString& rText ) { DockingWindow::SetHelpText( rText ); } const XubString& GetHelpText() const @@ -600,7 +579,6 @@ public: PopupMenu* GetMenu() const; void UpdateCustomMenu(); void SetMenuButtonHdl( const Link& rLink ); - const Link& GetMenuButtonHdl() const; // open custommenu void ExecuteCustomMenu(); @@ -625,13 +603,6 @@ public: // -1 is returned if no character is at that point // if an index is found the corresponding item id is filled in (else 0) long GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const; - // returns the number of portions in the result of GetDisplayText() - long GetTextCount() const; - // returns the interval [start,end] of text portion nText - // returns [-1,-1] for an invalid text number - Pair GetTextStartEnd( long nText ) const; - // returns the item id for text portion nText or 0 if nText is invalid - sal_uInt16 GetDisplayItemId( long nText ) const; const Size& GetDefaultImageSize() const; void ChangeHighlight( sal_uInt16 nPos ); diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 8ffe04c4208a..e43f1c1fc8bd 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -195,8 +195,6 @@ public: DECL_LINK( SelectHdl, Accelerator* ); void StartCustomizeMode(); - void EndCustomizeMode(); - sal_Bool IsCustomizeMode() { return mbCustomizeMode; } sal_Bool IsResizeMode() { return mbResizeMode; } }; @@ -3178,60 +3176,6 @@ void ToolBox::ImplDrawToolArrow( ToolBox* pBox, long nX, long nY, sal_Bool bBlac } } -void ToolBox::SetToolArrowClipregion( ToolBox* pBox, long nX, long nY, - sal_Bool bLeft, sal_Bool bTop, long nSize ) -{ - WindowAlign eAlign = pBox->meAlign; - long nHalfSize; - if ( bLeft ) - eAlign = WINDOWALIGN_RIGHT; - else if ( bTop ) - eAlign = WINDOWALIGN_BOTTOM; - - nHalfSize = nSize/2; - - Point p[6]; - - switch ( eAlign ) - { - case WINDOWALIGN_LEFT: - p[0].X() = nX-1; p[0].Y() = nY-1; - p[1].X() = nX-1; p[1].Y() = nY+nSize+1; - p[2].X() = nX+1; p[2].Y() = nY+nSize+1; - p[3].X() = nX+nHalfSize+1; p[3].Y() = nY+nHalfSize+1; - p[4].X() = nX+nHalfSize+1; p[4].Y() = nY+nHalfSize-1; - p[5].X() = nX+1; p[5].Y() = nY-1; - break; - case WINDOWALIGN_TOP: - p[0].X() = nX-1; p[0].Y() = nY-1; - p[1].X() = nX-1; p[1].Y() = nY+1; - p[2].X() = nX+nHalfSize-1; p[2].Y() = nY+nHalfSize+1; - p[3].X() = nX+nHalfSize+1; p[3].Y() = nY+nHalfSize+1; - p[4].X() = nX+nSize+1; p[4].Y() = nY+1; - p[5].X() = nX+nSize+1; p[5].Y() = nY-1; - break; - case WINDOWALIGN_RIGHT: - p[0].X() = nX+nHalfSize-1; p[0].Y() = nY-1; - p[1].X() = nX-1; p[1].Y() = nY+nHalfSize-1; - p[2].X() = nX-1; p[2].Y() = nY+nHalfSize+1; - p[3].X() = nX+nHalfSize-1; p[3].Y() = nY+nSize+1; - p[4].X() = nX+nHalfSize+1; p[4].Y() = nY+nSize+1; - p[5].X() = nX+nHalfSize+1; p[5].Y() = nY-1; - break; - case WINDOWALIGN_BOTTOM: - p[0].X() = nX-1; p[0].Y() = nY+nHalfSize-1; - p[1].X() = nX-1; p[1].Y() = nY+nHalfSize+1; - p[2].X() = nX+nSize+1; p[2].Y() = nY+nHalfSize+1; - p[3].X() = nX+nSize+1; p[3].Y() = nY+nHalfSize-1; - p[4].X() = nX+nHalfSize+1; p[4].Y() = nY-1; - p[5].X() = nX+nHalfSize-1; p[5].Y() = nY-1; - break; - } - Polygon aPoly(6,p); - Region aRgn( aPoly ); - pBox->SetClipRegion( aRgn ); -} - // ----------------------------------------------------------------------- void ToolBox::ImplDrawMenubutton( ToolBox *pThis, sal_Bool bHighlight ) @@ -3868,14 +3812,6 @@ void ToolBox::ImplStartCustomizeMode() } } -void ToolBox::SetCustomizeMode( sal_Bool bSet ) -{ - if ( bSet ) - ImplStartCustomizeMode(); - else - ImplEndCustomizeMode(); -} - // ----------------------------------------------------------------------- void ToolBox::ImplEndCustomizeMode() @@ -5545,33 +5481,6 @@ void ToolBox::EnableCustomize( sal_Bool bEnable ) // ----------------------------------------------------------------------- -void ToolBox::StartCustomize( const Rectangle& rRect, void* pData ) -{ - DBG_ASSERT( mbCustomize, - "ToolBox::StartCustomize(): ToolBox must be customized" ); - - ImplTBDragMgr* pMgr = ImplGetTBDragMgr(); - Point aMousePos = GetPointerPosPixel(); - Point aPos = ScreenToOutputPixel( rRect.TopLeft() ); - Rectangle aRect( aPos.X(), aPos.Y(), - aPos.X()+rRect.GetWidth()+SMALLBUTTON_HSIZE, - aPos.Y()+rRect.GetHeight()+SMALLBUTTON_VSIZE ); - aMousePos = ScreenToOutputPixel( aPos ); - Pointer aPtr; - SetPointer( aPtr ); - pMgr->StartDragging( this, aMousePos, aRect, 0, sal_False, pData ); -} - -// ----------------------------------------------------------------------- - -void ToolBox::StartCustomizeMode() -{ - ImplTBDragMgr* pMgr = ImplGetTBDragMgr(); - pMgr->StartCustomizeMode(); -} - -// ----------------------------------------------------------------------- - void ToolBox::EndCustomizeMode() { ImplTBDragMgr* pMgr = ImplGetTBDragMgr(); @@ -5580,14 +5489,6 @@ void ToolBox::EndCustomizeMode() // ----------------------------------------------------------------------- -sal_Bool ToolBox::IsCustomizeMode() -{ - ImplTBDragMgr* pMgr = ImplGetTBDragMgr(); - return pMgr->IsCustomizeMode(); -} - -// ----------------------------------------------------------------------- - void ToolBox::GetFocus() { DockingWindow::GetFocus(); @@ -5985,39 +5886,6 @@ ImplToolItem* ToolBox::ImplGetFirstValidItem( sal_uInt16 nLine ) return (it == mpData->m_aItems.end()) ? NULL : &(*it); } -// returns the last displayable item in the given line -ImplToolItem* ToolBox::ImplGetLastValidItem( sal_uInt16 nLine ) -{ - if( !nLine || nLine > mnCurLines ) - return NULL; - - nLine--; - ImplToolItem *pFound = NULL; - std::vector< ImplToolItem >::iterator it = mpData->m_aItems.begin(); - while( it != mpData->m_aItems.end() ) - { - // find correct line - if ( it->mbBreak ) - nLine--; - if( !nLine ) - { - // find last useful item - while( it != mpData->m_aItems.end() && ((it->meType == TOOLBOXITEM_BUTTON) && - /*it->mbEnabled &&*/ it->mbVisible && !ImplIsFixedControl( &(*it) )) ) - { - pFound = &(*it); - ++it; - if( it == mpData->m_aItems.end() || it->mbBreak ) - return pFound; // end of line: return last useful item - } - return pFound; - } - ++it; - } - - return pFound; -} - // ----------------------------------------------------------------------- sal_uInt16 ToolBox::ImplFindItemPos( const ImplToolItem* pItem, const std::vector< ImplToolItem >& rList ) diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx index 348ecec00104..3e32f5d02bf2 100644 --- a/vcl/source/window/toolbox2.cxx +++ b/vcl/source/window/toolbox2.cxx @@ -828,41 +828,6 @@ void ToolBox::RemoveItem( sal_uInt16 nPos ) // ----------------------------------------------------------------------- -void ToolBox::MoveItem( sal_uInt16 nItemId, sal_uInt16 nNewPos ) -{ - sal_uInt16 nPos = GetItemPos( nItemId ); - - if ( nPos == nNewPos ) - return; - - if ( nPos < nNewPos ) - nNewPos--; - - // Existiert Item - if ( nPos != TOOLBOX_ITEM_NOTFOUND ) - { - // ToolBox-Item in der Liste verschieben - ImplToolItem aItem = mpData->m_aItems[nPos]; - mpData->m_aItems.erase( mpData->m_aItems.begin()+nPos ); - mpData->m_aItems.insert( (nNewPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nNewPos : mpData->m_aItems.end(), aItem ); - mpData->ImplClearLayoutData(); - - // ToolBox neu ausgeben - ImplInvalidate( sal_False ); - - // Notify - if( nPos < nNewPos ) // only send one event, all indices above this item are invalid anyway - ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMREMOVED, reinterpret_cast< void* >( nPos ) ); - else - { - sal_uInt16 nNewPos2 = sal::static_int_cast(( nNewPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nNewPos); - ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos2 ) ); - } - } -} - -// ----------------------------------------------------------------------- - void ToolBox::CopyItem( const ToolBox& rToolBox, sal_uInt16 nItemId, sal_uInt16 nNewPos ) { @@ -893,29 +858,6 @@ void ToolBox::CopyItem( const ToolBox& rToolBox, sal_uInt16 nItemId, // ----------------------------------------------------------------------- -void ToolBox::CopyItems( const ToolBox& rToolBox ) -{ - mpData->ImplClearLayoutData(); - mpData->m_aItems = rToolBox.mpData->m_aItems; - // Absichern gegen das Loeschen im Select-Handler - mnCurItemId = 0; - mnHighItemId = 0; - - for( std::vector< ImplToolItem >::iterator it = mpData->m_aItems.begin(); - it != mpData->m_aItems.end(); ++it ) - { - it->mpWindow = NULL; - it->mbShowWindow = sal_False; - } - - ImplInvalidate( sal_True, sal_True ); - - // Notify - ImplCallEventListeners( VCLEVENT_TOOLBOX_ALLITEMSCHANGED ); -} - -// ----------------------------------------------------------------------- - void ToolBox::Clear() { mpData->m_aItems.clear(); @@ -1043,11 +985,6 @@ void ToolBox::SetPageScroll( sal_Bool b ) mpData->mbPageScroll = b; } -sal_Bool ToolBox::GetPageScroll() -{ - return mpData->mbPageScroll; -} - // ----------------------------------------------------------------------- void ToolBox::SetNextToolBox( const XubString& rStr ) @@ -1224,16 +1161,6 @@ Rectangle ToolBox::GetItemPosRect( sal_uInt16 nPos ) const return Rectangle(); } -// ----------------------------------------------------------------------- -Rectangle ToolBox::GetItemDropDownRect( sal_uInt16 nItemId ) const -{ - if ( mbCalc || mbFormat ) - ((ToolBox*)this)->ImplFormat(); - - sal_uInt16 nPos = GetItemPos( nItemId ); - return GetItemPosDropDownRect( nPos ); -} - // ----------------------------------------------------------------------- Rectangle ToolBox::GetItemPosDropDownRect( sal_uInt16 nPos ) const @@ -1249,11 +1176,6 @@ Rectangle ToolBox::GetItemPosDropDownRect( sal_uInt16 nPos ) const // ----------------------------------------------------------------------- -Rectangle ToolBox::GetMenubuttonRect() const -{ - return mpData->maMenubuttonItem.maRect; -} - sal_Bool ToolBox::ImplHasExternalMenubutton() { // check if the borderwindow (i.e. the decoration) provides the menu button @@ -1459,55 +1381,6 @@ Image ToolBox::GetItemImage( sal_uInt16 nItemId ) const // ----------------------------------------------------------------------- -long ToolBox::GetItemImageAngle( sal_uInt16 nItemId ) const -{ - ImplToolItem* pItem = ImplGetItem( nItemId ); - - if ( pItem ) - return pItem->mnImageAngle; - else - return 0; -} - -// ----------------------------------------------------------------------- - -sal_Bool ToolBox::GetItemImageMirrorMode( sal_uInt16 nItemId ) const -{ - ImplToolItem* pItem = ImplGetItem( nItemId ); - - if ( pItem ) - return pItem->mbMirrorMode; - else - return sal_False; -} - -// ----------------------------------------------------------------------- - -void ToolBox::SetItemHighImage( sal_uInt16 nItemId, const Image& rImage ) -{ - ImplToolItem* pItem = ImplGetItem( nItemId ); - if ( pItem ) - { - DBG_ASSERT( (pItem->maImage.GetSizePixel() == rImage.GetSizePixel()) || - ((!rImage) == sal_True), "ToolBox::SetItemHighImage() - ImageSize != HighImageSize" ); - pItem->maHighImage = rImage; - } -} - -// ----------------------------------------------------------------------- - -Image ToolBox::GetItemHighImage( sal_uInt16 nItemId ) const -{ - ImplToolItem* pItem = ImplGetItem( nItemId ); - - if ( pItem ) - return pItem->maHighImage; - else - return Image(); -} - -// ----------------------------------------------------------------------- - void ToolBox::SetItemText( sal_uInt16 nItemId, const XubString& rText ) { sal_uInt16 nPos = GetItemPos( nItemId ); @@ -1668,18 +1541,6 @@ void ToolBox::SetItemDown( sal_uInt16 nItemId, sal_Bool bDown, sal_Bool bRelease // ----------------------------------------------------------------------- -sal_Bool ToolBox::IsItemDown( sal_uInt16 nItemId ) const -{ - sal_uInt16 nPos = GetItemPos( nItemId ); - - if ( nPos != TOOLBOX_ITEM_NOTFOUND ) - return (nPos == mnCurPos); - else - return sal_False; -} - -// ----------------------------------------------------------------------- - void ToolBox::SetItemState( sal_uInt16 nItemId, TriState eState ) { sal_uInt16 nPos = GetItemPos( nItemId ); @@ -1969,13 +1830,6 @@ void ToolBox::SetOutStyle( sal_uInt16 nNewStyle ) // ----------------------------------------------------------------------- -void ToolBox::RecalcItems() -{ - ImplInvalidate( sal_True ); -} - -// ----------------------------------------------------------------------- - // disable key input if all items are disabled void ToolBox::ImplUpdateInputEnable() @@ -2064,37 +1918,6 @@ long ToolBox::GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const return nIndex; } -// ----------------------------------------------------------------------- - -long ToolBox::GetTextCount() const -{ - if( ! mpData->m_pLayoutData ) - ImplFillLayoutData(); - return mpData->m_pLayoutData ? mpData->m_pLayoutData->GetLineCount() : 0; -} - -// ----------------------------------------------------------------------- - -Pair ToolBox::GetTextStartEnd( long nText ) const -{ - if( ! mpData->m_pLayoutData ) - ImplFillLayoutData(); - return mpData->m_pLayoutData ? mpData->m_pLayoutData->GetLineStartEnd( nText ) : Pair( -1, -1 ); -} - -// ----------------------------------------------------------------------- - -sal_uInt16 ToolBox::GetDisplayItemId( long nText ) const -{ - sal_uInt16 nItemId = 0; - if( ! mpData->m_pLayoutData ) - ImplFillLayoutData(); - if( mpData->m_pLayoutData && nText >= 0 && (sal_uLong)nText < mpData->m_pLayoutData->m_aLineItemIds.size() ) - nItemId = mpData->m_pLayoutData->m_aLineItemIds[nText]; - return nItemId; -} - - // ----------------------------------------------------------------------- void ToolBox::SetDropdownClickHdl( const Link& rLink ) @@ -2154,11 +1977,6 @@ void ToolBox::SetMenuButtonHdl( const Link& rLink ) mpData->maMenuButtonHdl = rLink; } -const Link& ToolBox::GetMenuButtonHdl() const -{ - return mpData->maMenuButtonHdl; -} - // ----------------------------------------------------------------------- sal_Bool ToolBox::ImplHasClippedItems() -- cgit v1.2.3 From e6309e7bf5419b6b040cc2e94670c8db4fe66037 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 14:27:16 +0200 Subject: callcatcher: remove Type1Emitter::Type1Emitter --- vcl/source/fontsubset/cff.cxx | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'vcl') diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx index eed5a9e1ac07..b6516fcc624b 100644 --- a/vcl/source/fontsubset/cff.cxx +++ b/vcl/source/fontsubset/cff.cxx @@ -1868,7 +1868,6 @@ const char* CffSubsetterContext::getGlyphName( int nGlyphIndex) class Type1Emitter { public: - explicit Type1Emitter( const char* pOutFileName, bool bPfbSubset = true); explicit Type1Emitter( FILE* pOutFile, bool bPfbSubset = true); /*virtual*/ ~Type1Emitter( void); void setSubsetName( const char* ); @@ -1895,20 +1894,6 @@ public: // -------------------------------------------------------------------- -Type1Emitter::Type1Emitter( const char* pPfbFileName, bool bPfbSubset) -: mpFileOut( NULL) -, mbCloseOutfile( true) -, mnEECryptR( 55665) // default eexec seed, TODO: mnEECryptSeed -, mpPtr( maBuffer) -, mbPfbSubset( bPfbSubset) -, mnHexLineCol( 0) -{ - mpFileOut = fopen( pPfbFileName, "wb"); - maSubsetName[0] = '\0'; -} - -// -------------------------------------------------------------------- - Type1Emitter::Type1Emitter( FILE* pOutFile, bool bPfbSubset) : mpFileOut( pOutFile) , mbCloseOutfile( false) -- cgit v1.2.3 From 264ef46bed7263fd01a32804fcbd3ccda78b0725 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 21:13:08 +0200 Subject: callcatcher: bring ImplTBDragMgr members back and remove EndCustomizeMode --- vcl/source/window/toolbox.cxx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'vcl') diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index e43f1c1fc8bd..0304033d03f9 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -195,6 +195,8 @@ public: DECL_LINK( SelectHdl, Accelerator* ); void StartCustomizeMode(); + void EndCustomizeMode(); + sal_Bool IsCustomizeMode() { return mbCustomizeMode; } sal_Bool IsResizeMode() { return mbResizeMode; } }; @@ -5481,14 +5483,6 @@ void ToolBox::EnableCustomize( sal_Bool bEnable ) // ----------------------------------------------------------------------- -void ToolBox::EndCustomizeMode() -{ - ImplTBDragMgr* pMgr = ImplGetTBDragMgr(); - pMgr->EndCustomizeMode(); -} - -// ----------------------------------------------------------------------- - void ToolBox::GetFocus() { DockingWindow::GetFocus(); -- cgit v1.2.3 From 30bfcd14c3c42bde7c02328e258169deb5d634c2 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 22:05:08 +0200 Subject: callcatcher: remove Wallpaper::Foo --- vcl/inc/vcl/wall.hxx | 3 --- vcl/source/gdi/wall.cxx | 42 ------------------------------------------ 2 files changed, 45 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/wall.hxx b/vcl/inc/vcl/wall.hxx index 66a2a11038ed..f85d58c1200f 100644 --- a/vcl/inc/vcl/wall.hxx +++ b/vcl/inc/vcl/wall.hxx @@ -112,17 +112,14 @@ public: WallpaperStyle GetStyle() const; void SetBitmap( const BitmapEx& rBitmap ); - void SetBitmap(); BitmapEx GetBitmap() const; sal_Bool IsBitmap() const; void SetGradient( const Gradient& rGradient ); - void SetGradient(); Gradient GetGradient() const; sal_Bool IsGradient() const; void SetRect( const Rectangle& rRect ); - void SetRect(); Rectangle GetRect() const; sal_Bool IsRect() const; diff --git a/vcl/source/gdi/wall.cxx b/vcl/source/gdi/wall.cxx index a24d3b0cbd66..5529d9c06232 100644 --- a/vcl/source/gdi/wall.cxx +++ b/vcl/source/gdi/wall.cxx @@ -366,20 +366,6 @@ void Wallpaper::SetBitmap( const BitmapEx& rBitmap ) // ----------------------------------------------------------------------- -void Wallpaper::SetBitmap() -{ - DBG_CHKTHIS( Wallpaper, NULL ); - - if ( mpImplWallpaper->mpBitmap ) - { - ImplMakeUnique(); - delete mpImplWallpaper->mpBitmap; - mpImplWallpaper->mpBitmap = NULL; - } -} - -// ----------------------------------------------------------------------- - BitmapEx Wallpaper::GetBitmap() const { DBG_CHKTHIS( Wallpaper, NULL ); @@ -422,20 +408,6 @@ void Wallpaper::SetGradient( const Gradient& rGradient ) // ----------------------------------------------------------------------- -void Wallpaper::SetGradient() -{ - DBG_CHKTHIS( Wallpaper, NULL ); - - if ( mpImplWallpaper->mpGradient ) - { - ImplMakeUnique(); - delete mpImplWallpaper->mpGradient; - mpImplWallpaper->mpGradient = NULL; - } -} - -// ----------------------------------------------------------------------- - Gradient Wallpaper::GetGradient() const { DBG_CHKTHIS( Wallpaper, NULL ); @@ -504,20 +476,6 @@ void Wallpaper::SetRect( const Rectangle& rRect ) // ----------------------------------------------------------------------- -void Wallpaper::SetRect() -{ - DBG_CHKTHIS( Wallpaper, NULL ); - - if ( mpImplWallpaper->mpRect ) - { - ImplMakeUnique( sal_False ); - delete mpImplWallpaper->mpRect; - mpImplWallpaper->mpRect = NULL; - } -} - -// ----------------------------------------------------------------------- - Rectangle Wallpaper::GetRect() const { DBG_CHKTHIS( Wallpaper, NULL ); -- cgit v1.2.3 From c57d50dc6309a444c1ca2ef4dc75b71ea924c8ac Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 22:13:25 +0200 Subject: callcatcher: remove Printer::Foo --- vcl/inc/vcl/print.hxx | 5 ----- vcl/source/gdi/print.cxx | 56 ----------------------------------------------- vcl/source/gdi/print2.cxx | 43 ------------------------------------ 3 files changed, 104 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/print.hxx b/vcl/inc/vcl/print.hxx index 182258aeb3c1..3d266160b3e2 100644 --- a/vcl/inc/vcl/print.hxx +++ b/vcl/inc/vcl/print.hxx @@ -272,7 +272,6 @@ private: static SAL_DLLPRIVATE sal_uLong ImplSalPrinterErrorCodeToVCL( sal_uLong nError ); private: - SAL_DLLPRIVATE void ImplEndPrint(); SAL_DLLPRIVATE sal_Bool EndJob(); SAL_DLLPRIVATE Printer( const Printer& rPrinter ); SAL_DLLPRIVATE Printer& operator =( const Printer& rPrinter ); @@ -281,7 +280,6 @@ public: SAL_DLLPRIVATE void ImplEndPage(); public: void DrawGradientEx( OutputDevice* pOut, const Rectangle& rRect, const Gradient& rGradient ); - void DrawGradientEx( OutputDevice* pOut, const PolyPolygon& rPolyPoly, const Gradient& rGradient ); protected: @@ -290,7 +288,6 @@ protected: public: Printer(); - Printer( const Window* pWindow ); Printer( const JobSetup& rJobSetup ); Printer( const QueueInfo& rQueueInfo ); Printer( const XubString& rPrinterName ); @@ -329,7 +326,6 @@ public: sal_Bool SetOrientation( Orientation eOrient ); Orientation GetOrientation() const; - DuplexMode GetDuplexMode() const; sal_Bool SetDuplexMode( DuplexMode ); // returns the angle that a landscape page will be turned counterclockwise // wrt to portrait. The return value may be only valid for @@ -363,7 +359,6 @@ public: sal_Bool IsPrinting() const { return mbPrinting; } - sal_Bool AbortJob(); const XubString& GetCurJobName() const { return maJobName; } sal_uInt16 GetCurPage() const { return mnCurPage; } sal_Bool IsJobActive() const { return mbJobActive; } diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 4c9461fbcb97..ef3c68ec5355 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -667,14 +667,6 @@ Printer::Printer() // ----------------------------------------------------------------------- -Printer::Printer( const Window* pWindow ) -{ - ImplInitData(); - ImplInitDisplay( pWindow ); -} - -// ----------------------------------------------------------------------- - Printer::Printer( const JobSetup& rJobSetup ) : maJobSetup( rJobSetup ) { @@ -1336,13 +1328,6 @@ const PaperInfo& Printer::GetPaperInfo( int nPaper ) const // ----------------------------------------------------------------------- -DuplexMode Printer::GetDuplexMode() const -{ - return maJobSetup.ImplGetConstData()->meDuplexMode; -} - -// ----------------------------------------------------------------------- - sal_Bool Printer::SetDuplexMode( DuplexMode eDuplex ) { if ( mbInPrintPage ) @@ -1455,15 +1440,6 @@ sal_uLong Printer::ImplSalPrinterErrorCodeToVCL( sal_uLong nError ) // ----------------------------------------------------------------------- -void Printer::ImplEndPrint() -{ - mbPrinting = sal_False; - mnCurPrintPage = 0; - maJobName.Erase(); -} - -// ----------------------------------------------------------------------- - IMPL_LINK( Printer, ImplDestroyPrinterAsync, void*, pSalPrinter ) { SalPrinter* pPrinter = (SalPrinter*)pSalPrinter; @@ -1510,38 +1486,6 @@ sal_Bool Printer::EndJob() // ----------------------------------------------------------------------- -sal_Bool Printer::AbortJob() -{ - // Wenn wir einen Queue-Printer haben, kann man diesen noch mit - // AbortJob() abbrechen, solange dieser noch am Drucken ist - if ( !IsJobActive() && !IsPrinting() ) - return sal_False; - - mbJobActive = sal_False; - mbInPrintPage = sal_False; - mpJobGraphics = NULL; - - if ( mpPrinter ) - { - mbPrinting = sal_False; - mnCurPage = 0; - mnCurPrintPage = 0; - maJobName.Erase(); - - ImplReleaseGraphics(); - mbDevOutput = sal_False; - mpPrinter->AbortJob(); - Application::PostUserEvent( LINK( this, Printer, ImplDestroyPrinterAsync ), mpPrinter ); - mpPrinter = NULL; - - return sal_True; - } - - return sal_False; -} - -// ----------------------------------------------------------------------- - void Printer::ImplStartPage() { if ( !IsJobActive() ) diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx index add5071ef2dd..bfb28b5b6996 100644 --- a/vcl/source/gdi/print2.cxx +++ b/vcl/source/gdi/print2.cxx @@ -1579,47 +1579,4 @@ void Printer::DrawGradientEx( OutputDevice* pOut, const Rectangle& rRect, const pOut->DrawGradient( rRect, rGradient ); } -// ----------------------------------------------------------------------------- - -void Printer::DrawGradientEx( OutputDevice* pOut, const PolyPolygon& rPolyPoly, const Gradient& rGradient ) -{ - const PrinterOptions& rPrinterOptions = GetPrinterOptions(); - - if( rPrinterOptions.IsReduceGradients() ) - { - if( PRINTER_GRADIENT_STRIPES == rPrinterOptions.GetReducedGradientMode() ) - { - if( !rGradient.GetSteps() || ( rGradient.GetSteps() > rPrinterOptions.GetReducedGradientStepCount() ) ) - { - Gradient aNewGradient( rGradient ); - - aNewGradient.SetSteps( rPrinterOptions.GetReducedGradientStepCount() ); - pOut->DrawGradient( rPolyPoly, aNewGradient ); - } - else - pOut->DrawGradient( rPolyPoly, rGradient ); - } - else - { - const Color& rStartColor = rGradient.GetStartColor(); - const Color& rEndColor = rGradient.GetEndColor(); - const long nR = ( ( (long) rStartColor.GetRed() * rGradient.GetStartIntensity() ) / 100L + - ( (long) rEndColor.GetRed() * rGradient.GetEndIntensity() ) / 100L ) >> 1; - const long nG = ( ( (long) rStartColor.GetGreen() * rGradient.GetStartIntensity() ) / 100L + - ( (long) rEndColor.GetGreen() * rGradient.GetEndIntensity() ) / 100L ) >> 1; - const long nB = ( ( (long) rStartColor.GetBlue() * rGradient.GetStartIntensity() ) / 100L + - ( (long) rEndColor.GetBlue() * rGradient.GetEndIntensity() ) / 100L ) >> 1; - const Color aColor( (sal_uInt8) nR, (sal_uInt8) nG, (sal_uInt8) nB ); - - pOut->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR ); - pOut->SetLineColor( aColor ); - pOut->SetFillColor( aColor ); - pOut->DrawPolyPolygon( rPolyPoly ); - pOut->Pop(); - } - } - else - pOut->DrawGradient( rPolyPoly, rGradient ); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From 0206aafdb9b9076b58b46eaeaecccbff832a8182 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 13 Jul 2011 20:55:00 +0100 Subject: callcatcher: drop unused help methods --- vcl/inc/vcl/help.hxx | 2 -- vcl/source/app/help.cxx | 28 ---------------------------- 2 files changed, 30 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/help.hxx b/vcl/inc/vcl/help.hxx index ce7d1baf4fd6..54cdea8ccb25 100644 --- a/vcl/inc/vcl/help.hxx +++ b/vcl/inc/vcl/help.hxx @@ -86,14 +86,12 @@ public: static void EnableContextHelp(); static void DisableContextHelp(); static sal_Bool IsContextHelpEnabled(); - static sal_Bool StartContextHelp(); static void EnableExtHelp(); static void DisableExtHelp(); static sal_Bool IsExtHelpEnabled(); static sal_Bool StartExtHelp(); static sal_Bool EndExtHelp(); - static sal_Bool IsExtHelpActive(); static void EnableBalloonHelp(); static void DisableBalloonHelp(); diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx index 75bab1a29694..3db6bcc841bf 100644 --- a/vcl/source/app/help.cxx +++ b/vcl/source/app/help.cxx @@ -112,27 +112,6 @@ sal_Bool Help::IsContextHelpEnabled() // ----------------------------------------------------------------------- -sal_Bool Help::StartContextHelp() -{ - ImplSVData* pSVData = ImplGetSVData(); - - if ( pSVData->maHelpData.mbContextHelp ) - { - Window* pWindow = pSVData->maWinData.mpFocusWin; - if ( pWindow ) - { - Point aMousePos = pWindow->OutputToScreenPixel( pWindow->GetPointerPosPixel() ); - HelpEvent aHelpEvent( aMousePos, HELPMODE_CONTEXT ); - pWindow->RequestHelp( aHelpEvent ); - return sal_True; - } - } - - return sal_False; -} - -// ----------------------------------------------------------------------- - void Help::EnableExtHelp() { ImplGetSVData()->maHelpData.mbExtHelp = sal_True; @@ -191,13 +170,6 @@ sal_Bool Help::EndExtHelp() // ----------------------------------------------------------------------- -sal_Bool Help::IsExtHelpActive() -{ - return ImplGetSVData()->maHelpData.mbExtHelpMode; -} - -// ----------------------------------------------------------------------- - void Help::EnableBalloonHelp() { ImplGetSVData()->maHelpData.mbBalloonHelp = sal_True; -- cgit v1.2.3 From 9b5d883faeed10440175009e3b8bf1728381d0e3 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 13 Jul 2011 21:51:01 +0100 Subject: add missing mode-lines --- vcl/inc/saltimer.hxx | 3 +++ vcl/inc/svsys.h | 3 +++ vcl/inc/unx/Xproto.h | 3 +++ vcl/inc/unx/x11_cursors/salcursors.h | 3 +++ vcl/inc/vcl/displayconnectiondispatch.hxx | 3 +++ vcl/inc/vcl/quickselectionengine.hxx | 3 +++ vcl/inc/vcl/rendergraphic.hxx | 3 +++ vcl/inc/vcl/rendergraphicrasterizer.hxx | 3 +++ vcl/inc/vcl/throbber.hxx | 2 ++ vcl/source/components/rasterizer_rsvg.cxx | 3 +++ vcl/source/components/stringmirror.cxx | 3 +++ vcl/source/control/quickselectionengine.cxx | 3 +++ vcl/source/control/throbber.cxx | 3 +++ vcl/source/gdi/pdfwriter_impl2.cxx | 3 +++ vcl/source/gdi/rendergraphic.cxx | 3 +++ vcl/source/gdi/rendergraphicrasterizer.cxx | 3 +++ vcl/source/gdi/svgread.cxx | 3 +++ vcl/source/window/window4.cxx | 2 ++ vcl/source/window/wpropset.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atkaction.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atkbridge.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atkcomponent.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atkeditabletext.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atkfactory.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atkhypertext.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atkimage.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atklistener.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atkregistry.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atkselection.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atktable.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atktext.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atktextattributes.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atkutil.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atkvalue.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atkwindow.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atkwrapper.cxx | 3 +++ vcl/unx/gtk3/app/gtk3gtkdata.cxx | 3 +++ vcl/unx/gtk3/app/gtk3gtkinst.cxx | 3 +++ vcl/unx/gtk3/app/gtk3gtksys.cxx | 3 +++ vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx | 2 ++ vcl/unx/gtk3/window/gtk3gtkframe.cxx | 3 +++ vcl/unx/gtk3/window/gtk3gtkobject.cxx | 3 +++ 42 files changed, 123 insertions(+) (limited to 'vcl') diff --git a/vcl/inc/saltimer.hxx b/vcl/inc/saltimer.hxx index 38dd20e69ff3..11a90dc24bf1 100644 --- a/vcl/inc/saltimer.hxx +++ b/vcl/inc/saltimer.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -67,3 +68,5 @@ public: }; #endif // _SV_SALTIMER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/svsys.h b/vcl/inc/svsys.h index ce65f4ab95fb..0976282bc898 100644 --- a/vcl/inc/svsys.h +++ b/vcl/inc/svsys.h @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -44,3 +45,5 @@ #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/unx/Xproto.h b/vcl/inc/unx/Xproto.h index 804b3ffa98cc..b6db98dbfe15 100644 --- a/vcl/inc/unx/Xproto.h +++ b/vcl/inc/unx/Xproto.h @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -47,3 +48,5 @@ #include #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/unx/x11_cursors/salcursors.h b/vcl/inc/unx/x11_cursors/salcursors.h index e0d34e122336..6af2c111fb57 100644 --- a/vcl/inc/unx/x11_cursors/salcursors.h +++ b/vcl/inc/unx/x11_cursors/salcursors.h @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -160,3 +161,5 @@ #include "unx/x11_cursors/tblselsw_mask.h" #include "unx/x11_cursors/paintbrush_curs.h" #include "unx/x11_cursors/paintbrush_mask.h" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/vcl/displayconnectiondispatch.hxx b/vcl/inc/vcl/displayconnectiondispatch.hxx index fea1d0b7cba9..0804c9111153 100644 --- a/vcl/inc/vcl/displayconnectiondispatch.hxx +++ b/vcl/inc/vcl/displayconnectiondispatch.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -50,3 +51,5 @@ protected: } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/vcl/quickselectionengine.hxx b/vcl/inc/vcl/quickselectionengine.hxx index f70736428010..d3dc157d2c6c 100644 --- a/vcl/inc/vcl/quickselectionengine.hxx +++ b/vcl/inc/vcl/quickselectionengine.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -93,3 +94,5 @@ namespace vcl //........................................................................ #endif // VCL_QUICKSELECTIONENGINE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/vcl/rendergraphic.hxx b/vcl/inc/vcl/rendergraphic.hxx index 0a0f475decd6..bee2abf4f6f1 100644 --- a/vcl/inc/vcl/rendergraphic.hxx +++ b/vcl/inc/vcl/rendergraphic.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -122,3 +123,5 @@ namespace vcl } #endif // _SV_RENDERHRAPHIC_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/vcl/rendergraphicrasterizer.hxx b/vcl/inc/vcl/rendergraphicrasterizer.hxx index f2166b03ffb3..0f564a635beb 100644 --- a/vcl/inc/vcl/rendergraphicrasterizer.hxx +++ b/vcl/inc/vcl/rendergraphicrasterizer.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -109,3 +110,5 @@ namespace vcl } #endif // _SV_RENDERGRAPHICRASTERIZER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/vcl/throbber.hxx b/vcl/inc/vcl/throbber.hxx index ce45631d2fda..4cbd6dcdbce2 100644 --- a/vcl/inc/vcl/throbber.hxx +++ b/vcl/inc/vcl/throbber.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -99,3 +100,4 @@ private: #endif // VCL_THROBBER_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/components/rasterizer_rsvg.cxx b/vcl/source/components/rasterizer_rsvg.cxx index b68aaa1fda8c..ef0d5f82e937 100644 --- a/vcl/source/components/rasterizer_rsvg.cxx +++ b/vcl/source/components/rasterizer_rsvg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -542,3 +543,5 @@ uno::Reference< uno::XInterface > SAL_CALL Rasterizer_createInstance( const uno: } // namespace rsvg } // namespace vcl + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/components/stringmirror.cxx b/vcl/source/components/stringmirror.cxx index 78806914a7c4..70bf44b568d0 100644 --- a/vcl/source/components/stringmirror.cxx +++ b/vcl/source/components/stringmirror.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -121,3 +122,5 @@ Sequence< OUString > SAL_CALL StringMirror::getSupportedServiceNames() throw (Ru } } // namespace vcl + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/control/quickselectionengine.cxx b/vcl/source/control/quickselectionengine.cxx index 2d32393bf79a..ee479d27ab20 100644 --- a/vcl/source/control/quickselectionengine.cxx +++ b/vcl/source/control/quickselectionengine.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -181,3 +182,5 @@ namespace vcl //........................................................................ } // namespace vcl //........................................................................ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/control/throbber.cxx b/vcl/source/control/throbber.cxx index a55fdb3eb379..4aa456c1ddcf 100644 --- a/vcl/source/control/throbber.cxx +++ b/vcl/source/control/throbber.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -323,3 +324,5 @@ IMPL_LINK( Throbber, TimeOutHdl, void*, EMPTYARG ) return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index c1fd5a8c6ca5..0569de5e3464 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2050,3 +2051,5 @@ void PDFWriterImpl::writeG4Stream( BitmapReadAccess* i_pBitmap ) rtl_freeMemory( pFirstRefLine ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/gdi/rendergraphic.cxx b/vcl/source/gdi/rendergraphic.cxx index 10b6064cc57c..79771163fa2d 100644 --- a/vcl/source/gdi/rendergraphic.cxx +++ b/vcl/source/gdi/rendergraphic.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -238,3 +239,5 @@ void RenderGraphic::ImplGetDefaults() const } } // VCL + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/gdi/rendergraphicrasterizer.cxx b/vcl/source/gdi/rendergraphicrasterizer.cxx index 29c9863335b3..4c70d866245b 100644 --- a/vcl/source/gdi/rendergraphicrasterizer.cxx +++ b/vcl/source/gdi/rendergraphicrasterizer.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -398,3 +399,5 @@ void RenderGraphicRasterizer::ImplUpdateCache( const RenderGraphicRasterizer& rR } } // VCL + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/gdi/svgread.cxx b/vcl/source/gdi/svgread.cxx index 554cfa804b1b..0573f924e277 100644 --- a/vcl/source/gdi/svgread.cxx +++ b/vcl/source/gdi/svgread.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -129,3 +130,5 @@ namespace vcl } } // namespace vcl + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/window4.cxx b/vcl/source/window/window4.cxx index 775249c450ee..b4abcf229502 100644 --- a/vcl/source/window/window4.cxx +++ b/vcl/source/window/window4.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -223,3 +224,4 @@ uno::Sequence< beans::PropertyValue > Window::getProperties() const return aProps; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/wpropset.cxx b/vcl/source/window/wpropset.cxx index 10e3e8fa5e2f..ceca8f8784d6 100644 --- a/vcl/source/window/wpropset.cxx +++ b/vcl/source/window/wpropset.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -345,3 +346,5 @@ IMPL_LINK( vcl::WindowPropertySet, ChildEventListener, VclWindowEvent*, pEvent ) return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atkaction.cxx b/vcl/unx/gtk3/a11y/gtk3atkaction.cxx index 71a92c8e918b..80593f6af67c 100644 --- a/vcl/unx/gtk3/a11y/gtk3atkaction.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atkaction.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atkaction.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atkbridge.cxx b/vcl/unx/gtk3/a11y/gtk3atkbridge.cxx index 34d094ff9d20..f7babdb8d95f 100644 --- a/vcl/unx/gtk3/a11y/gtk3atkbridge.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atkbridge.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atkbridge.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atkcomponent.cxx b/vcl/unx/gtk3/a11y/gtk3atkcomponent.cxx index cd33fcf91e9d..8c300b125d79 100644 --- a/vcl/unx/gtk3/a11y/gtk3atkcomponent.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atkcomponent.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atkcomponent.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atkeditabletext.cxx b/vcl/unx/gtk3/a11y/gtk3atkeditabletext.cxx index 6ba2164d2842..ae91ac31c63e 100644 --- a/vcl/unx/gtk3/a11y/gtk3atkeditabletext.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atkeditabletext.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atkeditabletext.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atkfactory.cxx b/vcl/unx/gtk3/a11y/gtk3atkfactory.cxx index 3fd107f960c9..2a3c0dc8d76a 100644 --- a/vcl/unx/gtk3/a11y/gtk3atkfactory.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atkfactory.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atkfactory.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atkhypertext.cxx b/vcl/unx/gtk3/a11y/gtk3atkhypertext.cxx index 29458829989c..f6b8cb651ffb 100644 --- a/vcl/unx/gtk3/a11y/gtk3atkhypertext.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atkhypertext.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atkhypertext.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atkimage.cxx b/vcl/unx/gtk3/a11y/gtk3atkimage.cxx index e8404b199b0f..8167f6e8ecc9 100644 --- a/vcl/unx/gtk3/a11y/gtk3atkimage.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atkimage.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atkimage.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atklistener.cxx b/vcl/unx/gtk3/a11y/gtk3atklistener.cxx index a43aeab9abcb..76ad3ba5c6ea 100644 --- a/vcl/unx/gtk3/a11y/gtk3atklistener.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atklistener.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atklistener.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atkregistry.cxx b/vcl/unx/gtk3/a11y/gtk3atkregistry.cxx index 95c372a8c74e..3ad55519a892 100644 --- a/vcl/unx/gtk3/a11y/gtk3atkregistry.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atkregistry.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atkregistry.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atkselection.cxx b/vcl/unx/gtk3/a11y/gtk3atkselection.cxx index 860e125d38cb..b233bbee9ef5 100644 --- a/vcl/unx/gtk3/a11y/gtk3atkselection.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atkselection.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atkselection.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atktable.cxx b/vcl/unx/gtk3/a11y/gtk3atktable.cxx index 39dc5fc75407..bc0f473a773c 100644 --- a/vcl/unx/gtk3/a11y/gtk3atktable.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atktable.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atktable.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atktext.cxx b/vcl/unx/gtk3/a11y/gtk3atktext.cxx index 3239c6630114..f6f69af3b4be 100644 --- a/vcl/unx/gtk3/a11y/gtk3atktext.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atktext.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atktext.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atktextattributes.cxx b/vcl/unx/gtk3/a11y/gtk3atktextattributes.cxx index 61eeb47211d1..85ecf50da8bd 100644 --- a/vcl/unx/gtk3/a11y/gtk3atktextattributes.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atktextattributes.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atktextattributes.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atkutil.cxx b/vcl/unx/gtk3/a11y/gtk3atkutil.cxx index 44b41f63e575..183a33c3ac27 100644 --- a/vcl/unx/gtk3/a11y/gtk3atkutil.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atkutil.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atkutil.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atkvalue.cxx b/vcl/unx/gtk3/a11y/gtk3atkvalue.cxx index 8398e0f5f57f..346d7672d6d2 100644 --- a/vcl/unx/gtk3/a11y/gtk3atkvalue.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atkvalue.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atkvalue.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atkwindow.cxx b/vcl/unx/gtk3/a11y/gtk3atkwindow.cxx index 3b11cf0f0780..c93b0ff4a8de 100644 --- a/vcl/unx/gtk3/a11y/gtk3atkwindow.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atkwindow.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atkwindow.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atkwrapper.cxx b/vcl/unx/gtk3/a11y/gtk3atkwrapper.cxx index 9a6c2e9c5d22..fbcecd3495f8 100644 --- a/vcl/unx/gtk3/a11y/gtk3atkwrapper.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atkwrapper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atkwrapper.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/app/gtk3gtkdata.cxx b/vcl/unx/gtk3/app/gtk3gtkdata.cxx index a6d7a0e2abc2..01d5c59104ca 100644 --- a/vcl/unx/gtk3/app/gtk3gtkdata.cxx +++ b/vcl/unx/gtk3/app/gtk3gtkdata.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/app/gtkdata.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/app/gtk3gtkinst.cxx b/vcl/unx/gtk3/app/gtk3gtkinst.cxx index ad2d59ac54a5..7d10b89e62a6 100644 --- a/vcl/unx/gtk3/app/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/app/gtk3gtkinst.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/app/gtkinst.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/app/gtk3gtksys.cxx b/vcl/unx/gtk3/app/gtk3gtksys.cxx index ee769b30e71a..8b103fa28e61 100644 --- a/vcl/unx/gtk3/app/gtk3gtksys.cxx +++ b/vcl/unx/gtk3/app/gtk3gtksys.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/app/gtksys.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx index d6a181a77f30..aa68cc26e002 100644 --- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -28,3 +29,4 @@ #include "../../headless/svpdi.hxx" #include "../../headless/svpdi.hxx" +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/window/gtk3gtkframe.cxx b/vcl/unx/gtk3/window/gtk3gtkframe.cxx index a1d950ec5a15..47cbf2f41893 100644 --- a/vcl/unx/gtk3/window/gtk3gtkframe.cxx +++ b/vcl/unx/gtk3/window/gtk3gtkframe.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/window/gtkframe.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/window/gtk3gtkobject.cxx b/vcl/unx/gtk3/window/gtk3gtkobject.cxx index ab1628018e06..e91c849d8dff 100644 --- a/vcl/unx/gtk3/window/gtk3gtkobject.cxx +++ b/vcl/unx/gtk3/window/gtk3gtkobject.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/window/gtkobject.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From 0d5420e58da79b845f84587344fc29c4e105e5b6 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 14 Jul 2011 18:19:24 +0300 Subject: Use the gdiplus headers from Wine when cross-compiling to Windows --- vcl/Library_vcl.mk | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'vcl') diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 70bdad3fecd9..2925acf1cb24 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -42,12 +42,17 @@ endif $(eval $(call gb_Library_add_package_headers,vcl,vcl_inc)) $(eval $(call gb_Library_add_package_headers,vcl,vcl_afmhash)) +ifeq ($(OS)$(COM),WNTGCC) +GDIPLUSINCLUDE=-I$(OUTDIR)/inc/external/gdiplus +endif + $(eval $(call gb_Library_set_include,vcl,\ $$(INCLUDE) \ -I$(realpath $(SRCDIR)/vcl/inc) \ -I$(realpath $(SRCDIR)/vcl/inc/pch) \ -I$(SRCDIR)/solenv/inc \ -I$(OUTDIR)/inc \ + $(GDIPLUSINCLUDE) \ -I$(WORKDIR)/CustomTarget/vcl/unx/generic/fontmanager \ )) ifeq ($(GUIBASE),unx) -- cgit v1.2.3 From e4e34084c711f75cae159c072e241289d34c3068 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 14 Jul 2011 18:20:47 +0300 Subject: Use OLDNAMESLIB --- vcl/Library_vcl.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vcl') diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 2925acf1cb24..b6d7ba691431 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -545,7 +545,7 @@ $(eval $(call gb_Library_add_linked_libs,vcl,\ mpr \ msimg32 \ msvcrt \ - oldnames \ + $(OLDNAMESLIB) \ ole32 \ shell32 \ user32 \ -- cgit v1.2.3 From 87f3d120efc0ded699f89607b48a3c2f9c56d4e0 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 14 Jul 2011 18:25:16 +0300 Subject: Use the flat GdiPlus API as needed because of the incomplete headers from Wine --- vcl/win/source/gdi/salgdi_gdiplus.cxx | 104 +++++++++++++++++++--------------- 1 file changed, 57 insertions(+), 47 deletions(-) (limited to 'vcl') diff --git a/vcl/win/source/gdi/salgdi_gdiplus.cxx b/vcl/win/source/gdi/salgdi_gdiplus.cxx index 3c55685f0aba..fd828d6c0878 100644 --- a/vcl/win/source/gdi/salgdi_gdiplus.cxx +++ b/vcl/win/source/gdi/salgdi_gdiplus.cxx @@ -50,9 +50,9 @@ #pragma warning(push, 1) #endif -#include -#include -#include +#include +#include +#include #if defined _MSC_VER #pragma warning(pop) @@ -62,7 +62,7 @@ // ----------------------------------------------------------------------- -void impAddB2DPolygonToGDIPlusGraphicsPathReal(Gdiplus::GraphicsPath& rPath, const basegfx::B2DPolygon& rPolygon, bool bNoLineJoin) +void impAddB2DPolygonToGDIPlusGraphicsPathReal(Gdiplus::GpPath *pPath, const basegfx::B2DPolygon& rPolygon, bool bNoLineJoin) { sal_uInt32 nCount(rPolygon.count()); @@ -71,44 +71,42 @@ void impAddB2DPolygonToGDIPlusGraphicsPathReal(Gdiplus::GraphicsPath& rPath, con const sal_uInt32 nEdgeCount(rPolygon.isClosed() ? nCount : nCount - 1); const bool bControls(rPolygon.areControlPointsUsed()); basegfx::B2DPoint aCurr(rPolygon.getB2DPoint(0)); - Gdiplus::PointF aFCurr(Gdiplus::REAL(aCurr.getX()), Gdiplus::REAL(aCurr.getY())); for(sal_uInt32 a(0); a < nEdgeCount; a++) { const sal_uInt32 nNextIndex((a + 1) % nCount); const basegfx::B2DPoint aNext(rPolygon.getB2DPoint(nNextIndex)); - const Gdiplus::PointF aFNext(Gdiplus::REAL(aNext.getX()), Gdiplus::REAL(aNext.getY())); if(bControls && (rPolygon.isNextControlPointUsed(a) || rPolygon.isPrevControlPointUsed(nNextIndex))) { const basegfx::B2DPoint aCa(rPolygon.getNextControlPoint(a)); const basegfx::B2DPoint aCb(rPolygon.getPrevControlPoint(nNextIndex)); - rPath.AddBezier( - aFCurr, - Gdiplus::PointF(Gdiplus::REAL(aCa.getX()), Gdiplus::REAL(aCa.getY())), - Gdiplus::PointF(Gdiplus::REAL(aCb.getX()), Gdiplus::REAL(aCb.getY())), - aFNext); + Gdiplus::DllExports::GdipAddPathBezier(pPath, + aCurr.getX(), aCurr.getY(), + aCa.getX(), aCa.getY(), + aCb.getX(), aCb.getY(), + aNext.getX(), aNext.getY()); } else { - rPath.AddLine(aFCurr, aFNext); + Gdiplus::DllExports::GdipAddPathLine(pPath, aCurr.getX(), aCurr.getY(), aNext.getX(), aNext.getY()); } if(a + 1 < nEdgeCount) { - aFCurr = aFNext; + aCurr = aNext; if(bNoLineJoin) { - rPath.StartFigure(); + Gdiplus::DllExports::GdipStartPathFigure(pPath); } } } } } -void impAddB2DPolygonToGDIPlusGraphicsPathInteger(Gdiplus::GraphicsPath& rPath, const basegfx::B2DPolygon& rPolygon, bool bNoLineJoin) +void impAddB2DPolygonToGDIPlusGraphicsPathInteger(Gdiplus::GpPath *pPath, const basegfx::B2DPolygon& rPolygon, bool bNoLineJoin) { sal_uInt32 nCount(rPolygon.count()); @@ -117,37 +115,36 @@ void impAddB2DPolygonToGDIPlusGraphicsPathInteger(Gdiplus::GraphicsPath& rPath, const sal_uInt32 nEdgeCount(rPolygon.isClosed() ? nCount : nCount - 1); const bool bControls(rPolygon.areControlPointsUsed()); basegfx::B2DPoint aCurr(rPolygon.getB2DPoint(0)); - Gdiplus::Point aICurr(INT(aCurr.getX()), INT(aCurr.getY())); for(sal_uInt32 a(0); a < nEdgeCount; a++) { const sal_uInt32 nNextIndex((a + 1) % nCount); const basegfx::B2DPoint aNext(rPolygon.getB2DPoint(nNextIndex)); - const Gdiplus::Point aINext(INT(aNext.getX()), INT(aNext.getY())); if(bControls && (rPolygon.isNextControlPointUsed(a) || rPolygon.isPrevControlPointUsed(nNextIndex))) { const basegfx::B2DPoint aCa(rPolygon.getNextControlPoint(a)); const basegfx::B2DPoint aCb(rPolygon.getPrevControlPoint(nNextIndex)); - rPath.AddBezier( - aICurr, - Gdiplus::Point(INT(aCa.getX()), INT(aCa.getY())), - Gdiplus::Point(INT(aCb.getX()), INT(aCb.getY())), - aINext); + Gdiplus::DllExports::GdipAddPathBezier( + pPath, + aCurr.getX(), aCurr.getY(), + aCa.getX(), aCa.getY(), + aCb.getX(), aCb.getY(), + aNext.getX(), aNext.getY()); } else { - rPath.AddLine(aICurr, aINext); + Gdiplus::DllExports::GdipAddPathLine(pPath, aCurr.getX(), aCurr.getY(), aNext.getX(), aNext.getY()); } if(a + 1 < nEdgeCount) { - aICurr = aINext; + aCurr = aNext; if(bNoLineJoin) { - rPath.StartFigure(); + Gdiplus::DllExports::GdipStartPathFigure(pPath); } } } @@ -160,33 +157,39 @@ bool WinSalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly if(mbBrush && nCount && (fTransparency >= 0.0 && fTransparency < 1.0)) { - Gdiplus::Graphics aGraphics(mhDC); + Gdiplus::GpGraphics *pGraphics = NULL; + Gdiplus::DllExports::GdipCreateFromHDC(mhDC, &pGraphics); const sal_uInt8 aTrans((sal_uInt8)255 - (sal_uInt8)basegfx::fround(fTransparency * 255.0)); Gdiplus::Color aTestColor(aTrans, SALCOLOR_RED(maFillColor), SALCOLOR_GREEN(maFillColor), SALCOLOR_BLUE(maFillColor)); - Gdiplus::SolidBrush aTestBrush(aTestColor); - Gdiplus::GraphicsPath aPath; + Gdiplus::GpSolidFill *pTestBrush; + Gdiplus::DllExports::GdipCreateSolidFill(aTestColor.GetValue(), &pTestBrush); + Gdiplus::GpPath *pPath = NULL; + Gdiplus::DllExports::GdipCreatePath(Gdiplus::FillModeAlternate, &pPath); for(sal_uInt32 a(0); a < nCount; a++) { if(0 != a) { - aPath.StartFigure(); // #i101491# not needed for first run + Gdiplus::DllExports::GdipStartPathFigure(pPath); // #i101491# not needed for first run } - impAddB2DPolygonToGDIPlusGraphicsPathReal(aPath, rPolyPolygon.getB2DPolygon(a), false); - aPath.CloseFigure(); + impAddB2DPolygonToGDIPlusGraphicsPathReal(pPath, rPolyPolygon.getB2DPolygon(a), false); + Gdiplus::DllExports::GdipClosePathFigure(pPath); } if(getAntiAliasB2DDraw()) { - aGraphics.SetSmoothingMode(Gdiplus::SmoothingModeAntiAlias); + Gdiplus::DllExports::GdipSetSmoothingMode(pGraphics, Gdiplus::SmoothingModeAntiAlias); } else { - aGraphics.SetSmoothingMode(Gdiplus::SmoothingModeNone); + Gdiplus::DllExports::GdipSetSmoothingMode(pGraphics, Gdiplus::SmoothingModeNone); } - aGraphics.FillPath(&aTestBrush, &aPath); + Gdiplus::DllExports::GdipFillPath(pGraphics, pTestBrush, pPath); + + Gdiplus::DllExports::GdipDeletePath(pPath); + Gdiplus::DllExports::GdipDeleteGraphics(pGraphics); } return true; @@ -198,11 +201,14 @@ bool WinSalGraphics::drawPolyLine( const basegfx::B2DPolygon& rPolygon, double f if(mbPen && nCount) { - Gdiplus::Graphics aGraphics(mhDC); + Gdiplus::GpGraphics *pGraphics = NULL; + Gdiplus::DllExports::GdipCreateFromHDC(mhDC, &pGraphics); const sal_uInt8 aTrans = (sal_uInt8)basegfx::fround( 255 * (1.0 - fTransparency) ); Gdiplus::Color aTestColor(aTrans, SALCOLOR_RED(maLineColor), SALCOLOR_GREEN(maLineColor), SALCOLOR_BLUE(maLineColor)); - Gdiplus::Pen aTestPen(aTestColor, Gdiplus::REAL(rLineWidths.getX())); - Gdiplus::GraphicsPath aPath; + Gdiplus::GpPen *pTestPen = NULL; + Gdiplus::DllExports::GdipCreatePen1(aTestColor.GetValue(), Gdiplus::REAL(rLineWidths.getX()), Gdiplus::UnitWorld, &pTestPen); + Gdiplus::GpPath *pPath; + Gdiplus::DllExports::GdipCreatePath(Gdiplus::FillModeAlternate, &pPath); bool bNoLineJoin(false); switch(eLineJoin) @@ -217,49 +223,53 @@ bool WinSalGraphics::drawPolyLine( const basegfx::B2DPolygon& rPolygon, double f } case basegfx::B2DLINEJOIN_BEVEL : { - aTestPen.SetLineJoin(Gdiplus::LineJoinBevel); + Gdiplus::DllExports::GdipSetPenLineJoin(pTestPen, Gdiplus::LineJoinBevel); break; } case basegfx::B2DLINEJOIN_MIDDLE : case basegfx::B2DLINEJOIN_MITER : { const Gdiplus::REAL aMiterLimit(15.0); - aTestPen.SetMiterLimit(aMiterLimit); - aTestPen.SetLineJoin(Gdiplus::LineJoinMiter); + Gdiplus::DllExports::GdipSetPenMiterLimit(pTestPen, aMiterLimit); + Gdiplus::DllExports::GdipSetPenLineJoin(pTestPen, Gdiplus::LineJoinMiter); break; } case basegfx::B2DLINEJOIN_ROUND : { - aTestPen.SetLineJoin(Gdiplus::LineJoinRound); + Gdiplus::DllExports::GdipSetPenLineJoin(pTestPen, Gdiplus::LineJoinRound); break; } } if(nCount > 250 && basegfx::fTools::more(rLineWidths.getX(), 1.5)) { - impAddB2DPolygonToGDIPlusGraphicsPathInteger(aPath, rPolygon, bNoLineJoin); + impAddB2DPolygonToGDIPlusGraphicsPathInteger(pPath, rPolygon, bNoLineJoin); } else { - impAddB2DPolygonToGDIPlusGraphicsPathReal(aPath, rPolygon, bNoLineJoin); + impAddB2DPolygonToGDIPlusGraphicsPathReal(pPath, rPolygon, bNoLineJoin); } if(rPolygon.isClosed() && !bNoLineJoin) { // #i101491# needed to create the correct line joins - aPath.CloseFigure(); + Gdiplus::DllExports::GdipClosePathFigure(pPath); } if(getAntiAliasB2DDraw()) { - aGraphics.SetSmoothingMode(Gdiplus::SmoothingModeAntiAlias); + Gdiplus::DllExports::GdipSetSmoothingMode(pGraphics, Gdiplus::SmoothingModeAntiAlias); } else { - aGraphics.SetSmoothingMode(Gdiplus::SmoothingModeNone); + Gdiplus::DllExports::GdipSetSmoothingMode(pGraphics, Gdiplus::SmoothingModeNone); } - aGraphics.DrawPath(&aTestPen, &aPath); + Gdiplus::DllExports::GdipDrawPath(pGraphics, pTestPen, pPath); + + Gdiplus::DllExports::GdipDeletePath(pPath); + Gdiplus::DllExports::GdipDeletePen(pTestPen); + Gdiplus::DllExports::GdipDeleteGraphics(pGraphics); } return true; -- cgit v1.2.3 From 1f7e587c283f27ad08aaca19d3b9550da4b23941 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 14 Jul 2011 18:25:51 +0300 Subject: Fixes for Windows cross-compilation Header names are all lower-case. Use our own sehandler.hxx instead of assuming that stuff being in a patches excpt.h. --- vcl/win/source/app/salinst.cxx | 15 ++++++++------- vcl/win/source/app/saltimer.cxx | 7 ++++--- vcl/win/source/gdi/salprn.cxx | 8 ++++---- vcl/win/source/window/salframe.cxx | 7 ++++--- 4 files changed, 20 insertions(+), 17 deletions(-) (limited to 'vcl') diff --git a/vcl/win/source/app/salinst.cxx b/vcl/win/source/app/salinst.cxx index b06d3cc672d6..5e8930f4155f 100644 --- a/vcl/win/source/app/salinst.cxx +++ b/vcl/win/source/app/salinst.cxx @@ -34,9 +34,6 @@ #include #include #endif -#ifdef __MINGW32__ -#include -#endif #include #include @@ -72,15 +69,19 @@ #pragma warning( disable: 4917 ) #endif -#include -#include -#include -#include +#include +#include +#include +#include #if defined _MSC_VER #pragma warning(pop) #endif +#ifdef __MINGW32__ +#include +#endif + // ======================================================================= void SalAbort( const XubString& rErrorText ) diff --git a/vcl/win/source/app/saltimer.cxx b/vcl/win/source/app/saltimer.cxx index 60c917475a94..5aab67d88cdd 100644 --- a/vcl/win/source/app/saltimer.cxx +++ b/vcl/win/source/app/saltimer.cxx @@ -29,13 +29,14 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" #include -#ifdef __MINGW32__ -#include -#endif #include #include #include +#ifdef __MINGW32__ +#include +#endif + // ======================================================================= // Maximale Periode diff --git a/vcl/win/source/gdi/salprn.cxx b/vcl/win/source/gdi/salprn.cxx index ae8d93382985..7fdd77394cc2 100644 --- a/vcl/win/source/gdi/salprn.cxx +++ b/vcl/win/source/gdi/salprn.cxx @@ -39,10 +39,6 @@ #include -#ifdef __MINGW32__ -#include -#endif - #include #include #include @@ -64,6 +60,10 @@ #include +#ifdef __MINGW32__ +#include +#endif + #ifdef __MINGW32__ #define CATCH_DRIVER_EX_BEGIN \ jmp_buf jmpbuf; \ diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index 2ccef60923b1..81a6a4778753 100644 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -48,9 +48,6 @@ #include #include -#ifdef __MINGW32__ -#include -#endif #include #include @@ -100,6 +97,10 @@ using ::std::max; #include +#ifdef __MINGW32__ +#include +#endif + using ::rtl::OUString; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; -- cgit v1.2.3 From 80e824f344fdf74a69533859fbb6e60eadd7bdef Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 14 Jul 2011 21:02:30 +0300 Subject: Use all-lowercase header names --- vcl/win/source/gdi/winlayout.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vcl') diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx index ec4917f4201a..23f672389057 100644 --- a/vcl/win/source/gdi/winlayout.cxx +++ b/vcl/win/source/gdi/winlayout.cxx @@ -57,8 +57,8 @@ #define USE_UNISCRIBE #ifdef USE_UNISCRIBE -#include -#include +#include +#include #include #endif // USE_UNISCRIBE -- cgit v1.2.3 From ec1c756eb00aec9e4c9dfe14e0efe335cb048b61 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 14 Jul 2011 21:03:48 +0300 Subject: Relocated the headers we need from Wine --- vcl/Library_vcl.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vcl') diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index b6d7ba691431..977facc72a1f 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -43,7 +43,7 @@ $(eval $(call gb_Library_add_package_headers,vcl,vcl_inc)) $(eval $(call gb_Library_add_package_headers,vcl,vcl_afmhash)) ifeq ($(OS)$(COM),WNTGCC) -GDIPLUSINCLUDE=-I$(OUTDIR)/inc/external/gdiplus +WINEINCLUDE=-I$(OUTDIR)/inc/external/wine endif $(eval $(call gb_Library_set_include,vcl,\ @@ -52,7 +52,7 @@ $(eval $(call gb_Library_set_include,vcl,\ -I$(realpath $(SRCDIR)/vcl/inc/pch) \ -I$(SRCDIR)/solenv/inc \ -I$(OUTDIR)/inc \ - $(GDIPLUSINCLUDE) \ + $(WINEINCLUDE) \ -I$(WORKDIR)/CustomTarget/vcl/unx/generic/fontmanager \ )) ifeq ($(GUIBASE),unx) -- cgit v1.2.3 From c4accd1fd7bf27a210db4f05e10932fd933c8e6b Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 14 Jul 2011 21:07:07 +0300 Subject: Fix WNTGCC compilation error --- vcl/win/source/gdi/winlayout.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vcl') diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx index 23f672389057..6eb423f72cf6 100644 --- a/vcl/win/source/gdi/winlayout.cxx +++ b/vcl/win/source/gdi/winlayout.cxx @@ -2807,7 +2807,7 @@ private: grutils::GrFeatureParser * mpFeatures; mutable GraphiteLayoutWinImpl maImpl; public: - GraphiteWinLayout(HDC hDC, const ImplWinFontData& rWFD, ImplWinFontEntry& rWFE); + GraphiteWinLayout(HDC hDC, const ImplWinFontData& rWFD, ImplWinFontEntry& rWFE) throw(); // used by upper layers virtual bool LayoutText( ImplLayoutArgs& ); // first step of layout -- cgit v1.2.3 From f564296d7b8dd85fba153a5c5ed9f3ef6b16827c Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 14 Jul 2011 21:31:28 +0300 Subject: The MinGW winuser.h doesn't have WM_MOUSEHWHEEL yet --- vcl/win/source/window/salframe.cxx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'vcl') diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index 81a6a4778753..80051f321eac 100644 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -114,6 +114,9 @@ using namespace ::com::sun::star::beans; #ifndef SPI_SETWHEELSCROLLCHARS # define SPI_SETWHEELSCROLLCHARS 0x006D #endif +#ifndef WM_MOUSEHWHEEL +# define WM_MOUSEHWHEEL 0x020E +#endif #if OSL_DEBUG_LEVEL > 1 void MyOutputDebugString( char *s) { OutputDebugString( s ); } -- cgit v1.2.3 From 5a7834cd3e6e73ec9c19f3ff057aacba59e3f9a3 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 14 Jul 2011 11:02:21 +0300 Subject: iOS hacking Add some trivialish first attempts at iOS-specific headers and some source files that surely are quite bogus and does nothing sane, but must start with something. Mostly based on the MacOSX ("aqua") code. --- vcl/Library_vcl.mk | 33 +- vcl/StaticLibrary_vclmain.mk | 8 + vcl/inc/ios/iosvcltypes.h | 37 ++ vcl/inc/ios/salbmp.h | 117 ++++++ vcl/inc/ios/salcolorutils.hxx | 46 +++ vcl/inc/ios/saldata.hxx | 126 ++++++ vcl/inc/ios/salframe.h | 208 ++++++++++ vcl/inc/ios/salframeview.h | 144 +++++++ vcl/inc/ios/salgdi.h | 401 +++++++++++++++++++ vcl/inc/ios/salinst.h | 199 ++++++++++ vcl/inc/ios/salmathutils.hxx | 90 +++++ vcl/inc/ios/salmenu.h | 122 ++++++ vcl/inc/ios/salnstimer.h | 43 ++ vcl/inc/ios/salobj.h | 86 ++++ vcl/inc/ios/salprn.h | 173 ++++++++ vcl/inc/ios/salsys.h | 56 +++ vcl/inc/ios/saltimer.h | 54 +++ vcl/inc/ios/saluimenu.h | 62 +++ vcl/inc/ios/salvd.h | 79 ++++ vcl/inc/ios/vcluiapp.h | 53 +++ vcl/inc/vcl/bitmap.hxx | 2 +- vcl/inc/vcl/sysdata.hxx | 23 +- vcl/ios/source/app/saldata.cxx | 128 ++++++ vcl/ios/source/app/salinst.cxx | 828 +++++++++++++++++++++++++++++++++++++++ vcl/ios/source/app/salnstimer.mm | 59 +++ vcl/ios/source/app/salsys.cxx | 253 ++++++++++++ vcl/ios/source/app/saltimer.cxx | 104 +++++ vcl/ios/source/app/vcluiapp.mm | 101 +++++ vcl/source/salmain/salmain.cxx | 2 +- vcl/source/window/syschild.cxx | 3 + vcl/source/window/window.cxx | 10 + 31 files changed, 3644 insertions(+), 6 deletions(-) create mode 100644 vcl/inc/ios/iosvcltypes.h create mode 100644 vcl/inc/ios/salbmp.h create mode 100644 vcl/inc/ios/salcolorutils.hxx create mode 100644 vcl/inc/ios/saldata.hxx create mode 100644 vcl/inc/ios/salframe.h create mode 100644 vcl/inc/ios/salframeview.h create mode 100644 vcl/inc/ios/salgdi.h create mode 100644 vcl/inc/ios/salinst.h create mode 100644 vcl/inc/ios/salmathutils.hxx create mode 100644 vcl/inc/ios/salmenu.h create mode 100644 vcl/inc/ios/salnstimer.h create mode 100644 vcl/inc/ios/salobj.h create mode 100644 vcl/inc/ios/salprn.h create mode 100644 vcl/inc/ios/salsys.h create mode 100644 vcl/inc/ios/saltimer.h create mode 100644 vcl/inc/ios/saluimenu.h create mode 100644 vcl/inc/ios/salvd.h create mode 100644 vcl/inc/ios/vcluiapp.h create mode 100644 vcl/ios/source/app/saldata.cxx create mode 100644 vcl/ios/source/app/salinst.cxx create mode 100644 vcl/ios/source/app/salnstimer.mm create mode 100644 vcl/ios/source/app/salsys.cxx create mode 100644 vcl/ios/source/app/saltimer.cxx create mode 100644 vcl/ios/source/app/vcluiapp.mm (limited to 'vcl') diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 977facc72a1f..42e57144d5f4 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -236,7 +236,23 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ )) $(eval $(call gb_Library_add_nativeres,vcl,src)) +endif +ifeq ($(GUIBASE),cocoatouch) +$(eval $(call gb_Library_set_cxxflags,vcl,\ + $$(CXXFLAGS) \ + $$(OBJCXXFLAGS) \ +)) +$(eval $(call gb_Library_add_objcxxobjects,vcl,\ + vcl/ios/source/app/salnstimer \ + vcl/ios/source/app/vcluiapp \ +)) +$(eval $(call gb_Library_add_exception_objects,vcl,\ + vcl/ios/source/app/saldata \ + vcl/ios/source/app/salinst \ + vcl/ios/source/app/salsys \ + vcl/ios/source/app/saltimer \ +)) endif $(eval $(call gb_Library_add_cobjects,vcl,\ @@ -372,7 +388,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/source/helper/strhelper \ vcl/source/helper/threadex \ vcl/source/helper/xconnection \ - vcl/source/salmain/salmain \ vcl/source/window/abstdlg \ vcl/source/window/accel \ vcl/source/window/accmgr \ @@ -421,7 +436,11 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/source/window/wpropset \ vcl/source/window/wrkwin \ )) - +ifneq ($(OS),IOS) +$(eval $(call gb_Library_add_exception_objects,vcl,\ + vcl/source/salmain/salmain \ +)) +endif ## handle Graphite ifneq ($(ENABLE_GRAPHITE),) $(eval $(call gb_Library_set_defs,vcl,\ @@ -554,4 +573,14 @@ $(eval $(call gb_Library_add_linked_libs,vcl,\ winspool \ )) endif + +ifeq ($(GUIBASE),cocoatouch) +$(eval $(call gb_Library_set_ldflags,vcl,\ + $$(LDFLAGS) \ + -framework UIKit \ + -framework CoreFoundation \ +)) +endif + + # vim: set noet sw=4 ts=4: diff --git a/vcl/StaticLibrary_vclmain.mk b/vcl/StaticLibrary_vclmain.mk index 79b3ddd3ad5f..4c313f88b082 100644 --- a/vcl/StaticLibrary_vclmain.mk +++ b/vcl/StaticLibrary_vclmain.mk @@ -27,6 +27,13 @@ $(eval $(call gb_StaticLibrary_StaticLibrary,vclmain)) +ifeq ($(OS),IOS) +$(eval $(call gb_StaticLibrary_set_cxxflags,vclmain,\ + $$(CXXFLAGS) \ + -x objective-c++ -fobjc-abi-version=2 -fobjc-legacy-dispatch -D__IPHONE_OS_VERSION_MIN_REQUIRED=40300 \ +)) +endif + $(eval $(call gb_StaticLibrary_set_include,vclmain,\ $$(INCLUDE) \ -I$(realpath $(SRCDIR)/vcl/inc) \ @@ -36,6 +43,7 @@ $(eval $(call gb_StaticLibrary_set_include,vclmain,\ )) $(eval $(call gb_StaticLibrary_add_api,vclmain,\ + offapi \ udkapi \ )) diff --git a/vcl/inc/ios/iosvcltypes.h b/vcl/inc/ios/iosvcltypes.h new file mode 100644 index 000000000000..820547b6a013 --- /dev/null +++ b/vcl/inc/ios/iosvcltypes.h @@ -0,0 +1,37 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is Tor Lillqvist + * Portions created by the Initial Developer are Copyright (C) 2011 the + * Initial Developer. All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#ifndef _IOSVCLTYPES_H +#define _IOSVCLTYPES_H + +#include "premac.h" +#import +#include "postmac.h" + +#endif _IOSVCLTYPES_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/salbmp.h b/vcl/inc/ios/salbmp.h new file mode 100644 index 000000000000..0c3e1468b154 --- /dev/null +++ b/vcl/inc/ios/salbmp.h @@ -0,0 +1,117 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* + * 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 _SV_SALBMP_H +#define _SV_SALBMP_H + +#include "tools/gen.hxx" + +#include "basebmp/bitmapdevice.hxx" + +#include "vcl/salbtype.hxx" + +#include "ios/salgdi.h" + +#include "saldata.hxx" +#include "salinst.hxx" +#include "salvd.hxx" +#include "salbmp.hxx" + +#include "salcolorutils.hxx" + + +// -------------- +// - SalBitmap - +// -------------- + +struct BitmapBuffer; +class BitmapColor; +class BitmapPalette; +class IosSalVirtualDevice; +class IosSalGraphics; + +class IosSalBitmap : public SalBitmap +{ +public: + CGContextRef mxGraphicContext; + mutable CGImageRef mxCachedImage; + BitmapPalette maPalette; + basebmp::RawMemorySharedArray maUserBuffer; + basebmp::RawMemorySharedArray maContextBuffer; + sal_uInt16 mnBits; + int mnWidth; + int mnHeight; + sal_uInt32 mnBytesPerRow; + +public: + IosSalBitmap(); + virtual ~IosSalBitmap(); + +public: + + // SalBitmap methods + bool Create( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal ); + bool Create( const SalBitmap& rSalBmp ); + bool Create( const SalBitmap& rSalBmp, SalGraphics* pGraphics ); + bool Create( const SalBitmap& rSalBmp, sal_uInt16 nNewBitCount ); + virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas, + Size& rSize, + bool bMask = false ); + + void Destroy(); + + Size GetSize() const; + sal_uInt16 GetBitCount() const; + + BitmapBuffer *AcquireBuffer( bool bReadOnly ); + void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly ); + + bool GetSystemData( BitmapSystemData& rData ); + +private: + // quartz helper + bool CreateContext(); + void DestroyContext(); + bool AllocateUserData(); + + void ConvertBitmapData( sal_uInt32 nWidth, sal_uInt32 nHeight, + sal_uInt16 nDestBits, sal_uInt32 nDestBytesPerRow, const BitmapPalette& rDestPalette, sal_uInt8* pDestData, + sal_uInt16 nSrcBits, sal_uInt32 nSrcBytesPerRow, const BitmapPalette& rSrcPalette, sal_uInt8* pSrcData ); + +public: + bool Create( CGLayerRef xLayer, int nBitCount, int nX, int nY, int nWidth, int nHeight, bool bMirrorVert = true ); + +public: + CGImageRef CreateWithMask( const IosSalBitmap& rMask, int nX, int nY, int nWidth, int nHeight ) const; + CGImageRef CreateColorMask( int nX, int nY, int nWidth, int nHeight, SalColor nMaskColor ) const; + CGImageRef CreateCroppedImage( int nX, int nY, int nWidth, int nHeight ) const; +}; + +#endif // _SV_SALBMP_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/salcolorutils.hxx b/vcl/inc/ios/salcolorutils.hxx new file mode 100644 index 000000000000..d6db5f839e04 --- /dev/null +++ b/vcl/inc/ios/salcolorutils.hxx @@ -0,0 +1,46 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 _SV_SALCOLORUTILS_HXX +#define _SV_SALCOLORUTILS_HXX + +#include "vcl/salbtype.hxx" +#include "vcl/salgtype.hxx" +#include "salmathutils.hxx" + +// ------------------------------------------------------------------ + +SalColor GetSalColor( const float* pQuartzColor ); + +void SetSalColor( const SalColor& rColor, float* pQuartzColor ); + +// ------------------------------------------------------------------ + +#endif // _SV_SALCOLORUTILS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/saldata.hxx b/vcl/inc/ios/saldata.hxx new file mode 100644 index 000000000000..764264e42462 --- /dev/null +++ b/vcl/inc/ios/saldata.hxx @@ -0,0 +1,126 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 _SV_SALDATA_HXX +#define _SV_SALDATA_HXX + +#include "premac.h" +#include +#include "postmac.h" + +#include "com/sun/star/uno/Reference.hxx" + +#include "vcl/ptrstyle.hxx" + +#include "svdata.hxx" +#include "salwtype.hxx" + +#include +#include +#include +#include + +#include +#include + +class IosSalInstance; +class SalObject; +class SalFrame; +class SalVirtualDevice; +class SalPrinter; +class SystemFontList; + +// ------------------ +// - Some constants - +// ------------------ + +#define SAL_CLIPRECT_COUNT 16 + +#define VER_TIGER 0x1040 +#define VER_LEOPARD 0x1050 + +// ----------- +// - SalData - +// ----------- + +class IosSalFrame; +struct FrameHash : public boost::hash +{ + size_t operator()(const IosSalFrame* frame) const + { return boost::hash::operator()( reinterpret_cast(frame) ); } +}; + +struct SalData +{ + + SALTIMERPROC mpTimerProc; // timer callback proc + IosSalInstance *mpFirstInstance; // pointer of first instance + std::list maFrames; // pointer of first frame + boost::unordered_set maFrameCheck; // for fast check of frame existance + SalObject *mpFirstObject; // pointer of first object window + SalVirtualDevice *mpFirstVD; // first VirDev + SalPrinter *mpFirstPrinter; // first printing printer + SystemFontList *mpFontList; + + CGColorSpaceRef mxRGBSpace; + CGColorSpaceRef mxGraySpace; + CGColorSpaceRef mxP50Space; + CGPatternRef mxP50Pattern; + + std::vector< UIMenuItem* > maFallbackMenu; + + static oslThreadKey s_aAutoReleaseKey; + + SInt32 mnSystemVersion; // Store System Version + + long mnDPIX; // #i100617# read DPI only once per office life + long mnDPIY; // #i100617# read DPI only once per office life + + com::sun::star::uno::Reference< com::sun::star::uno::XInterface > + mxClipboard; + + SalData(); + ~SalData(); + + static void ensureThreadAutoreleasePool(); + static void drainThreadAutoreleasePool(); +}; + +inline void SetSalData( SalData* pData ) { ImplGetSVData()->mpSalData = (void*)pData; } +inline SalData *GetSalData() { return (SalData*)ImplGetSVData()->mpSalData; } +inline SalData *GetAppSalData() { return (SalData*)ImplGetAppSVData()->mpSalData; } + +// --- Prototypes --- + +sal_Bool ImplSalYieldMutexTryToAcquire(); +void ImplSalYieldMutexAcquire(); +void ImplSalYieldMutexRelease(); + +#endif // _SV_SALDATA_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/salframe.h b/vcl/inc/ios/salframe.h new file mode 100644 index 000000000000..14761fe36ebd --- /dev/null +++ b/vcl/inc/ios/salframe.h @@ -0,0 +1,208 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 _SV_SALFRAME_H +#define _SV_SALFRAME_H + +#include "vcl/sysdata.hxx" + +#include "ios/salmenu.h" +#include "ios/saldata.hxx" +#include "ios/iosvcltypes.h" + +#include "salframe.hxx" + +#include +#include +#include + +#include + +class IosSalGraphics; +class IosSalFrame; +class IosSalTimer; +class IosSalInstance; +class IosSalMenu; +class IosBlinker; + +typedef struct SalFrame::SalPointerState SalPointerState; + +// ---------------- +// - IosSalFrame - +// ---------------- + +class IosSalFrame : public SalFrame +{ +public: + UIWindow* mpWindow; + UIView* mpView; + CGRect maScreenRect; // for mirroring purposes + IosSalGraphics* mpGraphics; + IosSalFrame* mpParent; + SystemEnvData maSysData; + int mnMinWidth; // min. client width in pixels + int mnMinHeight; // min. client height in pixels + int mnMaxWidth; // max. client width in pixels + int mnMaxHeight; // max. client height in pixels + CGRect maFullScreenRect; // old window size when in FullScreen + bool mbGraphics:1; // is Graphics used? + bool mbShown:1; + bool mbInitShow:1; + bool mbPresentation:1; + + sal_uLong mnStyle; + unsigned int mnStyleMask; // our style mask from UIWindow creation + + sal_uLong mnLastEventTime; + unsigned int mnLastModifierFlags; + IosSalMenu* mpMenu; + + SalExtStyle mnExtStyle; // currently document frames are marked this way + + PointerStyle mePointerStyle; // currently active pointer style + + CGMutablePathRef mrClippingPath; // used for "shaping" + std::vector< CGRect > maClippingRects; + + std::list maBlinkers; + + Rectangle maInvalidRect; + + sal_uLong mnICOptions; + + boost::shared_ptr< Timer > mpActivityTimer; // Timer to prevent system sleep during presentation +public: + /** Constructor + + Creates a system window and connects this frame with it. + + @throws std::runtime_error in case window creation fails + */ + IosSalFrame( SalFrame* pParent, sal_uLong salFrameStyle ); + + virtual ~IosSalFrame(); + + virtual SalGraphics* GetGraphics(); + virtual void ReleaseGraphics( SalGraphics* pGraphics ); + virtual sal_Bool PostEvent( void* pData ); + virtual void SetTitle( const XubString& rTitle ); + virtual void SetIcon( sal_uInt16 nIcon ); + virtual void SetRepresentedURL( const rtl::OUString& ); + virtual void SetMenu( SalMenu* pSalMenu ); + virtual void DrawMenuBar(); + 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, 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 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( sal_Bool bMouse ); + virtual void SetPointerPos( long nX, long nY ); + virtual void Flush( void ); + virtual void Flush( const Rectangle& ); + virtual void Sync(); + virtual void SetInputContext( SalInputContext* pContext ); + 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 ); + virtual void Beep( SoundType eSoundType ); + virtual const SystemEnvData* GetSystemData() const; + virtual SalPointerState GetPointerState(); + virtual SalIndicatorState GetIndicatorState(); + virtual void SimulateKeyPress( sal_uInt16 nKeyCode ); + virtual void SetParent( SalFrame* pNewParent ); + virtual bool SetPluginParent( SystemParentData* pNewParent ); + virtual void SetExtendedFrameStyle( SalExtStyle ); + virtual void SetBackgroundBitmap( SalBitmap* ); + virtual void SetScreenNumber(unsigned int); + virtual void SetApplicationID( const rtl::OUString &rApplicationID ); + + // shaped system windows + // set clip region to none (-> rectangular windows, normal state) + virtual void ResetClipRegion(); + // start setting the clipregion consisting of nRects rectangles + 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 + virtual void EndSetClipRegion(); + + virtual void SetClientSize( long nWidth, long nHeight ); + + void UpdateFrameGeometry(); + + // trigger painting of the window + void SendPaintEvent( const Rectangle* pRect = NULL ); + + static bool isAlive( const IosSalFrame* pFrame ) + { return GetSalData()->maFrameCheck.find( pFrame ) != GetSalData()->maFrameCheck.end(); } + + static IosSalFrame* GetCaptureFrame() { return s_pCaptureFrame; } + + UIWindow* getWindow() const { return mpWindow; } + UIView* getView() const { return mpView; } + unsigned int getStyleMask() const { return mnStyleMask; } + + void getResolution( long& o_rDPIX, long& o_rDPIY ); + + CGMutablePathRef getClipPath() const { return mrClippingPath; } + + // called by VCL_UIApplication to indicate screen settings have changed + void screenParametersChanged(); + + private: // methods + /** do things on initial show (like centering on parent or on screen) + */ + void initShow(); + + void initWindowAndView(); + + private: // data + static IosSalFrame* s_pCaptureFrame; + + // make IosSalFrame non copyable + IosSalFrame( const IosSalFrame& ); + IosSalFrame& operator=(const IosSalFrame&); +}; + +#endif // _SV_SALFRAME_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/salframeview.h b/vcl/inc/ios/salframeview.h new file mode 100644 index 000000000000..e631209c7b7f --- /dev/null +++ b/vcl/inc/ios/salframeview.h @@ -0,0 +1,144 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 _VCL_SALFRAMEVIEW_H +#define _VCL_SALFRAMEVIEW_H + +@interface SalFrameWindow : UIWindow +{ + IosSalFrame* mpFrame; + id mDraggingDestinationHandler; +} +-(id)initWithSalFrame: (IosSalFrame*)pFrame; +-(BOOL)canBecomeKeyWindow; +-(void)displayIfNeeded; +-(void)becomeKeyWindow; +-(void)resignKeyWindow; +-(IosSalFrame*)getSalFrame; +@end + +@interface SalFrameView : UIView +{ + IosSalFrame* mpFrame; + + // for UITextInput + UIEvent* mpLastEvent; + BOOL mbNeedSpecialKeyHandle; + BOOL mbInKeyInput; + BOOL mbKeyHandled; + NSRange mMarkedRange; + NSRange mSelectedRange; + id mDraggingDestinationHandler; + UIEvent* mpLastSuperEvent; + + NSTimeInterval mfLastMagnifyTime; + float mfMagnifyDeltaSum; +} +-(id)initWithSalFrame: (IosSalFrame*)pFrame; +-(IosSalFrame*)getSalFrame; +-(BOOL)acceptsFirstResponder; +-(BOOL)isOpaque; +-(void)drawRect: (CGRect)aRect; +-(void)magnifyWithEvent: (UIEvent*)pEvent; +-(void)rotateWithEvent: (UIEvent*)pEvent; +-(void)swipeWithEvent: (UIEvent*)pEvent; +-(void)keyDown: (UIEvent*)pEvent; +-(void)flagsChanged: (UIEvent*)pEvent; +-(BOOL)sendKeyInputAndReleaseToFrame: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar; +-(BOOL)sendKeyInputAndReleaseToFrame: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod; +-(BOOL)sendKeyToFrameDirect: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod; +-(BOOL)sendSingleCharacter:(UIEvent*)pEvent; +-(BOOL)handleKeyDownException:(UIEvent*)pEvent; +-(void)clearLastEvent; +/* + text action methods +*/ +-(void)insertText:(id)aString; +-(void)insertTab: (id)aSender; +-(void)insertBacktab: (id)aSender; +-(void)moveLeft: (id)aSender; +-(void)moveLeftAndModifySelection: (id)aSender; +-(void)moveBackwardAndModifySelection: (id)aSender; +-(void)moveRight: (id)aSender; +-(void)moveRightAndModifySelection: (id)aSender; +-(void)moveForwardAndModifySelection: (id)aSender; +-(void)moveUp: (id)aSender; +-(void)moveDown: (id)aSender; +-(void)moveWordBackward: (id)aSender; +-(void)moveWordBackwardAndModifySelection: (id)aSender; +-(void)moveWordLeftAndModifySelection: (id)aSender; +-(void)moveWordForward: (id)aSender; +-(void)moveWordForwardAndModifySelection: (id)aSender; +-(void)moveWordRightAndModifySelection: (id)aSender; +-(void)moveToEndOfLine: (id)aSender; +-(void)moveToRightEndOfLine: (id)aSender; +-(void)moveToLeftEndOfLine: (id)aSender; +-(void)moveToEndOfLineAndModifySelection: (id)aSender; +-(void)moveToRightEndOfLineAndModifySelection: (id)aSender; +-(void)moveToLeftEndOfLineAndModifySelection: (id)aSender; +-(void)moveToBeginningOfLine: (id)aSender; +-(void)moveToBeginningOfLineAndModifySelection: (id)aSender; +-(void)moveToEndOfParagraph: (id)aSender; +-(void)moveToEndOfParagraphAndModifySelection: (id)aSender; +-(void)moveToBeginningOfParagraph: (id)aSender; +-(void)moveToBeginningOfParagraphAndModifySelection: (id)aSender; +-(void)moveParagraphForward: (id)aSender; +-(void)moveParagraphForwardAndModifySelection: (id)aSender; +-(void)moveParagraphBackward: (id)aSender; +-(void)moveParagraphBackwardAndModifySelection: (id)aSender; +-(void)moveToEndOfDocument: (id)aSender; +-(void)scrollToEndOfDocument: (id)aSender; +-(void)moveToEndOfDocumentAndModifySelection: (id)aSender; +-(void)moveToBeginningOfDocument: (id)aSender; +-(void)scrollToBeginningOfDocument: (id)aSender; +-(void)moveToBeginningOfDocumentAndModifySelection: (id)aSender; +-(void)insertNewline: (id)aSender; +-(void)deleteBackward: (id)aSender; +-(void)deleteForward: (id)aSender; +-(void)cancelOperation: (id)aSender; +-(void)deleteBackwardByDecomposingPreviousCharacter: (id)aSender; +-(void)deleteWordBackward: (id)aSender; +-(void)deleteWordForward: (id)aSender; +-(void)deleteToBeginningOfLine: (id)aSender; +-(void)deleteToEndOfLine: (id)aSender; +-(void)deleteToBeginningOfParagraph: (id)aSender; +-(void)deleteToEndOfParagraph: (id)aSender; +-(void)insertLineBreak: (id)aSender; +-(void)insertParagraphSeparator: (id)aSender; +-(void)selectWord: (id)aSender; +-(void)selectLine: (id)aSender; +-(void)selectParagraph: (id)aSender; +-(void)selectAll: (id)aSender; +-(void)noop: (id)aSender; +-(id)parentAttribute; +-(UIView *)viewElementForParent; +@end + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/salgdi.h b/vcl/inc/ios/salgdi.h new file mode 100644 index 000000000000..51ef49219e9a --- /dev/null +++ b/vcl/inc/ios/salgdi.h @@ -0,0 +1,401 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 _SV_SALGDI_H +#define _SV_SALGDI_H + +#include "basegfx/polygon/b2dpolypolygon.hxx" + +#include "ios/iosvcltypes.h" +#include + +#include "outfont.hxx" +#include "salgdi.hxx" + +#include + +class IosSalFrame; +class IosSalBitmap; +class ImplDevFontAttributes; + +class CGRect; + +// mac specific physically available font face +class ImplIosFontData : public ImplFontData +{ +public: + ImplIosFontData( const ImplDevFontAttributes&, NSString * ); + + virtual ~ImplIosFontData(); + + virtual ImplFontData* Clone() const; + virtual ImplFontEntry* CreateFontInstance( ImplFontSelectData& ) const; + virtual sal_IntPtr GetFontId() const; + + const ImplFontCharMap* GetImplFontCharMap() const; + bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const; + bool HasChar( sal_uInt32 cChar ) const; + + void ReadOs2Table() const; + void ReadIosCmapEncoding() const; + bool HasCJKSupport() const; + +private: + mutable const ImplFontCharMap* mpCharMap; + mutable vcl::FontCapabilities maFontCapabilities; + mutable bool mbOs2Read; // true if OS2-table related info is valid + mutable bool mbHasOs2Table; + mutable bool mbCmapEncodingRead; // true if cmap encoding of Ios font is read + mutable bool mbHasCJKSupport; // #i78970# CJK fonts need extra leading + mutable bool mbFontCapabilitiesRead; +}; + +// abstracting quartz color instead of having to use an CGFloat[] array +class RGBAColor +{ +public: + RGBAColor( SalColor ); + RGBAColor( float fRed, float fGreen, float fBlue, float fAlpha ); //NOTUSEDYET + const float* AsArray() const { return &mfRed; } + bool IsVisible() const { return (mfAlpha > 0); } + void SetAlpha( float fAlpha ) { mfAlpha = fAlpha; } +private: + float mfRed, mfGreen, mfBlue, mfAlpha; +}; + +// ------------------- +// - IosSalGraphics - +// ------------------- +class IosSalGraphics : public SalGraphics +{ +protected: + IosSalFrame* mpFrame; + CGLayerRef mxLayer; // Quartz graphics layer + CGContextRef mrContext; // Quartz drawing context + class XorEmulation* mpXorEmulation; + int mnXorMode; // 0: off 1: on 2: invert only + int mnWidth; + int mnHeight; + int mnBitmapDepth; // zero unless bitmap + /// device resolution of this graphics + long mnRealDPIX; + long mnRealDPIY; + /// some graphics implementations (e.g. IosSalInfoPrinter) scale + /// everything down by a factor (see SetupPrinterGraphics for details) + /// so we have to compensate for it with the inverse factor + double mfFakeDPIScale; + + /// path representing current clip region + CGMutablePathRef mxClipPath; + + /// Drawing colors + /// pen color RGBA + RGBAColor maLineColor; + /// brush color RGBA + RGBAColor maFillColor; + + // Device Font settings + const ImplIosFontData* mpIosFontData; + /// <1.0: font is squeezed, >1.0 font is stretched, else 1.0 + float mfFontStretch; + /// allows text to be rendered without antialiasing + bool mbNonAntialiasedText; + + // Graphics types + + /// is this a printer graphics + bool mbPrinter; + /// is this a virtual device graphics + bool mbVirDev; + /// is this a window graphics + bool mbWindow; + +public: + IosSalGraphics(); + virtual ~IosSalGraphics(); + + bool IsPenVisible() const { return maLineColor.IsVisible(); } + bool IsBrushVisible() const { return maFillColor.IsVisible(); } + + void SetWindowGraphics( IosSalFrame* pFrame ); + void SetPrinterGraphics( CGContextRef, long nRealDPIX, long nRealDPIY, double fFakeScale ); + void SetVirDevGraphics( CGLayerRef, CGContextRef, int nBitDepth = 0 ); + + void initResolution( UIWindow* ); + void copyResolution( IosSalGraphics& ); + void updateResolution(); + + bool IsWindowGraphics() const { return mbWindow; } + bool IsPrinterGraphics() const { return mbPrinter; } + bool IsVirDevGraphics() const { return mbVirDev; } + IosSalFrame* getGraphicsFrame() const { return mpFrame; } + void setGraphicsFrame( IosSalFrame* pFrame ) { mpFrame = pFrame; } + + void ImplDrawPixel( long nX, long nY, const RGBAColor& ); // helper to draw single pixels + + bool CheckContext(); + void UpdateWindow( CGRect& ); // delivered in NSView coordinates + void RefreshRect( const CGRect& ); + void RefreshRect(float lX, float lY, float lWidth, float lHeight); + + void SetState(); + void UnsetState(); + // InvalidateContext does an UnsetState and sets mrContext to 0 + void InvalidateContext(); + + virtual bool setClipRegion( const Region& ); + + // draw --> LineColor and FillColor and RasterOp and ClipRegion + virtual void drawPixel( long nX, long nY ); + 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_uLong nPoints, const SalPoint* pPtAry ); + virtual void drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry ); + virtual void drawPolyPolygon( sal_uLong nPoly, const sal_uLong* pPoints, PCONSTSALPOINT* pPtAry ); + virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ); + virtual sal_Bool drawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ); + virtual sal_Bool drawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ); + virtual sal_Bool drawPolyPolygonBezier( sal_uLong nPoly, const sal_uLong* pPoints, const SalPoint* const* pPtAry, const sal_uInt8* const* pFlgAry ); + virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ); + + // CopyArea --> No RasterOp, but ClipRegion + virtual void copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth, + long nSrcHeight, sal_uInt16 nFlags ); + + // CopyBits and DrawBitmap --> RasterOp and ClipRegion + // CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics + virtual void copyBits( const SalTwoRect* pPosAry, SalGraphics* pSrcGraphics ); + virtual void drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap ); + virtual void drawBitmap( const SalTwoRect* pPosAry, + const SalBitmap& rSalBitmap, + SalColor nTransparentColor ); + virtual void drawBitmap( const SalTwoRect* pPosAry, + const SalBitmap& rSalBitmap, + const SalBitmap& rTransparentBitmap ); + virtual void drawMask( const SalTwoRect* pPosAry, + const SalBitmap& rSalBitmap, + SalColor nMaskColor ); + + virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight ); + virtual SalColor getPixel( long nX, long nY ); + + // invert --> ClipRegion (only Windows or VirDevs) + virtual void invert( long nX, long nY, long nWidth, long nHeight, 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_uLong nSize ); + + virtual bool drawAlphaBitmap( const SalTwoRect&, + const SalBitmap& rSourceBitmap, + const SalBitmap& rAlphaBitmap ); + + virtual bool drawAlphaRect( long nX, long nY, long nWidth, + long nHeight, sal_uInt8 nTransparency ); + + CGPoint* makeCGptArray(sal_uLong nPoints, const SalPoint* pPtAry); + // native widget rendering methods that require mirroring + 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& aCaption ); + virtual sal_Bool drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, + ControlState nState, const ImplControlValue& aValue, + const rtl::OUString& aCaption ); + virtual sal_Bool getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState, + const ImplControlValue& aValue, const rtl::OUString& aCaption, + Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion ); + + // get device resolution + virtual void GetResolution( long& rDPIX, long& rDPIY ); + // get the depth of the device + virtual sal_uInt16 GetBitCount() const; + // get the width of the device + virtual long GetGraphicsWidth() const; + + // set the clip region to empty + virtual void ResetClipRegion(); + + // set the line color to transparent (= don't draw lines) + virtual void SetLineColor(); + // set the line color to a specific color + virtual void SetLineColor( SalColor nSalColor ); + // set the fill color to transparent (= don't fill) + virtual void SetFillColor(); + // set the fill color to a specific color, shapes will be + // filled accordingly + virtual void SetFillColor( SalColor nSalColor ); + // enable/disable XOR drawing + virtual void SetXORMode( bool bSet, bool bInvertOnly ); + // set line color for raster operations + virtual void SetROPLineColor( SalROPColor nROPColor ); + // set fill color for raster operations + virtual void SetROPFillColor( SalROPColor nROPColor ); + // set the text color to a specific color + virtual void SetTextColor( SalColor nSalColor ); + // set the font + virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel ); + // get the current font's etrics + virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); + // get kernign pairs of the current font + // return only PairCount if (pKernPairs == NULL) + virtual sal_uLong GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs ); + // get the repertoire of the current font + virtual const ImplFontCharMap* GetImplFontCharMap() const; + virtual bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const; + // graphics must fill supplied font list + virtual void GetDevFontList( ImplDevFontList* ); + // graphics should call ImplAddDevFontSubstitute on supplied + // OutputDevice for all its device specific preferred font substitutions + virtual void GetDevFontSubstList( OutputDevice* ); + virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName ); + // CreateFontSubset: a method to get a subset of glyhps of a font + // inside a new valid font file + // returns TRUE if creation of subset was successfull + // parameters: rToFile: contains a osl file URL to write the subset to + // pFont: describes from which font to create a subset + // pGlyphIDs: the glyph ids to be extracted + // pEncoding: the character code corresponding to each glyph + // pWidths: the advance widths of the correspoding glyphs (in PS font units) + // nGlyphs: the number of glyphs + // rInfo: additional outgoing information + // implementation note: encoding 0 with glyph id 0 should be added implicitly + // as "undefined character" + virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile, + const ImplFontData* pFont, + long* pGlyphIDs, + sal_uInt8* pEncoding, + sal_Int32* pWidths, + int nGlyphs, + FontSubsetInfo& rInfo // out parameter + ); + + // GetFontEncodingVector: a method to get the encoding map Unicode + // to font encoded character; this is only used for type1 fonts and + // may return NULL in case of unknown encoding vector + // if ppNonEncoded is set and non encoded characters (that is type1 + // glyphs with only a name) exist it is set to the corresponding + // map for non encoded glyphs; the encoding vector contains -1 + // as encoding for these cases + virtual const Ucs2SIntMap* GetFontEncodingVector( const ImplFontData*, const Ucs2OStrMap** ppNonEncoded ); + + // GetEmbedFontData: gets the font data for a font marked + // embeddable by GetDevFontList or NULL in case of error + // parameters: pFont: describes the font in question + // pWidths: the widths of all glyphs from char code 0 to 255 + // pWidths MUST support at least 256 members; + // rInfo: additional outgoing information + // pDataLen: out parameter, contains the byte length of the returned buffer + virtual const void* GetEmbedFontData( const ImplFontData*, + const sal_Ucs* pUnicodes, + sal_Int32* pWidths, + FontSubsetInfo& rInfo, + long* pDataLen ); + // frees the font data again + virtual void FreeEmbedFontData( const void* pData, long nDataLen ); + + virtual void GetGlyphWidths( const ImplFontData*, + bool bVertical, + Int32Vector& rWidths, + Ucs2UIntMap& rUnicodeEnc ); + + virtual sal_Bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ); + virtual sal_Bool GetGlyphOutline( sal_GlyphId nIndex, basegfx::B2DPolyPolygon& ); + + virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ); + virtual void DrawServerFontLayout( const ServerFontLayout& ); + virtual bool supportsOperation( OutDevSupportType ) const; + + // Query the platform layer for control support + virtual sal_Bool IsNativeControlSupported( ControlType nType, ControlPart nPart ); + + virtual SystemGraphicsData GetGraphicsData() const; + virtual SystemFontData GetSysFontData( int /* nFallbacklevel */ ) const; + +private: + // differences between VCL, Quartz and kHiThemeOrientation coordinate systems + // make some graphics seem to be vertically-mirrored from a VCL perspective + bool IsFlipped() const { return mbWindow; } + + void ApplyXorContext(); + void Pattern50Fill(); + UInt32 getState( ControlState nState ); + UInt32 getTrackState( ControlState nState ); +}; + +class XorEmulation +{ +public: + XorEmulation(); + /*final*/ ~XorEmulation(); + + void SetTarget( int nWidth, int nHeight, int nBitmapDepth, CGContextRef, CGLayerRef ); + bool UpdateTarget(); + void Enable() { mbIsEnabled = true; } + void Disable() { mbIsEnabled = false; } + bool IsEnabled() const { return mbIsEnabled; } + CGContextRef GetTargetContext() const { return mxTargetContext; } + CGContextRef GetMaskContext() const { return (mbIsEnabled ? mxMaskContext : NULL); } + +private: + CGLayerRef mxTargetLayer; + CGContextRef mxTargetContext; + CGContextRef mxMaskContext; + CGContextRef mxTempContext; + sal_uLong* mpMaskBuffer; + sal_uLong* mpTempBuffer; + int mnBufferLongs; + bool mbIsEnabled; +}; + + +// --- some trivial inlines + +inline void IosSalGraphics::RefreshRect( const CGRect& rRect ) +{ + RefreshRect( rRect.origin.x, rRect.origin.y, rRect.size.width, rRect.size.height ); +} + +inline RGBAColor::RGBAColor( SalColor nSalColor ) +: mfRed( SALCOLOR_RED(nSalColor) * (1.0/255)) +, mfGreen( SALCOLOR_GREEN(nSalColor) * (1.0/255)) +, mfBlue( SALCOLOR_BLUE(nSalColor) * (1.0/255)) +, mfAlpha( 1.0 ) // opaque +{} + +inline RGBAColor::RGBAColor( float fRed, float fGreen, float fBlue, float fAlpha ) +: mfRed( fRed ) +, mfGreen( fGreen ) +, mfBlue( fBlue ) +, mfAlpha( fAlpha ) +{} + +#endif // _SV_SALGDI_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/salinst.h b/vcl/inc/ios/salinst.h new file mode 100644 index 000000000000..9983804bf665 --- /dev/null +++ b/vcl/inc/ios/salinst.h @@ -0,0 +1,199 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 _SV_SALINST_H +#define _SV_SALINST_H + +#include "osl/mutex.hxx" +#include "osl/thread.hxx" +#include "osl/conditn.h" +#include + +#include "ios/iosvcltypes.h" + +#include "salinst.hxx" + +#include + +class IosSalFrame; +class ApplicationEvent; +class Image; + +// ----------------- +// - SalYieldMutex - +// ----------------- + +class SalYieldMutex : public vcl::SolarMutexObject +{ + sal_uLong mnCount; + oslThreadIdentifier mnThreadId; + +public: + SalYieldMutex(); + virtual void acquire(); + virtual void release(); + virtual sal_Bool tryToAcquire(); + sal_uLong GetAcquireCount() const { return mnCount; } + oslThreadIdentifier GetThreadId() const { return mnThreadId; } +}; + +#define YIELD_GUARD osl::SolarGuard aGuard( GetSalData()->mpFirstInstance->GetYieldMutex() ) + + +// ------------------- +// - SalInstanceData - +// ------------------- + +//struct SalInstanceData +//{ +//public: +//}; + +// ------------------ +// - IosSalInstance - +// ------------------ + +class IosSalInstance : public SalInstance +{ + struct SalUserEvent + { + IosSalFrame* mpFrame; + void* mpData; + sal_uInt16 mnType; + + SalUserEvent( IosSalFrame* pFrame, void* pData, sal_uInt16 nType ) : + mpFrame( pFrame ), mpData( pData ), mnType( nType ) + {} + }; + +public: + SalYieldMutex* mpSalYieldMutex; + rtl::OUString maDefaultPrinter; + oslThreadIdentifier maMainThread; + bool mbWaitingYield; + int mnActivePrintJobs; + std::list< SalUserEvent > maUserEvents; + oslMutex maUserEventListMutex; + oslCondition maWaitingYieldCond; + + typedef std::list AppEventList; + static AppEventList aAppEventList; + +public: + IosSalInstance(); + virtual ~IosSalInstance(); + + virtual SalSystem* CreateSystem(); + virtual void DestroySystem(SalSystem*); + virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uLong nStyle ); + virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle ); + virtual void DestroyFrame( SalFrame* pFrame ); + 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, + sal_uInt16 nBitCount, const SystemGraphicsData *pData ); + virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice ); + + virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo, + ImplJobSetup* pSetupData ); + virtual void DestroyInfoPrinter( SalInfoPrinter* pPrinter ); + virtual SalPrinter* CreatePrinter( SalInfoPrinter* pInfoPrinter ); + virtual void DestroyPrinter( SalPrinter* pPrinter ); + virtual void GetPrinterQueueInfo( ImplPrnQueueList* pList ); + virtual void GetPrinterQueueState( SalPrinterQueueInfo* pInfo ); + virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo ); + virtual String GetDefaultPrinter(); + virtual SalTimer* CreateSalTimer(); + virtual SalI18NImeStatus* CreateI18NImeStatus(); + virtual SalSystem* CreateSalSystem(); + virtual SalBitmap* CreateSalBitmap(); + virtual osl::SolarMutex* GetYieldMutex(); + virtual sal_uLong ReleaseYieldMutex(); + virtual void AcquireYieldMutex( sal_uLong nCount ); + virtual bool CheckYieldMutex(); + virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ); + virtual bool AnyInput( sal_uInt16 nType ); + virtual SalMenu* CreateMenu( sal_Bool bMenuBar, Menu* pVCLMenu ); + virtual void DestroyMenu( SalMenu* ); + virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData ); + virtual void DestroyMenuItem( SalMenuItem* ); + virtual SalSession* CreateSalSession(); + virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ); + virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType); + virtual void SetEventCallback( void* pInstance, bool(*pCallback)(void*,void*,int) ); + virtual void SetErrorEventCallback( void* pInstance, bool(*pCallback)(void*,void*,int) ); + + // dtrans implementation + virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > + CreateClipboard( const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& i_rArguments ); + virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > CreateDragSource(); + virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > CreateDropTarget(); + + void wakeupYield(); + + public: + friend class IosSalFrame; + + void PostUserEvent( IosSalFrame* pFrame, sal_uInt16 nType, void* pData ); + void delayedSettingsChanged( bool bInvalidate ); + + bool isUIAppThread() const; + + void startedPrintJob() { mnActivePrintJobs++; } + void endedPrintJob() { mnActivePrintJobs--; } + + // event subtypes for NSApplicationDefined events + static const short AppExecuteSVMain = 0x7fff; + static const short AppEndLoopEvent = 1; + static const short AppStartTimerEvent = 10; + static const short AppleRemoteEvent = 15; + static const short YieldWakeupEvent = 20; +}; + +// helper class: inverted solar guard +class YieldMutexReleaser +{ + sal_uLong mnCount; + public: + YieldMutexReleaser(); + ~YieldMutexReleaser(); +}; + +// helper class +rtl::OUString GetOUString( CFStringRef ); +rtl::OUString GetOUString( NSString* ); +CFStringRef CreateCFString( const rtl::OUString& ); +NSString* CreateNSString( const rtl::OUString& ); + +CGImageRef CreateCGImage( const Image& ); +UIImage* CreateUIImage( const Image& ); + +#endif // _SV_SALINST_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/salmathutils.hxx b/vcl/inc/ios/salmathutils.hxx new file mode 100644 index 000000000000..e81f68e46b0b --- /dev/null +++ b/vcl/inc/ios/salmathutils.hxx @@ -0,0 +1,90 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 _SV_SALMATHUTILS_HXX +#define _SV_SALMATHUTILS_HXX + +#ifdef __cplusplus +extern "C" { +#endif + +// ------------------------------------------------------------------ +// +// Structures +// +// ------------------------------------------------------------------ + +// LRectCoor is an abreviation for rectangular coordinates +// represented as long integers + +struct LRectCoor +{ + long x; + long y; + long z; +}; + +// ------------------------------------------------------------------ +// +// Type Definitions +// +// ------------------------------------------------------------------ + +// LRectCoorVec is an abreviation for vectors in rectangular +// coordinates represented as long integers + +typedef struct LRectCoor LRectCoor; +typedef LRectCoor *LRectCoorVector; +typedef LRectCoorVector *LRectCoorTensor; + +// ------------------------------------------------------------------ +// +// Function Headers +// +// ------------------------------------------------------------------ + +void CSwap ( char &rX, char &rY ); +void UCSwap ( unsigned char &rX, unsigned char &rY ); +void SSwap ( short &rX, short &rY ); +void USSwap ( unsigned short &rX, unsigned short &rY ); +void LSwap ( long &rX, long &rY ); +void ULSwap ( unsigned long &rX, unsigned long &rY ); + +// ------------------------------------------------------------------ + +unsigned long Euclidian2Norm ( const LRectCoorVector pVec ); + +// ------------------------------------------------------------------ + +#ifdef __cplusplus +} +#endif + +#endif // _SV_SALMATHUTILS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/salmenu.h b/vcl/inc/ios/salmenu.h new file mode 100644 index 000000000000..3f143ac1d976 --- /dev/null +++ b/vcl/inc/ios/salmenu.h @@ -0,0 +1,122 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 _SV_SALMENU_H +#define _SV_SALMENU_H + +#include "premac.h" +#include +#include "postmac.h" + +#include "salmenu.hxx" + +#include + +class IosSalFrame; +class IosSalMenuItem; + +class IosSalMenu : public SalMenu +{ + std::vector< IosSalMenuItem* > maItems; + +public: // for OOStatusView + struct MenuBarButtonEntry + { + SalMenuButtonItem maButton; + UIImage* mpUIImage; // cached image + NSString* mpToolTipString; + + MenuBarButtonEntry() : mpUIImage( nil ), mpToolTipString( nil ) {} + MenuBarButtonEntry( const SalMenuButtonItem& i_rItem ) + : maButton( i_rItem), mpUIImage( nil ), mpToolTipString( nil ) {} + }; +private: + std::vector< MenuBarButtonEntry > maButtons; + + MenuBarButtonEntry* findButtonItem( sal_uInt16 i_nItemId ); + void releaseButtonEntry( MenuBarButtonEntry& i_rEntry ); + static void statusLayout(); +public: + IosSalMenu( bool bMenuBar ); + virtual ~IosSalMenu(); + + virtual sal_Bool VisibleMenuBar(); // must return TRUE to actually DISPLAY native menu bars + // otherwise only menu messages are processed (eg, OLE on Windows) + + virtual void InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos ); + virtual void RemoveItem( unsigned nPos ); + virtual void SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned nPos ); + virtual void SetFrame( const SalFrame* pFrame ); + virtual void CheckItem( unsigned nPos, sal_Bool bCheck ); + virtual void EnableItem( unsigned nPos, sal_Bool bEnable ); + virtual void SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const XubString& rText ); + virtual void SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage); + virtual void GetSystemMenuData( SystemMenuData* pData ); + virtual bool ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rRect, sal_uLong nFlags); + virtual bool AddMenuBarButton( const SalMenuButtonItem& ); + virtual void RemoveMenuBarButton( sal_uInt16 nId ); + virtual Rectangle GetMenuBarButtonRectPixel( sal_uInt16 i_nItemId, SalFrame* i_pReferenceFrame ); + + int getItemIndexByPos( sal_uInt16 nPos ) const; + const IosSalFrame* getFrame() const; + + void setMainMenu(); + static void unsetMainMenu(); + static void setDefaultMenu(); + static void enableMainMenu( bool bEnable ); + static void addFallbackMenuItem( UIMenuItem* NewItem ); + static void removeFallbackMenuItem( UIMenuItem* pOldItem ); + + const std::vector< MenuBarButtonEntry >& getButtons() const { return maButtons; } + + bool mbMenuBar; // true - Menubar, false - Menu + UIMenuController* mpMenu; + Menu* mpVCLMenu; // the corresponding vcl Menu object + const IosSalFrame* mpFrame; // the frame to dispatch the menu events to + IosSalMenu* mpParentSalMenu; // the parent menu that contains us (and perhaps has a frame) + + static const IosSalMenu* pCurrentMenuBar; + +}; + +class IosSalMenuItem : public SalMenuItem +{ +public: + IosSalMenuItem( const SalItemParams* ); + virtual ~IosSalMenuItem(); + + sal_uInt16 mnId; // Item ID + Menu* mpVCLMenu; // VCL Menu into which this MenuItem is inserted + IosSalMenu* mpParentMenu; // The menu in which this menu item is inserted + IosSalMenu* mpSubMenu; // Sub menu of this item (if defined) + UIMenuItem* mpMenuItem; // The UIMenuItem +}; + +#endif // _SV_SALMENU_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/salnstimer.h b/vcl/inc/ios/salnstimer.h new file mode 100644 index 000000000000..cf98276747ee --- /dev/null +++ b/vcl/inc/ios/salnstimer.h @@ -0,0 +1,43 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 _VCL_SALNSTIMER_H +#define _VCL_SALNSTIMER_H + +#include "premac.h" +#include +#include "postmac.h" + +@interface TimerCallbackCaller : NSObject +{ +} +-(void)timerElapsed:(NSTimer*)pTimer; +@end + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/salobj.h b/vcl/inc/ios/salobj.h new file mode 100644 index 000000000000..3203a0d46e93 --- /dev/null +++ b/vcl/inc/ios/salobj.h @@ -0,0 +1,86 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 _SV_SALOBJ_H +#define _SV_SALOBJ_H + +#include "vcl/sysdata.hxx" +#include "salobj.hxx" + +class IosSalFrame; +class IosSalObject; + + +// ----------------- +// - SalObjectData - +// ----------------- + +struct SalObjectData +{ +}; + +class IosSalObject : public SalObject +{ +public: + IosSalFrame* mpFrame; // parent frame + SystemEnvData maSysData; + + long mnClipX; + long mnClipY; + long mnClipWidth; + long mnClipHeight; + bool mbClip; + + long mnX; + long mnY; + long mnWidth; + long mnHeight; + + void setClippedPosSize(); + + IosSalObject( IosSalFrame* pFrame ); + virtual ~IosSalObject(); + + virtual void ResetClipRegion(); + virtual sal_uInt16 GetClipRegionType(); + virtual void BeginSetClipRegion( sal_uLong 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( sal_Bool bVisible ); + virtual void Enable( sal_Bool nEnable ); + virtual void GrabFocus(); + virtual void SetBackground(); + virtual void SetBackground( SalColor nSalColor ); + virtual const SystemEnvData* GetSystemData() const; + virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept ); +}; + +#endif // _SV_SALOBJ_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/salprn.h b/vcl/inc/ios/salprn.h new file mode 100644 index 000000000000..cd90a0f881df --- /dev/null +++ b/vcl/inc/ios/salprn.h @@ -0,0 +1,173 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 _SV_SALPRN_H +#define _SV_SALPRN_H + +#include "ios/iosvcltypes.h" + +#include "salprn.hxx" + +#include + + +// --------------------- +// - IosSalInfoPrinter - +// --------------------- + +class IosSalGraphics; + +class IosSalInfoPrinter : public SalInfoPrinter +{ + /// Printer graphics + IosSalGraphics* mpGraphics; + /// is Graphics used + bool mbGraphics; + /// job active ? + bool mbJob; + + UIPrintFormatter* mpPrinter; + /// cocoa print info object + UIPrintInfo* mpPrintInfo; + + /// FIXME: get real printer context for infoprinter if possible + /// fake context for info printer + /// graphics context for Quartz 2D + CGContextRef mrContext; + /// memory for graphics bitmap context for querying metrics + boost::shared_array< sal_uInt8 > maContextMemory; + + // since changes to UIPrintInfo during a job are ignored + // we have to care for some settings ourselves + // currently we do this for orientation; + // really needed however is a solution for paper formats + Orientation mePageOrientation; + + int mnStartPageOffsetX; + int mnStartPageOffsetY; + sal_Int32 mnCurPageRangeStart; + sal_Int32 mnCurPageRangeCount; + + public: + IosSalInfoPrinter( const SalPrinterQueueInfo& pInfo ); + virtual ~IosSalInfoPrinter(); + + void SetupPrinterGraphics( CGContextRef i_xContext ) const; + + virtual SalGraphics* GetGraphics(); + virtual void ReleaseGraphics( SalGraphics* i_pGraphics ); + virtual sal_Bool Setup( SalFrame* i_pFrame, ImplJobSetup* i_pSetupData ); + virtual sal_Bool SetPrinterData( ImplJobSetup* pSetupData ); + virtual sal_Bool SetData( sal_uLong i_nFlags, ImplJobSetup* i_pSetupData ); + virtual void GetPageInfo( const ImplJobSetup* i_pSetupData, + long& o_rOutWidth, long& o_rOutHeight, + long& o_rPageOffX, long& o_rPageOffY, + long& o_rPageWidth, long& o_rPageHeight ); + virtual sal_uLong GetCapabilities( const ImplJobSetup* i_pSetupData, sal_uInt16 i_nType ); + virtual sal_uLong GetPaperBinCount( const ImplJobSetup* i_pSetupData ); + virtual String GetPaperBinName( const ImplJobSetup* i_pSetupData, sal_uLong i_nPaperBin ); + virtual void InitPaperFormats( const ImplJobSetup* i_pSetupData ); + virtual int GetLandscapeAngle( const ImplJobSetup* i_pSetupData ); + + // the artificial separation between InfoPrinter and Printer + // is not really useful for us + // so let's make IosSalPrinter just a forwarder to IosSalInfoPrinter + // and concentrate the real work in one class + // implement pull model print system + sal_Bool StartJob( const String* i_pFileName, + const String& rJobName, + const String& i_rAppName, + ImplJobSetup* i_pSetupData, + vcl::PrinterController& i_rController ); + sal_Bool EndJob(); + sal_Bool AbortJob(); + SalGraphics* StartPage( ImplJobSetup* i_pSetupData, sal_Bool i_bNewJobData ); + sal_Bool EndPage(); + sal_uLong GetErrorCode() const; + + UIPrintInfo* getPrintInfo() const { return mpPrintInfo; } + void setStartPageOffset( int nOffsetX, int nOffsetY ) { mnStartPageOffsetX = nOffsetX; mnStartPageOffsetY = nOffsetY; } + sal_Int32 getCurPageRangeStart() const { return mnCurPageRangeStart; } + sal_Int32 getCurPageRangeCount() const { return mnCurPageRangeCount; } + + // match width/height against known paper formats, possibly switching orientation + const PaperInfo* matchPaper( long i_nWidth, long i_nHeight, Orientation& o_rOrientation ) const; + void setPaperSize( long i_nWidth, long i_nHeight, Orientation i_eSetOrientation ); + + private: + IosSalInfoPrinter( const IosSalInfoPrinter& ); + IosSalInfoPrinter& operator=(const IosSalInfoPrinter&); +}; + +// ----------------- +// - IosSalPrinter - +// ----------------- + +class IosSalPrinter : public SalPrinter +{ + IosSalInfoPrinter* mpInfoPrinter; // pointer to the compatible InfoPrinter + public: + IosSalPrinter( IosSalInfoPrinter* i_pInfoPrinter ); + virtual ~IosSalPrinter(); + + virtual sal_Bool StartJob( const XubString* i_pFileName, + const XubString& i_rJobName, + const XubString& i_rAppName, + sal_uLong i_nCopies, + bool i_bCollate, + bool i_bDirect, + ImplJobSetup* i_pSetupData ); + // implement pull model print system + virtual sal_Bool StartJob( const String* i_pFileName, + const String& rJobName, + const String& i_rAppName, + ImplJobSetup* i_pSetupData, + vcl::PrinterController& i_rListener ); + + virtual sal_Bool EndJob(); + virtual sal_Bool AbortJob(); + virtual SalGraphics* StartPage( ImplJobSetup* i_pSetupData, sal_Bool i_bNewJobData ); + virtual sal_Bool EndPage(); + virtual sal_uLong GetErrorCode(); + + private: + IosSalPrinter( const IosSalPrinter& ); + IosSalPrinter& operator=(const IosSalPrinter&); +}; + +const double fPtTo100thMM = 35.27777778; + +inline int PtTo10Mu( double nPoints ) { return (int)(((nPoints)*fPtTo100thMM)+0.5); } + +inline double TenMuToPt( double nUnits ) { return floor(((nUnits)/fPtTo100thMM)+0.5); } + + + +#endif // _SV_SALPRN_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/salsys.h b/vcl/inc/ios/salsys.h new file mode 100644 index 000000000000..e586c8dfb356 --- /dev/null +++ b/vcl/inc/ios/salsys.h @@ -0,0 +1,56 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 _SV_SALSYS_H +#define _SV_SALSYS_H + +#include "salsys.hxx" + +class VCL_DLLPUBLIC IosSalSystem : public SalSystem +{ +public: + IosSalSystem() {} + virtual ~IosSalSystem(); + + // get info about the display + virtual unsigned int GetDisplayScreenCount(); + virtual bool IsMultiDisplay(); + virtual unsigned int GetDefaultDisplayNumber(); + virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen ); + virtual Rectangle GetDisplayWorkAreaPosSizePixel( unsigned int nScreen ); + + virtual rtl::OUString GetScreenName( unsigned int nScreen ); + virtual int ShowNativeMessageBox( const String& rTitle, + const String& rMessage, + int nButtonCombination, + int nDefaultButton); +}; + +#endif // _SV_SALSYS_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/saltimer.h b/vcl/inc/ios/saltimer.h new file mode 100644 index 000000000000..b5974219437d --- /dev/null +++ b/vcl/inc/ios/saltimer.h @@ -0,0 +1,54 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* + * 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 _SV_SALTIMER_H +#define _SV_SALTIMER_H + +#include "premac.h" +#include +#include "postmac.h" + +#include "saltimer.hxx" + +class IosSalTimer : public SalTimer +{ + public: + + IosSalTimer(); + virtual ~IosSalTimer(); + + void Start( sal_uLong nMS ); + void Stop(); + + static NSTimer* pRunningTimer; + static bool bDispatchTimer; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/saluimenu.h b/vcl/inc/ios/saluimenu.h new file mode 100644 index 000000000000..ef54daa2d631 --- /dev/null +++ b/vcl/inc/ios/saluimenu.h @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 _VCL_SALUIMENU_H +#define _VCL_SALUIMENU_H + +class IosSalMenu; +class IosSalMenuItem; + +@interface SalUIMenu : UIMenuController +{ + /* Caution: SalNSMenu instances occasionally are binary copied + in IosSalMenu::ShowNativePopupMenu. If any members are added, + please take this into account ! + */ + IosSalMenu* mpMenu; +} +-(id)initWithMenu: (IosSalMenu*)pMenu; +-(void)menuNeedsUpdate: (UIMenuController*)pMenu; +-(void)setSalMenu: (IosSalMenu*)pMenu; +@end + +@interface SalUIMenuItem : UIMenuItem +{ + /* Caution: SalUIMenuItem instances occasionally are binary copied + in IosSalMenu::ShowNativePopupMenu. If any members are added, + please take this into account ! + */ + IosSalMenuItem* mpMenuItem; +} +-(id)initWithMenuItem: (IosSalMenuItem*)pMenuItem; +-(void)menuItemTriggered: (id)aSender; +@end + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/salvd.h b/vcl/inc/ios/salvd.h new file mode 100644 index 000000000000..e116c5c45bab --- /dev/null +++ b/vcl/inc/ios/salvd.h @@ -0,0 +1,79 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 _SV_SALVD_H +#define _SV_SALVD_H + +#include "ios/salcolorutils.hxx" +#include "ios/salgdi.h" + +#include "salvd.hxx" + +#if PRAGMA_ONCE + #pragma once +#endif + +struct SalVirDevData +{ +}; + +typedef struct SalVirDevData SalVirDevData; +typedef SalVirDevData *SalVirDevDataPtr; +typedef SalVirDevDataPtr *SalVirDevDataHandle; + +// ======================================================================= + +class IosSalGraphics; + +class IosSalVirtualDevice : public SalVirtualDevice +{ +private: + bool mbGraphicsUsed; // is Graphics used + bool mbForeignContext; // is mxContext from outside VCL + CGContextRef mxBitmapContext; + int mnBitmapDepth; + CGLayerRef mxLayer; // Quartz layer + IosSalGraphics* mpGraphics; // current VirDev graphics + + void Destroy(); + +public: + IosSalVirtualDevice( IosSalGraphics* pGraphic, long nDX, long nDY, sal_uInt16 nBitCount, const SystemGraphicsData *pData ); + virtual ~IosSalVirtualDevice(); + + virtual SalGraphics* GetGraphics(); + virtual void ReleaseGraphics( SalGraphics* pGraphics ); + virtual sal_Bool SetSize( long nNewDX, long nNewDY ); + virtual void GetSize( long& rWidth, long& rHeight ); +}; + +// ======================================================================= + +#endif // _SV_SALVD_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/vcluiapp.h b/vcl/inc/ios/vcluiapp.h new file mode 100644 index 000000000000..df4a01ead0de --- /dev/null +++ b/vcl/inc/ios/vcluiapp.h @@ -0,0 +1,53 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 _VCL_VCLUIAPP_H +#define _VCL_VCLUIAPP_H + +#include "premac.h" +#include "UIKit/UIKit.h" +#include "postmac.h" + +class IosSalFrame; + +// our very own application +@interface VCL_UIApplication : UIApplication +{ +} +-(void)sendEvent:(UIEvent*)pEvent; +-(void)sendSuperEvent:(UIEvent*)pEvent; +-(BOOL)application: (UIApplication*) app openFile: (NSString*)file; +-(void)application: (UIApplication*) app openFiles: (NSArray*)files; +-(void)applicationWillTerminate: (UIApplication *) app; +-(void)addFallbackMenuItem: (UIMenuItem*)pNewItem; +-(void)removeFallbackMenuItem: (UIMenuItem*)pOldItem; +@end + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/vcl/bitmap.hxx b/vcl/inc/vcl/bitmap.hxx index e25bb482f53c..a6ff3129fada 100644 --- a/vcl/inc/vcl/bitmap.hxx +++ b/vcl/inc/vcl/bitmap.hxx @@ -234,7 +234,7 @@ struct BitmapSystemData #if defined( WNT ) void* pDIB; // device independent byte buffer void* pDDB; // if not NULL then this is actually an HBITMAP - #elif defined( QUARTZ ) + #elif defined( QUARTZ ) || defined( IOS ) void* rImageContext; //Image context (CGContextRef) #else void* aPixmap; diff --git a/vcl/inc/vcl/sysdata.hxx b/vcl/inc/vcl/sysdata.hxx index cab614841e1d..b5daf28e579d 100644 --- a/vcl/inc/vcl/sysdata.hxx +++ b/vcl/inc/vcl/sysdata.hxx @@ -41,6 +41,18 @@ typedef struct CGLayer *CGLayerRef; class NSView; #endif #endif + +#ifdef IOS +typedef struct CGFont *CGFontRef; +typedef struct CGContext *CGContextRef; +typedef struct CGLayer *CGLayerRef; +#ifdef __OBJC__ +@class UIView; +#else +class UIView; +#endif +#endif + #if defined( WNT ) #include #endif @@ -56,6 +68,8 @@ struct SystemEnvData HWND hWnd; // the window hwnd #elif defined( QUARTZ ) NSView* pView; // the cocoa (NSView *) implementing this object +#elif defined( IOS ) + UIView* pView; // the CocoaTouch (UIView *) implementing this object #elif defined( UNX ) void* pDisplay; // the relevant display connection long aWindow; // the window of the object @@ -84,6 +98,8 @@ struct SystemParentData HWND hWnd; // the window hwnd #elif defined( QUARTZ ) NSView* pView; // the cocoa (NSView *) implementing this object +#elif defined( IOS ) + UIView* pView; // the CocoaTouch (UIView *) implementing this object #elif defined( UNX ) long aWindow; // the window of the object bool bXEmbedSupport:1; // decides whether the object in question @@ -116,8 +132,8 @@ struct SystemGraphicsData unsigned long nSize; // size in bytes of this structure #if defined( WNT ) HDC hDC; // handle to a device context -#elif defined( QUARTZ ) - CGContextRef rCGContext; // QUARTZ graphic context +#elif defined( QUARTZ ) || defined( IOS ) + CGContextRef rCGContext; // CoreGraphics graphic context #elif defined( UNX ) void* pDisplay; // the relevant display connection long hDrawable; // a drawable @@ -139,6 +155,7 @@ struct SystemWindowData unsigned long nSize; // size in bytes of this structure #if defined( WNT ) // meaningless on Windows #elif defined( QUARTZ ) // meaningless on Mac OS X / Quartz +#elif defined( IOS ) // and maybe on iOS, too, then #elif defined( UNX ) void* pVisual; // the visual to be used #endif @@ -169,6 +186,8 @@ struct SystemFontData HFONT hFont; // native font object #elif defined( QUARTZ ) void* aATSUFontID; // native font object +#elif defined( IOS ) + CGFontRef rFont; // native font object #elif defined( UNX ) void* nFontId; // native font id int nFontFlags; // native font flags diff --git a/vcl/ios/source/app/saldata.cxx b/vcl/ios/source/app/saldata.cxx new file mode 100644 index 000000000000..f292b6fae585 --- /dev/null +++ b/vcl/ios/source/app/saldata.cxx @@ -0,0 +1,128 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 "ios/saldata.hxx" +#include "ios/saluimenu.h" +#include "ios/salinst.h" + +oslThreadKey SalData::s_aAutoReleaseKey = 0; + +static void SAL_CALL releasePool( void* pPool ) +{ + if( pPool ) + [(NSAutoreleasePool*)pPool release]; +} + +SalData::SalData() +: + mpTimerProc( NULL ), + mpFirstInstance( NULL ), + mpFirstObject( NULL ), + mpFirstVD( NULL ), + mpFirstPrinter( NULL ), + mpFontList( NULL ), + mxRGBSpace( CGColorSpaceCreateDeviceRGB( ) ), + mxGraySpace( CGColorSpaceCreateDeviceGray( ) ), + mxP50Space( NULL ), + mxP50Pattern( NULL ), + mnSystemVersion( VER_TIGER ), + mnDPIX( 0 ), + mnDPIY( 0 ) +{ + if( s_aAutoReleaseKey == 0 ) + s_aAutoReleaseKey = osl_createThreadKey( releasePool ); +} + +SalData::~SalData() +{ + CGPatternRelease( mxP50Pattern ); + CGColorSpaceRelease( mxP50Space ); + CGColorSpaceRelease( mxRGBSpace ); + CGColorSpaceRelease( mxGraySpace ); + if( s_aAutoReleaseKey ) + { + // release the last pool + NSAutoreleasePool* pPool = nil; + pPool = reinterpret_cast( osl_getThreadKeyData( s_aAutoReleaseKey ) ); + if( pPool ) + { + osl_setThreadKeyData( s_aAutoReleaseKey, NULL ); + [pPool release]; + } + + osl_destroyThreadKey( s_aAutoReleaseKey ); + s_aAutoReleaseKey = 0; + } +} + +void SalData::ensureThreadAutoreleasePool() +{ + NSAutoreleasePool* pPool = nil; + if( s_aAutoReleaseKey ) + { + pPool = reinterpret_cast( osl_getThreadKeyData( s_aAutoReleaseKey ) ); + if( ! pPool ) + { + pPool = [[NSAutoreleasePool alloc] init]; + osl_setThreadKeyData( s_aAutoReleaseKey, pPool ); + } + } + else + { + OSL_FAIL( "no autorelease key" ); + } +} + +void SalData::drainThreadAutoreleasePool() +{ + NSAutoreleasePool* pPool = nil; + if( s_aAutoReleaseKey ) + { + pPool = reinterpret_cast( osl_getThreadKeyData( s_aAutoReleaseKey ) ); + if( pPool ) + { + // osl_setThreadKeyData( s_aAutoReleaseKey, NULL ); + // [pPool release]; + [pPool drain]; + } + else + { + pPool = [[NSAutoreleasePool alloc] init]; + osl_setThreadKeyData( s_aAutoReleaseKey, pPool ); + } + } + else + { + OSL_FAIL( "no autorelease key" ); + } +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/ios/source/app/salinst.cxx b/vcl/ios/source/app/salinst.cxx new file mode 100644 index 000000000000..b4c944cd31a4 --- /dev/null +++ b/vcl/ios/source/app/salinst.cxx @@ -0,0 +1,828 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 "tools/fsys.hxx" +#include "tools/getprocessworkingdir.hxx" +#include + +#include "osl/process.h" + +#include "rtl/ustrbuf.hxx" + +#include "vcl/svapp.hxx" +#include "vcl/window.hxx" +#include "vcl/timer.hxx" +#include "vcl/solarmutex.hxx" + +#include "ios/saldata.hxx" +#include "ios/salinst.h" +#include "ios/salframe.h" +#include "ios/salobj.h" +#include "ios/salsys.h" +#include "ios/salvd.h" +#include "ios/salbmp.h" +#include "ios/salprn.h" +#include "ios/saltimer.h" +#include "ios/vcluiapp.h" + +#include "print.h" +#include "impbmp.hxx" +#include "salimestatus.hxx" + +#include + +#include +#include +#include +#include +#include + +using namespace std; +using namespace ::com::sun::star; + +extern sal_Bool ImplSVMain(); + +static int* gpnInit = 0; +static bool bNoSVMain = true; +static bool bLeftMain = false; +// ----------------------------------------------------------------------- + +class IosDelayedSettingsChanged : public Timer +{ + bool mbInvalidate; + public: + IosDelayedSettingsChanged( bool bInvalidate ) : + mbInvalidate( bInvalidate ) + { + } + + virtual void Timeout() + { + SalData* pSalData = GetSalData(); + if( ! pSalData->maFrames.empty() ) + pSalData->maFrames.front()->CallCallback( SALEVENT_SETTINGSCHANGED, NULL ); + + if( mbInvalidate ) + { + for( std::list< IosSalFrame* >::iterator it = pSalData->maFrames.begin(); + it != pSalData->maFrames.end(); ++it ) + { + if( (*it)->mbShown ) + (*it)->SendPaintEvent( NULL ); + } + } + Stop(); + delete this; + } +}; + +void IosSalInstance::delayedSettingsChanged( bool bInvalidate ) +{ + osl::SolarGuard aGuard( *mpSalYieldMutex ); + IosDelayedSettingsChanged* pTimer = new IosDelayedSettingsChanged( bInvalidate ); + pTimer->SetTimeout( 50 ); + pTimer->Start(); +} + + +// the AppEventList must be available before any SalData/SalInst/etc. objects are ready +typedef std::list AppEventList; +AppEventList IosSalInstance::aAppEventList; + +// initialize the VCL_UIApplication object +static void initUIApp() +{ + [VCL_UIApplication sharedApplication]; + + SalData::ensureThreadAutoreleasePool(); +} + +sal_Bool ImplSVMainHook( int * pnInit ) +{ + gpnInit = pnInit; + + bNoSVMain = false; + initUIApp(); + + char* pArgv[] = { "main", NULL }; + UIApplicationMain( 1, pArgv, NULL, NULL ); + + return TRUE; // indicate that ImplSVMainHook is implemented +} + +// ======================================================================= + +void SalAbort( const XubString& rErrorText ) +{ + if( !rErrorText.Len() ) + fprintf( stderr, "Application Error " ); + else + fprintf( stderr, "%s ", + ByteString( rErrorText, gsl_getSystemTextEncoding() ).GetBuffer() ); + abort(); +} + +// ----------------------------------------------------------------------- + +void InitSalData() +{ + SalData *pSalData = new SalData; + SetSalData( pSalData ); +} + +// ----------------------------------------------------------------------- + +const ::rtl::OUString& SalGetDesktopEnvironment() +{ + static OUString aDesktopEnvironment(RTL_CONSTASCII_USTRINGPARAM( "CocoaTouch" )); + return aDesktopEnvironment; +} + +// ----------------------------------------------------------------------- + +void DeInitSalData() +{ + SalData *pSalData = GetSalData(); + delete pSalData; + SetSalData( NULL ); +} + +// ----------------------------------------------------------------------- + +void InitSalMain() +{ + rtl::OUString urlWorkDir; + rtl_uString *sysWorkDir = NULL; + if (tools::getProcessWorkingDir(urlWorkDir)) + { + oslFileError err2 = osl_getSystemPathFromFileURL(urlWorkDir.pData, &sysWorkDir); + if (err2 == osl_File_E_None) + { + ByteString aPath( getenv( "PATH" ) ); + ByteString aResPath( getenv( "STAR_RESOURCEPATH" ) ); + ByteString aCmdPath( OUStringToOString(OUString(sysWorkDir), RTL_TEXTENCODING_UTF8).getStr() ); + ByteString aTmpPath; + // Get absolute path of command's directory + if ( aCmdPath.Len() ) { + DirEntry aCmdDirEntry( aCmdPath ); + aCmdDirEntry.ToAbs(); + aCmdPath = ByteString( aCmdDirEntry.GetPath().GetFull(), RTL_TEXTENCODING_ASCII_US ); + } + // Assign to PATH environment variable + if ( aCmdPath.Len() ) + { + aTmpPath = ByteString( "PATH=" ); + aTmpPath += aCmdPath; + if ( aPath.Len() ) + aTmpPath += ByteString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US ); + aTmpPath += aPath; + putenv( (char*)aTmpPath.GetBuffer() ); + } + // Assign to STAR_RESOURCEPATH environment variable + if ( aCmdPath.Len() ) + { + aTmpPath = ByteString( "STAR_RESOURCEPATH=" ); + aTmpPath += aCmdPath; + if ( aResPath.Len() ) + aTmpPath += ByteString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US ); + aTmpPath += aResPath; + putenv( (char*)aTmpPath.GetBuffer() ); + } + } + } +} + +// ----------------------------------------------------------------------- + +void DeInitSalMain() +{ +} + +// ======================================================================= + +SalYieldMutex::SalYieldMutex() +{ + mnCount = 0; + mnThreadId = 0; +} + +void SalYieldMutex::acquire() +{ + SolarMutexObject::acquire(); + mnThreadId = osl::Thread::getCurrentIdentifier(); + mnCount++; +} + +void SalYieldMutex::release() +{ + if ( mnThreadId == osl::Thread::getCurrentIdentifier() ) + { + if ( mnCount == 1 ) + mnThreadId = 0; + mnCount--; + } + SolarMutexObject::release(); +} + +sal_Bool SalYieldMutex::tryToAcquire() +{ + if ( SolarMutexObject::tryToAcquire() ) + { + mnThreadId = osl::Thread::getCurrentIdentifier(); + mnCount++; + return sal_True; + } + else + return sal_False; +} + +// ----------------------------------------------------------------------- + +// some convenience functions regarding the yield mutex, aka solar mutex + +sal_Bool ImplSalYieldMutexTryToAcquire() +{ + IosSalInstance* pInst = (IosSalInstance*) GetSalData()->mpFirstInstance; + if ( pInst ) + return pInst->mpSalYieldMutex->tryToAcquire(); + else + return FALSE; +} + +void ImplSalYieldMutexAcquire() +{ + IosSalInstance* pInst = (IosSalInstance*) GetSalData()->mpFirstInstance; + if ( pInst ) + pInst->mpSalYieldMutex->acquire(); +} + +void ImplSalYieldMutexRelease() +{ + IosSalInstance* pInst = (IosSalInstance*) GetSalData()->mpFirstInstance; + if ( pInst ) + pInst->mpSalYieldMutex->release(); +} + +// ======================================================================= + +SalInstance* CreateSalInstance() +{ + // this is the case for not using SVMain + // not so good + if( bNoSVMain ) + initUIApp(); + + SalData* pSalData = GetSalData(); + DBG_ASSERT( pSalData->mpFirstInstance == NULL, "more than one instance created" ); + IosSalInstance* pInst = new IosSalInstance; + + // init instance (only one instance in this version !!!) + pSalData->mpFirstInstance = pInst; + // this one is for outside IosSalInstance::Yield + SalData::ensureThreadAutoreleasePool(); + // no focus rects on NWF ios + ImplGetSVData()->maNWFData.mbNoFocusRects = true; + ImplGetSVData()->maNWFData.mbNoBoldTabFocus = true; + ImplGetSVData()->maNWFData.mbNoActiveTabTextRaise = true; + ImplGetSVData()->maNWFData.mbCenteredTabs = true; + ImplGetSVData()->maNWFData.mbProgressNeedsErase = true; + ImplGetSVData()->maNWFData.mbCheckBoxNeedsErase = true; + ImplGetSVData()->maNWFData.mnStatusBarLowerRightOffset = 10; + ImplGetSVData()->maGDIData.mbNoXORClipping = true; + ImplGetSVData()->maWinData.mbNoSaveBackground = true; + + return pInst; +} + +// ----------------------------------------------------------------------- + +void DestroySalInstance( SalInstance* pInst ) +{ + delete pInst; +} + +// ----------------------------------------------------------------------- + +IosSalInstance::IosSalInstance() +{ + mpSalYieldMutex = new SalYieldMutex; + mpSalYieldMutex->acquire(); + ::tools::SolarMutex::SetSolarMutex( mpSalYieldMutex ); + maMainThread = osl::Thread::getCurrentIdentifier(); + mbWaitingYield = false; + maUserEventListMutex = osl_createMutex(); + mnActivePrintJobs = 0; + maWaitingYieldCond = osl_createCondition(); +} + +// ----------------------------------------------------------------------- + +IosSalInstance::~IosSalInstance() +{ + ::tools::SolarMutex::SetSolarMutex( 0 ); + mpSalYieldMutex->release(); + delete mpSalYieldMutex; + osl_destroyMutex( maUserEventListMutex ); + osl_destroyCondition( maWaitingYieldCond ); +} + +// ----------------------------------------------------------------------- + +void IosSalInstance::wakeupYield() +{ +} + +// ----------------------------------------------------------------------- + +void IosSalInstance::PostUserEvent( IosSalFrame* pFrame, sal_uInt16 nType, void* pData ) +{ + osl_acquireMutex( maUserEventListMutex ); + maUserEvents.push_back( SalUserEvent( pFrame, pData, nType ) ); + osl_releaseMutex( maUserEventListMutex ); + + // notify main loop that an event has arrived + wakeupYield(); +} + +// ----------------------------------------------------------------------- + +osl::SolarMutex* IosSalInstance::GetYieldMutex() +{ + return mpSalYieldMutex; +} + +// ----------------------------------------------------------------------- + +sal_uLong IosSalInstance::ReleaseYieldMutex() +{ + SalYieldMutex* pYieldMutex = mpSalYieldMutex; + if ( pYieldMutex->GetThreadId() == + osl::Thread::getCurrentIdentifier() ) + { + sal_uLong nCount = pYieldMutex->GetAcquireCount(); + sal_uLong n = nCount; + while ( n ) + { + pYieldMutex->release(); + n--; + } + + return nCount; + } + else + return 0; +} + +// ----------------------------------------------------------------------- + +void IosSalInstance::AcquireYieldMutex( sal_uLong nCount ) +{ + SalYieldMutex* pYieldMutex = mpSalYieldMutex; + while ( nCount ) + { + pYieldMutex->acquire(); + nCount--; + } +} + +// ----------------------------------------------------------------------- + +bool IosSalInstance::CheckYieldMutex() +{ + bool bRet = true; + + SalYieldMutex* pYieldMutex = mpSalYieldMutex; + if ( pYieldMutex->GetThreadId() != osl::Thread::getCurrentIdentifier()) + { + bRet = false; + } + + return bRet; +} + +// ----------------------------------------------------------------------- + +bool IosSalInstance::isUIAppThread() const +{ + return osl::Thread::getCurrentIdentifier() == maMainThread; +} + +// ----------------------------------------------------------------------- + +class ReleasePoolHolder +{ + NSAutoreleasePool* mpPool; + public: + ReleasePoolHolder() : mpPool( [[NSAutoreleasePool alloc] init] ) {} + ~ReleasePoolHolder() { [mpPool release]; } +}; + +void IosSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents ) +{ + // ensure that the per thread autorelease pool is top level and + // will therefore not be destroyed by cocoa implicitly + SalData::ensureThreadAutoreleasePool(); + + // NSAutoreleasePool documentation suggests we should have + // an own pool for each yield level + ReleasePoolHolder aReleasePool; + + // Release all locks so that we don't deadlock when we pull pending + // events from the event queue + bool bDispatchUser = true; + while( bDispatchUser ) + { + sal_uLong nCount = ReleaseYieldMutex(); + + // get one user event + osl_acquireMutex( maUserEventListMutex ); + SalUserEvent aEvent( NULL, NULL, 0 ); + if( ! maUserEvents.empty() ) + { + aEvent = maUserEvents.front(); + maUserEvents.pop_front(); + } + else + bDispatchUser = false; + osl_releaseMutex( maUserEventListMutex ); + + AcquireYieldMutex( nCount ); + + // dispatch it + if( aEvent.mpFrame && IosSalFrame::isAlive( aEvent.mpFrame ) ) + { + aEvent.mpFrame->CallCallback( aEvent.mnType, aEvent.mpData ); + osl_setCondition( maWaitingYieldCond ); + // return if only one event is asked for + if( ! bHandleAllCurrentEvents ) + return; + } + } + + // handle event queue + // events mye be only handled in the thread the app was created + if( mnActivePrintJobs == 0 ) + { + // we need to be woken up by a cocoa-event + // if a user event should be posted by the event handling below + bool bOldWaitingYield = mbWaitingYield; + mbWaitingYield = bWait; + + mbWaitingYield = bOldWaitingYield; + + // collect update rectangles + const std::list< IosSalFrame* > rFrames( GetSalData()->maFrames ); + for( std::list< IosSalFrame* >::const_iterator it = rFrames.begin(); it != rFrames.end(); ++it ) + { + if( (*it)->mbShown && ! (*it)->maInvalidRect.IsEmpty() ) + { + (*it)->Flush( (*it)->maInvalidRect ); + (*it)->maInvalidRect.SetEmpty(); + } + } + osl_setCondition( maWaitingYieldCond ); + } +} + +// ----------------------------------------------------------------------- + +bool IosSalInstance::AnyInput( sal_uInt16 nType ) +{ + if( nType & INPUT_APPEVENT ) + { + if( ! aAppEventList.empty() ) + return true; + if( nType == INPUT_APPEVENT ) + return false; + } + + if( nType & INPUT_TIMER ) + { + if( IosSalTimer::pRunningTimer ) + { + NSDate* pDt = [IosSalTimer::pRunningTimer fireDate]; + if( pDt && [pDt timeIntervalSinceNow] < 0 ) + { + return true; + } + } + } + return false; +} + +// ----------------------------------------------------------------------- + +SalFrame* IosSalInstance::CreateChildFrame( SystemParentData*, sal_uLong /*nSalFrameStyle*/ ) +{ + return NULL; +} + +// ----------------------------------------------------------------------- + +SalFrame* IosSalInstance::CreateFrame( SalFrame* pParent, sal_uLong nSalFrameStyle ) +{ + SalData::ensureThreadAutoreleasePool(); + + SalFrame* pFrame = new IosSalFrame( pParent, nSalFrameStyle ); + return pFrame; +} + +// ----------------------------------------------------------------------- + +void IosSalInstance::DestroyFrame( SalFrame* pFrame ) +{ + delete pFrame; +} + +// ----------------------------------------------------------------------- + +SalObject* IosSalInstance::CreateObject( SalFrame* pParent, SystemWindowData* /* pWindowData */, sal_Bool /* bShow */ ) +{ + // SystemWindowData is meaningless on Mac OS X + IosSalObject *pObject = NULL; + + if ( pParent ) + pObject = new IosSalObject( static_cast(pParent) ); + + return pObject; +} + +// ----------------------------------------------------------------------- + +void IosSalInstance::DestroyObject( SalObject* pObject ) +{ + delete ( pObject ); +} + +SalSystem* IosSalInstance::CreateSystem() +{ + return new IosSalSystem(); +} + +// ----------------------------------------------------------------------- + +void IosSalInstance::DestroySystem( SalSystem* pSystem ) +{ + delete pSystem; +} + +// ----------------------------------------------------------------------- + +void IosSalInstance::SetEventCallback( void*, bool(*)(void*,void*,int) ) +{ +} + +// ----------------------------------------------------------------------- + +void IosSalInstance::SetErrorEventCallback( void*, bool(*)(void*,void*,int) ) +{ +} + +// ----------------------------------------------------------------------- + +void* IosSalInstance::GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ) +{ + rReturnedBytes = 1; + rReturnedType = AsciiCString; + return (void*)""; +} + +// We need to re-encode file urls because osl_getFileURLFromSystemPath converts +// to UTF-8 before encoding non ascii characters, which is not what other apps expect. +static rtl::OUString translateToExternalUrl(const rtl::OUString& internalUrl) +{ + rtl::OUString extUrl; + + uno::Reference< lang::XMultiServiceFactory > sm = comphelper::getProcessServiceFactory(); + if (sm.is()) + { + uno::Reference< beans::XPropertySet > pset; + sm->queryInterface( getCppuType( &pset )) >>= pset; + if (pset.is()) + { + uno::Reference< uno::XComponentContext > context; + static const rtl::OUString DEFAULT_CONTEXT( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ); + pset->getPropertyValue(DEFAULT_CONTEXT) >>= context; + if (context.is()) + extUrl = uri::ExternalUriReferenceTranslator::create(context)->translateToExternal(internalUrl); + } + } + return extUrl; +} + +// #i104525# many versions of OSX have problems with some URLs: +// when an app requests OSX to add one of these URLs to the "Recent Items" list +// then this app gets killed (TextEdit, Preview, etc. and also OOo) +static bool isDangerousUrl( const rtl::OUString& rUrl ) +{ + // use a heuristic that detects all known cases since there is no official comment + // on the exact impact and root cause of the OSX bug + const int nLen = rUrl.getLength(); + const sal_Unicode* p = rUrl.getStr(); + for( int i = 0; i < nLen-3; ++i, ++p ) { + if( p[0] != '%' ) + continue; + // escaped percent? + if( (p[1] == '2') && (p[2] == '5') ) + return true; + // escapes are considered to be UTF-8 encoded + // => check for invalid UTF-8 leading byte + if( (p[1] != 'f') && (p[1] != 'F') ) + continue; + int cLowNibble = p[2]; + if( (cLowNibble >= '0' ) && (cLowNibble <= '9')) + return false; + if( cLowNibble >= 'a' ) + cLowNibble -= 'a' - 'A'; + if( (cLowNibble < 'A') || (cLowNibble >= 'C')) + return true; + } + + return false; +} + +void IosSalInstance::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& /*rMimeType*/) +{ +} + +// ----------------------------------------------------------------------- + +SalTimer* IosSalInstance::CreateSalTimer() +{ + return new IosSalTimer(); +} + +// ----------------------------------------------------------------------- + +SalSystem* IosSalInstance::CreateSalSystem() +{ + return new IosSalSystem(); +} + +// ----------------------------------------------------------------------- + +SalBitmap* IosSalInstance::CreateSalBitmap() +{ + return new IosSalBitmap(); +} + +// ----------------------------------------------------------------------- + +SalSession* IosSalInstance::CreateSalSession() +{ + return NULL; +} + +// ----------------------------------------------------------------------- + +// YieldMutexReleaser +YieldMutexReleaser::YieldMutexReleaser() : mnCount( 0 ) +{ + SalData* pSalData = GetSalData(); + if( ! pSalData->mpFirstInstance->isUIAppThread() ) + { + SalData::ensureThreadAutoreleasePool(); + mnCount = pSalData->mpFirstInstance->ReleaseYieldMutex(); + } +} + +YieldMutexReleaser::~YieldMutexReleaser() +{ + if( mnCount != 0 ) + GetSalData()->mpFirstInstance->AcquireYieldMutex( mnCount ); +} + +////////////////////////////////////////////////////////////// +rtl::OUString GetOUString( CFStringRef rStr ) +{ + if( rStr == 0 ) + return rtl::OUString(); + CFIndex nLength = CFStringGetLength( rStr ); + if( nLength == 0 ) + return rtl::OUString(); + const UniChar* pConstStr = CFStringGetCharactersPtr( rStr ); + if( pConstStr ) + return rtl::OUString( pConstStr, nLength ); + UniChar* pStr = reinterpret_cast( rtl_allocateMemory( sizeof(UniChar)*nLength ) ); + CFRange aRange = { 0, nLength }; + CFStringGetCharacters( rStr, aRange, pStr ); + rtl::OUString aRet( pStr, nLength ); + rtl_freeMemory( pStr ); + return aRet; +} + +rtl::OUString GetOUString( NSString* pStr ) +{ + if( ! pStr ) + return rtl::OUString(); + int nLen = [pStr length]; + if( nLen == 0 ) + return rtl::OUString(); + + rtl::OUStringBuffer aBuf( nLen+1 ); + aBuf.setLength( nLen ); + [pStr getCharacters: const_cast(aBuf.getStr())]; + return aBuf.makeStringAndClear(); +} + +CFStringRef CreateCFString( const rtl::OUString& rStr ) +{ + return CFStringCreateWithCharacters(kCFAllocatorDefault, rStr.getStr(), rStr.getLength() ); +} + +NSString* CreateNSString( const rtl::OUString& rStr ) +{ + return [[NSString alloc] initWithCharacters: rStr.getStr() length: rStr.getLength()]; +} + +CGImageRef CreateCGImage( const Image& rImage ) +{ + BitmapEx aBmpEx( rImage.GetBitmapEx() ); + Bitmap aBmp( aBmpEx.GetBitmap() ); + + if( ! aBmp || ! aBmp.ImplGetImpBitmap() ) + return NULL; + + // simple case, no transparency + IosSalBitmap* pSalBmp = static_cast(aBmp.ImplGetImpBitmap()->ImplGetSalBitmap()); + + if( ! pSalBmp ) + return NULL; + + CGImageRef xImage = NULL; + if( ! (aBmpEx.IsAlpha() || aBmpEx.IsTransparent() ) ) + xImage = pSalBmp->CreateCroppedImage( 0, 0, pSalBmp->mnWidth, pSalBmp->mnHeight ); + else if( aBmpEx.IsAlpha() ) + { + AlphaMask aAlphaMask( aBmpEx.GetAlpha() ); + Bitmap aMask( aAlphaMask.GetBitmap() ); + IosSalBitmap* pMaskBmp = static_cast(aMask.ImplGetImpBitmap()->ImplGetSalBitmap()); + if( pMaskBmp ) + xImage = pSalBmp->CreateWithMask( *pMaskBmp, 0, 0, pSalBmp->mnWidth, pSalBmp->mnHeight ); + else + xImage = pSalBmp->CreateCroppedImage( 0, 0, pSalBmp->mnWidth, pSalBmp->mnHeight ); + } + else if( aBmpEx.GetTransparentType() == TRANSPARENT_BITMAP ) + { + Bitmap aMask( aBmpEx.GetMask() ); + IosSalBitmap* pMaskBmp = static_cast(aMask.ImplGetImpBitmap()->ImplGetSalBitmap()); + if( pMaskBmp ) + xImage = pSalBmp->CreateWithMask( *pMaskBmp, 0, 0, pSalBmp->mnWidth, pSalBmp->mnHeight ); + else + xImage = pSalBmp->CreateCroppedImage( 0, 0, pSalBmp->mnWidth, pSalBmp->mnHeight ); + } + else if( aBmpEx.GetTransparentType() == TRANSPARENT_COLOR ) + { + Color aTransColor( aBmpEx.GetTransparentColor() ); + SalColor nTransColor = MAKE_SALCOLOR( aTransColor.GetRed(), aTransColor.GetGreen(), aTransColor.GetBlue() ); + xImage = pSalBmp->CreateColorMask( 0, 0, pSalBmp->mnWidth, pSalBmp->mnHeight, nTransColor ); + } + + return xImage; +} + +UIImage* CreateNSImage( const Image& rImage ) +{ + CGImageRef xImage = CreateCGImage( rImage ); + + if( ! xImage ) + return nil; + + Size aSize( rImage.GetSizePixel() ); + UIImage* pImage = [[UIImage alloc] initWithCGImage: xImage]; + CGImageRelease( xImage ); + + return pImage; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/ios/source/app/salnstimer.mm b/vcl/ios/source/app/salnstimer.mm new file mode 100644 index 000000000000..05445110d8ba --- /dev/null +++ b/vcl/ios/source/app/salnstimer.mm @@ -0,0 +1,59 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 "ios/saltimer.h" +#include "ios/salnstimer.h" +#include "ios/salinst.h" +#include "ios/saldata.hxx" + +#include "svdata.hxx" + +@implementation TimerCallbackCaller +-(void)timerElapsed:(NSTimer*)pTimer +{ + (void)pTimer; + ImplSVData* pSVData = ImplGetSVData(); + if( IosSalTimer::bDispatchTimer ) + { + if( pSVData->mpSalTimer ) + { + YIELD_GUARD; + pSVData->mpSalTimer->CallCallback(); + + // NSTimer does not end nextEventMatchingMask of NSApplication + // so we need to wakeup a waiting Yield to inform it something happened + GetSalData()->mpFirstInstance->wakeupYield(); + } + } +} +@end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/ios/source/app/salsys.cxx b/vcl/ios/source/app/salsys.cxx new file mode 100644 index 000000000000..1baf357d85a9 --- /dev/null +++ b/vcl/ios/source/app/salsys.cxx @@ -0,0 +1,253 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 "tools/rc.hxx" + +#include "rtl/ustrbuf.hxx" + +#include "vcl/button.hxx" + +#include "ios/salsys.h" +#include "ios/saldata.hxx" +#include "ios/salinst.h" + +#include "svids.hrc" + +using ::rtl::OUString; + +// ======================================================================= + +IosSalSystem::~IosSalSystem() +{ +} + +unsigned int IosSalSystem::GetDisplayScreenCount() +{ + NSArray* pScreens = [UIScreen screens]; + return pScreens ? [pScreens count] : 1; +} + +bool IosSalSystem::IsMultiDisplay() +{ + return false; +} + +unsigned int IosSalSystem::GetDefaultDisplayNumber() +{ + return 0; +} + +Rectangle IosSalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen ) +{ + NSArray* pScreens = [UIScreen screens]; + Rectangle aRet; + UIScreen* pScreen = nil; + if( pScreens && nScreen < [pScreens count] ) + pScreen = [pScreens objectAtIndex: nScreen]; + else + pScreen = [UIScreen mainScreen]; + + if( pScreen ) + { + CGRect aFrame = pScreen.bounds; + aRet = Rectangle( Point( static_cast(aFrame.origin.x), static_cast(aFrame.origin.y) ), + Size( static_cast(aFrame.size.width), static_cast(aFrame.size.height) ) ); + } + return aRet; +} + +Rectangle IosSalSystem::GetDisplayWorkAreaPosSizePixel( unsigned int nScreen ) +{ + NSArray* pScreens = [UIScreen screens]; + Rectangle aRet; + UIScreen* pScreen = nil; + if( pScreens && nScreen < [pScreens count] ) + pScreen = [pScreens objectAtIndex: nScreen]; + else + pScreen = [UIScreen mainScreen]; + + if( pScreen ) + { + CGRect aFrame = pScreen.applicationFrame; + aRet = Rectangle( Point( static_cast(aFrame.origin.x), static_cast(aFrame.origin.y) ), + Size( static_cast(aFrame.size.width), static_cast(aFrame.size.height) ) ); + } + return aRet; +} + +rtl::OUString IosSalSystem::GetScreenName( unsigned int nScreen ) +{ + NSArray* pScreens = [UIScreen screens]; + OUString aRet; + if( nScreen < [pScreens count] ) + { + ResMgr* pMgr = ImplGetResMgr(); + if( pMgr ) + { + String aScreenName( ResId( SV_MAC_SCREENNNAME, *pMgr ) ); + aScreenName.SearchAndReplaceAllAscii( "%d", String::CreateFromInt32( nScreen ) ); + aRet = aScreenName; + } + } + return aRet; +} + +static NSString* getStandardString( int nButtonId ) +{ + rtl::OUString aText( Button::GetStandardText( nButtonId ) ); + if( ! aText.getLength() ) // this is for bad cases, we might be missing the vcl resource + { + switch( nButtonId ) + { + case BUTTON_OK: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OK" ) );break; + case BUTTON_ABORT: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Abort" ) );break; + case BUTTON_CANCEL: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Cancel" ) );break; + case BUTTON_RETRY: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Retry" ) );break; + case BUTTON_YES: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Yes" ) );break; + case BUTTON_NO : aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "No" ) );break; + } + } + return aText.getLength() ? CreateNSString( aText) : nil; +} + +@interface MessageboxDelegate : NSObject +{ + int *_resultPtr; +} +- (id)initWithResultPtr:(int *)resultPtr; +- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex; +@end + +@implementation MessageboxDelegate +- (id)initWithResultPtr:(int *)resultPtr +{ + _resultPtr = resultPtr; + return [super init]; +} + +- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex +{ + *_resultPtr = buttonIndex; +} +@end + +int IosSalSystem::ShowNativeMessageBox( const String& rTitle, + const String& rMessage, + int nButtonCombination, + int nDefaultButton) +{ + NSString* pTitle = CreateNSString( rTitle ); + NSString* pMessage = CreateNSString( rMessage ); + + struct id_entry + { + int nCombination; + int nDefaultButton; + int nTextIds[3]; + } aButtonIds[] = + { + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK, { BUTTON_OK, -1, -1 } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK, { BUTTON_OK, BUTTON_CANCEL, -1 } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, { BUTTON_CANCEL, BUTTON_OK, -1 } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_ABORT_RETRY_IGNORE, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_ABORT, { BUTTON_ABORT, BUTTON_IGNORE, BUTTON_RETRY } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_ABORT_RETRY_IGNORE, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY, { BUTTON_RETRY, BUTTON_IGNORE, BUTTON_ABORT } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_ABORT_RETRY_IGNORE, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_IGNORE, { BUTTON_IGNORE, BUTTON_IGNORE, BUTTON_ABORT } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_YES, { BUTTON_YES, BUTTON_NO, BUTTON_CANCEL } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO, { BUTTON_NO, BUTTON_YES, BUTTON_CANCEL } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, { BUTTON_CANCEL, BUTTON_YES, BUTTON_NO } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_YES, { BUTTON_YES, BUTTON_NO, -1 } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO, { BUTTON_NO, BUTTON_YES, -1 } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_RETRY_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY, { BUTTON_RETRY, BUTTON_CANCEL, -1 } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_RETRY_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, { BUTTON_CANCEL, BUTTON_RETRY, -1 } } + }; + + NSString* pDefText = nil; + NSString* pAltText = nil; + NSString* pOthText = nil; + + unsigned int nC; + for( nC = 0; nC < sizeof(aButtonIds)/sizeof(aButtonIds[0]); nC++ ) + { + if( aButtonIds[nC].nCombination == nButtonCombination ) + { + if( aButtonIds[nC].nDefaultButton == nDefaultButton ) + { + if( aButtonIds[nC].nTextIds[0] != -1 ) + pDefText = getStandardString( aButtonIds[nC].nTextIds[0] ); + if( aButtonIds[nC].nTextIds[1] != -1 ) + pAltText = getStandardString( aButtonIds[nC].nTextIds[1] ); + if( aButtonIds[nC].nTextIds[2] != -1 ) + pOthText = getStandardString( aButtonIds[nC].nTextIds[2] ); + break; + } + } + } + + int nResult = 1; // ??? + // How to do the delegate when this is C++? + MessageboxDelegate *delegate = [[MessageboxDelegate alloc] initWithResultPtr: &nResult]; + UIAlertView *view = [[UIAlertView alloc] initWithTitle: pTitle message: pMessage delegate: delegate + cancelButtonTitle: @"Cancel" otherButtonTitles: nil]; + [view show]; + [view dealloc]; + [delegate dealloc]; + + if( pTitle ) + [pTitle release]; + if( pMessage ) + [pMessage release]; + if( pDefText ) + [pDefText release]; + if( pAltText ) + [pAltText release]; + if( pOthText ) + [pOthText release]; + + int nRet = 0; + if( nC < sizeof(aButtonIds)/sizeof(aButtonIds[0]) && nResult >= 1 && nResult <= 3 ) + { + int nPressed = aButtonIds[nC].nTextIds[nResult-1]; + switch( nPressed ) + { + case BUTTON_NO: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO; break; + case BUTTON_YES: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_YES; break; + case BUTTON_OK: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK; break; + case BUTTON_CANCEL: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL; break; + case BUTTON_ABORT: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_ABORT; break; + case BUTTON_RETRY: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY; break; + case BUTTON_IGNORE: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_IGNORE; break; + } + } + + return nRet; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/ios/source/app/saltimer.cxx b/vcl/ios/source/app/saltimer.cxx new file mode 100644 index 000000000000..69401ea502d7 --- /dev/null +++ b/vcl/ios/source/app/saltimer.cxx @@ -0,0 +1,104 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 "ios/saltimer.h" +#include "ios/salnstimer.h" +#include "ios/saldata.hxx" +#include "ios/salframe.h" +#include "ios/salinst.h" + +// ======================================================================= + +NSTimer* IosSalTimer::pRunningTimer = nil; +bool IosSalTimer::bDispatchTimer = false; + + +void ImplSalStartTimer( sal_uLong nMS ) +{ + SalData* pSalData = GetSalData(); + if( pSalData->mpFirstInstance->isUIAppThread() ) + { + IosSalTimer::bDispatchTimer = true; + NSTimeInterval aTI = double(nMS)/1000.0; + if( IosSalTimer::pRunningTimer != nil ) + { + if( [IosSalTimer::pRunningTimer timeInterval] == aTI ) + // set new fire date + [IosSalTimer::pRunningTimer setFireDate: [NSDate dateWithTimeIntervalSinceNow: aTI]]; + else + { + [IosSalTimer::pRunningTimer invalidate]; + IosSalTimer::pRunningTimer = nil; + } + } + if( IosSalTimer::pRunningTimer == nil ) + { + IosSalTimer::pRunningTimer = [NSTimer scheduledTimerWithTimeInterval: aTI + target: [[[TimerCallbackCaller alloc] init] autorelease] + selector: @selector(timerElapsed:) + userInfo: nil + repeats: YES]; + } + } + else + { + SalData::ensureThreadAutoreleasePool(); + // post an event so we can get into the main thread + // ??? + } +} + +void ImplSalStopTimer() +{ + IosSalTimer::bDispatchTimer = false; +} + +IosSalTimer::IosSalTimer( ) +{ +} + +IosSalTimer::~IosSalTimer() +{ + ImplSalStopTimer(); +} + +void IosSalTimer::Start( sal_uLong nMS ) +{ + ImplSalStartTimer( nMS ); +} + +void IosSalTimer::Stop() +{ + ImplSalStopTimer(); +} + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/ios/source/app/vcluiapp.mm b/vcl/ios/source/app/vcluiapp.mm new file mode 100644 index 000000000000..e40d8a7eb792 --- /dev/null +++ b/vcl/ios/source/app/vcluiapp.mm @@ -0,0 +1,101 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 "rtl/ustrbuf.hxx" + +#include "vcl/window.hxx" +#include "vcl/svapp.hxx" +#include "vcl/cmdevt.hxx" + +#include "ios/vcluiapp.h" +#include "ios/salinst.h" +#include "ios/saldata.hxx" +#include "ios/salframe.h" +#include "ios/salframeview.h" + +#include "impimagetree.hxx" + +@implementation VCL_UIApplication +-(void)sendEvent:(UIEvent*)pEvent +{ + UIEventType eType = [pEvent type]; + [super sendEvent: pEvent]; +} + +-(void)sendSuperEvent:(UIEvent*)pEvent +{ + [super sendEvent: pEvent]; +} + +-(BOOL)application: (UIApplication*)app openFile: (NSString*)pFile +{ + (void)app; + const rtl::OUString aFile( GetOUString( pFile ) ); + return YES; +} + +-(void)application: (UIApplication*) app openFiles: (NSArray*)files +{ + (void)app; + rtl::OUStringBuffer aFileList( 256 ); + + NSEnumerator* it = [files objectEnumerator]; + NSString* pFile = nil; + + while( (pFile = [it nextObject]) != nil ) + { + const rtl::OUString aFile( GetOUString( pFile ) ); + } + + if( aFileList.getLength() ) + { + // we have no back channel here, we have to assume success, in which case + // replyToOpenOrPrint does not need to be called according to documentation + // [app replyToOpenOrPrint: NSApplicationDelegateReplySuccess]; + const ApplicationEvent* pAppEvent = new ApplicationEvent( String(), ApplicationAddress(), + APPEVENT_OPEN_STRING, aFileList.makeStringAndClear() ); + IosSalInstance::aAppEventList.push_back( pAppEvent ); + } +} + +-(void)addFallbackMenuItem: (UIMenuItem*)pNewItem +{ + IosSalMenu::addFallbackMenuItem( pNewItem ); +} + +-(void)removeFallbackMenuItem: (UIMenuItem*)pItem +{ + IosSalMenu::removeFallbackMenuItem( pItem ); +} + +@end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/salmain/salmain.cxx b/vcl/source/salmain/salmain.cxx index 80e853b3b654..0c3adf887023 100644 --- a/vcl/source/salmain/salmain.cxx +++ b/vcl/source/salmain/salmain.cxx @@ -36,7 +36,7 @@ #include "salinst.hxx" -SAL_IMPLEMENT_MAIN() { +SAL_IMPLEMENT_MAIN_WITH_GUI() { tools::extendApplicationEnvironment(); return SVMain(); } diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx index f72decce183e..1de33b56b15b 100644 --- a/vcl/source/window/syschild.cxx +++ b/vcl/source/window/syschild.cxx @@ -250,6 +250,9 @@ sal_IntPtr SystemChildWindow::GetParentWindowHandle( sal_Bool bUseJava ) // FIXME: this is wrong nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->pView ); (void)bUseJava; +#elif defined IOS + // FIXME: this is wrong + nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->pView ); #elif defined UNX if( !bUseJava ) { diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 1ab898011672..1e4157f5fcd3 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -8428,6 +8428,16 @@ uno::Reference< XDragSource > Window::GetDragSource() aDropTargetSN = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.dnd.OleDropTarget")); aDragSourceAL[ 1 ] = makeAny( static_cast( reinterpret_cast(pEnvData->pView) ) ); aDropTargetAL[ 0 ] = makeAny( static_cast( reinterpret_cast(pEnvData->pView) ) ); +#elif defined IOS + /* What does LibreOffice's use of DND concepts mean on + * iOS, huh, is this both inter-app DND (which clearly is + * meaningless), or intra-app? Anyway, use the same code + * as for MacOSX for now, even if meaningless... + */ + aDragSourceSN = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.dnd.OleDragSource")); + aDropTargetSN = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.dnd.OleDropTarget")); + aDragSourceAL[ 1 ] = makeAny( static_cast( reinterpret_cast(pEnvData->pView) ) ); + aDropTargetAL[ 0 ] = makeAny( static_cast( reinterpret_cast(pEnvData->pView) ) ); #elif defined UNX aDropTargetAL.realloc( 3 ); aDragSourceAL.realloc( 3 ); -- cgit v1.2.3 From e5e19089a22a71ea27164e7a9f74fa5a33cfa1f4 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 15 Jul 2011 01:53:13 +0300 Subject: WNTGCC fix --- vcl/Library_vcl.mk | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'vcl') diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 42e57144d5f4..044b067624f5 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -551,10 +551,17 @@ $(eval $(call gb_Library_set_ldflags,vcl,\ endif ifeq ($(OS),WNT) +ifeq ($(COM),MSC) $(eval $(call gb_Library_set_ldflags,vcl,\ $$(LDFLAGS) \ /ENTRY:LibMain@12 \ )) +endif +ifeq ($(COM),GCC) +$(eval $(call gb_Library_set_ldflags,vcl,\ + $$(LDFLAGS) \ +)) +endif $(eval $(call gb_Library_add_linked_libs,vcl,\ advapi32 \ gdi32 \ -- cgit v1.2.3 From 4b282f0eb8e5fa37f23ce3e4cbc5b349aea93925 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 15 Jul 2011 16:00:42 +0300 Subject: Use gb_Library_win32_OLDNAMES No need for the OLDNAMESLIB, we already had gb_Library_win32_OLDNAMES for this purpose. --- vcl/Library_vcl.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vcl') diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 044b067624f5..bf0d1a096ca8 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -571,7 +571,7 @@ $(eval $(call gb_Library_add_linked_libs,vcl,\ mpr \ msimg32 \ msvcrt \ - $(OLDNAMESLIB) \ + $(gb_Library_win32_OLDNAMES) \ ole32 \ shell32 \ user32 \ -- cgit v1.2.3 From 48aa50e1fa9b9c4e819aeaf77c098da52d457ec1 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 15 Jul 2011 16:05:19 +0300 Subject: Just using CAIRO_LIBS in ldflags is not enough --- vcl/Library_vcl.mk | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'vcl') diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index bf0d1a096ca8..19c1c9e7fcf6 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -490,10 +490,24 @@ $(eval $(call gb_Library_set_cxxflags,vcl,\ $$(CAIRO_CFLAGS) \ -DSYSTEM_CAIRO \ )) + +# CAIRO_LIBS contains both -L and -l options. Thes sets LDFLAGS which +# goes early into the linking command line before the object files. So +# on platforms where libraries are searched for symbols undefined at +# that point as they occur on the command line, it is pointless to +# search the cairo library at that point as no references to cairo +# entries have been read from object files yet. $(eval $(call gb_Library_set_ldflags,vcl,\ $$(LDFLAGS) \ $$(CAIRO_LIBS) \ )) + +# Thus we also need to add cairo to the list of linked libs. These go +# after the object files on the linking command line. +$(eval $(call gb_Library_add_linked_libs,vcl,\ + cairo \ +)) + else $(eval $(call gb_Library_add_linked_libs,vcl,\ cairo \ -- cgit v1.2.3 From 4e7a52e48b746d83cef31d79d4be9cd6d3acd660 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Fri, 15 Jul 2011 16:00:21 +0200 Subject: fix uninitialized member --- vcl/source/gdi/gdimtf.cxx | 1 + 1 file changed, 1 insertion(+) (limited to 'vcl') diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index 984386028cdc..30740176d676 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -254,6 +254,7 @@ size_t ImpLabelList::ImplGetLabelPos( const String& rLabelName ) // --------------- GDIMetaFile::GDIMetaFile() : + nCurrentActionElement( 0 ), aPrefSize ( 1, 1 ), pPrev ( NULL ), pNext ( NULL ), -- cgit v1.2.3 From 380971f0789084417470edc5ff1a2ced3e1a53f0 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 15 Jul 2011 17:53:03 +0300 Subject: Adapt for windres, use the actual lower-case file names --- vcl/win/source/src/salsrc.rc | 167 ++++++++++++++++++++++--------------------- 1 file changed, 84 insertions(+), 83 deletions(-) (limited to 'vcl') diff --git a/vcl/win/source/src/salsrc.rc b/vcl/win/source/src/salsrc.rc index 11b967ff475b..147b80fc3e8c 100644 --- a/vcl/win/source/src/salsrc.rc +++ b/vcl/win/source/src/salsrc.rc @@ -1,3 +1,4 @@ +/* -*- Mode: Fundamental; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,94 +29,94 @@ // for WINVER #include -#ifndef _SV_SALIDS_HRC #include -#endif -SAL_RESID_POINTER_NULL CURSOR NULLPTR.CUR +SAL_RESID_POINTER_NULL CURSOR nullptr.cur #if ( WINVER < 0x0400 ) -SAL_RESID_POINTER_HELP CURSOR HELP.CUR +SAL_RESID_POINTER_HELP CURSOR help.cur #endif #ifndef WNT -SAL_RESID_POINTER_HSIZE CURSOR HSIZE.CUR -SAL_RESID_POINTER_VSIZE CURSOR VSIZE.CUR -SAL_RESID_POINTER_NESWSIZE CURSOR NESWSIZE.CUR -SAL_RESID_POINTER_NWSESIZE CURSOR NWSESIZE.CUR +SAL_RESID_POINTER_HSIZE CURSOR hsize.cur +SAL_RESID_POINTER_VSIZE CURSOR vsize.cur +SAL_RESID_POINTER_NESWSIZE CURSOR neswsize.cur +SAL_RESID_POINTER_NWSESIZE CURSOR nwsesize.cur #endif -SAL_RESID_POINTER_CROSS CURSOR CROSS.CUR -SAL_RESID_POINTER_MOVE CURSOR MOVE.CUR -SAL_RESID_POINTER_HSPLIT CURSOR HSPLIT.CUR -SAL_RESID_POINTER_VSPLIT CURSOR VSPLIT.CUR -SAL_RESID_POINTER_HSIZEBAR CURSOR HSIZEBAR.CUR -SAL_RESID_POINTER_VSIZEBAR CURSOR VSIZEBAR.CUR -SAL_RESID_POINTER_HAND CURSOR HAND.CUR -SAL_RESID_POINTER_REFHAND CURSOR REFHAND.CUR -SAL_RESID_POINTER_PEN CURSOR PEN.CUR -SAL_RESID_POINTER_MAGNIFY CURSOR MAGNIFY.CUR -SAL_RESID_POINTER_FILL CURSOR FILL.CUR -SAL_RESID_POINTER_ROTATE CURSOR ROTATE.CUR -SAL_RESID_POINTER_HSHEAR CURSOR HSHEAR.CUR -SAL_RESID_POINTER_VSHEAR CURSOR VSHEAR.CUR -SAL_RESID_POINTER_MIRROR CURSOR MIRROR.CUR -SAL_RESID_POINTER_CROOK CURSOR CROOK.CUR -SAL_RESID_POINTER_CROP CURSOR CROP.CUR -SAL_RESID_POINTER_MOVEPOINT CURSOR MOVEPT.CUR -SAL_RESID_POINTER_MOVEBEZIERWEIGHT CURSOR MOVEBW.CUR -SAL_RESID_POINTER_MOVEDATA CURSOR MOVEDATA.CUR -SAL_RESID_POINTER_COPYDATA CURSOR COPYDATA.CUR -SAL_RESID_POINTER_LINKDATA CURSOR LINKDATA.CUR -SAL_RESID_POINTER_MOVEDATALINK CURSOR MOVEDLNK.CUR -SAL_RESID_POINTER_COPYDATALINK CURSOR COPYDLNK.CUR -SAL_RESID_POINTER_MOVEFILE CURSOR MOVEF.CUR -SAL_RESID_POINTER_COPYFILE CURSOR COPYF.CUR -SAL_RESID_POINTER_LINKFILE CURSOR LINKF.CUR -SAL_RESID_POINTER_MOVEFILELINK CURSOR MOVEFLNK.CUR -SAL_RESID_POINTER_COPYFILELINK CURSOR COPYFLNK.CUR -SAL_RESID_POINTER_MOVEFILES CURSOR MOVEF2.CUR -SAL_RESID_POINTER_COPYFILES CURSOR COPYF2.CUR -SAL_RESID_POINTER_NOTALLOWED CURSOR NOTALLOW.CUR -SAL_RESID_POINTER_DRAW_LINE CURSOR DLINE.CUR -SAL_RESID_POINTER_DRAW_RECT CURSOR DRECT.CUR -SAL_RESID_POINTER_DRAW_POLYGON CURSOR DPOLYGON.CUR -SAL_RESID_POINTER_DRAW_BEZIER CURSOR DBEZIER.CUR -SAL_RESID_POINTER_DRAW_ARC CURSOR DARC.CUR -SAL_RESID_POINTER_DRAW_PIE CURSOR DPIE.CUR -SAL_RESID_POINTER_DRAW_CIRCLECUT CURSOR DCIRCCUT.CUR -SAL_RESID_POINTER_DRAW_ELLIPSE CURSOR DELLIPSE.CUR -SAL_RESID_POINTER_DRAW_FREEHAND CURSOR DFREE.CUR -SAL_RESID_POINTER_DRAW_CONNECT CURSOR DCONNECT.CUR -SAL_RESID_POINTER_DRAW_TEXT CURSOR DTEXT.CUR -SAL_RESID_POINTER_DRAW_CAPTION CURSOR DCAPT.CUR -SAL_RESID_POINTER_CHART CURSOR CHART.CUR -SAL_RESID_POINTER_DETECTIVE CURSOR DETECTIV.CUR -SAL_RESID_POINTER_PIVOT_COL CURSOR PIVOTCOL.CUR -SAL_RESID_POINTER_PIVOT_ROW CURSOR PIVOTROW.CUR -SAL_RESID_POINTER_PIVOT_FIELD CURSOR PIVOTFLD.CUR -SAL_RESID_POINTER_PIVOT_DELETE CURSOR PIVOTDEL.CUR -SAL_RESID_POINTER_CHAIN CURSOR CHAIN.CUR -SAL_RESID_POINTER_CHAIN_NOTALLOWED CURSOR CHAINNOT.CUR -SAL_RESID_POINTER_TIMEEVENT_MOVE CURSOR TIMEMOVE.CUR -SAL_RESID_POINTER_TIMEEVENT_SIZE CURSOR TIMESIZE.CUR -SAL_RESID_POINTER_AUTOSCROLL_N CURSOR ASN.CUR -SAL_RESID_POINTER_AUTOSCROLL_S CURSOR ASS.CUR -SAL_RESID_POINTER_AUTOSCROLL_W CURSOR ASW.CUR -SAL_RESID_POINTER_AUTOSCROLL_E CURSOR ASE.CUR -SAL_RESID_POINTER_AUTOSCROLL_NW CURSOR ASNW.CUR -SAL_RESID_POINTER_AUTOSCROLL_NE CURSOR ASNE.CUR -SAL_RESID_POINTER_AUTOSCROLL_SW CURSOR ASSW.CUR -SAL_RESID_POINTER_AUTOSCROLL_SE CURSOR ASSE.CUR -SAL_RESID_POINTER_AUTOSCROLL_NS CURSOR ASNS.CUR -SAL_RESID_POINTER_AUTOSCROLL_WE CURSOR ASWE.CUR -SAL_RESID_POINTER_AUTOSCROLL_NSWE CURSOR ASNSWE.CUR -SAL_RESID_POINTER_AIRBRUSH CURSOR AIRBRUSH.CUR -SAL_RESID_POINTER_TEXT_VERTICAL CURSOR VTEXT.CUR -SAL_RESID_POINTER_TAB_SELECT_S CURSOR TBLSELS.CUR -SAL_RESID_POINTER_TAB_SELECT_E CURSOR TBLSELE.CUR -SAL_RESID_POINTER_TAB_SELECT_SE CURSOR TBLSELSE.CUR -SAL_RESID_POINTER_TAB_SELECT_W CURSOR TBLSELW.CUR -SAL_RESID_POINTER_TAB_SELECT_SW CURSOR TBLSELSW.CUR -SAL_RESID_POINTER_PAINTBRUSH CURSOR PNTBRSH.CUR +SAL_RESID_POINTER_CROSS CURSOR cross.cur +SAL_RESID_POINTER_MOVE CURSOR move.cur +SAL_RESID_POINTER_HSPLIT CURSOR hsplit.cur +SAL_RESID_POINTER_VSPLIT CURSOR vsplit.cur +SAL_RESID_POINTER_HSIZEBAR CURSOR hsizebar.cur +SAL_RESID_POINTER_VSIZEBAR CURSOR vsizebar.cur +SAL_RESID_POINTER_HAND CURSOR hand.cur +SAL_RESID_POINTER_REFHAND CURSOR refhand.cur +SAL_RESID_POINTER_PEN CURSOR pen.cur +SAL_RESID_POINTER_MAGNIFY CURSOR magnify.cur +SAL_RESID_POINTER_FILL CURSOR fill.cur +SAL_RESID_POINTER_ROTATE CURSOR rotate.cur +SAL_RESID_POINTER_HSHEAR CURSOR hshear.cur +SAL_RESID_POINTER_VSHEAR CURSOR vshear.cur +SAL_RESID_POINTER_MIRROR CURSOR mirror.cur +SAL_RESID_POINTER_CROOK CURSOR crook.cur +SAL_RESID_POINTER_CROP CURSOR crop.cur +SAL_RESID_POINTER_MOVEPOINT CURSOR movept.cur +SAL_RESID_POINTER_MOVEBEZIERWEIGHT CURSOR movebw.cur +SAL_RESID_POINTER_MOVEDATA CURSOR movedata.cur +SAL_RESID_POINTER_COPYDATA CURSOR copydata.cur +SAL_RESID_POINTER_LINKDATA CURSOR linkdata.cur +SAL_RESID_POINTER_MOVEDATALINK CURSOR movedlnk.cur +SAL_RESID_POINTER_COPYDATALINK CURSOR copydlnk.cur +SAL_RESID_POINTER_MOVEFILE CURSOR movef.cur +SAL_RESID_POINTER_COPYFILE CURSOR copyf.cur +SAL_RESID_POINTER_LINKFILE CURSOR linkf.cur +SAL_RESID_POINTER_MOVEFILELINK CURSOR moveflnk.cur +SAL_RESID_POINTER_COPYFILELINK CURSOR copyflnk.cur +SAL_RESID_POINTER_MOVEFILES CURSOR movef2.cur +SAL_RESID_POINTER_COPYFILES CURSOR copyf2.cur +SAL_RESID_POINTER_NOTALLOWED CURSOR notallow.cur +SAL_RESID_POINTER_DRAW_LINE CURSOR dline.cur +SAL_RESID_POINTER_DRAW_RECT CURSOR drect.cur +SAL_RESID_POINTER_DRAW_POLYGON CURSOR dpolygon.cur +SAL_RESID_POINTER_DRAW_BEZIER CURSOR dbezier.cur +SAL_RESID_POINTER_DRAW_ARC CURSOR darc.cur +SAL_RESID_POINTER_DRAW_PIE CURSOR dpie.cur +SAL_RESID_POINTER_DRAW_CIRCLECUT CURSOR dcirccut.cur +SAL_RESID_POINTER_DRAW_ELLIPSE CURSOR dellipse.cur +SAL_RESID_POINTER_DRAW_FREEHAND CURSOR dfree.cur +SAL_RESID_POINTER_DRAW_CONNECT CURSOR dconnect.cur +SAL_RESID_POINTER_DRAW_TEXT CURSOR dtext.cur +SAL_RESID_POINTER_DRAW_CAPTION CURSOR dcapt.cur +SAL_RESID_POINTER_CHART CURSOR chart.cur +SAL_RESID_POINTER_DETECTIVE CURSOR detectiv.cur +SAL_RESID_POINTER_PIVOT_COL CURSOR pivotcol.cur +SAL_RESID_POINTER_PIVOT_ROW CURSOR pivotrow.cur +SAL_RESID_POINTER_PIVOT_FIELD CURSOR pivotfld.cur +SAL_RESID_POINTER_PIVOT_DELETE CURSOR pivotdel.cur +SAL_RESID_POINTER_CHAIN CURSOR chain.cur +SAL_RESID_POINTER_CHAIN_NOTALLOWED CURSOR chainnot.cur +SAL_RESID_POINTER_TIMEEVENT_MOVE CURSOR timemove.cur +SAL_RESID_POINTER_TIMEEVENT_SIZE CURSOR timesize.cur +SAL_RESID_POINTER_AUTOSCROLL_N CURSOR asn.cur +SAL_RESID_POINTER_AUTOSCROLL_S CURSOR ass.cur +SAL_RESID_POINTER_AUTOSCROLL_W CURSOR asw.cur +SAL_RESID_POINTER_AUTOSCROLL_E CURSOR ase.cur +SAL_RESID_POINTER_AUTOSCROLL_NW CURSOR asnw.cur +SAL_RESID_POINTER_AUTOSCROLL_NE CURSOR asne.cur +SAL_RESID_POINTER_AUTOSCROLL_SW CURSOR assw.cur +SAL_RESID_POINTER_AUTOSCROLL_SE CURSOR asse.cur +SAL_RESID_POINTER_AUTOSCROLL_NS CURSOR asns.cur +SAL_RESID_POINTER_AUTOSCROLL_WE CURSOR aswe.cur +SAL_RESID_POINTER_AUTOSCROLL_NSWE CURSOR asnswe.cur +SAL_RESID_POINTER_AIRBRUSH CURSOR airbrush.cur +SAL_RESID_POINTER_TEXT_VERTICAL CURSOR vtext.cur +SAL_RESID_POINTER_TAB_SELECT_S CURSOR tblsels.cur +SAL_RESID_POINTER_TAB_SELECT_E CURSOR tblsele.cur +SAL_RESID_POINTER_TAB_SELECT_SE CURSOR tblselse.cur +SAL_RESID_POINTER_TAB_SELECT_W CURSOR tblselw.cur +SAL_RESID_POINTER_TAB_SELECT_SW CURSOR tblselsw.cur +SAL_RESID_POINTER_PAINTBRUSH CURSOR pntbrsh.cur + +SAL_RESID_BITMAP_50 BITMAP "50.bmp" -SAL_RESID_BITMAP_50 BITMAP 50.BMP +SAL_RESID_ICON_DEFAULT ICON sd.ico -SAL_RESID_ICON_DEFAULT ICON SD.ICO +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From c4da6f3c9af37f70026614e6f18bd273023caa11 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Mon, 18 Jul 2011 00:43:43 +0200 Subject: Some cppcheck cleaning --- vcl/source/fontsubset/gsub.cxx | 4 ++-- vcl/source/window/menu.cxx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'vcl') diff --git a/vcl/source/fontsubset/gsub.cxx b/vcl/source/fontsubset/gsub.cxx index da0d84cec089..7dcdc42e88f4 100644 --- a/vcl/source/fontsubset/gsub.cxx +++ b/vcl/source/fontsubset/gsub.cxx @@ -162,7 +162,7 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile, } } - if( !aFeatureIndexList.size() ) + if( aFeatureIndexList.empty() ) return true; UshortList aLookupIndexList; @@ -318,7 +318,7 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile, } // now apply the glyph substitutions that have been collected in this subtable - if( aSubstVector.size() > 0 ) + if( !aSubstVector.empty() ) { GlyphSubstitution* pGSubstitution = new GlyphSubstitution; pTTFile->pGSubstitution = (void*)pGSubstitution; diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index d4e16ed6c121..9e47d34716cb 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -156,7 +156,7 @@ struct MenuItemData pSalMenuItem ( NULL ) {} ~MenuItemData(); - bool HasCheck() + bool HasCheck() const { return bChecked || ( nBits & ( MIB_RADIOCHECK | MIB_CHECKABLE | MIB_AUTOCHECK ) ); } -- cgit v1.2.3 From 8104b3710e4942881d1e1e9969a28d5fd556521c Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 14 Jul 2011 22:07:32 +0100 Subject: callcatcher: remove unused methods --- svl/inc/svl/urihelper.hxx | 26 -------------- svl/source/misc/urihelper.cxx | 61 --------------------------------- svtools/inc/svtools/syntaxhighlight.hxx | 8 ----- svtools/source/edit/syntaxhighlight.cxx | 35 ------------------- vcl/inc/vcl/window.hxx | 1 - vcl/source/window/window2.cxx | 5 --- 6 files changed, 136 deletions(-) (limited to 'vcl') diff --git a/svl/inc/svl/urihelper.hxx b/svl/inc/svl/urihelper.hxx index 67326861642c..61be9f6c831d 100644 --- a/svl/inc/svl/urihelper.hxx +++ b/svl/inc/svl/urihelper.hxx @@ -177,32 +177,6 @@ removePassword(UniString const & rURI, INetURLObject::DecodeMechanism eDecodeMechanism = INetURLObject::DECODE_TO_IURI, rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8); - -//============================================================================ -/** Query the notational conventions used in the file system provided by some - file content provider. - - @param rFileUrl This file URL determines which file content provider is - used to query the desired information. (The UCB's usual mapping from URLs - to content providers is used.) - - @param bAddConvenienceStyles If true, the return value contains not only - the style bit corresponding to the queried content provider's conventions, - but may also contain additional style bits that make using this function - more convenient in certain situations. Currently, the effect is that - FSYS_UNX is extended with FSYS_VOS, and both FSYS_DOS and FSYS_MAC are - extended with FSYS_VOS and FSYS_UNX (i.e., the---unambiguous---detection - of VOS style and Unix style file system paths is always enabled); also, in - case the content provider's conventions cannot be determined, FSYS_DETECT - is returned instead of FSysStyle(0). - - @return The style bit corresponding to the queried content provider's - conventions, or FSysStyle(0) if these cannot be determined. - */ -SVL_DLLPUBLIC INetURLObject::FSysStyle queryFSysStyle(UniString const & rFileUrl, - bool bAddConvenienceStyles = true) - throw (com::sun::star::uno::RuntimeException); - } #endif // SVTOOLS_URIHELPER_HXX diff --git a/svl/source/misc/urihelper.cxx b/svl/source/misc/urihelper.cxx index 3f46d8ab9f5b..1bef290f3dfd 100644 --- a/svl/source/misc/urihelper.cxx +++ b/svl/source/misc/urihelper.cxx @@ -865,65 +865,4 @@ URIHelper::removePassword(UniString const & rURI, String(aObj.GetURLNoPass(eDecodeMechanism, eCharset)); } -//============================================================================ -// -// queryFSysStyle -// -//============================================================================ - -INetURLObject::FSysStyle URIHelper::queryFSysStyle(UniString const & rFileUrl, - bool bAddConvenienceStyles) - throw (uno::RuntimeException) -{ - ::ucbhelper::ContentBroker const * pBroker = ::ucbhelper::ContentBroker::get(); - uno::Reference< ucb::XContentProviderManager > xManager; - if (pBroker) - xManager = pBroker->getContentProviderManagerInterface(); - uno::Reference< beans::XPropertySet > xProperties; - if (xManager.is()) - xProperties - = uno::Reference< beans::XPropertySet >( - xManager->queryContentProvider(rFileUrl), uno::UNO_QUERY); - sal_Int32 nNotation = ucb::FileSystemNotation::UNKNOWN_NOTATION; - if (xProperties.is()) - try - { - xProperties->getPropertyValue(rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "FileSystemNotation"))) - >>= nNotation; - } - catch (beans::UnknownPropertyException const &) {} - catch (lang::WrappedTargetException const &) {} - - // The following code depends on the fact that the - // com::sun::star::ucb::FileSystemNotation constants range from UNKNOWN to - // MAC, without any holes. The table below has two entries per notation, - // the first is used if bAddConvenienceStyles == false, while the second - // is used if bAddConvenienceStyles == true: - static INetURLObject::FSysStyle const aMap[][2] - = { { INetURLObject::FSysStyle(0), - INetURLObject::FSYS_DETECT }, - // UNKNOWN - { INetURLObject::FSYS_UNX, - INetURLObject::FSysStyle(INetURLObject::FSYS_VOS - | INetURLObject::FSYS_UNX) }, - // UNIX - { INetURLObject::FSYS_DOS, - INetURLObject::FSysStyle(INetURLObject::FSYS_VOS - | INetURLObject::FSYS_UNX - | INetURLObject::FSYS_DOS) }, - // DOS - { INetURLObject::FSYS_MAC, - INetURLObject::FSysStyle(INetURLObject::FSYS_VOS - | INetURLObject::FSYS_UNX - | INetURLObject::FSYS_MAC) } }; - return aMap[nNotation < ucb::FileSystemNotation::UNKNOWN_NOTATION - || nNotation > ucb::FileSystemNotation::MAC_NOTATION ? - 0 : - nNotation - - ucb::FileSystemNotation::UNKNOWN_NOTATION] - [bAddConvenienceStyles]; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/inc/svtools/syntaxhighlight.hxx b/svtools/inc/svtools/syntaxhighlight.hxx index a9a0c5a2da58..f4bcca15a68d 100644 --- a/svtools/inc/svtools/syntaxhighlight.hxx +++ b/svtools/inc/svtools/syntaxhighlight.hxx @@ -129,14 +129,6 @@ class SimpleTokenizer_Impl sal_Bool getNextToken( /*out*/TokenTypes& reType, /*out*/const sal_Unicode*& rpStartPos, /*out*/const sal_Unicode*& rpEndPos ); - String getTokStr( /*out*/const sal_Unicode* pStartPos, /*out*/const sal_Unicode* pEndPos ); - -#ifdef DBG_UTIL - // TEST: Token ausgeben - String getFullTokenStr( /*out*/TokenTypes eType, - /*out*/const sal_Unicode* pStartPos, /*out*/const sal_Unicode* pEndPos ); -#endif - const char** ppListKeyWords; sal_uInt16 nKeyWordCount; diff --git a/svtools/source/edit/syntaxhighlight.cxx b/svtools/source/edit/syntaxhighlight.cxx index 6ccaa07453d8..df9c9d1acea9 100644 --- a/svtools/source/edit/syntaxhighlight.cxx +++ b/svtools/source/edit/syntaxhighlight.cxx @@ -675,41 +675,6 @@ sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, return sal_True; } -String SimpleTokenizer_Impl::getTokStr - ( /*out*/const sal_Unicode* pStartPos, /*out*/const sal_Unicode* pEndPos ) -{ - return String( pStartPos, (sal_uInt16)( pEndPos - pStartPos ) ); -} - -#ifdef DBG_UTIL -// TEST: Token ausgeben -String SimpleTokenizer_Impl::getFullTokenStr( /*out*/TokenTypes eType, - /*out*/const sal_Unicode* pStartPos, /*out*/const sal_Unicode* pEndPos ) -{ - String aOut; - switch( eType ) - { - case TT_UNKNOWN: aOut = String( RTL_CONSTASCII_USTRINGPARAM("TT_UNKNOWN:") ); break; - case TT_IDENTIFIER: aOut = String( RTL_CONSTASCII_USTRINGPARAM("TT_IDENTIFIER:") ); break; - case TT_WHITESPACE: aOut = String( RTL_CONSTASCII_USTRINGPARAM("TT_WHITESPACE:") ); break; - case TT_NUMBER: aOut = String( RTL_CONSTASCII_USTRINGPARAM("TT_NUMBER:") ); break; - case TT_STRING: aOut = String( RTL_CONSTASCII_USTRINGPARAM("TT_STRING:") ); break; - case TT_EOL: aOut = String( RTL_CONSTASCII_USTRINGPARAM("TT_EOL:") ); break; - case TT_COMMENT: aOut = String( RTL_CONSTASCII_USTRINGPARAM("TT_COMMENT:") ); break; - case TT_ERROR: aOut = String( RTL_CONSTASCII_USTRINGPARAM("TT_ERROR:") ); break; - case TT_OPERATOR: aOut = String( RTL_CONSTASCII_USTRINGPARAM("TT_OPERATOR:") ); break; - case TT_KEYWORDS: aOut = String( RTL_CONSTASCII_USTRINGPARAM("TT_KEYWORD:") ); break; - case TT_PARAMETER: aOut = String( RTL_CONSTASCII_USTRINGPARAM("TT_PARAMETER:") ); break; - } - if( eType != TT_EOL ) - { - aOut += String( pStartPos, (sal_uInt16)( pEndPos - pStartPos ) ); - } - aOut += String( RTL_CONSTASCII_USTRINGPARAM("\n") ); - return aOut; -} -#endif - SimpleTokenizer_Impl::SimpleTokenizer_Impl( HighlighterLanguage aLang ): aLanguage(aLang) { memset( aCharTypeTab, 0, sizeof( aCharTypeTab ) ); diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx index df82b7870854..8cc7bfd0894f 100644 --- a/vcl/inc/vcl/window.hxx +++ b/vcl/inc/vcl/window.hxx @@ -914,7 +914,6 @@ public: void SetFakeFocus( bool bFocus ); sal_Bool IsCompoundControl() const; - sal_Bool HasCompoundControlFocus() const; static sal_uIntPtr SaveFocus(); static sal_Bool EndSaveFocus( sal_uIntPtr nSaveId, sal_Bool bRestore = sal_True ); diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index bf81d2665f48..a2dd24378e37 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -1759,11 +1759,6 @@ sal_Bool Window::IsCompoundControl() const return mpWindowImpl->mbCompoundControl; } -sal_Bool Window::HasCompoundControlFocus() const -{ - return mpWindowImpl->mbCompoundControlHasFocus; -} - sal_Bool Window::IsChildPointerOverwrite() const { return mpWindowImpl->mbChildPtrOverwrite; -- cgit v1.2.3 From e689ed9b937213225f9d8c7f57d324041eff7f4b Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 15 Jul 2011 22:18:44 +0100 Subject: callcatcher: unused methods --- tools/inc/tools/inetmime.hxx | 3 --- tools/inc/tools/inetmsg.hxx | 1 - tools/source/inet/inetmime.cxx | 17 ----------------- tools/source/inet/inetmsg.cxx | 8 -------- vcl/inc/vcl/print.hxx | 1 - vcl/source/gdi/print.cxx | 10 ---------- vcl/source/window/toolbox.cxx | 25 ------------------------- 7 files changed, 65 deletions(-) (limited to 'vcl') diff --git a/tools/inc/tools/inetmime.hxx b/tools/inc/tools/inetmime.hxx index 059c34a9515a..cf8f8173cac7 100644 --- a/tools/inc/tools/inetmime.hxx +++ b/tools/inc/tools/inetmime.hxx @@ -533,9 +533,6 @@ public: static void writeUTF8(INetMIMEOutputSink & rSink, sal_uInt32 nChar); - static void writeUnsigned(INetMIMEOutputSink & rSink, sal_uInt32 nValue, - int nMinDigits = 1); - static void writeHeaderFieldBody(INetMIMEOutputSink & rSink, HeaderFieldType eType, const UniString & rBody, diff --git a/tools/inc/tools/inetmsg.hxx b/tools/inc/tools/inetmsg.hxx index cf96dc98d5be..b06541a8323d 100644 --- a/tools/inc/tools/inetmsg.hxx +++ b/tools/inc/tools/inetmsg.hxx @@ -482,7 +482,6 @@ public: return GetHeaderValue (m_nIndex[INETMSG_MIME_VERSION]); } - void SetContentDescription (const UniString& rDescription); UniString GetContentDescription (void) const { return GetHeaderValue (m_nIndex[INETMSG_MIME_CONTENT_DESCRIPTION]); diff --git a/tools/source/inet/inetmime.cxx b/tools/source/inet/inetmime.cxx index 1db41b4d73ba..2442b768e426 100644 --- a/tools/source/inet/inetmime.cxx +++ b/tools/source/inet/inetmime.cxx @@ -1956,23 +1956,6 @@ void INetMIME::writeUTF8(INetMIMEOutputSink & rSink, sal_uInt32 nChar) << sal_Char((nChar & 0x3F) | 0x80); } -//============================================================================ -// static -void INetMIME::writeUnsigned(INetMIMEOutputSink & rSink, sal_uInt32 nValue, - int nMinDigits) -{ - sal_Char aBuffer[10]; - // max unsigned 32 bit value (4294967295) has 10 places - sal_Char * p = aBuffer; - for (; nValue > 0; nValue /= 10) - *p++ = sal_Char(getDigit(nValue % 10)); - nMinDigits -= p - aBuffer; - while (nMinDigits-- > 0) - rSink << '0'; - while (p != aBuffer) - rSink << *--p; -} - //============================================================================ // static void INetMIME::writeHeaderFieldBody(INetMIMEOutputSink & rSink, diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx index aa6a00313352..1645e9ba7aea 100644 --- a/tools/source/inet/inetmsg.cxx +++ b/tools/source/inet/inetmsg.cxx @@ -1005,14 +1005,6 @@ void INetMIMEMessage::SetMIMEVersion (const UniString& rVersion) m_nIndex[INETMSG_MIME_VERSION]); } -void INetMIMEMessage::SetContentDescription (const String& rDescription) -{ - SetHeaderField_Impl ( - INetMIME::HEADER_FIELD_TEXT, - MIMEHDR(INETMSG_MIME_CONTENT_DESCRIPTION), rDescription, - m_nIndex[INETMSG_MIME_CONTENT_DESCRIPTION]); -} - void INetMIMEMessage::SetContentDisposition (const String& rDisposition) { SetHeaderField_Impl ( diff --git a/vcl/inc/vcl/print.hxx b/vcl/inc/vcl/print.hxx index 3d266160b3e2..120198328e49 100644 --- a/vcl/inc/vcl/print.hxx +++ b/vcl/inc/vcl/print.hxx @@ -265,7 +265,6 @@ private: SAL_DLLPRIVATE void ImplUpdatePageData(); SAL_DLLPRIVATE void ImplUpdateFontList(); SAL_DLLPRIVATE void ImplFindPaperFormatForUserSize( JobSetup&, bool bMatchNearest ); - DECL_DLLPRIVATE_LINK( ImplDestroyPrinterAsync, void* ); SAL_DLLPRIVATE bool StartJob( const rtl::OUString& rJobName, boost::shared_ptr& ); diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index ef3c68ec5355..440da9c5bb56 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -1440,16 +1440,6 @@ sal_uLong Printer::ImplSalPrinterErrorCodeToVCL( sal_uLong nError ) // ----------------------------------------------------------------------- -IMPL_LINK( Printer, ImplDestroyPrinterAsync, void*, pSalPrinter ) -{ - SalPrinter* pPrinter = (SalPrinter*)pSalPrinter; - ImplSVData* pSVData = ImplGetSVData(); - pSVData->mpDefInst->DestroyPrinter( pPrinter ); - return 0; -} - -// ----------------------------------------------------------------------- - sal_Bool Printer::EndJob() { sal_Bool bRet = sal_False; diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 0304033d03f9..288cbe103afe 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -194,8 +194,6 @@ public: void UpdateDragRect(); DECL_LINK( SelectHdl, Accelerator* ); - void StartCustomizeMode(); - void EndCustomizeMode(); sal_Bool IsCustomizeMode() { return mbCustomizeMode; } sal_Bool IsResizeMode() { return mbResizeMode; } }; @@ -1503,29 +1501,6 @@ IMPL_LINK( ImplTBDragMgr, SelectHdl, Accelerator*, pAccel ) // ----------------------------------------------------------------------- -void ImplTBDragMgr::StartCustomizeMode() -{ - mbCustomizeMode = sal_True; - - for ( size_t i = 0, n = mpBoxList->size(); i < n; ++i ) { - (*mpBoxList)[ i ]->ImplStartCustomizeMode(); - } -} - -// ----------------------------------------------------------------------- - -void ImplTBDragMgr::EndCustomizeMode() -{ - mbCustomizeMode = sal_False; - - for ( size_t i = 0, n = mpBoxList->size(); i < n; ++i ) { - (*mpBoxList)[ i ]->ImplEndCustomizeMode(); - } -} - -// ----------------------------------------------------------------------- - - static void ImplDrawOutButton( OutputDevice* pOutDev, const Rectangle& rRect, sal_uInt16 nStyle ) { -- cgit v1.2.3 From 03ea8631d3b468965ff514d0293d7e2c72442413 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 17 Jul 2011 22:27:38 +0100 Subject: callcatcher: remove unused getTunnelIdentifier --- vcl/inc/vcl/canvastools.hxx | 5 ----- vcl/source/helper/canvastools.cxx | 17 ----------------- 2 files changed, 22 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/canvastools.hxx b/vcl/inc/vcl/canvastools.hxx index e82d397a92f0..ce6c7bcafe68 100644 --- a/vcl/inc/vcl/canvastools.hxx +++ b/vcl/inc/vcl/canvastools.hxx @@ -144,11 +144,6 @@ namespace vcl ::BitmapEx VCL_DLLPUBLIC bitmapExFromXBitmap( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XIntegerReadOnlyBitmap >& xInputBitmap ); - /** get a unique identifier for identification in XUnoTunnel interface - */ - enum TunnelIdentifierType { Id_BitmapEx = 0 }; - const com::sun::star::uno::Sequence< sal_Int8 > VCL_DLLPUBLIC getTunnelIdentifier( TunnelIdentifierType eType ); - // Color conversions (vcl/tools Color <-> canvas standard color space) // =================================================================== diff --git a/vcl/source/helper/canvastools.cxx b/vcl/source/helper/canvastools.cxx index ac8e658f7bd8..7b152938744b 100644 --- a/vcl/source/helper/canvastools.cxx +++ b/vcl/source/helper/canvastools.cxx @@ -185,23 +185,6 @@ namespace vcl //--------------------------------------------------------------------------------------- - const uno::Sequence< sal_Int8 > getTunnelIdentifier( TunnelIdentifierType eType ) - { - static boost::unordered_map< int, uno::Sequence< sal_Int8 > > aIds; - boost::unordered_map< int, uno::Sequence< sal_Int8 > >::iterator it = - aIds.find( eType ); - if( it == aIds.end() ) - { - uno::Sequence< sal_Int8 > aNewId( 16 ); - rtl_createUuid( (sal_uInt8*)aNewId.getArray(), NULL, sal_True ); - aIds[ eType ] = aNewId; - it = aIds.find( eType ); - } - return it->second; - } - - //--------------------------------------------------------------------------------------- - namespace { inline bool operator==( const rendering::IntegerBitmapLayout& rLHS, -- cgit v1.2.3 From 40bbd3a61ae980840999b2410f681cae4c341531 Mon Sep 17 00:00:00 2001 From: Joseph Powers Date: Mon, 18 Jul 2011 20:55:51 -0700 Subject: Whitespace cleanup --- vcl/inc/unx/salbmp.h | 242 +++++++++++++++++++++----------------- vcl/unx/generic/gdi/salbmp.cxx | 261 ++++++++++++++++++++++++++++------------- 2 files changed, 314 insertions(+), 189 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/unx/salbmp.h b/vcl/inc/unx/salbmp.h index a389195308d3..42230d8bbde7 100644 --- a/vcl/inc/unx/salbmp.h +++ b/vcl/inc/unx/salbmp.h @@ -51,80 +51,118 @@ class VCLPLUG_GEN_PUBLIC X11SalBitmap : public SalBitmap { private: - static BitmapBuffer* ImplCreateDIB( const Size& rSize, - sal_uInt16 nBitCount, - const BitmapPalette& rPal ); - static BitmapBuffer* ImplCreateDIB( Drawable aDrawable, - int nScreen, - long nDrawableDepth, - long nX, long nY, - long nWidth, long nHeight, - bool bGrey ); + static BitmapBuffer* ImplCreateDIB( + const Size& rSize, + sal_uInt16 nBitCount, + const BitmapPalette& rPal + ); + + static BitmapBuffer* ImplCreateDIB( + Drawable aDrawable, + int nScreen, + long nDrawableDepth, + long nX, + long nY, + long nWidth, + long nHeight, + bool bGrey + ); public: static ImplSalBitmapCache* mpCache; - static sal_uIntPtr mnCacheInstCount; + static sal_uIntPtr mnCacheInstCount; static void ImplCreateCache(); static void ImplDestroyCache(); void ImplRemovedFromCache(); bool SnapShot (Display* pDisplay, XLIB_Window hWindow); - bool ImplCreateFromXImage( Display* pDisplay, - XLIB_Window hWindow, - int nScreen, - XImage* pImage); + bool ImplCreateFromXImage( + Display* pDisplay, + XLIB_Window hWindow, + int nScreen, + XImage* pImage + ); private: - BitmapBuffer* mpDIB; ImplSalDDB* mpDDB; bool mbGrey; public: - SAL_DLLPRIVATE bool ImplCreateFromDrawable( Drawable aDrawable, - int nScreen, - long nDrawableDepth, - long nX, long nY, - long nWidth, long nHeight ); - - SAL_DLLPRIVATE XImage* ImplCreateXImage( SalDisplay* pSalDisp, - int nScreen, long nDepth, - const SalTwoRect& rTwoRect ) const; - - SAL_DLLPRIVATE ImplSalDDB* ImplGetDDB( Drawable, int nScreen, long nDrawableDepth, - const SalTwoRect& ) const; - void ImplDraw( Drawable aDrawable, int nScreen, long nDrawableDepth, - const SalTwoRect& rTwoRect, const GC& rGC ) const; + SAL_DLLPRIVATE bool ImplCreateFromDrawable( + Drawable aDrawable, + int nScreen, + long nDrawableDepth, + long nX, + long nY, + long nWidth, + long nHeight + ); + + SAL_DLLPRIVATE XImage* ImplCreateXImage( + SalDisplay* pSalDisp, + int nScreen, + long nDepth, + const SalTwoRect& rTwoRect + ) const; + + SAL_DLLPRIVATE ImplSalDDB* ImplGetDDB( + Drawable, + int nScreen, + long nDrawableDepth, + const SalTwoRect& + ) const; + + void ImplDraw( + Drawable aDrawable, + int nScreen, + long nDrawableDepth, + const SalTwoRect& rTwoRect, + const GC& rGC + ) const; public: - X11SalBitmap(); - virtual ~X11SalBitmap(); + X11SalBitmap(); + virtual ~X11SalBitmap(); // overload pure virtual methods - virtual bool Create( const Size& rSize, - 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, - sal_uInt16 nNewBitCount ); - virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas, + virtual bool Create( + const Size& rSize, + 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, + sal_uInt16 nNewBitCount + ); + + virtual bool Create( + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XBitmapCanvas + > xBitmapCanvas, Size& rSize, - bool bMask = false ); + bool bMask = false + ); - virtual void Destroy(); + virtual void Destroy(); - virtual Size GetSize() const; + virtual Size GetSize() const; virtual sal_uInt16 GetBitCount() const; - virtual BitmapBuffer* AcquireBuffer( bool bReadOnly ); - virtual void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly ); - virtual bool GetSystemData( BitmapSystemData& rData ); + virtual BitmapBuffer* AcquireBuffer( bool bReadOnly ); + virtual void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly ); + virtual bool GetSystemData( BitmapSystemData& rData ); }; // -------------- @@ -142,37 +180,66 @@ private: ImplSalDDB() {} - static void ImplDraw( Drawable aSrcDrawable, long nSrcDrawableDepth, - Drawable aDstDrawable, long nDstDrawableDepth, - long nSrcX, long nSrcY, - long nDestWidth, long nDestHeight, - long nDestX, long nDestY, const GC& rGC ); + static void ImplDraw( + Drawable aSrcDrawable, + long nSrcDrawableDepth, + Drawable aDstDrawable, + long nDstDrawableDepth, + long nSrcX, + long nSrcY, + long nDestWidth, + long nDestHeight, + long nDestX, + long nDestY, + const GC& rGC + ); public: - ImplSalDDB( XImage* pImage, - Drawable aDrawable, int nScreen, - const SalTwoRect& rTwoRect ); - ImplSalDDB( Drawable aDrawable, - int nScreen, - long nDrawableDepth, - long nX, long nY, long nWidth, long nHeight ); - ImplSalDDB( Display* pDisplay, - XLIB_Window hWindow, - int nScreen, - XImage* pImage); + ImplSalDDB( + XImage* pImage, + Drawable aDrawable, + int nScreen, + const SalTwoRect& rTwoRect + ); + + ImplSalDDB( + Drawable aDrawable, + int nScreen, + long nDrawableDepth, + long nX, + long nY, + long nWidth, + long nHeight + ); + + ImplSalDDB( + Display* pDisplay, + XLIB_Window hWindow, + int nScreen, + XImage* pImage + ); + ~ImplSalDDB(); Pixmap ImplGetPixmap() const { return maPixmap; } long ImplGetWidth() const { return maTwoRect.mnDestWidth; } long ImplGetHeight() const { return maTwoRect.mnDestHeight; } long ImplGetDepth() const { return mnDepth; } - sal_uIntPtr 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; - void ImplDraw( Drawable aDrawable, long nDrawableDepth, - const SalTwoRect& rTwoRect, const GC& rGC ) const; + + void ImplDraw( + Drawable aDrawable, + long nDrawableDepth, + const SalTwoRect& rTwoRect, + const GC& rGC + ) const; }; // ---------------------- @@ -184,7 +251,7 @@ class ImplSalBitmapCache private: List maBmpList; - sal_uIntPtr mnTotalSize; + sal_uIntPtr mnTotalSize; public: @@ -198,47 +265,4 @@ public: #endif // _SV_SALBMP_HXX - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx index 3349e6ef3c01..0b9e69abb940 100644 --- a/vcl/unx/generic/gdi/salbmp.cxx +++ b/vcl/unx/generic/gdi/salbmp.cxx @@ -32,6 +32,7 @@ #include #include #include + #ifdef FREEBSD #include #endif @@ -69,14 +70,14 @@ SalBitmap* X11SalInstance::CreateSalBitmap() } ImplSalBitmapCache* X11SalBitmap::mpCache = NULL; -sal_uLong X11SalBitmap::mnCacheInstCount = 0; +sal_uLong X11SalBitmap::mnCacheInstCount = 0; // ----------------------------------------------------------------------------- -X11SalBitmap::X11SalBitmap() : - mpDIB( NULL ), - mpDDB( NULL ), - mbGrey( false ) +X11SalBitmap::X11SalBitmap() + : mpDIB( NULL ) + , mpDDB( NULL ) + , mbGrey( false ) { } @@ -115,9 +116,19 @@ void X11SalBitmap::ImplRemovedFromCache() // ----------------------------------------------------------------------------- -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!" ); +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!" + ); BitmapBuffer* pDIB = NULL; @@ -192,13 +203,16 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( const Size& rSize, sal_uInt16 nBitCou // ----------------------------------------------------------------------------- -BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable, - int nScreen, - long nDrawableDepth, - long nX, long nY, - long nWidth, long nHeight, - bool bGrey ) -{ +BitmapBuffer* X11SalBitmap::ImplCreateDIB( + Drawable aDrawable, + int nScreen, + long nDrawableDepth, + long nX, + long nY, + long nWidth, + long nHeight, + bool bGrey +) { BitmapBuffer* pDIB = NULL; if( aDrawable && nWidth && nHeight && nDrawableDepth ) @@ -221,7 +235,7 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable, { const SalTwoRect aTwoRect = { 0, 0, nWidth, nHeight, 0, 0, nWidth, nHeight }; BitmapBuffer aSrcBuf; - sal_uLong nDstFormat = BMP_FORMAT_BOTTOM_UP; + sal_uLong nDstFormat = BMP_FORMAT_BOTTOM_UP; const BitmapPalette* pDstPal = NULL; aSrcBuf.mnFormat = BMP_FORMAT_TOP_DOWN; @@ -239,14 +253,20 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable, { case( 1 ): { - aSrcBuf.mnFormat |= ( LSBFirst == pImage->bitmap_bit_order ? BMP_FORMAT_1BIT_LSB_PAL : BMP_FORMAT_1BIT_MSB_PAL ); + aSrcBuf.mnFormat |= ( LSBFirst == pImage->bitmap_bit_order + ? BMP_FORMAT_1BIT_LSB_PAL + : BMP_FORMAT_1BIT_MSB_PAL + ); nDstFormat |= BMP_FORMAT_1BIT_MSB_PAL; } break; case( 4 ): { - aSrcBuf.mnFormat |= ( LSBFirst == pImage->bitmap_bit_order ? BMP_FORMAT_4BIT_LSN_PAL : BMP_FORMAT_4BIT_MSN_PAL ); + aSrcBuf.mnFormat |= ( LSBFirst == pImage->bitmap_bit_order + ? BMP_FORMAT_4BIT_LSN_PAL + : BMP_FORMAT_4BIT_MSN_PAL + ); nDstFormat |= BMP_FORMAT_4BIT_MSN_PAL; } break; @@ -270,7 +290,6 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable, else { aSrcBuf.mnFormat |= BMP_FORMAT_16BIT_TC_MSB_MASK; - // aSrcBuf.maColorMask = ColorMask( pImage->red_mask ), SWAPSHORT( pImage->green_mask ), SWAPSHORT( pImage->blue_mask ) ); } } break; @@ -289,10 +308,15 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable, case( 32 ): { if( LSBFirst == pImage->byte_order ) - aSrcBuf.mnFormat |= ( pSalDisp->GetVisual(nScreen).red_mask == 0xFF ? BMP_FORMAT_32BIT_TC_RGBA : BMP_FORMAT_32BIT_TC_BGRA ); + aSrcBuf.mnFormat |= ( pSalDisp->GetVisual(nScreen).red_mask == 0xFF + ? BMP_FORMAT_32BIT_TC_RGBA + : BMP_FORMAT_32BIT_TC_BGRA + ); else - aSrcBuf.mnFormat |= ( pSalDisp->GetVisual(nScreen).red_mask == 0xFF ? BMP_FORMAT_32BIT_TC_ABGR : BMP_FORMAT_32BIT_TC_ARGB ); - + aSrcBuf.mnFormat |= ( pSalDisp->GetVisual(nScreen).red_mask == 0xFF + ? BMP_FORMAT_32BIT_TC_ABGR + : BMP_FORMAT_32BIT_TC_ARGB + ); nDstFormat |= BMP_FORMAT_24BIT_TC_BGR; } break; @@ -326,7 +350,9 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable, else if( aSrcBuf.mnBitCount <= 8 ) { const SalColormap& rColMap = pSalDisp->GetColormap( nScreen ); - const sal_uInt16 nCols = Min( (sal_uLong)rColMap.GetUsed(), (sal_uLong)(1 << nDrawableDepth) ); + const sal_uInt16 nCols = Min( (sal_uLong)rColMap.GetUsed() + , (sal_uLong)(1 << nDrawableDepth) + ); rPal.SetEntryCount( nCols ); pDstPal = &rPal; @@ -354,7 +380,12 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable, // ----------------------------------------------------------------------------- -XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long nDepth, const SalTwoRect& rTwoRect ) const +XImage* X11SalBitmap::ImplCreateXImage( + SalDisplay *pSalDisp, + int nScreen, + long nDepth, + const SalTwoRect& rTwoRect +) const { XImage* pImage = NULL; @@ -393,11 +424,17 @@ XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long switch( pImage->bits_per_pixel ) { case( 1 ): - nDstFormat |= ( LSBFirst == pImage->bitmap_bit_order ? BMP_FORMAT_1BIT_LSB_PAL : BMP_FORMAT_1BIT_MSB_PAL ); + nDstFormat |= ( LSBFirst == pImage->bitmap_bit_order + ? BMP_FORMAT_1BIT_LSB_PAL + : BMP_FORMAT_1BIT_MSB_PAL + ); break; case( 4 ): - nDstFormat |= ( LSBFirst == pImage->bitmap_bit_order ? BMP_FORMAT_4BIT_LSN_PAL : BMP_FORMAT_4BIT_MSN_PAL ); + nDstFormat |= ( LSBFirst == pImage->bitmap_bit_order + ? BMP_FORMAT_4BIT_LSN_PAL + : BMP_FORMAT_4BIT_MSN_PAL + ); break; case( 8 ): @@ -437,9 +474,15 @@ XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long case( 32 ): { if( LSBFirst == pImage->byte_order ) - nDstFormat |= ( pImage->red_mask == 0xFF ? BMP_FORMAT_32BIT_TC_RGBA : BMP_FORMAT_32BIT_TC_BGRA ); + nDstFormat |= ( pImage->red_mask == 0xFF + ? BMP_FORMAT_32BIT_TC_RGBA + : BMP_FORMAT_32BIT_TC_BGRA + ); else - nDstFormat |= ( pImage->red_mask == 0xFF ? BMP_FORMAT_32BIT_TC_ABGR : BMP_FORMAT_32BIT_TC_ARGB ); + nDstFormat |= ( pImage->red_mask == 0xFF + ? BMP_FORMAT_32BIT_TC_ABGR + : BMP_FORMAT_32BIT_TC_ARGB + ); } break; } @@ -467,7 +510,9 @@ 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_uLong)rColMap.GetUsed(), (sal_uLong)(1 << pImage->depth) ); + const sal_uInt16 nCols = Min( (sal_uLong)rColMap.GetUsed() + , (sal_uLong)(1 << pImage->depth) + ); pPal = new BitmapPalette( nCols ); @@ -506,10 +551,15 @@ XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long } // ----------------------------------------------------------------------------- -bool X11SalBitmap::ImplCreateFromDrawable( Drawable aDrawable, - int nScreen, long nDrawableDepth, - long nX, long nY, long nWidth, long nHeight ) -{ +bool X11SalBitmap::ImplCreateFromDrawable( + Drawable aDrawable, + int nScreen, + long nDrawableDepth, + long nX, + long nY, + long nWidth, + long nHeight +) { Destroy(); if( aDrawable && nWidth && nHeight && nDrawableDepth ) @@ -519,8 +569,7 @@ bool X11SalBitmap::ImplCreateFromDrawable( Drawable aDrawable, } // ----------------------------------------------------------------------------- -bool -X11SalBitmap::SnapShot (Display* pDisplay, XLIB_Window hWindow) +bool X11SalBitmap::SnapShot (Display* pDisplay, XLIB_Window hWindow) { if (hWindow != None) { @@ -598,9 +647,12 @@ X11SalBitmap::SnapShot (Display* pDisplay, XLIB_Window hWindow) return False; } -bool -X11SalBitmap::ImplCreateFromXImage (Display* pDisplay, XLIB_Window hWindow, int nScreen, XImage* pImage) -{ +bool X11SalBitmap::ImplCreateFromXImage ( + Display* pDisplay, + XLIB_Window hWindow, + int nScreen, + XImage* pImage +) { Destroy(); if (pImage != NULL && pImage->width != 0 && pImage->height != 0 && pImage->depth != 0) @@ -611,10 +663,12 @@ X11SalBitmap::ImplCreateFromXImage (Display* pDisplay, XLIB_Window hWindow, int return False; } -ImplSalDDB* X11SalBitmap::ImplGetDDB( Drawable aDrawable, - int nScreen, - long nDrawableDepth, - const SalTwoRect& rTwoRect ) const +ImplSalDDB* X11SalBitmap::ImplGetDDB( + Drawable aDrawable, + int nScreen, + long nDrawableDepth, + const SalTwoRect& rTwoRect +) const { if( !mpDDB || !mpDDB->ImplMatches( nScreen, nDrawableDepth, rTwoRect ) ) { @@ -708,11 +762,13 @@ ImplSalDDB* X11SalBitmap::ImplGetDDB( Drawable aDrawable, // ----------------------------------------------------------------------------- -void X11SalBitmap::ImplDraw( Drawable aDrawable, - int nScreen, - long nDrawableDepth, - const SalTwoRect& rTwoRect, - const GC& rGC ) const +void X11SalBitmap::ImplDraw( + Drawable aDrawable, + int nScreen, + long nDrawableDepth, + const SalTwoRect& rTwoRect, + const GC& rGC +) const { ImplGetDDB( aDrawable, nScreen, nDrawableDepth, rTwoRect ); if( mpDDB ) @@ -782,9 +838,14 @@ bool X11SalBitmap::Create( const SalBitmap&, sal_uInt16 ) // ----------------------------------------------------------------------------- -bool X11SalBitmap::Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas, Size& rSize, bool bMask ) -{ - ::com::sun::star::uno::Reference< ::com::sun::star::beans::XFastPropertySet > xFastPropertySet( xBitmapCanvas, ::com::sun::star::uno::UNO_QUERY ); +bool X11SalBitmap::Create( + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas, + Size& rSize, + bool bMask +) { + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XFastPropertySet > + xFastPropertySet( xBitmapCanvas, ::com::sun::star::uno::UNO_QUERY ); + if( xFastPropertySet.get() ) { sal_Int32 depth; ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > args; @@ -794,7 +855,15 @@ bool X11SalBitmap::Create( const ::com::sun::star::uno::Reference< ::com::sun::s if( ( args[1] >>= pixmapHandle ) && ( args[2] >>= depth ) ) { mbGrey = bMask; - bool bSuccess = ImplCreateFromDrawable( pixmapHandle, 0, depth, 0, 0, (long) rSize.Width(), (long) rSize.Height() ); + bool bSuccess = ImplCreateFromDrawable( + pixmapHandle, + 0, + depth, + 0, + 0, + (long) rSize.Width(), + (long) rSize.Height() + ); bool bFreePixmap = false; if( bSuccess && (args[0] >>= bFreePixmap) && bFreePixmap ) XFreePixmap( GetX11SalData()->GetDisplay()->GetDisplay(), pixmapHandle ); @@ -860,10 +929,15 @@ BitmapBuffer* X11SalBitmap::AcquireBuffer( bool ) { if( !mpDIB && mpDDB ) { - mpDIB = ImplCreateDIB( mpDDB->ImplGetPixmap(), - mpDDB->ImplGetScreen(), - mpDDB->ImplGetDepth(), - 0, 0, mpDDB->ImplGetWidth(), mpDDB->ImplGetHeight(), mbGrey ); + mpDIB = ImplCreateDIB( + mpDDB->ImplGetPixmap(), + mpDDB->ImplGetScreen(), + mpDDB->ImplGetDepth(), + 0, 0, + mpDDB->ImplGetWidth(), + mpDDB->ImplGetHeight(), + mbGrey + ); } return mpDIB; @@ -905,11 +979,11 @@ bool X11SalBitmap::GetSystemData( BitmapSystemData& rData ) // - ImplSalDDB - // -------------- -ImplSalDDB::ImplSalDDB( XImage* pImage, Drawable aDrawable, int nScreen, const SalTwoRect& rTwoRect ) : - maPixmap ( 0 ), - maTwoRect ( rTwoRect ), - mnDepth ( pImage->depth ), - mnScreen ( nScreen ) +ImplSalDDB::ImplSalDDB( XImage* pImage, Drawable aDrawable, int nScreen, const SalTwoRect& rTwoRect ) + : maPixmap ( 0 ) + , maTwoRect ( rTwoRect ) + , mnDepth ( pImage->depth ) + , mnScreen ( nScreen ) { SalDisplay* pSalDisp = GetX11SalData()->GetDisplay(); Display* pXDisp = pSalDisp->GetDisplay(); @@ -937,8 +1011,8 @@ ImplSalDDB::ImplSalDDB( XImage* pImage, Drawable aDrawable, int nScreen, const S // ----------------------------------------------------------------------------------------- // create from XImage -ImplSalDDB::ImplSalDDB (Display* pDisplay, XLIB_Window hWindow, int nScreen, XImage* pImage) : - mnScreen( nScreen ) +ImplSalDDB::ImplSalDDB (Display* pDisplay, XLIB_Window hWindow, int nScreen, XImage* pImage) + : mnScreen( nScreen ) { maPixmap = XCreatePixmap (pDisplay, hWindow, pImage->width, pImage->height, pImage->depth); if (maPixmap != 0) @@ -975,9 +1049,16 @@ ImplSalDDB::ImplSalDDB (Display* pDisplay, XLIB_Window hWindow, int nScreen, XIm // ----------------------------------------------------------------------------- -ImplSalDDB::ImplSalDDB( Drawable aDrawable, int nScreen, long nDrawableDepth, long nX, long nY, long nWidth, long nHeight ) : - mnDepth( nDrawableDepth ), - mnScreen( nScreen ) +ImplSalDDB::ImplSalDDB( + Drawable aDrawable, + int nScreen, + long nDrawableDepth, + long nX, + long nY, + long nWidth, + long nHeight +) : mnDepth( nDrawableDepth ) + , mnScreen( nScreen ) { SalDisplay* pSalDisp = GetX11SalData()->GetDisplay(); Display* pXDisp = pSalDisp->GetDisplay(); @@ -1023,18 +1104,26 @@ bool ImplSalDDB::ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRe if( ( maPixmap != 0 ) && ( ( mnDepth == nDepth ) || ( 1 == mnDepth ) ) && nScreen == mnScreen) { - if( rTwoRect.mnSrcX == maTwoRect.mnSrcX && rTwoRect.mnSrcY == maTwoRect.mnSrcY && - rTwoRect.mnSrcWidth == maTwoRect.mnSrcWidth && rTwoRect.mnSrcHeight == maTwoRect.mnSrcHeight && - rTwoRect.mnDestWidth == maTwoRect.mnDestWidth && rTwoRect.mnDestHeight == maTwoRect.mnDestHeight ) + if ( rTwoRect.mnSrcX == maTwoRect.mnSrcX + && rTwoRect.mnSrcY == maTwoRect.mnSrcY + && rTwoRect.mnSrcWidth == maTwoRect.mnSrcWidth + && rTwoRect.mnSrcHeight == maTwoRect.mnSrcHeight + && rTwoRect.mnDestWidth == maTwoRect.mnDestWidth + && rTwoRect.mnDestHeight == maTwoRect.mnDestHeight + ) { // absolutely indentically bRet = sal_True; } - else if( rTwoRect.mnSrcWidth == rTwoRect.mnDestWidth && rTwoRect.mnSrcHeight == rTwoRect.mnDestHeight && - maTwoRect.mnSrcWidth == maTwoRect.mnDestWidth && maTwoRect.mnSrcHeight == maTwoRect.mnDestHeight && - rTwoRect.mnSrcX >= maTwoRect.mnSrcX && rTwoRect.mnSrcY >= maTwoRect.mnSrcY && - ( rTwoRect.mnSrcX + rTwoRect.mnSrcWidth ) <= ( maTwoRect.mnSrcX + maTwoRect.mnSrcWidth ) && - ( rTwoRect.mnSrcY + rTwoRect.mnSrcHeight ) <= ( maTwoRect.mnSrcY + maTwoRect.mnSrcHeight ) ) + else if( rTwoRect.mnSrcWidth == rTwoRect.mnDestWidth + && rTwoRect.mnSrcHeight == rTwoRect.mnDestHeight + && maTwoRect.mnSrcWidth == maTwoRect.mnDestWidth + && maTwoRect.mnSrcHeight == maTwoRect.mnDestHeight + && rTwoRect.mnSrcX >= maTwoRect.mnSrcX + && rTwoRect.mnSrcY >= maTwoRect.mnSrcY + && ( rTwoRect.mnSrcX + rTwoRect.mnSrcWidth ) <= ( maTwoRect.mnSrcX + maTwoRect.mnSrcWidth ) + && ( rTwoRect.mnSrcY + rTwoRect.mnSrcHeight ) <= ( maTwoRect.mnSrcY + maTwoRect.mnSrcHeight ) + ) { bRet = sal_True; } @@ -1045,7 +1134,12 @@ bool ImplSalDDB::ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRe // ----------------------------------------------------------------------------- -void ImplSalDDB::ImplDraw( Drawable aDrawable, long nDrawableDepth, const SalTwoRect& rTwoRect, const GC& rGC ) const +void ImplSalDDB::ImplDraw( + Drawable aDrawable, + long nDrawableDepth, + const SalTwoRect& rTwoRect, + const GC& rGC +) const { ImplDraw( maPixmap, mnDepth, aDrawable, nDrawableDepth, rTwoRect.mnSrcX - maTwoRect.mnSrcX, rTwoRect.mnSrcY - maTwoRect.mnSrcY, @@ -1055,12 +1149,19 @@ void ImplSalDDB::ImplDraw( Drawable aDrawable, long nDrawableDepth, const SalTwo // ----------------------------------------------------------------------------- -void ImplSalDDB::ImplDraw( Drawable aSrcDrawable, long nSrcDrawableDepth, - Drawable aDstDrawable, long, - long nSrcX, long nSrcY, - long nDestWidth, long nDestHeight, - long nDestX, long nDestY, const GC& rGC ) -{ +void ImplSalDDB::ImplDraw( + Drawable aSrcDrawable, + long nSrcDrawableDepth, + Drawable aDstDrawable, + long, + long nSrcX, + long nSrcY, + long nDestWidth, + long nDestHeight, + long nDestX, + long nDestY, + const GC& rGC +) { SalDisplay* pSalDisp = GetX11SalData()->GetDisplay(); Display* pXDisp = pSalDisp->GetDisplay(); -- cgit v1.2.3 From b2262e8be35d51cc18afeb60486f19576a81adc0 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 19 Jul 2011 00:12:15 +0100 Subject: callcatcher: remove some unused methods --- vcl/inc/vcl/toolbox.hxx | 2 -- vcl/source/window/toolbox.cxx | 46 ------------------------------------------- 2 files changed, 48 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/toolbox.hxx b/vcl/inc/vcl/toolbox.hxx index 4542a51984b7..dd482c610d95 100644 --- a/vcl/inc/vcl/toolbox.hxx +++ b/vcl/inc/vcl/toolbox.hxx @@ -265,8 +265,6 @@ private: using Window::ImplInvalidate; SAL_DLLPRIVATE void ImplInvalidate( sal_Bool bNewCalc = sal_False, sal_Bool bFullPaint = sal_False ); SAL_DLLPRIVATE void ImplUpdateItem( sal_uInt16 nIndex = 0xFFFF ); - SAL_DLLPRIVATE void ImplStartCustomizeMode(); - SAL_DLLPRIVATE void ImplEndCustomizeMode(); SAL_DLLPRIVATE const XubString& ImplConvertMenuString( const XubString& rStr ); SAL_DLLPRIVATE sal_Bool ImplHandleMouseMove( const MouseEvent& rMEvt, sal_Bool bRepeat = sal_False ); SAL_DLLPRIVATE sal_Bool ImplHandleMouseButtonUp( const MouseEvent& rMEvt, sal_Bool bCancel = sal_False ); diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 288cbe103afe..742d821a1f7e 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -3768,52 +3768,6 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_uInt16 nHighlight, sal_Bool bPa // ----------------------------------------------------------------------- -void ToolBox::ImplStartCustomizeMode() -{ - mbCustomizeMode = sal_True; - - mpData->ImplClearLayoutData(); - - std::vector< ImplToolItem >::const_iterator it = mpData->m_aItems.begin(); - while ( it != mpData->m_aItems.end() ) - { - if ( it->mbShowWindow ) - { - it->mpWindow->Hide(); - - if ( !(it->maRect.IsEmpty()) ) - Invalidate( it->maRect ); - } - - ++it; - } -} - -// ----------------------------------------------------------------------- - -void ToolBox::ImplEndCustomizeMode() -{ - mbCustomizeMode = sal_False; - - mpData->ImplClearLayoutData(); - - std::vector< ImplToolItem >::const_iterator it = mpData->m_aItems.begin(); - while ( it != mpData->m_aItems.end() ) - { - if ( it->mbShowWindow ) - { - if ( !(it->maRect.IsEmpty()) ) - Invalidate( it->maRect ); - - it->mpWindow->Show(); - } - - ++it; - } -} - -// ----------------------------------------------------------------------- - void ToolBox::ImplDrawFloatwinBorder( ImplToolItem* pItem ) { if ( !pItem->maRect.IsEmpty() ) -- cgit v1.2.3 From 21cd1cd2c640aa923e6ee39acf0325c7e84487d6 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 19 Jul 2011 13:39:34 +0100 Subject: Resolves: rhbz#715549 use fontconfig's detected format when available --- vcl/inc/vcl/fontmanager.hxx | 2 +- vcl/unx/generic/fontmanager/fontconfig.cxx | 12 ++++- vcl/unx/generic/fontmanager/fontmanager.cxx | 81 ++++++++++++++++++----------- 3 files changed, 62 insertions(+), 33 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/fontmanager.hxx b/vcl/inc/vcl/fontmanager.hxx index 145c4d0a2169..467297668b5a 100644 --- a/vcl/inc/vcl/fontmanager.hxx +++ b/vcl/inc/vcl/fontmanager.hxx @@ -333,7 +333,7 @@ class VCL_PLUGIN_PUBLIC PrintFontManager void getFontAttributesFromXLFD( PrintFont* pFont, const std::list< rtl::OString >& rXLFDs ) const; - bool analyzeFontFile( int nDirID, const rtl::OString& rFileName, const std::list< rtl::OString >& rXLFDs, std::list< PrintFont* >& rNewFonts ) const; + bool analyzeFontFile( int nDirID, const rtl::OString& rFileName, const std::list< rtl::OString >& rXLFDs, std::list< PrintFont* >& rNewFonts, const char *pFormat=NULL ) const; rtl::OUString convertTrueTypeName( void* pNameRecord ) const; // actually a NameRecord* formt font subsetting code void analyzeTrueTypeFamilyName( void* pTTFont, std::list< rtl::OUString >& rnames ) const; // actually a TrueTypeFont* from font subsetting code bool analyzeTrueTypeFile( PrintFont* pFont ) const; diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx index 66faa526872c..38a5e93e56f3 100644 --- a/vcl/unx/generic/fontmanager/fontconfig.cxx +++ b/vcl/unx/generic/fontmanager/fontconfig.cxx @@ -68,6 +68,9 @@ using namespace psp; #ifndef FC_EMBOLDEN #define FC_EMBOLDEN "embolden" #endif +#ifndef FC_FONTFORMAT + #define FC_FONTFORMAT "fontformat" +#endif #include #include @@ -467,6 +470,7 @@ int PrintFontManager::countFontconfigFonts( boost::unordered_mapfonts[i], FC_SPACING, 0, &spacing); FcResult eOutRes = FcPatternGetBool(pFSet->fonts[i], FC_OUTLINE, 0, &outline); FcResult eIndexRes = FcPatternGetInteger(pFSet->fonts[i], FC_INDEX, 0, &nCollectionEntry); + FcResult eFormatRes = FcPatternGetString(pFSet->fonts[i], FC_FONTFORMAT, 0, &format); if( eFileRes != FcResultMatch || eFamilyRes != FcResultMatch || eOutRes != FcResultMatch ) continue; @@ -488,13 +493,14 @@ int PrintFontManager::countFontconfigFonts( boost::unordered_map 2) fprintf( stderr, "found font \"%s\" in file %s\n" " weight = %d, slant = %d, style = \"%s\"\n" - " spacing = %d, outline = %d\n" + " spacing = %d, outline = %d, format %s\n" , family, file , eWeightRes == FcResultMatch ? weight : -1 , eSpacRes == FcResultMatch ? slant : -1 , eStyleRes == FcResultMatch ? (const char*) style : "" , eSpacRes == FcResultMatch ? spacing : -1 , eOutRes == FcResultMatch ? outline : -1 + , eFormatRes == FcResultMatch ? (const char*)format : "" ); #endif @@ -529,7 +535,9 @@ int PrintFontManager::countFontconfigFonts( boost::unordered_map aDummy; - analyzeFontFile( nDirID, aBase, aDummy, aFonts ); + if (eFormatRes != FcResultMatch) + format = NULL; + analyzeFontFile( nDirID, aBase, aDummy, aFonts, (const char*)format ); #if OSL_DEBUG_LEVEL > 1 if( aFonts.empty() ) fprintf( stderr, "Warning: file \"%s\" is unusable to psprint\n", aOrgPath.getStr() ); diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx index 1427daedb193..8936df327aeb 100644 --- a/vcl/unx/generic/fontmanager/fontmanager.cxx +++ b/vcl/unx/generic/fontmanager/fontmanager.cxx @@ -1281,9 +1281,12 @@ int PrintFontManager::addFontFile( const ::rtl::OString& rFileName, int /*nFaceN return nFontId; } -// ------------------------------------------------------------------------- +enum fontFormat +{ + UNKNOWN, TRUETYPE, CFF, TYPE1, AFM +}; -bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, const ::std::list& rXLFDs, ::std::list< PrintFontManager::PrintFont* >& rNewFonts ) const +bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, const ::std::list& rXLFDs, ::std::list< PrintFontManager::PrintFont* >& rNewFonts, const char *pFormat ) const { rNewFonts.clear(); @@ -1297,8 +1300,32 @@ bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, co if( access( aFullPath.getStr(), R_OK ) ) return false; - ByteString aExt( rFontFile.copy( rFontFile.lastIndexOf( '.' )+1 ) ); - if( aExt.EqualsIgnoreCaseAscii( "pfb" ) || aExt.EqualsIgnoreCaseAscii( "pfa" ) ) + fontFormat eFormat = UNKNOWN; + if (pFormat) + { + if (!strcmp(pFormat, "TrueType")) + eFormat = TRUETYPE; + else if (!strcmp(pFormat, "CFF")) + eFormat = CFF; + else if (!strcmp(pFormat, "Type 1")) + eFormat = TYPE1; + } + if (eFormat == UNKNOWN) + { + ByteString aExt( rFontFile.copy( rFontFile.lastIndexOf( '.' )+1 ) ); + if( aExt.EqualsIgnoreCaseAscii( "pfb" ) || aExt.EqualsIgnoreCaseAscii( "pfa" ) ) + eFormat = TYPE1; + else if( aExt.EqualsIgnoreCaseAscii( "afm" ) ) + eFormat = AFM; + else if( aExt.EqualsIgnoreCaseAscii( "ttf" ) + || aExt.EqualsIgnoreCaseAscii( "ttc" ) + || aExt.EqualsIgnoreCaseAscii( "tte" ) ) // #i33947# for Gaiji support + eFormat = TRUETYPE; + else if( aExt.EqualsIgnoreCaseAscii( "otf" ) ) // check for TTF- and PS-OpenType too + eFormat = CFF; + } + + if (eFormat == TYPE1) { // check for corresponding afm metric // first look for an adjacent file @@ -1352,7 +1379,7 @@ bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, co } } } - else if( aExt.EqualsIgnoreCaseAscii( "afm" ) ) + else if (eFormat == AFM) { ByteString aFilePath( aDir ); aFilePath.Append( '/' ); @@ -1365,34 +1392,14 @@ bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, co else delete pFont; } - else if( aExt.EqualsIgnoreCaseAscii( "ttf" ) - || aExt.EqualsIgnoreCaseAscii( "tte" ) // #i33947# for Gaiji support - || aExt.EqualsIgnoreCaseAscii( "otf" ) ) // check for TTF- and PS-OpenType too - { - TrueTypeFontFile* pFont = new TrueTypeFontFile(); - pFont->m_nDirectory = nDirID; - pFont->m_aFontFile = rFontFile; - pFont->m_nCollectionEntry = -1; - - if( rXLFDs.size() ) - getFontAttributesFromXLFD( pFont, rXLFDs ); - // need to read the font anyway to get aliases inside the font file - if( ! analyzeTrueTypeFile( pFont ) ) - { - delete pFont; - pFont = NULL; - } - else - rNewFonts.push_back( pFont ); - } - else if( aExt.EqualsIgnoreCaseAscii( "ttc" ) ) + else if (eFormat == TRUETYPE || eFormat == CFF) { // get number of ttc entries int nLength = CountTTCFonts( aFullPath.getStr() ); if( nLength ) { #if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "%s contains %d fonts\n", aFullPath.getStr(), nLength ); + fprintf( stderr, "ttc: %s contains %d fonts\n", aFullPath.getStr(), nLength ); #endif for( int i = 0; i < nLength; i++ ) { @@ -1411,10 +1418,24 @@ bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, co rNewFonts.push_back( pFont ); } } -#if OSL_DEBUG_LEVEL > 1 else - fprintf( stderr, "CountTTCFonts( \"%s/%s\" ) failed\n", getDirectory(nDirID).getStr(), rFontFile.getStr() ); -#endif + { + TrueTypeFontFile* pFont = new TrueTypeFontFile(); + pFont->m_nDirectory = nDirID; + pFont->m_aFontFile = rFontFile; + pFont->m_nCollectionEntry = -1; + + if( rXLFDs.size() ) + getFontAttributesFromXLFD( pFont, rXLFDs ); + // need to read the font anyway to get aliases inside the font file + if( ! analyzeTrueTypeFile( pFont ) ) + { + delete pFont; + pFont = NULL; + } + else + rNewFonts.push_back( pFont ); + } } return ! rNewFonts.empty(); } -- cgit v1.2.3 From c7272c328892bec2c1adac64fd5b72b157fceb8d Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 20 Jul 2011 12:13:56 +0100 Subject: add GF_ROTL support to cairo vertical rendering --- vcl/unx/generic/gdi/salgdi3.cxx | 77 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 68 insertions(+), 9 deletions(-) (limited to 'vcl') diff --git a/vcl/unx/generic/gdi/salgdi3.cxx b/vcl/unx/generic/gdi/salgdi3.cxx index 25dc002cfdc5..bf95d229e000 100644 --- a/vcl/unx/generic/gdi/salgdi3.cxx +++ b/vcl/unx/generic/gdi/salgdi3.cxx @@ -288,9 +288,18 @@ void* CairoFontsCache::FindCachedFont(const CairoFontsCache::CacheId &rId) return NULL; } +namespace +{ + bool hasRotation(int nRotation) + { + return nRotation != 0; + } +} + void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout ) { std::vector cairo_glyphs; + std::vector glyph_extrarotation; cairo_glyphs.reserve( 256 ); Point aPos; @@ -302,6 +311,19 @@ void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout ) aGlyph.x = aPos.X(); aGlyph.y = aPos.Y(); cairo_glyphs.push_back(aGlyph); + + switch (aGlyphId & GF_ROTMASK) + { + case GF_ROTL: // left + glyph_extrarotation.push_back(900); + break; + case GF_ROTR: // right + glyph_extrarotation.push_back(-900); + break; + default: + glyph_extrarotation.push_back(0); + break; + } } if (cairo_glyphs.empty()) @@ -373,19 +395,56 @@ void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout ) cairo_matrix_t m; const ImplFontSelectData& rFSD = rFont.GetFontSelData(); - int nWidth = rFSD.mnWidth ? rFSD.mnWidth : rFSD.mnHeight; + int nHeight = rFSD.mnHeight; + int nWidth = rFSD.mnWidth ? rFSD.mnWidth : nHeight; + + std::vector::const_iterator aEnd = glyph_extrarotation.end(); + std::vector::const_iterator aStart = glyph_extrarotation.begin(); + std::vector::const_iterator aI = aStart; + while (aI != aEnd) + { + int nGlyphRotation = *aI; - cairo_matrix_init_identity(&m); + std::vector::const_iterator aNext = std::find_if(aI+1, aEnd, hasRotation); - if (rLayout.GetOrientation()) - cairo_matrix_rotate(&m, (3600 - rLayout.GetOrientation()) * M_PI / 1800.0); + cairo_matrix_init_identity(&m); - cairo_matrix_scale(&m, nWidth, rFSD.mnHeight); - if (rFont.NeedsArtificialItalic()) - m.xy = -m.xx * 0x6000L / 0x10000L; + if (rFont.NeedsArtificialItalic()) + m.xy = -m.xx * 0x6000L / 0x10000L; + + if (rLayout.GetOrientation()) + cairo_matrix_rotate(&m, (3600 - rLayout.GetOrientation()) * M_PI / 1800.0); + + cairo_matrix_scale(&m, nWidth, nHeight); + + if (nGlyphRotation) + { + cairo_matrix_rotate(&m, (3600 - nGlyphRotation) * M_PI / 1800.0); + + cairo_font_extents_t extents; + cairo_font_extents(cr, &extents); + //gives the same positions as pre-cairo conversion, but I don't like them + double xdiff = -extents.descent/(extents.height+extents.descent); + cairo_matrix_translate(&m, xdiff, 1); + } + + cairo_set_font_matrix(cr, &m); + size_t nStartIndex = std::distance(aStart, aI); + size_t nLen = std::distance(aI, aNext); + cairo_show_glyphs(cr, &cairo_glyphs[nStartIndex], nLen); + +#if OSL_DEBUG_LEVEL > 2 + //draw origin + cairo_save (cr); + cairo_rectangle (cr, cairo_glyphs[nStartIndex].x, cairo_glyphs[nStartIndex].y, 5, 5); + cairo_set_source_rgba (cr, 1, 0, 0, 0.80); + cairo_fill (cr); + cairo_restore (cr); +#endif + + aI = aNext; + } - cairo_set_font_matrix(cr, &m); - cairo_show_glyphs(cr, &cairo_glyphs[0], cairo_glyphs.size()); cairo_destroy(cr); } -- cgit v1.2.3 From a82d0899abaffa7d7e535eeb4850746f1d4cd566 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 20 Jul 2011 12:19:38 +0100 Subject: don't prohibit rendering text with cairo due to antialias advice anymore --- vcl/unx/generic/gdi/salgdi3.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vcl') diff --git a/vcl/unx/generic/gdi/salgdi3.cxx b/vcl/unx/generic/gdi/salgdi3.cxx index bf95d229e000..4934ed7f83fa 100644 --- a/vcl/unx/generic/gdi/salgdi3.cxx +++ b/vcl/unx/generic/gdi/salgdi3.cxx @@ -246,7 +246,7 @@ namespace { bool isCairoRenderable(const ServerFont& rFont) { - return rFont.GetFtFace() && rFont.GetAntialiasAdvice(); + return rFont.GetFtFace(); } } //namespace -- cgit v1.2.3 From 5ff29e7a9302c51ca5a41d398ee247141bcde11d Mon Sep 17 00:00:00 2001 From: Joseph Powers Date: Wed, 20 Jul 2011 05:26:52 -0700 Subject: Replace List with std::list< ImplBmpObj* > MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bool should be set to "false" & "true" not the sal_ versions of them. Special thanks go to Matúš Kukan for compiling and help fixing the patch. --- vcl/inc/unx/salbmp.h | 6 ++++- vcl/unx/generic/gdi/salbmp.cxx | 59 +++++++++++++++++++++++++----------------- 2 files changed, 40 insertions(+), 25 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/unx/salbmp.h b/vcl/inc/unx/salbmp.h index 42230d8bbde7..0fa69ae5a72f 100644 --- a/vcl/inc/unx/salbmp.h +++ b/vcl/inc/unx/salbmp.h @@ -36,6 +36,7 @@ #include #include #include +#include struct BitmapBuffer; class BitmapPalette; @@ -246,11 +247,14 @@ public: // - ImplSalBitmapCache - // ---------------------- +struct ImplBmpObj; + class ImplSalBitmapCache { private: + typedef ::std::list< ImplBmpObj* > BmpList_impl; - List maBmpList; + BmpList_impl maBmpList; sal_uIntPtr mnTotalSize; public: diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx index 0b9e69abb940..22a5d1eddb26 100644 --- a/vcl/unx/generic/gdi/salbmp.cxx +++ b/vcl/unx/generic/gdi/salbmp.cxx @@ -826,14 +826,14 @@ bool X11SalBitmap::Create( const SalBitmap& rSSalBmp ) bool X11SalBitmap::Create( const SalBitmap&, SalGraphics* ) { - return sal_False; + return false; } // ----------------------------------------------------------------------------- bool X11SalBitmap::Create( const SalBitmap&, sal_uInt16 ) { - return sal_False; + return false; } // ----------------------------------------------------------------------------- @@ -1100,7 +1100,7 @@ ImplSalDDB::~ImplSalDDB() bool ImplSalDDB::ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRect ) const { - bool bRet = sal_False; + bool bRet = false; if( ( maPixmap != 0 ) && ( ( mnDepth == nDepth ) || ( 1 == mnDepth ) ) && nScreen == mnScreen) { @@ -1113,7 +1113,7 @@ bool ImplSalDDB::ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRe ) { // absolutely indentically - bRet = sal_True; + bRet = true; } else if( rTwoRect.mnSrcWidth == rTwoRect.mnDestWidth && rTwoRect.mnSrcHeight == rTwoRect.mnDestHeight @@ -1125,7 +1125,7 @@ bool ImplSalDDB::ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRe && ( rTwoRect.mnSrcY + rTwoRect.mnSrcHeight ) <= ( maTwoRect.mnSrcY + maTwoRect.mnSrcHeight ) ) { - bRet = sal_True; + bRet = true; } } @@ -1209,12 +1209,18 @@ ImplSalBitmapCache::~ImplSalBitmapCache() void ImplSalBitmapCache::ImplAdd( X11SalBitmap* pBmp, sal_uLong nMemSize, sal_uLong nFlags ) { - ImplBmpObj* pObj; - bool bFound = sal_False; - - for( pObj = (ImplBmpObj*) maBmpList.Last(); pObj && !bFound; pObj = (ImplBmpObj*) maBmpList.Prev() ) + ImplBmpObj* pObj = NULL; + bool bFound = false; + + for( + BmpList_impl::iterator it = maBmpList.begin(); + (it != maBmpList.end() ) && !bFound ; + ++it + ) { + pObj = *it; if( pObj->mpBmp == pBmp ) - bFound = sal_True; + bFound = true; + } mnTotalSize += nMemSize; @@ -1224,21 +1230,24 @@ void ImplSalBitmapCache::ImplAdd( X11SalBitmap* pBmp, sal_uLong nMemSize, sal_uL pObj->mnMemSize = nMemSize, pObj->mnFlags = nFlags; } else - maBmpList.Insert( new ImplBmpObj( pBmp, nMemSize, nFlags ), LIST_APPEND ); + maBmpList.push_back( new ImplBmpObj( pBmp, nMemSize, nFlags ) ); } // ----------------------------------------------------------------------------- void ImplSalBitmapCache::ImplRemove( X11SalBitmap* pBmp ) { - for( ImplBmpObj* pObj = (ImplBmpObj*) maBmpList.Last(); pObj; pObj = (ImplBmpObj*) maBmpList.Prev() ) - { - if( pObj->mpBmp == pBmp ) + for( + BmpList_impl::iterator it = maBmpList.begin(); + it != maBmpList.end(); + ++it + ) { + if( (*it)->mpBmp == pBmp ) { - maBmpList.Remove( pObj ); - pObj->mpBmp->ImplRemovedFromCache(); - mnTotalSize -= pObj->mnMemSize; - delete pObj; + (*it)->mpBmp->ImplRemovedFromCache(); + mnTotalSize -= (*it)->mnMemSize; + delete *it; + maBmpList.erase( it ); break; } } @@ -1248,13 +1257,15 @@ void ImplSalBitmapCache::ImplRemove( X11SalBitmap* pBmp ) void ImplSalBitmapCache::ImplClear() { - for( ImplBmpObj* pObj = (ImplBmpObj*) maBmpList.First(); pObj; pObj = (ImplBmpObj*) maBmpList.Next() ) - { - pObj->mpBmp->ImplRemovedFromCache(); - delete pObj; + for( + BmpList_impl::iterator it = maBmpList.begin(); + it != maBmpList.end(); + ++it + ) { + (*it)->mpBmp->ImplRemovedFromCache(); + delete *it; } - - maBmpList.Clear(); + maBmpList.clear(); mnTotalSize = 0; } -- cgit v1.2.3 From 63bd3f537793e83adccbccc6936ca730138d9aae Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Tue, 19 Jul 2011 15:10:17 +0200 Subject: callcatcher: cleanup Application::Foo --- vcl/inc/vcl/svapp.hxx | 14 ----- vcl/source/app/svapp.cxx | 140 ----------------------------------------------- 2 files changed, 154 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/svapp.hxx b/vcl/inc/vcl/svapp.hxx index 20eec8a9811e..d0212fbc4d37 100644 --- a/vcl/inc/vcl/svapp.hxx +++ b/vcl/inc/vcl/svapp.hxx @@ -232,8 +232,6 @@ public: virtual void InitFinished(); virtual void DeInit(); - static void InitAppRes( const ResId& rResId ); - static sal_uInt16 GetCommandLineParamCount(); static XubString GetCommandLineParam( sal_uInt16 nParam ); static const XubString& GetAppFileName(); @@ -256,7 +254,6 @@ public: static sal_Bool IsInMain(); static sal_Bool IsInExecute(); - static sal_Bool IsShutDown(); static sal_Bool IsInModalMode(); static sal_uInt16 GetModalModeCount(); @@ -264,7 +261,6 @@ public: static sal_Bool AnyInput( sal_uInt16 nType = INPUT_ANY ); static sal_uLong GetLastInputInterval(); static sal_Bool IsUICaptured(); - static sal_Bool IsUserActive( sal_uInt16 nTest = USERACTIVE_ALL ); virtual void SystemSettingsChanging( AllSettings& rSettings, Window* pFrame ); @@ -300,7 +296,6 @@ public: static void RemoveMouseAndKeyEvents( Window *pWin ); static sal_Bool IsProcessedMouseOrKeyEvent( sal_uLong nEventId ); - static sal_uLong PostUserEvent( sal_uLong nEvent, void* pEventData = NULL ); static sal_uLong PostUserEvent( const Link& rLink, void* pCaller = NULL ); static sal_Bool PostUserEvent( sal_uLong& rEventId, sal_uLong nEvent, void* pEventData = NULL ); static sal_Bool PostUserEvent( sal_uLong& rEventId, const Link& rLink, void* pCaller = NULL ); @@ -357,16 +352,11 @@ public: static sal_Bool InsertAccel( Accelerator* pAccel ); static void RemoveAccel( Accelerator* pAccel ); - static void FlushAccel(); static sal_Bool CallAccel( const KeyCode& rKeyCode, sal_uInt16 nRepeat = 0 ); - static sal_uLong AddHotKey( const KeyCode& rKeyCode, const Link& rLink, void* pData = NULL ); - static void RemoveHotKey( sal_uLong nId ); static sal_uLong AddEventHook( VCLEventHookProc pProc, void* pData = NULL ); static void RemoveEventHook( sal_uLong nId ); static long CallEventHooks( NotifyEvent& rEvt ); - static long CallPreNotify( NotifyEvent& rEvt ); - static long CallEvent( NotifyEvent& rEvt ); static void SetHelp( Help* pHelp = NULL ); static Help* GetHelp(); @@ -390,9 +380,7 @@ public: static sal_uInt16 GetSystemWindowMode(); static void SetDialogScaleX( short nScale ); - static short GetDialogScaleX(); - static void SetFontPath( const String& rPath ); static const String& GetFontPath(); static UniqueItemId CreateUniqueId(); @@ -407,8 +395,6 @@ public: static void SetFilterHdl( const Link& rLink ); static const Link& GetFilterHdl(); - static sal_Bool IsAccessibilityEnabled(); - static void EnableHeadlessMode( sal_Bool bEnable = sal_True ); static sal_Bool IsHeadlessModeEnabled(); diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index e6619cbfd20b..dc63f172d87a 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -241,12 +241,6 @@ Application::~Application() // ----------------------------------------------------------------------- -void Application::InitAppRes( const ResId& ) -{ -} - -// ----------------------------------------------------------------------- - sal_Bool Application::QueryExit() { WorkWindow* pAppWin = ImplGetSVData()->maWinData.mpAppWin; @@ -549,13 +543,6 @@ sal_Bool Application::IsInExecute() // ----------------------------------------------------------------------- -sal_Bool Application::IsShutDown() -{ - return ImplGetSVData()->maAppData.mbAppQuit; -} - -// ----------------------------------------------------------------------- - sal_Bool Application::IsInModalMode() { return (ImplGetSVData()->maAppData.mnModalMode != 0); @@ -609,34 +596,6 @@ sal_Bool Application::IsUICaptured() // ----------------------------------------------------------------------- -sal_Bool Application::IsUserActive( sal_uInt16 nTest ) -{ - if ( nTest & (USERACTIVE_MOUSEDRAG | USERACTIVE_INPUT) ) - { - if ( IsUICaptured() ) - return sal_True; - } - - if ( nTest & USERACTIVE_INPUT ) - { - if ( GetLastInputInterval() < 500 ) - return sal_True; - - if ( AnyInput( INPUT_KEYBOARD ) ) - return sal_True; - } - - if ( nTest & USERACTIVE_MODALDIALOG ) - { - if ( ImplGetSVData()->maAppData.mnModalDialog ) - return sal_True; - } - - return sal_False; -} - -// ----------------------------------------------------------------------- - void Application::SystemSettingsChanging( AllSettings& /*rSettings*/, Window* /*pFrame*/ ) { @@ -1064,15 +1023,6 @@ sal_Bool Application::IsProcessedMouseOrKeyEvent( sal_uLong nEventId ) // ----------------------------------------------------------------------- -sal_uLong Application::PostUserEvent( sal_uLong nEvent, void* pEventData ) -{ - sal_uLong nEventId; - PostUserEvent( nEventId, nEvent, pEventData ); - return nEventId; -} - -// ----------------------------------------------------------------------- - sal_uLong Application::PostUserEvent( const Link& rLink, void* pCaller ) { sal_uLong nEventId; @@ -1453,16 +1403,6 @@ void Application::RemoveAccel( Accelerator* pAccel ) // ----------------------------------------------------------------------- -void Application::FlushAccel() -{ - ImplSVData* pSVData = ImplGetSVData(); - - if ( pSVData->maAppData.mpAccelMgr ) - pSVData->maAppData.mpAccelMgr->FlushAccel(); -} - -// ----------------------------------------------------------------------- - sal_Bool Application::CallAccel( const KeyCode& rKeyCode, sal_uInt16 nRepeat ) { ImplSVData* pSVData = ImplGetSVData(); @@ -1535,13 +1475,6 @@ void Application::SetDialogScaleX( short nScale ) // ----------------------------------------------------------------------- -short Application::GetDialogScaleX() -{ - return ImplGetSVData()->maAppData.mnDialogScaleX; -} - -// ----------------------------------------------------------------------- - void Application::SetDefDialogParent( Window* pWindow ) { ImplGetSVData()->maWinData.mpDefDialogParent = pWindow; @@ -1663,19 +1596,6 @@ const String& Application::GetFontPath() // ----------------------------------------------------------------------- -void Application::SetFontPath( const String& rPath ) -{ - ImplSVData* pSVData = ImplGetSVData(); - - // if it doesn't exist create a new one - if( !pSVData->maAppData.mpFontPath ) - pSVData->maAppData.mpFontPath = new String( rPath ); - else - *(pSVData->maAppData.mpFontPath) = rPath; -} - -// ----------------------------------------------------------------------- - UniqueItemId Application::CreateUniqueId() { ImplSVData* pSVData = ImplGetSVData(); @@ -1801,47 +1721,6 @@ void ImplFreeHotKeyData() // ----------------------------------------------------------------------- -sal_uIntPtr Application::AddHotKey( const KeyCode& rKeyCode, const Link& rLink, void* pData ) -{ - ImplSVData* pSVData = ImplGetSVData(); - ImplHotKey* pHotKeyData = new ImplHotKey; - pHotKeyData->mpUserData = pData; - pHotKeyData->maKeyCode = rKeyCode; - pHotKeyData->maLink = rLink; - pHotKeyData->mpNext = pSVData->maAppData.mpFirstHotKey; - pSVData->maAppData.mpFirstHotKey = pHotKeyData; - return (sal_uIntPtr)pHotKeyData; -} - -// ----------------------------------------------------------------------- - -void Application::RemoveHotKey( sal_uIntPtr nId ) -{ - ImplSVData* pSVData = ImplGetSVData(); - ImplHotKey* pFindHotKeyData = (ImplHotKey*)nId; - ImplHotKey* pPrevHotKeyData = NULL; - ImplHotKey* pHotKeyData = pSVData->maAppData.mpFirstHotKey; - while ( pHotKeyData ) - { - if ( pHotKeyData == pFindHotKeyData ) - { - if ( pPrevHotKeyData ) - pPrevHotKeyData->mpNext = pFindHotKeyData->mpNext; - else - pSVData->maAppData.mpFirstHotKey = pFindHotKeyData->mpNext; - delete pFindHotKeyData; - break; - } - - pPrevHotKeyData = pHotKeyData; - pHotKeyData = pHotKeyData->mpNext; - } - - DBG_ASSERT( pHotKeyData, "Application::RemoveHotKey() - HotKey is not added" ); -} - -// ----------------------------------------------------------------------- - void ImplFreeEventHookData() { ImplSVData* pSVData = ImplGetSVData(); @@ -1919,20 +1798,6 @@ long Application::CallEventHooks( NotifyEvent& rEvt ) // ----------------------------------------------------------------------- -long Application::CallPreNotify( NotifyEvent& rEvt ) -{ - return ImplCallPreNotify( rEvt ); -} - -// ----------------------------------------------------------------------- - -long Application::CallEvent( NotifyEvent& rEvt ) -{ - return ImplCallEvent( rEvt ); -} - -// ----------------------------------------------------------------------- - const LocaleDataWrapper& Application::GetAppLocaleDataWrapper() { return GetSettings().GetLocaleDataWrapper(); @@ -2008,11 +1873,6 @@ void Application::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const r pSVData->mpDefInst->AddToRecentDocumentList(rFileUrl, rMimeType); } -sal_Bool Application::IsAccessibilityEnabled() -{ - return sal_False; -} - sal_Bool InitAccessBridge( sal_Bool bShowCancel, sal_Bool &rCancelled ) { sal_Bool bRet = true; -- cgit v1.2.3 From f79a846c6d2cc1e4213334ec7b47d0e1680bafa7 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Tue, 19 Jul 2011 15:13:16 +0200 Subject: callcatcher: cleanup Animation::Foo --- vcl/inc/vcl/animate.hxx | 3 --- vcl/source/gdi/animate.cxx | 44 -------------------------------------------- 2 files changed, 47 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/animate.hxx b/vcl/inc/vcl/animate.hxx index aaf88c8b6e76..956f63f330f8 100644 --- a/vcl/inc/vcl/animate.hxx +++ b/vcl/inc/vcl/animate.hxx @@ -192,8 +192,6 @@ public: sal_Bool operator!=( const Animation& rAnimation ) const { return !(*this==rAnimation); } - sal_Bool IsEqual( const Animation& rAnimation ) const; - sal_Bool IsEmpty() const; void SetEmpty(); @@ -254,7 +252,6 @@ public: ); sal_Bool Invert(); sal_Bool Mirror( sal_uLong nMirrorFlags ); - sal_Bool Dither( sal_uLong nDitherFlags = BMP_DITHER_MATRIX ); sal_Bool Adjust( short nLuminancePercent = 0, short nContrastPercent = 0, diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx index 8cb6a47d902e..9dcbce01ffaf 100644 --- a/vcl/source/gdi/animate.cxx +++ b/vcl/source/gdi/animate.cxx @@ -190,27 +190,6 @@ sal_Bool Animation::operator==( const Animation& rAnimation ) const // ------------------------------------------------------------------ -sal_Bool Animation::IsEqual( const Animation& rAnimation ) const -{ - const size_t nCount = maList.size(); - sal_Bool bRet = sal_False; - - if( rAnimation.maList.size() == nCount - && rAnimation.maBitmapEx.IsEqual( maBitmapEx ) - && rAnimation.maGlobalSize == maGlobalSize - && rAnimation.meCycleMode == meCycleMode - ) - { - for( size_t n = 0; ( n < nCount ) && !bRet; n++ ) - if( maList[ n ]->IsEqual( *rAnimation.maList[ n ] ) ) - bRet = sal_True; - } - - return bRet; -} - -// ------------------------------------------------------------------ - sal_Bool Animation::IsEmpty() const { return( maBitmapEx.IsEmpty() && maList.empty() ); @@ -763,29 +742,6 @@ sal_Bool Animation::Mirror( sal_uLong nMirrorFlags ) // ----------------------------------------------------------------------- -sal_Bool Animation::Dither( sal_uLong nDitherFlags ) -{ - DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" ); - - sal_Bool bRet; - - if( !IsInAnimation() && !maList.empty() ) - { - bRet = sal_True; - - for( size_t i = 0, n = maList.size(); ( i < n ) && bRet; ++i ) - bRet = maList[ i ]->aBmpEx.Dither( nDitherFlags ); - - maBitmapEx.Dither( nDitherFlags ); - } - else - bRet = sal_False; - - return bRet; -} - -// ----------------------------------------------------------------------- - sal_Bool Animation::Adjust( short nLuminancePercent, short nContrastPercent, short nChannelRPercent, short nChannelGPercent, short nChannelBPercent, double fGamma, sal_Bool bInvert ) -- cgit v1.2.3 From ded34422f2e6cd7b795b7e51828cf9ff3e50b35d Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Tue, 19 Jul 2011 17:23:58 +0200 Subject: callcatcher: cleanup Accelerator --- vcl/inc/vcl/accel.hxx | 15 --- vcl/source/window/accel.cxx | 263 +------------------------------------------- 2 files changed, 5 insertions(+), 273 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/accel.hxx b/vcl/inc/vcl/accel.hxx index cf21000ee08a..79109e08cd4c 100644 --- a/vcl/inc/vcl/accel.hxx +++ b/vcl/inc/vcl/accel.hxx @@ -83,9 +83,6 @@ public: void InsertItem( sal_uInt16 nItemId, const KeyCode& rKeyCode ); void InsertItem( const ResId& rResId ); - void RemoveItem( sal_uInt16 nItemId ); - void RemoveItem( const KeyCode rKeyCode ); - void Clear(); sal_uInt16 GetCurItemId() const { return mnCurId; } const KeyCode& GetCurKeyCode() const { return maCurKeyCode; } @@ -94,21 +91,9 @@ public: sal_uInt16 GetItemCount() const; sal_uInt16 GetItemId( sal_uInt16 nPos ) const; - KeyCode GetItemKeyCode( sal_uInt16 nPos ) const; - sal_uInt16 GetItemId( const KeyCode& rKeyCode ) const; KeyCode GetKeyCode( sal_uInt16 nItemId ) const; - sal_Bool IsIdValid( sal_uInt16 nItemId ) const; - sal_Bool Call( const KeyCode& rKeyCode, sal_uInt16 nRepeat = 0 ); - void SetAccel( sal_uInt16 nItemId, Accelerator* pAccel ); Accelerator* GetAccel( sal_uInt16 nItemId ) const; - void SetAccel( const KeyCode rKeyCode, Accelerator* pAccel ); - Accelerator* GetAccel( const KeyCode rKeyCode ) const; - - void EnableItem( sal_uInt16 nItemId, sal_Bool bEnable = sal_True ); - sal_Bool IsItemEnabled( sal_uInt16 nItemId ) const; - void EnableItem( const KeyCode rKeyCode, sal_Bool bEnable = sal_True ); - sal_Bool IsItemEnabled( const KeyCode rKeyCode ) const; void SetHelpText( const XubString& rHelpText ) { maHelpStr = rHelpText; } const XubString& GetHelpText() const { return maHelpStr; } diff --git a/vcl/source/window/accel.cxx b/vcl/source/window/accel.cxx index ebf15497b229..3fb5aabc4a35 100644 --- a/vcl/source/window/accel.cxx +++ b/vcl/source/window/accel.cxx @@ -410,85 +410,6 @@ void Accelerator::InsertItem( const ResId& rResId ) // ----------------------------------------------------------------------- -void Accelerator::RemoveItem( sal_uInt16 nItemId ) -{ - DBG_CHKTHIS( Accelerator, NULL ); - - // Aus der Id-Liste entfernen - sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId ); - if ( nIndex != ACCELENTRY_NOTFOUND ) - { - sal_uInt16 nItemCount = GetItemCount(); - do - { - ImplAccelEntry* pEntry = ( nIndex < mpData->maIdList.size() ) ? mpData->maIdList[ nIndex ] : NULL; - if ( pEntry && pEntry->mnId == nItemId ) - { - mpData->maKeyTable.Remove( pEntry->maKeyCode.GetFullKeyCode() ); - - ImplAccelList::iterator it = mpData->maIdList.begin(); - ::std::advance( it, nIndex ); - mpData->maIdList.erase( it ); - - // AutoResAccel zerstoeren - if ( pEntry->mpAutoAccel ) - delete pEntry->mpAutoAccel; - - delete pEntry; - } - else - break; - } - while ( nIndex < nItemCount ); - } -} - -// ----------------------------------------------------------------------- - -void Accelerator::RemoveItem( const KeyCode rKeyCode ) -{ - DBG_CHKTHIS( Accelerator, NULL ); - - ImplAccelEntry* pEntry = ImplGetAccelData( rKeyCode ); - if ( pEntry ) - { - // Aus der Id-Liste entfernen - sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), pEntry->mnId ); - sal_uInt16 nItemCount = GetItemCount(); - do - { - if ( mpData->maIdList[ nIndex ] == pEntry ) - break; - nIndex++; - } - while ( nIndex < nItemCount ); - - mpData->maKeyTable.Remove( rKeyCode.GetFullKeyCode() ); - - ImplAccelList::iterator it = mpData->maIdList.begin(); - ::std::advance( it, nIndex ); - mpData->maIdList.erase( it ); - - // AutoResAccel zerstoeren - if ( pEntry->mpAutoAccel ) - delete pEntry->mpAutoAccel; - - delete pEntry; - } -} - -// ----------------------------------------------------------------------- - -void Accelerator::Clear() -{ - DBG_CHKTHIS( Accelerator, NULL ); - - ImplDeleteData(); - mpData->maKeyTable.Clear(); -} - -// ----------------------------------------------------------------------- - sal_uInt16 Accelerator::GetItemCount() const { DBG_CHKTHIS( Accelerator, NULL ); @@ -498,45 +419,6 @@ sal_uInt16 Accelerator::GetItemCount() const // ----------------------------------------------------------------------- -sal_uInt16 Accelerator::GetItemId( sal_uInt16 nPos ) const -{ - DBG_CHKTHIS( Accelerator, NULL ); - - ImplAccelEntry* pEntry = ( nPos < mpData->maIdList.size() ) ? mpData->maIdList[ nPos ] : NULL; - if ( pEntry ) - return pEntry->mnId; - else - return 0; -} - -// ----------------------------------------------------------------------- - -KeyCode Accelerator::GetItemKeyCode( sal_uInt16 nPos ) const -{ - DBG_CHKTHIS( Accelerator, NULL ); - - ImplAccelEntry* pEntry = ( nPos < mpData->maIdList.size() ) ? mpData->maIdList[ nPos ] : NULL; - if ( pEntry ) - return pEntry->maKeyCode; - else - return KeyCode(); -} - -// ----------------------------------------------------------------------- - -sal_uInt16 Accelerator::GetItemId( const KeyCode& rKeyCode ) const -{ - DBG_CHKTHIS( Accelerator, NULL ); - - ImplAccelEntry* pEntry = ImplGetAccelData( rKeyCode ); - if ( pEntry ) - return pEntry->mnId; - else - return 0; -} - -// ----------------------------------------------------------------------- - KeyCode Accelerator::GetKeyCode( sal_uInt16 nItemId ) const { DBG_CHKTHIS( Accelerator, NULL ); @@ -550,66 +432,15 @@ KeyCode Accelerator::GetKeyCode( sal_uInt16 nItemId ) const // ----------------------------------------------------------------------- -sal_Bool Accelerator::IsIdValid( sal_uInt16 nItemId ) const -{ - DBG_CHKTHIS( Accelerator, NULL ); - - sal_uInt16 nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId ); - return (nIndex != ACCELENTRY_NOTFOUND); -} - -// ----------------------------------------------------------------------- - -sal_Bool Accelerator::Call( const KeyCode& rKeyCode, sal_uInt16 nRepeat ) +sal_uInt16 Accelerator::GetItemId( sal_uInt16 nPos ) const { DBG_CHKTHIS( Accelerator, NULL ); - ImplAccelEntry* pEntry = ImplGetAccelData( rKeyCode ); + ImplAccelEntry* pEntry = ( nPos < mpData->maIdList.size() ) ? mpData->maIdList[ nPos ] : NULL; if ( pEntry ) - { - if ( pEntry->mbEnabled ) - { - sal_Bool bDel = sal_False; - mnCurId = pEntry->mnId; - maCurKeyCode = rKeyCode; - mnCurRepeat = nRepeat; - mpDel = &bDel; - Select(); - if ( !bDel ) - { - mnCurId = 0; - maCurKeyCode = KeyCode(); - mnCurRepeat = 0; - } - - return sal_True; - } - } - - return sal_False; -} - -// ----------------------------------------------------------------------- - -void Accelerator::SetAccel( sal_uInt16 nItemId, Accelerator* pAccel ) -{ - DBG_CHKTHIS( Accelerator, NULL ); - - sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId ); - if ( nIndex != ACCELENTRY_NOTFOUND ) - { - sal_uInt16 nItemCount = GetItemCount(); - do - { - ImplAccelEntry* pEntry = mpData->maIdList[ nIndex ]; - if ( pEntry->mnId != nItemId ) - break; - - pEntry->mpAccel = pAccel; - nIndex++; - } - while ( nIndex < nItemCount ); - } + return pEntry->mnId; + else + return 0; } // ----------------------------------------------------------------------- @@ -627,90 +458,6 @@ Accelerator* Accelerator::GetAccel( sal_uInt16 nItemId ) const // ----------------------------------------------------------------------- -void Accelerator::SetAccel( const KeyCode rKeyCode, Accelerator* pAccel ) -{ - DBG_CHKTHIS( Accelerator, NULL ); - - ImplAccelEntry* pEntry = ImplGetAccelData( rKeyCode ); - if ( pEntry ) - pEntry->mpAccel = pAccel; -} - -// ----------------------------------------------------------------------- - -Accelerator* Accelerator::GetAccel( const KeyCode rKeyCode ) const -{ - DBG_CHKTHIS( Accelerator, NULL ); - - ImplAccelEntry* pEntry = ImplGetAccelData( rKeyCode ); - if ( pEntry ) - return pEntry->mpAccel; - else - return sal_False; -} - -// ----------------------------------------------------------------------- - -void Accelerator::EnableItem( sal_uInt16 nItemId, sal_Bool bEnable ) -{ - DBG_CHKTHIS( Accelerator, NULL ); - - sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId ); - if ( nIndex != ACCELENTRY_NOTFOUND ) - { - sal_uInt16 nItemCount = GetItemCount(); - do - { - ImplAccelEntry* pEntry = mpData->maIdList[ nIndex ]; - if ( pEntry->mnId != nItemId ) - break; - - pEntry->mbEnabled = bEnable; - nIndex++; - } - while ( nIndex < nItemCount ); - } -} - -// ----------------------------------------------------------------------- - -sal_Bool Accelerator::IsItemEnabled( sal_uInt16 nItemId ) const -{ - DBG_CHKTHIS( Accelerator, NULL ); - - sal_uInt16 nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId ); - if ( nIndex != ACCELENTRY_NOTFOUND ) - return mpData->maIdList[ nIndex ]->mbEnabled; - else - return sal_False; -} - -// ----------------------------------------------------------------------- - -void Accelerator::EnableItem( const KeyCode rKeyCode, sal_Bool bEnable ) -{ - DBG_CHKTHIS( Accelerator, NULL ); - - ImplAccelEntry* pEntry = ImplGetAccelData( rKeyCode ); - if ( pEntry ) - pEntry->mbEnabled = bEnable; -} - -// ----------------------------------------------------------------------- - -sal_Bool Accelerator::IsItemEnabled( const KeyCode rKeyCode ) const -{ - DBG_CHKTHIS( Accelerator, NULL ); - - ImplAccelEntry* pEntry = ImplGetAccelData( rKeyCode ); - if ( pEntry ) - return pEntry->mbEnabled; - else - return sal_False; -} - -// ----------------------------------------------------------------------- - Accelerator& Accelerator::operator=( const Accelerator& rAccel ) { DBG_CHKTHIS( Accelerator, NULL ); -- cgit v1.2.3 From aa40ec4414ccb3d64f6f72faab84fa127af9974c Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 20 Jul 2011 11:11:47 +0200 Subject: callcatcher: bring Application::PostUserEvent back --- vcl/inc/vcl/svapp.hxx | 1 + vcl/source/app/svapp.cxx | 9 +++++++++ 2 files changed, 10 insertions(+) (limited to 'vcl') diff --git a/vcl/inc/vcl/svapp.hxx b/vcl/inc/vcl/svapp.hxx index d0212fbc4d37..b233a3c07c03 100644 --- a/vcl/inc/vcl/svapp.hxx +++ b/vcl/inc/vcl/svapp.hxx @@ -296,6 +296,7 @@ public: static void RemoveMouseAndKeyEvents( Window *pWin ); static sal_Bool IsProcessedMouseOrKeyEvent( sal_uLong nEventId ); + static sal_uLong PostUserEvent( sal_uLong nEvent, void* pEventData = NULL ); static sal_uLong PostUserEvent( const Link& rLink, void* pCaller = NULL ); static sal_Bool PostUserEvent( sal_uLong& rEventId, sal_uLong nEvent, void* pEventData = NULL ); static sal_Bool PostUserEvent( sal_uLong& rEventId, const Link& rLink, void* pCaller = NULL ); diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index dc63f172d87a..9d54803f7f3b 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -1023,6 +1023,15 @@ sal_Bool Application::IsProcessedMouseOrKeyEvent( sal_uLong nEventId ) // ----------------------------------------------------------------------- +sal_uLong Application::PostUserEvent( sal_uLong nEvent, void* pEventData ) +{ + sal_uLong nEventId; + PostUserEvent( nEventId, nEvent, pEventData ); + return nEventId; +} + +// ----------------------------------------------------------------------- + sal_uLong Application::PostUserEvent( const Link& rLink, void* pCaller ) { sal_uLong nEventId; -- cgit v1.2.3 From cba97d1d22d8cd24ab7fd762832ca42d17b330a7 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 20 Jul 2011 21:59:22 +0100 Subject: callcatcher: unused ThreadExecutor --- vcl/inc/vcl/threadex.hxx | 18 ------------------ vcl/source/helper/threadex.cxx | 40 ---------------------------------------- 2 files changed, 58 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/threadex.hxx b/vcl/inc/vcl/threadex.hxx index 429b43e6ac7c..c5333d847fa1 100644 --- a/vcl/inc/vcl/threadex.hxx +++ b/vcl/inc/vcl/threadex.hxx @@ -39,24 +39,6 @@ namespace vcl { - class VCL_DLLPUBLIC ThreadExecutor - { - oslThread m_aThread; - oslCondition m_aFinish; - long m_nReturn; - - #ifdef THREADEX_IMPLEMENTATION - public: - SAL_DLLPRIVATE static void SAL_CALL worker( void* ); - #endif - public: - ThreadExecutor(); - virtual ~ThreadExecutor(); - - virtual long doIt() = 0; - long execute(); - }; - class VCL_DLLPUBLIC SolarThreadExecutor { oslCondition m_aStart; diff --git a/vcl/source/helper/threadex.cxx b/vcl/source/helper/threadex.cxx index ad351410e2c2..f0db5e3a372f 100644 --- a/vcl/source/helper/threadex.cxx +++ b/vcl/source/helper/threadex.cxx @@ -35,46 +35,6 @@ using namespace vcl; -ThreadExecutor::ThreadExecutor() -{ - m_aFinish = osl_createCondition(); - m_aThread = NULL; -} - -ThreadExecutor::~ThreadExecutor() -{ - osl_destroyCondition( m_aFinish ); - if( m_aThread ) - osl_destroyThread( m_aThread ); -} - -extern "C" -{ - static void call_worker( void* pInstance ) - { - ThreadExecutor::worker( pInstance ); - } -} - -void ThreadExecutor::worker( void* pInstance ) -{ - ThreadExecutor* pThis = ((ThreadExecutor*)pInstance); - pThis->m_nReturn = pThis->doIt(); - osl_setCondition( pThis->m_aFinish ); -} - -long ThreadExecutor::execute() -{ - osl_resetCondition( m_aFinish ); - if( m_aThread ) - osl_destroyThread( m_aThread ), m_aThread = NULL; - m_aThread = osl_createThread( call_worker, this ); - while( ! osl_checkCondition( m_aFinish ) ) - Application::Reschedule(); - return m_nReturn; -} - - SolarThreadExecutor::SolarThreadExecutor() :m_nReturn( 0 ) ,m_bTimeout( false ) -- cgit v1.2.3 From d423fd54604ee9fa60c028528c93d5b6c25fbb71 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 18 Jul 2011 20:30:24 +0300 Subject: Start at trying to build these test programs for iOS --- vcl/workben/makefile.mk | 4 ++++ vcl/workben/svdem.cxx | 2 +- vcl/workben/vcldemo.cxx | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'vcl') diff --git a/vcl/workben/makefile.mk b/vcl/workben/makefile.mk index d52737507a20..810b1fb42a00 100644 --- a/vcl/workben/makefile.mk +++ b/vcl/workben/makefile.mk @@ -49,6 +49,10 @@ OBJFILES= \ # --- Targets ------------------------------------------------------ +.IF "$(OS)" == "IOS" +CFLAGS += -x objective-c++ -fobjc-abi-version=2 -fobjc-legacy-dispatch -D__IPHONE_OS_VERSION_MIN_REQUIRED=40300 +.ENDIF + # svdem APP1NOSAL= TRUE diff --git a/vcl/workben/svdem.cxx b/vcl/workben/svdem.cxx index 4898aed1a995..ee5cbb2ba420 100644 --- a/vcl/workben/svdem.cxx +++ b/vcl/workben/svdem.cxx @@ -51,7 +51,7 @@ void Main(); // ----------------------------------------------------------------------- -SAL_IMPLEMENT_MAIN() +SAL_IMPLEMENT_MAIN_WITH_GUI() { tools::extendApplicationEnvironment(); diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index 547660fa1e1e..3c75c643fe4a 100644 --- a/vcl/workben/vcldemo.cxx +++ b/vcl/workben/vcldemo.cxx @@ -56,7 +56,7 @@ void Main(); // ----------------------------------------------------------------------- -SAL_IMPLEMENT_MAIN() +SAL_IMPLEMENT_MAIN_WITH_GUI() { tools::extendApplicationEnvironment(); -- cgit v1.2.3