From 1f8b67f3d7249658af3fc196808b7402541c9d24 Mon Sep 17 00:00:00 2001 From: Pedro Giffuni Date: Fri, 11 Nov 2011 01:37:05 +0000 Subject: i118582: OS/2 port - vcl build fixes - by ydario --- vcl/inc/os2/salbmp.h | 109 +++++++++ vcl/inc/os2/saldata.hxx | 302 +++++++++++++++++++++++ vcl/inc/os2/salframe.h | 166 +++++++++++++ vcl/inc/os2/salgdi.h | 367 ++++++++++++++++++++++++++++ vcl/inc/os2/salids.hrc | 109 +++++++++ vcl/inc/os2/salinst.h | 104 ++++++++ vcl/inc/os2/sallang.hxx | 66 +++++ vcl/inc/os2/sallayout.h | 69 ++++++ vcl/inc/os2/salmenu.h | 65 +++++ vcl/inc/os2/salobj.h | 69 ++++++ vcl/inc/os2/salprn.h | 145 +++++++++++ vcl/inc/os2/salsound.h | 94 +++++++ vcl/inc/os2/salsound.hxx | 80 ++++++ vcl/inc/os2/salsys.h | 43 ++++ vcl/inc/os2/saltimer.h | 44 ++++ vcl/inc/os2/salvd.h | 65 +++++ vcl/inc/os2/svsys.h | 35 +++ vcl/inc/os2/wingdi.h | 70 ++++++ vcl/inc/os2/xwphook.h | 620 +++++++++++++++++++++++++++++++++++++++++++++++ vcl/inc/sft.hxx | 4 +- vcl/inc/vcl/sysdata.hxx | 2 + 21 files changed, 2626 insertions(+), 2 deletions(-) create mode 100644 vcl/inc/os2/salbmp.h create mode 100644 vcl/inc/os2/saldata.hxx create mode 100644 vcl/inc/os2/salframe.h create mode 100644 vcl/inc/os2/salgdi.h create mode 100644 vcl/inc/os2/salids.hrc create mode 100644 vcl/inc/os2/salinst.h create mode 100644 vcl/inc/os2/sallang.hxx create mode 100644 vcl/inc/os2/sallayout.h create mode 100644 vcl/inc/os2/salmenu.h create mode 100644 vcl/inc/os2/salobj.h create mode 100644 vcl/inc/os2/salprn.h create mode 100644 vcl/inc/os2/salsound.h create mode 100644 vcl/inc/os2/salsound.hxx create mode 100644 vcl/inc/os2/salsys.h create mode 100644 vcl/inc/os2/saltimer.h create mode 100644 vcl/inc/os2/salvd.h create mode 100644 vcl/inc/os2/svsys.h create mode 100644 vcl/inc/os2/wingdi.h create mode 100644 vcl/inc/os2/xwphook.h (limited to 'vcl/inc') diff --git a/vcl/inc/os2/salbmp.h b/vcl/inc/os2/salbmp.h new file mode 100644 index 000000000000..14e51ffae8da --- /dev/null +++ b/vcl/inc/os2/salbmp.h @@ -0,0 +1,109 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALBMP_H +#define _SV_SALBMP_H + +#include +#include +#include + +// -------------- +// - SalBitmap - +// -------------- + +struct BitmapBuffer; +class BitmapColor; +class BitmapPalette; +class SalGraphics; + +#define HANDLE ULONG +#define HBITMAP ULONG + +class Os2SalBitmap : public SalBitmap +{ +private: + + Size maSize; + HANDLE mhDIB; + HANDLE mhDIB1Subst; + HBITMAP mhDDB; + USHORT mnBitCount; + +public: + + HANDLE ImplGethDIB() const { return mhDIB; } + HBITMAP ImplGethDDB() const { return mhDDB; } + HANDLE ImplGethDIB1Subst() const { return mhDIB1Subst; } + + void ImplReplacehDIB1Subst( HANDLE hDIB1Subst ); + + static HANDLE ImplCreateDIB( const Size& rSize, USHORT nBitCount, const BitmapPalette& rPal ); + static HANDLE ImplCreateDIB4FromDIB1( HANDLE hDIB1 ); + static HANDLE ImplCopyDIBOrDDB( HANDLE hHdl, BOOL bDIB ); + static USHORT ImplGetDIBColorCount( HANDLE hDIB ); + static void ImplDecodeRLEBuffer( const BYTE* pSrcBuf, BYTE* pDstBuf, + const Size& rSizePixel, BOOL bRLE4 ); + + //BOOL Create( HANDLE hBitmap, BOOL bDIB, BOOL bCopyHandle ); + +public: + + Os2SalBitmap(); + ~Os2SalBitmap(); + +public: + + //BOOL Create( const Size& rSize, USHORT nBitCount, const BitmapPalette& rPal ); + //BOOL Create( const SalBitmap& rSalBmpImpl ); + //BOOL Create( const SalBitmap& rSalBmpImpl, SalGraphics* pGraphics ); + //BOOL Create( const SalBitmap& rSalBmpImpl, USHORT nNewBitCount ); + + //void Destroy(); + + //Size GetSize() const { return maSize; } + //USHORT GetBitCount() const { return mnBitCount; } + + //BitmapBuffer* AcquireBuffer( bool bReadOnly ); + //void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly ); + 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_H diff --git a/vcl/inc/os2/saldata.hxx b/vcl/inc/os2/saldata.hxx new file mode 100644 index 000000000000..daf546f5616b --- /dev/null +++ b/vcl/inc/os2/saldata.hxx @@ -0,0 +1,302 @@ +/************************************************************** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + + + +#ifndef _SV_SALDATA_HXX +#define _SV_SALDATA_HXX + +#include +#include + +class Os2SalInstance; +class Os2SalFrame; +class Os2SalObject; + +extern "C" int debug_printf(const char *f, ...); + +// -------------- +// - SalIMEData - +// -------------- + +// YD FIXME #define ENABLE_IME + +#ifdef ENABLE_IME + +struct SalIMEData; + +#ifdef OS2IM_INCLUDED + +typedef APIRET (APIENTRY ImAssociateInstanceFunc)( HWND hwnd, HIMI himi, PHIMI phimiPrev ); +typedef APIRET (APIENTRY ImGetInstanceFunc)( HWND hwnd, PHIMI phimi ); +typedef APIRET (APIENTRY ImReleaseInstanceFunc)( HWND hwnd, HIMI himi ); +typedef APIRET (APIENTRY ImSetConversionFontFunc)( HIMI himi, PFATTRS pFontAttrs ); +typedef APIRET (APIENTRY ImSetConversionFontSizeFunc)( HIMI himi, PSIZEF psizfxBox ); +typedef APIRET (APIENTRY ImGetConversionStringFunc)( HIMI himi, ULONG ulIndex, PVOID pBuf, PULONG pulBufLen ); +typedef APIRET (APIENTRY ImGetResultStringFunc)( HIMI himi, ULONG ulIndex, PVOID pBuf, PULONG pulBufLen ); +typedef APIRET (APIENTRY ImSetCandidateWindowPosFunc)( HIMI himi, PCANDIDATEPOS pCandidatePos ); +typedef APIRET (APIENTRY ImQueryIMEPropertyFunc)( HIMI himi, ULONG ulIndex, PULONG pulProp ); +typedef APIRET (APIENTRY ImRequestIMEFunc)( HIMI himi, ULONG ulAction, ULONG ulIndex, ULONG ulValue ); +typedef APIRET (APIENTRY ImSetIMModeFunc)( HIMI himi, ULONG ulInputMode, ULONG ulConversionMode ); +typedef APIRET (APIENTRY ImQueryIMModeFunc)( HIMI himi, PULONG pulInputMode, PULONG pulConversionMode ); + +struct SalIMEData +{ + HMODULE mhModIME; + ImAssociateInstanceFunc* mpAssocIME; + ImGetInstanceFunc* mpGetIME; + ImReleaseInstanceFunc* mpReleaseIME; + ImSetConversionFontFunc* mpSetConversionFont; + ImSetConversionFontSizeFunc* mpSetConversionFontSize; + ImGetConversionStringFunc* mpGetConversionString; + ImGetResultStringFunc* mpGetResultString; + ImSetCandidateWindowPosFunc* mpSetCandidateWin; + ImQueryIMEPropertyFunc* mpQueryIMEProperty; + ImRequestIMEFunc* mpRequestIME; + ImSetIMModeFunc* mpSetIMEMode; + ImQueryIMModeFunc* mpQueryIMEMode; +}; + +#endif + +#endif + +// -------------------- +// - Icon cache - +// -------------------- + +struct SalIcon +{ + int nId; + HPOINTER hIcon; + SalIcon *pNext; +}; + +// ----------- +// - SalData - +// ----------- + +struct SalData +{ + HAB mhAB; // anchor block handle + HMQ mhMQ; // handle of os2 message queue + int mnArgc; // commandline param count + char** mpArgv; // commandline + ULONG mnNewTimerMS; // Neue Zeit, mit dem der Timer gestartet werden soll + ULONG mnTimerMS; // Current Time (in MS) of the Timer + ULONG mnTimerOrgMS; // Current Original Time (in MS) + ULONG mnNextTimerTime; + ULONG mnLastEventTime; + ULONG mnTimerId; // os2 timer id + PM_BOOL mbInTimerProc; // timer event is currently being dispatched + //SALTIMERPROC mpTimerProc; // timer callback proc + HWND mhWantLeaveMsg; // window handle, that want a MOUSELEAVE message + AutoTimer* mpMouseLeaveTimer; // Timer for MouseLeave Test + Os2SalInstance* mpFirstInstance; // pointer of first instance + Os2SalFrame* mpFirstFrame; // pointer of first frame + Os2SalFrame* mpCreateFrame; // Create-Frame for WM_CREATE + Os2SalObject* mpFirstObject; // pointer of first object window + ULONG mnAppThreadId; // Id from Applikation-Thread + ULONG mnFontMetricCount; // number of entries in the font list + PFONTMETRICS mpFontMetrics; // cached font list + PM_BOOL mbObjClassInit; // Ist SALOBJECTCLASS initialised +#ifdef ENABLE_IME + SalIMEData* mpIMEData; // SalIME-Data + PM_BOOL mbIMEInit; // SalIME-Data-Init +#endif + + SalIcon* mpFirstIcon; // icon cache, points to first icon, NULL if none + +}; + +inline void SetSalData( SalData* pData ) { ImplGetSVData()->mpSalData = (void*)pData; } +inline SalData* GetSalData() { return (SalData*)ImplGetSVData()->mpSalData; } +inline SalData* GetAppSalData() { return (SalData*)ImplGetAppSVData()->mpSalData; } + +// -------------- +// - SalShlData - +// -------------- + +#define OS2_VER_211 211 +#define OS2_VER_WARP3 230 +#define OS2_VER_WARP4 240 + +struct SalShlData +{ + HMODULE mhMod; // Module handle of SAL-DLL + USHORT mnVersion; // 211 = OS2 2.11; 230 = OS2 3.0; 240 = OS2 4.0 + PFNWP mpFrameProc; // old frame proc +}; + +extern SalShlData aSalShlData; + +PM_BOOL SalImplHandleProcessMenu( HWND hWnd, ULONG nMsg, MPARAM nMP1, MPARAM nMP2 ); + +// -------------------------------------------- +// - SALSHL.CXX - for accessing DLL resources - +// -------------------------------------------- + +HPOINTER ImplLoadSalCursor( int nId ); +HBITMAP ImplLoadSalBitmap( int nId ); +sal_Bool ImplLoadSalIcon( int nId, HPOINTER& rIcon); + +// SALGDI.CXX +void ImplInitSalGDI(); +void ImplFreeSalGDI(); + +// -------------- +// - Prototypes - +// -------------- + +// \\OS2\SOURCE\APP\SALINST.CXX +void ImplSalYieldMutexAcquireWithWait(); +ULONG ImplSalReleaseYieldMutex(); +void ImplSalAcquireYieldMutex( ULONG nCount ); +ULONG GetCurrentThreadId(); +sal_Bool ImplSalYieldMutexTryToAcquire(); +void ImplSalYieldMutexAcquire(); +void ImplSalYieldMutexRelease(); + +// \\OS2\SOURCE\WINDOW\SALFRAME.CXX +MRESULT EXPENTRY SalFrameWndProc( HWND hWnd, ULONG nMsg, MPARAM nMP1, MPARAM nMP2 ); +MRESULT EXPENTRY SalFrameFrameProc( HWND hWnd, ULONG nMsg, MPARAM nMP1, MPARAM nMP2 ); +// \SV\WIN\SOURCE\APP\SALTIMER.CXX +#define SALTIMERPROC_RECURSIVE 0xffffffff +void SalTimerProc( HWND hWnd, UINT nMsg, UINT nId, ULONG nTime ); + +// \WIN\SOURCE\WINDOW\SALFRAME.CXX +void SalTestMouseLeave(); + +// \\OS2\SOURCE\WINDOW\SALFRAME.CXX +// return Frame for Message-Handling +Os2SalFrame* GetSalDefaultFrame(); + +// \\OS2\SOURCE\WINDOW\SALFRAME.CXX +// IME-Daten wieder freigeben +#ifdef ENABLE_IME +void ImplReleaseSALIMEData(); +#endif + +// ----------- +// - Defines - +// ----------- + +#define SAL_PROFILE_APPNAME ((PSZ)"StarOffice") +#define SAL_PROFILE_USEDJP ((PSZ)"UseDJP") +#define SAL_PROFILE_PRINTDJP ((PSZ)"PrintDJP") +#define SAL_PROFILE_PRINTRAW ((PSZ)"PrintRAW") + +#define SAL_FRAME_WNDEXTRA sizeof(ULONG) +#define SAL_FRAME_THIS 0 +#define SAL_FRAME_CLASSNAME "SALFRAME" +#define SAL_SUBFRAME_CLASSNAME "SALSUBFRAME" +#define SAL_OBJECT_WNDEXTRA sizeof(ULONG) +#define SAL_OBJECT_THIS 0 +#define SAL_OBJECT_CLASSNAME "SALOBJECT" +#define SAL_OBJECT_CHILDCLASSNAME "SALOBJECTCHILD" +#define SAL_OBJECT_CLIPCLASSNAME "SALOBJECTCLIP" +#define SAL_COM_CLASSNAME "SALCOMWND" + +#define SAL_MOUSELEAVE_TIMEOUT 300 + +// MP1 == 0; MP2 == pData +#define SAL_MSG_USEREVENT (WM_USER+111) +// MP1 == 0; MP2 == MousePosition relativ to upper left of screen +#define SAL_MSG_MOUSELEAVE (WM_USER+112) +// MP1 == hDC; MP2 == 0 +#define SAL_MSG_PRINTABORTJOB (WM_USER+113) +// MP1 == 0; MP2 == 0 +#define SAL_MSG_STARTTIMER (WM_USER+114) +// MP1 == nFrameStyle; MP2 == pParent; lResult pFrame +#define SAL_MSG_CREATEFRAME (WM_USER+115) +// MP1 == 0; MP2 == pParent; lResult pObject +#define SAL_MSG_CREATEOBJECT (WM_USER+116) +// MP1 == bWait; MP2 == pMutex +#define SAL_MSG_THREADYIELD (WM_USER+117) +// MP1 == 0; MP2 == 0 +#define SAL_MSG_RELEASEWAITYIELD (WM_USER+118) +// MP1 == 0; MP2 == pData +#define SAL_MSG_SYSPROCESSMENU (WM_USER+119) +// POSTFOCUS-Message; MP1 == nMP1; MP2 == nMP2 (SHORT1( bFocus ), 0) +#define SAL_MSG_POSTFOCUS (WM_USER+120) +// POSTSIZE-Message; MP1 == nMP1; MP2 == nMP2 +#define SAL_MSG_POSTSIZE (WM_USER+121) + +// wParam == wParam; lParam == lParam +#define SAL_MSG_POSTMOVE (WM_USER+136) +// wParam == pRECT; lParam == 0 +#define SAL_MSG_POSTPAINT (WM_USER+137) +// wParam == nFlags; lParam == 0 +#define SAL_MSG_TOTOP (WM_USER+142) +// wParam == bVisible; lParam == 0 +#define SAL_MSG_SHOW (WM_USER+143) + +// SysChild-ToTop; nMP1 = 0; nMP2 = 0 +#define SALOBJ_MSG_TOTOP (WM_USER+150) +// POSTFOCUS-Message; MP1 == nMP1; MP2 == nMP2 (SHORT1( bFocus ), 0) +#define SALOBJ_MSG_POSTFOCUS (WM_USER+151) + +// wParam == 0; lParam == 0 +#define SAL_MSG_DESTROYFRAME (WM_USER+160) +// wParam == 0; lParam == pObject; +#define SAL_MSG_DESTROYOBJECT (WM_USER+161) +// wParam == 0; lParam == this; lResult == bRet +#define SAL_MSG_CREATESOUND (WM_USER+162) +// wParam == 0; lParam == this +#define SAL_MSG_DESTROYSOUND (WM_USER+163) +// wParam == hWnd; lParam == 0; lResult == hDC +#define SAL_MSG_GETDC (WM_USER+164) +// wParam == hWnd; lParam == 0 +#define SAL_MSG_RELEASEDC (WM_USER+165) +// wParam == newParentHwnd; lParam == oldHwnd; lResult == newhWnd +#define SAL_MSG_RECREATEHWND (WM_USER+166) +// wParam == newParentHwnd; lParam == oldHwnd; lResult == newhWnd +#define SAL_MSG_RECREATECHILDHWND (WM_USER+167) +// wParam == 0; lParam == HWND; +#define SAL_MSG_DESTROYHWND (WM_USER+168) +// POSTTIMER-Message; wparam = 0, lParam == time +#define SAL_MSG_POSTTIMER (WM_USER+169) + +// ----------------- +// - Helpfunctions - +// ----------------- + +inline void SetWindowPtr( HWND hWnd, SalFrame* pThis ) +{ + WinSetWindowULong( hWnd, SAL_FRAME_THIS, (ULONG)pThis ); +} + +inline Os2SalFrame* GetWindowPtr( HWND hWnd ) +{ + return (Os2SalFrame*)WinQueryWindowULong( hWnd, SAL_FRAME_THIS ); +} + +inline void SetSalObjWindowPtr( HWND hWnd, SalObject* pThis ) +{ + WinSetWindowULong( hWnd, SAL_OBJECT_THIS, (ULONG)pThis ); +} + +inline Os2SalObject* GetSalObjWindowPtr( HWND hWnd ) +{ + return (Os2SalObject*)WinQueryWindowULong( hWnd, SAL_OBJECT_THIS ); +} + +#endif // _SV_SALDATA_HXX diff --git a/vcl/inc/os2/salframe.h b/vcl/inc/os2/salframe.h new file mode 100644 index 000000000000..f02a39f80955 --- /dev/null +++ b/vcl/inc/os2/salframe.h @@ -0,0 +1,166 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALFRAME_H +#define _SV_SALFRAME_H + +#include +#include +#include + + +#ifndef PM_BIDI_INCLUDED +#include +#endif + +#ifndef __UCONV_H__ +#include +#endif + +#ifndef __UNIDEF_H__ +#include +#endif + +#ifndef __UNIKBD_H__ +#include +#endif + +//class SalFrame; +class Os2SalGraphics; + +// ---------------- +// - SalFrameData - +// ---------------- + +//class SalFrameData +class Os2SalFrame : public SalFrame +{ +public: + HWND mhWndFrame; // HWND-Frame + HWND mhWndClient; // HWND-Client + HAB mhAB; // HAB + HPOINTER mhPointer; // Current MousePointer + void* mpInst; // VCL-Instance + //SALFRAMEPROC mpProc; // VCL-Proc + Os2SalGraphics* mpGraphics; // current frame graphics + Os2SalFrame* mpNextFrame; // pointer to next frame + SystemEnvData maSysData; // system data + SalFrameState maState; // frame state + int mnShowState; // show state + ULONG mnStyle; // SalFrameStyle + long mnWidth; // Window-Witdth + long mnHeight; // Window-Height + SWP maFullScreenRect; // WindowRect befor FullScreenMode + BOOL mbGraphics; // is Graphics used + BOOL mbAllwayOnTop; // Allways on top modus + BOOL mbVisible; // Visible Show/Hide-Status + BOOL mbMinHide; // hide called from OS2 + BOOL mbHandleIME; // TRUE: Wir handeln die IME-Messages + BOOL mbConversionMode; // TRUE: Wir befinden uns im Conversion-Modus + BOOL mbCandidateMode; // TRUE: Wir befinden uns im Candidate-Modus + 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 + + 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 + static ULONG mnInputLang; // current Input Language + KHAND mnKeyboardHandle; // current unicode keyboard + static BOOL mbInReparent; // TRUE: ignore focus lost and gain due to reparenting + +private: + Os2SalFrame* mpParentFrame; // parent frame pointer + +public: + Os2SalFrame(); + virtual ~Os2SalFrame(); + + 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( RECTL& rRect ); + 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 ); + 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(); + +}; + +#endif // _SV_SALFRAME_H diff --git a/vcl/inc/os2/salgdi.h b/vcl/inc/os2/salgdi.h new file mode 100644 index 000000000000..1c9b66d89a0b --- /dev/null +++ b/vcl/inc/os2/salgdi.h @@ -0,0 +1,367 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALGDI_H +#define _SV_SALGDI_H + +#include +#include +#include +#include +#include + +#include + +class ImplOs2FontEntry; + +// ----------- +// - Defines - +// ----------- + +// win32 platform specific options. Move them to the PMK file? +#define GCP_USEKERNING 0x0008 +#define USE_UNISCRIBE +#define GCP_KERN_HACK +#define GNG_VERT_HACK + +// os2 specific physically available font face +class ImplOs2FontData : public ImplFontData +{ +public: + ImplOs2FontData( PFONTMETRICS, + int nFontHeight, + BYTE nPitchAndFamily ); + ~ImplOs2FontData(); + + virtual ImplFontData* Clone() const; + virtual ImplFontEntry* CreateFontInstance( ImplFontSelectData& ) const; + virtual sal_IntPtr GetFontId() const; + void SetFontId( sal_IntPtr nId ) { mnId = nId; } + void UpdateFromHPS( HPS ) const; + + bool HasChar( sal_uInt32 cChar ) const; + + PFONTMETRICS GetFontMetrics() const { return pFontMetric; } + USHORT GetCharSet() const { return meOs2CharSet; } + BYTE GetPitchAndFamily() const { return mnPitchAndFamily; } + bool IsGlyphApiDisabled() const { return mbDisableGlyphApi; } + bool SupportsKorean() const { return mbHasKoreanRange; } + bool SupportsCJK() const { return mbHasCJKSupport; } + bool AliasSymbolsHigh() const { return mbAliasSymbolsHigh; } + bool AliasSymbolsLow() const { return mbAliasSymbolsLow; } + + const ImplFontCharMap* GetImplFontCharMap() const; + +private: + sal_IntPtr mnId; + mutable bool mbDisableGlyphApi; + mutable bool mbHasKoreanRange; + mutable bool mbHasCJKSupport; + + mutable const 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) + BYTE mnFontCharSetCount; // Number of Charsets of the current font; 0 - if not queried + USHORT meOs2CharSet; + BYTE mnPitchAndFamily; + bool mbAliasSymbolsHigh; + bool mbAliasSymbolsLow; + PFONTMETRICS pFontMetric; + +private: + void ReadCmapTable( HDC ) const; + void ReadOs2Table( HDC ) const; + +#ifdef GNG_VERT_HACK + void ReadGsubTable( HDC ) const; + + typedef std::hash_set IntHashSet; + mutable IntHashSet maGsubTable; + mutable bool mbGsubRead; +public: + bool HasGSUBstitutions( HDC ) const; + bool IsGSUBstituted( sal_Unicode ) const; +#endif // GNG_VERT_HACK + +}; + + +// ------------------- +// - SalGraphicsData - +// ------------------- + +class Os2SalGraphics : public SalGraphics +{ +public: + HPS mhPS; // HPS + HDC mhDC; // HDC + HWND mhWnd; // HWND + LONG mnHeight; // Height of frame Window + ULONG mnClipElementCount; // number of clip rects in clip rect array + RECTL* mpClipRectlAry; // clip rect array + ULONG mnFontMetricCount; // number of entries in the font list + PFONTMETRICS mpFontMetrics; // cached font list + LONG mnOrientationX; // X-Font orientation + LONG mnOrientationY; // Y-Font orientation + BOOL mbLine; // draw lines + BOOL mbFill; // fill areas + BOOL mbPrinter; // is Printer + BOOL mbVirDev; // is VirDev + BOOL mbWindow; // is Window + BOOL mbScreen; // is Screen compatible + bool mbXORMode; // _every_ output with RasterOp XOR + ULONG mhFonts[ MAX_FALLBACK ]; // Font + Fallbacks + 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 + BOOL mbFontKernInit; // FALSE: FontKerns must be queried + KERNINGPAIRS* mpFontKernPairs; // Kerning Pairs of the current Font + ULONG mnFontKernPairCount;// Number of Kerning Pairs of the current Font + + USHORT ImplDoSetFont( ImplFontSelectData* i_pFont, float& o_rFontScale, int ); + +public: + Os2SalGraphics(); + virtual ~Os2SalGraphics(); + +protected: + // 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( ULONG nPoly, const ULONG* 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( ULONG nPoly, const ULONG* 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 ); + +#if 0 + // native widget rendering methods that require mirroring + virtual BOOL hitTestNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion, + const Point& aPos, BOOL& rIsInside ); + virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion, + ControlState nState, const ImplControlValue& aValue, + rtl::OUString aCaption ); + virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart, const Region& rControlRegion, + ControlState nState, const ImplControlValue& aValue, + rtl::OUString aCaption ); + virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart, const Region& rControlRegion, ControlState nState, + const ImplControlValue& aValue, rtl::OUString aCaption, + Region &rNativeBoundingRegion, Region &rNativeContentRegion ); +#endif + + 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(); + virtual bool setClipRegion( const Region& ); + + // 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* ); + // 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 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* pFont, + long* pGlyphIDs, + sal_uInt8* pEncoding, + sal_Int32* pWidths, + int nGlyphs, + FontSubsetInfo& rInfo // out parameter + ); + + // GetFontEncodingVector: a method to get the encoding map Unicode + // to font encoded character; this is only used for type1 fonts and + // may return NULL in case of unknown encoding vector + // if ppNonEncoded is set and non encoded characters (that is type1 + // glyphs with only a name) exist it is set to the corresponding + // map for non encoded glyphs; the encoding vector contains -1 + // as encoding for these cases + virtual const Ucs2SIntMap* GetFontEncodingVector( const ImplFontData*, const Ucs2OStrMap** ppNonEncoded ); + + // GetEmbedFontData: gets the font data for a font marked + // embeddable by GetDevFontList or NULL in case of error + // parameters: pFont: describes the font in question + // pWidths: the widths of all glyphs from char code 0 to 255 + // pWidths MUST support at least 256 members; + // rInfo: additional outgoing information + // pDataLen: out parameter, contains the byte length of the returned buffer + virtual const void* GetEmbedFontData( const ImplFontData*, + const sal_Ucs* pUnicodes, + sal_Int32* pWidths, + FontSubsetInfo& rInfo, + long* pDataLen ); + // frees the font data again + virtual void FreeEmbedFontData( const void* pData, long nDataLen ); + + virtual void GetGlyphWidths( const ImplFontData* pFont, + bool bVertical, + Int32Vector& rWidths, + Ucs2UIntMap& rUnicodeEnc ); + + 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( Os2SalGraphics* mpData ); +void ImplSalDeInitGraphics( Os2SalGraphics* mpData ); + +// ----------- +// - Defines - +// ----------- + +#define RGBCOLOR(r,g,b) ((ULONG)(((BYTE)(b)|((USHORT)(g)<<8))|(((ULONG)(BYTE)(r))<<16))) +#define TY( y ) (mnHeight-(y)-1) + +// offset for lcid field, used for fallback font selection +#define LCID_BASE 100 + +// ----------- +// - Inlines - +// ----------- + +// #102411# Win's GCP mishandles kerning => we need to do it ourselves +// SalGraphicsData::mpFontKernPairs is sorted by +inline bool ImplCmpKernData( const KERNINGPAIRS& a, const KERNINGPAIRS& b ) +{ + if( a.sFirstChar < b.sFirstChar ) + return true; + if( a.sFirstChar > b.sFirstChar ) + return false; + return (a.sSecondChar < b.sSecondChar); +} + +// called extremely often from just one spot => inline +inline bool ImplOs2FontData::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; + return mpUnicodeMap->HasChar( cChar ); +} + +#endif // _SV_SALGDI_H diff --git a/vcl/inc/os2/salids.hrc b/vcl/inc/os2/salids.hrc new file mode 100644 index 000000000000..b5f2260d307f --- /dev/null +++ b/vcl/inc/os2/salids.hrc @@ -0,0 +1,109 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALIDS_HRC +#define _SV_SALIDS_HRC + +// Pointer +#define SAL_RESID_POINTER_NULL 10000 +#define SAL_RESID_POINTER_HELP 10001 +#define SAL_RESID_POINTER_CROSS 10002 +#define SAL_RESID_POINTER_MOVE 10003 +#define SAL_RESID_POINTER_HSPLIT 10004 +#define SAL_RESID_POINTER_VSPLIT 10005 +#define SAL_RESID_POINTER_HSIZEBAR 10006 +#define SAL_RESID_POINTER_VSIZEBAR 10007 +#define SAL_RESID_POINTER_HAND 10008 +#define SAL_RESID_POINTER_REFHAND 10009 +#define SAL_RESID_POINTER_PEN 10010 +#define SAL_RESID_POINTER_MAGNIFY 10011 +#define SAL_RESID_POINTER_FILL 10012 +#define SAL_RESID_POINTER_ROTATE 10013 +#define SAL_RESID_POINTER_HSHEAR 10014 +#define SAL_RESID_POINTER_VSHEAR 10015 +#define SAL_RESID_POINTER_MIRROR 10016 +#define SAL_RESID_POINTER_CROOK 10017 +#define SAL_RESID_POINTER_CROP 10018 +#define SAL_RESID_POINTER_MOVEPOINT 10019 +#define SAL_RESID_POINTER_MOVEBEZIERWEIGHT 10020 +#define SAL_RESID_POINTER_MOVEDATA 10021 +#define SAL_RESID_POINTER_COPYDATA 10022 +#define SAL_RESID_POINTER_LINKDATA 10023 +#define SAL_RESID_POINTER_MOVEDATALINK 10024 +#define SAL_RESID_POINTER_COPYDATALINK 10025 +#define SAL_RESID_POINTER_MOVEFILE 10026 +#define SAL_RESID_POINTER_COPYFILE 10027 +#define SAL_RESID_POINTER_LINKFILE 10028 +#define SAL_RESID_POINTER_MOVEFILELINK 10029 +#define SAL_RESID_POINTER_COPYFILELINK 10030 +#define SAL_RESID_POINTER_MOVEFILES 10031 +#define SAL_RESID_POINTER_COPYFILES 10032 +#define SAL_RESID_POINTER_DRAW_LINE 10033 +#define SAL_RESID_POINTER_DRAW_RECT 10034 +#define SAL_RESID_POINTER_DRAW_POLYGON 10035 +#define SAL_RESID_POINTER_DRAW_BEZIER 10036 +#define SAL_RESID_POINTER_DRAW_ARC 10037 +#define SAL_RESID_POINTER_DRAW_PIE 10038 +#define SAL_RESID_POINTER_DRAW_CIRCLECUT 10039 +#define SAL_RESID_POINTER_DRAW_ELLIPSE 10040 +#define SAL_RESID_POINTER_DRAW_FREEHAND 10041 +#define SAL_RESID_POINTER_DRAW_CONNECT 10042 +#define SAL_RESID_POINTER_DRAW_TEXT 10043 +#define SAL_RESID_POINTER_DRAW_CAPTION 10044 +#define SAL_RESID_POINTER_CHART 10045 +#define SAL_RESID_POINTER_DETECTIVE 10046 +#define SAL_RESID_POINTER_PIVOT_COL 10047 +#define SAL_RESID_POINTER_PIVOT_ROW 10048 +#define SAL_RESID_POINTER_PIVOT_FIELD 10049 +#define SAL_RESID_POINTER_CHAIN 10050 +#define SAL_RESID_POINTER_CHAIN_NOTALLOWED 10051 +#define SAL_RESID_POINTER_TIMEEVENT_MOVE 10052 +#define SAL_RESID_POINTER_TIMEEVENT_SIZE 10053 +#define SAL_RESID_POINTER_AUTOSCROLL_N 10054 +#define SAL_RESID_POINTER_AUTOSCROLL_S 10055 +#define SAL_RESID_POINTER_AUTOSCROLL_W 10056 +#define SAL_RESID_POINTER_AUTOSCROLL_E 10057 +#define SAL_RESID_POINTER_AUTOSCROLL_NW 10058 +#define SAL_RESID_POINTER_AUTOSCROLL_NE 10059 +#define SAL_RESID_POINTER_AUTOSCROLL_SW 10060 +#define SAL_RESID_POINTER_AUTOSCROLL_SE 10061 +#define SAL_RESID_POINTER_AUTOSCROLL_NS 10062 +#define SAL_RESID_POINTER_AUTOSCROLL_WE 10063 +#define SAL_RESID_POINTER_AUTOSCROLL_NSWE 10064 +#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_ICON_DEFAULT 1 + +#endif // _SV_SALIDS_HRC diff --git a/vcl/inc/os2/salinst.h b/vcl/inc/os2/salinst.h new file mode 100644 index 000000000000..4ea4d20501f3 --- /dev/null +++ b/vcl/inc/os2/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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALINST_H +#define _SV_SALINST_H + +#include + +namespace vos { class OMutex; } + +// ------------------- +// - SalInstanceData - +// ------------------- + +class SalYieldMutex; + +#define SAL_COMMANDLINENOINIT ((USHORT)0xFFFF) +#define SAL_MAXPARAM 40 + +class Os2SalInstance : public SalInstance +{ +public: + HAB mhAB; // anchor block handle + HMQ mhMQ; // handle of os2 message queue + HPOINTER mhAppIcon; // app icon + int mnArgc; // commandline param count + char** mpArgv; // commandline + 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: + Os2SalInstance(); + virtual ~Os2SalInstance(); + + 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, sal_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, bool ); + virtual bool AnyInput( USHORT nType ); + virtual SalMenu* CreateMenu( sal_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); +}; + +SalFrame* ImplSalCreateFrame( Os2SalInstance* pInst, HWND hWndParent, ULONG nSalFrameStyle ); +SalObject* ImplSalCreateObject( Os2SalInstance* pInst, Os2SalFrame* pParent ); +void ImplSalStartTimer( ULONG nMS, sal_Bool bMutex = FALSE ); + +#endif // _SV_SALINST_H diff --git a/vcl/inc/os2/sallang.hxx b/vcl/inc/os2/sallang.hxx new file mode 100644 index 000000000000..26bf20d1eb8e --- /dev/null +++ b/vcl/inc/os2/sallang.hxx @@ -0,0 +1,66 @@ +/************************************************************** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + + + +#ifndef _SALLANG_HXX +#define _SALLANG_HXX + +//#ifndef _TOOLS_LANG_HXX +//#include +//#endif +#include + +// -------------------- +// - Language Strings - +// -------------------- + +// --- Key-Namen --- +#define LSTR_KEY_SHIFT 0 +#define LSTR_KEY_CTRL 1 +#define LSTR_KEY_ALT 2 +#define LSTR_KEY_UP 3 +#define LSTR_KEY_DOWN 4 +#define LSTR_KEY_LEFT 5 +#define LSTR_KEY_RIGHT 6 +#define LSTR_KEY_HOME 7 +#define LSTR_KEY_END 8 +#define LSTR_KEY_PAGEUP 9 +#define LSTR_KEY_PAGEDOWN 10 +#define LSTR_KEY_RETURN 11 +#define LSTR_KEY_ESC 12 +#define LSTR_KEY_TAB 13 +#define LSTR_KEY_BACKSPACE 14 +#define LSTR_KEY_SPACE 15 +#define LSTR_KEY_INSERT 16 +#define LSTR_KEY_DELETE 17 + +// --- Anzahl der Texte --- + +#define LSTR_COUNT 18 + +// -------------------------------------------- +// - Methoden zum Abfragen der Sprach-Strings - +// -------------------------------------------- + +const sal_Unicode** ImplGetLangTab( LanguageType eLang ); + +#endif // _SALLANG_HXX diff --git a/vcl/inc/os2/sallayout.h b/vcl/inc/os2/sallayout.h new file mode 100644 index 000000000000..8444b5e758a9 --- /dev/null +++ b/vcl/inc/os2/sallayout.h @@ -0,0 +1,69 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALLAYOUT_H +#define _SV_SALLAYOUT_H + +#if 0 +#include +#include + +class ImplOs2FontEntry; + +class Os2SalLayout : public GenericSalLayout +{ +public: + Os2SalLayout( HPS); + virtual bool LayoutText( ImplLayoutArgs& ); + virtual void AdjustLayout( ImplLayoutArgs& ); + virtual void DrawText( SalGraphics& ) const; + +protected: + HPS mhPS; + FONTMETRICS FontMetrics; + int mnBaseAdv; + +private: + int mnGlyphCount; + int mnCharCount; + sal_Unicode* mpOutGlyphs; + int* mpGlyphAdvances; // if possible this is shared with mpGlyphAdvances[] + int* mpGlyphOrigAdvs; + int* mpCharWidths; // map rel char pos to char width + int* mpChars2Glyphs; // map rel char pos to abs glyph pos + int* mpGlyphs2Chars; // map abs glyph pos to abs char pos + bool* mpGlyphRTLFlags; // BiDi status for glyphs: true=>RTL + mutable long mnWidth; + bool mbDisableGlyphs; + + int mnNotdefWidth; + BYTE mnCharSet; + +}; +#endif + +#endif // _SV_SALLAYOUT_H diff --git a/vcl/inc/os2/salmenu.h b/vcl/inc/os2/salmenu.h new file mode 100644 index 000000000000..081158bf81f7 --- /dev/null +++ b/vcl/inc/os2/salmenu.h @@ -0,0 +1,65 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALMENU_H +#define _SV_SALMENU_H + +#include +#include +#include + + +class Os2SalMenu : public SalMenu +{ +public: + Os2SalMenu() {} + virtual ~Os2SalMenu(); + + 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 ); +}; + +class Os2SalMenuItem : public SalMenuItem +{ +public: + Os2SalMenuItem() {} + virtual ~Os2SalMenuItem(); +}; + +#endif // _SV_SALMENU_H + diff --git a/vcl/inc/os2/salobj.h b/vcl/inc/os2/salobj.h new file mode 100644 index 000000000000..3d05c4550f86 --- /dev/null +++ b/vcl/inc/os2/salobj.h @@ -0,0 +1,69 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALOBJ_H +#define _SV_SALOBJ_H + +#include + +// ----------------- +// - SalObjectData - +// ----------------- + +class Os2SalObject : 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 + HWND mhLastClipWnd; // LastClip-Window + HWND mhOldLastClipWnd; // LastClip-Window befor BeginSetClipRegion + long mnHeight; // Fenster-Hoehe fuer Positionsumrechnung + Os2SalObject* mpNextObject; // pointer to next object + void* mpInst; // instance handle for callback + SALOBJECTPROC mpProc; // callback proc + + Os2SalObject(); + virtual ~Os2SalObject(); + + 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( sal_Bool bVisible ); + virtual void Enable( sal_Bool nEnable ); + virtual void GrabFocus(); + virtual void SetBackground(); + virtual void SetBackground( SalColor nSalColor ); + virtual const SystemEnvData* GetSystemData() const; + virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept ); +}; + +#endif // _SV_SALOBJ_H diff --git a/vcl/inc/os2/salprn.h b/vcl/inc/os2/salprn.h new file mode 100644 index 000000000000..962550523422 --- /dev/null +++ b/vcl/inc/os2/salprn.h @@ -0,0 +1,145 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALPRN_H +#define _SV_SALPRN_H + +#include + +class SalGraphics; +class SalInfoPrinter; + +struct ImplFormInfo; +typedef ImplFormInfo* PIMPLFORMINFO; +struct ImplTrayInfo; +typedef ImplTrayInfo* PIMPLTRAYINFO; + +// ---------------------- +// - SalInfoPrinterData - +// ---------------------- + +//class SalInfoPrinterData +class Os2SalInfoPrinter : public SalInfoPrinter +{ +public: + Os2SalGraphics* mpGraphics; // Graphics + HDC mhDC; // printer hdc + HPS mhPS; // printer hps + ByteString maPrinterName; // pszPrinters + ByteString maName; // pszName bzw. LogAdress + ByteString maDriverName; // pszDriverName nach . + ByteString maDeviceName; // pszDriverName bis . + ByteString maJobSetupDeviceName; // DeviceName aus pDriverData + PIMPLFORMINFO* mpFormArray; // PaperForm-Names + USHORT mnFormCount; // PaperForm-Count + PIMPLTRAYINFO* mpTrayArray; // PaperTray-Names + USHORT mnTrayCount; // PaperTray-Count + sal_Bool mbDJPSupported; // is driver DJP enabled + sal_Bool mbGraphics; // is Graphics used + +public: + Os2SalInfoPrinter(); + virtual ~Os2SalInfoPrinter(); + + virtual SalGraphics* GetGraphics(); + virtual void ReleaseGraphics( SalGraphics* pGraphics ); + virtual sal_Bool Setup( SalFrame* pFrame, ImplJobSetup* pSetupData ); + virtual sal_Bool SetPrinterData( ImplJobSetup* pSetupData ); + virtual sal_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 ); +}; + +// ------------------ +// - SalPrinterData - +// ------------------ + +class SalPrinterData00 +{ +public: + Os2SalGraphics* mpGraphics; // current Printer graphics + SalInfoPrinter* mpInfoPrinter; // pointer to the compatible InfoPrinter + HDC mhDC; // printer hdc + HPS mhPS; // printer hps + ULONG mnError; // Error Code + sal_Bool mbFirstPage; // IsFirstPage + sal_Bool mbAbort; // JobAborted + sal_Bool mbPrintDJPSupported; // is driver PrintDJP enabled (DEVESC_NEWFRAME_WPROP) + char maCommentBuf[33]; // Comment + char maCopyBuf[10]; // Kopien +}; + +// ----------------- +// - Os2SalPrinter - +// ----------------- + +class Os2SalPrinter : public SalPrinter +{ +public: + Os2SalGraphics* mpGraphics; // current Printer graphics + Os2SalInfoPrinter* mpInfoPrinter; // pointer to the compatible InfoPrinter + Os2SalPrinter* mpNextPrinter; // next printing printer + HDC mhDC; // printer hdc + HPS mhPS; // printer hps + ULONG mnError; // Error Code + sal_Bool mbFirstPage; // IsFirstPage + sal_Bool mbAbort; // JobAborted + sal_Bool mbPrintDJPSupported; // is driver PrintDJP enabled (DEVESC_NEWFRAME_WPROP) + char maCommentBuf[33]; // Comment + char maCopyBuf[16]; // Kopien + //HDC mhDC; // printer hdc + //ULONG mnError; // Error Code + //ULONG mnCopies; // Kopien + //sal_Bool mbCollate; // Sortierte Kopien + //sal_Bool mbAbort; // Job Aborted + +public: + Os2SalPrinter(); + virtual ~Os2SalPrinter(); + + virtual sal_Bool StartJob( const XubString* pFileName, + const XubString& rJobName, + const XubString& rAppName, + ULONG nCopies, + bool bCollate, + bool bDirect, + ImplJobSetup* pSetupData ); + virtual sal_Bool EndJob(); + virtual sal_Bool AbortJob(); + virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, sal_Bool bNewJobData ); + virtual sal_Bool EndPage(); + virtual ULONG GetErrorCode(); +}; + +#endif // _SV_SALPRN_H diff --git a/vcl/inc/os2/salsound.h b/vcl/inc/os2/salsound.h new file mode 100644 index 000000000000..4bbf0d658270 --- /dev/null +++ b/vcl/inc/os2/salsound.h @@ -0,0 +1,94 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALSOUND_H +#define _SV_SALSOUND_H + +#include +#include +#include +#include +#ifndef _SV_SALSTYPE_HXX +#include +#endif +#include + +// ------------ +// - SalSound - +// ------------ + +//class SalSound +class Os2SalSound : public SalSound +{ +private: + + static HMODULE mhMCILib; + static ULONG mnSoundState; + static void* mpMCIFnc; + SALSOUNDPROC mpProc; + void* mpInst; + ULONG mnStartTime; + ULONG mnPlayLen; + HWND mhSoundWnd; + USHORT mnDeviceId; + BOOL mbLoop; + BOOL mbPaused; + +public: + + void ImplSetError( ULONG nMciErr ); + void ImplNotify( SoundNotification eNotification, ULONG nError ); + +public: + + BOOL Create(); + //static BOOL IsValid() { return( SOUND_STATE_VALID == Os2SalSound::mnSoundState ); } + //BOOL Init( SalFrame* pFrame, const String& rSoundName, ULONG& rSoundLen ); + //BOOL Init( SalFrame* pFrame, const BYTE* pSound, ULONG nDataLen, ULONG& rSoundLen ); + + void SetNotifyProc( void* pInst, SALSOUNDPROC pProc ) + { mpInst = pInst; mpProc = pProc; } +public: + Os2SalSound(); + virtual ~Os2SalSound(); + + virtual bool IsValid(); + virtual bool Init( const String& rSoundName, ULONG& rSoundLen ); + virtual void Play( ULONG nStartTime, ULONG nPlayTime, bool bLoop ); + virtual void Stop(); + virtual void Pause(); + virtual void Continue(); + virtual bool IsLoopMode() const; + virtual bool IsPlaying() const; + virtual bool IsPaused() const; + + bool ImplCreate(); + void ImplDestroy(); + static void Release(); +}; + +#endif // _SV_SALSOUND_H diff --git a/vcl/inc/os2/salsound.hxx b/vcl/inc/os2/salsound.hxx new file mode 100644 index 000000000000..e005db4589f6 --- /dev/null +++ b/vcl/inc/os2/salsound.hxx @@ -0,0 +1,80 @@ +/************************************************************** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + + + +#ifndef _SV_SALSOUND_HXX +#define _SV_SALSOUND_HXX + +#include +#include +#include +#include +#ifndef _SV_SALSTYPE_HXX +#include +#endif +#include + +// ------------ +// - SalSound - +// ------------ + +class SalSound +{ +private: + + static HMODULE mhMCILib; + static ULONG mnSoundState; + static void* mpMCIFnc; + SALSOUNDPROC mpProc; + void* mpInst; + ULONG mnStartTime; + ULONG mnPlayLen; + HWND mhSoundWnd; + USHORT mnDeviceId; + BOOL mbLoop; + BOOL mbPaused; + +public: + + void ImplSetError( ULONG nMciErr ); + void ImplNotify( SoundNotification eNotification, ULONG nError ); + +public: + + SalSound(); + ~SalSound(); + + BOOL Create(); + static void Release(); + static BOOL IsValid() { return( SOUND_STATE_VALID == SalSound::mnSoundState ); } + + BOOL Init( SalFrame* pFrame, const String& rSoundName, ULONG& rSoundLen ); + BOOL Init( SalFrame* pFrame, const BYTE* pSound, ULONG nDataLen, ULONG& rSoundLen ); + void Play( ULONG nStartTime, ULONG nPlayTime, BOOL bLoop ); + void Stop(); + void Pause(); + + void SetNotifyProc( void* pInst, SALSOUNDPROC pProc ) + { mpInst = pInst; mpProc = pProc; } +}; + +#endif // _SV_SALSOUND_HXX diff --git a/vcl/inc/os2/salsys.h b/vcl/inc/os2/salsys.h new file mode 100644 index 000000000000..05bd9f4020a1 --- /dev/null +++ b/vcl/inc/os2/salsys.h @@ -0,0 +1,43 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALSYS_H +#define _SV_SALSYS_H + +#include + +class SalFrame; + +// ----------------- +// - SalSystemData - +// ----------------- + +class SalSystemData +{ +}; + +#endif // _SV_SALSYS_H diff --git a/vcl/inc/os2/saltimer.h b/vcl/inc/os2/saltimer.h new file mode 100644 index 000000000000..069e97755d05 --- /dev/null +++ b/vcl/inc/os2/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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALTIMER_H +#define _SV_SALTIMER_H + +#include + +class Os2SalTimer : public SalTimer +{ +public: + Os2SalTimer() {} + virtual ~Os2SalTimer(); + + // overload all pure virtual methods + void Start( ULONG nMS ); + void Stop(); +}; + +#endif diff --git a/vcl/inc/os2/salvd.h b/vcl/inc/os2/salvd.h new file mode 100644 index 000000000000..8f841f941430 --- /dev/null +++ b/vcl/inc/os2/salvd.h @@ -0,0 +1,65 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALVD_H +#define _SV_SALVD_H + +#include +#include + +class Os2SalGraphics; + +// ----------------- +// - SalVirDevData - +// ----------------- + +//class SalVirDevData +class Os2SalVirtualDevice : public SalVirtualDevice +{ +public: + HPS mhPS; // HPS + HDC mhDC; // HDC + HBITMAP mhBmp; // Memory Bitmap + HBITMAP mhDefBmp; // Default Bitmap + Os2SalGraphics* mpGraphics; // current VirDev graphics + USHORT mnBitCount; // BitCount (0 or 1) + BOOL mbGraphics; // is Graphics used + + Os2SalVirtualDevice(); + virtual ~Os2SalVirtualDevice(); + + virtual SalGraphics* GetGraphics(); + virtual void ReleaseGraphics( SalGraphics* pGraphics ); + virtual BOOL SetSize( long nNewDX, long nNewDY ); + virtual void GetSize( long& rWidth, long& rHeight ); +}; + +// Help-Functions +HBITMAP ImplCreateVirDevBitmap( HDC hDC, HPS hPS, long nDX, long nDY, + USHORT nBitCount ); + +#endif // _SV_SALVD_H diff --git a/vcl/inc/os2/svsys.h b/vcl/inc/os2/svsys.h new file mode 100644 index 000000000000..39544b83d875 --- /dev/null +++ b/vcl/inc/os2/svsys.h @@ -0,0 +1,35 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SVSYS_H +#define _SV_SVSYS_H + +#ifndef _SVPM_H +#include +#endif + +#endif // _SV_SVSYS_H diff --git a/vcl/inc/os2/wingdi.h b/vcl/inc/os2/wingdi.h new file mode 100644 index 000000000000..d6085abbd262 --- /dev/null +++ b/vcl/inc/os2/wingdi.h @@ -0,0 +1,70 @@ +#ifndef _WINGDI_ +#define _WINGDI_ + +typedef struct tagPOINT +{ + LONG x; + LONG y; +} POINT, *PPOINT, *LPPOINT; + + +typedef unsigned long DWORD; +typedef unsigned short WORD; +typedef struct +{ + WORD fract; + SHORT value; +} W32FIXED; + +typedef struct tagPOINTFX +{ + W32FIXED x; + W32FIXED y; +} POINTFX, *LPPOINTFX; + +typedef struct tagTTPOLYCURVE +{ + WORD wType; + WORD cpfx; + POINTFX apfx[1]; +} TTPOLYCURVE, *LPTTPOLYCURVE; + +typedef struct tagTTPOLYGONHEADER +{ + DWORD cb; + DWORD dwType; + POINTFX pfxStart; +} TTPOLYGONHEADER, *LPTTPOLYGONHEADER; + +typedef struct +{ + UINT gmBlackBoxX; + UINT gmBlackBoxY; + POINT gmptGlyphOrigin; + SHORT gmCellIncX; + SHORT gmCellIncY; +} GLYPHMETRICS, *LPGLYPHMETRICS; + +#define GGO_METRICS 0 +#define GGO_BITMAP 1 +#define GGO_NATIVE 2 +#define GGO_BEZIER 3 +#define GGO_GRAY2_BITMAP 4 +#define GGO_GRAY4_BITMAP 5 +#define GGO_GRAY8_BITMAP 6 +#define GGO_GLYPH_INDEX 0x80 + +#define TT_PRIM_LINE 1 +#define TT_PRIM_QSPLINE 2 +#define TT_PRIM_CSPLINE 3 +#define TT_POLYGON_TYPE 24 + +typedef struct +{ + W32FIXED eM11; + W32FIXED eM12; + W32FIXED eM21; + W32FIXED eM22; +} MAT2, *LPMAT2; + +#endif // _WINGDI_ diff --git a/vcl/inc/os2/xwphook.h b/vcl/inc/os2/xwphook.h new file mode 100644 index 000000000000..07e00bd4c4c1 --- /dev/null +++ b/vcl/inc/os2/xwphook.h @@ -0,0 +1,620 @@ + +/* + * xwphook.h: + * header for both xwphook.c and xwpdaemon.c. This is also + * included from a number of sources for XFLDR.DLL which need + * to interface (configure) the daemon. + */ + +/* + * Copyright (C) 1999-2002 Ulrich M”ller. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, in version 2 as it comes in the COPYING + * file of the XWorkplace main distribution. + * This program 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 General Public License for more details. + */ + +#ifndef XWPHOOK_HEADER_INCLUDED + #define XWPHOOK_HEADER_INCLUDED + + /* ****************************************************************** + * + * OS2.INI applications and keys + * + ********************************************************************/ + + #define INIAPP_XWPHOOK "XWorkplace:Hook" // added V0.9.0 + #define INIKEY_HOOK_HOTKEYS "Hotkeys" // added V0.9.0 + #define INIKEY_HOOK_CONFIG "Config" // added V0.9.0 + #define INIKEY_HOOK_PAGERCONFIG "PagerConfig" // V0.9.2 (2000-02-25) [umoeller] + // changed V0.9.19 (2002-05-07) [umoeller] + #define INIKEY_HOOK_PAGERWINPOS "PagerWinPos" + // changed V0.9.19 (2002-05-07) [umoeller] + #define INIKEY_HOOK_FUNCTIONKEYS "FuncKeys" // added V0.9.3 (2000-04-19) [umoeller] + #define INIKEY_HOOK_MOUSEMAPPINGS "MouseMappings" // added V0.9.19 (2002-04-20) [lafaix] + + /* ****************************************************************** + * + * Structures + * + ********************************************************************/ + + // do not change the following, or this will break + // binary compatibility of the XPager OS2.INI data + #define MAX_STICKIES 64 + #define STICKYLEN 50 + +#ifndef __NOPAGER__ + + // flags for PAGERCONFIG.aulStickyFlags + #define SF_CONTAINS 0x00000000L // default + #define SF_BEGINSWITH 0x00000001L + #define SF_ENDSWITH 0x00000002L + #define SF_EQUALS 0x00000004L + #define SF_MATCHES 0x00000008L // V0.9.19 (2002-04-17) [umoeller] + #define SF_OPERATOR_MASK 0x0000FFFFL + + #define SF_INCLUDE 0x00000000L // default + #define SF_EXCLUDE 0x00010000L + #define SF_CRITERIA_MASK 0x00010000L + + #define SF_TITLE 0x00000000L // default + #define SF_ATTRIBUTE_MASK 0xFFFE0000L + + #pragma pack(1) + + /* + *@@ PAGERCONFIG: + * XPager configuration data. + * This is stored within the HOOKDATA structure + * (statically in the hook DLL) so that both + * the daemon and the hook have access to this. + * + *@@added V0.9.2 (2000-02-25) [umoeller] + */ + + typedef struct _PAGERCONFIG + { + BYTE cDesktopsX, + cDesktopsY, + // no. of virtual Desktops (x and y) + bStartX, + bStartY; + // initial desktop at startup + + ULONG flPager; + // flags for "XPager" settings page 1 + #define PGRFL_WRAPAROUND 0x0001 + #define PGRFL_HOTKEYS 0x0002 + #define PGRFL_NOFOLLOWFOCUS 0x0004 + + #define PGRMASK_PAGE1 (PGRFL_WRAPAROUND | PGRFL_HOTKEYS) + #define PGRFL_PAGE1_DEFAULTS 0 + + // flags for "XPager" settings page 2 + #define PGRFL_PRESERVEPROPS 0x0010 + // preserve proportions of XPager win when resizing? + #define PGRFL_STAYONTOP 0x0020 + // stay on top? + #define PGRFL_FLASHTOTOP 0x0040 + #define PGRFL_MINIWINDOWS 0x0080 + // show mini windows in XPager? + #define PGRFL_MINIWIN_TITLES 0x0100 + // show mini window titles? + #define PGRFL_MINIWIN_MOUSE 0x0200 + // allow activate/lower by mouse clicks? + #define PGRFL_INCLUDESECONDARY 0x0400 + #define PGRFL_INCLUDESTICKY 0x0800 + #define PGRFL_MINIWIN_ICONS 0x1000 + // show mini window icons? + // V0.9.19 (2002-06-13) [umoeller] + + #define PGRMASK_PAGE2 ( PGRFL_PRESERVEPROPS \ + | PGRFL_STAYONTOP \ + | PGRFL_FLASHTOTOP \ + | PGRFL_MINIWINDOWS \ + | PGRFL_MINIWIN_TITLES \ + | PGRFL_MINIWIN_MOUSE \ + | PGRFL_INCLUDESECONDARY \ + | PGRFL_INCLUDESTICKY \ + | PGRFL_MINIWIN_ICONS ) + #define PGRFL_PAGE2_DEFAULTS ( PGRFL_PRESERVEPROPS \ + | PGRFL_MINIWINDOWS \ + | PGRFL_MINIWIN_TITLES \ + | PGRFL_MINIWIN_MOUSE) + + // flags for "XPager" settings page 3 + #define PGRFL_ADDSTICKYTOGGLE 0x2000 + // add "sticky" option to system menu? + // V1.0.0 (2002-09-14) [lafaix] + + #define PGRMASK_PAGE3 ( PGRFL_ADDSTICKYTOGGLE ) + #define PGRFL_PAGE3_DEFAULTS 0 + #define PGRFL_WINDOWS_KEYS 0x00010000 + // V1.0.3 (2004-10-14) [bird]: Use windows keys for left / right + + ULONG ulFlashDelay; + // "flash" delay in milliseconds, if PGRFL_FLASHTOTOP + ULONG flKeyShift; // KC_* values + + // paint settings + ULONG flPaintMode; // as in BKGNDINFO (gpih.h) + LONG lcolDesktop1, // as in BKGNDINFO (gpih.h) + lcolDesktop2; // as in BKGNDINFO (gpih.h) + + LONG lcolActiveDesktop; // color of hatching for active desktop + + LONG lcolGrid; // grid color (separators between desktops) + + LONG lcolInactiveWindow, + lcolActiveWindow, + lcolWindowFrame, + lcolInactiveText, + lcolActiveText; + + // sticky windows + ULONG cStickies; + ULONG aulStickyFlags[MAX_STICKIES]; // SF_* flags per sticky + CHAR aszStickies[MAX_STICKIES][STICKYLEN]; + + } PAGERCONFIG, *PPAGERCONFIG; + + #pragma pack() + +#endif + + // flags for HOOKCONFIG.usScrollMode + #define SM_LINEWISE 0 + #define SM_AMPLIFIED 1 + + // flags for HOOKCONFIG.ulAutoHideFlags + #define AHF_IGNOREMENUS 0x00000001L + #define AHF_IGNOREBUTTONS 0x00000002L + + // flags for HOOKCONFIG.ulAutoMoveFlags + #define AMF_ALWAYSMOVE 0x00000001L + #define AMF_IGNORENOBUTTON 0x00000002L + #define AMF_ANIMATE 0x00000004L + + /* + *@@ HOOKCONFIG: + * configuration data for the hook and the daemon. + * + * This is stored within the HOOKDATA structure + * (statically in the hook DLL) so that both + * the daemon and the hook have access to this. + * + * A mirror of this structure is put into OS2.INI + * which gets loaded by the XWorkplace settings + * objects in XFLDR.DLL to configure the hook. + * This gets (re)loaded by the daemon when XFLDR.DLL + * posts XDM_HOOKCONFIG to fnwpDaemonObject. + * + * So this is seen by the hook and the daemon; + * XFLDR.DLL only writes this back to OS2.INI and + * notifies the daemon to reload this. + * + * For every item, the safe default value is null + * so the structure can be zeroed to disable + * everything. + * + * If settings are added to this structure, they + * must be added to the bottom in order not to + * break binary compatibility between XWP versions. + * + * Note that the object hotkey _definitions_ are + * not part of this structure. Those are set using + * XDM_HOTKEYSCHANGED instead. However, object + * hotkeys are globally enabled in here (fGlobalHotkeys). + */ +#pragma pack(4) + typedef struct _HOOKCONFIG + { + // Sliding focus: + + PM_BOOL __fSlidingFocus; + // enabled? + ULONG __ulSlidingFocusDelay; + // delay in ms; 0 = off + + PM_BOOL __fSlidingBring2Top; + // bring windows to top or preserve Z-order + PM_BOOL __fSlidingIgnoreDesktop; + // ignore Desktop windows + PM_BOOL __fSlidingIgnoreSeamless; + // TRUE: ignore seamless Win-OS/2 windows + // FALSE: always bring them to top + + // Screen corner objects: + HOBJECT ahobjDummy[4]; // was four screen corner objects; + // we extended the array to 8 items + // so the array had to be moved to the + // bottom in order not to break binary + // compatibility + + BYTE bMonitorDrives[30]; // array of 1-byte BOOLs; if any of these + // is "1", the corresponding drive letter + // will be monitored for media change + // (index 1 = A, index 2 = B, index 3 = C, ...). + // Index 0 is unused to match logical drive numbers. + + // More mouse mappings: V0.9.1 (99-12-03) + + PM_BOOL fChordWinList; // deprecated V0.9.19 (2002-04-20) [lafaix] + // show window list on mb1+2 chord + PM_BOOL fSysMenuMB2TitleBar; // deprecated V0.9.19 (2002-04-20) [lafaix] + // show system menu on mb2 title-bar click + + // Mouse-button-3 scrolling: V0.9.1 (99-12-03) + + PM_BOOL fMB3Scroll; // deprecated V0.9.19 (2002-04-20) [lafaix] + // scroll window contents on MB3Drag + PM_BOOL fMB3ScrollReverse; // deprecated V0.9.19 (2002-04-20) [lafaix] + // reverse scrolling + USHORT usScrollMode; // deprecated V0.9.19 (2002-04-20) [lafaix] + // one of the following: + // -- SM_LINEWISE (0): scroll fixed, line-wise + // -- SM_AMPLIFIED (1): scroll amplified, relative to window size + USHORT usMB3ScrollMin; + // minimum pixels that mouse must be moved; + // 0 means 1, 1 means 2, ... + SHORT sAmplification; + // amplification (-9 thru +10) + // the amplification in percent is calculated like this: + // percent = 100 + (sAmplification * 10) + // so we get: + // 0 --> 100% + // 2 --> 120% + // 10 --> 200% + // -2 --> 80% + // -9 --> 10% + + // Auto-hide mouse pointer: V0.9.1 (99-12-03) + PM_BOOL __fAutoHideMouse; + ULONG __ulAutoHideDelay; + // delay in seconds; 0 means 1 second, 2 means 3, ... + + // Global object hotkeys enabled: + // this can be disabled even if any hotkeys are defined + // because the hotkeys themselves are stored separately + // in shared memory + PM_BOOL __fGlobalHotkeys; + + // XPager configuration + PM_BOOL fRemoved1, // _fXPagerStayOnTop, + fRemoved2; //__fSlidingIgnoreXPager; + // removed V0.9.19 (2002-05-07) [umoeller] + + // Sliding menus + PM_BOOL fSlidingMenus; + // enabled? + ULONG ulSubmenuDelay; + // delay in ms; 0 = off + PM_BOOL fMenuImmediateHilite; + + // Mouse-button-3 single-clicks to MB1 double-clicks + // V0.9.4 (2000-06-12) [umoeller] + PM_BOOL fMB3Click2MB1DblClk; // deprecated V0.9.19 (2002-04-20) [lafaix] + + // Screen corner objects: + // moved the array down here (there's a dummy above) + // V0.9.4 (2000-06-12) [umoeller] + HOBJECT ahobjHotCornerObjects[8]; + // Indices: + // 0 = lower left corner, + // 1 = top left corner, + // 2 = lower right corner, + // 3 = top right corner; + // borders added V0.9.4 (2000-06-12) [umoeller]: + // 4 = top border, + // 5 = left border, + // 6 = right border, + // 7 = bottom border. + // V0.9.18 (2002-02-12) [pr] + #define SCREENCORNER_MIN 0 + #define SCREENCORNER_BOTTOMLEFT 0 + #define SCREENCORNER_TOPLEFT 1 + #define SCREENCORNER_BOTTOMRIGHT 2 + #define SCREENCORNER_TOPRIGHT 3 + #define SCREENCORNER_TOP 4 + #define SCREENCORNER_LEFT 5 + #define SCREENCORNER_RIGHT 6 + #define SCREENCORNER_BOTTOM 7 + #define SCREENCORNER_MAX 7 + // If any item is NULLHANDLE, it means the + // corner is inactive (no function defined). + // If the hiword of the item is 0xFFFF, this + // means a special function has been defined: + // (#define's added V0.9.19 (2002-04-17) [umoeller]): + #define SPECIALOBJ_FIRST 0xFFFF0000 + #define SPECIALOBJ_SHOWWINDOWLIST 0xFFFF0000 + #define SPECIALOBJ_DESKTOPCONTEXTMENU 0xFFFF0001 + #define SPECIALOBJ_PAGER_SHOW 0xFFFF0002 + // the following added (2001-01-26) [lafaix] + #define SPECIALOBJ_PAGER_UP 0xFFFF0003 + #define SPECIALOBJ_PAGER_RIGHT 0xFFFF0004 + #define SPECIALOBJ_PAGER_DOWN 0xFFFF0005 + #define SPECIALOBJ_PAGER_LEFT 0xFFFF0006 + // the following added V0.9.18 [pr] + #define SPECIALOBJ_SCREENWRAP 0xFFFF0007 + // Otherwise (> 0 and < 0xFFFF0000), we have + // a "real" object handle, and a regular WPS + // object is to be opened. + + // special treatment for conditional-cascade submenus when + // using sliding menus (V0.9.6 (2000-10-27) [umoeller]) + PM_BOOL fConditionalCascadeSensitive; + + // more XPager configuration V0.9.7 (2000-12-08) [umoeller] + PM_BOOL fRemoved3; // __fSlidingIgnoreXCenter; + // removed V0.9.19 (2002-05-07) [umoeller] + + // screen corner objects sensitivity; in percent of the + // adjacents borders. 0 = off, 50 = borders objects disabled + // V0.9.9 (2001-03-15) [lafaix] + ULONG ulCornerSensitivity; + + // Mouse-button-3 autoscroll and push to bottom features + PM_BOOL fMB3AutoScroll; // deprecated V0.9.19 (2002-04-20) [lafaix] + PM_BOOL fMB3Push2Bottom; // deprecated V0.9.19 (2002-04-20) [lafaix] + + // Auto hide and automatic pointer movement options + // V0.9.14 (2001-08-02) [lafaix] + ULONG __ulAutoHideFlags; + PM_BOOL __fAutoMoveMouse; + ULONG __ulAutoMoveFlags; + ULONG __ulAutoMoveDelay; // V0.9.14 (2001-08-21) [umoeller] + ULONG __ulMouseMappingsCount; // V0.9.19 (2002-04-20) [lafaix] + } HOOKCONFIG, *PHOOKCONFIG; +#pragma pack() + + /* + *@@ GLOBALHOTKEY: + * single XWorkplace object hotkey definition. + * Arrays of this are allocated in shared memory and + * used by xwphook.c, xwpdaemn.c, and also XFldObject + * for hotkey manipulation and detection. + */ + + typedef struct _GLOBALHOTKEY + { + USHORT usFlags; + // Keyboard control codes: + // SHORT1FROMMP(mp1) of WM_CHAR, filtered. + // Only the following flags will be set: + // -- KC_CTRL + // -- KC_ALT + // -- KC_SHIFT + // -- KC_VIRTUALKEY + // -- KC_INVALIDCOMP: special flag used if the + // scan code represents one of the user-defined + // function keys in the XWPKeyboard object. + // KC_CTRL, KC_ALT, KC_SHIFT work always, + // no matter if we're in a PM or VIO session. + // However, for some reason, KC_VIRTUALKEY is + // never set in VIO sessions. We still store it + // in this structure though to be able to display + // the hotkey in the configuration pages. + // The hook will filter that out since the scan + // code is good enough to identify the key. + UCHAR ucScanCode; + // Hardware scan code: + // CHAR4FROMMP(mp1) of WM_CHAR. + // As opposed to what we do with folder hotkeys, + // this must be stored also, because we must use + // the scan code for WM_CHAR processing in the hook + // to identify hotkeys. We cannot use usKeyCode + // because that's different in VIO sessions, while + // this one is always the same. + // Even if any of Ctrl, Alt, Shift are pressed, this + // has the scan code of the additional key which was + // pressed. + USHORT usKeyCode; + // key code: + // if KC_VIRTUALKEY is set in usFlags, this has usvk, + // otherwise usch from WM_CHAR. + // This is only used to be able to display the hotkey + // in the hotkey configuration dialogs; we do _not_ use + // this to check WM_CHAR messages in the hook, because + // this is different between PM and VIO sessions. + ULONG ulHandle; + // handle to post to thread-1 object window (kernel.c); + // this is normally the HOBJECT of the object to be + // opened. + } GLOBALHOTKEY, *PGLOBALHOTKEY; + + /* + *@@ MOUSEMAPPING: + * single XWorkplace mouse mapping definition. + * Arrays of this are allocated in shared memory and + * used by xwphook.c, xwpdaemn.c, and also XWPMouse + * for mouse mappings manipulation and detection. + * + *@@added V0.9.19 (2002-04-20) [lafaix] + */ + + typedef struct _MOUSEMAPPING + { + USHORT usEvent; + // One of the MME_* values (or MME_XBUTTON_FIRST+n + // to denote extra button n, 0 <= n < 32). + // standard mouse events + #define MME_BUTTON1CLICK 0x0001 + #define MME_BUTTON2CLICK 0x0002 + #define MME_BUTTON3CLICK 0x0003 + #define MME_BUTTON1DRAG 0x0004 + #define MME_BUTTON2DRAG 0x0005 + #define MME_BUTTON3DRAG 0x0006 + #define MME_CHORD 0x0007 + // wheel/stick events + #define MME_UP 0x1001 + #define MME_DOWN 0x1002 + #define MME_LEFT 0x1003 + #define MME_RIGHT 0x1004 + // the 2X and 3X variants are handy when mapping an action + // to a wheel/stick movement. They map at least 2 (or 3) + // consecutive events, and hence disambiguate an unexpected + // wheel/stick event. + #define MME_UP2X 0x2001 + #define MME_DOWN2X 0x2002 + #define MME_LEFT2X 0x2003 + #define MME_RIGHT2X 0x2004 + #define MME_UP3X 0x3001 + #define MME_DOWN3X 0x3002 + #define MME_LEFT3X 0x3003 + #define MME_RIGHT3X 0x3004 + // extra buttons + #define MME_XBUTTON_FIRST 0x4000 + // type helpers + #define MME_TYPE_MASK 0xF000 + #define MME_TYPE_STANDARD 0x0000 + #define MME_TYPE_WHEEL 0x1000 + #define MME_TYPE_WHEEL2X 0x2000 + #define MME_TYPE_WHEEL3X 0x3000 + #define MME_TYPE_XBUTTON 0x4000 + #define MME_TYPE_DISABLED 0x8000 + + USHORT usModifiers; + // A possibly empty combination of KC_SHIFT, KC_CTRL, + // and KC_ALT. + CHAR achLocation[32]; + // The class name upon which this mapping applies. + // An empty location (i.e., achLocation[0] = 0) means + // a global mapping. + CHAR achPluginName[8]; + // The plugin library providing the action defined for + // this mapping. An empty location (i.e., + // achPluginName[0] = 0) means a buildin action. + USHORT usAction; + // The action (relative to the plugin) defined for + // this event. + BYTE abSetup[16]; + // A private area possibly refining the action. + } MOUSEMAPPING, *PMOUSEMAPPING; + + /* + *@@ FUNCTIONKEY: + * XWorkplace function key description. + * An array of these is returned by + * hifQueryFunctionKeys(). + * + *@@added V0.9.3 (2000-04-19) [umoeller] + */ + + typedef struct _FUNCTIONKEY + { + UCHAR ucScanCode; // hardware scan code; + // CHAR4FROMMP(mp1) of WM_CHAR + CHAR szDescription[30]; // key description (e.g. "Win left") + PM_BOOL fModifier; // TRUE if the scan code represents + // a modifier key which can be pressed + // together with another key, similar + // to Ctrl or Alt or Del; this will + // allow us to do things like "WinLeft + C" + } FUNCTIONKEY, *PFUNCTIONKEY; + + /* ****************************************************************** + * + * Messages + * + ********************************************************************/ + + #define XDM_HOOKINSTALL (WM_USER + 400) + + #define XDM_DESKTOPREADY (WM_USER + 401) + + #define XDM_HOOKCONFIG (WM_USER + 402) + +#ifndef __NOPAGER__ + #define XDM_STARTSTOPPAGER (WM_USER + 403) + + #define XDM_PAGERCONFIG (WM_USER + 404) + // flags for XDM_PAGERCONFIG: + #define PGRCFG_REPAINT 0x0001 // invalidates mini windows + #define PGRCFG_REFORMAT 0x0004 // causes PGRM_POSITIONFRAME, + // repaints background too + #define PGRCFG_STICKIES 0x0008 // sticky windows have changed +#endif + + #define XDM_HOTKEYPRESSED (WM_USER + 405) + + #define XDM_HOTKEYSCHANGED (WM_USER + 406) + + #define XDM_FUNCTIONKEYSCHANGED (WM_USER + 407) + +#ifndef __NOSLIDINGFOCUS__ + #define XDM_SLIDINGFOCUS (WM_USER + 408) +#endif + + #define XDM_SLIDINGMENU (WM_USER + 409) + + #define XDM_HOTCORNER (WM_USER + 410) + + #define XDM_WMCHORDWINLIST (WM_USER + 411) + + // added V0.9.9 (2001-03-18) [lafaix] + #define XDM_BEGINSCROLL (WM_USER + 413) + #define XDM_SETPOINTER (WM_USER + 414) + #define XDM_ENDSCROLL (WM_USER + 415) + + // added V0.9.12 (2001-05-12) [umoeller] + #define XDM_RECOVERWINDOWS (WM_USER + 416) + + #define XDM_ADDDISKWATCH (WM_USER + 417) + + /* + *@@ ADDDISKWATCH: + * struct used with XDM_ADDDISKWATCH. + * + *@@added V0.9.14 (2001-08-01) [umoeller] + */ + + typedef struct _ADDDISKWATCH + { + ULONG ulLogicalDrive; // disk to be monitored + HWND hwndNotify; // window to be notified on change + ULONG ulMessage; // message to be posted to window + } ADDDISKWATCH, *PADDDISKWATCH; + + #define XDM_REMOVEDISKWATCH (WM_USER + 418) + + #define XDM_QUERYDISKS (WM_USER + 419) + + #define XDM_ADDCLICKWATCH (WM_USER + 420) + + #define XDM_MOUSECLICKED (WM_USER + 421) + +#ifndef __NOMOVEMENT2FEATURES__ + #define XDM_MOVEPTRTOBUTTON (WM_USER + 422) +#endif + + #define XDM_DISABLEHOTKEYSTEMP (WM_USER + 423) + + #define XDM_STARTAPP (WM_USER + 424) + + #define XDM_ADDWINLISTWATCH (WM_USER + 425) + + #define XDM_WINDOWCHANGE (WM_USER + 426) + + #define XDM_ICONCHANGE (WM_USER + 427) + + #define XDM_QUERYWINLIST (WM_USER + 428) + + #define XDM_REMOVEWINLISTWATCH (WM_USER + 429) // V0.9.19 (2002-06-14) [lafaix] + + #define XDM_REMOVECLICKWATCH (WM_USER + 430) // V0.9.19 (2002-06-14) [lafaix] + +#ifndef __NOPAGER__ + #define XDM_TOGGLETRANSIENTSTICKY (WM_USER + 431) // V1.0.0 (2002-07-26) [lafaix] + #define XDM_ISTRANSIENTSTICKY (WM_USER + 432) +#endif + + #define XDM_NLSCHANGED (WM_USER + 433) // V1.0.0 (2002-09-15) [lafaix] +#endif + + + diff --git a/vcl/inc/sft.hxx b/vcl/inc/sft.hxx index 19fd90f9e6cf..10a8b859e77e 100644 --- a/vcl/inc/sft.hxx +++ b/vcl/inc/sft.hxx @@ -109,7 +109,7 @@ namespace vcl }; /** Value of the width member of the TTGlobalFontInfo struct */ -#ifndef OS2 +#ifndef FWIDTH_DONT_CARE // OS2 enum WidthClass { FWIDTH_ULTRA_CONDENSED = 1, /**< 50% of normal */ FWIDTH_EXTRA_CONDENSED = 2, /**< 62.5% of normal */ @@ -121,7 +121,7 @@ namespace vcl FWIDTH_EXTRA_EXPANDED = 8, /**< 150% of normal */ FWIDTH_ULTRA_EXPANDED = 9 /**< 200% of normal */ }; -#endif // OS2 +#endif // FWIDTH_DONT_CARE #endif /* FW_THIN */ /** Type of the 'kern' table, stored in _TrueTypeFont::kerntype */ diff --git a/vcl/inc/vcl/sysdata.hxx b/vcl/inc/vcl/sysdata.hxx index ae44612dbf24..52bd296d6d0a 100644 --- a/vcl/inc/vcl/sysdata.hxx +++ b/vcl/inc/vcl/sysdata.hxx @@ -159,6 +159,8 @@ struct SystemFontData unsigned long nSize; // size in bytes of this structure #if defined( WNT ) HFONT hFont; // native font object +#elif defined( OS2 ) + ULONG hFont; // native font object #elif defined( QUARTZ ) void* aATSUFontID; // native font object #elif defined( UNX ) -- cgit