diff options
author | Philipp Lohmann [pl] <Philipp.Lohmann@Sun.COM> | 2011-01-24 20:21:12 +0100 |
---|---|---|
committer | Philipp Lohmann [pl] <Philipp.Lohmann@Sun.COM> | 2011-01-24 20:21:12 +0100 |
commit | 19ba1faf12419233e8a772ba8609703cbce1c6e7 (patch) | |
tree | f1dfda6c1e47e3a21be87bc647845e1657109670 /vcl/inc | |
parent | 5d463c719bb2881d63da68d0752e4086c265876d (diff) |
vcl2gnumake: #i116589# header cleanup: windows
Diffstat (limited to 'vcl/inc')
-rwxr-xr-x | vcl/inc/win/salbmp.h | 87 | ||||
-rwxr-xr-x | vcl/inc/win/saldata.hxx | 379 | ||||
-rwxr-xr-x | vcl/inc/win/salframe.h | 149 | ||||
-rwxr-xr-x | vcl/inc/win/salgdi.h | 405 | ||||
-rw-r--r-- | vcl/inc/win/salids.hrc | 120 | ||||
-rwxr-xr-x | vcl/inc/win/salinst.h | 104 | ||||
-rwxr-xr-x | vcl/inc/win/salmenu.h | 76 | ||||
-rwxr-xr-x | vcl/inc/win/salnativewidgets.h | 52 | ||||
-rwxr-xr-x | vcl/inc/win/salobj.h | 70 | ||||
-rwxr-xr-x | vcl/inc/win/salprn.h | 129 | ||||
-rwxr-xr-x | vcl/inc/win/salsys.h | 92 | ||||
-rwxr-xr-x | vcl/inc/win/saltimer.h | 44 | ||||
-rwxr-xr-x | vcl/inc/win/salvd.h | 60 | ||||
-rw-r--r-- | vcl/inc/win/svsys.h | 33 | ||||
-rwxr-xr-x | vcl/inc/win/wincomp.hxx | 263 |
15 files changed, 2063 insertions, 0 deletions
diff --git a/vcl/inc/win/salbmp.h b/vcl/inc/win/salbmp.h new file mode 100755 index 000000000000..44f3af42c137 --- /dev/null +++ b/vcl/inc/win/salbmp.h @@ -0,0 +1,87 @@ +/************************************************************************* + * + * 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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALBMP_H +#define _SV_SALBMP_H + +#include <tools/gen.hxx> +#include <win/wincomp.hxx> +#include <salbmp.hxx> + +// -------------- +// - SalBitmap - +// -------------- + +struct BitmapBuffer; +class BitmapColor; +class BitmapPalette; +class SalGraphics; + +class WinSalBitmap : public SalBitmap +{ +private: + + Size maSize; + HGLOBAL mhDIB; + HBITMAP mhDDB; + USHORT mnBitCount; + +public: + + HGLOBAL ImplGethDIB() const { return mhDIB; } + HBITMAP ImplGethDDB() const { return mhDDB; } + + static HGLOBAL ImplCreateDIB( const Size& rSize, USHORT nBitCount, const BitmapPalette& rPal ); + static HANDLE ImplCopyDIBOrDDB( HANDLE hHdl, bool bDIB ); + static USHORT ImplGetDIBColorCount( HGLOBAL hDIB ); + static void ImplDecodeRLEBuffer( const BYTE* pSrcBuf, BYTE* pDstBuf, + const Size& rSizePixel, bool bRLE4 ); + +public: + + WinSalBitmap(); + virtual ~WinSalBitmap(); + +public: + + bool Create( HANDLE hBitmap, bool bDIB, bool bCopyHandle ); + virtual bool Create( const Size& rSize, USHORT nBitCount, const BitmapPalette& rPal ); + virtual bool Create( const SalBitmap& rSalBmpImpl ); + virtual bool Create( const SalBitmap& rSalBmpImpl, SalGraphics* pGraphics ); + virtual bool Create( const SalBitmap& rSalBmpImpl, USHORT nNewBitCount ); + + virtual void Destroy(); + + virtual Size GetSize() const { return maSize; } + virtual USHORT GetBitCount() const { return mnBitCount; } + + virtual BitmapBuffer* AcquireBuffer( bool bReadOnly ); + virtual void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly ); + virtual bool GetSystemData( BitmapSystemData& rData ); +}; + +#endif // _SV_SALBMP_HXX diff --git a/vcl/inc/win/saldata.hxx b/vcl/inc/win/saldata.hxx new file mode 100755 index 000000000000..d945f7cedfa6 --- /dev/null +++ b/vcl/inc/win/saldata.hxx @@ -0,0 +1,379 @@ +/************************************************************************* + * + * 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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALDATA_HXX +#define _SV_SALDATA_HXX + +#include "osl/module.h" + +#include <svdata.hxx> +#include <salwtype.hxx> + +#include <win/wincomp.hxx> + +#include <set> // for hMenu validation +#include <map> + +class AutoTimer; +class WinSalInstance; +class WinSalObject; +class WinSalFrame; +class WinSalVirtualDevice; +class WinSalPrinter; +class Font; +struct HDCCache; +struct TempFontItem; + +typedef HRESULT (WINAPI *DwmIsCompositionEnabled_ptr)(WIN_BOOL*); + +// -------------------- +// - Standard-Defines - +// -------------------- + +#define MAX_STOCKPEN 4 +#define MAX_STOCKBRUSH 4 +#define SAL_CLIPRECT_COUNT 16 + +// -------------------- +// - Icon cache - +// -------------------- + +struct SalIcon +{ + int nId; + HICON hIcon; + HICON hSmallIcon; + SalIcon *pNext; +}; + +// ----------- +// - SalData - +// ----------- + +class SalData +{ +public: + SalData(); + ~SalData(); + + // native widget framework + void initNWF(); + void deInitNWF(); + + // fill maVKMap; + void initKeyCodeMap(); + + // checks if the menuhandle was created by VCL + BOOL IsKnownMenuHandle( HMENU hMenu ); + +public: + HINSTANCE mhInst; // default instance handle + HINSTANCE mhPrevInst; // previous instance handle + int mnCmdShow; // default frame show style + HPALETTE mhDitherPal; // dither palette + HGLOBAL mhDitherDIB; // dither memory handle + BYTE* mpDitherDIB; // dither memory + BYTE* mpDitherDIBData; // beginning of DIB data + long* mpDitherDiff; // Dither mapping table + BYTE* mpDitherLow; // Dither mapping table + BYTE* mpDitherHigh; // Dither mapping table + ULONG mnTimerMS; // Current Time (in MS) of the Timer + ULONG mnTimerOrgMS; // Current Original Time (in MS) + DWORD mnNextTimerTime; + DWORD mnLastEventTime; + UINT mnTimerId; // windows timer id + BOOL mbInTimerProc; // timer event is currently being dispatched + HHOOK mhSalObjMsgHook; // hook to get interesting msg for SalObject + HWND mhWantLeaveMsg; // window handle, that want a MOUSELEAVE message + AutoTimer* mpMouseLeaveTimer; // Timer for MouseLeave Test + WinSalInstance* mpFirstInstance; // pointer of first instance + WinSalFrame* mpFirstFrame; // pointer of first frame + WinSalObject* mpFirstObject; // pointer of first object window + WinSalVirtualDevice* mpFirstVD; // first VirDev + WinSalPrinter* mpFirstPrinter; // first printing printer + HDCCache* mpHDCCache; // Cache for three DC's + HBITMAP mh50Bmp; // 50% Bitmap + HBRUSH mh50Brush; // 50% Brush + COLORREF maStockPenColorAry[MAX_STOCKPEN]; + COLORREF maStockBrushColorAry[MAX_STOCKBRUSH]; + HPEN mhStockPenAry[MAX_STOCKPEN]; + HBRUSH mhStockBrushAry[MAX_STOCKBRUSH]; + USHORT mnStockPenCount; // count of static pens + USHORT mnStockBrushCount; // count of static brushes + WPARAM mnSalObjWantKeyEvt; // KeyEvent, welcher vom SalObj-Hook verarbeitet werden soll + BYTE mnCacheDCInUse; // count of CacheDC in use + BOOL mbObjClassInit; // is SALOBJECTCLASS initialised + BOOL mbInPalChange; // is in WM_QUERYNEWPALETTE + DWORD mnAppThreadId; // Id from Applikation-Thread + WIN_BOOL mbScrSvrEnabled; // ScreenSaver enabled + int mnSageStatus; // status of Sage-DLL (DISABLE_AGENT == nicht vorhanden) + SysAgt_Enable_PROC mpSageEnableProc; // funktion to deactivate the system agent + SalIcon* mpFirstIcon; // icon cache, points to first icon, NULL if none + TempFontItem* mpTempFontItem; + BOOL mbThemeChanged; // true if visual theme was changed: throw away theme handles + BOOL mbThemeMenuSupport; + + // for GdiPlus GdiplusStartup/GdiplusShutdown + ULONG_PTR gdiplusToken; + + std::set< HMENU > mhMenuSet; // keeps track of menu handles created by VCL, used by IsKnownMenuHandle() + std::map< UINT,USHORT > maVKMap; // map some dynamic VK_* entries + oslModule maDwmLib; + DwmIsCompositionEnabled_ptr mpDwmIsCompositionEnabled; +}; + +inline void SetSalData( SalData* pData ) { ImplGetSVData()->mpSalData = (void*)pData; } +inline SalData* GetSalData() { return (SalData*)ImplGetSVData()->mpSalData; } +inline SalData* GetAppSalData() { return (SalData*)ImplGetAppSVData()->mpSalData; } + +// -------------- +// - SalShlData - +// -------------- + +struct SalShlData +{ + HINSTANCE mhInst; // Instance of SAL-DLL + UINT mnWheelScrollLines; // WheelScrollLines + UINT mnWheelScrollChars; // WheelScrollChars + UINT mnWheelMsgId; // Wheel-Message-Id fuer W95 + WORD mnVersion; // System-Version (311 == 3.11) + WIN_BOOL mbW40; // Is System-Version >= 4.0 + WIN_BOOL mbWXP; // Windows XP + WIN_BOOL mbWPrinter; // true: use unicode printer functions + // false: use anis compat printer functions + OSVERSIONINFO maVersionInfo; +}; + +extern SalShlData aSalShlData; + +// ------------ +// - GDICache - +// ------------ + +#define CACHESIZE_HDC 3 +#define CACHED_HDC_1 0 +#define CACHED_HDC_2 1 +#define CACHED_HDC_DRAW 2 +#define CACHED_HDC_DEFEXT 64 + +struct HDCCache +{ + HDC mhDC; + HPALETTE mhDefPal; + HBITMAP mhDefBmp; + HBITMAP mhSelBmp; + HBITMAP mhActBmp; +}; + +void ImplClearHDCCache( SalData* pData ); +HDC ImplGetCachedDC( ULONG nID, HBITMAP hBmp = 0 ); +void ImplReleaseCachedDC( ULONG nID ); + +bool ImplAddTempFont( SalData&, const String& rFontFileURL ); +void ImplReleaseTempFonts( SalData& ); + +// -------------------------------------------- +// - SALSHL.CXX - for accessing DLL resources - +// -------------------------------------------- + +HCURSOR ImplLoadSalCursor( int nId ); +HBITMAP ImplLoadSalBitmap( int nId ); +BOOL ImplLoadSalIcon( int nId, HICON& rIcon, HICON& rSmallIcon ); + +// SALGDI.CXX +void ImplInitSalGDI(); +void ImplFreeSalGDI(); + +// -------------- +// - Prototypes - +// -------------- + +// \\WIN\SOURCE\APP\SALINST.CXX +void ImplSalYieldMutexAcquireWithWait(); +BOOL ImplSalYieldMutexTryToAcquire(); +void ImplSalYieldMutexAcquire(); +void ImplSalYieldMutexRelease(); +ULONG ImplSalReleaseYieldMutex(); +void ImplSalAcquireYieldMutex( ULONG nCount ); +sal_Bool ImplInterceptChildWindowKeyDown( MSG& rMsg ); + +// \\WIN\SOURCE\WINDOW\SALFRAME.CXX +LRESULT CALLBACK SalFrameWndProcA( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam ); +LRESULT CALLBACK SalFrameWndProcW( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam ); +// \SV\WIN\SOURCE\APP\SALTIMER.CXX +#define SALTIMERPROC_RECURSIVE 0xffffffff +void CALLBACK SalTimerProc( HWND hWnd, UINT nMsg, UINT_PTR nId, DWORD nTime ); + +// \WIN\SOURCE\WINDOW\SALFRAME.CXX +void SalTestMouseLeave(); +BOOL ImplWriteLastError( DWORD lastError, const char *szApiCall ); + +// \WIN\SOURCE\WINDOW\SALFRAME.CXX +long ImplHandleSalObjKeyMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam ); +long ImplHandleSalObjSysCharMsg( HWND hWnd, WPARAM wParam, LPARAM lParam ); +BOOL ImplHandleGlobalMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, LRESULT& rlResult ); + +// \WIN\SOURCE\WINDOW\SALOBJ.CXX +WinSalObject* ImplFindSalObject( HWND hWndChild ); +BOOL ImplSalPreDispatchMsg( MSG* pMsg ); +void ImplSalPostDispatchMsg( MSG* pMsg, LRESULT nDispatchResult ); + +// \WIN\SOURCE\GDI\SALGDI3.CXX +void ImplSalLogFontToFontA( HDC hDC, const LOGFONTA& rLogFont, Font& rFont ); +void ImplSalLogFontToFontW( HDC hDC, const LOGFONTW& rLogFont, Font& rFont ); +bool ImplIsFontAvailable( HDC hDC, const UniString& rName ); + +// \WIN\SOURCE\APP\SALDATA.CXX +rtl_TextEncoding ImplSalGetSystemEncoding(); +ByteString ImplSalGetWinAnsiString( const UniString& rStr, BOOL bFileName = FALSE ); +UniString ImplSalGetUniString( const sal_Char* pStr, xub_StrLen nLen = STRING_LEN ); +int ImplSalWICompareAscii( const wchar_t* pStr1, const char* pStr2 ); + +// ----------- +// - Defines - +// ----------- + +#define SAL_FRAME_WNDEXTRA sizeof( DWORD ) +#define SAL_FRAME_THIS 0 +#define SAL_FRAME_CLASSNAMEA "SALFRAME" +#define SAL_FRAME_CLASSNAMEW L"SALFRAME" +#define SAL_SUBFRAME_CLASSNAMEA "SALSUBFRAME" +#define SAL_SUBFRAME_CLASSNAMEW L"SALSUBFRAME" +#define SAL_TMPSUBFRAME_CLASSNAMEW L"SALTMPSUBFRAME" +#define SAL_OBJECT_WNDEXTRA sizeof( DWORD ) +#define SAL_OBJECT_THIS 0 +#define SAL_OBJECT_CLASSNAMEA "SALOBJECT" +#define SAL_OBJECT_CLASSNAMEW L"SALOBJECT" +#define SAL_OBJECT_CHILDCLASSNAMEA "SALOBJECTCHILD" +#define SAL_OBJECT_CHILDCLASSNAMEW L"SALOBJECTCHILD" +#define SAL_COM_CLASSNAMEA "SALCOMWND" +#define SAL_COM_CLASSNAMEW L"SALCOMWND" + +#define SAL_MOUSELEAVE_TIMEOUT 300 + +// wParam == hDC; lParam == 0 +#define SAL_MSG_PRINTABORTJOB (WM_USER+110) +// wParam == bWait; lParam == 0 +#define SAL_MSG_THREADYIELD (WM_USER+111) +// wParam == 0; lParam == 0 +#define SAL_MSG_RELEASEWAITYIELD (WM_USER+112) +// wParam == 0; lParam == nMS +#define SAL_MSG_STARTTIMER (WM_USER+113) +// wParam == nFrameStyle; lParam == pParent; lResult == pFrame +#define SAL_MSG_CREATEFRAME (WM_USER+114) +// wParam == 0; lParam == 0 +#define SAL_MSG_DESTROYFRAME (WM_USER+115) +// wParam == 0; lParam == pParent; lResult == pObject +#define SAL_MSG_CREATEOBJECT (WM_USER+116) +// wParam == 0; lParam == pObject; +#define SAL_MSG_DESTROYOBJECT (WM_USER+117) +// wParam == hWnd; lParam == 0; lResult == hDC +#define SAL_MSG_GETDC (WM_USER+120) +// wParam == hWnd; lParam == 0 +#define SAL_MSG_RELEASEDC (WM_USER+121) +// wParam == newParentHwnd; lParam == oldHwnd; lResult == newhWnd +#define SAL_MSG_RECREATEHWND (WM_USER+122) +// wParam == newParentHwnd; lParam == oldHwnd; lResult == newhWnd +#define SAL_MSG_RECREATECHILDHWND (WM_USER+123) +// wParam == 0; lParam == HWND; +#define SAL_MSG_DESTROYHWND (WM_USER+124) + +// wParam == 0; lParam == pData +#define SAL_MSG_USEREVENT (WM_USER+130) +// wParam == 0; lParam == MousePosition relativ to upper left of screen +#define SAL_MSG_MOUSELEAVE (WM_USER+131) +// NULL-Message, soll nicht verarbeitet werden +#define SAL_MSG_DUMMY (WM_USER+132) +// wParam == 0; lParam == 0 +#define SAL_MSG_POSTFOCUS (WM_USER+133) +// wParam == wParam; lParam == lParam +#define SAL_MSG_POSTQUERYNEWPAL (WM_USER+134) +// wParam == wParam; lParam == lParam +#define SAL_MSG_POSTPALCHANGED (WM_USER+135) +// wParam == wParam; lParam == lParam +#define SAL_MSG_POSTMOVE (WM_USER+136) +// wParam == wParam; lParam == lParam +#define SAL_MSG_POSTCALLSIZE (WM_USER+137) +// wParam == pRECT; lParam == 0 +#define SAL_MSG_POSTPAINT (WM_USER+138) +// wParam == 0; lParam == pFrame; lResult 0 +#define SAL_MSG_FORCEPALETTE (WM_USER+139) +// wParam == 0; lParam == 0 +#define SAL_MSG_CAPTUREMOUSE (WM_USER+140) +// wParam == 0; lParam == 0 +#define SAL_MSG_RELEASEMOUSE (WM_USER+141) +// wParam == nFlags; lParam == 0 +#define SAL_MSG_TOTOP (WM_USER+142) +// wParam == bVisible; lParam == 0 +#define SAL_MSG_SHOW (WM_USER+143) +// wParam == 0; lParam == SalInputContext +#define SAL_MSG_SETINPUTCONTEXT (WM_USER+144) +// wParam == nFlags; lParam == 0 +#define SAL_MSG_ENDEXTTEXTINPUT (WM_USER+145) +// POSTTIMER-Message; wparam = 0, lParam == time +#define SAL_MSG_POSTTIMER (WM_USER+161) + +// SysChild-ToTop; wParam = 0; lParam = 0 +#define SALOBJ_MSG_TOTOP (WM_USER+160) +// POSTFOCUS-Message; wParam == bFocus; lParam == 0 +#define SALOBJ_MSG_POSTFOCUS (WM_USER+161) + + +// ----------------- +// - Helpfunctions - +// ----------------- + +// A/W-Wrapper +LONG ImplSetWindowLong( HWND hWnd, int nIndex, DWORD dwNewLong ); +LONG ImplGetWindowLong( HWND hWnd, int nIndex ); +WIN_BOOL ImplPostMessage( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam ); +WIN_BOOL ImplSendMessage( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam ); +WIN_BOOL ImplGetMessage( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax ); +WIN_BOOL ImplPeekMessage( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg ); +LONG ImplDispatchMessage( CONST MSG *lpMsg ); + +inline void SetWindowPtr( HWND hWnd, WinSalFrame* pThis ) +{ + ImplSetWindowLong( hWnd, SAL_FRAME_THIS, (LONG)pThis ); +} + +inline WinSalFrame* GetWindowPtr( HWND hWnd ) +{ + return (WinSalFrame*)ImplGetWindowLong( hWnd, SAL_FRAME_THIS ); +} + +inline void SetSalObjWindowPtr( HWND hWnd, WinSalObject* pThis ) +{ + ImplSetWindowLong( hWnd, SAL_OBJECT_THIS, (LONG)pThis ); +} + +inline WinSalObject* GetSalObjWindowPtr( HWND hWnd ) +{ + return (WinSalObject*)ImplGetWindowLong( hWnd, SAL_OBJECT_THIS ); +} + +#endif // _SV_SALDATA_HXX diff --git a/vcl/inc/win/salframe.h b/vcl/inc/win/salframe.h new file mode 100755 index 000000000000..92b6bbc509da --- /dev/null +++ b/vcl/inc/win/salframe.h @@ -0,0 +1,149 @@ +/************************************************************************* + * + * 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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALFRAME_H +#define _SV_SALFRAME_H + +#include <vcl/sysdata.hxx> +#include <salframe.hxx> + +class WinSalGraphics; + +// ---------------- +// - WinSalFrame - +// ---------------- + +class WinSalFrame : public SalFrame +{ +public: + HWND mhWnd; // Window handle + HCURSOR mhCursor; // cursor handle + HIMC mhDefIMEContext; // default IME-Context + WinSalGraphics* mpGraphics; // current frame graphics + WinSalGraphics* mpGraphics2; // current frame graphics for other threads + WinSalFrame* mpNextFrame; // pointer to next frame + HMENU mSelectedhMenu; // the menu where highlighting is currently going on + HMENU mLastActivatedhMenu; // the menu that was most recently opened + SystemEnvData maSysData; // system data + SalFrameState maState; // frame state + int mnShowState; // show state + long mnWidth; // client width in pixeln + long mnHeight; // client height in pixeln + int mnMinWidth; // min. client width in pixeln + int mnMinHeight; // min. client height in pixeln + int mnMaxWidth; // max. client width in pixeln + int mnMaxHeight; // max. client height in pixeln + RECT maFullScreenRect; // fullscreen rect + int mnFullScreenShowState; // fullscreen restore show state + UINT mnInputLang; // current Input Language + UINT mnInputCodePage; // current Input CodePage + ULONG mnStyle; // style + BOOL mbGraphics; // is Graphics used + BOOL mbCaption; // has window a caption + BOOL mbBorder; // has window a border + BOOL mbFixBorder; // has window a fixed border + BOOL mbSizeBorder; // has window a sizeable border + BOOL mbNoIcon; // is an window without an icon + BOOL mbFloatWin; // is a FloatingWindow + BOOL mbFullScreen; // TRUE: in full screen mode + BOOL mbPresentation; // TRUE: Presentation Mode running + BOOL mbInShow; // innerhalb eines Show-Aufrufs + BOOL mbRestoreMaximize; // Restore-Maximize + BOOL mbInMoveMsg; // Move-Message wird verarbeitet + BOOL mbInSizeMsg; // Size-Message wird verarbeitet + BOOL mbFullScreenToolWin; // WS_EX_TOOLWINDOW reset in FullScreenMode + BOOL mbDefPos; // default-position + BOOL mbOverwriteState; // TRUE: WindowState darf umgesetzt werden + BOOL mbIME; // TRUE: We are in IME Mode + BOOL mbHandleIME; // TRUE: Wir handeln die IME-Messages + BOOL mbSpezIME; // TRUE: Spez IME + BOOL mbAtCursorIME; // TRUE: Wir behandeln nur einige IME-Messages + BOOL mbCandidateMode; // TRUE: Wir befinden uns im Candidate-Modus + static BOOL mbInReparent; // TRUE: ignore focus lost and gain due to reparenting + + RGNDATA* mpClipRgnData; + RECT* mpNextClipRect; + BOOL mbFirstClipRect; + sal_Int32 mnDisplay; // Display used for Fullscreen, 0 is primary monitor + + void updateScreenNumber(); +public: + WinSalFrame(); + virtual ~WinSalFrame(); + + virtual SalGraphics* GetGraphics(); + virtual void ReleaseGraphics( SalGraphics* pGraphics ); + virtual BOOL PostEvent( void* pData ); + virtual void SetTitle( const XubString& rTitle ); + virtual void SetIcon( USHORT nIcon ); + virtual void SetMenu( SalMenu* pSalMenu ); + virtual void DrawMenuBar(); + virtual void SetExtendedFrameStyle( SalExtStyle nExtStyle ); + virtual void Show( BOOL bVisible, BOOL bNoActivate = FALSE ); + virtual void Enable( BOOL bEnable ); + virtual void SetMinClientSize( long nWidth, long nHeight ); + virtual void SetMaxClientSize( long nWidth, long nHeight ); + virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags ); + virtual void GetClientSize( long& rWidth, long& rHeight ); + virtual void GetWorkArea( Rectangle& rRect ); + virtual SalFrame* GetParent() const; + virtual void SetWindowState( const SalFrameState* pState ); + virtual BOOL GetWindowState( SalFrameState* pState ); + virtual void ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay ); + virtual void StartPresentation( BOOL bStart ); + virtual void SetAlwaysOnTop( BOOL bOnTop ); + virtual void ToTop( USHORT nFlags ); + virtual void SetPointer( PointerStyle ePointerStyle ); + virtual void CaptureMouse( BOOL bMouse ); + virtual void SetPointerPos( long nX, long nY ); + using SalFrame::Flush; + virtual void Flush(); + virtual void Sync(); + virtual void SetInputContext( SalInputContext* pContext ); + virtual void EndExtTextInput( USHORT nFlags ); + virtual String GetKeyName( USHORT nKeyCode ); + virtual String GetSymbolKeyName( const XubString& rFontName, USHORT nKeyCode ); + virtual BOOL MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode ); + virtual LanguageType GetInputLanguage(); + virtual SalBitmap* SnapShot(); + virtual void UpdateSettings( AllSettings& rSettings ); + virtual void Beep( SoundType eSoundType ); + virtual const SystemEnvData* GetSystemData() const; + virtual SalPointerState GetPointerState(); + 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 ); + virtual void EndSetClipRegion(); +}; + +void ImplSalGetWorkArea( HWND hWnd, RECT *pRect, const RECT *pParentRect ); + +#endif // _SV_SALFRAME_H diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h new file mode 100755 index 000000000000..3b0daa6d95ef --- /dev/null +++ b/vcl/inc/win/salgdi.h @@ -0,0 +1,405 @@ +/************************************************************************* + * + * 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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALGDI_H +#define _SV_SALGDI_H + +#include <sallayout.hxx> +#include <salgdi.hxx> +#include <outfont.hxx> +#include <impfont.hxx> + +#include "boost/scoped_ptr.hpp" +#include <hash_set> + +class ImplFontSelectData; +class ImplWinFontEntry; +class ImplFontAttrCache; + +// ----------- +// - Defines - +// ----------- + +#define RGB_TO_PALRGB(nRGB) ((nRGB)|0x02000000) +#define PALRGB_TO_RGB(nPalRGB) ((nPalRGB)&0x00ffffff) + +// win32 platform specific options. Move them to the PMK file? + +#define GCP_KERN_HACK +#define GNG_VERT_HACK + +// win32 specific physically available font face +class ImplWinFontData : public ImplFontData +{ +public: + explicit ImplWinFontData( const ImplDevFontAttributes&, + int nFontHeight, WIN_BYTE eWinCharSet, + WIN_BYTE nPitchAndFamily ); + virtual ~ImplWinFontData(); + + virtual ImplFontData* Clone() const; + virtual ImplFontEntry* CreateFontInstance( ImplFontSelectData& ) const; + virtual sal_IntPtr GetFontId() const; + void SetFontId( sal_IntPtr nId ) { mnId = nId; } + void UpdateFromHDC( HDC ) const; + + bool HasChar( sal_uInt32 cChar ) const; + + WIN_BYTE GetCharSet() const { return meWinCharSet; } + WIN_BYTE GetPitchAndFamily() const { return mnPitchAndFamily; } + bool IsGlyphApiDisabled() const { return mbDisableGlyphApi; } + bool SupportsKorean() const { return mbHasKoreanRange; } + bool SupportsCJK() const { return mbHasCJKSupport; } + bool SupportsArabic() const { return mbHasArabicSupport; } + bool AliasSymbolsHigh() const { return mbAliasSymbolsHigh; } + bool AliasSymbolsLow() const { return mbAliasSymbolsLow; } +#ifdef ENABLE_GRAPHITE + bool SupportsGraphite() const { return mbHasGraphiteSupport; } +#endif + + const ImplFontCharMap* GetImplFontCharMap() const; + const Ucs2SIntMap* GetEncodingVector() const { return mpEncodingVector; } + void SetEncodingVector( const Ucs2SIntMap* pNewVec ) const + { + if( mpEncodingVector ) + delete mpEncodingVector; + mpEncodingVector = pNewVec; + } +private: + sal_IntPtr mnId; + + // some members that are initalized lazily when the font gets selected into a HDC + mutable bool mbDisableGlyphApi; + mutable bool mbHasKoreanRange; + mutable bool mbHasCJKSupport; +#ifdef ENABLE_GRAPHITE + mutable bool mbHasGraphiteSupport; +#endif + mutable bool mbHasArabicSupport; + mutable ImplFontCharMap* mpUnicodeMap; + mutable const Ucs2SIntMap* mpEncodingVector; + + // 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) + BYTE mnFontCharSetCount; // Number of Charsets of the current font; 0 - if not queried + WIN_BYTE meWinCharSet; + WIN_BYTE mnPitchAndFamily; + bool mbAliasSymbolsHigh; + bool mbAliasSymbolsLow; +private: + void ReadCmapTable( HDC ) const; + void ReadOs2Table( HDC ) const; + +#ifdef GNG_VERT_HACK + void ReadGsubTable( HDC ) const; + + typedef std::hash_set<sal_UCS4> UcsHashSet; + mutable UcsHashSet maGsubTable; + mutable bool mbGsubRead; +public: + bool HasGSUBstitutions( HDC ) const; + bool IsGSUBstituted( sal_UCS4 ) const; +#endif // GNG_VERT_HACK +}; + +// ------------------ +// - WinSalGraphics - +// ------------------ + +class WinSalGraphics : public SalGraphics +{ +public: + HDC mhDC; // HDC + HWND mhWnd; // Window-Handle, when Window-Graphics + HFONT mhFonts[ MAX_FALLBACK ]; // Font + Fallbacks + const ImplWinFontData* mpWinFontData[ MAX_FALLBACK ]; // pointer to the most recent font face + ImplWinFontEntry* mpWinFontEntry[ MAX_FALLBACK ]; // pointer to the most recent font instance + float mfFontScale; // allows metrics emulation of huge font sizes + HPEN mhPen; // Pen + HBRUSH mhBrush; // Brush + HRGN mhRegion; // Region Handle + HPEN mhDefPen; // DefaultPen + HBRUSH mhDefBrush; // DefaultBrush + HFONT mhDefFont; // DefaultFont + HPALETTE mhDefPal; // DefaultPalette + COLORREF mnPenColor; // PenColor + COLORREF mnBrushColor; // BrushColor + COLORREF mnTextColor; // TextColor + RGNDATA* mpClipRgnData; // ClipRegion-Data + RGNDATA* mpStdClipRgnData; // Cache Standard-ClipRegion-Data + RECT* mpNextClipRect; // Naechstes ClipRegion-Rect + BOOL mbFirstClipRect; // Flag for first cliprect to insert + LOGFONTA* mpLogFont; // LOG-Font which is currently selected (only W9x) + ImplFontAttrCache* mpFontAttrCache; // Cache font attributes from files in so/share/fonts + BYTE* mpFontCharSets; // All Charsets for the current font + BYTE mnFontCharSetCount; // Number of Charsets of the current font; 0 - if not queried + BOOL mbFontKernInit; // FALSE: FontKerns must be queried + KERNINGPAIR* mpFontKernPairs; // Kerning Pairs of the current Font + ULONG mnFontKernPairCount;// Number of Kerning Pairs of the current Font + int mnPenWidth; // Linienbreite + BOOL mbStockPen; // is Pen a stockpen + BOOL mbStockBrush; // is Brush a stcokbrush + BOOL mbPen; // is Pen (FALSE == NULL_PEN) + BOOL mbBrush; // is Brush (FALSE == NULL_BRUSH) + BOOL mbPrinter; // is Printer + BOOL mbVirDev; // is VirDev + BOOL mbWindow; // is Window + BOOL mbScreen; // is Screen compatible + bool mbXORMode; // _every_ output with RasterOp XOR + + // remember RGB values for SetLineColor/SetFillColor + SalColor maLineColor; + SalColor maFillColor; + + HFONT ImplDoSetFont( ImplFontSelectData* i_pFont, float& o_rFontScale, HFONT& o_rOldFont ); + +public: + explicit WinSalGraphics(); + virtual ~WinSalGraphics(); + +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 ); + virtual void drawLine( long nX1, long nY1, long nX2, long nY2 ); + virtual void drawRect( long nX, long nY, long nWidth, long nHeight ); + virtual void drawPolyLine( ULONG nPoints, const SalPoint* pPtAry ); + virtual void drawPolygon( ULONG nPoints, const SalPoint* pPtAry ); + virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ); + virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ); + virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& 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( sal_uInt32 nPoly, const sal_uInt32* pPoints, const SalPoint* const* pPtAry, const BYTE* const* pFlgAry ); + + // CopyArea --> No RasterOp, but ClipRegion + virtual void copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth, + long nSrcHeight, USHORT 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( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags ); + + virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize ); + + // native widget rendering methods that require mirroring + virtual BOOL hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, + const Point& aPos, BOOL& rIsInside ); + virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, + ControlState nState, const ImplControlValue& aValue, + const rtl::OUString& aCaption ); + virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, + ControlState nState, const ImplControlValue& aValue, + const rtl::OUString& aCaption ); + virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState, + const ImplControlValue& aValue, const rtl::OUString& aCaption, + Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion ); + + 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: + // public SalGraphics methods, the interface to teh independent vcl part + + // get device resolution + virtual void GetResolution( long& rDPIX, long& rDPIY ); + // get the depth of the device + virtual USHORT GetBitCount(); + // get the width of the device + virtual long GetGraphicsWidth() const; + + // set the clip region to empty + virtual void ResetClipRegion(); + // begin setting the clip region, add rectangles to the + // region with the UnionClipRegion call + virtual void BeginSetClipRegion( ULONG nCount ); + // all rectangles were added and the clip region should be set now + virtual void EndSetClipRegion(); + + // 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 ); + // 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 USHORT 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 ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs ); + // get the repertoire of the current font + virtual const ImplFontCharMap* GetImplFontCharMap() 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 BOOL CreateFontSubset( const rtl::OUString& rToFile, + const ImplFontData*, + 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 int GetMinKashidaWidth(); + + virtual BOOL GetGlyphBoundRect( long nIndex, Rectangle& ); + virtual BOOL GetGlyphOutline( long 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 BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart ); + + virtual SystemGraphicsData GetGraphicsData() const; + virtual SystemFontData GetSysFontData( int nFallbacklevel ) const; +}; + +// Init/Deinit Graphics +void ImplSalInitGraphics( WinSalGraphics* ); +void ImplSalDeInitGraphics( WinSalGraphics* ); +void ImplUpdateSysColorEntries(); +int ImplIsSysColorEntry( SalColor nSalColor ); +void ImplGetLogFontFromFontSelect( HDC, const ImplFontSelectData*, + LOGFONTW&, bool bTestVerticalAvail ); + +// ----------- +// - Defines - +// ----------- + +#define MAX_64KSALPOINTS ((((USHORT)0xFFFF)-8)/sizeof(POINTS)) + +// ----------- +// - Inlines - +// ----------- + +// #102411# Win's GCP mishandles kerning => we need to do it ourselves +// SalGraphicsData::mpFontKernPairs is sorted by +inline bool ImplCmpKernData( const KERNINGPAIR& a, const KERNINGPAIR& b ) +{ + if( a.wFirst < b.wFirst ) + return true; + if( a.wFirst > b.wFirst ) + return false; + return (a.wSecond < b.wSecond); +} + +// called extremely often from just one spot => inline +inline bool ImplWinFontData::HasChar( sal_uInt32 cChar ) const +{ + if( mpUnicodeMap->HasChar( cChar ) ) + return true; + // second chance to allow symbol aliasing + if( mbAliasSymbolsLow && ((cChar-0xF000) <= 0xFF) ) + cChar -= 0xF000; + else if( mbAliasSymbolsHigh && (cChar <= 0xFF) ) + cChar += 0xF000; + else + return false; + return mpUnicodeMap->HasChar( cChar ); +} + +#endif // _SV_SALGDI_H + diff --git a/vcl/inc/win/salids.hrc b/vcl/inc/win/salids.hrc new file mode 100644 index 000000000000..3049f11b551b --- /dev/null +++ b/vcl/inc/win/salids.hrc @@ -0,0 +1,120 @@ +/************************************************************************* + * + * 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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALIDS_HRC +#define _SV_SALIDS_HRC + +// Cursor +#define SAL_RESID_POINTER_NULL 10000 +#ifndef W40ONLY +#define SAL_RESID_POINTER_HELP 10001 +#endif +#ifndef WNT +#define SAL_RESID_POINTER_HSIZE 10002 +#define SAL_RESID_POINTER_VSIZE 10003 +#define SAL_RESID_POINTER_NESWSIZE 10004 +#define SAL_RESID_POINTER_NWSESIZE 10005 +#endif +#define SAL_RESID_POINTER_CROSS 10006 +#define SAL_RESID_POINTER_MOVE 10007 +#define SAL_RESID_POINTER_HSPLIT 10008 +#define SAL_RESID_POINTER_VSPLIT 10009 +#define SAL_RESID_POINTER_HSIZEBAR 10010 +#define SAL_RESID_POINTER_VSIZEBAR 10011 +#define SAL_RESID_POINTER_HAND 10012 +#define SAL_RESID_POINTER_REFHAND 10013 +#define SAL_RESID_POINTER_PEN 10014 +#define SAL_RESID_POINTER_MAGNIFY 10015 +#define SAL_RESID_POINTER_FILL 10016 +#define SAL_RESID_POINTER_ROTATE 10017 +#define SAL_RESID_POINTER_HSHEAR 10018 +#define SAL_RESID_POINTER_VSHEAR 10019 +#define SAL_RESID_POINTER_MIRROR 10020 +#define SAL_RESID_POINTER_CROOK 10021 +#define SAL_RESID_POINTER_CROP 10022 +#define SAL_RESID_POINTER_MOVEPOINT 10023 +#define SAL_RESID_POINTER_MOVEBEZIERWEIGHT 10024 +#define SAL_RESID_POINTER_MOVEDATA 10025 +#define SAL_RESID_POINTER_COPYDATA 10026 +#define SAL_RESID_POINTER_LINKDATA 10027 +#define SAL_RESID_POINTER_MOVEDATALINK 10028 +#define SAL_RESID_POINTER_COPYDATALINK 10029 +#define SAL_RESID_POINTER_MOVEFILE 10030 +#define SAL_RESID_POINTER_COPYFILE 10031 +#define SAL_RESID_POINTER_LINKFILE 10032 +#define SAL_RESID_POINTER_MOVEFILELINK 10033 +#define SAL_RESID_POINTER_COPYFILELINK 10034 +#define SAL_RESID_POINTER_MOVEFILES 10035 +#define SAL_RESID_POINTER_COPYFILES 10036 +#define SAL_RESID_POINTER_NOTALLOWED 10037 +#define SAL_RESID_POINTER_DRAW_LINE 10038 +#define SAL_RESID_POINTER_DRAW_RECT 10039 +#define SAL_RESID_POINTER_DRAW_POLYGON 10040 +#define SAL_RESID_POINTER_DRAW_BEZIER 10041 +#define SAL_RESID_POINTER_DRAW_ARC 10042 +#define SAL_RESID_POINTER_DRAW_PIE 10043 +#define SAL_RESID_POINTER_DRAW_CIRCLECUT 10044 +#define SAL_RESID_POINTER_DRAW_ELLIPSE 10045 +#define SAL_RESID_POINTER_DRAW_FREEHAND 10046 +#define SAL_RESID_POINTER_DRAW_CONNECT 10047 +#define SAL_RESID_POINTER_DRAW_TEXT 10048 +#define SAL_RESID_POINTER_DRAW_CAPTION 10049 +#define SAL_RESID_POINTER_CHART 10050 +#define SAL_RESID_POINTER_DETECTIVE 10051 +#define SAL_RESID_POINTER_PIVOT_COL 10052 +#define SAL_RESID_POINTER_PIVOT_ROW 10053 +#define SAL_RESID_POINTER_PIVOT_FIELD 10054 +#define SAL_RESID_POINTER_CHAIN 10055 +#define SAL_RESID_POINTER_CHAIN_NOTALLOWED 10056 +#define SAL_RESID_POINTER_TIMEEVENT_MOVE 10057 +#define SAL_RESID_POINTER_TIMEEVENT_SIZE 10058 +#define SAL_RESID_POINTER_AUTOSCROLL_N 10059 +#define SAL_RESID_POINTER_AUTOSCROLL_S 10060 +#define SAL_RESID_POINTER_AUTOSCROLL_W 10061 +#define SAL_RESID_POINTER_AUTOSCROLL_E 10062 +#define SAL_RESID_POINTER_AUTOSCROLL_NW 10063 +#define SAL_RESID_POINTER_AUTOSCROLL_NE 10064 +#define SAL_RESID_POINTER_AUTOSCROLL_SW 10065 +#define SAL_RESID_POINTER_AUTOSCROLL_SE 10066 +#define SAL_RESID_POINTER_AUTOSCROLL_NS 10067 +#define SAL_RESID_POINTER_AUTOSCROLL_WE 10068 +#define SAL_RESID_POINTER_AUTOSCROLL_NSWE 10069 +#define SAL_RESID_POINTER_AIRBRUSH 10070 +#define SAL_RESID_POINTER_TEXT_VERTICAL 10071 +#define SAL_RESID_POINTER_PIVOT_DELETE 10072 +#define SAL_RESID_POINTER_TAB_SELECT_S 10073 +#define SAL_RESID_POINTER_TAB_SELECT_E 10074 +#define SAL_RESID_POINTER_TAB_SELECT_SE 10075 +#define SAL_RESID_POINTER_TAB_SELECT_W 10076 +#define SAL_RESID_POINTER_TAB_SELECT_SW 10077 +#define SAL_RESID_POINTER_PAINTBRUSH 10078 + +#define SAL_RESID_BITMAP_50 11000 + +#define SAL_RESID_ICON_DEFAULT 1 + +#endif // _SV_SALIDS_HRC diff --git a/vcl/inc/win/salinst.h b/vcl/inc/win/salinst.h new file mode 100755 index 000000000000..6fc160a19e05 --- /dev/null +++ b/vcl/inc/win/salinst.h @@ -0,0 +1,104 @@ +/************************************************************************* + * + * 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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALINST_H +#define _SV_SALINST_H + +#include <salinst.hxx> + +namespace vos { class OMutex; } + +// ------------------- +// - SalInstanceData - +// ------------------- + +class SalYieldMutex; + +class WinSalInstance : public SalInstance +{ +public: + HINSTANCE mhInst; // Instance Handle + HWND mhComWnd; // window, for communication (between threads and the main thread) + SalYieldMutex* mpSalYieldMutex; // Sal-Yield-Mutex + vos::OMutex* mpSalWaitMutex; // Sal-Wait-Mutex + USHORT mnYieldWaitCount; // Wait-Count +public: + WinSalInstance(); + virtual ~WinSalInstance(); + + virtual SalFrame* CreateChildFrame( SystemParentData* pParent, ULONG nStyle ); + virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle ); + virtual void DestroyFrame( SalFrame* pFrame ); + virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow = TRUE ); + virtual void DestroyObject( SalObject* pObject ); + virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics, + long nDX, long nDY, + USHORT 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 vos::IMutex* GetYieldMutex(); + virtual ULONG ReleaseYieldMutex(); + virtual void AcquireYieldMutex( ULONG nCount ); + virtual bool CheckYieldMutex(); + + virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ); + virtual bool AnyInput( USHORT nType ); + virtual SalMenu* CreateMenu( BOOL bMenuBar, Menu* ); + 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); + + static int WorkaroundExceptionHandlingInUSER32Lib(int nExcept, LPEXCEPTION_POINTERS pExceptionInfo); +}; + +// -------------- +// - Prototypen - +// -------------- + +SalFrame* ImplSalCreateFrame( WinSalInstance* pInst, HWND hWndParent, ULONG nSalFrameStyle ); +SalObject* ImplSalCreateObject( WinSalInstance* pInst, WinSalFrame* pParent ); +HWND ImplSalReCreateHWND( HWND hWndParent, HWND oldhWnd, BOOL bAsChild ); +void ImplSalStartTimer( ULONG nMS, BOOL bMutex = FALSE ); +void ImplSalPrinterAbortJobAsync( HDC hPrnDC ); + +#endif // _SV_SALINST_H diff --git a/vcl/inc/win/salmenu.h b/vcl/inc/win/salmenu.h new file mode 100755 index 000000000000..1d8428b2b418 --- /dev/null +++ b/vcl/inc/win/salmenu.h @@ -0,0 +1,76 @@ +/************************************************************************* + * + * 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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALMENU_H +#define _SV_SALMENU_H + +#include <vcl/bitmap.hxx> +#include <salmenu.hxx> + +class WinSalMenu : public SalMenu +{ +public: + WinSalMenu(); + virtual ~WinSalMenu(); + virtual 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, BOOL bCheck ); + virtual void EnableItem( unsigned nPos, BOOL bEnable ); + virtual void SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const XubString& rText ); + virtual void SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage ); + virtual void SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const KeyCode& rKeyCode, const XubString& rKeyName ); + virtual void GetSystemMenuData( SystemMenuData* pData ); + + HMENU mhMenu; // the menu handle + BOOL mbMenuBar; // true for menu bars + HWND mhWnd; // the window handle where the menubar is attached, may be NULL + WinSalMenu *mpParentMenu; // the parent menu +}; + +class WinSalMenuItem : public SalMenuItem +{ +public: + WinSalMenuItem(); + virtual ~WinSalMenuItem(); + + + MENUITEMINFOW mInfo; + void* mpMenu; // pointer to corresponding VCL menu + XubString mText; // the item text + XubString mAccelText; // the accelerator string + Bitmap maBitmap; // item image + int mnId; // item id + WinSalMenu* mpSalMenu; // the menu where this item is inserted +}; + +#endif // _SV_SALMENU_H + diff --git a/vcl/inc/win/salnativewidgets.h b/vcl/inc/win/salnativewidgets.h new file mode 100755 index 000000000000..772e0cc5b036 --- /dev/null +++ b/vcl/inc/win/salnativewidgets.h @@ -0,0 +1,52 @@ +/************************************************************************* + * + * 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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_NATIVEWIDGETS_H +#define _SV_NATIVEWIDGETS_H + + +#ifdef __cplusplus + +/* SalControlHandleData: + * + * Holds platform specific theming data. + */ + +class SalControlHandleData +{ + public: + SalControlHandleData( void ); + ~SalControlHandleData( void ); + + public: + // nothing needed on Win32 +}; + + +#endif /* __cplusplus */ + +#endif diff --git a/vcl/inc/win/salobj.h b/vcl/inc/win/salobj.h new file mode 100755 index 000000000000..52137437975a --- /dev/null +++ b/vcl/inc/win/salobj.h @@ -0,0 +1,70 @@ +/************************************************************************* + * + * 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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALOBJ_H +#define _SV_SALOBJ_H + +#include <salobj.hxx> + +// ----------------- +// - SalObjectData - +// ----------------- + +class WinSalObject : public SalObject +{ +public: + HWND mhWnd; // Window handle + HWND mhWndChild; // Child Window handle + HWND mhLastFocusWnd; // Child-Window, welches als letztes den Focus hatte + SystemChildData maSysData; // SystemEnvData + RGNDATA* mpClipRgnData; // ClipRegion-Data + RGNDATA* mpStdClipRgnData; // Cache Standard-ClipRegion-Data + RECT* mpNextClipRect; // Naechstes ClipRegion-Rect + BOOL mbFirstClipRect; // Flag for first cliprect to insert + sal_Bool mbInterceptChildWindowKeyDown; // Intercept the KeyDown event sent to system child window + WinSalObject* mpNextObject; // pointer to next object + + + WinSalObject(); + virtual ~WinSalObject(); + + virtual void ResetClipRegion(); + virtual USHORT GetClipRegionType(); + virtual void BeginSetClipRegion( 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( BOOL bVisible ); + virtual void Enable( 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 diff --git a/vcl/inc/win/salprn.h b/vcl/inc/win/salprn.h new file mode 100755 index 000000000000..c438fc3ead71 --- /dev/null +++ b/vcl/inc/win/salprn.h @@ -0,0 +1,129 @@ +/************************************************************************* + * + * 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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALPRN_H +#define _SV_SALPRN_H + +#include <salprn.hxx> + +// ----------------- +// - SalDriverData - +// ----------------- + +// WNT3 +#define SAL_DRIVERDATA_SYSSIGN ((ULONG)0x574E5433) +#define SAL_DRIVERDATA_VERSION_A 1 +#define SAL_DRIVERDATA_VERSION_W 2 + +#pragma pack( 1 ) + +struct SalDriverData +{ + ULONG mnSysSignature; + USHORT mnVersion; + USHORT mnDriverOffset; + BYTE maDriverData[1]; +}; + +#pragma pack() + +// --------------------- +// - WinSalInfoPrinter - +// --------------------- + +class WinSalGraphics; + +class WinSalInfoPrinter : public SalInfoPrinter +{ +public: + WinSalGraphics* mpGraphics; // current Printer graphics + XubString maDriverName; // printer driver name + XubString maDeviceName; // printer device name + XubString maPortName; // printer port name + HDC mhDC; // printer hdc + BOOL mbGraphics; // is Graphics used +public: + WinSalInfoPrinter(); + virtual ~WinSalInfoPrinter(); + + virtual SalGraphics* GetGraphics(); + virtual void ReleaseGraphics( SalGraphics* pGraphics ); + virtual BOOL Setup( SalFrame* pFrame, ImplJobSetup* pSetupData ); + virtual BOOL SetPrinterData( ImplJobSetup* pSetupData ); + virtual BOOL SetData( ULONG nFlags, ImplJobSetup* pSetupData ); + virtual void GetPageInfo( const ImplJobSetup* pSetupData, + long& rOutWidth, long& rOutHeight, + long& rPageOffX, long& rPageOffY, + long& rPageWidth, long& rPageHeight ); + virtual ULONG GetCapabilities( const ImplJobSetup* pSetupData, USHORT nType ); + virtual ULONG GetPaperBinCount( const ImplJobSetup* pSetupData ); + virtual String GetPaperBinName( const ImplJobSetup* pSetupData, ULONG nPaperBin ); + virtual void InitPaperFormats( const ImplJobSetup* pSetupData ); + virtual int GetLandscapeAngle( const ImplJobSetup* pSetupData ); +}; + +// ----------------- +// - WinSalPrinter - +// ----------------- + +class WinSalPrinter : public SalPrinter +{ +public: + WinSalGraphics* mpGraphics; // current Printer graphics + WinSalInfoPrinter* mpInfoPrinter; // pointer to the compatible InfoPrinter + WinSalPrinter* mpNextPrinter; // next printing printer + HDC mhDC; // printer hdc + ULONG mnError; // Error Code + ULONG mnCopies; // Kopien + BOOL mbCollate; // Sortierte Kopien + BOOL mbAbort; // Job Aborted + + bool mbValid; + +public: + WinSalPrinter(); + virtual ~WinSalPrinter(); + + using SalPrinter::StartJob; + virtual BOOL StartJob( const XubString* pFileName, + const XubString& rJobName, + const XubString& rAppName, + ULONG nCopies, + bool bCollate, + bool bDirect, + ImplJobSetup* pSetupData ); + virtual BOOL EndJob(); + virtual BOOL AbortJob(); + virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, BOOL bNewJobData ); + virtual BOOL EndPage(); + virtual ULONG GetErrorCode(); + + void markInvalid(); + bool isValid() const { return mbValid; } +}; + +#endif // _SV_SALPRN_H diff --git a/vcl/inc/win/salsys.h b/vcl/inc/win/salsys.h new file mode 100755 index 000000000000..f1848b72cee2 --- /dev/null +++ b/vcl/inc/win/salsys.h @@ -0,0 +1,92 @@ +/************************************************************************* + * + * 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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALSYS_H +#define _SV_SALSYS_H + +#include <salsys.hxx> + +#include <vector> +#include <map> + +class WinSalSystem : public SalSystem +{ + public: + struct DisplayMonitor + { + rtl::OUString m_aName; + rtl::OUString m_aDeviceName; + Rectangle m_aArea; + Rectangle m_aWorkArea; + sal_Int32 m_nStateFlags; + + DisplayMonitor() : m_nStateFlags( 0 ) {} + DisplayMonitor( const rtl::OUString& rName, + const rtl::OUString& rDevName, + const Rectangle& rArea, + const Rectangle& rWorkArea, + DWORD nStateFlags ) + : m_aName( rName ), + m_aDeviceName( rDevName ), + m_aArea( rArea ), + m_aWorkArea( rWorkArea ), + m_nStateFlags( nStateFlags ) + { + } + ~DisplayMonitor() {} + }; + private: + std::vector<DisplayMonitor> m_aMonitors; + std::map<rtl::OUString, unsigned int> m_aDeviceNameToMonitor; + unsigned int m_nPrimary; +public: + WinSalSystem() : m_nPrimary( 0 ) {} + virtual ~WinSalSystem(); + + 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); + bool initMonitors(); + // discards monitorinfo; used by WM_DISPLAYCHANGED handler + void clearMonitors(); + const std::vector<DisplayMonitor>& getMonitors() + { initMonitors(); return m_aMonitors;} + + BOOL handleMonitorCallback( sal_IntPtr /*HMONITOR*/, + sal_IntPtr /*HDC*/, + sal_IntPtr /*LPRECT*/ ); +}; + +#endif // _SV_SALSYS_H + diff --git a/vcl/inc/win/saltimer.h b/vcl/inc/win/saltimer.h new file mode 100755 index 000000000000..88707ef41ad1 --- /dev/null +++ b/vcl/inc/win/saltimer.h @@ -0,0 +1,44 @@ +/************************************************************************* + * + * 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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALTIMER_H +#define _SV_SALTIMER_H + +#include <saltimer.hxx> + +class WinSalTimer : public SalTimer +{ +public: + WinSalTimer() {} + virtual ~WinSalTimer(); + + // overload all pure virtual methods + void Start( ULONG nMS ); + void Stop(); +}; + +#endif diff --git a/vcl/inc/win/salvd.h b/vcl/inc/win/salvd.h new file mode 100755 index 000000000000..665d6b1c3a9c --- /dev/null +++ b/vcl/inc/win/salvd.h @@ -0,0 +1,60 @@ +/************************************************************************* + * + * 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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALVD_H +#define _SV_SALVD_H + +#include <salvd.hxx> + +class WinSalGraphics; + +// ----------------- +// - SalVirDevData - +// ----------------- + +class WinSalVirtualDevice : public SalVirtualDevice +{ +public: + HDC mhDC; // HDC or 0 for Cache Device + HBITMAP mhBmp; // Memory Bitmap + HBITMAP mhDefBmp; // Default Bitmap + WinSalGraphics* mpGraphics; // current VirDev graphics + WinSalVirtualDevice* mpNext; // next VirDev + USHORT mnBitCount; // BitCount (0 or 1) + BOOL mbGraphics; // is Graphics used + BOOL mbForeignDC; // uses a foreign DC instead of a bitmap + + WinSalVirtualDevice(); + virtual ~WinSalVirtualDevice(); + + virtual SalGraphics* GetGraphics(); + virtual void ReleaseGraphics( SalGraphics* pGraphics ); + virtual BOOL SetSize( long nNewDX, long nNewDY ); + virtual void GetSize( long& rWidth, long& rHeight ); +}; + +#endif // _SV_SALVD_H diff --git a/vcl/inc/win/svsys.h b/vcl/inc/win/svsys.h new file mode 100644 index 000000000000..7b0e87304d59 --- /dev/null +++ b/vcl/inc/win/svsys.h @@ -0,0 +1,33 @@ +/************************************************************************* + * + * 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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SVSYS_H +#define _SV_SVSYS_H + +#include <tools/svwin.h> + +#endif // _SV_SVSYS_H diff --git a/vcl/inc/win/wincomp.hxx b/vcl/inc/win/wincomp.hxx new file mode 100755 index 000000000000..d9c218d193ac --- /dev/null +++ b/vcl/inc/win/wincomp.hxx @@ -0,0 +1,263 @@ +/************************************************************************* + * + * 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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_WINCOMP_HXX +#define _SV_WINCOMP_HXX + +#ifndef _STRING_H +#include <string.h> +#endif + +// ---------- +// - Strict - +// ---------- + +// Anpassungen fuer TypeChecking + +inline HPEN SelectPen( HDC hDC, HPEN hPen ) +{ + return (HPEN)SelectObject( hDC, (HGDIOBJ)hPen ); +} + +inline void DeletePen( HPEN hPen ) +{ + DeleteObject( (HGDIOBJ)hPen ); +} + +inline HPEN GetStockPen( int nObject ) +{ + return (HPEN)GetStockObject( nObject ); +} + +inline HBRUSH SelectBrush( HDC hDC, HBRUSH hBrush ) +{ + return (HBRUSH)SelectObject( hDC, (HGDIOBJ)hBrush ); +} + +inline void DeleteBrush( HBRUSH hBrush ) +{ + DeleteObject( (HGDIOBJ)hBrush ); +} + +inline HBRUSH GetStockBrush( int nObject ) +{ + return (HBRUSH)GetStockObject( nObject ); +} + +inline HFONT SelectFont( HDC hDC, HFONT hFont ) +{ + return (HFONT)SelectObject( hDC, (HGDIOBJ)hFont ); +} + +inline void DeleteFont( HFONT hFont ) +{ + DeleteObject( (HGDIOBJ)hFont ); +} + +inline HFONT GetStockFont( int nObject ) +{ + return (HFONT)GetStockObject( nObject ); +} + +inline HBITMAP SelectBitmap( HDC hDC, HBITMAP hBitmap ) +{ + return (HBITMAP)SelectObject( hDC, (HGDIOBJ)hBitmap ); +} + +inline void DeleteBitmap( HBITMAP hBitmap ) +{ + DeleteObject( (HGDIOBJ)hBitmap ); +} + +inline void DeleteRegion( HRGN hRegion ) +{ + DeleteObject( (HGDIOBJ)hRegion ); +} + +inline HPALETTE GetStockPalette( int nObject ) +{ + return (HPALETTE)GetStockObject( nObject ); +} + +inline void DeletePalette( HPALETTE hPalette ) +{ + DeleteObject( (HGDIOBJ)hPalette ); +} + +inline void SetWindowStyle( HWND hWnd, DWORD nStyle ) +{ + SetWindowLong( hWnd, GWL_STYLE, nStyle ); +} + +inline DWORD GetWindowStyle( HWND hWnd ) +{ + return GetWindowLong( hWnd, GWL_STYLE ); +} + +inline void SetWindowExStyle( HWND hWnd, DWORD nStyle ) +{ + SetWindowLong( hWnd, GWL_EXSTYLE, nStyle ); +} + +inline DWORD GetWindowExStyle( HWND hWnd ) +{ + return GetWindowLong( hWnd, GWL_EXSTYLE ); +} + +inline WIN_BOOL IsMinimized( HWND hWnd ) +{ + return IsIconic( hWnd ); +} + +inline WIN_BOOL IsMaximized( HWND hWnd ) +{ + return IsZoomed( hWnd ); +} + +inline void SetWindowFont( HWND hWnd, HFONT hFont, WIN_BOOL bRedraw ) +{ + SendMessage( hWnd, WM_SETFONT, (WPARAM)hFont, MAKELPARAM((UINT)bRedraw,0) ); +} + +inline HFONT GetWindowFont( HWND hWnd ) +{ + return (HFONT)(UINT)SendMessage( hWnd, WM_GETFONT, 0, 0 ); +} + +inline void SetClassCursor( HWND hWnd, HCURSOR hCursor ) +{ + SetClassLong( hWnd, GCL_HCURSOR, (DWORD)hCursor ); +} + +inline HCURSOR GetClassCursor( HWND hWnd ) +{ + return (HCURSOR)GetClassLong( hWnd, GCL_HCURSOR ); +} + +inline void SetClassIcon( HWND hWnd, HICON hIcon ) +{ + SetClassLong( hWnd, GCL_HICON, (DWORD)hIcon ); +} + +inline HICON GetClassIcon( HWND hWnd ) +{ + return (HICON)GetClassLong( hWnd, GCL_HICON ); +} + +inline HBRUSH SetClassBrush( HWND hWnd, HBRUSH hBrush ) +{ + return (HBRUSH)SetClassLong( hWnd, GCL_HBRBACKGROUND, (DWORD)hBrush ); +} + +inline HBRUSH GetClassBrush( HWND hWnd ) +{ + return (HBRUSH)GetClassLong( hWnd, GCL_HBRBACKGROUND ); +} + +inline HINSTANCE GetWindowInstance( HWND hWnd ) +{ + return (HINSTANCE)GetWindowLong( hWnd, GWL_HINSTANCE ); +} + +// ------------------------ +// - ZMouse Erweiterungen - +// ------------------------ + +#define MSH_MOUSEWHEEL "MSWHEEL_ROLLMSG" + +#define MOUSEZ_CLASSNAME "MouseZ" // wheel window class +#define MOUSEZ_TITLE "Magellan MSWHEEL" // wheel window title + +#define MSH_WHEELMODULE_CLASS (MOUSEZ_CLASSNAME) +#define MSH_WHEELMODULE_TITLE (MOUSEZ_TITLE) + +#define MSH_SCROLL_LINES "MSH_SCROLL_LINES_MSG" + +#ifndef WHEEL_DELTA +#define WHEEL_DELTA 120 +#endif +#ifndef WM_MOUSEWHEEL +#define WM_MOUSEWHEEL 0x020A +#endif +#ifndef SPI_GETWHEELSCROLLLINES +#define SPI_GETWHEELSCROLLLINES 104 +#endif +#ifndef SPI_SETWHEELSCROLLLINES +#define SPI_SETWHEELSCROLLLINES 105 +#endif +#ifndef WHEEL_PAGESCROLL +#define WHEEL_PAGESCROLL (UINT_MAX) +#endif + + +// ----------------------------- +// - SystemAgent Erweiterungen - +// ----------------------------- + +#define ENABLE_AGENT 1 +#define DISABLE_AGENT 2 +#define GET_AGENT_STATUS 3 +typedef int (APIENTRY* SysAgt_Enable_PROC)( int ); + +// --------------------- +// - 5.0-Erweiterungen - +// --------------------- + +#ifndef COLOR_GRADIENTACTIVECAPTION +#define COLOR_GRADIENTACTIVECAPTION 27 +#endif +#ifndef COLOR_GRADIENTINACTIVECAPTION +#define COLOR_GRADIENTINACTIVECAPTION 28 +#endif + +#ifndef SPI_GETFLATMENU +#define SPI_GETFLATMENU 0x1022 +#endif +#ifndef COLOR_MENUBAR +#define COLOR_MENUBAR 30 +#endif +#ifndef COLOR_MENUHILIGHT +#define COLOR_MENUHILIGHT 29 +#endif + +#ifndef CS_DROPSHADOW +#define CS_DROPSHADOW 0x00020000 +#endif + +// ------------------------------------------------------- +// MT 12/03: From winuser.h, only needed in salframe.cxx +// Better change salframe.cxx to include winuser.h +// ------------------------------------------------------- + +#define WS_EX_LAYERED 0x00080000 + +#ifndef WM_UNICHAR +#define WM_UNICHAR 0x0109 +#define UNICODE_NOCHAR 0xFFFF +#endif + +#endif // _SV_WINCOMP_HXX |