diff options
author | Rüdiger Timm <rt@openoffice.org> | 2008-12-09 08:43:20 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2008-12-09 08:43:20 +0000 |
commit | b8db9514147779737d0db35c82a3b680b36e3f9f (patch) | |
tree | ccac9396d5368064c8a9e3dc32f81b6fd39cdf20 /vcl | |
parent | 28bbe98abeef2ca37413405d3d94321353084390 (diff) |
CWS-TOOLING: integrate CWS os2port04
2008-11-27 13:22:38 +0100 ydario r264480 : #i96439#: fix build for unix platforms.
2008-11-26 18:32:42 +0100 ydario r264433 : #i96439#: os2 systemshell code (dummy code).
2008-11-26 16:33:48 +0100 ydario r264421 : #i96439#: vcl fix for pdf export of truetype fonts.
2008-11-26 15:04:44 +0100 ydario r264399 : #i96439#: build macros fix scripts, gcc specific flags.
2008-11-26 15:00:15 +0100 ydario r264398 : #i96439#: vcl source code updates.
2008-11-26 13:21:37 +0100 ydario r264378 : #i96439#: os2 build system fixes.
2008-11-26 13:20:27 +0100 ydario r264377 : #i96439#: configuration and build macros updates.
2008-11-26 13:16:35 +0100 ydario r264375 : #i96439#: new launcher code, build system updates.
2008-11-26 13:12:49 +0100 ydario r264373 : #i96439#: use OSL endian macro.
2008-11-26 12:54:50 +0100 ydario r264371 : #i96439#: os2 build system fixes.
2008-11-26 12:30:46 +0100 ydario r264367 : #i96439#: os2 build system fixes.
2008-11-26 12:09:33 +0100 ydario r264365 : #i96439#: _Export is a reserved keyword under gcc for os2.
2008-11-26 12:08:12 +0100 ydario r264364 : #i96439#: new libpath handling.
2008-11-26 11:57:51 +0100 ydario r264363 : #i96439#: use C call, generates proper stabs; fix rtti names.
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/os2/inc/salframe.h | 1 | ||||
-rw-r--r-- | vcl/os2/inc/salgdi.h | 25 | ||||
-rw-r--r-- | vcl/os2/inc/salinst.h | 6 | ||||
-rw-r--r-- | vcl/os2/inc/salobj.h | 1 | ||||
-rw-r--r-- | vcl/os2/source/app/makefile.mk | 6 | ||||
-rw-r--r-- | vcl/os2/source/app/salinst.cxx | 8 | ||||
-rw-r--r-- | vcl/os2/source/app/sallang.cxx | 490 | ||||
-rw-r--r-- | vcl/os2/source/app/salsound.cxx | 422 | ||||
-rw-r--r-- | vcl/os2/source/app/salsys.cxx | 246 | ||||
-rw-r--r-- | vcl/os2/source/gdi/os2layout.cxx | 12 | ||||
-rw-r--r-- | vcl/os2/source/gdi/salgdi.cxx | 29 | ||||
-rw-r--r-- | vcl/os2/source/gdi/salgdi3.cxx | 36 | ||||
-rw-r--r-- | vcl/os2/source/window/salframe.cxx | 44 |
13 files changed, 225 insertions, 1101 deletions
diff --git a/vcl/os2/inc/salframe.h b/vcl/os2/inc/salframe.h index d3c0ec8ca233..dd8c441ca255 100644 --- a/vcl/os2/inc/salframe.h +++ b/vcl/os2/inc/salframe.h @@ -158,6 +158,7 @@ public: virtual void SetParent( SalFrame* pNewParent ); virtual bool SetPluginParent( SystemParentData* pNewParent ); virtual void SetBackgroundBitmap( SalBitmap* ); + virtual void SetScreenNumber( unsigned int ); virtual void ResetClipRegion(); virtual void BeginSetClipRegion( ULONG nRects ); virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ); diff --git a/vcl/os2/inc/salgdi.h b/vcl/os2/inc/salgdi.h index 6f319a32064e..5e70f50ada79 100644 --- a/vcl/os2/inc/salgdi.h +++ b/vcl/os2/inc/salgdi.h @@ -64,7 +64,7 @@ public: virtual ImplFontEntry* CreateFontInstance( ImplFontSelectData& ) const; virtual sal_IntPtr GetFontId() const; void SetFontId( sal_IntPtr nId ) { mnId = nId; } - void UpdateFromHPS( HPS ); + void UpdateFromHPS( HPS ) const; bool HasChar( sal_uInt32 cChar ) const; @@ -77,15 +77,15 @@ public: bool AliasSymbolsHigh() const { return mbAliasSymbolsHigh; } bool AliasSymbolsLow() const { return mbAliasSymbolsLow; } - ImplFontCharMap* GetImplFontCharMap(); + ImplFontCharMap* GetImplFontCharMap() const; private: sal_IntPtr mnId; - bool mbDisableGlyphApi; - bool mbHasKoreanRange; - bool mbHasCJKSupport; + mutable bool mbDisableGlyphApi; + mutable bool mbHasKoreanRange; + mutable bool mbHasCJKSupport; - ImplFontCharMap* mpUnicodeMap; + mutable ImplFontCharMap* mpUnicodeMap; // TODO: get rid of the members below needed to work with the Win9x non-unicode API BYTE* mpFontCharSets; // all Charsets for the current font (used on W98 for kerning) @@ -97,8 +97,8 @@ private: PFONTMETRICS pFontMetric; private: - void ReadCmapTable( HDC ); - void ReadOs2Table( HDC ); + void ReadCmapTable( HDC ) const; + void ReadOs2Table( HDC ) const; #ifdef GNG_VERT_HACK void ReadGsubTable( HDC ) const; @@ -139,7 +139,7 @@ public: BOOL mbScreen; // is Screen compatible bool mbXORMode; // _every_ output with RasterOp XOR ULONG mhFonts[ MAX_FALLBACK ]; // Font + Fallbacks - ImplOs2FontData* mpOs2FontData[ MAX_FALLBACK ]; // pointer to the most recent font face + const ImplOs2FontData* mpOs2FontData[ MAX_FALLBACK ]; // pointer to the most recent font face ImplOs2FontEntry* mpOs2FontEntry[ MAX_FALLBACK ]; // pointer to the most recent font instance ULONG mhDefFont; // DefaultFont float mfFontScale; // allows metrics emulation of huge font sizes @@ -155,6 +155,7 @@ public: protected: virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight ); + virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& ); // draw --> LineColor and FillColor and RasterOp and ClipRegion virtual void drawPixel( long nX, long nY ); virtual void drawPixel( long nX, long nY, SalColor nSalColor ); @@ -163,6 +164,8 @@ protected: virtual void drawPolyLine( ULONG nPoints, const SalPoint* pPtAry ); virtual void drawPolygon( ULONG nPoints, const SalPoint* pPtAry ); virtual void drawPolyPolygon( ULONG nPoly, const ULONG* pPoints, PCONSTSALPOINT* pPtAry ); + virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ); + virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, const ::basegfx::B2DVector& rLineWidth, basegfx::B2DLineJoin); virtual sal_Bool drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ); virtual sal_Bool drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ); virtual sal_Bool drawPolyPolygonBezier( ULONG nPoly, const ULONG* pPoints, const SalPoint* const* pPtAry, const BYTE* const* pFlgAry ); @@ -277,7 +280,7 @@ public: // implementation note: encoding 0 with glyph id 0 should be added implicitly // as "undefined character" virtual BOOL CreateFontSubset( const rtl::OUString& rToFile, - ImplFontData* pFont, + const ImplFontData* pFont, long* pGlyphIDs, sal_uInt8* pEncoding, sal_Int32* pWidths, @@ -309,7 +312,7 @@ public: // frees the font data again virtual void FreeEmbedFontData( const void* pData, long nDataLen ); - virtual void GetGlyphWidths( ImplFontData* pFont, + virtual void GetGlyphWidths( const ImplFontData* pFont, bool bVertical, Int32Vector& rWidths, Ucs2UIntMap& rUnicodeEnc ); diff --git a/vcl/os2/inc/salinst.h b/vcl/os2/inc/salinst.h index 83d736592a93..119324c1acd6 100644 --- a/vcl/os2/inc/salinst.h +++ b/vcl/os2/inc/salinst.h @@ -41,9 +41,6 @@ namespace vos { class OMutex; } // ------------------- class SalYieldMutex; -//class SalInstance; -//class SalFrame; -//class SalObject; #define SAL_COMMANDLINENOINIT ((USHORT)0xFFFF) #define SAL_MAXPARAM 40 @@ -57,8 +54,6 @@ public: int mnArgc; // commandline param count char** mpArgv; // commandline HWND mhComWnd; // window, for communication (between threads and the main thread) - //void* mpFilterInst; // hack for clipboard - //void* mpFilterCallback; // hack for clipboard SalYieldMutex* mpSalYieldMutex; // Sal-Yield-Mutex vos::OMutex* mpSalWaitMutex; // Sal-Wait-Mutex USHORT mnYieldWaitCount; // Wait-Count @@ -86,7 +81,6 @@ public: virtual void GetPrinterQueueState( SalPrinterQueueInfo* pInfo ); virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo ); virtual String GetDefaultPrinter(); - virtual SalSound* CreateSalSound(); virtual SalTimer* CreateSalTimer(); virtual SalI18NImeStatus* CreateI18NImeStatus(); virtual SalSystem* CreateSalSystem(); diff --git a/vcl/os2/inc/salobj.h b/vcl/os2/inc/salobj.h index 9fefa2ddc54a..aa566808a41f 100644 --- a/vcl/os2/inc/salobj.h +++ b/vcl/os2/inc/salobj.h @@ -32,7 +32,6 @@ #define _SV_SALOBJ_H #include <vcl/sv.h> -#include <sysdata.hxx> #include <vcl/salobj.hxx> // ----------------- diff --git a/vcl/os2/source/app/makefile.mk b/vcl/os2/source/app/makefile.mk index b3349d9f32ee..e2c14fb1744a 100644 --- a/vcl/os2/source/app/makefile.mk +++ b/vcl/os2/source/app/makefile.mk @@ -49,7 +49,6 @@ YD00_CXXFILES=\ salinst.cxx \ sallang.cxx \ saltimer.cxx \ - salsound.cxx \ salsys.cxx SLOFILES= $(SLO)$/salshl.obj \ @@ -57,10 +56,7 @@ SLOFILES= $(SLO)$/salshl.obj \ $(SLO)$/salinfo.obj \ $(SLO)$/salinst.obj \ $(SLO)$/sallang.obj \ - $(SLO)$/saltimer.obj \ - $(SLO)$/salsound.obj - -# $(SLO)$/salsys.obj + $(SLO)$/saltimer.obj # --- Targets ------------------------------------------------------ diff --git a/vcl/os2/source/app/salinst.cxx b/vcl/os2/source/app/salinst.cxx index 6632daff90ef..a14881c253ee 100644 --- a/vcl/os2/source/app/salinst.cxx +++ b/vcl/os2/source/app/salinst.cxx @@ -52,7 +52,6 @@ #include <salframe.h> #include <salobj.h> #include <saltimer.h> -#include <salsound.h> #include <salbmp.h> #include <vcl/salimestatus.hxx> #include <vcl/timer.hxx> @@ -821,13 +820,6 @@ SalTimer* Os2SalInstance::CreateSalTimer() // ----------------------------------------------------------------------- -SalSound* Os2SalInstance::CreateSalSound() -{ - return new Os2SalSound(); -} - -// ----------------------------------------------------------------------- - SalBitmap* Os2SalInstance::CreateSalBitmap() { return new Os2SalBitmap(); diff --git a/vcl/os2/source/app/sallang.cxx b/vcl/os2/source/app/sallang.cxx index f27398b3c463..c15a61332aa4 100644 --- a/vcl/os2/source/app/sallang.cxx +++ b/vcl/os2/source/app/sallang.cxx @@ -1,370 +1,120 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: sallang.cxx,v $ - * $Revision: 1.5 $ - * - * 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 - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include <sallang.hxx> - -// ======================================================================= - -// ----------------------------------------------------------------------- -// Danish - -static const wchar_t* aImplLangDanishTab[LSTR_COUNT] = -{ - L"Skift", // LSTR_KEY_SHIFT - L"Ctrl", // LSTR_KEY_CTRL - L"Alt", // LSTR_KEY_ALT - L"Op", // LSTR_KEY_UP - L"Ned", // LSTR_KEY_DOWN - L"Venstre", // LSTR_KEY_LEFT - L"Hjre", // LSTR_KEY_RIGHT - L"Home", // LSTR_KEY_HOME - L"End", // LSTR_KEY_END - L"PageUp", // LSTR_KEY_PAGEUP - L"PageDown", // LSTR_KEY_PAGEDOWN - L"Enter", // LSTR_KEY_RETURN - L"Esc", // LSTR_KEY_ESC - L"Tab", // LSTR_KEY_TAB - L"Tilbage", // LSTR_KEY_BACKSPACE - L"Mellemrum", // LSTR_KEY_SPACE - L"Insert", // LSTR_KEY_INSERT - L"Delete", // LSTR_KEY_DELETE -}; - -// ----------------------------------------------------------------------- -// Dutch (Netherland/Belgian) - -static const wchar_t* aImplLangDutchTab[LSTR_COUNT] = -{ - L"Shift", // LSTR_KEY_SHIFT - L"Ctrl", // LSTR_KEY_CTRL - L"Alt", // LSTR_KEY_ALT - L"Boven", // LSTR_KEY_UP - L"Onder", // LSTR_KEY_DOWN - L"Links", // LSTR_KEY_LEFT - L"Links", // LSTR_KEY_RIGHT - L"Pos1", // LSTR_KEY_HOME - L"Einde", // LSTR_KEY_END - L"PageUp", // LSTR_KEY_PAGEUP - L"PageDown", // LSTR_KEY_PAGEDOWN - L"Return", // LSTR_KEY_RETURN - L"Esc", // LSTR_KEY_ESC - L"Tab", // LSTR_KEY_TAB - L"Backspace", // LSTR_KEY_BACKSPACE - L"Spatiebalk", // LSTR_KEY_SPACE - L"Ins", // LSTR_KEY_INSERT - L"Verwijderen", // LSTR_KEY_DELETE -}; - -// ----------------------------------------------------------------------- -// English (US/UK/AUS/CAN/NZ/EIRE/SAFRICA/JAMAICA/CARRIBEAN) - -static const wchar_t* aImplLangEnglishTab[LSTR_COUNT] = -{ - L"Shift", // LSTR_KEY_SHIFT - L"Ctrl", // LSTR_KEY_CTRL - L"Alt", // LSTR_KEY_ALT - L"Up", // LSTR_KEY_UP - L"Down", // LSTR_KEY_DOWN - L"Left", // LSTR_KEY_LEFT - L"Right", // LSTR_KEY_RIGHT - L"Home", // LSTR_KEY_HOME - L"End", // LSTR_KEY_END - L"PageUp", // LSTR_KEY_PAGEUP - L"PageDown", // LSTR_KEY_PAGEDOWN - L"Enter", // LSTR_KEY_RETURN - L"Esc", // LSTR_KEY_ESC - L"Tab", // LSTR_KEY_TAB - L"Backspace", // LSTR_KEY_BACKSPACE - L"Space", // LSTR_KEY_SPACE - L"Insert", // LSTR_KEY_INSERT - L"Del", // LSTR_KEY_DELETE -}; - -// ----------------------------------------------------------------------- -// Finnish - -static const wchar_t* aImplLangFinnishTab[LSTR_COUNT] = -{ - L"Vaihtonppain", // LSTR_KEY_SHIFT - L"Ctrl", // LSTR_KEY_CTRL - L"Alt", // LSTR_KEY_ALT - L"Yl", // LSTR_KEY_UP - L"Ala", // LSTR_KEY_DOWN - L"Vasen", // LSTR_KEY_LEFT - L"Oikea", // LSTR_KEY_RIGHT - L"Home", // LSTR_KEY_HOME - L"End", // LSTR_KEY_END - L"PageUp", // LSTR_KEY_PAGEUP - L"PageDown", // LSTR_KEY_PAGEDOWN - L"Enter", // LSTR_KEY_RETURN - L"Esc", // LSTR_KEY_ESC - L"Sarkain", // LSTR_KEY_TAB - L"Askelpalautin", // LSTR_KEY_BACKSPACE - L"Vlinppin", // LSTR_KEY_SPACE - L"Insert", // LSTR_KEY_INSERT - L"Delete", // LSTR_KEY_DELETE -}; - -// ----------------------------------------------------------------------- -// French (French/Belgian/Canadian/Swiss/Luxenbourg) - -static const wchar_t* aImplLangFrenchTab[LSTR_COUNT] = -{ - L"Maj", // LSTR_KEY_SHIFT - L"Ctrl", // LSTR_KEY_CTRL - L"Alt", // LSTR_KEY_ALT - L"Haut", // LSTR_KEY_UP - L"Bas", // LSTR_KEY_DOWN - L"Gauche", // LSTR_KEY_LEFT - L"Droite", // LSTR_KEY_RIGHT - L"Origine", // LSTR_KEY_HOME - L"Fin", // LSTR_KEY_END - L"Pg. Prc", // LSTR_KEY_PAGEUP - L"Pg. Suiv", // LSTR_KEY_PAGEDOWN - L"Entre", // LSTR_KEY_RETURN - L"Esc", // LSTR_KEY_ESC - L"Tab", // LSTR_KEY_TAB - L"Ret. Arr", // LSTR_KEY_BACKSPACE - L"Espace", // LSTR_KEY_SPACE - L"Insrer", // LSTR_KEY_INSERT - L"Suppr", // LSTR_KEY_DELETE -}; - -// ----------------------------------------------------------------------- -// German (German/Swiss/Austrian/Luxembourg/Liechtenstein) - -static const wchar_t* aImplLangGermanTab[LSTR_COUNT] = -{ - L"Umschalt", // LSTR_KEY_SHIFT - L"Strg", // LSTR_KEY_CTRL - L"Alt", // LSTR_KEY_ALT - L"Nach-Oben", // LSTR_KEY_UP - L"Nach-Unten", // LSTR_KEY_DOWN - L"Nach-Links", // LSTR_KEY_LEFT - L"Nach-Rechts", // LSTR_KEY_RIGHT - L"Pos1", // LSTR_KEY_HOME - L"Ende", // LSTR_KEY_END - L"Bild-Nach-Oben", // LSTR_KEY_PAGEUP - L"Bild-Nach-Unten", // LSTR_KEY_PAGEDOWN - L"Eingabe", // LSTR_KEY_RETURN - L"Esc", // LSTR_KEY_ESC - L"Tab", // LSTR_KEY_TAB - L"Rck", // LSTR_KEY_BACKSPACE - L"Leer", // LSTR_KEY_SPACE - L"Einfg", // LSTR_KEY_INSERT - L"Entf", // LSTR_KEY_DELETE -}; - -// ----------------------------------------------------------------------- -// Italian (Italian/Swiss) - -static const wchar_t* aImplLangItalianTab[LSTR_COUNT] = -{ - L"Maiusc", // LSTR_KEY_SHIFT - L"Ctrl", // LSTR_KEY_CTRL - L"Alt", // LSTR_KEY_ALT - L"Sposta verso l'alto", // LSTR_KEY_UP - L"Sposta verso il basso", // LSTR_KEY_DOWN - L"A sinistra", // LSTR_KEY_LEFT - L"A destra", // LSTR_KEY_RIGHT - L"Home", // LSTR_KEY_HOME - L"Fine", // LSTR_KEY_END - L"PgSu", // LSTR_KEY_PAGEUP - L"PgGi", // LSTR_KEY_PAGEDOWN - L"Invio", // LSTR_KEY_RETURN - L"Esc", // LSTR_KEY_ESC - L"Tab", // LSTR_KEY_TAB - L"Backspace", // LSTR_KEY_BACKSPACE - L"Spaziatrice", // LSTR_KEY_SPACE - L"Ins", // LSTR_KEY_INSERT - L"Canc", // LSTR_KEY_DELETE -}; - -// ----------------------------------------------------------------------- -// Norwegian (Bokmal) - -static const wchar_t* aImplLangNorwegianTab[LSTR_COUNT] = -{ - L"Skift", // LSTR_KEY_SHIFT - L"Ctrl", // LSTR_KEY_CTRL - L"Alt", // LSTR_KEY_ALT - L"Opp", // LSTR_KEY_UP - L"Ned", // LSTR_KEY_DOWN - L"Venstre", // LSTR_KEY_LEFT - L"Hyre", // LSTR_KEY_RIGHT - L"Home", // LSTR_KEY_HOME - L"End", // LSTR_KEY_END - L"PageUp", // LSTR_KEY_PAGEUP - L"PageDown", // LSTR_KEY_PAGEDOWN - L"Enter", // LSTR_KEY_RETURN - L"Esc", // LSTR_KEY_ESC - L"Tab", // LSTR_KEY_TAB - L"Tilbake", // LSTR_KEY_BACKSPACE - L"Mellomrom", // LSTR_KEY_SPACE - L"Insert", // LSTR_KEY_INSERT - L"Delete", // LSTR_KEY_DELETE -}; - -// ----------------------------------------------------------------------- -// Portuguse (Portuguse/Brazilian) - -static const wchar_t* aImplLangPortugueseTab[LSTR_COUNT] = -{ - L"Shift", // LSTR_KEY_SHIFT - L"Ctrl", // LSTR_KEY_CTRL - L"Alt", // LSTR_KEY_ALT - L"Acima", // LSTR_KEY_UP - L"Abaixo", // LSTR_KEY_DOWN - L"Esquerda", // LSTR_KEY_LEFT - L"Direita", // LSTR_KEY_RIGHT - L"Home", // LSTR_KEY_HOME - L"End", // LSTR_KEY_END - L"PageUp", // LSTR_KEY_PAGEUP - L"PageDown", // LSTR_KEY_PAGEDOWN - L"Enter", // LSTR_KEY_RETURN - L"Esc", // LSTR_KEY_ESC - L"Tab", // LSTR_KEY_TAB - L"Backspace", // LSTR_KEY_BACKSPACE - L"Space", // LSTR_KEY_SPACE - L"Insert", // LSTR_KEY_INSERT - L"Delete", // LSTR_KEY_DELETE -}; - -// ----------------------------------------------------------------------- -// Spanish (Spanish/Mexican/Modern/Guatemala/Costarica/Panama/Dominican/ -// Venezuela/Colombia/Peru/Argentina/Ecuador/Chile/Uruguay/ -// Paraguay/Bolivia) - -static const wchar_t* aImplLangSpanishTab[LSTR_COUNT] = -{ - L"Mays", // LSTR_KEY_SHIFT - L"Control", // LSTR_KEY_CTRL - L"Alt", // LSTR_KEY_ALT - L"Hacia arriba", // LSTR_KEY_UP - L"Hacia abajo", // LSTR_KEY_DOWN - L"Hacia la izquierda", // LSTR_KEY_LEFT - L"Hacia la derecha", // LSTR_KEY_RIGHT - L"Home", // LSTR_KEY_HOME - L"Fin", // LSTR_KEY_END - L"RePg", // LSTR_KEY_PAGEUP - L"AvPg", // LSTR_KEY_PAGEDOWN - L"Entrada", // LSTR_KEY_RETURN - L"Esc", // LSTR_KEY_ESC - L"Tab", // LSTR_KEY_TAB - L"Ret", // LSTR_KEY_BACKSPACE - L"Espacio", // LSTR_KEY_SPACE - L"Insert", // LSTR_KEY_INSERT - L"Supr", // LSTR_KEY_DELETE -}; - -// ----------------------------------------------------------------------- -// Swedish - -static const wchar_t* aImplLangSwedishTab[LSTR_COUNT] = -{ - L"Skift", // LSTR_KEY_SHIFT - L"Ctrl", // LSTR_KEY_CTRL - L"Alt", // LSTR_KEY_ALT - L"Up", // LSTR_KEY_UP - L"Ned", // LSTR_KEY_DOWN - L"Vnster", // LSTR_KEY_LEFT - L"Hger", // LSTR_KEY_RIGHT - L"Home", // LSTR_KEY_HOME - L"End", // LSTR_KEY_END - L"PageUp", // LSTR_KEY_PAGEUP - L"PageDown", // LSTR_KEY_PAGEDOWN - L"Retur", // LSTR_KEY_RETURN - L"Esc", // LSTR_KEY_ESC - L"Tab", // LSTR_KEY_TAB - L"Backsteg", // LSTR_KEY_BACKSPACE - L"Blank", // LSTR_KEY_SPACE - L"Insert", // LSTR_KEY_INSERT - L"Delete", // LSTR_KEY_DELETE -}; - -// ======================================================================= - -const sal_Unicode** ImplGetLangTab( LanguageType eLang ) -{ - // Sprachtabelle ermitteln - const wchar_t** pLangTab; - //switch ( International::GetNeutralLanguage( eLang ) ) - switch ( eLang ) - { - case LANGUAGE_DANISH: - pLangTab = aImplLangDanishTab; - break; - - case LANGUAGE_DUTCH: - case LANGUAGE_DUTCH_BELGIAN: - pLangTab = aImplLangDutchTab; - break; - - case LANGUAGE_FINNISH: - pLangTab = aImplLangFinnishTab; - break; - - case LANGUAGE_FRENCH: - pLangTab = aImplLangFrenchTab; - break; - - case LANGUAGE_GERMAN: - pLangTab = aImplLangGermanTab; - break; - - case LANGUAGE_ITALIAN: - pLangTab = aImplLangItalianTab; - break; - - case LANGUAGE_NORWEGIAN: - case LANGUAGE_NORWEGIAN_BOKMAL: - pLangTab = aImplLangNorwegianTab; - break; - - case LANGUAGE_PORTUGUESE: - case LANGUAGE_PORTUGUESE_BRAZILIAN: - pLangTab = aImplLangPortugueseTab; - break; - - case LANGUAGE_SPANISH: - pLangTab = aImplLangSpanishTab; - break; - - case LANGUAGE_SWEDISH: - pLangTab = aImplLangSwedishTab; - break; - - default: - pLangTab = aImplLangEnglishTab; - break; - } - - return (const sal_Unicode**)pLangTab; -} +/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sallang.cxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SALLANG_HXX
+#include <sallang.hxx>
+#endif
+
+// =======================================================================
+
+// -----------------------------------------------------------------------
+// English (US/UK/AUS/CAN/NZ/EIRE/SAFRICA/JAMAICA/CARRIBEAN)
+static const wchar_t* aImplLangEnglishTab[LSTR_COUNT] =
+{
+ L"Shift", // LSTR_KEY_SHIFT
+ L"Ctrl", // LSTR_KEY_CTRL
+ L"Alt", // LSTR_KEY_ALT
+ L"Up", // LSTR_KEY_UP
+ L"Down", // LSTR_KEY_DOWN
+ L"Left", // LSTR_KEY_LEFT
+ L"Right", // LSTR_KEY_RIGHT
+ L"Home", // LSTR_KEY_HOME
+ L"End", // LSTR_KEY_END
+ L"PageUp", // LSTR_KEY_PAGEUP
+ L"PageDown", // LSTR_KEY_PAGEDOWN
+ L"Enter", // LSTR_KEY_RETURN
+ L"Esc", // LSTR_KEY_ESC
+ L"Tab", // LSTR_KEY_TAB
+ L"Backspace", // LSTR_KEY_BACKSPACE
+ L"Space", // LSTR_KEY_SPACE
+ L"Insert", // LSTR_KEY_INSERT
+ L"Del", // LSTR_KEY_DELETE
+};
+
+// =======================================================================
+
+const sal_Unicode** ImplGetLangTab( LanguageType eLang )
+{
+ // Sprachtabelle ermitteln
+ const wchar_t** pLangTab;
+ //switch ( International::GetNeutralLanguage( eLang ) )
+ switch ( eLang )
+ {
+#if 0
+ case LANGUAGE_DANISH:
+ pLangTab = aImplLangDanishTab;
+ break;
+
+ case LANGUAGE_DUTCH:
+ case LANGUAGE_DUTCH_BELGIAN:
+ pLangTab = aImplLangDutchTab;
+ break;
+
+ case LANGUAGE_FINNISH:
+ pLangTab = aImplLangFinnishTab;
+ break;
+
+ case LANGUAGE_FRENCH:
+ pLangTab = aImplLangFrenchTab;
+ break;
+
+ case LANGUAGE_GERMAN:
+ pLangTab = aImplLangGermanTab;
+ break;
+
+ case LANGUAGE_ITALIAN:
+ pLangTab = aImplLangItalianTab;
+ break;
+
+ case LANGUAGE_NORWEGIAN:
+ case LANGUAGE_NORWEGIAN_BOKMAL:
+ pLangTab = aImplLangNorwegianTab;
+ break;
+
+ case LANGUAGE_PORTUGUESE:
+ case LANGUAGE_PORTUGUESE_BRAZILIAN:
+ pLangTab = aImplLangPortugueseTab;
+ break;
+
+ case LANGUAGE_SPANISH:
+ pLangTab = aImplLangSpanishTab;
+ break;
+
+ case LANGUAGE_SWEDISH:
+ pLangTab = aImplLangSwedishTab;
+ break;
+#endif
+ default:
+ pLangTab = aImplLangEnglishTab;
+ break;
+ }
+
+ return (const sal_Unicode**)pLangTab;
+}
diff --git a/vcl/os2/source/app/salsound.cxx b/vcl/os2/source/app/salsound.cxx deleted file mode 100644 index ff3c7f1be8c3..000000000000 --- a/vcl/os2/source/app/salsound.cxx +++ /dev/null @@ -1,422 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: salsound.cxx,v $ - * $Revision: 1.5 $ - * - * 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 - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#define _SV_SALSOUND_CXX - -// ------------ -// - Includes - -// ------------ - -#include <string.h> - -#define INCL_DOSMODULEMGR -#include <svpm.h> -#include <saldata.hxx> -#include <salinst.h> -#include <salsound.h> - -#define INCL_MCIOS2 -#include <os2me.h> - -// --------- -// - Names - -// --------- - -#define SOUND_LIBNAME "MDM" -#define SOUND_PROCNAME "mciSendCommand" - -// ------------ -// - Fnc cast - -// ------------ - -typedef ULONG (_cdecl *SALMCIPROC)( USHORT nDeviceId, USHORT nMessage, ULONG nFlags, void* pParam, USHORT ); -#define MCIFNC ( (SALMCIPROC) Os2SalSound::mpMCIFnc ) - -// ----------------- -// - Statics init. - -// ----------------- - -HMODULE Os2SalSound::mhMCILib = 0; -ULONG Os2SalSound::mnSoundState = SOUND_STATE_UNLOADED; -void* Os2SalSound::mpMCIFnc = NULL; - -// ------------------- -// - Window-Callback - -// ------------------- - -MRESULT EXPENTRY SoundWndProc( HWND hWnd, ULONG nMsg, MPARAM nPar1, MPARAM nPar2 ) -{ - if( MM_MCINOTIFY == nMsg ) - { - USHORT nNotify = (USHORT)(ULONG) nPar1; - SoundNotification eNotification; - BOOL bNotify = TRUE; - - switch( nNotify ) - { - case( MCI_NOTIFY_SUCCESSFUL ): - eNotification = SOUND_NOTIFY_SUCCESS; - break; - - case( MCI_NOTIFY_ABORTED ): - eNotification = SOUND_NOTIFY_ABORTED; - break; - - case( MCI_NOTIFY_SUPERSEDED ): - bNotify = FALSE; - break; - - default: - eNotification = SOUND_NOTIFY_ERROR; - break; - } - - if( bNotify ) - ( (Os2SalSound*) WinQueryWindowULong( hWnd, 0 ) )->ImplNotify( eNotification, 0 ); - } - - return WinDefWindowProc( hWnd, nMsg, nPar1, nPar2 ); -} - -// ------------ -// - Os2SalSound - -// ------------ - -Os2SalSound::Os2SalSound() : - mpProc ( NULL ), - mhSoundWnd ( 0 ), - mnDeviceId ( 0 ), - mbLoop ( FALSE ), - mbPaused ( FALSE ) -{ -} - -// ------------------------------------------------------------------------ - -Os2SalSound::~Os2SalSound() -{ - Stop(); - - if( mnDeviceId ) - { - MCI_GENERIC_PARMS aGenericParams; - memset( &aGenericParams, 0, sizeof( aGenericParams ) ); - aGenericParams.hwndCallback = mhSoundWnd; - MCIFNC( mnDeviceId, MCI_CLOSE, MCI_WAIT, &aGenericParams, 0 ); - } - - if( mhSoundWnd ) - WinDestroyWindow( mhSoundWnd ); -} - -// ------------------------------------------------------------------------ - -void Os2SalSound::ImplSetError( ULONG nMciErr ) -{ - struct aMapper { DWORD nMci; ULONG nSv; }; - - ULONG nError = SOUNDERR_GENERAL_ERROR; - static aMapper aErrArr[] = - { - { 0, SOUNDERR_SUCCESS }, - { MCIERR_CANNOT_LOAD_DRIVER, SOUNDERR_CANNOT_LOAD_DRIVER }, - { MCIERR_DEVICE_LOCKED, SOUNDERR_DEVICE_LOCKED }, - { MCIERR_DEVICE_NOT_READY, SOUNDERR_DEVICE_NOT_READY }, - { MCIERR_DEVICE_TYPE_REQUIRED, SOUNDERR_DEVICE_NOT_FOUND }, - { MCIERR_DRIVER, SOUNDERR_CANNOT_LOAD_DRIVER }, - { MCIERR_DRIVER_INTERNAL, SOUNDERR_CANNOT_LOAD_DRIVER }, - { MCIERR_EXTENSION_NOT_FOUND, SOUNDERR_SOUND_NOT_FOUND }, - { MCIERR_FILE_NOT_FOUND, SOUNDERR_SOUND_NOT_FOUND }, - { MCIERR_HARDWARE, SOUNDERR_HARDWARE_ERROR }, - { MCIERR_INVALID_DEVICE_NAME, SOUNDERR_DEVICE_NOT_FOUND }, - { MCIERR_OUT_OF_MEMORY, SOUNDERR_OUT_OF_MEMORY }, - { MCIERR_UNSUPPORTED_FUNCTION, SOUNDERR_UNSUPPORTED_FUNCTION } - }; - - for( USHORT n=0; n < (sizeof( aErrArr ) / sizeof( aMapper ) ); n++ ) - { - if( aErrArr[ n ].nMci == nMciErr ) - { - nError = aErrArr[ n ].nSv; - break; - } - } - - if( nError ) - ImplNotify( SOUND_NOTIFY_ERROR, nError ); -} - -// ------------------------------------------------------------------------ - -void Os2SalSound::ImplNotify( SoundNotification eNotification, ULONG nError ) -{ - if( mbLoop && ( SOUND_NOTIFY_SUCCESS == eNotification ) && !nError ) - Play( mnStartTime, mnPlayLen, TRUE ); - - if( mpProc && mpInst ) - mpProc( mpInst, eNotification, nError ); -} - -// ------------------------------------------------------------------------ - -BOOL Os2SalSound::Create() -{ - SalData* pData = GetSalData(); - BOOL bRet = FALSE; - - if( SOUND_STATE_UNLOADED == Os2SalSound::mnSoundState ) - { - if( DosLoadModule( 0, 0, (PCSZ)SOUND_LIBNAME, &Os2SalSound::mhMCILib ) == 0 && - DosQueryProcAddr( Os2SalSound::mhMCILib, 0, (PCSZ)SOUND_PROCNAME, (PFN*) &Os2SalSound::mpMCIFnc ) == 0 ) - { - char* pszClassName = "SoundWin"; - PFNWP pWindowProc = SoundWndProc; - - WinRegisterClass( pData->mhAB, (PCSZ)pszClassName, pWindowProc, 0L, 4 ); - Os2SalSound::mnSoundState = SOUND_STATE_VALID; - bRet = TRUE; - } - else - { - if( Os2SalSound::mhMCILib ) - DosFreeModule( Os2SalSound::mhMCILib ); - - Os2SalSound::mnSoundState = SOUND_STATE_INVALID; - ImplNotify( SOUND_NOTIFY_ERROR, SOUNDERR_CANNOT_LOAD_DRIVER ); - } - } - else if( SOUND_STATE_VALID == Os2SalSound::mnSoundState ) - bRet = TRUE; - - if( bRet ) - { - mhSoundWnd = WinCreateWindow( HWND_OBJECT, (PCSZ)"SoundWin", (PCSZ)"Sound", 0, 0, 0, 0, 0, HWND_DESKTOP, HWND_BOTTOM, 0, 0, 0 ); - WinSetWindowULong( mhSoundWnd, 0, (ULONG) this ); - } - else - mhSoundWnd = 0; - - return bRet; -} - -// ------------------------------------------------------------------------ - -void Os2SalSound::Release() -{ - if( Os2SalSound::mhMCILib ) - DosFreeModule( Os2SalSound::mhMCILib ); - - Os2SalSound::mnSoundState = SOUND_STATE_UNLOADED; -} - -// ------------------------------------------------------------------------ - -bool Os2SalSound::IsValid() -{ - return (Os2SalSound::mnSoundState == SOUND_STATE_VALID); -} - -// ------------------------------------------------------------------------ - -bool Os2SalSound::Init( const XubString& rSoundName, ULONG& rSoundLen ) -{ - MCI_OPEN_PARMS aOpenParams; - ULONG nMciErr = 0; - - rSoundLen = 0; - - // clear old device - if( mnDeviceId ) - { - Stop(); - - MCI_GENERIC_PARMS aGenericParams; - memset( &aGenericParams, 0, sizeof( aGenericParams ) ); - aGenericParams.hwndCallback = mhSoundWnd; - nMciErr = MCIFNC( mnDeviceId, MCI_CLOSE, MCI_WAIT, &aGenericParams, 0 ); - mnDeviceId = 0; - } - - if( rSoundName.Len() ) - { - // init new device with sound name - memset( &aOpenParams, 0, sizeof( aOpenParams ) ); - aOpenParams.pszElementName = (PSZ) rSoundName.GetBuffer(); - aOpenParams.hwndCallback = mhSoundWnd; - nMciErr = MCIFNC( 0, MCI_OPEN, MCI_WAIT | MCI_OPEN_ELEMENT, &aOpenParams, 0 ); - - if( !nMciErr ) - { - // set time format - MCI_SET_PARMS aSetParams; - memset( &aSetParams, 0, sizeof( aSetParams ) ); - mnDeviceId = aOpenParams.usDeviceID; - aSetParams.ulTimeFormat = MCI_FORMAT_MILLISECONDS; - nMciErr = MCIFNC( mnDeviceId, MCI_SET, MCI_WAIT | MCI_SET_TIME_FORMAT, &aSetParams, 0 ); - - if( !nMciErr ) - { - // get length of sound - MCI_STATUS_PARMS aStatus; - memset( &aStatus, 0, sizeof( aStatus ) ); - aStatus.ulItem = MCI_STATUS_LENGTH; - MCIFNC( mnDeviceId, MCI_STATUS, MCI_WAIT | MCI_STATUS_ITEM, &aStatus, 0 ); - rSoundLen = (ULONG) aStatus.ulReturn; - } - } - } - - if( nMciErr ) - ImplSetError( nMciErr ); - - return( nMciErr ? FALSE : TRUE ); -} - -// ------------------------------------------------------------------------ -#if 0 -BOOL Os2SalSound::Init( SalFrame* pFrame, const BYTE* pSound, ULONG nDataLen, ULONG& rSoundLen ) -{ - rSoundLen = 0UL; - ImplSetError( MCIERR_FILE_NOT_FOUND ); - - return FALSE; -} -#endif - -// ------------------------------------------------------------------------ - -void Os2SalSound::Play( ULONG nStartTime, ULONG nPlayLen, bool bLoop ) -{ - if( mnDeviceId ) - { - ULONG nMciErr = 0; - - if( !mbPaused ) - { - MCI_SEEK_PARMS aSeekParams; - memset( &aSeekParams, 0, sizeof( aSeekParams ) ); - aSeekParams.hwndCallback = mhSoundWnd; - aSeekParams.ulTo = 0; - nMciErr = MCIFNC( mnDeviceId, MCI_SEEK,MCI_WAIT | MCI_TO, &aSeekParams, 0 ); - } - - mnStartTime = nStartTime; - mnPlayLen = nPlayLen; - mbLoop = bLoop; - mbPaused = FALSE; - - if( !nMciErr ) - { - MCI_PLAY_PARMS aPlayParams; - DWORD nFlags = MCI_NOTIFY; - - memset( &aPlayParams, 0, sizeof( aPlayParams ) ); - aPlayParams.hwndCallback = mhSoundWnd; - - if( nStartTime ) - { - aPlayParams.ulFrom = nStartTime; - nFlags |= MCI_FROM; - } - - if( nPlayLen != SOUND_PLAYALL ) - { - aPlayParams.ulTo = nStartTime + nPlayLen; - nFlags |= MCI_TO; - } - - nMciErr = MCIFNC( mnDeviceId, MCI_PLAY, nFlags, &aPlayParams, 0 ); - - if( !nMciErr ) - mbPaused = FALSE; - } - - if( nMciErr ) - ImplSetError( nMciErr ); - } - else - ImplSetError( MCIERR_EXTENSION_NOT_FOUND ); -} - -// ------------------------------------------------------------------------ - -void Os2SalSound::Stop() -{ - if( mnDeviceId ) - { - MCI_GENERIC_PARMS aGenericParams; - memset( &aGenericParams, 0, sizeof( aGenericParams ) ); - aGenericParams.hwndCallback = mhSoundWnd; - mbLoop = mbPaused = FALSE; - MCIFNC( mnDeviceId, MCI_STOP, MCI_WAIT, &aGenericParams, 0 ); - } -} - -// ------------------------------------------------------------------------ - -void Os2SalSound::Pause() -{ - if( mnDeviceId ) - { - MCI_GENERIC_PARMS aGenericParams; - memset( &aGenericParams, 0, sizeof( aGenericParams ) ); - aGenericParams.hwndCallback = mhSoundWnd; - mbPaused = TRUE; - MCIFNC( mnDeviceId, MCI_PAUSE, MCI_WAIT, &aGenericParams, 0 ); - } -} - -// ------------------------------------------------------------------------ - -void Os2SalSound::Continue() -{ - Play( 0, 0, mbLoop ); -} - -// ------------------------------------------------------------------------ - -bool Os2SalSound::IsLoopMode() const -{ - return mbLoop; -} - -// ------------------------------------------------------------------------ - -bool Os2SalSound::IsPlaying() const -{ - return !mbPaused; -} - -// ------------------------------------------------------------------------ - -bool Os2SalSound::IsPaused() const -{ - return mbPaused; -} diff --git a/vcl/os2/source/app/salsys.cxx b/vcl/os2/source/app/salsys.cxx deleted file mode 100644 index 35319c1d3cfc..000000000000 --- a/vcl/os2/source/app/salsys.cxx +++ /dev/null @@ -1,246 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: salsys.cxx,v $ - * $Revision: 1.5 $ - * - * 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 - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#define _SV_SALSYS_CXX - -#include <string.h> - -#define INCL_DOS -#define INCL_DOSERRORS -#ifndef _SVPM_H -#include <svpm.h> -#endif -#include <saldata.hxx> -#include <salinst.hxx> -#include <salframe.hxx> -#include <salbmp.hxx> -#include <salsys.hxx> -#ifndef _VOS_PROCESS_HXX -#include <vos/process.hxx> -#endif -#ifndef _TOOLS_FASTFSYS_HXX -#include <tools/fastfsys.hxx> -#endif - -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <ctype.h> - -// ======================================================================= - -SalSystem* SalInstance::CreateSystem() -{ - return new SalSystem(); -} - -// ----------------------------------------------------------------------- - -void SalInstance::DestroySystem( SalSystem* pSystem ) -{ - delete pSystem; -} - -// ----------------------------------------------------------------------- - -SalSystem::SalSystem() -{ -} - -// ----------------------------------------------------------------------- - -SalSystem::~SalSystem() -{ -} - -// ----------------------------------------------------------------------- - -BOOL SalSystem::StartProcess( SalFrame* pFrame, const XubString& rFileName, - const XubString& rParam, - const XubString& rWorkingDirectory ) -{ - ItemIDPath aFile(rFileName); - - // - // first check if item has a context menu with open command - // - - ItemIDPath aParent, aChild; - - if(aFile.Split(aParent, aChild)) - { - IfcContextMenu *pConMenu = Folder(aParent).GetContextMenu(1, &aChild); - - if(pConMenu) - { - UINT32 nCount = pConMenu->GetItemCount(); - - for(UINT32 n = 0; n < nCount; n++) - { - MenuItem aMenuItem; - - if(pConMenu->GetMenuItem(n, aMenuItem) && - aMenuItem.aVerb.Compare("open") == COMPARE_EQUAL) - { - return pConMenu->ExecuteCommand(aMenuItem.aCommand); - } - } - } - } - - // Dateinamen mit Wildcards lehnen wir ab - if ( (rFileName.Search( '*' ) != STRING_NOTFOUND) || - (rFileName.Search( '?' ) != STRING_NOTFOUND) ) - return FALSE; - - XubString aFileName = aFile.GetHostNotationPath(); - char* aStdExtAry[] = { "exe", "com", "cmd", "bat" }; - const char* pStdExt; - const xub_Unicode* pFileName = aFileName.GetStr(); - const xub_Unicode* pParam = rParam.GetStr(); - XubString aSearchFileName; - XubString aExt; - BOOL bExe = FALSE; - BOOL bProcess = FALSE; - BOOL bRet = FALSE; - BOOL bExtension; - int i; - - // Parameter und Extension ermitteln - if ( !rParam.Len() ) - pParam = NULL; - // Wenn keine Extension, dann versuchen wir eine zu ermitteln, - // indem wir nach EXE-, COM-, CMD- oder BAT-Dateien suchen. - bExtension = ImplSalGetExtension( aFileName, aExt ); - if ( !bExtension ) - { - i = 0; - do - { - pStdExt = aStdExtAry[i]; - aSearchFileName = aFileName; - aSearchFileName += '.'; - aSearchFileName += pStdExt; - if ( ImplSalFindFile( aSearchFileName.GetStr(), aSearchFileName ) ) - { - pFileName = aSearchFileName.GetStr(); - bExtension = ImplSalGetExtension( aSearchFileName, aExt ); - break; - } - i++; - } - while ( i < 4 ); - } - else - { - // Ansonsten Filename im Pfad suchen - if ( ImplSalFindFile( pFileName, aSearchFileName ) ) - { - pFileName = aSearchFileName.GetStr(); - bExtension = ImplSalGetExtension( aSearchFileName, aExt ); - } - } - // Wenn wir eine Extension haben, testen wir, ob es eine - // Standard-Extension ist, womit wir einen Process starten koennen - if ( bExtension ) - { - aExt.ToLower(); - i = 0; - do - { - if ( aExt == aStdExtAry[i] ) - { - bExe = TRUE; - break; - } - i++; - } - while ( i < 4 ); - } - - // change to path of executable if no working dir set - XubString aWorkingDir(rWorkingDirectory); - - if(aWorkingDir.Len() == 0) - { - USHORT nIndex; - - aWorkingDir = pFileName; - nIndex = aWorkingDir.SearchCharBackward("\\/:"); - - if(nIndex == STRING_NOTFOUND) - nIndex = 0; - else if(aWorkingDir.GetChar(nIndex) == ':') - aWorkingDir[nIndex++] = '\\'; - - aWorkingDir.Erase(nIndex); - } - - // start executables with process execute - if ( bExe ) - { - NAMESPACE_VOS( OProcess )::TProcessError nProcessError; - NAMESPACE_VOS( OProcess ) aProcess( pFileName, pParam ); - - aProcess.setDirectory(aWorkingDir.GetStr()); - - nProcessError = aProcess.execute( (NAMESPACE_VOS(OProcess)::TProcessOption) - (NAMESPACE_VOS(OProcess)::TOption_Detached) ); - bRet = nProcessError == NAMESPACE_VOS( OProcess )::E_None; - } - - // when not startet, start programm with WPS - if ( !bRet ) - { - HOBJECT hObject = WinQueryObject( pFileName ); - if ( hObject ) - { - if ( WinOpenObject( hObject, 0, FALSE ) ) - bRet = TRUE; - } - } - - return bRet; -} - -// ----------------------------------------------------------------------- - -BOOL SalSystem::AddRecentDoc( SalFrame* pFrame, const XubString& rFileName ) -{ - return FALSE; -} - -// ----------------------------------------------------------------------- - -String SalSystem::GetSummarySystemInfos( ULONG nFlags ) -{ - return String(); -} - diff --git a/vcl/os2/source/gdi/os2layout.cxx b/vcl/os2/source/gdi/os2layout.cxx index 07fdb6c38927..dffb6a412f9b 100644 --- a/vcl/os2/source/gdi/os2layout.cxx +++ b/vcl/os2/source/gdi/os2layout.cxx @@ -107,7 +107,7 @@ inline int ImplOs2FontEntry::GetCachedGlyphWidth( int nCharCode ) const class Os2Layout : public SalLayout { public: - Os2Layout( HDC, ImplOs2FontData&, ImplOs2FontEntry& ); + Os2Layout( HDC, const ImplOs2FontData&, ImplOs2FontEntry& ); virtual void InitFont() const; void SetFontScale( float f ) { mfFontScale = f; } float GetFontScale() const { return mfFontScale; } @@ -118,7 +118,7 @@ protected: int mnBaseAdv; // x-offset relative to Layout origin float mfFontScale; // allows metrics emulation of huge font sizes - ImplOs2FontData& mrOs2FontData; + const ImplOs2FontData& mrOs2FontData; ImplOs2FontEntry& mrOs2FontEntry; }; @@ -127,7 +127,7 @@ protected: class Os2SalLayout : public Os2Layout { public: - Os2SalLayout( HPS, BYTE nCharSet, ImplOs2FontData&, ImplOs2FontEntry& ); + Os2SalLayout( HPS, BYTE nCharSet, const ImplOs2FontData&, ImplOs2FontEntry& ); virtual ~Os2SalLayout(); virtual bool LayoutText( ImplLayoutArgs& ); @@ -172,7 +172,7 @@ private: // ======================================================================= -Os2Layout::Os2Layout( HPS hPS, ImplOs2FontData& rWFD, ImplOs2FontEntry& rWFE ) +Os2Layout::Os2Layout( HPS hPS, const ImplOs2FontData& rWFD, ImplOs2FontEntry& rWFE ) : mhPS( hPS ), mnBaseAdv( 0 ), mfFontScale( 1.0 ), @@ -194,7 +194,7 @@ void Os2Layout::InitFont() const // ======================================================================= Os2SalLayout::Os2SalLayout( HPS hPS, BYTE nCharSet, - ImplOs2FontData& rOs2FontData, ImplOs2FontEntry& rOs2FontEntry ) + const ImplOs2FontData& rOs2FontData, ImplOs2FontEntry& rOs2FontEntry ) : Os2Layout( hPS, rOs2FontData, rOs2FontEntry ), mnGlyphCount( 0 ), mnCharCount( 0 ), @@ -950,7 +950,7 @@ SalLayout* Os2SalGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLe Os2SalLayout* pLayout = NULL; DBG_ASSERT( mpOs2FontEntry[nFallbackLevel], "WinSalGraphics mpWinFontEntry==NULL"); - ImplOs2FontData& rFontFace = *mpOs2FontData[ nFallbackLevel ]; + const ImplOs2FontData& rFontFace = *mpOs2FontData[ nFallbackLevel ]; ImplOs2FontEntry& rFontInstance = *mpOs2FontEntry[ nFallbackLevel ]; { diff --git a/vcl/os2/source/gdi/salgdi.cxx b/vcl/os2/source/gdi/salgdi.cxx index 04516cf1d0f5..b6616eb3a24b 100644 --- a/vcl/os2/source/gdi/salgdi.cxx +++ b/vcl/os2/source/gdi/salgdi.cxx @@ -242,6 +242,14 @@ BOOL Os2SalGraphics::unionClipRegion( long nX, long nY, long nWidth, long nHeigh // ----------------------------------------------------------------------- +bool Os2SalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& ) +{ + // TODO: implement and advertise OutDevSupport_B2DClip support + return false; +} + +// ----------------------------------------------------------------------- + void Os2SalGraphics::EndSetClipRegion() { #ifdef SAL_PRINTER_CLIPPATH @@ -655,6 +663,25 @@ void Os2SalGraphics::drawPolyPolygon( ULONG nPoly, const ULONG* pPoints, // ----------------------------------------------------------------------- +bool Os2SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double /*fTransparency*/ ) +{ + // TODO: implement and advertise OutDevSupport_B2DDraw support + return false; +} + +// ----------------------------------------------------------------------- + +bool Os2SalGraphics::drawPolyLine( + const basegfx::B2DPolygon& /*rPolygon*/, + const basegfx::B2DVector& /*rLineWidths*/, + basegfx::B2DLineJoin /*eLineJoin*/) +{ + // TODO: implement + return false; +} + +// ----------------------------------------------------------------------- + sal_Bool Os2SalGraphics::drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ) { return sal_False; @@ -1010,7 +1037,9 @@ SystemGraphicsData Os2SalGraphics::GetGraphicsData() const { SystemGraphicsData aRes; aRes.nSize = sizeof(aRes); +#if 0 aRes.hDC = mhDC; +#endif return aRes; } diff --git a/vcl/os2/source/gdi/salgdi3.cxx b/vcl/os2/source/gdi/salgdi3.cxx index e72ad9a0ad29..e6a5788b401c 100644 --- a/vcl/os2/source/gdi/salgdi3.cxx +++ b/vcl/os2/source/gdi/salgdi3.cxx @@ -52,7 +52,6 @@ #include <vcl/svapp.hxx> #include <saldata.hxx> #include <salgdi.h> -#include <vcl/outfont.hxx> #include <vcl/font.hxx> #include <vcl/sallayout.hxx> #include <tools/poly.hxx> @@ -61,7 +60,9 @@ #include <tools/debug.hxx> #include <saldata.hxx> #include <salgdi.h> -#include <outfont.hxx> +#ifndef _SV_OUTFONT_HXX +#include <vcl/outfont.hxx> +#endif #include <sallayout.h> #include <tools/poly.hxx> #include <basegfx/polygon/b2dpolygon.hxx> @@ -400,7 +401,7 @@ sal_IntPtr ImplOs2FontData::GetFontId() const // ----------------------------------------------------------------------- -void ImplOs2FontData::UpdateFromHPS( HPS hPS ) +void ImplOs2FontData::UpdateFromHPS( HPS hPS ) const { // short circuit if already initialized if( mpUnicodeMap != NULL ) @@ -437,7 +438,7 @@ bool ImplOs2FontData::IsGSUBstituted( sal_Ucs cChar ) const // ----------------------------------------------------------------------- -ImplFontCharMap* ImplOs2FontData::GetImplFontCharMap() +ImplFontCharMap* ImplOs2FontData::GetImplFontCharMap() const { mpUnicodeMap->AddReference(); return mpUnicodeMap; @@ -450,7 +451,7 @@ static unsigned GetUShort( const unsigned char* p ){ return((p[0]<<8)+p[1]);} static signed GetSShort( const unsigned char* p ){ return((short)((p[0]<<8)+p[1]));} static inline DWORD CalcTag( const char p[4]) { return (p[0]+(p[1]<<8)+(p[2]<<16)+(p[3]<<24)); } -void ImplOs2FontData::ReadOs2Table( HPS hPS ) +void ImplOs2FontData::ReadOs2Table( HPS hPS ) const { const DWORD Os2Tag = CalcTag( "OS/2" ); DWORD nLength = Ft2GetFontData( hPS, Os2Tag, 0, NULL, 0 ); @@ -556,7 +557,7 @@ void ImplOs2FontData::ReadGsubTable( HPS hPS ) const // ----------------------------------------------------------------------- -void ImplOs2FontData::ReadCmapTable( HPS hPS ) +void ImplOs2FontData::ReadCmapTable( HPS hPS ) const { CmapResult aResult; aResult.mnPairCount = 0; @@ -804,7 +805,7 @@ USHORT Os2SalGraphics::SetFont( ImplFontSelectData* pFont, int nFallbackLevel ) DBG_ASSERT( pFont->mpFontData, "WinSalGraphics mpFontData==NULL"); mpOs2FontEntry[ nFallbackLevel ] = reinterpret_cast<ImplOs2FontEntry*>( pFont->mpFontEntry ); - mpOs2FontData[ nFallbackLevel ] = reinterpret_cast<ImplOs2FontData*>( pFont->mpFontData ); + mpOs2FontData[ nFallbackLevel ] = static_cast<const ImplOs2FontData*>( pFont->mpFontData ); ImplDoSetFont( pFont, mfFontScale, nFallbackLevel); @@ -1010,13 +1011,6 @@ ImplFontCharMap* Os2SalGraphics::GetImplFontCharMap() const if( !mpOs2FontData[0] ) return ImplFontCharMap::GetDefaultMap(); return mpOs2FontData[0]->GetImplFontCharMap(); -#if 0 -//if( !mpWinFontData[0] ) - // return ImplFontCharMap::GetDefaultMap(); - if (!pOs2DefaultImplFontCharMap) - pOs2DefaultImplFontCharMap = new ImplFontCharMap( 1, pOs2DefaultRangeCodes, NULL ); - return pOs2DefaultImplFontCharMap; -#endif } // ----------------------------------------------------------------------- @@ -1462,7 +1456,7 @@ BOOL Os2SalGraphics::CreateFontSubset( const rtl::OUString& rToFile, // create matching ImplFontSelectData // we need just enough to get to the font file data // use height=1000 for easier debugging (to match psprint's font units) - ImplFontSelectData aIFSD( *pFont, Size(0,1000), 0, false ); + ImplFontSelectData aIFSD( *pFont, Size(0,1000), 1000.0, 0, false ); // TODO: much better solution: move SetFont and restoration of old font to caller ScopedFont aOldFont(*this); @@ -1581,7 +1575,7 @@ const void* Os2SalGraphics::GetEmbedFontData( const ImplFontData* pFont, { // create matching ImplFontSelectData // we need just enough to get to the font file data - ImplFontSelectData aIFSD( *pFont, Size(0,1000), 0, false ); + ImplFontSelectData aIFSD( *pFont, Size(0,1000), 1000.0, 0, false ); // TODO: much better solution: move SetFont and restoration of old font to caller ScopedFont aOldFont(*this); @@ -1665,11 +1659,11 @@ const Ucs2SIntMap* Os2SalGraphics::GetFontEncodingVector( const ImplFontData* pF void Os2SalGraphics::GetGlyphWidths( const ImplFontData* pFont, bool bVertical, Int32Vector& rWidths, - Ucs2UInt& rUnicodeEnc ) + Ucs2UIntMap& rUnicodeEnc ) { // create matching ImplFontSelectData // we need just enough to get to the font file data - ImplFontSelectData aIFSD( *pFont, Size(0,1000), 0, false ); + ImplFontSelectData aIFSD( *pFont, Size(0,1000), 1000.0, 0, false ); // TODO: much better solution: move SetFont and restoration of old font to caller ScopedFont aOldFont(*this); @@ -1680,11 +1674,11 @@ void Os2SalGraphics::GetGlyphWidths( const ImplFontData* pFont, if( pFont->IsSubsettable() ) { // get raw font file data - DWORD nFontSize1 = ::Ft2GetFontData( mhDC, 0, 0, NULL, 0 ); + DWORD nFontSize1 = ::Ft2GetFontData( mhPS, 0, 0, NULL, 0 ); if( nFontSize1 == FT2_ERROR ) return; ScopedCharArray xRawFontData(new char[ nFontSize1 ]); - DWORD nFontSize2 = ::Ft2GetFontData( mhDC, 0, 0, (void*)xRawFontData.get(), nFontSize1 ); + DWORD nFontSize2 = ::Ft2GetFontData( mhPS, 0, 0, (void*)xRawFontData.get(), nFontSize1 ); if( nFontSize1 != nFontSize2 ) return; @@ -1716,7 +1710,7 @@ void Os2SalGraphics::GetGlyphWidths( const ImplFontData* pFont, free( pMetrics ); rUnicodeEnc.clear(); } - ImplOs2FontData* pWinFont = static_cast<ImplOs2FontData*>(pFont); + const ImplOs2FontData* pWinFont = static_cast<const ImplOs2FontData*>(pFont); ImplFontCharMap* pMap = pWinFont->GetImplFontCharMap(); DBG_ASSERT( pMap && pMap->GetCharCount(), "no map" ); diff --git a/vcl/os2/source/window/salframe.cxx b/vcl/os2/source/window/salframe.cxx index e90c7f9bf4af..8860d68d683e 100644 --- a/vcl/os2/source/window/salframe.cxx +++ b/vcl/os2/source/window/salframe.cxx @@ -56,7 +56,7 @@ #include <salgdi.h> #include <salframe.h> #include <vcl/timer.hxx> -#include <settings.hxx> +#include <vcl/settings.hxx> #ifndef _SV_KEYCOES_HXX #include <vcl/keycodes.hxx> #endif @@ -962,7 +962,7 @@ SalFrame* Os2SalFrame::GetParent() const // ----------------------------------------------------------------------- -static void ImplSalShow( HWND hWnd, BOOL bVisible, BOOL bNoActivate ) +static void ImplSalShow( HWND hWnd, ULONG bVisible, ULONG bNoActivate ) { Os2SalFrame* pFrame = GetWindowPtr( hWnd ); if ( !pFrame ) @@ -1392,6 +1392,40 @@ BOOL Os2SalFrame::GetWindowState( SalFrameState* pState ) // ----------------------------------------------------------------------- +void Os2SalFrame::SetScreenNumber( unsigned int nNewScreen ) +{ +#if 0 + WinSalSystem* pSys = static_cast<WinSalSystem*>(ImplGetSalSystem()); + if( pSys ) + { + const std::vector<WinSalSystem::DisplayMonitor>& rMonitors = + pSys->getMonitors(); + size_t nMon = rMonitors.size(); + if( nNewScreen < nMon ) + { + Point aOldMonPos, aNewMonPos( rMonitors[nNewScreen].m_aArea.TopLeft() ); + Point aCurPos( maGeometry.nX, maGeometry.nY ); + for( size_t i = 0; i < nMon; i++ ) + { + if( rMonitors[i].m_aArea.IsInside( aCurPos ) ) + { + aOldMonPos = rMonitors[i].m_aArea.TopLeft(); + break; + } + } + mnDisplay = nNewScreen; + maGeometry.nScreenNumber = nNewScreen; + SetPosSize( aNewMonPos.X() + (maGeometry.nX - aOldMonPos.X()), + aNewMonPos.Y() + (maGeometry.nY - aOldMonPos.Y()), + 0, 0, + SAL_FRAME_POSSIZE_X | SAL_FRAME_POSSIZE_Y ); + } + } +#endif +} + +// ----------------------------------------------------------------------- + // native menu implementation - currently empty void Os2SalFrame::DrawMenuBar() { @@ -1453,7 +1487,7 @@ void Os2SalFrame::SetAlwaysOnTop( BOOL bOnTop ) // ----------------------------------------------------------------------- -static void ImplSalToTop( HWND hWnd, USHORT nFlags ) +static void ImplSalToTop( HWND hWnd, ULONG nFlags ) { Os2SalFrame* pFrame = GetWindowPtr( hWnd ); #if OSL_DEBUG_LEVEL>0 @@ -3591,11 +3625,11 @@ MRESULT EXPENTRY SalFrameWndProc( HWND hWnd, ULONG nMsg, bDef = FALSE; break; case SAL_MSG_TOTOP: - ImplSalToTop( hWnd, (USHORT)nMP1 ); + ImplSalToTop( hWnd, (ULONG)nMP1 ); bDef = FALSE; break; case SAL_MSG_SHOW: - ImplSalShow( hWnd, (BOOL)nMP1, (BOOL)nMP2 ); + ImplSalShow( hWnd, (ULONG)nMP1, (ULONG)nMP2 ); bDef = FALSE; break; |