Files
libreoffice/vcl/win/source/window/salframe.cxx

6013 lines
208 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
re-base on ALv2 code. Includes: Patches contributed by Pedro Giffuni: Avoid some uses of non portable #!/bin/bash in shell scripts. http://svn.apache.org/viewvc?view=revision&revision=1235297 Reduce the dependencies on non standard GNU copy. http://svn.apache.org/viewvc?view=revision&revision=1238684 Correct /usr/bin/env path. http://svn.apache.org/viewvc?view=revision&revision=1235619 Complex Toolbar Controls Extension from the SDK Patches contributed by Ariel Constenla-Haile http://svn.apache.org/viewvc?view=revision&revision=1190390 i118615 - make epm more verbose http://svn.apache.org/viewvc?view=revision&revision=1204288 Patches contributed by Mathias Bauer (and others) gnumake4 work variously http://svn.apache.org/viewvc?view=revision&revision=1394707 http://svn.apache.org/viewvc?view=revision&revision=1394326 Patches contributed by Juergen Schmidt: jsc341: i117327: take care if no dependency node in current description exists, create one http://svn.apache.org/viewvc?view=revision&revision=1172101 jsc341: i117327: add extra extension dependency check http://svn.apache.org/viewvc?view=revision&revision=1172098 make initial branding changes http://svn.apache.org/viewvc?view=revision&revision=1231878 Patches contributed by Ingo Schmidt native373: #i117733# no linux jre installation on 64 bit systems http://svn.apache.org/viewvc?view=revision&revision=1167536 native373: ##164464# improve debian support http://svn.apache.org/viewvc?view=revision&revision=1167537 Patch contribtued by Armin Le-Grand: Changed various aspects concerning usages of old vendor names http://svn.apache.org/viewvc?view=revision&revision=1293313 fix for neon webdav, remove coinmp bits, improve odk script, cleanup & remove OS/2 conditionals, system ucpp fixes, remove OS/2 conditionals, restore our license filenames.
2012-11-06 12:12:33 +00:00
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* 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 .
*/
2000-09-18 16:07:07 +00:00
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/awt/Rectangle.hpp>
#include <comphelper/processfactory.hxx>
#include <unotools/misccfg.hxx>
#include <officecfg/Office/Common.hxx>
2000-09-18 16:07:07 +00:00
#include <string.h>
#include <limits.h>
#include <svsys.h>
#include <rtl/string.h>
#include <rtl/ustring.h>
#include <osl/module.h>
2000-09-18 16:07:07 +00:00
#include <tools/debug.hxx>
#include <o3tl/enumarray.hxx>
2000-09-18 16:07:07 +00:00
#include <vcl/sysdata.hxx>
#include <vcl/timer.hxx>
#include <vcl/settings.hxx>
#include <vcl/keycodes.hxx>
#include <vcl/window.hxx>
#include <vcl/wrkwin.hxx>
#include <vcl/svapp.hxx>
// Warning in SDK header
#ifdef _MSC_VER
#pragma warning( disable: 4242 )
#endif
#include <win/wincomp.hxx>
#include <win/salids.hrc>
#include <win/saldata.hxx>
#include <win/salinst.h>
#include <win/salbmp.h>
#include <win/salgdi.h>
#include <win/salsys.h>
#include <win/salframe.h>
#include <win/salvd.h>
#include <win/salmenu.h>
#include <win/salobj.h>
#include <win/saltimer.h>
#include <impbmp.hxx>
#include <window.h>
#include <sallayout.hxx>
2002-05-08 10:09:33 +00:00
#define COMPILE_MULTIMON_STUBS
#pragma warning(push)
#pragma warning(disable:4996)
2002-05-08 10:09:33 +00:00
#include <multimon.h>
#pragma warning(pop)
#include <vector>
#ifdef __MINGW32__
#include <algorithm>
using ::std::max;
#endif
2002-05-08 10:09:33 +00:00
#include <com/sun/star/uno/Exception.hpp>
#include <oleacc.h>
#include <com/sun/star/accessibility/XMSAAService.hpp>
#ifndef WM_GETOBJECT // TESTME does this ever happen ?
# define WM_GETOBJECT 0x003D
#endif
#include <time.h>
#if defined ( __MINGW32__ )
#include <sehandler.hxx>
#endif
#include <windows.h>
#include <shobjidl.h>
#include <propkey.h>
#include <propvarutil.h>
#include <shellapi.h>
2011-01-13 15:07:15 +01:00
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::beans;
#ifndef SPI_GETWHEELSCROLLCHARS
# define SPI_GETWHEELSCROLLCHARS 0x006C
#endif
#ifndef SPI_SETWHEELSCROLLCHARS
# define SPI_SETWHEELSCROLLCHARS 0x006D
#endif
#ifndef WM_MOUSEHWHEEL
# define WM_MOUSEHWHEEL 0x020E
#endif
#ifndef IDC_PEN
# define IDC_PEN MAKEINTRESOURCE(32631)
#endif
const unsigned int WM_USER_SYSTEM_WINDOW_ACTIVATED = RegisterWindowMessageA("SYSTEM_WINDOW_ACTIVATED");
2002-11-27 16:16:23 +00:00
bool WinSalFrame::mbInReparent = FALSE;
2000-09-18 16:07:07 +00:00
// Macros for support of WM_UNICHAR & Keyman 6.0
//#define Uni_UTF32ToSurrogate1(ch) (((unsigned long) (ch) - 0x10000) / 0x400 + 0xD800)
#define Uni_UTF32ToSurrogate2(ch) (((unsigned long) (ch) - 0x10000) % 0x400 + 0xDC00)
#define Uni_SupplementaryPlanesStart 0x10000
static void UpdateFrameGeometry( HWND hWnd, WinSalFrame* pFrame );
static void SetMaximizedFrameGeometry( HWND hWnd, WinSalFrame* pFrame, RECT* pParentRect = NULL );
2000-09-18 16:07:07 +00:00
static void ImplSaveFrameState( WinSalFrame* pFrame )
2000-09-18 16:07:07 +00:00
{
// save position, size and state for GetWindowState()
if ( !pFrame->mbFullScreen )
2000-09-18 16:07:07 +00:00
{
bool bVisible = (GetWindowStyle( pFrame->mhWnd ) & WS_VISIBLE) != 0;
if ( IsIconic( pFrame->mhWnd ) )
2000-09-18 16:07:07 +00:00
{
pFrame->maState.mnState |= WINDOWSTATE_STATE_MINIMIZED;
2000-09-18 16:07:07 +00:00
if ( bVisible )
pFrame->mnShowState = SW_SHOWMAXIMIZED;
2000-09-18 16:07:07 +00:00
}
else if ( IsZoomed( pFrame->mhWnd ) )
2000-09-18 16:07:07 +00:00
{
pFrame->maState.mnState &= ~WINDOWSTATE_STATE_MINIMIZED;
pFrame->maState.mnState |= WINDOWSTATE_STATE_MAXIMIZED;
2000-09-18 16:07:07 +00:00
if ( bVisible )
pFrame->mnShowState = SW_SHOWMAXIMIZED;
pFrame->mbRestoreMaximize = TRUE;
WINDOWPLACEMENT aPlacement;
aPlacement.length = sizeof(aPlacement);
if( GetWindowPlacement( pFrame->mhWnd, &aPlacement ) )
{
RECT aRect = aPlacement.rcNormalPosition;
RECT aRect2 = aRect;
AdjustWindowRectEx( &aRect2, GetWindowStyle( pFrame->mhWnd ),
FALSE, GetWindowExStyle( pFrame->mhWnd ) );
long nTopDeco = abs( aRect.top - aRect2.top );
long nLeftDeco = abs( aRect.left - aRect2.left );
long nBottomDeco = abs( aRect.bottom - aRect2.bottom );
long nRightDeco = abs( aRect.right - aRect2.right );
pFrame->maState.mnX = aRect.left + nLeftDeco;
pFrame->maState.mnY = aRect.top + nTopDeco;
pFrame->maState.mnWidth = aRect.right - aRect.left - nLeftDeco - nRightDeco;
pFrame->maState.mnHeight = aRect.bottom - aRect.top - nTopDeco - nBottomDeco;
}
2000-09-18 16:07:07 +00:00
}
else
{
RECT aRect;
GetWindowRect( pFrame->mhWnd, &aRect );
// to be consistent with Unix, the frame state is without(!) decoration
RECT aRect2 = aRect;
AdjustWindowRectEx( &aRect2, GetWindowStyle( pFrame->mhWnd ),
FALSE, GetWindowExStyle( pFrame->mhWnd ) );
long nTopDeco = abs( aRect.top - aRect2.top );
long nLeftDeco = abs( aRect.left - aRect2.left );
long nBottomDeco = abs( aRect.bottom - aRect2.bottom );
long nRightDeco = abs( aRect.right - aRect2.right );
pFrame->maState.mnState &= ~(WINDOWSTATE_STATE_MINIMIZED | WINDOWSTATE_STATE_MAXIMIZED);
// subtract decoration
pFrame->maState.mnX = aRect.left+nLeftDeco;
pFrame->maState.mnY = aRect.top+nTopDeco;
pFrame->maState.mnWidth = aRect.right-aRect.left-nLeftDeco-nRightDeco;
pFrame->maState.mnHeight = aRect.bottom-aRect.top-nTopDeco-nBottomDeco;
2000-09-18 16:07:07 +00:00
if ( bVisible )
pFrame->mnShowState = SW_SHOWNORMAL;
pFrame->mbRestoreMaximize = FALSE;
2000-09-18 16:07:07 +00:00
}
}
}
2002-11-20 16:15:33 +00:00
// if pParentRect is set, the workarea of the monitor that contains pParentRect is returned
void ImplSalGetWorkArea( HWND hWnd, RECT *pRect, const RECT *pParentRect )
2002-05-08 10:09:33 +00:00
{
// check if we or our parent is fullscreen, then the taskbar should be ignored
bool bIgnoreTaskbar = false;
WinSalFrame* pFrame = GetWindowPtr( hWnd );
if( pFrame )
{
vcl::Window *pWin = pFrame->GetWindow();
while( pWin )
{
WorkWindow *pWorkWin = (pWin->GetType() == WINDOW_WORKWINDOW) ? (WorkWindow *) pWin : NULL;
if( pWorkWin && pWorkWin->ImplGetWindowImpl()->mbReallyVisible && pWorkWin->IsFullScreenMode() )
{
bIgnoreTaskbar = true;
break;
}
else
pWin = pWin->ImplGetWindowImpl()->mpParent;
}
}
2011-06-18 18:36:57 +02:00
// calculates the work area taking multiple monitors into account
static int nMonitors = GetSystemMetrics( SM_CMONITORS );
if( nMonitors == 1 )
2002-05-08 10:09:33 +00:00
{
2011-06-18 18:36:57 +02:00
if( bIgnoreTaskbar )
{
2011-06-18 18:36:57 +02:00
pRect->left = pRect->top = 0;
pRect->right = GetSystemMetrics( SM_CXSCREEN );
pRect->bottom = GetSystemMetrics( SM_CYSCREEN );
2002-05-08 10:09:33 +00:00
}
2011-06-18 18:36:57 +02:00
else
SystemParametersInfo( SPI_GETWORKAREA, 0, pRect, 0 );
2002-05-08 10:09:33 +00:00
}
2011-06-18 18:36:57 +02:00
else
2002-05-08 10:09:33 +00:00
{
2011-06-18 18:36:57 +02:00
if( pParentRect != NULL )
{
2011-06-18 18:36:57 +02:00
// return the size of the monitor where pParentRect lives
HMONITOR hMonitor;
MONITORINFO mi;
// get the nearest monitor to the passed rect.
hMonitor = MonitorFromRect(pParentRect, MONITOR_DEFAULTTONEAREST);
// get the work area or entire monitor rect.
mi.cbSize = sizeof(mi);
GetMonitorInfo(hMonitor, &mi);
if( !bIgnoreTaskbar )
*pRect = mi.rcWork;
else
2011-06-18 18:36:57 +02:00
*pRect = mi.rcMonitor;
}
2002-05-08 10:09:33 +00:00
else
{
2011-06-18 18:36:57 +02:00
// return the union of all monitors
pRect->left = GetSystemMetrics( SM_XVIRTUALSCREEN );
pRect->top = GetSystemMetrics( SM_YVIRTUALSCREEN );
pRect->right = pRect->left + GetSystemMetrics( SM_CXVIRTUALSCREEN );
pRect->bottom = pRect->top + GetSystemMetrics( SM_CYVIRTUALSCREEN );
// virtualscreen does not take taskbar into account, so use the corresponding
// diffs between screen and workarea from the default screen
// however, this is still not perfect: the taskbar might not be on the primary screen
if( !bIgnoreTaskbar )
2002-11-20 16:15:33 +00:00
{
2011-06-18 18:36:57 +02:00
RECT wRect, scrRect;
SystemParametersInfo( SPI_GETWORKAREA, 0, &wRect, 0 );
scrRect.left = 0;
scrRect.top = 0;
scrRect.right = GetSystemMetrics( SM_CXSCREEN );
scrRect.bottom = GetSystemMetrics( SM_CYSCREEN );
pRect->left += wRect.left;
pRect->top += wRect.top;
pRect->right -= scrRect.right - wRect.right;
pRect->bottom -= scrRect.bottom - wRect.bottom;
}
2002-05-08 10:09:33 +00:00
}
}
}
SalFrame* ImplSalCreateFrame( WinSalInstance* pInst,
HWND hWndParent, sal_uLong nSalFrameStyle )
2000-09-18 16:07:07 +00:00
{
WinSalFrame* pFrame = new WinSalFrame;
2000-09-18 16:07:07 +00:00
HWND hWnd;
DWORD nSysStyle = 0;
DWORD nExSysStyle = 0;
bool bSubFrame = FALSE;
2000-09-18 16:07:07 +00:00
static const char* pEnvSynchronize = getenv("SAL_SYNCHRONIZE");
if ( pEnvSynchronize ) // no buffering of drawing commands
GdiSetBatchLimit( 1 );
static const char* pEnvTransparentFloats = getenv("SAL_TRANSPARENT_FLOATS" );
2000-09-18 16:07:07 +00:00
// determine creation data
if ( nSalFrameStyle & (SAL_FRAME_STYLE_PLUG | SAL_FRAME_STYLE_SYSTEMCHILD) )
{
2000-09-18 16:07:07 +00:00
nSysStyle |= WS_CHILD;
if( nSalFrameStyle & SAL_FRAME_STYLE_SYSTEMCHILD )
nSysStyle |= WS_CLIPSIBLINGS;
}
2000-09-18 16:07:07 +00:00
else
{
// #i87402# commenting out WS_CLIPCHILDREN
// this breaks SAL_FRAME_STYLE_SYSTEMCHILD handling, which is not
// used currently. Probably SAL_FRAME_STYLE_SYSTEMCHILD should be
// removed again.
// nSysStyle |= WS_CLIPCHILDREN;
if ( hWndParent )
{
nSysStyle |= WS_POPUP;
bSubFrame = TRUE;
pFrame->mbNoIcon = TRUE;
}
else
{
// Only with WS_OVRLAPPED we get a useful default position/size
if ( (nSalFrameStyle & (SAL_FRAME_STYLE_SIZEABLE | SAL_FRAME_STYLE_MOVEABLE)) ==
(SAL_FRAME_STYLE_SIZEABLE | SAL_FRAME_STYLE_MOVEABLE) )
nSysStyle |= WS_OVERLAPPED;
else
2002-11-20 16:15:33 +00:00
{
nSysStyle |= WS_POPUP;
if ( !(nSalFrameStyle & SAL_FRAME_STYLE_MOVEABLE) )
nExSysStyle |= WS_EX_TOOLWINDOW; // avoid taskbar appearance, for eg splash screen
2002-11-20 16:15:33 +00:00
}
}
if ( nSalFrameStyle & SAL_FRAME_STYLE_MOVEABLE )
{
pFrame->mbCaption = TRUE;
nSysStyle |= WS_SYSMENU | WS_CAPTION;
if ( !hWndParent )
nSysStyle |= WS_SYSMENU | WS_MINIMIZEBOX;
else
nExSysStyle |= WS_EX_DLGMODALFRAME;
if ( nSalFrameStyle & SAL_FRAME_STYLE_SIZEABLE )
{
pFrame->mbSizeBorder = TRUE;
nSysStyle |= WS_THICKFRAME;
if ( !hWndParent )
nSysStyle |= WS_MAXIMIZEBOX;
}
else
pFrame->mbFixBorder = TRUE;
if ( nSalFrameStyle & SAL_FRAME_STYLE_DEFAULT )
nExSysStyle |= WS_EX_APPWINDOW;
}
if( nSalFrameStyle & SAL_FRAME_STYLE_TOOLWINDOW
2002-07-11 06:43:29 +00:00
// #100656# toolwindows lead to bad alt-tab behaviour, if they have the focus
// you must press it twice to leave the application
// so toolwindows are only used for non sizeable windows
// which are typically small, so a small caption makes sense
// #103578# looked too bad - above changes reverted
/* && !(nSalFrameStyle & SAL_FRAME_STYLE_SIZEABLE) */ )
{
pFrame->mbNoIcon = TRUE;
nExSysStyle |= WS_EX_TOOLWINDOW;
2011-07-06 20:58:09 +03:00
if ( pEnvTransparentFloats /*&& !(nSalFrameStyle & SAL_FRAME_STYLE_MOVEABLE) */)
nExSysStyle |= WS_EX_LAYERED;
}
}
2001-10-24 07:57:18 +00:00
if ( nSalFrameStyle & SAL_FRAME_STYLE_FLOAT )
{
nExSysStyle |= WS_EX_TOOLWINDOW;
pFrame->mbFloatWin = TRUE;
2011-07-06 20:58:09 +03:00
if ( (pEnvTransparentFloats /* does not work remote! || (nSalFrameStyle & SAL_FRAME_STYLE_FLOAT_FOCUSABLE) */ ) )
nExSysStyle |= WS_EX_LAYERED;
2001-10-24 07:57:18 +00:00
}
CWS-TOOLING: integrate CWS impressnotes01 2009-09-11 13:52:41 +0200 cl r276061 : CWS-TOOLING: rebase CWS impressnotes01 to trunk@276043 (milestone: DEV300:m58) 2009-09-10 15:44:57 +0200 cl r276039 : #i103139# continued work on the impress annotation feature 2009-09-10 14:52:31 +0200 cl r276032 : #i103139# continued work on the impress annotation feature 2009-09-10 14:50:32 +0200 cl r276031 : #i103139# continued work on the impress annotation feature 2009-09-10 14:48:29 +0200 cl r276030 : #i103139# continued work on the impress annotation feature 2009-09-10 11:36:11 +0200 cl r276027 : #i103139# continued work on the impress annotation feature 2009-09-09 20:22:41 +0200 cl r276018 : #i103139# continued work on the impress annotation feature 2009-09-09 20:21:45 +0200 cl r276017 : #i103139# continued work on the impress annotation feature 2009-09-09 19:32:29 +0200 sj r276015 : #i103139# added import of comments (ppt binary) 2009-09-09 19:31:07 +0200 sj r276014 : #i103139# added import of comments (ppt binary) 2009-09-09 19:16:41 +0200 cl r276011 : #i103139# continued work on the impress annotation feature 2009-09-09 19:15:19 +0200 cl r276010 : #i103139# continued work on the impress annotation feature 2009-09-09 16:27:19 +0200 cl r276001 : #i104579# fixed isEmptyPresObj() 2009-09-09 15:12:02 +0200 cl r275997 : #i103139# continued work on the impress annotation feature 2009-09-09 15:06:29 +0200 sj r275996 : #i103139# added import of comments (ppt binary) 2009-09-09 14:53:01 +0200 cl r275995 : #i103139# continued work on the impress annotation feature 2009-09-09 14:51:32 +0200 cl r275994 : #i103139# continued work on the impress annotation feature 2009-09-09 12:11:17 +0200 cl r275982 : #i103139# continued work on the impress annotation feature 2009-09-09 11:47:55 +0200 cl r275981 : #i103139# continued work on the impress annotation feature 2009-09-09 11:47:23 +0200 cl r275980 : #i103139# continued work on the impress annotation feature 2009-09-09 11:44:47 +0200 cl r275978 : #i104315# added missing tab pages 2009-09-08 16:04:44 +0200 cl r275936 : #i103139# continued work on the impress annotation feature 2009-09-08 16:03:28 +0200 cl r275935 : #i103139# continued work on the impress annotation feature 2009-09-08 11:45:47 +0200 cl r275920 : #i103139# continued work on the impress annotation feature 2009-09-08 11:41:51 +0200 cl r275919 : #i103139# continued work on the impress annotation feature 2009-09-07 18:30:55 +0200 cl r275910 : #i103139# continued work on the impress annotation feature 2009-09-07 18:29:37 +0200 cl r275909 : #i103139# continued work on the impress annotation feature 2009-09-07 17:25:43 +0200 cl r275905 : #i103139# continued work on the impress annotation feature 2009-09-07 12:00:28 +0200 cl r275884 : #i103139# continued work on the impress annotation feature 2009-09-06 14:14:00 +0200 cl r275859 : #i103139# continued work on the impress annotation feature 2009-09-05 20:57:24 +0200 cl r275854 : #i103139# continued work on the impress annotation feature 2009-09-05 20:56:29 +0200 cl r275853 : #i103139# continued work on the impress annotation feature 2009-09-05 20:55:27 +0200 cl r275852 : #i103139# continued work on the impress annotation feature 2009-09-05 20:11:42 +0200 cl r275851 : #i103139# continued work on the impress annotation feature 2009-09-05 20:11:09 +0200 cl r275850 : #i103139# continued work on the impress annotation feature 2009-09-05 17:43:33 +0200 cl r275845 : #i103139# continued work on the impress annotation feature 2009-09-05 17:04:41 +0200 cl r275843 : #i103139# continued work on the impress annotation feature 2009-09-05 17:03:26 +0200 cl r275842 : #i103139# continued work on the impress annotation feature 2009-09-05 17:02:53 +0200 cl r275841 : #i103139# continued work on the impress annotation feature 2009-09-05 13:15:04 +0200 pl r275839 : #i104823# WB_NEEDSFOCUS 2009-09-05 13:14:41 +0200 pl r275838 : #i104823# WB_NEEDSFOCUS 2009-09-04 17:48:21 +0200 cl r275826 : #i103139# continued work on the impress annotation feature 2009-09-04 17:35:03 +0200 cl r275825 : #i103139# continued work on the impress annotation feature 2009-09-04 17:15:46 +0200 cl r275824 : #i103139# continued work on the impress annotation feature 2009-09-04 17:12:54 +0200 cl r275823 : #i103139# continued work on the impress annotation feature 2009-09-04 17:05:23 +0200 cl r275822 : #i103139# continued work on the impress annotation feature 2009-09-04 16:48:28 +0200 cl r275820 : #i103139# continued work on the impress annotation feature 2009-09-04 16:44:02 +0200 cl r275818 : #i103139# continued work on the impress annotation feature 2009-09-04 16:43:23 +0200 cl r275817 : #i103139# continued work on the impress annotation feature 2009-09-04 16:06:04 +0200 cl r275812 : #i103139# continued work on the impress annotation feature 2009-09-04 16:05:45 +0200 cl r275811 : #i103139# continued work on the impress annotation feature 2009-09-04 15:04:33 +0200 cl r275806 : #i103139# continued work on the impress annotation feature 2009-09-04 11:43:14 +0200 cl r275795 : #i103139# continued work on the impress annotation feature 2009-09-04 11:27:10 +0200 cl r275793 : #i103139# continued work on the impress annotation feature 2009-09-04 11:10:02 +0200 cl r275792 : #i103139# continued work on the impress annotation feature 2009-09-04 11:07:05 +0200 cl r275790 : #i103139# continued work on the impress annotation feature 2009-09-04 11:05:01 +0200 cl r275789 : #i103139# continued work on the impress annotation feature 2009-09-04 10:55:51 +0200 cl r275785 : #i103139# renamed notes to comments 2009-09-04 10:54:57 +0200 cl r275784 : #i103139# renamed notes to comments 2009-09-03 20:37:35 +0200 cl r275772 : #i103139# continued work on the impress annotation feature 2009-09-03 20:35:31 +0200 cl r275771 : #i103139# continued work on the impress annotation feature 2009-09-01 18:17:55 +0200 cl r275680 : #i103139# continued work on the impress annotation feature 2009-09-01 18:15:08 +0200 cl r275678 : #i103139# continued work on the impress annotation feature 2009-09-01 18:13:38 +0200 cl r275677 : #i103139# continued work on the impress annotation feature 2009-08-18 12:35:42 +0200 cl r275089 : fixed merge error 2009-08-18 11:39:58 +0200 cl r275086 : CWS-TOOLING: rebase CWS impressnotes01 to trunk@275001 (milestone: DEV300:m55) 2009-07-30 13:45:10 +0200 cl r274481 : fixed merge errrors 2009-07-30 13:41:21 +0200 cl r274480 : fixed merge errrors 2009-07-30 13:39:40 +0200 cl r274478 : fixed merge errrors 2009-07-22 18:07:30 +0200 cl r274256 : CWS-TOOLING: rebase CWS impressnotes01 to trunk@273858 (milestone: DEV300:m52) 2009-07-21 17:21:31 +0200 cl r274208 : merging 2009-07-20 14:28:34 +0200 cl r274137 : #i103139# annotation support for impress 2009-07-20 14:28:04 +0200 cl r274136 : #i103139# annotation support for impress 2009-07-20 14:27:20 +0200 cl r274135 : #i103139# annotation support for impress 2009-07-20 14:21:17 +0200 cl r274134 : #i103139# annotation support for impress 2009-07-20 14:20:56 +0200 cl r274133 : #i103139# annotation support for impress 2009-07-20 14:20:09 +0200 cl r274132 : #i103139# annotation support for impress 2009-07-20 14:19:00 +0200 cl r274131 : #i103139# annotation support for impress 2009-07-20 14:17:50 +0200 cl r274130 : #i103139# annotation support for impress 2009-07-20 14:12:24 +0200 cl r274129 : #i103139# annotation support for impress 2009-07-20 13:52:03 +0200 cl r274128 : #i103139# annotation support for impress 2009-07-20 13:51:11 +0200 cl r274127 : #i103139# annotation support for impress 2009-07-20 13:48:59 +0200 cl r274126 : #i103139# annotation support for impress 2009-07-20 13:43:56 +0200 cl r274125 : #i103139# annotation support for impress 2009-07-20 13:31:55 +0200 cl r274123 : #i103139# annotation support for impress 2009-07-20 13:30:45 +0200 cl r274122 : #i103139# annotation support for impress
2009-09-16 13:55:36 +00:00
if( (nSalFrameStyle & SAL_FRAME_STYLE_TOOLTIP) || (nSalFrameStyle & SAL_FRAME_STYLE_FLOAT_FOCUSABLE) )
nExSysStyle |= WS_EX_TOPMOST;
2000-09-18 16:07:07 +00:00
// init frame data
pFrame->mnStyle = nSalFrameStyle;
2000-09-18 16:07:07 +00:00
// determine show style
pFrame->mnShowState = SW_SHOWNORMAL;
if ( (nSysStyle & (WS_POPUP | WS_MAXIMIZEBOX | WS_THICKFRAME)) == (WS_MAXIMIZEBOX | WS_THICKFRAME) )
2000-09-18 16:07:07 +00:00
{
if ( GetSystemMetrics( SM_CXSCREEN ) <= 1024 )
pFrame->mnShowState = SW_SHOWMAXIMIZED;
2000-09-18 16:07:07 +00:00
else
{
if ( nSalFrameStyle & SAL_FRAME_STYLE_DEFAULT )
{
SalData* pSalData = GetSalData();
pFrame->mnShowState = pSalData->mnCmdShow;
if ( (pFrame->mnShowState != SW_SHOWMINIMIZED) &&
(pFrame->mnShowState != SW_MINIMIZE) &&
(pFrame->mnShowState != SW_SHOWMINNOACTIVE) )
{
if ( (pFrame->mnShowState == SW_SHOWMAXIMIZED) ||
(pFrame->mnShowState == SW_MAXIMIZE) )
pFrame->mbOverwriteState = FALSE;
pFrame->mnShowState = SW_SHOWMAXIMIZED;
}
else
pFrame->mbOverwriteState = FALSE;
}
else
{
// Document Windows are also maximized, if the current Document Window
// is also maximized
HWND hWnd2 = GetForegroundWindow();
if ( hWnd2 && IsMaximized( hWnd2 ) &&
(GetWindowInstance( hWnd2 ) == pInst->mhInst) &&
((GetWindowStyle( hWnd2 ) & (WS_POPUP | WS_MAXIMIZEBOX | WS_THICKFRAME)) == (WS_MAXIMIZEBOX | WS_THICKFRAME)) )
pFrame->mnShowState = SW_SHOWMAXIMIZED;
}
}
}
2000-09-18 16:07:07 +00:00
// create frame
2011-01-24 04:00:57 +02:00
LPCWSTR pClassName;
if ( bSubFrame )
2000-09-18 16:07:07 +00:00
{
2011-01-24 04:00:57 +02:00
if ( nSalFrameStyle & (SAL_FRAME_STYLE_MOVEABLE|SAL_FRAME_STYLE_NOSHADOW) ) // check if shadow not wanted
pClassName = SAL_SUBFRAME_CLASSNAMEW;
2000-09-18 16:07:07 +00:00
else
2011-01-24 04:00:57 +02:00
pClassName = SAL_TMPSUBFRAME_CLASSNAMEW; // undecorated floaters will get shadow on XP
2000-09-18 16:07:07 +00:00
}
else
{
2011-01-24 04:00:57 +02:00
if ( nSalFrameStyle & SAL_FRAME_STYLE_MOVEABLE )
pClassName = SAL_FRAME_CLASSNAMEW;
2000-09-18 16:07:07 +00:00
else
2011-01-24 04:00:57 +02:00
pClassName = SAL_TMPSUBFRAME_CLASSNAMEW;
2000-09-18 16:07:07 +00:00
}
2011-01-24 04:00:57 +02:00
hWnd = CreateWindowExW( nExSysStyle, pClassName, L"", nSysStyle,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
hWndParent, 0, pInst->mhInst, (void*)pFrame );
if( !hWnd )
ImplWriteLastError( GetLastError(), "CreateWindowEx" );
#if OSL_DEBUG_LEVEL > 1
// set transparency value
2011-07-06 20:58:09 +03:00
if( GetWindowExStyle( hWnd ) & WS_EX_LAYERED )
SetLayeredWindowAttributes( hWnd, 0, 230, 0x00000002 /*LWA_ALPHA*/ );
2011-01-24 04:00:57 +02:00
#endif
2000-09-18 16:07:07 +00:00
if ( !hWnd )
{
delete pFrame;
return NULL;
}
// If we have an Window with an Caption Bar and without
// an MaximizeBox, we change the SystemMenu
if ( (nSysStyle & (WS_CAPTION | WS_MAXIMIZEBOX)) == (WS_CAPTION) )
{
HMENU hSysMenu = GetSystemMenu( hWnd, FALSE );
if ( hSysMenu )
{
if ( !(nSysStyle & (WS_MINIMIZEBOX | WS_MAXIMIZEBOX)) )
DeleteMenu( hSysMenu, SC_RESTORE, MF_BYCOMMAND );
else
EnableMenuItem( hSysMenu, SC_RESTORE, MF_BYCOMMAND | MF_GRAYED | MF_DISABLED );
if ( !(nSysStyle & WS_MINIMIZEBOX) )
DeleteMenu( hSysMenu, SC_MINIMIZE, MF_BYCOMMAND );
if ( !(nSysStyle & WS_MAXIMIZEBOX) )
DeleteMenu( hSysMenu, SC_MAXIMIZE, MF_BYCOMMAND );
if ( !(nSysStyle & WS_THICKFRAME) )
DeleteMenu( hSysMenu, SC_SIZE, MF_BYCOMMAND );
}
}
if ( (nSysStyle & WS_SYSMENU) && !(nSalFrameStyle & SAL_FRAME_STYLE_CLOSEABLE) )
2000-09-18 16:07:07 +00:00
{
HMENU hSysMenu = GetSystemMenu( hWnd, FALSE );
if ( hSysMenu )
EnableMenuItem( hSysMenu, SC_CLOSE, MF_BYCOMMAND | MF_GRAYED | MF_DISABLED );
2000-09-18 16:07:07 +00:00
}
// reset input context
pFrame->mhDefIMEContext = ImmAssociateContext( hWnd, 0 );
2000-09-18 16:07:07 +00:00
// determine output size and state
RECT aRect;
GetClientRect( hWnd, &aRect );
pFrame->mnWidth = aRect.right;
pFrame->mnHeight = aRect.bottom;
2000-09-18 16:07:07 +00:00
ImplSaveFrameState( pFrame );
pFrame->mbDefPos = TRUE;
2000-09-18 16:07:07 +00:00
UpdateFrameGeometry( hWnd, pFrame );
2002-01-17 15:11:18 +00:00
if( pFrame->mnShowState == SW_SHOWMAXIMIZED )
2002-01-17 15:11:18 +00:00
{
// #96084 set a useful internal window size because
// the window will not be maximized (and the size updated) before show()
SetMaximizedFrameGeometry( hWnd, pFrame );
2002-01-17 15:11:18 +00:00
}
2000-09-18 16:07:07 +00:00
return pFrame;
}
// helper that only creates the HWND
// to allow for easy reparenting of system windows, (i.e. destroy and create new)
HWND ImplSalReCreateHWND( HWND hWndParent, HWND oldhWnd, bool bAsChild )
{
HINSTANCE hInstance = GetSalData()->mhInst;
Merge commit 'ooo/DEV300_m101' into intm101 The following builds for me: basebmp, basegfx, comphelper, dtrans, i18npool, i18nutil, l10ntools, o3tl, psprint_config, regexp, rsc, sax, sot, tools, ucbhelper, unotools, vcl The rest still needs fixing ;-) Conflicts: canvas/prj/build.lst canvas/source/cairo/cairo_textlayout.cxx canvas/source/directx/dx_winstuff.hxx canvas/source/tools/image.cxx canvas/source/vcl/canvashelper.cxx comphelper/inc/comphelper/documentconstants.hxx comphelper/inc/comphelper/optionalvalue.hxx comphelper/inc/comphelper/querydeep.hxx comphelper/prj/build.lst comphelper/qa/complex/makefile.mk comphelper/qa/string/test_string_noadditional.cxx comphelper/source/misc/componentmodule.cxx comphelper/source/misc/mimeconfighelper.cxx comphelper/source/misc/querydeep.cxx comphelper/source/misc/uieventslogger.cxx comphelper/source/property/TypeGeneration.cxx comphelper/test/uno_iterators/uno_iterators.cxx comphelper/util/makefile.mk cppcanvas/source/mtfrenderer/implrenderer.cxx dtrans/prj/build.lst dtrans/source/generic/dtrans.cxx dtrans/source/win32/dtobj/FmtFilter.cxx i18npool/prj/build.lst i18npool/source/localedata/data/localedata_others.map i18npool/source/localedata/data/makefile.mk i18npool/source/localedata/localedata.cxx i18npool/source/localedata/saxparser.cxx i18npool/source/registerservices/registerservices.cxx i18npool/source/search/textsearch.cxx l10ntools/inc/cfgmerge.hxx l10ntools/inc/export.hxx l10ntools/inc/gsicheck.hxx l10ntools/inc/l10ntools/vosapp.hxx l10ntools/inc/tagtest.hxx l10ntools/inc/xmlparse.hxx l10ntools/layout/layoutparse.cxx l10ntools/layout/tralay.cxx l10ntools/source/cfgmerge.cxx l10ntools/source/export.cxx l10ntools/source/export2.cxx l10ntools/source/gsicheck.cxx l10ntools/source/help/HelpLinker.cxx l10ntools/source/lngex.cxx l10ntools/source/lngmerge.cxx l10ntools/source/merge.cxx l10ntools/source/tagtest.cxx l10ntools/source/xmlparse.cxx padmin/source/fontentry.cxx padmin/source/padialog.cxx padmin/source/padialog.src padmin/source/pamain.cxx rsc/inc/rscarray.hxx rsc/inc/rscclass.hxx rsc/inc/rscclobj.hxx rsc/inc/rsccont.hxx rsc/inc/rscdb.hxx rsc/inc/rscdef.hxx rsc/inc/rscmgr.hxx rsc/inc/rscrange.hxx rsc/inc/rsctop.hxx rsc/inc/vclrsc.hxx rsc/source/parser/rscdb.cxx rsc/source/parser/rscicpx.cxx rsc/source/parser/rscinit.cxx rsc/source/prj/start.cxx rsc/source/res/rscarray.cxx rsc/source/res/rscclass.cxx rsc/source/res/rscclobj.cxx rsc/source/res/rsccont.cxx rsc/source/res/rscmgr.cxx rsc/source/res/rscrange.cxx rsc/source/res/rsctop.cxx rsc/source/rsc/rsc.cxx rsc/source/tools/rscdef.cxx rsc/source/tools/rsctools.cxx sax/source/expatwrap/sax_expat.cxx sax/source/fastparser/facreg.cxx sax/source/tools/fastserializer.cxx sot/inc/sot/filelist.hxx sot/inc/sot/object.hxx sot/source/base/factory.cxx sot/source/base/filelist.cxx sot/source/sdstor/stg.cxx sot/source/sdstor/stgcache.cxx sot/source/sdstor/stgole.cxx sot/source/sdstor/stgstrms.cxx sot/source/sdstor/storage.cxx sot/source/sdstor/ucbstorage.cxx svl/inc/svl/cenumitm.hxx svl/inc/svl/cintitem.hxx svl/inc/svl/cntwall.hxx svl/inc/svl/ctypeitm.hxx svl/inc/svl/custritm.hxx svl/inc/svl/dateitem.hxx svl/inc/svl/filerec.hxx svl/inc/svl/globalnameitem.hxx svl/inc/svl/ilstitem.hxx svl/inc/svl/imageitm.hxx svl/inc/svl/intitem.hxx svl/inc/svl/itempool.hxx svl/inc/svl/itemset.hxx svl/inc/svl/lckbitem.hxx svl/inc/svl/poolitem.hxx svl/inc/svl/ptitem.hxx svl/inc/svl/rectitem.hxx svl/inc/svl/sfontitm.hxx svl/inc/svl/slstitm.hxx svl/inc/svl/srchitem.hxx svl/inc/svl/svarray.hxx svl/inc/svl/svdde.hxx svl/inc/svl/svstdarr.hxx svl/inc/svl/szitem.hxx svl/inc/svl/visitem.hxx svl/inc/svl/zforlist.hxx svl/inc/svl/zformat.hxx svl/prj/build.lst svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx svl/qa/complex/ConfigItems/helper/makefile.mk svl/qa/makefile.mk svl/source/filepicker/pickerhelper.cxx svl/source/filerec/filerec.cxx svl/source/items/cenumitm.cxx svl/source/items/cintitem.cxx svl/source/items/cntwall.cxx svl/source/items/ctypeitm.cxx svl/source/items/custritm.cxx svl/source/items/dateitem.cxx svl/source/items/globalnameitem.cxx svl/source/items/ilstitem.cxx svl/source/items/imageitm.cxx svl/source/items/intitem.cxx svl/source/items/itempool.cxx svl/source/items/itemprop.cxx svl/source/items/itemset.cxx svl/source/items/lckbitem.cxx svl/source/items/poolio.cxx svl/source/items/poolitem.cxx svl/source/items/ptitem.cxx svl/source/items/rectitem.cxx svl/source/items/slstitm.cxx svl/source/items/srchitem.cxx svl/source/items/style.cxx svl/source/items/szitem.cxx svl/source/items/visitem.cxx svl/source/items/whiter.cxx svl/source/memtools/svarray.cxx svl/source/misc/PasswordHelper.cxx svl/source/misc/adrparse.cxx svl/source/misc/lngmisc.cxx svl/source/notify/brdcst.cxx svl/source/notify/listener.cxx svl/source/notify/listenerbase.cxx svl/source/numbers/makefile.mk svl/source/numbers/nbdll.cxx svl/source/numbers/zforfind.cxx svl/source/numbers/zforlist.cxx svl/source/numbers/zformat.cxx svl/source/numbers/zforscan.cxx svl/source/passwordcontainer/passwordcontainer.cxx svl/source/svdde/ddecli.cxx svl/source/svdde/ddeimp.hxx svl/source/svdde/ddemlos2.h svl/source/svdde/ddesvr.cxx svl/source/undo/undo.cxx svl/source/uno/registerservices.cxx svl/util/makefile.mk svtools/bmpmaker/bmpsum.cxx svtools/bmpmaker/g2g.cxx svtools/bmpmaker/makefile.mk svtools/inc/borderhelper.hxx svtools/inc/svtools/accessiblefactory.hxx svtools/inc/svtools/apearcfg.hxx svtools/inc/svtools/brwbox.hxx svtools/inc/svtools/ctrlbox.hxx svtools/inc/svtools/ctrltool.hxx svtools/inc/svtools/editbrowsebox.hxx svtools/inc/svtools/ehdl.hxx svtools/inc/svtools/embedhlp.hxx svtools/inc/svtools/filter.hxx svtools/inc/svtools/ivctrl.hxx svtools/inc/svtools/parhtml.hxx svtools/inc/svtools/printdlg.hxx svtools/inc/svtools/rtftoken.h svtools/inc/svtools/ruler.hxx svtools/inc/svtools/svicnvw.hxx svtools/inc/svtools/svlbitm.hxx svtools/inc/svtools/svlbox.hxx svtools/inc/svtools/svtreebx.hxx svtools/inc/svtools/tabbar.hxx svtools/inc/svtools/table/abstracttablecontrol.hxx svtools/inc/svtools/taskbar.hxx svtools/inc/svtools/textview.hxx svtools/inc/svtools/valueset.hxx svtools/source/brwbox/brwbox1.cxx svtools/source/brwbox/brwbox2.cxx svtools/source/brwbox/datwin.cxx svtools/source/brwbox/datwin.hxx svtools/source/brwbox/makefile.mk svtools/source/config/apearcfg.cxx svtools/source/config/htmlcfg.cxx svtools/source/config/menuoptions.cxx svtools/source/config/miscopt.cxx svtools/source/contnr/cont_pch.cxx svtools/source/contnr/ctrdll.cxx svtools/source/contnr/fileview.cxx svtools/source/contnr/imivctl1.cxx svtools/source/contnr/ivctrl.cxx svtools/source/contnr/makefile.mk svtools/source/contnr/svcontnr.src svtools/source/contnr/svicnvw.cxx svtools/source/contnr/svimpbox.cxx svtools/source/contnr/svimpicn.cxx svtools/source/contnr/svlbitm.cxx svtools/source/contnr/svtreebx.cxx svtools/source/contnr/templwin.cxx svtools/source/contnr/templwin.hxx svtools/source/control/asynclink.cxx svtools/source/control/ctrlbox.cxx svtools/source/control/ctrldll.cxx svtools/source/control/ctrltool.cxx svtools/source/control/filectrl.cxx svtools/source/control/filectrl.src svtools/source/control/headbar.cxx svtools/source/control/inettbc.cxx svtools/source/control/makefile.mk svtools/source/control/prgsbar.cxx svtools/source/control/roadmap.cxx svtools/source/control/ruler.cxx svtools/source/control/scriptedtext.cxx svtools/source/control/stdmenu.cxx svtools/source/control/tabbar.cxx svtools/source/control/taskbar.cxx svtools/source/control/taskbox.cxx svtools/source/control/taskmisc.cxx svtools/source/control/taskstat.cxx svtools/source/control/valueacc.cxx svtools/source/control/valueset.cxx svtools/source/dialogs/addresstemplate.cxx svtools/source/dialogs/addresstemplate.src svtools/source/dialogs/colrdlg.src svtools/source/dialogs/filedlg2.cxx svtools/source/dialogs/filedlg2.hxx svtools/source/dialogs/makefile.mk svtools/source/dialogs/printdlg.cxx svtools/source/dialogs/printdlg.src svtools/source/dialogs/propctrl.cxx svtools/source/dialogs/propctrl.hxx svtools/source/dialogs/property.cxx svtools/source/edit/makefile.mk svtools/source/edit/sychconv.cxx svtools/source/edit/syntaxhighlight.cxx svtools/source/edit/textdoc.cxx svtools/source/edit/texteng.cxx svtools/source/edit/textundo.cxx svtools/source/edit/textview.cxx svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx svtools/source/filter.vcl/filter/dlgejpg.cxx svtools/source/filter.vcl/filter/dlgejpg.hxx svtools/source/filter.vcl/filter/dlgejpg.src svtools/source/filter.vcl/filter/dlgepng.cxx svtools/source/filter.vcl/filter/dlgepng.hxx svtools/source/filter.vcl/filter/dlgepng.src svtools/source/filter.vcl/filter/dlgexpor.cxx svtools/source/filter.vcl/filter/dlgexpor.hxx svtools/source/filter.vcl/filter/dlgexpor.src svtools/source/filter.vcl/filter/filter2.cxx svtools/source/filter.vcl/filter/makefile.mk svtools/source/filter.vcl/filter/sgfbram.cxx svtools/source/filter.vcl/filter/sgvmain.cxx svtools/source/filter.vcl/filter/sgvspln.cxx svtools/source/filter.vcl/filter/strings.src svtools/source/filter.vcl/jpeg/makefile.mk svtools/source/filter.vcl/wmf/emfwr.cxx svtools/source/filter.vcl/wmf/emfwr.hxx svtools/source/filter.vcl/wmf/enhwmf.cxx svtools/source/filter.vcl/wmf/winmtf.hxx svtools/source/filter.vcl/wmf/wmfwr.cxx svtools/source/filter.vcl/wmf/wmfwr.hxx svtools/source/graphic/grfcache.cxx svtools/source/graphic/grfcache.hxx svtools/source/graphic/grfmgr.cxx svtools/source/graphic/makefile.mk svtools/source/inc/accessibletableimp.hxx svtools/source/inc/svimpbox.hxx svtools/source/java/patchjavaerror.src svtools/source/misc/ehdl.cxx svtools/source/misc/errtxt.src svtools/source/misc/helpagentwindow.cxx svtools/source/misc/imagemgr.cxx svtools/source/misc/imagemgr.src svtools/source/misc/imageresourceaccess.cxx svtools/source/misc/imap.cxx svtools/source/misc/langtab.src svtools/source/misc/makefile.mk svtools/source/misc/svtdata.cxx svtools/source/misc/templatefoldercache.cxx svtools/source/misc/transfer2.cxx svtools/source/misc/undo.src svtools/source/plugapp/commtest.cxx svtools/source/plugapp/commtest.src svtools/source/plugapp/makefile.mk svtools/source/plugapp/testtool.src svtools/source/productregistration/productregistration.cxx svtools/source/svhtml/htmlkywd.cxx svtools/source/svhtml/parhtml.cxx svtools/source/svrtf/rtfkey2.cxx svtools/source/svrtf/rtfkeywd.cxx svtools/source/table/defaultinputhandler.cxx svtools/source/table/makefile.mk svtools/source/table/tablecontrol.cxx svtools/source/table/tablecontrol_impl.cxx svtools/source/table/tablecontrol_impl.hxx svtools/source/table/tabledatawindow.cxx svtools/source/table/tablegeometry.cxx svtools/source/table/tablegeometry.hxx svtools/source/toolpanel/makefile.mk svtools/source/toolpanel/toolpaneldrawer.cxx svtools/source/uno/addrtempuno.cxx svtools/source/uno/miscservices.cxx svtools/source/uno/svtxgridcontrol.cxx svtools/source/uno/svtxgridcontrol.hxx svtools/source/uno/toolboxcontroller.cxx svtools/source/uno/treecontrolpeer.cxx svtools/source/uno/unocontroltablemodel.cxx svtools/source/uno/unocontroltablemodel.hxx svtools/source/uno/unoimap.cxx svtools/source/urlobj/inetimg.cxx svtools/util/makefile.mk svtools/workben/browser.cxx svtools/workben/cui/makefile.mk svtools/workben/makefile.mk svtools/workben/stest.cxx svtools/workben/toolpanel/makefile.mk svtools/workben/urange.cxx toolkit/inc/toolkit/awt/vclxdevice.hxx toolkit/inc/toolkit/awt/vclxgraphics.hxx toolkit/inc/toolkit/awt/vclxwindows.hxx toolkit/inc/toolkit/controls/dialogcontrol.hxx toolkit/inc/toolkit/helper/property.hxx toolkit/inc/toolkit/helper/servicenames.hxx toolkit/inc/toolkit/helper/throbberimpl.hxx toolkit/qa/complex/toolkit/accessibility/_XAccessibleComponent.java toolkit/source/awt/asynccallback.cxx toolkit/source/awt/vclxgraphics.cxx toolkit/source/awt/vclxtoolkit.cxx toolkit/source/awt/vclxwindow.cxx toolkit/source/awt/xsimpleanimation.cxx toolkit/source/awt/xthrobber.cxx toolkit/source/controls/dialogcontrol.cxx toolkit/source/controls/grid/defaultgridcolumnmodel.cxx toolkit/source/controls/grid/defaultgriddatamodel.cxx toolkit/source/controls/grid/gridcontrol.cxx toolkit/source/controls/grid/initguard.hxx toolkit/source/controls/unocontrol.cxx toolkit/source/controls/unocontrolcontainer.cxx toolkit/source/controls/unocontrols.cxx toolkit/source/helper/listenermultiplexer.cxx toolkit/source/helper/property.cxx toolkit/source/helper/registerservices.cxx toolkit/source/helper/servicenames.cxx toolkit/source/helper/throbberimpl.cxx toolkit/source/helper/tkresmgr.cxx tools/StaticLibrary_ooopathutils.mk tools/bootstrp/addexes/makefile.mk tools/bootstrp/addexes2/makefile.mk tools/bootstrp/addexes2/mkfilt.cxx tools/bootstrp/command.cxx tools/bootstrp/cppdep.cxx tools/bootstrp/iserver.cxx tools/bootstrp/makefile.mk tools/bootstrp/mkcreate.cxx tools/bootstrp/prj.cxx tools/bootstrp/rscdep.cxx tools/bootstrp/sstring.cxx tools/inc/bootstrp/command.hxx tools/inc/bootstrp/mkcreate.hxx tools/inc/bootstrp/prj.hxx tools/inc/bootstrp/sstring.hxx tools/inc/tools/agapi.hxx tools/inc/tools/agitem.hxx tools/inc/tools/chapi.hxx tools/inc/tools/download.hxx tools/inc/tools/eacopier.hxx tools/inc/tools/fract.hxx tools/inc/tools/fsys.hxx tools/inc/tools/geninfo.hxx tools/inc/tools/globname.hxx tools/inc/tools/inetmime.hxx tools/inc/tools/multisel.hxx tools/inc/tools/poly.hxx tools/inc/tools/postsys.h tools/inc/tools/postwin.h tools/inc/tools/presys.h tools/inc/tools/prewin.h tools/inc/tools/pstm.hxx tools/inc/tools/ref.hxx tools/inc/tools/simplerm.hxx tools/inc/tools/solar.h tools/inc/tools/table.hxx tools/inc/tools/urlkeys.hxx tools/inc/tools/urlobj.hxx tools/prj/build.lst tools/prj/d.lst tools/qa/makefile.mk tools/source/communi/geninfo.cxx tools/source/debug/debug.cxx tools/source/fsys/dirent.cxx tools/source/fsys/tdir.cxx tools/source/fsys/unx.cxx tools/source/fsys/urlobj.cxx tools/source/generic/color.cxx tools/source/generic/config.cxx tools/source/generic/fract.cxx tools/source/inet/inetmime.cxx tools/source/memtools/multisel.cxx tools/source/memtools/table.cxx tools/source/rc/resmgr.cxx tools/source/ref/globname.cxx tools/source/ref/pstm.cxx tools/source/solar/solar.c tools/source/stream/strmos2.cxx tools/source/stream/strmunx.cxx tools/source/stream/strmwnt.cxx tools/source/string/makefile.mk tools/source/testtoolloader/testtoolloader.cxx tools/test/makefile.mk tools/util/makefile.mk tools/win/inc/dll.hxx tools/win/inc/parser.hxx tools/win/inc/shellex.h tools/win/inc/shutil.h tools/win/inc/toolsdll.hxx tools/win/inc/winshell.hxx tools/workben/makefile.mk ucbhelper/source/client/proxydecider.cxx ucbhelper/workben/ucbexplorer/ucbexplorer.hrc unotools/inc/unotools/unotunnelhelper.hxx unotools/source/config/fltrcfg.cxx unotools/source/config/lingucfg.cxx unotools/source/config/misccfg.cxx unotools/source/config/pathoptions.cxx unotools/source/config/searchopt.cxx unotools/source/i18n/localedatawrapper.cxx unotools/source/ucbhelper/localfilehelper.cxx unotools/source/ucbhelper/ucbhelper.cxx unotools/source/ucbhelper/xtempfile.cxx vcl/aqua/inc/salbmp.h vcl/aqua/inc/salgdi.h vcl/aqua/inc/salinst.h vcl/aqua/source/app/salinst.cxx vcl/aqua/source/gdi/aquaprintaccessoryview.mm vcl/aqua/source/gdi/salgdi.cxx vcl/aqua/source/gdi/salprn.cxx vcl/aqua/source/window/salframeview.mm vcl/aqua/source/window/salobj.cxx vcl/inc/vcl/bitmap.hxx vcl/inc/vcl/brdwin.hxx vcl/inc/vcl/button.hxx vcl/inc/vcl/cmdevt.hxx vcl/inc/vcl/cvtgrf.hxx vcl/inc/vcl/dialog.hxx vcl/inc/vcl/dockwin.hxx vcl/inc/vcl/event.hxx vcl/inc/vcl/fixed.hxx vcl/inc/vcl/fldunit.hxx vcl/inc/vcl/floatwin.hxx vcl/inc/vcl/gdimtf.hxx vcl/inc/vcl/glyphcache.hxx vcl/inc/vcl/graphite_adaptors.hxx vcl/inc/vcl/graphite_features.hxx vcl/inc/vcl/graphite_layout.hxx vcl/inc/vcl/ilstbox.hxx vcl/inc/vcl/image.h vcl/inc/vcl/imgctrl.hxx vcl/inc/vcl/impbmpconv.hxx vcl/inc/vcl/impprn.hxx vcl/inc/vcl/jobset.h vcl/inc/vcl/keycodes.hxx vcl/inc/vcl/lstbox.hxx vcl/inc/vcl/mapunit.hxx vcl/inc/vcl/menu.hxx vcl/inc/vcl/msgbox.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/prndlg.hxx vcl/inc/vcl/salatype.hxx vcl/inc/vcl/salbmp.hxx vcl/inc/vcl/salgdi.hxx vcl/inc/vcl/salinst.hxx vcl/inc/vcl/seleng.hxx vcl/inc/vcl/settings.hxx vcl/inc/vcl/smartid.hxx vcl/inc/vcl/status.hxx vcl/inc/vcl/strhelper.hxx vcl/inc/vcl/svapp.hxx vcl/inc/vcl/svdata.hxx vcl/inc/vcl/syschild.hxx vcl/inc/vcl/sysdata.hxx vcl/inc/vcl/taskpanelist.hxx vcl/inc/vcl/toolbox.hxx vcl/inc/vcl/vclevent.hxx vcl/inc/vcl/windata.hxx vcl/inc/vcl/window.hxx vcl/inc/vcl/wintypes.hxx vcl/os2/source/app/salinst.cxx vcl/os2/source/gdi/salgdi.cxx vcl/os2/source/window/salmenu.cxx vcl/os2/source/window/salobj.cxx vcl/prj/build.lst vcl/source/app/dbggui.cxx vcl/source/app/help.cxx vcl/source/app/idlemgr.cxx vcl/source/app/settings.cxx vcl/source/app/svapp.cxx vcl/source/app/svdata.cxx vcl/source/app/svmain.cxx vcl/source/app/svmainhook.cxx vcl/source/app/unohelp.cxx vcl/source/app/vclevent.cxx vcl/source/control/button.cxx vcl/source/control/combobox.cxx vcl/source/control/edit.cxx vcl/source/control/field.cxx vcl/source/control/fixed.cxx vcl/source/control/ilstbox.cxx vcl/source/control/imgctrl.cxx vcl/source/control/makefile.mk vcl/source/control/tabctrl.cxx vcl/source/gdi/bitmap.cxx vcl/source/gdi/bitmap2.cxx vcl/source/gdi/bitmap4.cxx vcl/source/gdi/bmpconv.cxx vcl/source/gdi/cvtsvm.cxx vcl/source/gdi/font.cxx vcl/source/gdi/gdimtf.cxx vcl/source/gdi/image.cxx vcl/source/gdi/impimage.cxx vcl/source/gdi/jobset.cxx vcl/source/gdi/makefile.mk vcl/source/gdi/metaact.cxx vcl/source/gdi/outdev.cxx vcl/source/gdi/outdev3.cxx vcl/source/gdi/outdev4.cxx vcl/source/gdi/outdevnative.cxx vcl/source/gdi/pdfwriter.cxx vcl/source/gdi/pdfwriter_impl.cxx vcl/source/gdi/print3.cxx vcl/source/gdi/salmisc.cxx vcl/source/glyphs/gcach_ftyp.cxx vcl/source/glyphs/gcach_ftyp.hxx vcl/source/glyphs/glyphcache.cxx vcl/source/glyphs/graphite_cache.cxx vcl/source/glyphs/graphite_layout.cxx vcl/source/glyphs/graphite_textsrc.hxx vcl/source/helper/canvasbitmap.cxx vcl/source/helper/smartid.cxx vcl/source/helper/xconnection.cxx vcl/source/src/btntext.src vcl/source/src/images.src vcl/source/src/print.src vcl/source/window/accel.cxx vcl/source/window/accmgr.cxx vcl/source/window/brdwin.cxx vcl/source/window/btndlg.cxx vcl/source/window/dlgctrl.cxx vcl/source/window/javachild.cxx vcl/source/window/menu.cxx vcl/source/window/msgbox.cxx vcl/source/window/printdlg.cxx vcl/source/window/status.cxx vcl/source/window/syschild.cxx vcl/source/window/toolbox.cxx vcl/source/window/toolbox2.cxx vcl/source/window/window.cxx vcl/source/window/window2.cxx vcl/source/window/wrkwin.cxx vcl/unx/gtk/app/gtkdata.cxx vcl/unx/gtk/app/gtkinst.cxx vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx vcl/unx/gtk/window/gtkframe.cxx vcl/unx/gtk/window/gtkobject.cxx vcl/unx/headless/svpbmp.hxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svpinst.cxx vcl/unx/headless/svpinst.hxx vcl/unx/headless/svpprn.cxx vcl/unx/headless/svpprn.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/unx/headless/svptext.cxx vcl/unx/inc/dtint.hxx vcl/unx/inc/plugins/gtk/gtkdata.hxx vcl/unx/inc/pspgraphics.h vcl/unx/inc/salbmp.h vcl/unx/inc/saldata.hxx vcl/unx/inc/saldisp.hxx vcl/unx/inc/salgdi.h vcl/unx/inc/salinst.h vcl/unx/inc/xfont.hxx vcl/unx/kde/kdedata.cxx vcl/unx/kde4/KDESalGraphics.cxx vcl/unx/source/app/keysymnames.cxx vcl/unx/source/app/saldata.cxx vcl/unx/source/app/saldisp.cxx vcl/unx/source/app/salinst.cxx vcl/unx/source/app/wmadaptor.cxx vcl/unx/source/dtrans/X11_selection.cxx vcl/unx/source/dtrans/X11_service.cxx vcl/unx/source/gdi/makefile.mk vcl/unx/source/gdi/pspgraphics.cxx vcl/unx/source/gdi/salgdi.cxx vcl/unx/source/gdi/salgdi3.cxx vcl/unx/source/gdi/salprnpsp.cxx vcl/unx/source/gdi/xfont.cxx vcl/unx/source/gdi/xlfd_attr.cxx vcl/unx/source/gdi/xlfd_attr.hxx vcl/unx/source/gdi/xlfd_extd.cxx vcl/unx/source/gdi/xlfd_extd.hxx vcl/unx/source/gdi/xlfd_smpl.cxx vcl/unx/source/gdi/xlfd_smpl.hxx vcl/unx/source/printer/ppdparser.cxx vcl/unx/source/printer/printerinfomanager.cxx vcl/unx/source/window/salframe.cxx vcl/unx/source/window/salmenu.cxx vcl/unx/source/window/salobj.cxx vcl/util/makefile2.pmk vcl/win/inc/salbmp.h vcl/win/inc/saldata.hxx vcl/win/inc/salgdi.h vcl/win/inc/salinst.h vcl/win/source/app/saldata.cxx vcl/win/source/app/salinst.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salprn.cxx vcl/win/source/gdi/winlayout.cxx vcl/win/source/window/salframe.cxx vcl/win/source/window/salobj.cxx vcl/workben/outdevgrind.cxx vos/inc/vos/execabl.hxx vos/inc/vos/macros.hxx vos/inc/vos/pipe.hxx vos/inc/vos/process.hxx vos/inc/vos/refernce.hxx vos/inc/vos/signal.hxx vos/inc/vos/socket.hxx vos/inc/vos/stream.hxx vos/inc/vos/thread.hxx vos/source/pipe.cxx vos/source/process.cxx vos/source/signal.cxx vos/source/thread.cxx vos/source/timer.cxx
2011-03-11 14:24:23 +01:00
sal_uLong nSysStyle = GetWindowLong( oldhWnd, GWL_STYLE );
sal_uLong nExSysStyle = GetWindowLong( oldhWnd, GWL_EXSTYLE );
if( bAsChild )
{
nSysStyle = WS_CHILD;
nExSysStyle = 0;
}
2011-01-24 04:00:57 +02:00
LPCWSTR pClassName = SAL_SUBFRAME_CLASSNAMEW;
return CreateWindowExW( nExSysStyle, pClassName, L"", nSysStyle,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
hWndParent, 0, hInstance, (void*)GetWindowPtr( oldhWnd ) );
}
// translation table from System keycodes into StartView keycodes
2000-09-18 16:07:07 +00:00
#define KEY_TAB_SIZE 146
static const sal_uInt16 aImplTranslateKeyTab[KEY_TAB_SIZE] =
2000-09-18 16:07:07 +00:00
{
// StarView-Code System-Code Index
0, // 0
0, // VK_LBUTTON 1
0, // VK_RBUTTON 2
0, // VK_CANCEL 3
0, // VK_MBUTTON 4
0, // 5
0, // 6
0, // 7
KEY_BACKSPACE, // VK_BACK 8
KEY_TAB, // VK_TAB 9
0, // 10
0, // 11
0, // VK_CLEAR 12
KEY_RETURN, // VK_RETURN 13
0, // 14
0, // 15
0, // VK_SHIFT 16
0, // VK_CONTROL 17
0, // VK_MENU 18
0, // VK_PAUSE 19
0, // VK_CAPITAL 20
0, // VK_HANGUL 21
2000-09-18 16:07:07 +00:00
0, // 22
0, // 23
0, // 24
KEY_HANGUL_HANJA, // VK_HANJA 25
2000-09-18 16:07:07 +00:00
0, // 26
KEY_ESCAPE, // VK_ESCAPE 27
0, // 28
0, // 29
0, // 30
0, // 31
KEY_SPACE, // VK_SPACE 32
KEY_PAGEUP, // VK_PRIOR 33
KEY_PAGEDOWN, // VK_NEXT 34
KEY_END, // VK_END 35
KEY_HOME, // VK_HOME 36
KEY_LEFT, // VK_LEFT 37
KEY_UP, // VK_UP 38
KEY_RIGHT, // VK_RIGHT 39
KEY_DOWN, // VK_DOWN 40
0, // VK_SELECT 41
0, // VK_PRINT 42
0, // VK_EXECUTE 43
0, // VK_SNAPSHOT 44
KEY_INSERT, // VK_INSERT 45
KEY_DELETE, // VK_DELETE 46
KEY_HELP, // VK_HELP 47
KEY_0, // 48
KEY_1, // 49
KEY_2, // 50
KEY_3, // 51
KEY_4, // 52
KEY_5, // 53
KEY_6, // 54
KEY_7, // 55
KEY_8, // 56
KEY_9, // 57
0, // 58
0, // 59
0, // 60
0, // 61
0, // 62
0, // 63
0, // 64
KEY_A, // 65
KEY_B, // 66
KEY_C, // 67
KEY_D, // 68
KEY_E, // 69
KEY_F, // 70
KEY_G, // 71
KEY_H, // 72
KEY_I, // 73
KEY_J, // 74
KEY_K, // 75
KEY_L, // 76
KEY_M, // 77
KEY_N, // 78
KEY_O, // 79
KEY_P, // 80
KEY_Q, // 81
KEY_R, // 82
KEY_S, // 83
KEY_T, // 84
KEY_U, // 85
KEY_V, // 86
KEY_W, // 87
KEY_X, // 88
KEY_Y, // 89
KEY_Z, // 90
0, // VK_LWIN 91
0, // VK_RWIN 92
KEY_CONTEXTMENU, // VK_APPS 93
0, // 94
0, // 95
KEY_0, // VK_NUMPAD0 96
KEY_1, // VK_NUMPAD1 97
KEY_2, // VK_NUMPAD2 98
KEY_3, // VK_NUMPAD3 99
KEY_4, // VK_NUMPAD4 100
KEY_5, // VK_NUMPAD5 101
KEY_6, // VK_NUMPAD6 102
KEY_7, // VK_NUMPAD7 103
KEY_8, // VK_NUMPAD8 104
KEY_9, // VK_NUMPAD9 105
KEY_MULTIPLY, // VK_MULTIPLY 106
KEY_ADD, // VK_ADD 107
KEY_DECIMAL, // VK_SEPARATOR 108
2000-09-18 16:07:07 +00:00
KEY_SUBTRACT, // VK_SUBTRACT 109
KEY_DECIMAL, // VK_DECIMAL 110
2000-09-18 16:07:07 +00:00
KEY_DIVIDE, // VK_DIVIDE 111
KEY_F1, // VK_F1 112
KEY_F2, // VK_F2 113
KEY_F3, // VK_F3 114
KEY_F4, // VK_F4 115
KEY_F5, // VK_F5 116
KEY_F6, // VK_F6 117
KEY_F7, // VK_F7 118
KEY_F8, // VK_F8 119
KEY_F9, // VK_F9 120
KEY_F10, // VK_F10 121
KEY_F11, // VK_F11 122
KEY_F12, // VK_F12 123
KEY_F13, // VK_F13 124
KEY_F14, // VK_F14 125
KEY_F15, // VK_F15 126
KEY_F16, // VK_F16 127
KEY_F17, // VK_F17 128
KEY_F18, // VK_F18 129
KEY_F19, // VK_F19 130
KEY_F20, // VK_F20 131
KEY_F21, // VK_F21 132
KEY_F22, // VK_F22 133
KEY_F23, // VK_F23 134
KEY_F24, // VK_F24 135
0, // 136
0, // 137
0, // 138
0, // 139
0, // 140
0, // 141
0, // 142
0, // 143
0, // NUMLOCK 144
0 // SCROLLLOCK 145
};
static UINT ImplSalGetWheelScrollLines()
{
UINT nScrLines = 0;
HWND hWndMsWheel = FindWindowA( MSH_WHEELMODULE_CLASS, MSH_WHEELMODULE_TITLE );
2000-09-18 16:07:07 +00:00
if ( hWndMsWheel )
{
UINT nGetScrollLinesMsgId = RegisterWindowMessage( MSH_SCROLL_LINES );
nScrLines = (UINT)SendMessageW( hWndMsWheel, nGetScrollLinesMsgId, 0, 0 );
2000-09-18 16:07:07 +00:00
}
if ( !nScrLines )
if( !SystemParametersInfo( SPI_GETWHEELSCROLLLINES, 0, &nScrLines, 0 ) )
nScrLines = 0 ;
2000-09-18 16:07:07 +00:00
if ( !nScrLines )
nScrLines = 3;
return nScrLines;
}
static UINT ImplSalGetWheelScrollChars()
{
UINT nScrChars = 0;
if( !SystemParametersInfo( SPI_GETWHEELSCROLLCHARS, 0, &nScrChars, 0 ) )
{
// Depending on Windows version, use proper default or 1 (when
// driver emulates hscroll)
if (!aSalShlData.mbWVista)
{
// Windows 2000 & WinXP : emulating driver, use step size
// of 1
return 1;
}
else
{
// Longhorn or above: use proper default value of 3
return 3;
}
}
// system settings successfully read
return nScrChars;
}
static void ImplSalAddBorder( const WinSalFrame* pFrame, int& width, int& height )
{
// transform client size into window size
RECT aWinRect;
aWinRect.left = 0;
aWinRect.right = width-1;
aWinRect.top = 0;
aWinRect.bottom = height-1;
AdjustWindowRectEx( &aWinRect, GetWindowStyle( pFrame->mhWnd ),
FALSE, GetWindowExStyle( pFrame->mhWnd ) );
width = aWinRect.right - aWinRect.left + 1;
height = aWinRect.bottom - aWinRect.top + 1;
}
static void ImplSalCalcFullScreenSize( const WinSalFrame* pFrame,
2000-09-18 16:07:07 +00:00
int& rX, int& rY, int& rDX, int& rDY )
{
// set window to screen size
int nFrameX;
int nFrameY;
int nCaptionY;
int nScreenX = 0;
int nScreenY = 0;
int nScreenDX = 0;
int nScreenDY = 0;
2000-09-18 16:07:07 +00:00
if ( pFrame->mbSizeBorder )
2000-09-18 16:07:07 +00:00
{
nFrameX = GetSystemMetrics( SM_CXSIZEFRAME );
nFrameY = GetSystemMetrics( SM_CYSIZEFRAME );
}
else if ( pFrame->mbFixBorder )
{
nFrameX = GetSystemMetrics( SM_CXFIXEDFRAME );
nFrameY = GetSystemMetrics( SM_CYFIXEDFRAME );
2000-09-18 16:07:07 +00:00
}
else if ( pFrame->mbBorder )
2000-09-18 16:07:07 +00:00
{
nFrameX = GetSystemMetrics( SM_CXBORDER );
nFrameY = GetSystemMetrics( SM_CYBORDER );
}
else
{
nFrameX = 0;
nFrameY = 0;
}
if ( pFrame->mbCaption )
2000-09-18 16:07:07 +00:00
nCaptionY = GetSystemMetrics( SM_CYCAPTION );
else
nCaptionY = 0;
try
{
sal_Int32 nMonitors = Application::GetScreenCount();
if( (pFrame->mnDisplay >= 0) && (pFrame->mnDisplay < nMonitors) )
{
Rectangle aRect = Application::GetScreenPosSizePixel( pFrame->mnDisplay );
nScreenX = aRect.Left();
nScreenY = aRect.Top();
nScreenDX = aRect.getWidth()+1; // difference between java/awt convention and vcl
nScreenDY = aRect.getHeight()+1; // difference between java/awt convention and vcl
}
else
{
Rectangle aCombined = Application::GetScreenPosSizePixel( 0 );
for( sal_Int32 i = 1 ; i < nMonitors ; i++ )
{
aCombined.Union( Application::GetScreenPosSizePixel( i ) );
}
nScreenX = aCombined.Left();
nScreenY = aCombined.Top();
nScreenDX = aCombined.getWidth();
nScreenDY = aCombined.getHeight();
}
}
catch( Exception& )
{
}
2000-09-18 16:07:07 +00:00
if( !nScreenDX || !nScreenDY )
{
nScreenDX = GetSystemMetrics( SM_CXSCREEN );
nScreenDY = GetSystemMetrics( SM_CYSCREEN );
}
rX = nScreenX -nFrameX;
rY = nScreenY -(nFrameY+nCaptionY);
2000-09-18 16:07:07 +00:00
rDX = nScreenDX+(nFrameX*2);
rDY = nScreenDY+(nFrameY*2)+nCaptionY;
}
static void ImplSalFrameFullScreenPos( WinSalFrame* pFrame, bool bAlways = FALSE )
2000-09-18 16:07:07 +00:00
{
if ( bAlways || !IsIconic( pFrame->mhWnd ) )
2000-09-18 16:07:07 +00:00
{
// set window to screen size
int nX;
int nY;
int nWidth;
int nHeight;
ImplSalCalcFullScreenSize( pFrame, nX, nY, nWidth, nHeight );
SetWindowPos( pFrame->mhWnd, 0,
2000-09-18 16:07:07 +00:00
nX, nY, nWidth, nHeight,
SWP_NOZORDER | SWP_NOACTIVATE );
}
}
WinSalFrame::WinSalFrame()
2000-09-18 16:07:07 +00:00
{
SalData* pSalData = GetSalData();
2003-11-20 12:03:14 +00:00
mhWnd = 0;
mhCursor = LoadCursor( 0, IDC_ARROW );
mhDefIMEContext = 0;
mpGraphics = NULL;
mpGraphics2 = NULL;
mnShowState = SW_SHOWNORMAL;
mnWidth = 0;
mnHeight = 0;
mnMinWidth = 0;
mnMinHeight = 0;
mnMaxWidth = SHRT_MAX;
mnMaxHeight = SHRT_MAX;
2003-11-20 12:03:14 +00:00
mnInputLang = 0;
mnInputCodePage = 0;
mbGraphics = FALSE;
mbCaption = FALSE;
mbBorder = FALSE;
mbFixBorder = FALSE;
mbSizeBorder = FALSE;
mbFullScreen = false;
2003-11-20 12:03:14 +00:00
mbPresentation = FALSE;
mbInShow = FALSE;
mbRestoreMaximize = FALSE;
mbInMoveMsg = FALSE;
mbInSizeMsg = FALSE;
mbFullScreenToolWin = FALSE;
mbDefPos = TRUE;
mbOverwriteState = TRUE;
mbIME = FALSE;
mbHandleIME = FALSE;
mbSpezIME = FALSE;
mbAtCursorIME = FALSE;
mbCandidateMode = FALSE;
mbFloatWin = FALSE;
mbNoIcon = FALSE;
mSelectedhMenu = 0;
mLastActivatedhMenu = 0;
mpClipRgnData = NULL;
mbFirstClipRect = TRUE;
mpNextClipRect = NULL;
mnDisplay = 0;
mbPropertiesStored = FALSE;
memset( &maState, 0, sizeof( SalFrameState ) );
maSysData.nSize = sizeof( SystemEnvData );
2000-09-18 16:07:07 +00:00
2001-11-23 11:39:27 +00:00
memset( &maGeometry, 0, sizeof( maGeometry ) );
2001-10-24 07:57:18 +00:00
// get data, when making 1st frame
2000-09-18 16:07:07 +00:00
if ( !pSalData->mpFirstFrame )
{
if ( !aSalShlData.mnWheelMsgId )
aSalShlData.mnWheelMsgId = RegisterWindowMessage( MSH_MOUSEWHEEL );
if ( !aSalShlData.mnWheelScrollLines )
aSalShlData.mnWheelScrollLines = ImplSalGetWheelScrollLines();
if ( !aSalShlData.mnWheelScrollChars )
aSalShlData.mnWheelScrollChars = ImplSalGetWheelScrollChars();
2000-09-18 16:07:07 +00:00
}
// insert frame in framelist
mpNextFrame = pSalData->mpFirstFrame;
2000-09-18 16:07:07 +00:00
pSalData->mpFirstFrame = this;
}
void WinSalFrame::updateScreenNumber()
{
if( mnDisplay == -1 ) // spans all monitors
return;
WinSalSystem* pSys = static_cast<WinSalSystem*>(ImplGetSalSystem());
if( pSys )
{
const std::vector<WinSalSystem::DisplayMonitor>& rMonitors =
pSys->getMonitors();
Point aPoint( maGeometry.nX, maGeometry.nY );
size_t nMon = rMonitors.size();
for( size_t i = 0; i < nMon; i++ )
{
if( rMonitors[i].m_aArea.IsInside( aPoint ) )
{
mnDisplay = static_cast<sal_Int32>(i);
maGeometry.nDisplayScreenNumber = static_cast<unsigned int>(i);
}
}
}
}
WinSalFrame::~WinSalFrame()
2000-09-18 16:07:07 +00:00
{
SalData* pSalData = GetSalData();
if( mpClipRgnData )
delete [] (BYTE*)mpClipRgnData;
// remove frame from framelist
WinSalFrame** ppFrame = &pSalData->mpFirstFrame;
for(; (*ppFrame != this) && *ppFrame; ppFrame = &(*ppFrame)->mpNextFrame );
if( *ppFrame )
*ppFrame = mpNextFrame;
mpNextFrame = NULL;
2000-12-14 12:39:14 +00:00
// Release Cache DC
if ( mpGraphics2 &&
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
mpGraphics2->getHDC() )
ReleaseGraphics( mpGraphics2 );
2000-12-14 12:39:14 +00:00
2000-09-18 16:07:07 +00:00
// destroy saved DC
if ( mpGraphics )
2000-09-18 16:07:07 +00:00
{
if ( mpGraphics->getDefPal() )
SelectPalette( mpGraphics->getHDC(), mpGraphics->getDefPal(), TRUE );
mpGraphics->DeInitGraphics();
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
ReleaseDC( mhWnd, mpGraphics->getHDC() );
delete mpGraphics;
mpGraphics = NULL;
2000-09-18 16:07:07 +00:00
}
if ( mhWnd )
2000-09-18 16:07:07 +00:00
{
// reset mouse leave data
if ( pSalData->mhWantLeaveMsg == mhWnd )
2000-09-18 16:07:07 +00:00
{
pSalData->mhWantLeaveMsg = 0;
if ( pSalData->mpMouseLeaveTimer )
{
delete pSalData->mpMouseLeaveTimer;
pSalData->mpMouseLeaveTimer = NULL;
}
}
// remove windows properties
if ( mbPropertiesStored )
SetApplicationID( OUString() );
2000-09-18 16:07:07 +00:00
// destroy system frame
if ( !DestroyWindow( mhWnd ) )
SetWindowPtr( mhWnd, 0 );
2000-09-18 16:07:07 +00:00
mhWnd = 0;
2000-09-18 16:07:07 +00:00
}
}
SalGraphics* WinSalFrame::AcquireGraphics()
2000-09-18 16:07:07 +00:00
{
if ( mbGraphics )
2000-09-18 16:07:07 +00:00
return NULL;
2000-12-14 12:39:14 +00:00
// Other threads get an own DC, because Windows modify in the
// other case our DC (changing clip region), when they send a
// WM_ERASEBACKGROUND message
SalData* pSalData = GetSalData();
if ( pSalData->mnAppThreadId != GetCurrentThreadId() )
2000-09-18 16:07:07 +00:00
{
2000-12-14 12:39:14 +00:00
// We use only three CacheDC's for all threads, because W9x is limited
// to max. 5 Cache DC's per thread
if ( pSalData->mnCacheDCInUse >= 3 )
return NULL;
if ( !mpGraphics2 )
2000-12-14 12:39:14 +00:00
{
mpGraphics2 = new WinSalGraphics(WinSalGraphics::WINDOW, true, mhWnd, this);
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
mpGraphics2->setHDC(0);
2000-12-14 12:39:14 +00:00
}
HDC hDC = (HDC)(sal_IntPtr)SendMessageW( pSalData->mpFirstInstance->mhComWnd,
2000-12-14 12:39:14 +00:00
SAL_MSG_GETDC,
(WPARAM)mhWnd, 0 );
2000-09-18 16:07:07 +00:00
if ( hDC )
{
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
mpGraphics2->setHDC(hDC);
2000-09-18 16:07:07 +00:00
if ( pSalData->mhDitherPal )
{
mpGraphics2->setDefPal(SelectPalette( hDC, pSalData->mhDitherPal, TRUE ));
2000-09-18 16:07:07 +00:00
RealizePalette( hDC );
}
mpGraphics2->InitGraphics();
mbGraphics = TRUE;
2000-12-14 12:39:14 +00:00
pSalData->mnCacheDCInUse++;
return mpGraphics2;
2000-09-18 16:07:07 +00:00
}
2000-12-14 12:39:14 +00:00
else
return NULL;
2000-09-18 16:07:07 +00:00
}
else
2000-12-14 12:39:14 +00:00
{
if ( !mpGraphics )
2000-12-14 12:39:14 +00:00
{
HDC hDC = GetDC( mhWnd );
2000-12-14 12:39:14 +00:00
if ( hDC )
{
mpGraphics = new WinSalGraphics(WinSalGraphics::WINDOW, true, mhWnd, this);
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
mpGraphics->setHDC(hDC);
2000-12-14 12:39:14 +00:00
if ( pSalData->mhDitherPal )
{
mpGraphics->setDefPal(SelectPalette( hDC, pSalData->mhDitherPal, TRUE ));
2000-12-14 12:39:14 +00:00
RealizePalette( hDC );
}
mpGraphics->InitGraphics();
mbGraphics = TRUE;
2000-12-14 12:39:14 +00:00
}
}
else
mbGraphics = TRUE;
2000-09-18 16:07:07 +00:00
return mpGraphics;
2000-12-14 12:39:14 +00:00
}
2000-09-18 16:07:07 +00:00
}
void WinSalFrame::ReleaseGraphics( SalGraphics* pGraphics )
2000-09-18 16:07:07 +00:00
{
if ( mpGraphics2 == pGraphics )
2000-12-14 12:39:14 +00:00
{
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
if ( mpGraphics2->getHDC() )
2000-12-14 12:39:14 +00:00
{
SalData* pSalData = GetSalData();
if ( mpGraphics2->getDefPal() )
SelectPalette( mpGraphics2->getHDC(), mpGraphics2->getDefPal(), TRUE );
mpGraphics2->InitGraphics();
SendMessageW( pSalData->mpFirstInstance->mhComWnd,
2000-12-14 12:39:14 +00:00
SAL_MSG_RELEASEDC,
(WPARAM)mhWnd,
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
(LPARAM)mpGraphics2->getHDC() );
mpGraphics2->setHDC(0);
2000-12-14 12:39:14 +00:00
pSalData->mnCacheDCInUse--;
}
}
mbGraphics = FALSE;
2000-09-18 16:07:07 +00:00
}
bool WinSalFrame::PostEvent( void* pData )
2000-09-18 16:07:07 +00:00
{
return (bool)PostMessageW( mhWnd, SAL_MSG_USEREVENT, 0, (LPARAM)pData );
2000-09-18 16:07:07 +00:00
}
void WinSalFrame::SetTitle( const OUString& rTitle )
2000-09-18 16:07:07 +00:00
{
DBG_ASSERT( sizeof( WCHAR ) == sizeof( sal_Unicode ), "WinSalFrame::SetTitle(): WCHAR != sal_Unicode" );
2000-09-18 16:07:07 +00:00
2012-02-02 09:44:10 +07:00
SetWindowTextW( mhWnd, reinterpret_cast<LPCWSTR>(rTitle.getStr()) );
2000-09-18 16:07:07 +00:00
}
void WinSalFrame::SetIcon( sal_uInt16 nIcon )
2000-09-18 16:07:07 +00:00
{
// If we have a window without an Icon (for example a dialog), ignore this call
if ( mbNoIcon )
return;
2001-04-27 13:46:33 +00:00
// 0 means default (class) icon
HICON hIcon = NULL, hSmIcon = NULL;
if ( !nIcon )
nIcon = 1;
2001-04-27 13:46:33 +00:00
ImplLoadSalIcon( nIcon, hIcon, hSmIcon );
DBG_ASSERT( hIcon , "WinSalFrame::SetIcon(): Could not load large icon !" );
DBG_ASSERT( hSmIcon , "WinSalFrame::SetIcon(): Could not load small icon !" );
2001-04-27 13:46:33 +00:00
SendMessageW( mhWnd, WM_SETICON, ICON_BIG, (LPARAM)hIcon );
SendMessageW( mhWnd, WM_SETICON, ICON_SMALL, (LPARAM)hSmIcon );
2000-09-18 16:07:07 +00:00
}
void WinSalFrame::SetMenu( SalMenu* pSalMenu )
{
2003-11-20 12:03:14 +00:00
WinSalMenu* pWMenu = static_cast<WinSalMenu*>(pSalMenu);
if( pSalMenu && pWMenu->mbMenuBar )
::SetMenu( mhWnd, pWMenu->mhMenu );
}
void WinSalFrame::DrawMenuBar()
{
2003-11-20 12:03:14 +00:00
::DrawMenuBar( mhWnd );
}
HWND ImplGetParentHwnd( HWND hWnd )
{
WinSalFrame* pFrame = GetWindowPtr( hWnd );
if( !pFrame || !pFrame->GetWindow())
return ::GetParent( hWnd );
vcl::Window *pRealParent = pFrame->GetWindow()->ImplGetWindowImpl()->mpRealParent;
if( pRealParent )
return static_cast<WinSalFrame*>(pRealParent->ImplGetWindowImpl()->mpFrame)->mhWnd;
else
return ::GetParent( hWnd );
2002-01-10 07:07:19 +00:00
}
SalFrame* WinSalFrame::GetParent() const
2002-09-18 15:35:23 +00:00
{
return GetWindowPtr( ImplGetParentHwnd( mhWnd ) );
2002-09-18 15:35:23 +00:00
}
static void ImplSalShow( HWND hWnd, bool bVisible, bool bNoActivate )
2000-09-18 16:07:07 +00:00
{
WinSalFrame* pFrame = GetWindowPtr( hWnd );
2000-09-18 16:07:07 +00:00
if ( !pFrame )
return;
if ( bVisible )
{
pFrame->mbDefPos = FALSE;
pFrame->mbOverwriteState = TRUE;
pFrame->mbInShow = TRUE;
2002-11-20 16:15:33 +00:00
// #i4715, save position
RECT aRectPreMatrox, aRectPostMatrox;
GetWindowRect( hWnd, &aRectPreMatrox );
vcl::DeletionListener aDogTag( pFrame );
2002-07-16 08:04:37 +00:00
if( bNoActivate )
ShowWindow( hWnd, SW_SHOWNOACTIVATE );
else
ShowWindow( hWnd, pFrame->mnShowState );
if( aDogTag.isDeleted() )
return;
2002-11-20 16:15:33 +00:00
if ( aSalShlData.mbWXP && pFrame->mbFloatWin && !(pFrame->mnStyle & SAL_FRAME_STYLE_NOSHADOW))
{
// erase the window immediately to improve XP shadow effect
// otherwise the shadow may appears long time before the rest of the window
// especially when accessibility is on
HDC dc = GetDC( hWnd );
RECT aRect;
GetClientRect( hWnd, &aRect );
2011-12-06 23:04:19 -08:00
FillRect( dc, &aRect, (HBRUSH) (COLOR_MENU+1) ); // choose the menucolor, because its mostly noticeable for menus
ReleaseDC( hWnd, dc );
}
2002-11-20 16:15:33 +00:00
// #i4715, matrox centerpopup might have changed our position
2011-12-06 23:04:19 -08:00
// reposition popups without caption (menus, dropdowns, tooltips)
2002-11-20 16:15:33 +00:00
GetWindowRect( hWnd, &aRectPostMatrox );
if( (GetWindowStyle( hWnd ) & WS_POPUP) &&
!pFrame->mbCaption &&
2002-11-20 16:15:33 +00:00
(aRectPreMatrox.left != aRectPostMatrox.left || aRectPreMatrox.top != aRectPostMatrox.top) )
SetWindowPos( hWnd, 0, aRectPreMatrox.left, aRectPreMatrox.top, 0, 0, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSIZE );
if( aDogTag.isDeleted() )
return;
vcl::Window *pClientWin = pFrame->GetWindow()->ImplGetClientWindow();
if ( pFrame->mbFloatWin || ( pClientWin && (pClientWin->GetStyle() & WB_SYSTEMFLOATWIN) ) )
pFrame->mnShowState = SW_SHOWNOACTIVATE;
2001-10-24 07:57:18 +00:00
else
pFrame->mnShowState = SW_SHOW;
// hide toolbar for W98
if ( pFrame->mbPresentation )
2000-09-18 16:07:07 +00:00
{
HWND hWndParent = ::GetParent( hWnd );
if ( hWndParent )
SetForegroundWindow( hWndParent );
SetForegroundWindow( hWnd );
}
2001-10-24 07:57:18 +00:00
pFrame->mbInShow = FALSE;
pFrame->updateScreenNumber();
2000-12-14 12:39:14 +00:00
// Direct Paint only, if we get the SolarMutx
if ( ImplSalYieldMutexTryToAcquire() )
{
UpdateWindow( hWnd );
ImplSalYieldMutexRelease();
}
2000-09-18 16:07:07 +00:00
}
else
{
2011-01-24 04:00:57 +02:00
ShowWindow( hWnd, SW_HIDE );
2000-09-18 16:07:07 +00:00
}
}
void WinSalFrame::SetExtendedFrameStyle( SalExtStyle )
{
}
void WinSalFrame::Show( bool bVisible, bool bNoActivate )
2000-09-18 16:07:07 +00:00
{
2000-12-14 12:39:14 +00:00
// Post this Message to the window, because this only works
// in the thread of the window, which has create this window.
// We post this message to avoid deadlocks
if ( GetSalData()->mnAppThreadId != GetCurrentThreadId() )
PostMessageW( mhWnd, SAL_MSG_SHOW, bVisible, bNoActivate );
2000-12-14 12:39:14 +00:00
else
ImplSalShow( mhWnd, bVisible, bNoActivate );
2000-09-18 16:07:07 +00:00
}
void WinSalFrame::SetMinClientSize( long nWidth, long nHeight )
2000-09-18 16:07:07 +00:00
{
mnMinWidth = nWidth;
mnMinHeight = nHeight;
2000-09-18 16:07:07 +00:00
}
void WinSalFrame::SetMaxClientSize( long nWidth, long nHeight )
{
mnMaxWidth = nWidth;
mnMaxHeight = nHeight;
}
void WinSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight,
sal_uInt16 nFlags )
2000-09-18 16:07:07 +00:00
{
bool bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
2000-09-18 16:07:07 +00:00
if ( !bVisible )
2001-10-24 07:57:18 +00:00
{
vcl::Window *pClientWin = GetWindow()->ImplGetClientWindow();
if ( mbFloatWin || ( pClientWin && (pClientWin->GetStyle() & WB_SYSTEMFLOATWIN) ) )
mnShowState = SW_SHOWNOACTIVATE;
2001-10-24 07:57:18 +00:00
else
mnShowState = SW_SHOWNORMAL;
2001-10-24 07:57:18 +00:00
}
2000-09-18 16:07:07 +00:00
else
{
if ( IsIconic( mhWnd ) || IsZoomed( mhWnd ) )
ShowWindow( mhWnd, SW_RESTORE );
2000-09-18 16:07:07 +00:00
}
sal_uInt16 nEvent = 0;
2001-10-24 07:57:18 +00:00
UINT nPosSize = 0;
RECT aClientRect, aWindowRect;
GetClientRect( mhWnd, &aClientRect ); // x,y always 0,0, but width and height without border
GetWindowRect( mhWnd, &aWindowRect ); // x,y in screen coordinates, width and height with border
2001-10-24 07:57:18 +00:00
if ( !(nFlags & (SAL_FRAME_POSSIZE_X | SAL_FRAME_POSSIZE_Y)) )
nPosSize |= SWP_NOMOVE;
else
{
//DBG_ASSERT( nX && nY, " Windowposition of (0,0) requested!" );
nEvent = SALEVENT_MOVE;
}
if ( !(nFlags & (SAL_FRAME_POSSIZE_WIDTH | SAL_FRAME_POSSIZE_HEIGHT)) )
nPosSize |= SWP_NOSIZE;
else
nEvent = (nEvent == SALEVENT_MOVE) ? SALEVENT_MOVERESIZE : SALEVENT_RESIZE;
if ( !(nFlags & SAL_FRAME_POSSIZE_X) )
nX = aWindowRect.left;
if ( !(nFlags & SAL_FRAME_POSSIZE_Y) )
nY = aWindowRect.top;
if ( !(nFlags & SAL_FRAME_POSSIZE_WIDTH) )
nWidth = aClientRect.right-aClientRect.left;
if ( !(nFlags & SAL_FRAME_POSSIZE_HEIGHT) )
nHeight = aClientRect.bottom-aClientRect.top;
// Calculate window size including the border
RECT aWinRect;
2000-09-18 16:07:07 +00:00
aWinRect.left = 0;
2001-10-24 07:57:18 +00:00
aWinRect.right = (int)nWidth-1;
2000-09-18 16:07:07 +00:00
aWinRect.top = 0;
2001-10-24 07:57:18 +00:00
aWinRect.bottom = (int)nHeight-1;
AdjustWindowRectEx( &aWinRect, GetWindowStyle( mhWnd ),
FALSE, GetWindowExStyle( mhWnd ) );
2001-10-24 07:57:18 +00:00
nWidth = aWinRect.right - aWinRect.left + 1;
nHeight = aWinRect.bottom - aWinRect.top + 1;
2000-09-18 16:07:07 +00:00
if ( !(nPosSize & SWP_NOMOVE) && ::GetParent( mhWnd ) )
2001-10-24 07:57:18 +00:00
{
2002-07-11 06:43:29 +00:00
// --- RTL --- (mirror window pos)
RECT aParentRect;
GetClientRect( ImplGetParentHwnd( mhWnd ), &aParentRect );
if( AllSettings::GetLayoutRTL() )
2002-07-11 06:43:29 +00:00
nX = (aParentRect.right - aParentRect.left) - nWidth-1 - nX;
//#110386#, do not transform coordinates for system child windows
2003-11-20 12:03:14 +00:00
if( !(GetWindowStyle( mhWnd ) & WS_CHILD) )
{
POINT aPt;
aPt.x = nX;
aPt.y = nY;
HWND parentHwnd = ImplGetParentHwnd( mhWnd );
WinSalFrame* pParentFrame = GetWindowPtr( parentHwnd );
if ( pParentFrame && pParentFrame->mnShowState == SW_SHOWMAXIMIZED )
{
// #i42485#: parent will be shown maximized in which case
// a ClientToScreen uses the wrong coordinates (i.e. those from the restore pos)
// so use the (already updated) frame geometry for the transformation
aPt.x += pParentFrame->maGeometry.nX;
aPt.y += pParentFrame->maGeometry.nY;
}
else
ClientToScreen( parentHwnd, &aPt );
nX = aPt.x;
nY = aPt.y;
}
2001-10-24 07:57:18 +00:00
}
2000-09-18 16:07:07 +00:00
// #i3338# to be conformant to UNIX we must position the client window, ie without the decoration
// #i43250# if the position was read from the system (GetWindowRect(), see above), it must not be modified
if ( nFlags & SAL_FRAME_POSSIZE_X )
nX += aWinRect.left;
if ( nFlags & SAL_FRAME_POSSIZE_Y )
nY += aWinRect.top;
2001-11-02 17:31:39 +00:00
int nScreenX;
int nScreenY;
int nScreenWidth;
int nScreenHeight;
RECT aRect;
ImplSalGetWorkArea( mhWnd, &aRect, NULL );
2001-11-02 17:31:39 +00:00
nScreenX = aRect.left;
nScreenY = aRect.top;
nScreenWidth = aRect.right-aRect.left;
nScreenHeight = aRect.bottom-aRect.top;
if ( mbDefPos && (nPosSize & SWP_NOMOVE)) // we got no positioning request, so choose default position
2000-09-18 16:07:07 +00:00
{
2001-10-24 07:57:18 +00:00
// center window
HWND hWndParent = ::GetParent( mhWnd );
// Search for TopLevel Frame
while ( hWndParent && (GetWindowStyle( hWndParent ) & WS_CHILD) )
hWndParent = ::GetParent( hWndParent );
// if the Window has a Parent, than center the window to
// the parent, in the other case to the screen
if ( hWndParent && !IsIconic( hWndParent ) &&
(GetWindowStyle( hWndParent ) & WS_VISIBLE) )
{
RECT aParentRect;
GetWindowRect( hWndParent, &aParentRect );
int nParentWidth = aParentRect.right-aParentRect.left;
int nParentHeight = aParentRect.bottom-aParentRect.top;
// We don't center, when Parent is smaller than our window
if ( (nParentWidth-GetSystemMetrics( SM_CXFIXEDFRAME ) <= nWidth) &&
(nParentHeight-GetSystemMetrics( SM_CYFIXEDFRAME ) <= nHeight) )
{
int nOff = GetSystemMetrics( SM_CYSIZEFRAME ) + GetSystemMetrics( SM_CYCAPTION );
nX = aParentRect.left+nOff;
nY = aParentRect.top+nOff;
}
else
{
nX = (nParentWidth-nWidth)/2 + aParentRect.left;
nY = (nParentHeight-nHeight)/2 + aParentRect.top;
}
}
else
{
2002-11-20 16:15:33 +00:00
POINT pt;
GetCursorPos( &pt );
RECT aRect2;
aRect2.left = pt.x;
aRect2.top = pt.y;
aRect2.right = pt.x+2;
aRect2.bottom = pt.y+2;
2002-11-20 16:15:33 +00:00
// dualmonitor support:
// Get screensize of the monitor with the mouse pointer
ImplSalGetWorkArea( mhWnd, &aRect2, &aRect2 );
2002-11-20 16:15:33 +00:00
nX = ((aRect2.right-aRect2.left)-nWidth)/2 + aRect2.left;
nY = ((aRect2.bottom-aRect2.top)-nHeight)/2 + aRect2.top;
}
2001-10-24 07:57:18 +00:00
//if ( bVisible )
// mbDefPos = FALSE;
2001-10-24 07:57:18 +00:00
mbDefPos = FALSE; // center only once
2001-10-24 07:57:18 +00:00
nPosSize &= ~SWP_NOMOVE; // activate positioning
nEvent = SALEVENT_MOVERESIZE;
2000-09-18 16:07:07 +00:00
}
2001-10-24 07:57:18 +00:00
2001-11-02 17:31:39 +00:00
// Adjust Window in the screen
bool bCheckOffScreen = TRUE;
// but don't do this for floaters or ownerdraw windows that are currently moved interactively
if( (mnStyle & SAL_FRAME_STYLE_FLOAT) && !(mnStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) )
bCheckOffScreen = FALSE;
if( mnStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION )
{
// may be the window is currently being moved (mouse is captured), then no check is required
if( mhWnd == ::GetCapture() )
bCheckOffScreen = FALSE;
else
bCheckOffScreen = TRUE;
}
if( bCheckOffScreen )
{
if ( nX+nWidth > nScreenX+nScreenWidth )
nX = (nScreenX+nScreenWidth) - nWidth;
if ( nY+nHeight > nScreenY+nScreenHeight )
nY = (nScreenY+nScreenHeight) - nHeight;
if ( nX < nScreenX )
nX = nScreenX;
if ( nY < nScreenY )
nY = nScreenY;
}
2001-11-02 17:31:39 +00:00
UINT nPosFlags = SWP_NOACTIVATE | SWP_NOOWNERZORDER | nPosSize;
// bring floating windows always to top
if( !(mnStyle & SAL_FRAME_STYLE_FLOAT) )
nPosFlags |= SWP_NOZORDER; // do not change z-order
SetWindowPos( mhWnd, HWND_TOP, nX, nY, (int)nWidth, (int)nHeight, nPosFlags );
UpdateFrameGeometry( mhWnd, this );
2000-09-18 16:07:07 +00:00
2001-10-24 07:57:18 +00:00
// Notification -- really ???
if( nEvent )
CallCallback( nEvent, NULL );
2001-10-24 07:57:18 +00:00
}
static void ImplSetParentFrame( WinSalFrame* pThis, HWND hNewParentWnd, bool bAsChild )
{
// save hwnd, will be overwritten in WM_CREATE during createwindow
HWND hWndOld = pThis->mhWnd;
HWND hWndOldParent = ::GetParent( hWndOld );
SalData* pSalData = GetSalData();
if( hNewParentWnd == hWndOldParent )
return;
::std::vector< WinSalFrame* > children;
::std::vector< WinSalObject* > systemChildren;
// search child windows
WinSalFrame *pFrame = pSalData->mpFirstFrame;
while( pFrame )
{
HWND hWndParent = ::GetParent( pFrame->mhWnd );
if( pThis->mhWnd == hWndParent )
children.push_back( pFrame );
pFrame = pFrame->mpNextFrame;
}
// search system child windows (plugins etc.)
WinSalObject *pObject = pSalData->mpFirstObject;
while( pObject )
{
HWND hWndParent = ::GetParent( pObject->mhWnd );
if( pThis->mhWnd == hWndParent )
systemChildren.push_back( pObject );
pObject = pObject->mpNextObject;
}
bool bNeedGraphics = pThis->mbGraphics;
bool bNeedCacheDC = FALSE;
HFONT hFont = NULL;
HPEN hPen = NULL;
HBRUSH hBrush = NULL;
#if OSL_DEBUG_LEVEL > 0
int oldCount = pSalData->mnCacheDCInUse;
(void)oldCount;
#endif
// Release Cache DC
if ( pThis->mpGraphics2 &&
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
pThis->mpGraphics2->getHDC() )
{
// save current gdi objects before hdc is gone
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
hFont = (HFONT) GetCurrentObject( pThis->mpGraphics2->getHDC(), OBJ_FONT);
hPen = (HPEN) GetCurrentObject( pThis->mpGraphics2->getHDC(), OBJ_PEN);
hBrush = (HBRUSH) GetCurrentObject( pThis->mpGraphics2->getHDC(), OBJ_BRUSH);
pThis->ReleaseGraphics( pThis->mpGraphics2 );
// recreate cache dc only if it was destroyed
bNeedCacheDC = TRUE;
}
// destroy saved DC
if ( pThis->mpGraphics )
{
if ( pThis->mpGraphics->getDefPal() )
SelectPalette( pThis->mpGraphics->getHDC(), pThis->mpGraphics->getDefPal(), TRUE );
pThis->mpGraphics->InitGraphics();
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
ReleaseDC( pThis->mhWnd, pThis->mpGraphics->getHDC() );
}
// create a new hwnd with the same styles
HWND hWndParent = hNewParentWnd;
// forward to main thread
HWND hWnd = (HWND) (sal_IntPtr) SendMessageW( pSalData->mpFirstInstance->mhComWnd,
bAsChild ? SAL_MSG_RECREATECHILDHWND : SAL_MSG_RECREATEHWND,
(WPARAM) hWndParent, (LPARAM)pThis->mhWnd );
// succeeded ?
DBG_ASSERT( IsWindow( hWnd ), "WinSalFrame::SetParent not successful");
// recreate DCs
if( bNeedGraphics )
{
if( pThis->mpGraphics2 )
{
pThis->mpGraphics2->setHWND(hWnd);
if( bNeedCacheDC )
{
// re-create cached DC
HDC hDC = (HDC)(sal_IntPtr)SendMessageW( pSalData->mpFirstInstance->mhComWnd,
SAL_MSG_GETDC,
(WPARAM) hWnd, 0 );
if ( hDC )
{
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
pThis->mpGraphics2->setHDC(hDC);
if ( pSalData->mhDitherPal )
{
pThis->mpGraphics2->setDefPal(SelectPalette( hDC, pSalData->mhDitherPal, TRUE ));
RealizePalette( hDC );
}
pThis->mpGraphics2->InitGraphics();
// re-select saved gdi objects
if( hFont )
SelectObject( hDC, hFont );
if( hPen )
SelectObject( hDC, hPen );
if( hBrush )
SelectObject( hDC, hBrush );
pThis->mbGraphics = TRUE;
pSalData->mnCacheDCInUse++;
DBG_ASSERT( oldCount == pSalData->mnCacheDCInUse, "WinSalFrame::SetParent() hDC count corrupted");
}
}
}
if( pThis->mpGraphics )
{
// re-create DC
pThis->mpGraphics->setHWND(hWnd);
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
pThis->mpGraphics->setHDC( GetDC( hWnd ) );
if ( GetSalData()->mhDitherPal )
{
pThis->mpGraphics->setDefPal(SelectPalette( pThis->mpGraphics->getHDC(), GetSalData()->mhDitherPal, TRUE ));
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
RealizePalette( pThis->mpGraphics->getHDC() );
}
pThis->mpGraphics->InitGraphics();
pThis->mbGraphics = TRUE;
}
}
// TODO: add SetParent() call for SalObjects
DBG_ASSERT( systemChildren.empty(), "WinSalFrame::SetParent() parent of living system child window will be destroyed!");
// reparent children before old parent is destroyed
2011-09-01 21:33:22 +02:00
for( ::std::vector< WinSalFrame* >::iterator iChild = children.begin(); iChild != children.end(); ++iChild )
ImplSetParentFrame( *iChild, hWnd, FALSE );
children.clear();
systemChildren.clear();
// Now destroy original HWND in the thread where it was created.
SendMessageW( GetSalData()->mpFirstInstance->mhComWnd,
SAL_MSG_DESTROYHWND, (WPARAM) 0, (LPARAM)hWndOld);
}
void WinSalFrame::SetParent( SalFrame* pNewParent )
{
WinSalFrame::mbInReparent = TRUE;
ImplSetParentFrame( this, static_cast<WinSalFrame*>(pNewParent)->mhWnd, FALSE );
WinSalFrame::mbInReparent = FALSE;
}
bool WinSalFrame::SetPluginParent( SystemParentData* pNewParent )
{
if ( pNewParent->hWnd == 0 )
{
pNewParent->hWnd = GetDesktopWindow();
}
WinSalFrame::mbInReparent = TRUE;
ImplSetParentFrame( this, pNewParent->hWnd, TRUE );
WinSalFrame::mbInReparent = FALSE;
return true;
}
void WinSalFrame::GetWorkArea( Rectangle &rRect )
2001-10-24 07:57:18 +00:00
{
RECT aRect;
ImplSalGetWorkArea( mhWnd, &aRect, NULL );
rRect.Left() = aRect.left;
rRect.Right() = aRect.right-1;
rRect.Top() = aRect.top;
rRect.Bottom() = aRect.bottom-1;
2000-09-18 16:07:07 +00:00
}
void WinSalFrame::GetClientSize( long& rWidth, long& rHeight )
2000-09-18 16:07:07 +00:00
{
2002-09-18 15:35:23 +00:00
rWidth = maGeometry.nWidth;
rHeight = maGeometry.nHeight;
2000-09-18 16:07:07 +00:00
}
void WinSalFrame::SetWindowState( const SalFrameState* pState )
2000-09-18 16:07:07 +00:00
{
// Check if the window fits into the screen, in case the screen
// resolution changed
2000-09-18 16:07:07 +00:00
int nX;
int nY;
int nWidth;
int nHeight;
int nScreenX;
int nScreenY;
int nScreenWidth;
int nScreenHeight;
RECT aRect;
ImplSalGetWorkArea( mhWnd, &aRect, NULL );
// #102500# allow some overlap, the window could have been made a little larger than the physical screen
nScreenX = aRect.left-10;
nScreenY = aRect.top-10;
nScreenWidth = aRect.right-aRect.left+20;
nScreenHeight = aRect.bottom-aRect.top+20;
2001-08-23 12:45:29 +00:00
UINT nPosSize = 0;
RECT aWinRect;
GetWindowRect( mhWnd, &aWinRect );
2000-09-18 16:07:07 +00:00
// to be consistent with Unix, the frame state is without(!) decoration
// ->add the decoration
RECT aRect2 = aWinRect;
AdjustWindowRectEx( &aRect2, GetWindowStyle( mhWnd ),
FALSE, GetWindowExStyle( mhWnd ) );
long nTopDeco = abs( aWinRect.top - aRect2.top );
long nLeftDeco = abs( aWinRect.left - aRect2.left );
long nBottomDeco = abs( aWinRect.bottom - aRect2.bottom );
long nRightDeco = abs( aWinRect.right - aRect2.right );
// adjust window position/size to fit the screen
if ( !(pState->mnMask & (WINDOWSTATE_MASK_X | WINDOWSTATE_MASK_Y)) )
2001-08-23 12:45:29 +00:00
nPosSize |= SWP_NOMOVE;
if ( !(pState->mnMask & (WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT)) )
2001-08-23 12:45:29 +00:00
nPosSize |= SWP_NOSIZE;
if ( pState->mnMask & WINDOWSTATE_MASK_X )
nX = (int)pState->mnX - nLeftDeco;
2001-08-23 12:45:29 +00:00
else
nX = aWinRect.left;
if ( pState->mnMask & WINDOWSTATE_MASK_Y )
nY = (int)pState->mnY - nTopDeco;
2001-08-23 12:45:29 +00:00
else
nY = aWinRect.top;
if ( pState->mnMask & WINDOWSTATE_MASK_WIDTH )
nWidth = (int)pState->mnWidth + nLeftDeco + nRightDeco;
2001-08-23 12:45:29 +00:00
else
nWidth = aWinRect.right-aWinRect.left;
if ( pState->mnMask & WINDOWSTATE_MASK_HEIGHT )
nHeight = (int)pState->mnHeight + nTopDeco + nBottomDeco;
2001-08-23 12:45:29 +00:00
else
nHeight = aWinRect.bottom-aWinRect.top;
// Adjust Window in the screen:
// if it does not fit into the screen do nothing, ie default pos/size will be used
// if there is an overlap with the screen border move the window while keeping its size
if( nWidth > nScreenWidth || nHeight > nScreenHeight )
nPosSize |= (SWP_NOMOVE | SWP_NOSIZE);
2001-08-23 12:45:29 +00:00
if ( nX+nWidth > nScreenX+nScreenWidth )
nX = (nScreenX+nScreenWidth) - nWidth;
if ( nY+nHeight > nScreenY+nScreenHeight )
nY = (nScreenY+nScreenHeight) - nHeight;
2000-09-18 16:07:07 +00:00
if ( nX < nScreenX )
nX = nScreenX;
if ( nY < nScreenY )
nY = nScreenY;
// set Restore-Position
2000-09-18 16:07:07 +00:00
WINDOWPLACEMENT aPlacement;
aPlacement.length = sizeof( aPlacement );
GetWindowPlacement( mhWnd, &aPlacement );
2000-09-18 16:07:07 +00:00
// set State
bool bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
bool bUpdateHiddenFramePos = FALSE;
2000-09-18 16:07:07 +00:00
if ( !bVisible )
{
aPlacement.showCmd = SW_HIDE;
if ( mbOverwriteState )
2000-09-18 16:07:07 +00:00
{
if ( pState->mnMask & WINDOWSTATE_MASK_STATE )
2001-08-23 12:45:29 +00:00
{
if ( pState->mnState & WINDOWSTATE_STATE_MINIMIZED )
mnShowState = SW_SHOWMINIMIZED;
else if ( pState->mnState & WINDOWSTATE_STATE_MAXIMIZED )
{
mnShowState = SW_SHOWMAXIMIZED;
bUpdateHiddenFramePos = TRUE;
}
else if ( pState->mnState & WINDOWSTATE_STATE_NORMAL )
mnShowState = SW_SHOWNORMAL;
2001-08-23 12:45:29 +00:00
}
2000-09-18 16:07:07 +00:00
}
}
else
{
if ( pState->mnMask & WINDOWSTATE_MASK_STATE )
2000-09-18 16:07:07 +00:00
{
if ( pState->mnState & WINDOWSTATE_STATE_MINIMIZED )
2001-08-23 12:45:29 +00:00
{
if ( pState->mnState & WINDOWSTATE_STATE_MAXIMIZED )
2001-08-23 12:45:29 +00:00
aPlacement.flags |= WPF_RESTORETOMAXIMIZED;
aPlacement.showCmd = SW_SHOWMINIMIZED;
}
else if ( pState->mnState & WINDOWSTATE_STATE_MAXIMIZED )
2001-08-23 12:45:29 +00:00
aPlacement.showCmd = SW_SHOWMAXIMIZED;
else if ( pState->mnState & WINDOWSTATE_STATE_NORMAL )
2001-08-23 12:45:29 +00:00
aPlacement.showCmd = SW_RESTORE;
2000-09-18 16:07:07 +00:00
}
}
// if a window is neither minimized nor maximized or need not be
// positioned visibly (that is in visible state), do not use
// SetWindowPlacement since it calculates including the TaskBar
if ( !IsIconic( mhWnd ) && !IsZoomed( mhWnd ) &&
2000-09-18 16:07:07 +00:00
(!bVisible || (aPlacement.showCmd == SW_RESTORE)) )
{
if( bUpdateHiddenFramePos )
{
RECT aStateRect;
aStateRect.left = nX;
aStateRect.top = nY;
aStateRect.right = nX+nWidth;
aStateRect.bottom = nY+nHeight;
// #96084 set a useful internal window size because
// the window will not be maximized (and the size updated) before show()
SetMaximizedFrameGeometry( mhWnd, this, &aStateRect );
SetWindowPos( mhWnd, 0,
maGeometry.nX, maGeometry.nY, maGeometry.nWidth, maGeometry.nHeight,
SWP_NOZORDER | SWP_NOACTIVATE | nPosSize );
}
else
SetWindowPos( mhWnd, 0,
2000-09-18 16:07:07 +00:00
nX, nY, nWidth, nHeight,
2001-08-23 12:45:29 +00:00
SWP_NOZORDER | SWP_NOACTIVATE | nPosSize );
2000-09-18 16:07:07 +00:00
}
else
{
if( !(nPosSize & (SWP_NOMOVE|SWP_NOSIZE)) )
{
aPlacement.rcNormalPosition.left = nX-nScreenX;
aPlacement.rcNormalPosition.top = nY-nScreenY;
aPlacement.rcNormalPosition.right = nX+nWidth-nScreenX;
aPlacement.rcNormalPosition.bottom = nY+nHeight-nScreenY;
}
SetWindowPlacement( mhWnd, &aPlacement );
2000-09-18 16:07:07 +00:00
}
if( !(nPosSize & SWP_NOMOVE) )
mbDefPos = FALSE; // window was positioned
2000-09-18 16:07:07 +00:00
}
bool WinSalFrame::GetWindowState( SalFrameState* pState )
2000-09-18 16:07:07 +00:00
{
if ( maState.mnWidth && maState.mnHeight )
2000-09-18 16:07:07 +00:00
{
*pState = maState;
// #94144# allow Minimize again, should be masked out when read from configuration
// 91625 - Don't save minimize
//if ( !(pState->mnState & WINDOWSTATE_STATE_MAXIMIZED) )
if ( !(pState->mnState & (WINDOWSTATE_STATE_MINIMIZED | WINDOWSTATE_STATE_MAXIMIZED)) )
pState->mnState |= WINDOWSTATE_STATE_NORMAL;
2000-09-18 16:07:07 +00:00
return TRUE;
}
return FALSE;
}
void WinSalFrame::SetScreenNumber( unsigned int nNewScreen )
{
WinSalSystem* pSys = static_cast<WinSalSystem*>(ImplGetSalSystem());
if( pSys )
{
const std::vector<WinSalSystem::DisplayMonitor>& rMonitors =
pSys->getMonitors();
size_t nMon = rMonitors.size();
if( nNewScreen < nMon )
{
Point aOldMonPos, aNewMonPos( rMonitors[nNewScreen].m_aArea.TopLeft() );
Point aCurPos( maGeometry.nX, maGeometry.nY );
for( size_t i = 0; i < nMon; i++ )
{
if( rMonitors[i].m_aArea.IsInside( aCurPos ) )
{
aOldMonPos = rMonitors[i].m_aArea.TopLeft();
break;
}
}
mnDisplay = nNewScreen;
maGeometry.nDisplayScreenNumber = nNewScreen;
SetPosSize( aNewMonPos.X() + (maGeometry.nX - aOldMonPos.X()),
aNewMonPos.Y() + (maGeometry.nY - aOldMonPos.Y()),
0, 0,
SAL_FRAME_POSSIZE_X | SAL_FRAME_POSSIZE_Y );
}
}
}
void WinSalFrame::SetApplicationID( const OUString &rApplicationID )
{
if ( aSalShlData.mbW7 )
{
// http://msdn.microsoft.com/en-us/library/windows/desktop/dd378430(v=vs.85).aspx
// A window's properties must be removed before the window is closed.
typedef HRESULT ( WINAPI *SHGETPROPERTYSTOREFORWINDOW )( HWND, REFIID, void ** );
SHGETPROPERTYSTOREFORWINDOW pSHGetPropertyStoreForWindow;
pSHGetPropertyStoreForWindow = ( SHGETPROPERTYSTOREFORWINDOW )GetProcAddress(
GetModuleHandleW (L"shell32.dll"), "SHGetPropertyStoreForWindow" );
if( pSHGetPropertyStoreForWindow )
{
IPropertyStore *pps;
HRESULT hr = pSHGetPropertyStoreForWindow ( mhWnd, IID_PPV_ARGS(&pps) );
if ( SUCCEEDED(hr) )
{
PROPVARIANT pv;
if ( !rApplicationID.isEmpty() )
{
hr = InitPropVariantFromString( ( PCWSTR )rApplicationID.getStr(), &pv );
mbPropertiesStored = TRUE;
}
else
// if rApplicationID we remove the property from the window, if present
PropVariantInit( &pv );
if ( SUCCEEDED(hr) )
{
hr = pps->SetValue( PKEY_AppUserModel_ID, pv );
PropVariantClear( &pv );
}
pps->Release();
}
}
}
}
void WinSalFrame::ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay )
2000-09-18 16:07:07 +00:00
{
if ( (mbFullScreen == bFullScreen) && (!bFullScreen || (mnDisplay == nDisplay)) )
2000-09-18 16:07:07 +00:00
return;
mbFullScreen = bFullScreen;
mnDisplay = nDisplay;
2000-09-18 16:07:07 +00:00
if ( bFullScreen )
{
// to hide the Windows taskbar
DWORD nExStyle = GetWindowExStyle( mhWnd );
2000-09-18 16:07:07 +00:00
if ( nExStyle & WS_EX_TOOLWINDOW )
{
mbFullScreenToolWin = TRUE;
2000-09-18 16:07:07 +00:00
nExStyle &= ~WS_EX_TOOLWINDOW;
SetWindowExStyle( mhWnd, nExStyle );
2000-09-18 16:07:07 +00:00
}
// save old position
GetWindowRect( mhWnd, &maFullScreenRect );
2000-09-18 16:07:07 +00:00
// save show state
mnFullScreenShowState = mnShowState;
if ( !(GetWindowStyle( mhWnd ) & WS_VISIBLE) )
mnShowState = SW_SHOW;
2000-09-18 16:07:07 +00:00
// set window to screen size
ImplSalFrameFullScreenPos( this, TRUE );
}
else
{
// when the ShowState has to be reset, hide the window first to
// reduce flicker
bool bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
if ( bVisible && (mnShowState != mnFullScreenShowState) )
ShowWindow( mhWnd, SW_HIDE );
2000-09-18 16:07:07 +00:00
if ( mbFullScreenToolWin )
SetWindowExStyle( mhWnd, GetWindowExStyle( mhWnd ) | WS_EX_TOOLWINDOW );
mbFullScreenToolWin = FALSE;
2000-09-18 16:07:07 +00:00
SetWindowPos( mhWnd, 0,
maFullScreenRect.left,
maFullScreenRect.top,
maFullScreenRect.right-maFullScreenRect.left,
maFullScreenRect.bottom-maFullScreenRect.top,
2000-09-18 16:07:07 +00:00
SWP_NOZORDER | SWP_NOACTIVATE );
// restore show state
if ( mnShowState != mnFullScreenShowState )
2000-09-18 16:07:07 +00:00
{
mnShowState = mnFullScreenShowState;
2000-09-18 16:07:07 +00:00
if ( bVisible )
{
mbInShow = TRUE;
ShowWindow( mhWnd, mnShowState );
mbInShow = FALSE;
UpdateWindow( mhWnd );
2000-09-18 16:07:07 +00:00
}
}
}
}
void WinSalFrame::StartPresentation( bool bStart )
2000-09-18 16:07:07 +00:00
{
if ( mbPresentation == bStart )
2000-09-18 16:07:07 +00:00
return;
mbPresentation = bStart;
2000-09-18 16:07:07 +00:00
SalData* pSalData = GetSalData();
if ( bStart )
{
if ( !pSalData->mpSageEnableProc )
{
if ( pSalData->mnSageStatus != DISABLE_AGENT )
{
OFSTRUCT aOS;
OpenFile( "SAGE.DLL", &aOS, OF_EXIST );
if ( !aOS.nErrCode )
{
OUString aLibraryName( OUString::createFromAscii( aOS.szPathName ) );
oslModule mhSageInst = osl_loadModule( aLibraryName.pData, SAL_LOADMODULE_DEFAULT );
CWS-TOOLING: integrate CWS vcl101 2009-04-30 16:05:34 +0200 pl r271420 : #i95591# need a poll timer so XtTimers work properly 2009-04-30 11:25:52 +0200 hdu r271406 : #i100929# avoid unneeded colormap reallocation 2009-04-30 11:21:16 +0200 hdu r271405 : #i100929# use improved SetDrawable() also for salframe updates 2009-04-30 11:12:41 +0200 hdu r271404 : i100929# invalidate cached renderpic also for changed vdev 2009-04-29 14:31:40 +0200 hdu r271375 : i100929# use cached renderpic also for alpha-rect/bitmap drawing 2009-04-29 14:16:51 +0200 hdu r271370 : i100929# notify only GtkSalFrame's valid X11SalFrames 2009-04-29 13:58:10 +0200 hdu r271369 : i100929# notify GtkSalFrame's X11SalGraphics that their drawables will become obsolete 2009-04-29 13:53:48 +0200 hdu r271367 : #i100929# release cached renderpic whenever the corresponding drawable changes 2009-04-28 11:56:07 +0200 pl r271317 : fix a snafu 2009-04-27 16:52:29 +0200 hdu r271293 : #i100000# WAE fix for debug=true compilation 2009-04-27 12:38:11 +0200 hdu r271260 : #i101367# disable vdev mapmode when measuring pixel size 2009-04-27 12:28:37 +0200 hdu r271259 : #i101367# speedup svclcanvas::CanvasBitmapHelper::getSize() 2009-04-23 15:11:25 +0200 hdu r271175 : #i91685# ignore trailing space in last cell 2009-04-23 12:55:14 +0200 pl r271156 : #i101032# check for empty bitmap 2009-04-23 11:04:50 +0200 pl r271144 : #101184# add a paranoia check 2009-04-21 19:12:25 +0200 pl r271055 : #i101184# add: recognize added/removed monitors in xinerama configuration for gtk plugin (thanks cmc) 2009-04-21 17:04:44 +0200 pl r271046 : #i101089# remove unused method (thanks cmc) 2009-04-21 16:41:38 +0200 hdu r271042 : #i99842# set text decoration color 2009-04-20 22:57:37 +0200 pl r271015 : #i101063# fix warnings 2009-04-20 22:55:39 +0200 pl r271014 : #i101063# fix warnings 2009-04-20 11:35:24 +0200 hdu r270968 : #i1001102# remove dependency to psprint module 2009-04-20 11:31:08 +0200 hdu r270967 : #i100929# keep cached render Picture in X11SalGraphics removes 2009-04-20 11:24:57 +0200 hdu r270966 : #i100929# cache render Picture in X11SalGraphics 2009-04-18 14:53:22 +0200 hdu r270959 : CWS-TOOLING: rebase CWS vcl101 to trunk@270723 (milestone: DEV300:m46) 2009-04-17 12:00:50 +0200 hdu r270934 : #i100951# b2d-polygon clipping handles bezier-segments nowadays => performance opt possible 2009-04-17 11:50:49 +0200 hdu r270933 : #i100922# count b2d-polypoly-points to avoid priority-queue reallocations 2009-04-17 11:07:03 +0200 hdu r270930 : #i101145# match dpi-sanity check with gnome-UI (thanks Caolan!) 2009-04-17 10:44:41 +0200 hdu r270929 : #i100603# dingbats-encoded PDF-builtin fonts are symbol fonts too 2009-04-17 10:36:10 +0200 hdu r270928 : #i101145# check sanity of resolution reported by Xft-dpi (thanks CMC!) 2009-04-08 13:53:35 +0200 hdu r270644 : #i100951# avoid expensive calls to basegfx::tools::clipPolygonOnRange() if possible 2009-04-08 13:19:26 +0200 hdu r270637 : #i100922# prevent needless stl::priority_queue reallacations by reserving 2009-04-08 11:14:30 +0200 hdu r270627 : #i100929# use X11SalGraphics::GetXRenderPicture() also for text drawing 2009-04-08 10:00:42 +0200 hdu r270620 : #i100929# add and use X11SalGraphics::GetXRenderPicture() for polygon drawing 2009-04-06 15:52:47 +0200 hdu r270563 : #i100885# add and use AquaSalGraphics::copyResolution() to speed up virdev creation 2009-04-02 14:39:06 +0200 pl r270408 : #i95873# do not set LD_LIBRARY_PATH for external apps 2009-03-31 18:43:19 +0200 pl r270292 : #i99783# transparency of closer image changed to mask in the meantime 2009-03-27 15:42:37 +0100 hdu r270158 : #i100591# fix binary search in dingbats encoding converter 2009-03-27 13:06:34 +0100 hdu r270151 : #i100603# only PDF builtin text fonts use WinAnsiEncoding 2009-03-27 12:05:35 +0100 hdu r270147 : #i100603# use correct encoding for all PDF builtin fonts 2009-03-27 09:04:07 +0100 hdu r270133 : #i100603# use proper encoding for PDF builtin symbol fonts 2009-03-26 17:19:38 +0100 hdu r270090 : #i100591# support RTL_TEXTENCODING_ADOBE_DINGBATS encoding 2009-03-25 09:02:18 +0100 hdu r269995 : #i100521# prefer osl_getAsciiFunctionSymbol() when dynloading SAGE and extra USER32 symbols 2009-03-25 08:55:49 +0100 hdu r269994 : #i100521# prefer osl_getAsciiFunctionSymbol() when dynloading LUNA symbols 2009-03-24 16:15:54 +0100 hdu r269965 : #i100521# prefer osl_getAsciiFunctionSymbol() when dynloading vclplugin symbols 2009-03-24 16:10:29 +0100 hdu r269963 : #i100521# prefer osl_getAsciiFunctionSymbol() when dynloading USP symbols 2009-03-24 15:54:30 +0100 hdu r269962 : #i100521# prefer osl_getAsciiFunctionSymbol() when dynloading xrender symbols 2009-03-24 10:46:55 +0100 hdu r269920 : #i100506# fix WAE build breakers on unxsols4 for debug=true 2009-03-23 16:36:43 +0100 hdu r269884 : #159477# fix crash for PDFs with big zlib-chunks 2009-03-20 17:36:56 +0100 pl r269821 : #i96568# add recent files to mac quickstarter 2009-03-20 14:39:41 +0100 pl r269809 : #i35482# no HC mode detection, automatically done in independent part 2009-03-19 20:01:37 +0100 pl r269768 : #i95591# do not reuse UnxPloginComm because of connection loss problems 2009-03-19 18:08:23 +0100 pl r269765 : #i95588# change default visibility that was ignored everywhere but unix anyway
2009-06-03 15:45:09 +00:00
pSalData->mpSageEnableProc = (SysAgt_Enable_PROC)osl_getAsciiFunctionSymbol( mhSageInst, "System_Agent_Enable" );
2000-09-18 16:07:07 +00:00
}
else
pSalData->mnSageStatus = DISABLE_AGENT;
}
}
if ( pSalData->mpSageEnableProc )
{
pSalData->mnSageStatus = pSalData->mpSageEnableProc( GET_AGENT_STATUS );
if ( pSalData->mnSageStatus == ENABLE_AGENT )
pSalData->mpSageEnableProc( DISABLE_AGENT );
}
// turn off screen-saver when in Presentation mode
2000-09-18 16:07:07 +00:00
SystemParametersInfo( SPI_GETSCREENSAVEACTIVE, 0,
&(pSalData->mbScrSvrEnabled), 0 );
if ( pSalData->mbScrSvrEnabled )
SystemParametersInfo( SPI_SETSCREENSAVEACTIVE, FALSE, 0, 0 );
}
else
{
// turn on screen-saver
2000-09-18 16:07:07 +00:00
if ( pSalData->mbScrSvrEnabled )
SystemParametersInfo( SPI_SETSCREENSAVEACTIVE, pSalData->mbScrSvrEnabled, 0, 0 );
// re-activate system agents
2000-09-18 16:07:07 +00:00
if ( pSalData->mnSageStatus == ENABLE_AGENT )
pSalData->mpSageEnableProc( pSalData->mnSageStatus );
}
}
void WinSalFrame::SetAlwaysOnTop( bool bOnTop )
2000-09-18 16:07:07 +00:00
{
HWND hWnd;
if ( bOnTop )
hWnd = HWND_TOPMOST;
else
hWnd = HWND_NOTOPMOST;
SetWindowPos( mhWnd, hWnd, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE );
2000-09-18 16:07:07 +00:00
}
static void ImplSalToTop( HWND hWnd, sal_uInt16 nFlags )
2000-09-18 16:07:07 +00:00
{
WinSalFrame* pToTopFrame = GetWindowPtr( hWnd );
if( pToTopFrame && (pToTopFrame->mnStyle & SAL_FRAME_STYLE_SYSTEMCHILD) != 0 )
BringWindowToTop( hWnd );
2000-09-18 16:07:07 +00:00
if ( nFlags & SAL_FRAME_TOTOP_FOREGROUNDTASK )
{
// This magic code is necessary to connect the input focus of the
// current window thread and the thread which owns the window that
// should be the new foreground window.
HWND hCurrWnd = GetForegroundWindow();
DWORD myThreadID = GetCurrentThreadId();
DWORD currThreadID = GetWindowThreadProcessId(hCurrWnd,NULL);
AttachThreadInput(myThreadID, currThreadID,TRUE);
SetForegroundWindow(hWnd);
AttachThreadInput(myThreadID,currThreadID,FALSE);
}
if ( nFlags & SAL_FRAME_TOTOP_RESTOREWHENMIN )
{
HWND hIconicWnd = hWnd;
while ( hIconicWnd )
{
if ( IsIconic( hIconicWnd ) )
{
WinSalFrame* pFrame = GetWindowPtr( hIconicWnd );
if ( pFrame )
{
if ( GetWindowPtr( hWnd )->mbRestoreMaximize )
ShowWindow( hIconicWnd, SW_MAXIMIZE );
else
ShowWindow( hIconicWnd, SW_RESTORE );
}
else
ShowWindow( hIconicWnd, SW_RESTORE );
}
hIconicWnd = ::GetParent( hIconicWnd );
}
}
2008-10-01 13:31:44 +00:00
if ( !IsIconic( hWnd ) && IsWindowVisible( hWnd ) )
2000-09-18 16:07:07 +00:00
{
SetFocus( hWnd );
// Windows sometimes incorrectly reports to have the focus;
// thus make sure to really get the focus
2000-09-18 16:07:07 +00:00
if ( ::GetFocus() == hWnd )
SetForegroundWindow( hWnd );
}
}
void WinSalFrame::ToTop( sal_uInt16 nFlags )
2000-09-18 16:07:07 +00:00
{
2002-04-15 11:50:03 +00:00
nFlags &= ~SAL_FRAME_TOTOP_GRABFOCUS; // this flag is not needed on win32
2000-12-14 12:39:14 +00:00
// Post this Message to the window, because this only works
// in the thread of the window, which has create this window.
// We post this message to avoid deadlocks
if ( GetSalData()->mnAppThreadId != GetCurrentThreadId() )
PostMessageW( mhWnd, SAL_MSG_TOTOP, nFlags, 0 );
2000-12-14 12:39:14 +00:00
else
ImplSalToTop( mhWnd, nFlags );
2000-09-18 16:07:07 +00:00
}
void WinSalFrame::SetPointer( PointerStyle ePointerStyle )
2000-09-18 16:07:07 +00:00
{
struct ImplPtrData
{
HCURSOR mhCursor;
LPCSTR mnSysId;
UINT mnOwnId;
};
static o3tl::enumarray<PointerStyle, ImplPtrData> aImplPtrTab =
2000-09-18 16:07:07 +00:00
{
ImplPtrData{ 0, IDC_ARROW, 0 }, // POINTER_ARROW
2000-09-18 16:07:07 +00:00
{ 0, 0, SAL_RESID_POINTER_NULL }, // POINTER_NULL
{ 0, IDC_WAIT, 0 }, // POINTER_WAIT
{ 0, IDC_IBEAM, 0 }, // POINTER_TEXT
{ 0, IDC_HELP, 0 }, // POINTER_HELP
{ 0, IDC_CROSS, 0 }, // POINTER_CROSS
{ 0, IDC_SIZEALL, 0 }, // POINTER_MOVE
2000-09-18 16:07:07 +00:00
{ 0, IDC_SIZENS, 0 }, // POINTER_NSIZE
{ 0, IDC_SIZENS, 0 }, // POINTER_SSIZE
{ 0, IDC_SIZEWE, 0 }, // POINTER_WSIZE
{ 0, IDC_SIZEWE, 0 }, // POINTER_ESIZE
{ 0, IDC_SIZENWSE, 0 }, // POINTER_NWSIZE
{ 0, IDC_SIZENESW, 0 }, // POINTER_NESIZE
{ 0, IDC_SIZENESW, 0 }, // POINTER_SWSIZE
{ 0, IDC_SIZENWSE, 0 }, // POINTER_SESIZE
{ 0, IDC_SIZENS, 0 }, // POINTER_WINDOW_NSIZE
{ 0, IDC_SIZENS, 0 }, // POINTER_WINDOW_SSIZE
{ 0, IDC_SIZEWE, 0 }, // POINTER_WINDOW_WSIZE
{ 0, IDC_SIZEWE, 0 }, // POINTER_WINDOW_ESIZE
{ 0, IDC_SIZENWSE, 0 }, // POINTER_WINDOW_NWSIZE
{ 0, IDC_SIZENESW, 0 }, // POINTER_WINDOW_NESIZE
{ 0, IDC_SIZENESW, 0 }, // POINTER_WINDOW_SWSIZE
{ 0, IDC_SIZENWSE, 0 }, // POINTER_WINDOW_SESIZE
{ 0, IDC_SIZEWE, 0 }, // POINTER_HSPLIT
{ 0, IDC_SIZENS, 0 }, // POINTER_VSPLIT
{ 0, IDC_SIZEWE, 0 }, // POINTER_HSIZEBAR
{ 0, IDC_SIZENS, 0 }, // POINTER_VSIZEBAR
{ 0, IDC_HAND, 0 }, // POINTER_HAND
{ 0, IDC_HAND, 0 }, // POINTER_REFHAND
{ 0, IDC_PEN, 0 }, // POINTER_PEN
2000-09-18 16:07:07 +00:00
{ 0, 0, SAL_RESID_POINTER_MAGNIFY }, // POINTER_MAGNIFY
{ 0, 0, SAL_RESID_POINTER_FILL }, // POINTER_FILL
{ 0, 0, SAL_RESID_POINTER_ROTATE }, // POINTER_ROTATE
{ 0, 0, SAL_RESID_POINTER_HSHEAR }, // POINTER_HSHEAR
{ 0, 0, SAL_RESID_POINTER_VSHEAR }, // POINTER_VSHEAR
{ 0, 0, SAL_RESID_POINTER_MIRROR }, // POINTER_MIRROR
{ 0, 0, SAL_RESID_POINTER_CROOK }, // POINTER_CROOK
{ 0, 0, SAL_RESID_POINTER_CROP }, // POINTER_CROP
{ 0, 0, SAL_RESID_POINTER_MOVEPOINT }, // POINTER_MOVEPOINT
{ 0, 0, SAL_RESID_POINTER_MOVEBEZIERWEIGHT }, // POINTER_MOVEBEZIERWEIGHT
{ 0, 0, SAL_RESID_POINTER_MOVEDATA }, // POINTER_MOVEDATA
{ 0, 0, SAL_RESID_POINTER_COPYDATA }, // POINTER_COPYDATA
{ 0, 0, SAL_RESID_POINTER_LINKDATA }, // POINTER_LINKDATA
{ 0, 0, SAL_RESID_POINTER_MOVEDATALINK }, // POINTER_MOVEDATALINK
{ 0, 0, SAL_RESID_POINTER_COPYDATALINK }, // POINTER_COPYDATALINK
{ 0, 0, SAL_RESID_POINTER_MOVEFILE }, // POINTER_MOVEFILE
{ 0, 0, SAL_RESID_POINTER_COPYFILE }, // POINTER_COPYFILE
{ 0, 0, SAL_RESID_POINTER_LINKFILE }, // POINTER_LINKFILE
{ 0, 0, SAL_RESID_POINTER_MOVEFILELINK }, // POINTER_MOVEFILELINK
{ 0, 0, SAL_RESID_POINTER_COPYFILELINK }, // POINTER_COPYFILELINK
{ 0, 0, SAL_RESID_POINTER_MOVEFILES }, // POINTER_MOVEFILES
{ 0, 0, SAL_RESID_POINTER_COPYFILES }, // POINTER_COPYFILES
{ 0, IDC_NO, 0 }, // POINTER_NOTALLOWED
2000-09-18 16:07:07 +00:00
{ 0, 0, SAL_RESID_POINTER_DRAW_LINE }, // POINTER_DRAW_LINE
{ 0, 0, SAL_RESID_POINTER_DRAW_RECT }, // POINTER_DRAW_RECT
{ 0, 0, SAL_RESID_POINTER_DRAW_POLYGON }, // POINTER_DRAW_POLYGON
{ 0, 0, SAL_RESID_POINTER_DRAW_BEZIER }, // POINTER_DRAW_BEZIER
{ 0, 0, SAL_RESID_POINTER_DRAW_ARC }, // POINTER_DRAW_ARC
{ 0, 0, SAL_RESID_POINTER_DRAW_PIE }, // POINTER_DRAW_PIE
{ 0, 0, SAL_RESID_POINTER_DRAW_CIRCLECUT }, // POINTER_DRAW_CIRCLECUT
{ 0, 0, SAL_RESID_POINTER_DRAW_ELLIPSE }, // POINTER_DRAW_ELLIPSE
{ 0, 0, SAL_RESID_POINTER_DRAW_FREEHAND }, // POINTER_DRAW_FREEHAND
{ 0, 0, SAL_RESID_POINTER_DRAW_CONNECT }, // POINTER_DRAW_CONNECT
{ 0, 0, SAL_RESID_POINTER_DRAW_TEXT }, // POINTER_DRAW_TEXT
{ 0, 0, SAL_RESID_POINTER_DRAW_CAPTION }, // POINTER_DRAW_CAPTION
{ 0, 0, SAL_RESID_POINTER_CHART }, // POINTER_CHART
{ 0, 0, SAL_RESID_POINTER_DETECTIVE }, // POINTER_DETECTIVE
{ 0, 0, SAL_RESID_POINTER_PIVOT_COL }, // POINTER_PIVOT_COL
{ 0, 0, SAL_RESID_POINTER_PIVOT_ROW }, // POINTER_PIVOT_ROW
{ 0, 0, SAL_RESID_POINTER_PIVOT_FIELD }, // POINTER_PIVOT_FIELD
{ 0, 0, SAL_RESID_POINTER_CHAIN }, // POINTER_CHAIN
{ 0, 0, SAL_RESID_POINTER_CHAIN_NOTALLOWED }, // POINTER_CHAIN_NOTALLOWED
{ 0, 0, SAL_RESID_POINTER_TIMEEVENT_MOVE }, // POINTER_TIMEEVENT_MOVE
{ 0, 0, SAL_RESID_POINTER_TIMEEVENT_SIZE }, // POINTER_TIMEEVENT_SIZE
{ 0, 0, SAL_RESID_POINTER_AUTOSCROLL_N }, // POINTER_AUTOSCROLL_N
{ 0, 0, SAL_RESID_POINTER_AUTOSCROLL_S }, // POINTER_AUTOSCROLL_S
{ 0, 0, SAL_RESID_POINTER_AUTOSCROLL_W }, // POINTER_AUTOSCROLL_W
{ 0, 0, SAL_RESID_POINTER_AUTOSCROLL_E }, // POINTER_AUTOSCROLL_E
{ 0, 0, SAL_RESID_POINTER_AUTOSCROLL_NW }, // POINTER_AUTOSCROLL_NW
{ 0, 0, SAL_RESID_POINTER_AUTOSCROLL_NE }, // POINTER_AUTOSCROLL_NE
{ 0, 0, SAL_RESID_POINTER_AUTOSCROLL_SW }, // POINTER_AUTOSCROLL_SW
{ 0, 0, SAL_RESID_POINTER_AUTOSCROLL_SE }, // POINTER_AUTOSCROLL_SE
{ 0, 0, SAL_RESID_POINTER_AUTOSCROLL_NS }, // POINTER_AUTOSCROLL_NS
{ 0, 0, SAL_RESID_POINTER_AUTOSCROLL_WE }, // POINTER_AUTOSCROLL_WE
{ 0, 0, SAL_RESID_POINTER_AUTOSCROLL_NSWE }, // POINTER_AUTOSCROLL_NSWE
2000-11-15 19:52:59 +00:00
{ 0, 0, SAL_RESID_POINTER_AIRBRUSH }, // POINTER_AIRBRUSH
{ 0, 0, SAL_RESID_POINTER_TEXT_VERTICAL }, // POINTER_TEXT_VERTICAL
{ 0, 0, SAL_RESID_POINTER_PIVOT_DELETE }, // POINTER_PIVOT_DELETE
// #i32329#
{ 0, 0, SAL_RESID_POINTER_TAB_SELECT_S }, // POINTER_TAB_SELECT_S
{ 0, 0, SAL_RESID_POINTER_TAB_SELECT_E }, // POINTER_TAB_SELECT_E
{ 0, 0, SAL_RESID_POINTER_TAB_SELECT_SE }, // POINTER_TAB_SELECT_SE
{ 0, 0, SAL_RESID_POINTER_TAB_SELECT_W }, // POINTER_TAB_SELECT_W
{ 0, 0, SAL_RESID_POINTER_TAB_SELECT_SW }, // POINTER_TAB_SELECT_SW
// #i20119#
{ 0, 0, SAL_RESID_POINTER_PAINTBRUSH } // POINTER_PAINTBRUSH
2000-09-18 16:07:07 +00:00
};
// Mousepointer loaded ?
if ( !aImplPtrTab[ePointerStyle].mhCursor )
{
if ( aImplPtrTab[ePointerStyle].mnOwnId )
aImplPtrTab[ePointerStyle].mhCursor = ImplLoadSalCursor( aImplPtrTab[ePointerStyle].mnOwnId );
else
aImplPtrTab[ePointerStyle].mhCursor = LoadCursor( 0, aImplPtrTab[ePointerStyle].mnSysId );
}
// change the mouse pointer if different
if ( mhCursor != aImplPtrTab[ePointerStyle].mhCursor )
2000-09-18 16:07:07 +00:00
{
mhCursor = aImplPtrTab[ePointerStyle].mhCursor;
SetCursor( mhCursor );
2000-09-18 16:07:07 +00:00
}
}
void WinSalFrame::CaptureMouse( bool bCapture )
2000-09-18 16:07:07 +00:00
{
// Send this Message to the window, because CaptureMouse() only work
// in the thread of the window, which has create this window
int nMsg;
if ( bCapture )
nMsg = SAL_MSG_CAPTUREMOUSE;
else
nMsg = SAL_MSG_RELEASEMOUSE;
SendMessageW( mhWnd, nMsg, 0, 0 );
2000-09-18 16:07:07 +00:00
}
void WinSalFrame::SetPointerPos( long nX, long nY )
2000-09-18 16:07:07 +00:00
{
POINT aPt;
aPt.x = (int)nX;
aPt.y = (int)nY;
ClientToScreen( mhWnd, &aPt );
2000-09-18 16:07:07 +00:00
SetCursorPos( aPt.x, aPt.y );
}
void WinSalFrame::Flush()
2000-09-18 16:07:07 +00:00
{
GdiFlush();
}
void WinSalFrame::Sync()
2000-09-18 16:07:07 +00:00
{
GdiFlush();
}
2001-06-22 13:15:50 +00:00
static void ImplSalFrameSetInputContext( HWND hWnd, const SalInputContext* pContext )
2000-09-18 16:07:07 +00:00
{
WinSalFrame* pFrame = GetWindowPtr( hWnd );
bool bIME(pContext->mnOptions & InputContextFlags::Text);
2000-11-03 13:17:43 +00:00
if ( bIME )
2000-09-18 16:07:07 +00:00
{
if ( !pFrame->mbIME )
2000-11-03 13:17:43 +00:00
{
pFrame->mbIME = TRUE;
2000-11-03 13:17:43 +00:00
if ( pFrame->mhDefIMEContext )
2000-11-03 13:17:43 +00:00
{
ImmAssociateContext( pFrame->mhWnd, pFrame->mhDefIMEContext );
2000-11-03 13:17:43 +00:00
UINT nImeProps = ImmGetProperty( GetKeyboardLayout( 0 ), IGP_PROPERTY );
pFrame->mbSpezIME = (nImeProps & IME_PROP_SPECIAL_UI) != 0;
pFrame->mbAtCursorIME = (nImeProps & IME_PROP_AT_CARET) != 0;
pFrame->mbHandleIME = !pFrame->mbSpezIME;
2000-11-03 13:17:43 +00:00
}
}
// When the application can't handle IME messages, then the
// System should handle the IME handling
if ( !(pContext->mnOptions & InputContextFlags::ExtText) )
pFrame->mbHandleIME = FALSE;
2000-11-03 13:17:43 +00:00
// Set the Font for IME Handling
if ( pContext->mpFont )
{
HIMC hIMC = ImmGetContext( pFrame->mhWnd );
2000-11-03 13:17:43 +00:00
if ( hIMC )
{
LOGFONTW aLogFont;
HDC hDC = GetDC( pFrame->mhWnd );
// In case of vertical writing, always append a '@' to the
// Windows font name, not only if such a Windows font really is
// available (bTestVerticalAvail == false in the below call):
// The Windows IME's candidates window seems to always use a
// font that has all necessary glyphs, not necessarily the one
// specified by this font name; but it seems to decide whether
// to use that font's horizontal or vertical variant based on a
// '@' in front of this font name.
ImplGetLogFontFromFontSelect( hDC, pContext->mpFont, aLogFont,
false );
ReleaseDC( pFrame->mhWnd, hDC );
2000-11-03 13:17:43 +00:00
ImmSetCompositionFontW( hIMC, &aLogFont );
ImmReleaseContext( pFrame->mhWnd, hIMC );
2000-11-03 13:17:43 +00:00
}
}
2000-09-18 16:07:07 +00:00
}
else
{
if ( pFrame->mbIME )
2000-09-18 16:07:07 +00:00
{
pFrame->mbIME = FALSE;
pFrame->mbHandleIME = FALSE;
ImmAssociateContext( pFrame->mhWnd, 0 );
2000-09-18 16:07:07 +00:00
}
}
}
void WinSalFrame::SetInputContext( SalInputContext* pContext )
2001-06-22 13:15:50 +00:00
{
// Must be called in the main thread!
SendMessageW( mhWnd, SAL_MSG_SETINPUTCONTEXT, 0, (LPARAM)(void*)pContext );
2001-06-22 13:15:50 +00:00
}
static void ImplSalFrameEndExtTextInput( HWND hWnd, EndExtTextInputFlags nFlags )
2000-09-18 16:07:07 +00:00
{
HIMC hIMC = ImmGetContext( hWnd );
if ( hIMC )
{
DWORD nIndex;
if ( nFlags & EndExtTextInputFlags::Complete )
2000-09-18 16:07:07 +00:00
nIndex = CPS_COMPLETE;
else
nIndex = CPS_CANCEL;
ImmNotifyIME( hIMC, NI_COMPOSITIONSTR, nIndex, 0 );
ImmReleaseContext( hWnd, hIMC );
}
}
void WinSalFrame::EndExtTextInput( EndExtTextInputFlags nFlags )
2001-06-22 13:15:50 +00:00
{
// Must be called in the main thread!
SendMessageW( mhWnd, SAL_MSG_ENDEXTTEXTINPUT, (WPARAM)nFlags, 0 );
2001-06-22 13:15:50 +00:00
}
2000-09-18 16:07:07 +00:00
static void ImplGetKeyNameText( LONG lParam, sal_Unicode* pBuf,
UINT& rCount, UINT nMaxSize,
const sal_Char* pReplace )
{
DBG_ASSERT( sizeof( WCHAR ) == sizeof( sal_Unicode ), "WinSalFrame::ImplGetKeyNameTextW(): WCHAR != sal_Unicode" );
2000-09-18 16:07:07 +00:00
static const int nMaxKeyLen = 350;
WCHAR aKeyBuf[ nMaxKeyLen ];
2000-09-18 16:07:07 +00:00
int nKeyLen = 0;
if ( lParam )
{
OUString aLang = Application::GetSettings().GetUILanguageTag().getLanguage();
OUString aRet;
aRet = ::vcl_sal::getKeysReplacementName( aLang, lParam );
if( aRet.isEmpty() )
{
nKeyLen = GetKeyNameTextW( lParam, aKeyBuf, nMaxKeyLen );
DBG_ASSERT( nKeyLen <= nMaxKeyLen, "Invalid key name length!" );
if( nKeyLen > nMaxKeyLen )
nKeyLen = 0;
else if( nKeyLen > 0 )
2000-09-18 16:07:07 +00:00
{
// Capitalize just the first letter of key names
CharLowerBuffW( aKeyBuf, nKeyLen );
bool bUpper = true;
for( WCHAR *pW=aKeyBuf, *pE=pW+nKeyLen; pW < pE; ++pW )
{
if( bUpper )
CharUpperBuffW( pW, 1 );
bUpper = (*pW=='+') || (*pW=='-') || (*pW==' ') || (*pW=='.');
}
2000-09-18 16:07:07 +00:00
}
}
else
{
nKeyLen = aRet.getLength();
wcscpy( aKeyBuf, reinterpret_cast< const wchar_t* >( aRet.getStr() ));
}
2000-09-18 16:07:07 +00:00
}
if ( (nKeyLen > 0) || pReplace )
{
if( (rCount > 0) && (rCount < nMaxSize) )
2000-09-18 16:07:07 +00:00
{
pBuf[rCount] = '+';
rCount++;
}
if( nKeyLen > 0 )
2000-09-18 16:07:07 +00:00
{
WCHAR *pW = aKeyBuf, *pE = aKeyBuf + nKeyLen;
while( *pW && (pW < pE) && (rCount < nMaxSize) )
pBuf[rCount++] = *pW++;
2000-09-18 16:07:07 +00:00
}
else // fall back to provided default name
2000-09-18 16:07:07 +00:00
{
while( *pReplace && (rCount < nMaxSize) )
2000-09-18 16:07:07 +00:00
{
pBuf[rCount] = *pReplace;
rCount++;
pReplace++;
}
}
}
else
rCount = 0;
}
OUString WinSalFrame::GetKeyName( sal_uInt16 nKeyCode )
2000-09-18 16:07:07 +00:00
{
static const UINT nMaxKeyLen = 350;
sal_Unicode aKeyBuf[ nMaxKeyLen ];
2000-09-18 16:07:07 +00:00
UINT nKeyBufLen = 0;
UINT nSysCode = 0;
2000-09-18 16:07:07 +00:00
if ( nKeyCode & KEY_MOD1 )
2000-09-18 16:07:07 +00:00
{
nSysCode = MapVirtualKey( VK_CONTROL, 0 );
nSysCode = (nSysCode << 16) | (((sal_uLong)1) << 25);
ImplGetKeyNameText( nSysCode, aKeyBuf, nKeyBufLen, nMaxKeyLen, "Ctrl" );
2000-09-18 16:07:07 +00:00
}
if ( nKeyCode & KEY_MOD2 )
2000-09-18 16:07:07 +00:00
{
nSysCode = MapVirtualKey( VK_MENU, 0 );
nSysCode = (nSysCode << 16) | (((sal_uLong)1) << 25);
ImplGetKeyNameText( nSysCode, aKeyBuf, nKeyBufLen, nMaxKeyLen, "Alt" );
2000-09-18 16:07:07 +00:00
}
if ( nKeyCode & KEY_SHIFT )
{
nSysCode = MapVirtualKey( VK_SHIFT, 0 );
nSysCode = (nSysCode << 16) | (((sal_uLong)1) << 25);
ImplGetKeyNameText( nSysCode, aKeyBuf, nKeyBufLen, nMaxKeyLen, "Shift" );
2000-09-18 16:07:07 +00:00
}
sal_uInt16 nCode = nKeyCode & 0x0FFF;
sal_uLong nSysCode2 = 0;
const sal_Char* pReplace = NULL;
2000-09-18 16:07:07 +00:00
sal_Unicode cSVCode = 0;
sal_Char aFBuf[4];
nSysCode = 0;
if ( (nCode >= KEY_0) && (nCode <= KEY_9) )
cSVCode = '0' + (nCode - KEY_0);
else if ( (nCode >= KEY_A) && (nCode <= KEY_Z) )
cSVCode = 'A' + (nCode - KEY_A);
else if ( (nCode >= KEY_F1) && (nCode <= KEY_F26) )
{
nSysCode = VK_F1 + (nCode - KEY_F1);
aFBuf[0] = 'F';
if ( (nCode >= KEY_F1) && (nCode <= KEY_F9) )
{
aFBuf[1] = sal::static_int_cast<sal_Char>('1' + (nCode - KEY_F1));
2000-09-18 16:07:07 +00:00
aFBuf[2] = 0;
}
else if ( (nCode >= KEY_F10) && (nCode <= KEY_F19) )
{
aFBuf[1] = '1';
aFBuf[2] = sal::static_int_cast<sal_Char>('0' + (nCode - KEY_F10));
2000-09-18 16:07:07 +00:00
aFBuf[3] = 0;
}
else
{
aFBuf[1] = '2';
aFBuf[2] = sal::static_int_cast<sal_Char>('0' + (nCode - KEY_F20));
2000-09-18 16:07:07 +00:00
aFBuf[3] = 0;
}
pReplace = aFBuf;
}
else
{
switch ( nCode )
{
case KEY_DOWN:
nSysCode = VK_DOWN;
nSysCode2 = (((sal_uLong)1) << 24);
2000-09-18 16:07:07 +00:00
pReplace = "Down";
break;
case KEY_UP:
nSysCode = VK_UP;
nSysCode2 = (((sal_uLong)1) << 24);
2000-09-18 16:07:07 +00:00
pReplace = "Up";
break;
case KEY_LEFT:
nSysCode = VK_LEFT;
nSysCode2 = (((sal_uLong)1) << 24);
2000-09-18 16:07:07 +00:00
pReplace = "Left";
break;
case KEY_RIGHT:
nSysCode = VK_RIGHT;
nSysCode2 = (((sal_uLong)1) << 24);
2000-09-18 16:07:07 +00:00
pReplace = "Right";
break;
case KEY_HOME:
nSysCode = VK_HOME;
nSysCode2 = (((sal_uLong)1) << 24);
2000-09-18 16:07:07 +00:00
pReplace = "Home";
break;
case KEY_END:
nSysCode = VK_END;
nSysCode2 = (((sal_uLong)1) << 24);
2000-09-18 16:07:07 +00:00
pReplace = "End";
break;
case KEY_PAGEUP:
nSysCode = VK_PRIOR;
nSysCode2 = (((sal_uLong)1) << 24);
2000-09-18 16:07:07 +00:00
pReplace = "Page Up";
break;
case KEY_PAGEDOWN:
nSysCode = VK_NEXT;
nSysCode2 = (((sal_uLong)1) << 24);
2000-09-18 16:07:07 +00:00
pReplace = "Page Down";
break;
case KEY_RETURN:
nSysCode = VK_RETURN;
pReplace = "Enter";
break;
case KEY_ESCAPE:
nSysCode = VK_ESCAPE;
pReplace = "Escape";
break;
case KEY_TAB:
nSysCode = VK_TAB;
pReplace = "Tab";
break;
case KEY_BACKSPACE:
nSysCode = VK_BACK;
pReplace = "Backspace";
break;
case KEY_SPACE:
nSysCode = VK_SPACE;
pReplace = "Space";
break;
case KEY_INSERT:
nSysCode = VK_INSERT;
nSysCode2 = (((sal_uLong)1) << 24);
2000-09-18 16:07:07 +00:00
pReplace = "Insert";
break;
case KEY_DELETE:
nSysCode = VK_DELETE;
nSysCode2 = (((sal_uLong)1) << 24);
2000-09-18 16:07:07 +00:00
pReplace = "Delete";
break;
case KEY_ADD:
cSVCode = '+';
break;
case KEY_SUBTRACT:
cSVCode = '-';
break;
case KEY_MULTIPLY:
cSVCode = '*';
break;
case KEY_DIVIDE:
cSVCode = '/';
break;
case KEY_POINT:
cSVCode = '.';
break;
case KEY_COMMA:
cSVCode = ',';
break;
case KEY_LESS:
cSVCode = '<';
break;
case KEY_GREATER:
cSVCode = '>';
break;
case KEY_EQUAL:
cSVCode = '=';
break;
case KEY_SEMICOLON:
cSVCode = ';';
break;
case KEY_QUOTERIGHT:
cSVCode = '\'';
break;
case KEY_BRACKETLEFT:
cSVCode = '[';
break;
case KEY_BRACKETRIGHT:
cSVCode = ']';
break;
2000-09-18 16:07:07 +00:00
}
}
if ( nSysCode )
{
nSysCode = MapVirtualKey( (UINT)nSysCode, 0 );
if ( nSysCode )
nSysCode = (nSysCode << 16) | nSysCode2;
ImplGetKeyNameText( nSysCode, aKeyBuf, nKeyBufLen, nMaxKeyLen, pReplace );
2000-09-18 16:07:07 +00:00
}
else
{
if ( cSVCode )
{
if ( nKeyBufLen > 0 )
aKeyBuf[ nKeyBufLen++ ] = '+';
if( nKeyBufLen < nMaxKeyLen )
aKeyBuf[ nKeyBufLen++ ] = cSVCode;
2000-09-18 16:07:07 +00:00
}
}
if( !nKeyBufLen )
return OUString();
2000-09-18 16:07:07 +00:00
return OUString( aKeyBuf, sal::static_int_cast< sal_uInt16 >(nKeyBufLen) );
2000-09-18 16:07:07 +00:00
}
inline Color ImplWinColorToSal( COLORREF nColor )
{
return Color( GetRValue( nColor ), GetGValue( nColor ), GetBValue( nColor ) );
}
static void ImplSalUpdateStyleFontW( HDC hDC, const LOGFONTW& rLogFont, vcl::Font& rFont )
2000-09-18 16:07:07 +00:00
{
ImplSalLogFontToFontW( hDC, rLogFont, rFont );
2001-06-07 15:52:11 +00:00
// On Windows 9x, Windows NT we get sometimes very small sizes
// (for example for the small Caption height).
// So if it is MS Sans Serif, a none scalable font we use
// 8 Point as the minimum control height, in all other cases
// 6 Point is the smallest one
if ( rFont.GetHeight() < 8 )
{
if ( rtl_ustr_compareIgnoreAsciiCase( reinterpret_cast<const sal_Unicode*>(rLogFont.lfFaceName), reinterpret_cast<const sal_Unicode*>(L"MS Sans Serif") ) == 0 )
rFont.SetHeight( 8 );
else if ( rFont.GetHeight() < 6 )
rFont.SetHeight( 6 );
}
2000-09-18 16:07:07 +00:00
}
static long ImplA2I( const BYTE* pStr )
{
long n = 0;
int nSign = 1;
if ( *pStr == '-' )
{
nSign = -1;
pStr++;
}
while( (*pStr >= 48) && (*pStr <= 57) )
{
n *= 10;
n += ((*pStr) - 48);
pStr++;
}
n *= nSign;
return n;
}
void WinSalFrame::UpdateSettings( AllSettings& rSettings )
2000-09-18 16:07:07 +00:00
{
MouseSettings aMouseSettings = rSettings.GetMouseSettings();
aMouseSettings.SetDoubleClickTime( GetDoubleClickTime() );
aMouseSettings.SetDoubleClickWidth( GetSystemMetrics( SM_CXDOUBLECLK ) );
aMouseSettings.SetDoubleClickHeight( GetSystemMetrics( SM_CYDOUBLECLK ) );
long nDragWidth = GetSystemMetrics( SM_CXDRAG );
long nDragHeight = GetSystemMetrics( SM_CYDRAG );
if ( nDragWidth )
aMouseSettings.SetStartDragWidth( nDragWidth );
if ( nDragHeight )
aMouseSettings.SetStartDragHeight( nDragHeight );
HKEY hRegKey;
if ( RegOpenKey( HKEY_CURRENT_USER,
"Control Panel\\Desktop",
&hRegKey ) == ERROR_SUCCESS )
{
BYTE aValueBuf[10];
DWORD nValueSize = sizeof( aValueBuf );
DWORD nType;
if ( RegQueryValueEx( hRegKey, "MenuShowDelay", 0,
&nType, aValueBuf, &nValueSize ) == ERROR_SUCCESS )
{
if ( nType == REG_SZ )
aMouseSettings.SetMenuDelay( (sal_uLong)ImplA2I( aValueBuf ) );
2000-09-18 16:07:07 +00:00
}
RegCloseKey( hRegKey );
}
StyleSettings aStyleSettings = rSettings.GetStyleSettings();
aStyleSettings.SetScrollBarSize( GetSystemMetrics( SM_CXVSCROLL ) );
aStyleSettings.SetSpinSize( GetSystemMetrics( SM_CXVSCROLL ) );
UINT blinkTime = GetCaretBlinkTime();
aStyleSettings.SetCursorBlinkTime(
blinkTime == 0 || blinkTime == INFINITE // 0 indicates error
? STYLE_CURSOR_NOBLINKTIME : blinkTime );
aStyleSettings.SetFloatTitleHeight( GetSystemMetrics( SM_CYSMCAPTION ) );
aStyleSettings.SetTitleHeight( GetSystemMetrics( SM_CYCAPTION ) );
aStyleSettings.SetActiveBorderColor( ImplWinColorToSal( GetSysColor( COLOR_ACTIVEBORDER ) ) );
aStyleSettings.SetDeactiveBorderColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVEBORDER ) ) );
Merge commit 'ooo/DEV300_m101' into intm101 The following builds for me: basebmp, basegfx, comphelper, dtrans, i18npool, i18nutil, l10ntools, o3tl, psprint_config, regexp, rsc, sax, sot, tools, ucbhelper, unotools, vcl The rest still needs fixing ;-) Conflicts: canvas/prj/build.lst canvas/source/cairo/cairo_textlayout.cxx canvas/source/directx/dx_winstuff.hxx canvas/source/tools/image.cxx canvas/source/vcl/canvashelper.cxx comphelper/inc/comphelper/documentconstants.hxx comphelper/inc/comphelper/optionalvalue.hxx comphelper/inc/comphelper/querydeep.hxx comphelper/prj/build.lst comphelper/qa/complex/makefile.mk comphelper/qa/string/test_string_noadditional.cxx comphelper/source/misc/componentmodule.cxx comphelper/source/misc/mimeconfighelper.cxx comphelper/source/misc/querydeep.cxx comphelper/source/misc/uieventslogger.cxx comphelper/source/property/TypeGeneration.cxx comphelper/test/uno_iterators/uno_iterators.cxx comphelper/util/makefile.mk cppcanvas/source/mtfrenderer/implrenderer.cxx dtrans/prj/build.lst dtrans/source/generic/dtrans.cxx dtrans/source/win32/dtobj/FmtFilter.cxx i18npool/prj/build.lst i18npool/source/localedata/data/localedata_others.map i18npool/source/localedata/data/makefile.mk i18npool/source/localedata/localedata.cxx i18npool/source/localedata/saxparser.cxx i18npool/source/registerservices/registerservices.cxx i18npool/source/search/textsearch.cxx l10ntools/inc/cfgmerge.hxx l10ntools/inc/export.hxx l10ntools/inc/gsicheck.hxx l10ntools/inc/l10ntools/vosapp.hxx l10ntools/inc/tagtest.hxx l10ntools/inc/xmlparse.hxx l10ntools/layout/layoutparse.cxx l10ntools/layout/tralay.cxx l10ntools/source/cfgmerge.cxx l10ntools/source/export.cxx l10ntools/source/export2.cxx l10ntools/source/gsicheck.cxx l10ntools/source/help/HelpLinker.cxx l10ntools/source/lngex.cxx l10ntools/source/lngmerge.cxx l10ntools/source/merge.cxx l10ntools/source/tagtest.cxx l10ntools/source/xmlparse.cxx padmin/source/fontentry.cxx padmin/source/padialog.cxx padmin/source/padialog.src padmin/source/pamain.cxx rsc/inc/rscarray.hxx rsc/inc/rscclass.hxx rsc/inc/rscclobj.hxx rsc/inc/rsccont.hxx rsc/inc/rscdb.hxx rsc/inc/rscdef.hxx rsc/inc/rscmgr.hxx rsc/inc/rscrange.hxx rsc/inc/rsctop.hxx rsc/inc/vclrsc.hxx rsc/source/parser/rscdb.cxx rsc/source/parser/rscicpx.cxx rsc/source/parser/rscinit.cxx rsc/source/prj/start.cxx rsc/source/res/rscarray.cxx rsc/source/res/rscclass.cxx rsc/source/res/rscclobj.cxx rsc/source/res/rsccont.cxx rsc/source/res/rscmgr.cxx rsc/source/res/rscrange.cxx rsc/source/res/rsctop.cxx rsc/source/rsc/rsc.cxx rsc/source/tools/rscdef.cxx rsc/source/tools/rsctools.cxx sax/source/expatwrap/sax_expat.cxx sax/source/fastparser/facreg.cxx sax/source/tools/fastserializer.cxx sot/inc/sot/filelist.hxx sot/inc/sot/object.hxx sot/source/base/factory.cxx sot/source/base/filelist.cxx sot/source/sdstor/stg.cxx sot/source/sdstor/stgcache.cxx sot/source/sdstor/stgole.cxx sot/source/sdstor/stgstrms.cxx sot/source/sdstor/storage.cxx sot/source/sdstor/ucbstorage.cxx svl/inc/svl/cenumitm.hxx svl/inc/svl/cintitem.hxx svl/inc/svl/cntwall.hxx svl/inc/svl/ctypeitm.hxx svl/inc/svl/custritm.hxx svl/inc/svl/dateitem.hxx svl/inc/svl/filerec.hxx svl/inc/svl/globalnameitem.hxx svl/inc/svl/ilstitem.hxx svl/inc/svl/imageitm.hxx svl/inc/svl/intitem.hxx svl/inc/svl/itempool.hxx svl/inc/svl/itemset.hxx svl/inc/svl/lckbitem.hxx svl/inc/svl/poolitem.hxx svl/inc/svl/ptitem.hxx svl/inc/svl/rectitem.hxx svl/inc/svl/sfontitm.hxx svl/inc/svl/slstitm.hxx svl/inc/svl/srchitem.hxx svl/inc/svl/svarray.hxx svl/inc/svl/svdde.hxx svl/inc/svl/svstdarr.hxx svl/inc/svl/szitem.hxx svl/inc/svl/visitem.hxx svl/inc/svl/zforlist.hxx svl/inc/svl/zformat.hxx svl/prj/build.lst svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx svl/qa/complex/ConfigItems/helper/makefile.mk svl/qa/makefile.mk svl/source/filepicker/pickerhelper.cxx svl/source/filerec/filerec.cxx svl/source/items/cenumitm.cxx svl/source/items/cintitem.cxx svl/source/items/cntwall.cxx svl/source/items/ctypeitm.cxx svl/source/items/custritm.cxx svl/source/items/dateitem.cxx svl/source/items/globalnameitem.cxx svl/source/items/ilstitem.cxx svl/source/items/imageitm.cxx svl/source/items/intitem.cxx svl/source/items/itempool.cxx svl/source/items/itemprop.cxx svl/source/items/itemset.cxx svl/source/items/lckbitem.cxx svl/source/items/poolio.cxx svl/source/items/poolitem.cxx svl/source/items/ptitem.cxx svl/source/items/rectitem.cxx svl/source/items/slstitm.cxx svl/source/items/srchitem.cxx svl/source/items/style.cxx svl/source/items/szitem.cxx svl/source/items/visitem.cxx svl/source/items/whiter.cxx svl/source/memtools/svarray.cxx svl/source/misc/PasswordHelper.cxx svl/source/misc/adrparse.cxx svl/source/misc/lngmisc.cxx svl/source/notify/brdcst.cxx svl/source/notify/listener.cxx svl/source/notify/listenerbase.cxx svl/source/numbers/makefile.mk svl/source/numbers/nbdll.cxx svl/source/numbers/zforfind.cxx svl/source/numbers/zforlist.cxx svl/source/numbers/zformat.cxx svl/source/numbers/zforscan.cxx svl/source/passwordcontainer/passwordcontainer.cxx svl/source/svdde/ddecli.cxx svl/source/svdde/ddeimp.hxx svl/source/svdde/ddemlos2.h svl/source/svdde/ddesvr.cxx svl/source/undo/undo.cxx svl/source/uno/registerservices.cxx svl/util/makefile.mk svtools/bmpmaker/bmpsum.cxx svtools/bmpmaker/g2g.cxx svtools/bmpmaker/makefile.mk svtools/inc/borderhelper.hxx svtools/inc/svtools/accessiblefactory.hxx svtools/inc/svtools/apearcfg.hxx svtools/inc/svtools/brwbox.hxx svtools/inc/svtools/ctrlbox.hxx svtools/inc/svtools/ctrltool.hxx svtools/inc/svtools/editbrowsebox.hxx svtools/inc/svtools/ehdl.hxx svtools/inc/svtools/embedhlp.hxx svtools/inc/svtools/filter.hxx svtools/inc/svtools/ivctrl.hxx svtools/inc/svtools/parhtml.hxx svtools/inc/svtools/printdlg.hxx svtools/inc/svtools/rtftoken.h svtools/inc/svtools/ruler.hxx svtools/inc/svtools/svicnvw.hxx svtools/inc/svtools/svlbitm.hxx svtools/inc/svtools/svlbox.hxx svtools/inc/svtools/svtreebx.hxx svtools/inc/svtools/tabbar.hxx svtools/inc/svtools/table/abstracttablecontrol.hxx svtools/inc/svtools/taskbar.hxx svtools/inc/svtools/textview.hxx svtools/inc/svtools/valueset.hxx svtools/source/brwbox/brwbox1.cxx svtools/source/brwbox/brwbox2.cxx svtools/source/brwbox/datwin.cxx svtools/source/brwbox/datwin.hxx svtools/source/brwbox/makefile.mk svtools/source/config/apearcfg.cxx svtools/source/config/htmlcfg.cxx svtools/source/config/menuoptions.cxx svtools/source/config/miscopt.cxx svtools/source/contnr/cont_pch.cxx svtools/source/contnr/ctrdll.cxx svtools/source/contnr/fileview.cxx svtools/source/contnr/imivctl1.cxx svtools/source/contnr/ivctrl.cxx svtools/source/contnr/makefile.mk svtools/source/contnr/svcontnr.src svtools/source/contnr/svicnvw.cxx svtools/source/contnr/svimpbox.cxx svtools/source/contnr/svimpicn.cxx svtools/source/contnr/svlbitm.cxx svtools/source/contnr/svtreebx.cxx svtools/source/contnr/templwin.cxx svtools/source/contnr/templwin.hxx svtools/source/control/asynclink.cxx svtools/source/control/ctrlbox.cxx svtools/source/control/ctrldll.cxx svtools/source/control/ctrltool.cxx svtools/source/control/filectrl.cxx svtools/source/control/filectrl.src svtools/source/control/headbar.cxx svtools/source/control/inettbc.cxx svtools/source/control/makefile.mk svtools/source/control/prgsbar.cxx svtools/source/control/roadmap.cxx svtools/source/control/ruler.cxx svtools/source/control/scriptedtext.cxx svtools/source/control/stdmenu.cxx svtools/source/control/tabbar.cxx svtools/source/control/taskbar.cxx svtools/source/control/taskbox.cxx svtools/source/control/taskmisc.cxx svtools/source/control/taskstat.cxx svtools/source/control/valueacc.cxx svtools/source/control/valueset.cxx svtools/source/dialogs/addresstemplate.cxx svtools/source/dialogs/addresstemplate.src svtools/source/dialogs/colrdlg.src svtools/source/dialogs/filedlg2.cxx svtools/source/dialogs/filedlg2.hxx svtools/source/dialogs/makefile.mk svtools/source/dialogs/printdlg.cxx svtools/source/dialogs/printdlg.src svtools/source/dialogs/propctrl.cxx svtools/source/dialogs/propctrl.hxx svtools/source/dialogs/property.cxx svtools/source/edit/makefile.mk svtools/source/edit/sychconv.cxx svtools/source/edit/syntaxhighlight.cxx svtools/source/edit/textdoc.cxx svtools/source/edit/texteng.cxx svtools/source/edit/textundo.cxx svtools/source/edit/textview.cxx svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx svtools/source/filter.vcl/filter/dlgejpg.cxx svtools/source/filter.vcl/filter/dlgejpg.hxx svtools/source/filter.vcl/filter/dlgejpg.src svtools/source/filter.vcl/filter/dlgepng.cxx svtools/source/filter.vcl/filter/dlgepng.hxx svtools/source/filter.vcl/filter/dlgepng.src svtools/source/filter.vcl/filter/dlgexpor.cxx svtools/source/filter.vcl/filter/dlgexpor.hxx svtools/source/filter.vcl/filter/dlgexpor.src svtools/source/filter.vcl/filter/filter2.cxx svtools/source/filter.vcl/filter/makefile.mk svtools/source/filter.vcl/filter/sgfbram.cxx svtools/source/filter.vcl/filter/sgvmain.cxx svtools/source/filter.vcl/filter/sgvspln.cxx svtools/source/filter.vcl/filter/strings.src svtools/source/filter.vcl/jpeg/makefile.mk svtools/source/filter.vcl/wmf/emfwr.cxx svtools/source/filter.vcl/wmf/emfwr.hxx svtools/source/filter.vcl/wmf/enhwmf.cxx svtools/source/filter.vcl/wmf/winmtf.hxx svtools/source/filter.vcl/wmf/wmfwr.cxx svtools/source/filter.vcl/wmf/wmfwr.hxx svtools/source/graphic/grfcache.cxx svtools/source/graphic/grfcache.hxx svtools/source/graphic/grfmgr.cxx svtools/source/graphic/makefile.mk svtools/source/inc/accessibletableimp.hxx svtools/source/inc/svimpbox.hxx svtools/source/java/patchjavaerror.src svtools/source/misc/ehdl.cxx svtools/source/misc/errtxt.src svtools/source/misc/helpagentwindow.cxx svtools/source/misc/imagemgr.cxx svtools/source/misc/imagemgr.src svtools/source/misc/imageresourceaccess.cxx svtools/source/misc/imap.cxx svtools/source/misc/langtab.src svtools/source/misc/makefile.mk svtools/source/misc/svtdata.cxx svtools/source/misc/templatefoldercache.cxx svtools/source/misc/transfer2.cxx svtools/source/misc/undo.src svtools/source/plugapp/commtest.cxx svtools/source/plugapp/commtest.src svtools/source/plugapp/makefile.mk svtools/source/plugapp/testtool.src svtools/source/productregistration/productregistration.cxx svtools/source/svhtml/htmlkywd.cxx svtools/source/svhtml/parhtml.cxx svtools/source/svrtf/rtfkey2.cxx svtools/source/svrtf/rtfkeywd.cxx svtools/source/table/defaultinputhandler.cxx svtools/source/table/makefile.mk svtools/source/table/tablecontrol.cxx svtools/source/table/tablecontrol_impl.cxx svtools/source/table/tablecontrol_impl.hxx svtools/source/table/tabledatawindow.cxx svtools/source/table/tablegeometry.cxx svtools/source/table/tablegeometry.hxx svtools/source/toolpanel/makefile.mk svtools/source/toolpanel/toolpaneldrawer.cxx svtools/source/uno/addrtempuno.cxx svtools/source/uno/miscservices.cxx svtools/source/uno/svtxgridcontrol.cxx svtools/source/uno/svtxgridcontrol.hxx svtools/source/uno/toolboxcontroller.cxx svtools/source/uno/treecontrolpeer.cxx svtools/source/uno/unocontroltablemodel.cxx svtools/source/uno/unocontroltablemodel.hxx svtools/source/uno/unoimap.cxx svtools/source/urlobj/inetimg.cxx svtools/util/makefile.mk svtools/workben/browser.cxx svtools/workben/cui/makefile.mk svtools/workben/makefile.mk svtools/workben/stest.cxx svtools/workben/toolpanel/makefile.mk svtools/workben/urange.cxx toolkit/inc/toolkit/awt/vclxdevice.hxx toolkit/inc/toolkit/awt/vclxgraphics.hxx toolkit/inc/toolkit/awt/vclxwindows.hxx toolkit/inc/toolkit/controls/dialogcontrol.hxx toolkit/inc/toolkit/helper/property.hxx toolkit/inc/toolkit/helper/servicenames.hxx toolkit/inc/toolkit/helper/throbberimpl.hxx toolkit/qa/complex/toolkit/accessibility/_XAccessibleComponent.java toolkit/source/awt/asynccallback.cxx toolkit/source/awt/vclxgraphics.cxx toolkit/source/awt/vclxtoolkit.cxx toolkit/source/awt/vclxwindow.cxx toolkit/source/awt/xsimpleanimation.cxx toolkit/source/awt/xthrobber.cxx toolkit/source/controls/dialogcontrol.cxx toolkit/source/controls/grid/defaultgridcolumnmodel.cxx toolkit/source/controls/grid/defaultgriddatamodel.cxx toolkit/source/controls/grid/gridcontrol.cxx toolkit/source/controls/grid/initguard.hxx toolkit/source/controls/unocontrol.cxx toolkit/source/controls/unocontrolcontainer.cxx toolkit/source/controls/unocontrols.cxx toolkit/source/helper/listenermultiplexer.cxx toolkit/source/helper/property.cxx toolkit/source/helper/registerservices.cxx toolkit/source/helper/servicenames.cxx toolkit/source/helper/throbberimpl.cxx toolkit/source/helper/tkresmgr.cxx tools/StaticLibrary_ooopathutils.mk tools/bootstrp/addexes/makefile.mk tools/bootstrp/addexes2/makefile.mk tools/bootstrp/addexes2/mkfilt.cxx tools/bootstrp/command.cxx tools/bootstrp/cppdep.cxx tools/bootstrp/iserver.cxx tools/bootstrp/makefile.mk tools/bootstrp/mkcreate.cxx tools/bootstrp/prj.cxx tools/bootstrp/rscdep.cxx tools/bootstrp/sstring.cxx tools/inc/bootstrp/command.hxx tools/inc/bootstrp/mkcreate.hxx tools/inc/bootstrp/prj.hxx tools/inc/bootstrp/sstring.hxx tools/inc/tools/agapi.hxx tools/inc/tools/agitem.hxx tools/inc/tools/chapi.hxx tools/inc/tools/download.hxx tools/inc/tools/eacopier.hxx tools/inc/tools/fract.hxx tools/inc/tools/fsys.hxx tools/inc/tools/geninfo.hxx tools/inc/tools/globname.hxx tools/inc/tools/inetmime.hxx tools/inc/tools/multisel.hxx tools/inc/tools/poly.hxx tools/inc/tools/postsys.h tools/inc/tools/postwin.h tools/inc/tools/presys.h tools/inc/tools/prewin.h tools/inc/tools/pstm.hxx tools/inc/tools/ref.hxx tools/inc/tools/simplerm.hxx tools/inc/tools/solar.h tools/inc/tools/table.hxx tools/inc/tools/urlkeys.hxx tools/inc/tools/urlobj.hxx tools/prj/build.lst tools/prj/d.lst tools/qa/makefile.mk tools/source/communi/geninfo.cxx tools/source/debug/debug.cxx tools/source/fsys/dirent.cxx tools/source/fsys/tdir.cxx tools/source/fsys/unx.cxx tools/source/fsys/urlobj.cxx tools/source/generic/color.cxx tools/source/generic/config.cxx tools/source/generic/fract.cxx tools/source/inet/inetmime.cxx tools/source/memtools/multisel.cxx tools/source/memtools/table.cxx tools/source/rc/resmgr.cxx tools/source/ref/globname.cxx tools/source/ref/pstm.cxx tools/source/solar/solar.c tools/source/stream/strmos2.cxx tools/source/stream/strmunx.cxx tools/source/stream/strmwnt.cxx tools/source/string/makefile.mk tools/source/testtoolloader/testtoolloader.cxx tools/test/makefile.mk tools/util/makefile.mk tools/win/inc/dll.hxx tools/win/inc/parser.hxx tools/win/inc/shellex.h tools/win/inc/shutil.h tools/win/inc/toolsdll.hxx tools/win/inc/winshell.hxx tools/workben/makefile.mk ucbhelper/source/client/proxydecider.cxx ucbhelper/workben/ucbexplorer/ucbexplorer.hrc unotools/inc/unotools/unotunnelhelper.hxx unotools/source/config/fltrcfg.cxx unotools/source/config/lingucfg.cxx unotools/source/config/misccfg.cxx unotools/source/config/pathoptions.cxx unotools/source/config/searchopt.cxx unotools/source/i18n/localedatawrapper.cxx unotools/source/ucbhelper/localfilehelper.cxx unotools/source/ucbhelper/ucbhelper.cxx unotools/source/ucbhelper/xtempfile.cxx vcl/aqua/inc/salbmp.h vcl/aqua/inc/salgdi.h vcl/aqua/inc/salinst.h vcl/aqua/source/app/salinst.cxx vcl/aqua/source/gdi/aquaprintaccessoryview.mm vcl/aqua/source/gdi/salgdi.cxx vcl/aqua/source/gdi/salprn.cxx vcl/aqua/source/window/salframeview.mm vcl/aqua/source/window/salobj.cxx vcl/inc/vcl/bitmap.hxx vcl/inc/vcl/brdwin.hxx vcl/inc/vcl/button.hxx vcl/inc/vcl/cmdevt.hxx vcl/inc/vcl/cvtgrf.hxx vcl/inc/vcl/dialog.hxx vcl/inc/vcl/dockwin.hxx vcl/inc/vcl/event.hxx vcl/inc/vcl/fixed.hxx vcl/inc/vcl/fldunit.hxx vcl/inc/vcl/floatwin.hxx vcl/inc/vcl/gdimtf.hxx vcl/inc/vcl/glyphcache.hxx vcl/inc/vcl/graphite_adaptors.hxx vcl/inc/vcl/graphite_features.hxx vcl/inc/vcl/graphite_layout.hxx vcl/inc/vcl/ilstbox.hxx vcl/inc/vcl/image.h vcl/inc/vcl/imgctrl.hxx vcl/inc/vcl/impbmpconv.hxx vcl/inc/vcl/impprn.hxx vcl/inc/vcl/jobset.h vcl/inc/vcl/keycodes.hxx vcl/inc/vcl/lstbox.hxx vcl/inc/vcl/mapunit.hxx vcl/inc/vcl/menu.hxx vcl/inc/vcl/msgbox.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/prndlg.hxx vcl/inc/vcl/salatype.hxx vcl/inc/vcl/salbmp.hxx vcl/inc/vcl/salgdi.hxx vcl/inc/vcl/salinst.hxx vcl/inc/vcl/seleng.hxx vcl/inc/vcl/settings.hxx vcl/inc/vcl/smartid.hxx vcl/inc/vcl/status.hxx vcl/inc/vcl/strhelper.hxx vcl/inc/vcl/svapp.hxx vcl/inc/vcl/svdata.hxx vcl/inc/vcl/syschild.hxx vcl/inc/vcl/sysdata.hxx vcl/inc/vcl/taskpanelist.hxx vcl/inc/vcl/toolbox.hxx vcl/inc/vcl/vclevent.hxx vcl/inc/vcl/windata.hxx vcl/inc/vcl/window.hxx vcl/inc/vcl/wintypes.hxx vcl/os2/source/app/salinst.cxx vcl/os2/source/gdi/salgdi.cxx vcl/os2/source/window/salmenu.cxx vcl/os2/source/window/salobj.cxx vcl/prj/build.lst vcl/source/app/dbggui.cxx vcl/source/app/help.cxx vcl/source/app/idlemgr.cxx vcl/source/app/settings.cxx vcl/source/app/svapp.cxx vcl/source/app/svdata.cxx vcl/source/app/svmain.cxx vcl/source/app/svmainhook.cxx vcl/source/app/unohelp.cxx vcl/source/app/vclevent.cxx vcl/source/control/button.cxx vcl/source/control/combobox.cxx vcl/source/control/edit.cxx vcl/source/control/field.cxx vcl/source/control/fixed.cxx vcl/source/control/ilstbox.cxx vcl/source/control/imgctrl.cxx vcl/source/control/makefile.mk vcl/source/control/tabctrl.cxx vcl/source/gdi/bitmap.cxx vcl/source/gdi/bitmap2.cxx vcl/source/gdi/bitmap4.cxx vcl/source/gdi/bmpconv.cxx vcl/source/gdi/cvtsvm.cxx vcl/source/gdi/font.cxx vcl/source/gdi/gdimtf.cxx vcl/source/gdi/image.cxx vcl/source/gdi/impimage.cxx vcl/source/gdi/jobset.cxx vcl/source/gdi/makefile.mk vcl/source/gdi/metaact.cxx vcl/source/gdi/outdev.cxx vcl/source/gdi/outdev3.cxx vcl/source/gdi/outdev4.cxx vcl/source/gdi/outdevnative.cxx vcl/source/gdi/pdfwriter.cxx vcl/source/gdi/pdfwriter_impl.cxx vcl/source/gdi/print3.cxx vcl/source/gdi/salmisc.cxx vcl/source/glyphs/gcach_ftyp.cxx vcl/source/glyphs/gcach_ftyp.hxx vcl/source/glyphs/glyphcache.cxx vcl/source/glyphs/graphite_cache.cxx vcl/source/glyphs/graphite_layout.cxx vcl/source/glyphs/graphite_textsrc.hxx vcl/source/helper/canvasbitmap.cxx vcl/source/helper/smartid.cxx vcl/source/helper/xconnection.cxx vcl/source/src/btntext.src vcl/source/src/images.src vcl/source/src/print.src vcl/source/window/accel.cxx vcl/source/window/accmgr.cxx vcl/source/window/brdwin.cxx vcl/source/window/btndlg.cxx vcl/source/window/dlgctrl.cxx vcl/source/window/javachild.cxx vcl/source/window/menu.cxx vcl/source/window/msgbox.cxx vcl/source/window/printdlg.cxx vcl/source/window/status.cxx vcl/source/window/syschild.cxx vcl/source/window/toolbox.cxx vcl/source/window/toolbox2.cxx vcl/source/window/window.cxx vcl/source/window/window2.cxx vcl/source/window/wrkwin.cxx vcl/unx/gtk/app/gtkdata.cxx vcl/unx/gtk/app/gtkinst.cxx vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx vcl/unx/gtk/window/gtkframe.cxx vcl/unx/gtk/window/gtkobject.cxx vcl/unx/headless/svpbmp.hxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svpinst.cxx vcl/unx/headless/svpinst.hxx vcl/unx/headless/svpprn.cxx vcl/unx/headless/svpprn.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/unx/headless/svptext.cxx vcl/unx/inc/dtint.hxx vcl/unx/inc/plugins/gtk/gtkdata.hxx vcl/unx/inc/pspgraphics.h vcl/unx/inc/salbmp.h vcl/unx/inc/saldata.hxx vcl/unx/inc/saldisp.hxx vcl/unx/inc/salgdi.h vcl/unx/inc/salinst.h vcl/unx/inc/xfont.hxx vcl/unx/kde/kdedata.cxx vcl/unx/kde4/KDESalGraphics.cxx vcl/unx/source/app/keysymnames.cxx vcl/unx/source/app/saldata.cxx vcl/unx/source/app/saldisp.cxx vcl/unx/source/app/salinst.cxx vcl/unx/source/app/wmadaptor.cxx vcl/unx/source/dtrans/X11_selection.cxx vcl/unx/source/dtrans/X11_service.cxx vcl/unx/source/gdi/makefile.mk vcl/unx/source/gdi/pspgraphics.cxx vcl/unx/source/gdi/salgdi.cxx vcl/unx/source/gdi/salgdi3.cxx vcl/unx/source/gdi/salprnpsp.cxx vcl/unx/source/gdi/xfont.cxx vcl/unx/source/gdi/xlfd_attr.cxx vcl/unx/source/gdi/xlfd_attr.hxx vcl/unx/source/gdi/xlfd_extd.cxx vcl/unx/source/gdi/xlfd_extd.hxx vcl/unx/source/gdi/xlfd_smpl.cxx vcl/unx/source/gdi/xlfd_smpl.hxx vcl/unx/source/printer/ppdparser.cxx vcl/unx/source/printer/printerinfomanager.cxx vcl/unx/source/window/salframe.cxx vcl/unx/source/window/salmenu.cxx vcl/unx/source/window/salobj.cxx vcl/util/makefile2.pmk vcl/win/inc/salbmp.h vcl/win/inc/saldata.hxx vcl/win/inc/salgdi.h vcl/win/inc/salinst.h vcl/win/source/app/saldata.cxx vcl/win/source/app/salinst.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salprn.cxx vcl/win/source/gdi/winlayout.cxx vcl/win/source/window/salframe.cxx vcl/win/source/window/salobj.cxx vcl/workben/outdevgrind.cxx vos/inc/vos/execabl.hxx vos/inc/vos/macros.hxx vos/inc/vos/pipe.hxx vos/inc/vos/process.hxx vos/inc/vos/refernce.hxx vos/inc/vos/signal.hxx vos/inc/vos/socket.hxx vos/inc/vos/stream.hxx vos/inc/vos/thread.hxx vos/source/pipe.cxx vos/source/process.cxx vos/source/signal.cxx vos/source/thread.cxx vos/source/timer.cxx
2011-03-11 14:24:23 +01:00
aStyleSettings.SetDeactiveColor( ImplWinColorToSal( GetSysColor( COLOR_GRADIENTINACTIVECAPTION ) ) );
aStyleSettings.SetFaceColor( ImplWinColorToSal( GetSysColor( COLOR_3DFACE ) ) );
aStyleSettings.SetInactiveTabColor( aStyleSettings.GetFaceColor() );
aStyleSettings.SetLightColor( ImplWinColorToSal( GetSysColor( COLOR_3DHILIGHT ) ) );
aStyleSettings.SetLightBorderColor( ImplWinColorToSal( GetSysColor( COLOR_3DLIGHT ) ) );
aStyleSettings.SetShadowColor( ImplWinColorToSal( GetSysColor( COLOR_3DSHADOW ) ) );
aStyleSettings.SetDarkShadowColor( ImplWinColorToSal( GetSysColor( COLOR_3DDKSHADOW ) ) );
2000-09-18 16:07:07 +00:00
aStyleSettings.SetHelpColor( ImplWinColorToSal( GetSysColor( COLOR_INFOBK ) ) );
aStyleSettings.SetHelpTextColor( ImplWinColorToSal( GetSysColor( COLOR_INFOTEXT ) ) );
aStyleSettings.SetDialogColor( aStyleSettings.GetFaceColor() );
aStyleSettings.SetDialogTextColor( aStyleSettings.GetButtonTextColor() );
aStyleSettings.SetButtonTextColor( ImplWinColorToSal( GetSysColor( COLOR_BTNTEXT ) ) );
aStyleSettings.SetButtonRolloverTextColor( aStyleSettings.GetButtonTextColor() );
aStyleSettings.SetTabTextColor( aStyleSettings.GetButtonTextColor() );
aStyleSettings.SetTabRolloverTextColor( aStyleSettings.GetButtonTextColor() );
aStyleSettings.SetTabHighlightTextColor( aStyleSettings.GetButtonTextColor() );
2000-09-18 16:07:07 +00:00
aStyleSettings.SetRadioCheckTextColor( ImplWinColorToSal( GetSysColor( COLOR_WINDOWTEXT ) ) );
aStyleSettings.SetGroupTextColor( aStyleSettings.GetRadioCheckTextColor() );
aStyleSettings.SetLabelTextColor( aStyleSettings.GetRadioCheckTextColor() );
aStyleSettings.SetInfoTextColor( aStyleSettings.GetRadioCheckTextColor() );
aStyleSettings.SetWindowColor( ImplWinColorToSal( GetSysColor( COLOR_WINDOW ) ) );
2008-10-29 09:25:50 +00:00
aStyleSettings.SetActiveTabColor( aStyleSettings.GetWindowColor() );
2000-09-18 16:07:07 +00:00
aStyleSettings.SetWindowTextColor( ImplWinColorToSal( GetSysColor( COLOR_WINDOWTEXT ) ) );
aStyleSettings.SetFieldColor( aStyleSettings.GetWindowColor() );
aStyleSettings.SetFieldTextColor( aStyleSettings.GetWindowTextColor() );
aStyleSettings.SetFieldRolloverTextColor( aStyleSettings.GetFieldTextColor() );
2000-09-18 16:07:07 +00:00
aStyleSettings.SetHighlightColor( ImplWinColorToSal( GetSysColor( COLOR_HIGHLIGHT ) ) );
aStyleSettings.SetHighlightTextColor( ImplWinColorToSal( GetSysColor( COLOR_HIGHLIGHTTEXT ) ) );
aStyleSettings.SetMenuHighlightColor( aStyleSettings.GetHighlightColor() );
aStyleSettings.SetMenuHighlightTextColor( aStyleSettings.GetHighlightTextColor() );
ImplSVData* pSVData = ImplGetSVData();
pSVData->maNWFData.mnMenuFormatBorderX = 0;
pSVData->maNWFData.mnMenuFormatBorderY = 0;
pSVData->maNWFData.maMenuBarHighlightTextColor = Color( COL_TRANSPARENT );
GetSalData()->mbThemeMenuSupport = FALSE;
if (officecfg::Office::Common::Accessibility::AutoDetectSystemHC::get())
{
aStyleSettings.SetShadowColor( ImplWinColorToSal( GetSysColor( COLOR_ACTIVEBORDER ) ) );
aStyleSettings.SetWorkspaceColor( ImplWinColorToSal( GetSysColor( COLOR_MENU ) ) );
}
aStyleSettings.SetMenuColor( ImplWinColorToSal( GetSysColor( COLOR_MENU ) ) );
aStyleSettings.SetMenuBarColor( aStyleSettings.GetMenuColor() );
aStyleSettings.SetMenuBarRolloverColor( aStyleSettings.GetHighlightColor() );
aStyleSettings.SetMenuBorderColor( aStyleSettings.GetLightBorderColor() ); // overridden below for flat menus
aStyleSettings.SetUseFlatBorders( FALSE );
aStyleSettings.SetUseFlatMenus( FALSE );
aStyleSettings.SetMenuTextColor( ImplWinColorToSal( GetSysColor( COLOR_MENUTEXT ) ) );
if ( boost::optional<Color> aColor = aStyleSettings.GetPersonaMenuBarTextColor() )
{
aStyleSettings.SetMenuBarTextColor( *aColor );
aStyleSettings.SetMenuBarRolloverTextColor( *aColor );
}
else
{
aStyleSettings.SetMenuBarTextColor( ImplWinColorToSal( GetSysColor( COLOR_MENUTEXT ) ) );
aStyleSettings.SetMenuBarRolloverTextColor( ImplWinColorToSal( GetSysColor( COLOR_HIGHLIGHTTEXT ) ) );
}
aStyleSettings.SetMenuBarHighlightTextColor(aStyleSettings.GetMenuHighlightTextColor());
aStyleSettings.SetActiveColor( ImplWinColorToSal( GetSysColor( COLOR_ACTIVECAPTION ) ) );
aStyleSettings.SetActiveTextColor( ImplWinColorToSal( GetSysColor( COLOR_CAPTIONTEXT ) ) );
aStyleSettings.SetDeactiveColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVECAPTION ) ) );
aStyleSettings.SetDeactiveTextColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVECAPTIONTEXT ) ) );
if ( aSalShlData.mbWXP )
{
// only xp supports a different menu bar color
long bFlatMenus = 0;
SystemParametersInfo( SPI_GETFLATMENU, 0, &bFlatMenus, 0);
if( bFlatMenus )
2001-11-06 09:08:39 +00:00
{
aStyleSettings.SetUseFlatMenus( TRUE );
aStyleSettings.SetMenuBarColor( ImplWinColorToSal( GetSysColor( COLOR_MENUBAR ) ) );
aStyleSettings.SetMenuHighlightColor( ImplWinColorToSal( GetSysColor( COLOR_MENUHILIGHT ) ) );
aStyleSettings.SetMenuBarRolloverColor( ImplWinColorToSal( GetSysColor( COLOR_MENUHILIGHT ) ) );
aStyleSettings.SetMenuBorderColor( ImplWinColorToSal( GetSysColor( COLOR_3DSHADOW ) ) );
// flat borders for our controls etc. as well in this mode (ie, no 3d borders)
// this is not active in the classic style appearance
aStyleSettings.SetUseFlatBorders( TRUE );
2001-11-06 09:08:39 +00:00
}
2000-09-18 16:07:07 +00:00
}
aStyleSettings.SetCheckedColorSpecialCase( );
2000-09-18 16:07:07 +00:00
// caret width
DWORD nCaretWidth = 2;
if( SystemParametersInfo( SPI_GETCARETWIDTH, 0, &nCaretWidth, 0 ) )
aStyleSettings.SetCursorSize( nCaretWidth );
2002-02-01 07:41:37 +00:00
// High contrast
HIGHCONTRAST hc;
hc.cbSize = sizeof( HIGHCONTRAST );
if( SystemParametersInfo( SPI_GETHIGHCONTRAST, hc.cbSize, &hc, 0 )
&& (hc.dwFlags & HCF_HIGHCONTRASTON) )
aStyleSettings.SetHighContrastMode( true );
else
aStyleSettings.SetHighContrastMode( false );
2002-02-01 07:41:37 +00:00
2000-09-18 16:07:07 +00:00
// Query Fonts
vcl::Font aMenuFont = aStyleSettings.GetMenuFont();
vcl::Font aTitleFont = aStyleSettings.GetTitleFont();
vcl::Font aFloatTitleFont = aStyleSettings.GetFloatTitleFont();
vcl::Font aHelpFont = aStyleSettings.GetHelpFont();
vcl::Font aAppFont = aStyleSettings.GetAppFont();
vcl::Font aIconFont = aStyleSettings.GetIconFont();
2001-06-07 15:52:11 +00:00
HDC hDC = GetDC( 0 );
2011-01-24 04:00:57 +02:00
NONCLIENTMETRICSW aNonClientMetrics;
aNonClientMetrics.cbSize = sizeof( aNonClientMetrics );
if ( SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, sizeof( aNonClientMetrics ), &aNonClientMetrics, 0 ) )
2000-09-18 16:07:07 +00:00
{
2011-01-24 04:00:57 +02:00
ImplSalUpdateStyleFontW( hDC, aNonClientMetrics.lfMenuFont, aMenuFont );
ImplSalUpdateStyleFontW( hDC, aNonClientMetrics.lfCaptionFont, aTitleFont );
ImplSalUpdateStyleFontW( hDC, aNonClientMetrics.lfSmCaptionFont, aFloatTitleFont );
ImplSalUpdateStyleFontW( hDC, aNonClientMetrics.lfStatusFont, aHelpFont );
ImplSalUpdateStyleFontW( hDC, aNonClientMetrics.lfMessageFont, aAppFont );
LOGFONTW aLogFont;
if ( SystemParametersInfoW( SPI_GETICONTITLELOGFONT, 0, &aLogFont, 0 ) )
ImplSalUpdateStyleFontW( hDC, aLogFont, aIconFont );
2000-09-18 16:07:07 +00:00
}
2001-06-07 15:52:11 +00:00
ReleaseDC( 0, hDC );
aStyleSettings.SetToolbarIconSize(ToolbarIconSize::Large);
2000-09-18 16:07:07 +00:00
aStyleSettings.SetMenuFont( aMenuFont );
aStyleSettings.SetTitleFont( aTitleFont );
aStyleSettings.SetFloatTitleFont( aFloatTitleFont );
aStyleSettings.SetHelpFont( aHelpFont );
aStyleSettings.SetIconFont( aIconFont );
// We prefer Arial in the russian version, because MS Sans Serif
// is to wide for the dialogs
if ( rSettings.GetLanguageTag().getLanguageType() == LANGUAGE_RUSSIAN )
2000-09-18 16:07:07 +00:00
{
OUString aFontName = aAppFont.GetName();
OUString aFirstName = aFontName.getToken( 0, ';' );
if ( aFirstName.equalsIgnoreAsciiCase( "MS Sans Serif" ) )
2000-09-18 16:07:07 +00:00
{
aFontName = "Arial;" + aFontName;
2000-09-18 16:07:07 +00:00
aAppFont.SetName( aFontName );
}
}
aStyleSettings.SetAppFont( aAppFont );
aStyleSettings.SetGroupFont( aAppFont );
aStyleSettings.SetLabelFont( aAppFont );
aStyleSettings.SetRadioCheckFont( aAppFont );
aStyleSettings.SetPushButtonFont( aAppFont );
aStyleSettings.SetFieldFont( aAppFont );
if ( aAppFont.GetWeight() > WEIGHT_NORMAL )
aAppFont.SetWeight( WEIGHT_NORMAL );
aStyleSettings.SetInfoFont( aAppFont );
aStyleSettings.SetToolFont( aAppFont );
aStyleSettings.SetTabFont( aAppFont );
2000-09-18 16:07:07 +00:00
BOOL bDragFull;
2000-09-18 16:07:07 +00:00
if ( SystemParametersInfo( SPI_GETDRAGFULLWINDOWS, 0, &bDragFull, 0 ) )
{
DragFullOptions nDragFullOptions = aStyleSettings.GetDragFullOptions();
2000-09-18 16:07:07 +00:00
if ( bDragFull )
nDragFullOptions |= DragFullOptions::WindowMove | DragFullOptions::WindowSize | DragFullOptions::Docking | DragFullOptions::Split;
2000-09-18 16:07:07 +00:00
else
nDragFullOptions &= ~DragFullOptions(DragFullOptions::WindowMove | DragFullOptions::WindowSize | DragFullOptions::Docking | DragFullOptions::Split);
2000-09-18 16:07:07 +00:00
aStyleSettings.SetDragFullOptions( nDragFullOptions );
}
if ( RegOpenKey( HKEY_CURRENT_USER,
"Control Panel\\International\\Calendars\\TwoDigitYearMax",
&hRegKey ) == ERROR_SUCCESS )
{
BYTE aValueBuf[10];
DWORD nValue;
DWORD nValueSize = sizeof( aValueBuf );
DWORD nType;
if ( RegQueryValueEx( hRegKey, "1", 0,
&nType, aValueBuf, &nValueSize ) == ERROR_SUCCESS )
{
if ( nType == REG_SZ )
{
nValue = (sal_uLong)ImplA2I( aValueBuf );
2000-09-18 16:07:07 +00:00
if ( (nValue > 1000) && (nValue < 10000) )
{
MiscSettings aMiscSettings = rSettings.GetMiscSettings();
utl::MiscCfg().SetYear2000( (sal_Int32)(nValue-99) );
2000-09-18 16:07:07 +00:00
rSettings.SetMiscSettings( aMiscSettings );
}
}
}
RegCloseKey( hRegKey );
}
rSettings.SetMouseSettings( aMouseSettings );
rSettings.SetStyleSettings( aStyleSettings );
// now apply the values from theming, if available
WinSalGraphics::updateSettingsNative( rSettings );
2000-09-18 16:07:07 +00:00
}
const SystemEnvData* WinSalFrame::GetSystemData() const
2000-09-18 16:07:07 +00:00
{
return &maSysData;
2000-09-18 16:07:07 +00:00
}
void WinSalFrame::Beep()
{
// a simple beep
MessageBeep( 0 );
}
SalFrame::SalPointerState WinSalFrame::GetPointerState()
{
SalPointerState aState;
aState.mnState = 0;
if ( GetKeyState( VK_LBUTTON ) & 0x8000 )
aState.mnState |= MOUSE_LEFT;
if ( GetKeyState( VK_MBUTTON ) & 0x8000 )
aState.mnState |= MOUSE_MIDDLE;
if ( GetKeyState( VK_RBUTTON ) & 0x8000 )
aState.mnState |= MOUSE_RIGHT;
if ( GetKeyState( VK_SHIFT ) & 0x8000 )
aState.mnState |= KEY_SHIFT;
if ( GetKeyState( VK_CONTROL ) & 0x8000 )
aState.mnState |= KEY_MOD1;
if ( GetKeyState( VK_MENU ) & 0x8000 )
aState.mnState |= KEY_MOD2;
POINT pt;
GetCursorPos( &pt );
aState.maPos = Point( pt.x - maGeometry.nX, pt.y - maGeometry.nY );
return aState;
}
KeyIndicatorState WinSalFrame::GetIndicatorState()
{
KeyIndicatorState aState = KeyIndicatorState::NONE;
if (::GetKeyState(VK_CAPITAL))
aState |= KeyIndicatorState::CAPSLOCK;
if (::GetKeyState(VK_NUMLOCK))
aState |= KeyIndicatorState::NUMLOCK;
if (::GetKeyState(VK_SCROLL))
aState |= KeyIndicatorState::SCROLLLOCK;
return aState;
}
Merge commit 'ooo/DEV300_m101' into intm101 The following builds for me: basebmp, basegfx, comphelper, dtrans, i18npool, i18nutil, l10ntools, o3tl, psprint_config, regexp, rsc, sax, sot, tools, ucbhelper, unotools, vcl The rest still needs fixing ;-) Conflicts: canvas/prj/build.lst canvas/source/cairo/cairo_textlayout.cxx canvas/source/directx/dx_winstuff.hxx canvas/source/tools/image.cxx canvas/source/vcl/canvashelper.cxx comphelper/inc/comphelper/documentconstants.hxx comphelper/inc/comphelper/optionalvalue.hxx comphelper/inc/comphelper/querydeep.hxx comphelper/prj/build.lst comphelper/qa/complex/makefile.mk comphelper/qa/string/test_string_noadditional.cxx comphelper/source/misc/componentmodule.cxx comphelper/source/misc/mimeconfighelper.cxx comphelper/source/misc/querydeep.cxx comphelper/source/misc/uieventslogger.cxx comphelper/source/property/TypeGeneration.cxx comphelper/test/uno_iterators/uno_iterators.cxx comphelper/util/makefile.mk cppcanvas/source/mtfrenderer/implrenderer.cxx dtrans/prj/build.lst dtrans/source/generic/dtrans.cxx dtrans/source/win32/dtobj/FmtFilter.cxx i18npool/prj/build.lst i18npool/source/localedata/data/localedata_others.map i18npool/source/localedata/data/makefile.mk i18npool/source/localedata/localedata.cxx i18npool/source/localedata/saxparser.cxx i18npool/source/registerservices/registerservices.cxx i18npool/source/search/textsearch.cxx l10ntools/inc/cfgmerge.hxx l10ntools/inc/export.hxx l10ntools/inc/gsicheck.hxx l10ntools/inc/l10ntools/vosapp.hxx l10ntools/inc/tagtest.hxx l10ntools/inc/xmlparse.hxx l10ntools/layout/layoutparse.cxx l10ntools/layout/tralay.cxx l10ntools/source/cfgmerge.cxx l10ntools/source/export.cxx l10ntools/source/export2.cxx l10ntools/source/gsicheck.cxx l10ntools/source/help/HelpLinker.cxx l10ntools/source/lngex.cxx l10ntools/source/lngmerge.cxx l10ntools/source/merge.cxx l10ntools/source/tagtest.cxx l10ntools/source/xmlparse.cxx padmin/source/fontentry.cxx padmin/source/padialog.cxx padmin/source/padialog.src padmin/source/pamain.cxx rsc/inc/rscarray.hxx rsc/inc/rscclass.hxx rsc/inc/rscclobj.hxx rsc/inc/rsccont.hxx rsc/inc/rscdb.hxx rsc/inc/rscdef.hxx rsc/inc/rscmgr.hxx rsc/inc/rscrange.hxx rsc/inc/rsctop.hxx rsc/inc/vclrsc.hxx rsc/source/parser/rscdb.cxx rsc/source/parser/rscicpx.cxx rsc/source/parser/rscinit.cxx rsc/source/prj/start.cxx rsc/source/res/rscarray.cxx rsc/source/res/rscclass.cxx rsc/source/res/rscclobj.cxx rsc/source/res/rsccont.cxx rsc/source/res/rscmgr.cxx rsc/source/res/rscrange.cxx rsc/source/res/rsctop.cxx rsc/source/rsc/rsc.cxx rsc/source/tools/rscdef.cxx rsc/source/tools/rsctools.cxx sax/source/expatwrap/sax_expat.cxx sax/source/fastparser/facreg.cxx sax/source/tools/fastserializer.cxx sot/inc/sot/filelist.hxx sot/inc/sot/object.hxx sot/source/base/factory.cxx sot/source/base/filelist.cxx sot/source/sdstor/stg.cxx sot/source/sdstor/stgcache.cxx sot/source/sdstor/stgole.cxx sot/source/sdstor/stgstrms.cxx sot/source/sdstor/storage.cxx sot/source/sdstor/ucbstorage.cxx svl/inc/svl/cenumitm.hxx svl/inc/svl/cintitem.hxx svl/inc/svl/cntwall.hxx svl/inc/svl/ctypeitm.hxx svl/inc/svl/custritm.hxx svl/inc/svl/dateitem.hxx svl/inc/svl/filerec.hxx svl/inc/svl/globalnameitem.hxx svl/inc/svl/ilstitem.hxx svl/inc/svl/imageitm.hxx svl/inc/svl/intitem.hxx svl/inc/svl/itempool.hxx svl/inc/svl/itemset.hxx svl/inc/svl/lckbitem.hxx svl/inc/svl/poolitem.hxx svl/inc/svl/ptitem.hxx svl/inc/svl/rectitem.hxx svl/inc/svl/sfontitm.hxx svl/inc/svl/slstitm.hxx svl/inc/svl/srchitem.hxx svl/inc/svl/svarray.hxx svl/inc/svl/svdde.hxx svl/inc/svl/svstdarr.hxx svl/inc/svl/szitem.hxx svl/inc/svl/visitem.hxx svl/inc/svl/zforlist.hxx svl/inc/svl/zformat.hxx svl/prj/build.lst svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx svl/qa/complex/ConfigItems/helper/makefile.mk svl/qa/makefile.mk svl/source/filepicker/pickerhelper.cxx svl/source/filerec/filerec.cxx svl/source/items/cenumitm.cxx svl/source/items/cintitem.cxx svl/source/items/cntwall.cxx svl/source/items/ctypeitm.cxx svl/source/items/custritm.cxx svl/source/items/dateitem.cxx svl/source/items/globalnameitem.cxx svl/source/items/ilstitem.cxx svl/source/items/imageitm.cxx svl/source/items/intitem.cxx svl/source/items/itempool.cxx svl/source/items/itemprop.cxx svl/source/items/itemset.cxx svl/source/items/lckbitem.cxx svl/source/items/poolio.cxx svl/source/items/poolitem.cxx svl/source/items/ptitem.cxx svl/source/items/rectitem.cxx svl/source/items/slstitm.cxx svl/source/items/srchitem.cxx svl/source/items/style.cxx svl/source/items/szitem.cxx svl/source/items/visitem.cxx svl/source/items/whiter.cxx svl/source/memtools/svarray.cxx svl/source/misc/PasswordHelper.cxx svl/source/misc/adrparse.cxx svl/source/misc/lngmisc.cxx svl/source/notify/brdcst.cxx svl/source/notify/listener.cxx svl/source/notify/listenerbase.cxx svl/source/numbers/makefile.mk svl/source/numbers/nbdll.cxx svl/source/numbers/zforfind.cxx svl/source/numbers/zforlist.cxx svl/source/numbers/zformat.cxx svl/source/numbers/zforscan.cxx svl/source/passwordcontainer/passwordcontainer.cxx svl/source/svdde/ddecli.cxx svl/source/svdde/ddeimp.hxx svl/source/svdde/ddemlos2.h svl/source/svdde/ddesvr.cxx svl/source/undo/undo.cxx svl/source/uno/registerservices.cxx svl/util/makefile.mk svtools/bmpmaker/bmpsum.cxx svtools/bmpmaker/g2g.cxx svtools/bmpmaker/makefile.mk svtools/inc/borderhelper.hxx svtools/inc/svtools/accessiblefactory.hxx svtools/inc/svtools/apearcfg.hxx svtools/inc/svtools/brwbox.hxx svtools/inc/svtools/ctrlbox.hxx svtools/inc/svtools/ctrltool.hxx svtools/inc/svtools/editbrowsebox.hxx svtools/inc/svtools/ehdl.hxx svtools/inc/svtools/embedhlp.hxx svtools/inc/svtools/filter.hxx svtools/inc/svtools/ivctrl.hxx svtools/inc/svtools/parhtml.hxx svtools/inc/svtools/printdlg.hxx svtools/inc/svtools/rtftoken.h svtools/inc/svtools/ruler.hxx svtools/inc/svtools/svicnvw.hxx svtools/inc/svtools/svlbitm.hxx svtools/inc/svtools/svlbox.hxx svtools/inc/svtools/svtreebx.hxx svtools/inc/svtools/tabbar.hxx svtools/inc/svtools/table/abstracttablecontrol.hxx svtools/inc/svtools/taskbar.hxx svtools/inc/svtools/textview.hxx svtools/inc/svtools/valueset.hxx svtools/source/brwbox/brwbox1.cxx svtools/source/brwbox/brwbox2.cxx svtools/source/brwbox/datwin.cxx svtools/source/brwbox/datwin.hxx svtools/source/brwbox/makefile.mk svtools/source/config/apearcfg.cxx svtools/source/config/htmlcfg.cxx svtools/source/config/menuoptions.cxx svtools/source/config/miscopt.cxx svtools/source/contnr/cont_pch.cxx svtools/source/contnr/ctrdll.cxx svtools/source/contnr/fileview.cxx svtools/source/contnr/imivctl1.cxx svtools/source/contnr/ivctrl.cxx svtools/source/contnr/makefile.mk svtools/source/contnr/svcontnr.src svtools/source/contnr/svicnvw.cxx svtools/source/contnr/svimpbox.cxx svtools/source/contnr/svimpicn.cxx svtools/source/contnr/svlbitm.cxx svtools/source/contnr/svtreebx.cxx svtools/source/contnr/templwin.cxx svtools/source/contnr/templwin.hxx svtools/source/control/asynclink.cxx svtools/source/control/ctrlbox.cxx svtools/source/control/ctrldll.cxx svtools/source/control/ctrltool.cxx svtools/source/control/filectrl.cxx svtools/source/control/filectrl.src svtools/source/control/headbar.cxx svtools/source/control/inettbc.cxx svtools/source/control/makefile.mk svtools/source/control/prgsbar.cxx svtools/source/control/roadmap.cxx svtools/source/control/ruler.cxx svtools/source/control/scriptedtext.cxx svtools/source/control/stdmenu.cxx svtools/source/control/tabbar.cxx svtools/source/control/taskbar.cxx svtools/source/control/taskbox.cxx svtools/source/control/taskmisc.cxx svtools/source/control/taskstat.cxx svtools/source/control/valueacc.cxx svtools/source/control/valueset.cxx svtools/source/dialogs/addresstemplate.cxx svtools/source/dialogs/addresstemplate.src svtools/source/dialogs/colrdlg.src svtools/source/dialogs/filedlg2.cxx svtools/source/dialogs/filedlg2.hxx svtools/source/dialogs/makefile.mk svtools/source/dialogs/printdlg.cxx svtools/source/dialogs/printdlg.src svtools/source/dialogs/propctrl.cxx svtools/source/dialogs/propctrl.hxx svtools/source/dialogs/property.cxx svtools/source/edit/makefile.mk svtools/source/edit/sychconv.cxx svtools/source/edit/syntaxhighlight.cxx svtools/source/edit/textdoc.cxx svtools/source/edit/texteng.cxx svtools/source/edit/textundo.cxx svtools/source/edit/textview.cxx svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx svtools/source/filter.vcl/filter/dlgejpg.cxx svtools/source/filter.vcl/filter/dlgejpg.hxx svtools/source/filter.vcl/filter/dlgejpg.src svtools/source/filter.vcl/filter/dlgepng.cxx svtools/source/filter.vcl/filter/dlgepng.hxx svtools/source/filter.vcl/filter/dlgepng.src svtools/source/filter.vcl/filter/dlgexpor.cxx svtools/source/filter.vcl/filter/dlgexpor.hxx svtools/source/filter.vcl/filter/dlgexpor.src svtools/source/filter.vcl/filter/filter2.cxx svtools/source/filter.vcl/filter/makefile.mk svtools/source/filter.vcl/filter/sgfbram.cxx svtools/source/filter.vcl/filter/sgvmain.cxx svtools/source/filter.vcl/filter/sgvspln.cxx svtools/source/filter.vcl/filter/strings.src svtools/source/filter.vcl/jpeg/makefile.mk svtools/source/filter.vcl/wmf/emfwr.cxx svtools/source/filter.vcl/wmf/emfwr.hxx svtools/source/filter.vcl/wmf/enhwmf.cxx svtools/source/filter.vcl/wmf/winmtf.hxx svtools/source/filter.vcl/wmf/wmfwr.cxx svtools/source/filter.vcl/wmf/wmfwr.hxx svtools/source/graphic/grfcache.cxx svtools/source/graphic/grfcache.hxx svtools/source/graphic/grfmgr.cxx svtools/source/graphic/makefile.mk svtools/source/inc/accessibletableimp.hxx svtools/source/inc/svimpbox.hxx svtools/source/java/patchjavaerror.src svtools/source/misc/ehdl.cxx svtools/source/misc/errtxt.src svtools/source/misc/helpagentwindow.cxx svtools/source/misc/imagemgr.cxx svtools/source/misc/imagemgr.src svtools/source/misc/imageresourceaccess.cxx svtools/source/misc/imap.cxx svtools/source/misc/langtab.src svtools/source/misc/makefile.mk svtools/source/misc/svtdata.cxx svtools/source/misc/templatefoldercache.cxx svtools/source/misc/transfer2.cxx svtools/source/misc/undo.src svtools/source/plugapp/commtest.cxx svtools/source/plugapp/commtest.src svtools/source/plugapp/makefile.mk svtools/source/plugapp/testtool.src svtools/source/productregistration/productregistration.cxx svtools/source/svhtml/htmlkywd.cxx svtools/source/svhtml/parhtml.cxx svtools/source/svrtf/rtfkey2.cxx svtools/source/svrtf/rtfkeywd.cxx svtools/source/table/defaultinputhandler.cxx svtools/source/table/makefile.mk svtools/source/table/tablecontrol.cxx svtools/source/table/tablecontrol_impl.cxx svtools/source/table/tablecontrol_impl.hxx svtools/source/table/tabledatawindow.cxx svtools/source/table/tablegeometry.cxx svtools/source/table/tablegeometry.hxx svtools/source/toolpanel/makefile.mk svtools/source/toolpanel/toolpaneldrawer.cxx svtools/source/uno/addrtempuno.cxx svtools/source/uno/miscservices.cxx svtools/source/uno/svtxgridcontrol.cxx svtools/source/uno/svtxgridcontrol.hxx svtools/source/uno/toolboxcontroller.cxx svtools/source/uno/treecontrolpeer.cxx svtools/source/uno/unocontroltablemodel.cxx svtools/source/uno/unocontroltablemodel.hxx svtools/source/uno/unoimap.cxx svtools/source/urlobj/inetimg.cxx svtools/util/makefile.mk svtools/workben/browser.cxx svtools/workben/cui/makefile.mk svtools/workben/makefile.mk svtools/workben/stest.cxx svtools/workben/toolpanel/makefile.mk svtools/workben/urange.cxx toolkit/inc/toolkit/awt/vclxdevice.hxx toolkit/inc/toolkit/awt/vclxgraphics.hxx toolkit/inc/toolkit/awt/vclxwindows.hxx toolkit/inc/toolkit/controls/dialogcontrol.hxx toolkit/inc/toolkit/helper/property.hxx toolkit/inc/toolkit/helper/servicenames.hxx toolkit/inc/toolkit/helper/throbberimpl.hxx toolkit/qa/complex/toolkit/accessibility/_XAccessibleComponent.java toolkit/source/awt/asynccallback.cxx toolkit/source/awt/vclxgraphics.cxx toolkit/source/awt/vclxtoolkit.cxx toolkit/source/awt/vclxwindow.cxx toolkit/source/awt/xsimpleanimation.cxx toolkit/source/awt/xthrobber.cxx toolkit/source/controls/dialogcontrol.cxx toolkit/source/controls/grid/defaultgridcolumnmodel.cxx toolkit/source/controls/grid/defaultgriddatamodel.cxx toolkit/source/controls/grid/gridcontrol.cxx toolkit/source/controls/grid/initguard.hxx toolkit/source/controls/unocontrol.cxx toolkit/source/controls/unocontrolcontainer.cxx toolkit/source/controls/unocontrols.cxx toolkit/source/helper/listenermultiplexer.cxx toolkit/source/helper/property.cxx toolkit/source/helper/registerservices.cxx toolkit/source/helper/servicenames.cxx toolkit/source/helper/throbberimpl.cxx toolkit/source/helper/tkresmgr.cxx tools/StaticLibrary_ooopathutils.mk tools/bootstrp/addexes/makefile.mk tools/bootstrp/addexes2/makefile.mk tools/bootstrp/addexes2/mkfilt.cxx tools/bootstrp/command.cxx tools/bootstrp/cppdep.cxx tools/bootstrp/iserver.cxx tools/bootstrp/makefile.mk tools/bootstrp/mkcreate.cxx tools/bootstrp/prj.cxx tools/bootstrp/rscdep.cxx tools/bootstrp/sstring.cxx tools/inc/bootstrp/command.hxx tools/inc/bootstrp/mkcreate.hxx tools/inc/bootstrp/prj.hxx tools/inc/bootstrp/sstring.hxx tools/inc/tools/agapi.hxx tools/inc/tools/agitem.hxx tools/inc/tools/chapi.hxx tools/inc/tools/download.hxx tools/inc/tools/eacopier.hxx tools/inc/tools/fract.hxx tools/inc/tools/fsys.hxx tools/inc/tools/geninfo.hxx tools/inc/tools/globname.hxx tools/inc/tools/inetmime.hxx tools/inc/tools/multisel.hxx tools/inc/tools/poly.hxx tools/inc/tools/postsys.h tools/inc/tools/postwin.h tools/inc/tools/presys.h tools/inc/tools/prewin.h tools/inc/tools/pstm.hxx tools/inc/tools/ref.hxx tools/inc/tools/simplerm.hxx tools/inc/tools/solar.h tools/inc/tools/table.hxx tools/inc/tools/urlkeys.hxx tools/inc/tools/urlobj.hxx tools/prj/build.lst tools/prj/d.lst tools/qa/makefile.mk tools/source/communi/geninfo.cxx tools/source/debug/debug.cxx tools/source/fsys/dirent.cxx tools/source/fsys/tdir.cxx tools/source/fsys/unx.cxx tools/source/fsys/urlobj.cxx tools/source/generic/color.cxx tools/source/generic/config.cxx tools/source/generic/fract.cxx tools/source/inet/inetmime.cxx tools/source/memtools/multisel.cxx tools/source/memtools/table.cxx tools/source/rc/resmgr.cxx tools/source/ref/globname.cxx tools/source/ref/pstm.cxx tools/source/solar/solar.c tools/source/stream/strmos2.cxx tools/source/stream/strmunx.cxx tools/source/stream/strmwnt.cxx tools/source/string/makefile.mk tools/source/testtoolloader/testtoolloader.cxx tools/test/makefile.mk tools/util/makefile.mk tools/win/inc/dll.hxx tools/win/inc/parser.hxx tools/win/inc/shellex.h tools/win/inc/shutil.h tools/win/inc/toolsdll.hxx tools/win/inc/winshell.hxx tools/workben/makefile.mk ucbhelper/source/client/proxydecider.cxx ucbhelper/workben/ucbexplorer/ucbexplorer.hrc unotools/inc/unotools/unotunnelhelper.hxx unotools/source/config/fltrcfg.cxx unotools/source/config/lingucfg.cxx unotools/source/config/misccfg.cxx unotools/source/config/pathoptions.cxx unotools/source/config/searchopt.cxx unotools/source/i18n/localedatawrapper.cxx unotools/source/ucbhelper/localfilehelper.cxx unotools/source/ucbhelper/ucbhelper.cxx unotools/source/ucbhelper/xtempfile.cxx vcl/aqua/inc/salbmp.h vcl/aqua/inc/salgdi.h vcl/aqua/inc/salinst.h vcl/aqua/source/app/salinst.cxx vcl/aqua/source/gdi/aquaprintaccessoryview.mm vcl/aqua/source/gdi/salgdi.cxx vcl/aqua/source/gdi/salprn.cxx vcl/aqua/source/window/salframeview.mm vcl/aqua/source/window/salobj.cxx vcl/inc/vcl/bitmap.hxx vcl/inc/vcl/brdwin.hxx vcl/inc/vcl/button.hxx vcl/inc/vcl/cmdevt.hxx vcl/inc/vcl/cvtgrf.hxx vcl/inc/vcl/dialog.hxx vcl/inc/vcl/dockwin.hxx vcl/inc/vcl/event.hxx vcl/inc/vcl/fixed.hxx vcl/inc/vcl/fldunit.hxx vcl/inc/vcl/floatwin.hxx vcl/inc/vcl/gdimtf.hxx vcl/inc/vcl/glyphcache.hxx vcl/inc/vcl/graphite_adaptors.hxx vcl/inc/vcl/graphite_features.hxx vcl/inc/vcl/graphite_layout.hxx vcl/inc/vcl/ilstbox.hxx vcl/inc/vcl/image.h vcl/inc/vcl/imgctrl.hxx vcl/inc/vcl/impbmpconv.hxx vcl/inc/vcl/impprn.hxx vcl/inc/vcl/jobset.h vcl/inc/vcl/keycodes.hxx vcl/inc/vcl/lstbox.hxx vcl/inc/vcl/mapunit.hxx vcl/inc/vcl/menu.hxx vcl/inc/vcl/msgbox.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/prndlg.hxx vcl/inc/vcl/salatype.hxx vcl/inc/vcl/salbmp.hxx vcl/inc/vcl/salgdi.hxx vcl/inc/vcl/salinst.hxx vcl/inc/vcl/seleng.hxx vcl/inc/vcl/settings.hxx vcl/inc/vcl/smartid.hxx vcl/inc/vcl/status.hxx vcl/inc/vcl/strhelper.hxx vcl/inc/vcl/svapp.hxx vcl/inc/vcl/svdata.hxx vcl/inc/vcl/syschild.hxx vcl/inc/vcl/sysdata.hxx vcl/inc/vcl/taskpanelist.hxx vcl/inc/vcl/toolbox.hxx vcl/inc/vcl/vclevent.hxx vcl/inc/vcl/windata.hxx vcl/inc/vcl/window.hxx vcl/inc/vcl/wintypes.hxx vcl/os2/source/app/salinst.cxx vcl/os2/source/gdi/salgdi.cxx vcl/os2/source/window/salmenu.cxx vcl/os2/source/window/salobj.cxx vcl/prj/build.lst vcl/source/app/dbggui.cxx vcl/source/app/help.cxx vcl/source/app/idlemgr.cxx vcl/source/app/settings.cxx vcl/source/app/svapp.cxx vcl/source/app/svdata.cxx vcl/source/app/svmain.cxx vcl/source/app/svmainhook.cxx vcl/source/app/unohelp.cxx vcl/source/app/vclevent.cxx vcl/source/control/button.cxx vcl/source/control/combobox.cxx vcl/source/control/edit.cxx vcl/source/control/field.cxx vcl/source/control/fixed.cxx vcl/source/control/ilstbox.cxx vcl/source/control/imgctrl.cxx vcl/source/control/makefile.mk vcl/source/control/tabctrl.cxx vcl/source/gdi/bitmap.cxx vcl/source/gdi/bitmap2.cxx vcl/source/gdi/bitmap4.cxx vcl/source/gdi/bmpconv.cxx vcl/source/gdi/cvtsvm.cxx vcl/source/gdi/font.cxx vcl/source/gdi/gdimtf.cxx vcl/source/gdi/image.cxx vcl/source/gdi/impimage.cxx vcl/source/gdi/jobset.cxx vcl/source/gdi/makefile.mk vcl/source/gdi/metaact.cxx vcl/source/gdi/outdev.cxx vcl/source/gdi/outdev3.cxx vcl/source/gdi/outdev4.cxx vcl/source/gdi/outdevnative.cxx vcl/source/gdi/pdfwriter.cxx vcl/source/gdi/pdfwriter_impl.cxx vcl/source/gdi/print3.cxx vcl/source/gdi/salmisc.cxx vcl/source/glyphs/gcach_ftyp.cxx vcl/source/glyphs/gcach_ftyp.hxx vcl/source/glyphs/glyphcache.cxx vcl/source/glyphs/graphite_cache.cxx vcl/source/glyphs/graphite_layout.cxx vcl/source/glyphs/graphite_textsrc.hxx vcl/source/helper/canvasbitmap.cxx vcl/source/helper/smartid.cxx vcl/source/helper/xconnection.cxx vcl/source/src/btntext.src vcl/source/src/images.src vcl/source/src/print.src vcl/source/window/accel.cxx vcl/source/window/accmgr.cxx vcl/source/window/brdwin.cxx vcl/source/window/btndlg.cxx vcl/source/window/dlgctrl.cxx vcl/source/window/javachild.cxx vcl/source/window/menu.cxx vcl/source/window/msgbox.cxx vcl/source/window/printdlg.cxx vcl/source/window/status.cxx vcl/source/window/syschild.cxx vcl/source/window/toolbox.cxx vcl/source/window/toolbox2.cxx vcl/source/window/window.cxx vcl/source/window/window2.cxx vcl/source/window/wrkwin.cxx vcl/unx/gtk/app/gtkdata.cxx vcl/unx/gtk/app/gtkinst.cxx vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx vcl/unx/gtk/window/gtkframe.cxx vcl/unx/gtk/window/gtkobject.cxx vcl/unx/headless/svpbmp.hxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svpinst.cxx vcl/unx/headless/svpinst.hxx vcl/unx/headless/svpprn.cxx vcl/unx/headless/svpprn.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/unx/headless/svptext.cxx vcl/unx/inc/dtint.hxx vcl/unx/inc/plugins/gtk/gtkdata.hxx vcl/unx/inc/pspgraphics.h vcl/unx/inc/salbmp.h vcl/unx/inc/saldata.hxx vcl/unx/inc/saldisp.hxx vcl/unx/inc/salgdi.h vcl/unx/inc/salinst.h vcl/unx/inc/xfont.hxx vcl/unx/kde/kdedata.cxx vcl/unx/kde4/KDESalGraphics.cxx vcl/unx/source/app/keysymnames.cxx vcl/unx/source/app/saldata.cxx vcl/unx/source/app/saldisp.cxx vcl/unx/source/app/salinst.cxx vcl/unx/source/app/wmadaptor.cxx vcl/unx/source/dtrans/X11_selection.cxx vcl/unx/source/dtrans/X11_service.cxx vcl/unx/source/gdi/makefile.mk vcl/unx/source/gdi/pspgraphics.cxx vcl/unx/source/gdi/salgdi.cxx vcl/unx/source/gdi/salgdi3.cxx vcl/unx/source/gdi/salprnpsp.cxx vcl/unx/source/gdi/xfont.cxx vcl/unx/source/gdi/xlfd_attr.cxx vcl/unx/source/gdi/xlfd_attr.hxx vcl/unx/source/gdi/xlfd_extd.cxx vcl/unx/source/gdi/xlfd_extd.hxx vcl/unx/source/gdi/xlfd_smpl.cxx vcl/unx/source/gdi/xlfd_smpl.hxx vcl/unx/source/printer/ppdparser.cxx vcl/unx/source/printer/printerinfomanager.cxx vcl/unx/source/window/salframe.cxx vcl/unx/source/window/salmenu.cxx vcl/unx/source/window/salobj.cxx vcl/util/makefile2.pmk vcl/win/inc/salbmp.h vcl/win/inc/saldata.hxx vcl/win/inc/salgdi.h vcl/win/inc/salinst.h vcl/win/source/app/saldata.cxx vcl/win/source/app/salinst.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salprn.cxx vcl/win/source/gdi/winlayout.cxx vcl/win/source/window/salframe.cxx vcl/win/source/window/salobj.cxx vcl/workben/outdevgrind.cxx vos/inc/vos/execabl.hxx vos/inc/vos/macros.hxx vos/inc/vos/pipe.hxx vos/inc/vos/process.hxx vos/inc/vos/refernce.hxx vos/inc/vos/signal.hxx vos/inc/vos/socket.hxx vos/inc/vos/stream.hxx vos/inc/vos/thread.hxx vos/source/pipe.cxx vos/source/process.cxx vos/source/signal.cxx vos/source/thread.cxx vos/source/timer.cxx
2011-03-11 14:24:23 +01:00
void WinSalFrame::SimulateKeyPress( sal_uInt16 nKeyCode )
{
BYTE nVKey = 0;
switch (nKeyCode)
{
case KEY_CAPSLOCK:
nVKey = VK_CAPITAL;
break;
}
if (nVKey > 0 && nVKey < 255)
{
::keybd_event(nVKey, 0x45, KEYEVENTF_EXTENDEDKEY, 0);
::keybd_event(nVKey, 0x45, KEYEVENTF_EXTENDEDKEY|KEYEVENTF_KEYUP, 0);
}
}
void WinSalFrame::ResetClipRegion()
{
SetWindowRgn( mhWnd, 0, TRUE );
}
void WinSalFrame::BeginSetClipRegion( sal_uLong nRects )
{
if( mpClipRgnData )
delete [] (BYTE*)mpClipRgnData;
sal_uLong nRectBufSize = sizeof(RECT)*nRects;
mpClipRgnData = (RGNDATA*)new BYTE[sizeof(RGNDATA)-1+nRectBufSize];
mpClipRgnData->rdh.dwSize = sizeof( RGNDATAHEADER );
mpClipRgnData->rdh.iType = RDH_RECTANGLES;
mpClipRgnData->rdh.nCount = nRects;
mpClipRgnData->rdh.nRgnSize = nRectBufSize;
SetRectEmpty( &(mpClipRgnData->rdh.rcBound) );
mpNextClipRect = (RECT*)(&(mpClipRgnData->Buffer));
mbFirstClipRect = TRUE;
}
void WinSalFrame::UnionClipRegion( long nX, long nY, long nWidth, long nHeight )
{
if( ! mpClipRgnData )
return;
RECT* pRect = mpNextClipRect;
RECT* pBoundRect = &(mpClipRgnData->rdh.rcBound);
long nRight = nX + nWidth;
long nBottom = nY + nHeight;
if ( mbFirstClipRect )
{
pBoundRect->left = nX;
pBoundRect->top = nY;
pBoundRect->right = nRight;
pBoundRect->bottom = nBottom;
mbFirstClipRect = FALSE;
}
else
{
if ( nX < pBoundRect->left )
pBoundRect->left = (int)nX;
if ( nY < pBoundRect->top )
pBoundRect->top = (int)nY;
if ( nRight > pBoundRect->right )
pBoundRect->right = (int)nRight;
if ( nBottom > pBoundRect->bottom )
pBoundRect->bottom = (int)nBottom;
}
pRect->left = (int)nX;
pRect->top = (int)nY;
pRect->right = (int)nRight;
pRect->bottom = (int)nBottom;
if( (mpNextClipRect - (RECT*)(&mpClipRgnData->Buffer)) < (int)mpClipRgnData->rdh.nCount )
mpNextClipRect++;
}
void WinSalFrame::EndSetClipRegion()
{
if( ! mpClipRgnData )
return;
HRGN hRegion;
// create region from accumulated rectangles
if ( mpClipRgnData->rdh.nCount == 1 )
{
RECT* pRect = &(mpClipRgnData->rdh.rcBound);
hRegion = CreateRectRgn( pRect->left, pRect->top,
pRect->right, pRect->bottom );
}
else
{
sal_uLong nSize = mpClipRgnData->rdh.nRgnSize+sizeof(RGNDATAHEADER);
hRegion = ExtCreateRegion( NULL, nSize, mpClipRgnData );
}
delete [] (BYTE*)mpClipRgnData;
mpClipRgnData = NULL;
DBG_ASSERT( hRegion, "WinSalFrame::EndSetClipRegion() - Can't create ClipRegion" );
if( hRegion )
{
RECT aWindowRect;
GetWindowRect( mhWnd, &aWindowRect );
POINT aPt;
aPt.x=0;
aPt.y=0;
ClientToScreen( mhWnd, &aPt );
OffsetRgn( hRegion, aPt.x - aWindowRect.left, aPt.y - aWindowRect.top );
if( SetWindowRgn( mhWnd, hRegion, TRUE ) == 0 )
DeleteObject( hRegion );
}
}
2000-09-18 16:07:07 +00:00
static long ImplHandleMouseMsg( HWND hWnd, UINT nMsg,
WPARAM wParam, LPARAM lParam )
{
WinSalFrame* pFrame = GetWindowPtr( hWnd );
2000-09-18 16:07:07 +00:00
if ( !pFrame )
return 0;
if( nMsg == WM_LBUTTONDOWN || nMsg == WM_MBUTTONDOWN || nMsg == WM_RBUTTONDOWN )
{
// #103168# post again if async focus has not arrived yet
// hopefully we will not receive the corresponding button up before this
// button down arrives again
vcl::Window *pWin = pFrame->GetWindow();
if( pWin && pWin->ImplGetWindowImpl()->mpFrameData->mnFocusId )
{
PostMessageW( hWnd, nMsg, wParam, lParam );
return 1;
}
}
2000-09-18 16:07:07 +00:00
SalMouseEvent aMouseEvt;
long nRet;
sal_uInt16 nEvent = 0;
bool bCall = TRUE;
2000-09-18 16:07:07 +00:00
aMouseEvt.mnX = (short)LOWORD( lParam );
aMouseEvt.mnY = (short)HIWORD( lParam );
aMouseEvt.mnCode = 0;
aMouseEvt.mnTime = GetMessageTime();
// Use GetKeyState(), as some Logitech mouse drivers do not check
// KeyState when simulating double-click with center mouse button
2000-09-18 16:07:07 +00:00
if ( GetKeyState( VK_LBUTTON ) & 0x8000 )
aMouseEvt.mnCode |= MOUSE_LEFT;
if ( GetKeyState( VK_MBUTTON ) & 0x8000 )
aMouseEvt.mnCode |= MOUSE_MIDDLE;
if ( GetKeyState( VK_RBUTTON ) & 0x8000 )
aMouseEvt.mnCode |= MOUSE_RIGHT;
if ( GetKeyState( VK_SHIFT ) & 0x8000 )
aMouseEvt.mnCode |= KEY_SHIFT;
if ( GetKeyState( VK_CONTROL ) & 0x8000 )
aMouseEvt.mnCode |= KEY_MOD1;
if ( GetKeyState( VK_MENU ) & 0x8000 )
aMouseEvt.mnCode |= KEY_MOD2;
switch ( nMsg )
{
case WM_MOUSEMOVE:
{
// As the mouse events are not collected correctly when
// pressing modifier keys (as interrupted by KeyEvents)
// we do this here ourselves
2000-09-18 16:07:07 +00:00
if ( aMouseEvt.mnCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2) )
{
MSG aTempMsg;
if ( PeekMessageW( &aTempMsg, hWnd, WM_MOUSEFIRST, WM_MOUSELAST, PM_NOREMOVE | PM_NOYIELD ) )
2000-09-18 16:07:07 +00:00
{
if ( (aTempMsg.message == WM_MOUSEMOVE) &&
(aTempMsg.wParam == wParam) )
return 1;
}
}
SalData* pSalData = GetSalData();
// Test for MouseLeave
if ( pSalData->mhWantLeaveMsg && (pSalData->mhWantLeaveMsg != hWnd) )
SendMessageW( pSalData->mhWantLeaveMsg, SAL_MSG_MOUSELEAVE, 0, GetMessagePos() );
2000-09-18 16:07:07 +00:00
pSalData->mhWantLeaveMsg = hWnd;
// Start MouseLeave-Timer
if ( !pSalData->mpMouseLeaveTimer )
{
pSalData->mpMouseLeaveTimer = new AutoTimer;
pSalData->mpMouseLeaveTimer->SetTimeout( SAL_MOUSELEAVE_TIMEOUT );
pSalData->mpMouseLeaveTimer->Start();
// We don't need to set a timeout handler, because we test
2000-09-18 16:07:07 +00:00
// for mouseleave in the timeout callback
}
aMouseEvt.mnButton = 0;
nEvent = SALEVENT_MOUSEMOVE;
}
break;
case WM_NCMOUSEMOVE:
case SAL_MSG_MOUSELEAVE:
{
SalData* pSalData = GetSalData();
if ( pSalData->mhWantLeaveMsg == hWnd )
{
pSalData->mhWantLeaveMsg = 0;
if ( pSalData->mpMouseLeaveTimer )
{
delete pSalData->mpMouseLeaveTimer;
pSalData->mpMouseLeaveTimer = NULL;
}
// Mouse-Coordinates are relative to the screen
2000-09-18 16:07:07 +00:00
POINT aPt;
aPt.x = (short)LOWORD( lParam );
aPt.y = (short)HIWORD( lParam );
ScreenToClient( hWnd, &aPt );
aMouseEvt.mnX = aPt.x;
aMouseEvt.mnY = aPt.y;
aMouseEvt.mnButton = 0;
nEvent = SALEVENT_MOUSELEAVE;
}
else
bCall = FALSE;
}
break;
case WM_LBUTTONDOWN:
aMouseEvt.mnButton = MOUSE_LEFT;
nEvent = SALEVENT_MOUSEBUTTONDOWN;
break;
case WM_MBUTTONDOWN:
aMouseEvt.mnButton = MOUSE_MIDDLE;
nEvent = SALEVENT_MOUSEBUTTONDOWN;
break;
case WM_RBUTTONDOWN:
aMouseEvt.mnButton = MOUSE_RIGHT;
nEvent = SALEVENT_MOUSEBUTTONDOWN;
break;
case WM_LBUTTONUP:
aMouseEvt.mnButton = MOUSE_LEFT;
nEvent = SALEVENT_MOUSEBUTTONUP;
break;
case WM_MBUTTONUP:
aMouseEvt.mnButton = MOUSE_MIDDLE;
nEvent = SALEVENT_MOUSEBUTTONUP;
break;
case WM_RBUTTONUP:
aMouseEvt.mnButton = MOUSE_RIGHT;
nEvent = SALEVENT_MOUSEBUTTONUP;
break;
}
// check if this window was destroyed - this might happen if we are the help window
// and sent a mouse leave message to the application which killed the help window, ie ourselves
if( !IsWindow( hWnd ) )
return 0;
2000-09-18 16:07:07 +00:00
if ( bCall )
{
if ( nEvent == SALEVENT_MOUSEBUTTONDOWN )
UpdateWindow( hWnd );
2002-07-11 06:43:29 +00:00
// --- RTL --- (mirror mouse pos)
if( AllSettings::GetLayoutRTL() )
2002-07-11 06:43:29 +00:00
aMouseEvt.mnX = pFrame->maGeometry.nWidth-1-aMouseEvt.mnX;
nRet = pFrame->CallCallback( nEvent, &aMouseEvt );
2000-09-18 16:07:07 +00:00
if ( nMsg == WM_MOUSEMOVE )
SetCursor( pFrame->mhCursor );
2000-09-18 16:07:07 +00:00
}
else
nRet = 0;
return nRet;
}
static long ImplHandleMouseActivateMsg( HWND hWnd )
{
WinSalFrame* pFrame = GetWindowPtr( hWnd );
2000-09-18 16:07:07 +00:00
if ( !pFrame )
return 0;
if ( pFrame->mbFloatWin )
2001-10-24 07:57:18 +00:00
return TRUE;
2000-09-18 16:07:07 +00:00
SalMouseActivateEvent aMouseActivateEvt;
POINT aPt;
GetCursorPos( &aPt );
ScreenToClient( hWnd, &aPt );
aMouseActivateEvt.mnX = aPt.x;
aMouseActivateEvt.mnY = aPt.y;
return pFrame->CallCallback( SALEVENT_MOUSEACTIVATE, &aMouseActivateEvt );
2000-09-18 16:07:07 +00:00
}
static long ImplHandleWheelMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam )
2000-09-18 16:07:07 +00:00
{
DBG_ASSERT( nMsg == WM_MOUSEWHEEL ||
nMsg == WM_MOUSEHWHEEL,
"ImplHandleWheelMsg() called with no wheel mouse event" );
2000-09-18 16:07:07 +00:00
ImplSalYieldMutexAcquireWithWait();
long nRet = 0;
WinSalFrame* pFrame = GetWindowPtr( hWnd );
2000-09-18 16:07:07 +00:00
if ( pFrame )
{
WORD nWinModCode = LOWORD( wParam );
POINT aWinPt;
aWinPt.x = (short)LOWORD( lParam );
aWinPt.y = (short)HIWORD( lParam );
ScreenToClient( hWnd, &aWinPt );
SalWheelMouseEvent aWheelEvt;
aWheelEvt.mnTime = GetMessageTime();
aWheelEvt.mnX = aWinPt.x;
aWheelEvt.mnY = aWinPt.y;
aWheelEvt.mnCode = 0;
aWheelEvt.mnDelta = (short)HIWORD( wParam );
aWheelEvt.mnNotchDelta = aWheelEvt.mnDelta/WHEEL_DELTA;
if( aWheelEvt.mnNotchDelta == 0 )
{
if( aWheelEvt.mnDelta > 0 )
aWheelEvt.mnNotchDelta = 1;
else if( aWheelEvt.mnDelta < 0 )
aWheelEvt.mnNotchDelta = -1;
}
if( nMsg == WM_MOUSEWHEEL )
{
if ( aSalShlData.mnWheelScrollLines == WHEEL_PAGESCROLL )
aWheelEvt.mnScrollLines = SAL_WHEELMOUSE_EVENT_PAGESCROLL;
else
aWheelEvt.mnScrollLines = aSalShlData.mnWheelScrollLines;
aWheelEvt.mbHorz = FALSE;
}
2000-09-18 16:07:07 +00:00
else
{
aWheelEvt.mnScrollLines = aSalShlData.mnWheelScrollChars;
aWheelEvt.mbHorz = TRUE;
// fdo#36380 - seems horiz scrolling has swapped direction
aWheelEvt.mnDelta *= -1;
aWheelEvt.mnNotchDelta *= -1;
}
2000-09-18 16:07:07 +00:00
if ( nWinModCode & MK_SHIFT )
aWheelEvt.mnCode |= KEY_SHIFT;
if ( nWinModCode & MK_CONTROL )
aWheelEvt.mnCode |= KEY_MOD1;
if ( GetKeyState( VK_MENU ) & 0x8000 )
aWheelEvt.mnCode |= KEY_MOD2;
// --- RTL --- (mirror mouse pos)
if( AllSettings::GetLayoutRTL() )
aWheelEvt.mnX = pFrame->maGeometry.nWidth-1-aWheelEvt.mnX;
nRet = pFrame->CallCallback( SALEVENT_WHEELMOUSE, &aWheelEvt );
2000-09-18 16:07:07 +00:00
}
ImplSalYieldMutexRelease();
return nRet;
}
static sal_uInt16 ImplSalGetKeyCode( WPARAM wParam )
2000-09-18 16:07:07 +00:00
{
sal_uInt16 nKeyCode;
2000-09-18 16:07:07 +00:00
// convert KeyCode
if ( wParam < KEY_TAB_SIZE )
nKeyCode = aImplTranslateKeyTab[wParam];
else
{
SalData* pSalData = GetSalData();
std::map< UINT, sal_uInt16 >::const_iterator it = pSalData->maVKMap.find( (UINT)wParam );
if( it != pSalData->maVKMap.end() )
nKeyCode = it->second;
else
nKeyCode = 0;
}
2000-09-18 16:07:07 +00:00
return nKeyCode;
}
static void ImplUpdateInputLang( WinSalFrame* pFrame )
2000-09-18 16:07:07 +00:00
{
UINT nLang = LOWORD( GetKeyboardLayout( 0 ) );
if ( nLang && nLang != pFrame->mnInputLang )
{
// keep input lang up-to-date
pFrame->mnInputLang = nLang;
}
2011-01-24 04:00:57 +02:00
// We are on Windows NT so we use Unicode FrameProcs and get
// Unicode charcodes directly from Windows no need to set up a
// code page
return;
}
static sal_Unicode ImplGetCharCode( WinSalFrame* pFrame, WPARAM nCharCode )
{
ImplUpdateInputLang( pFrame );
2011-01-24 04:00:57 +02:00
// We are on Windows NT so we use Unicode FrameProcs and we
// get Unicode charcodes directly from Windows
2011-01-24 04:00:57 +02:00
return (sal_Unicode)nCharCode;
2000-09-18 16:07:07 +00:00
}
LanguageType WinSalFrame::GetInputLanguage()
{
if( !mnInputLang )
ImplUpdateInputLang( this );
if( !mnInputLang )
return LANGUAGE_DONTKNOW;
else
return (LanguageType) mnInputLang;
}
bool WinSalFrame::MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, vcl::KeyCode& rKeyCode )
{
bool bRet = FALSE;
sal_IntPtr nLangType = aLangType;
// just use the passed language identifier, do not try to load additional keyboard support
HKL hkl = (HKL) nLangType;
if( hkl )
{
SHORT scan = VkKeyScanExW( aUnicode, hkl );
if( LOWORD(scan) == 0xFFFF )
// keyboard not loaded or key cannot be mapped
bRet = FALSE;
else
{
BYTE vkeycode = LOBYTE(scan);
BYTE shiftstate = HIBYTE(scan);
CWS-TOOLING: integrate CWS macshortcuts01 2009-04-02 18:13:38 +0200 pl r270430 : CWS-TOOLING: rebase CWS macshortcuts01 to trunk@270033 (milestone: DEV300:m45) 2009-03-04 13:02:01 +0100 pl r268816 : make compile with oldish gtk headers 2009-03-04 11:23:41 +0100 rvojta r268799 : Remove #ifndef MACOSX as Mac OS X X11 port is obsolote, no need to check for non Mac OS X 2009-03-03 16:33:34 +0100 rvojta r268764 : Meta/Super to MOD3 on all Unix platforms except Mac OS X 2009-03-03 16:08:46 +0100 rvojta r268744 : Map GDK_Meta_L/R and GDK_Super_L/R keys to KEY_MOD3 on Unix systems except Mac OS X 2009-03-03 16:04:23 +0100 rvojta r268742 : IsMod3(), IsLeftMod3(), IsRightMod3() added 2009-03-03 16:03:48 +0100 rvojta r268741 : MODKEY_LMOD3, MODKEY_RMOD3, MODKEY_MOD3 support 2009-02-28 00:09:26 +0100 rvojta r268620 : New KeyCode constructors support, by default MOD3 is not used here (probably temporary solution) 2009-02-25 22:53:02 +0100 rvojta r268469 : MOD3 support (META_DOWN_MASK) 2009-02-25 13:22:13 +0100 rvojta r268435 : Cmd-M to minimize window, Cmd-Option-M to minimize all windows 2009-02-25 11:09:20 +0100 rvojta r268417 : Add back F11 for non Mac OS X platforms (removed by accident in r268405) 2009-02-24 18:32:31 +0100 rvojta r268405 : F11 replaced by Cmd-T on Mac OS X 2009-02-23 15:21:53 +0100 sb r268358 : #i99296# support values with both xml:lang and install:module (which are moved into the spool tree, not the res tree) 2009-02-16 22:45:34 +0100 rvojta r267839 : Multiplatform shortcuts support 2009-02-16 22:41:03 +0100 rvojta r267838 : Use install:module instead of separate xcu file 2009-02-16 18:35:36 +0100 rvojta r267833 : Removed accelerators target 2009-02-16 09:27:42 +0100 rvojta r267776 : MOD3 added 2009-02-16 09:18:32 +0100 rvojta r267775 : MOD3 support 2009-02-16 09:17:11 +0100 rvojta r267774 : MOD3 support 2009-02-15 22:11:37 +0100 rvojta r267773 : Check for MOD3 too 2009-02-15 22:11:15 +0100 rvojta r267772 : Check for MOD3 too 2009-02-15 22:10:37 +0100 rvojta r267771 : Check for MOD3 too 2009-02-15 22:10:15 +0100 rvojta r267770 : Check for MOD3 during mouse event too 2009-02-15 22:09:54 +0100 rvojta r267769 : IsMod3() added 2009-02-15 19:34:59 +0100 rvojta r267768 : MOD3 added (Ctrl on Mac OS X) 2009-02-15 19:33:43 +0100 rvojta r267767 : Cmd-M -> Ctrl-M for default format 2009-02-15 19:32:19 +0100 rvojta r267766 : MOD3 added (Ctrl on Mac OS X) 2009-02-15 19:31:30 +0100 rvojta r267765 : MOD3 added (Ctrl on Mac OS X) 2009-02-15 19:31:04 +0100 rvojta r267764 : MOD3 added (Ctrl on Mac OS X) 2009-02-15 19:30:33 +0100 rvojta r267763 : MOD3 added (Ctrl on Mac OS X) 2009-02-15 19:30:09 +0100 rvojta r267762 : MOD3 added (Ctrl on Mac OS X) 2009-02-13 22:11:22 +0100 rvojta r267751 : Cmd-Shift-Z for .uno:Redo 2009-02-13 22:04:19 +0100 rvojta r267748 : F11 -> Cmd-T for .uno:DesignerDialog 2009-02-13 21:09:11 +0100 rvojta r267743 : F11 -> Cmd-T (all occurences) 2009-02-13 19:47:21 +0100 rvojta r267741 : accelerators target added for Mac OS X shortcuts 2009-02-13 19:46:58 +0100 rvojta r267740 : Spreadsheet - replace F11 with Cmd-T 2009-02-13 19:24:19 +0100 rvojta r267739 : Remove Accelerators-Mac.xcs 2009-02-13 18:50:01 +0100 rvojta r267738 : Accelerators-Mac.xcs test 2009-02-13 18:48:10 +0100 rvojta r267737 : Accelerators-Mac.xcu added 2009-02-13 18:46:48 +0100 rvojta r267736 : F11 -> Cmd-T for stylist in Spreadsheet
2009-04-12 04:24:43 +00:00
// Last argument is set to FALSE, because there's no decission made
// yet which key should be assigned to MOD3 modifier on Windows.
// Windows key - user's can be confused, because it should display
// Windows menu (applies to both left/right key)
// Menu key - this key is used to display context menu
// AltGr key - probably it has no sense
rKeyCode = vcl::KeyCode( ImplSalGetKeyCode( vkeycode ),
(shiftstate & 0x01) ? TRUE : FALSE, // shift
(shiftstate & 0x02) ? TRUE : FALSE, // ctrl
CWS-TOOLING: integrate CWS macshortcuts01 2009-04-02 18:13:38 +0200 pl r270430 : CWS-TOOLING: rebase CWS macshortcuts01 to trunk@270033 (milestone: DEV300:m45) 2009-03-04 13:02:01 +0100 pl r268816 : make compile with oldish gtk headers 2009-03-04 11:23:41 +0100 rvojta r268799 : Remove #ifndef MACOSX as Mac OS X X11 port is obsolote, no need to check for non Mac OS X 2009-03-03 16:33:34 +0100 rvojta r268764 : Meta/Super to MOD3 on all Unix platforms except Mac OS X 2009-03-03 16:08:46 +0100 rvojta r268744 : Map GDK_Meta_L/R and GDK_Super_L/R keys to KEY_MOD3 on Unix systems except Mac OS X 2009-03-03 16:04:23 +0100 rvojta r268742 : IsMod3(), IsLeftMod3(), IsRightMod3() added 2009-03-03 16:03:48 +0100 rvojta r268741 : MODKEY_LMOD3, MODKEY_RMOD3, MODKEY_MOD3 support 2009-02-28 00:09:26 +0100 rvojta r268620 : New KeyCode constructors support, by default MOD3 is not used here (probably temporary solution) 2009-02-25 22:53:02 +0100 rvojta r268469 : MOD3 support (META_DOWN_MASK) 2009-02-25 13:22:13 +0100 rvojta r268435 : Cmd-M to minimize window, Cmd-Option-M to minimize all windows 2009-02-25 11:09:20 +0100 rvojta r268417 : Add back F11 for non Mac OS X platforms (removed by accident in r268405) 2009-02-24 18:32:31 +0100 rvojta r268405 : F11 replaced by Cmd-T on Mac OS X 2009-02-23 15:21:53 +0100 sb r268358 : #i99296# support values with both xml:lang and install:module (which are moved into the spool tree, not the res tree) 2009-02-16 22:45:34 +0100 rvojta r267839 : Multiplatform shortcuts support 2009-02-16 22:41:03 +0100 rvojta r267838 : Use install:module instead of separate xcu file 2009-02-16 18:35:36 +0100 rvojta r267833 : Removed accelerators target 2009-02-16 09:27:42 +0100 rvojta r267776 : MOD3 added 2009-02-16 09:18:32 +0100 rvojta r267775 : MOD3 support 2009-02-16 09:17:11 +0100 rvojta r267774 : MOD3 support 2009-02-15 22:11:37 +0100 rvojta r267773 : Check for MOD3 too 2009-02-15 22:11:15 +0100 rvojta r267772 : Check for MOD3 too 2009-02-15 22:10:37 +0100 rvojta r267771 : Check for MOD3 too 2009-02-15 22:10:15 +0100 rvojta r267770 : Check for MOD3 during mouse event too 2009-02-15 22:09:54 +0100 rvojta r267769 : IsMod3() added 2009-02-15 19:34:59 +0100 rvojta r267768 : MOD3 added (Ctrl on Mac OS X) 2009-02-15 19:33:43 +0100 rvojta r267767 : Cmd-M -> Ctrl-M for default format 2009-02-15 19:32:19 +0100 rvojta r267766 : MOD3 added (Ctrl on Mac OS X) 2009-02-15 19:31:30 +0100 rvojta r267765 : MOD3 added (Ctrl on Mac OS X) 2009-02-15 19:31:04 +0100 rvojta r267764 : MOD3 added (Ctrl on Mac OS X) 2009-02-15 19:30:33 +0100 rvojta r267763 : MOD3 added (Ctrl on Mac OS X) 2009-02-15 19:30:09 +0100 rvojta r267762 : MOD3 added (Ctrl on Mac OS X) 2009-02-13 22:11:22 +0100 rvojta r267751 : Cmd-Shift-Z for .uno:Redo 2009-02-13 22:04:19 +0100 rvojta r267748 : F11 -> Cmd-T for .uno:DesignerDialog 2009-02-13 21:09:11 +0100 rvojta r267743 : F11 -> Cmd-T (all occurences) 2009-02-13 19:47:21 +0100 rvojta r267741 : accelerators target added for Mac OS X shortcuts 2009-02-13 19:46:58 +0100 rvojta r267740 : Spreadsheet - replace F11 with Cmd-T 2009-02-13 19:24:19 +0100 rvojta r267739 : Remove Accelerators-Mac.xcs 2009-02-13 18:50:01 +0100 rvojta r267738 : Accelerators-Mac.xcs test 2009-02-13 18:48:10 +0100 rvojta r267737 : Accelerators-Mac.xcu added 2009-02-13 18:46:48 +0100 rvojta r267736 : F11 -> Cmd-T for stylist in Spreadsheet
2009-04-12 04:24:43 +00:00
(shiftstate & 0x04) ? TRUE : FALSE, // alt
FALSE );
bRet = TRUE;
}
}
return bRet;
}
2000-09-18 16:07:07 +00:00
static long ImplHandleKeyMsg( HWND hWnd, UINT nMsg,
WPARAM wParam, LPARAM lParam, LRESULT& rResult )
2000-09-18 16:07:07 +00:00
{
static bool bIgnoreCharMsg = FALSE;
2000-09-18 16:07:07 +00:00
static WPARAM nDeadChar = 0;
static WPARAM nLastVKChar = 0;
static sal_uInt16 nLastChar = 0;
static sal_uInt16 nLastModKeyCode = 0;
static bool bWaitForModKeyRelease = false;
sal_uInt16 nRepeat = LOWORD( lParam )-1;
sal_uInt16 nModCode = 0;
2000-09-18 16:07:07 +00:00
// this key might have been relayed by SysChild and thus
// may not be processed twice
2000-09-18 16:07:07 +00:00
GetSalData()->mnSalObjWantKeyEvt = 0;
if ( nMsg == WM_DEADCHAR )
{
nDeadChar = wParam;
return 0;
}
WinSalFrame* pFrame = GetWindowPtr( hWnd );
2000-09-18 16:07:07 +00:00
if ( !pFrame )
return 0;
// reset the background mode for each text input,
// as some tools such as RichWin may have changed it
if ( pFrame->mpGraphics &&
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
pFrame->mpGraphics->getHDC() )
SetBkMode( pFrame->mpGraphics->getHDC(), TRANSPARENT );
2000-09-18 16:07:07 +00:00
// determine modifiers
if ( GetKeyState( VK_SHIFT ) & 0x8000 )
nModCode |= KEY_SHIFT;
if ( GetKeyState( VK_CONTROL ) & 0x8000 )
nModCode |= KEY_MOD1;
if ( GetKeyState( VK_MENU ) & 0x8000 )
nModCode |= KEY_MOD2;
if ( (nMsg == WM_CHAR) || (nMsg == WM_SYSCHAR) )
{
nDeadChar = 0;
if ( bIgnoreCharMsg )
{
bIgnoreCharMsg = FALSE;
// #101635# if zero is returned here for WM_SYSCHAR (ALT+<key>) Windows will beep
// because this 'hotkey' was not processed -> better return 1
// except for Alt-SPACE which should always open the sysmenu (#104616#)
// also return zero if a system menubar is available that might process this hotkey
// this also applies to the OLE inplace embedding where we are a child window
if( (GetWindowStyle( hWnd ) & WS_CHILD) || GetMenu( hWnd ) || (wParam == 0x20) )
return 0;
else
return 1;
2000-09-18 16:07:07 +00:00
}
// ignore backspace as a single key, so that
// we do not get problems for combinations w/ a DeadKey
2000-09-18 16:07:07 +00:00
if ( wParam == 0x08 ) // BACKSPACE
return 0;
// only "free flying" WM_CHAR messages arrive here, that are
// created by typing a ALT-NUMPAD combination
2000-09-18 16:07:07 +00:00
SalKeyEvent aKeyEvt;
if ( (wParam >= '0') && (wParam <= '9') )
aKeyEvt.mnCode = sal::static_int_cast<sal_uInt16>(KEYGROUP_NUM + wParam - '0');
2000-09-18 16:07:07 +00:00
else if ( (wParam >= 'A') && (wParam <= 'Z') )
aKeyEvt.mnCode = sal::static_int_cast<sal_uInt16>(KEYGROUP_ALPHA + wParam - 'A');
2000-09-18 16:07:07 +00:00
else if ( (wParam >= 'a') && (wParam <= 'z') )
aKeyEvt.mnCode = sal::static_int_cast<sal_uInt16>(KEYGROUP_ALPHA + wParam - 'a');
2000-09-18 16:07:07 +00:00
else if ( wParam == 0x0D ) // RETURN
aKeyEvt.mnCode = KEY_RETURN;
else if ( wParam == 0x1B ) // ESCAPE
aKeyEvt.mnCode = KEY_ESCAPE;
else if ( wParam == 0x09 ) // TAB
aKeyEvt.mnCode = KEY_TAB;
else if ( wParam == 0x20 ) // SPACE
aKeyEvt.mnCode = KEY_SPACE;
else
aKeyEvt.mnCode = 0;
aKeyEvt.mnTime = GetMessageTime();
aKeyEvt.mnCode |= nModCode;
aKeyEvt.mnCharCode = ImplGetCharCode( pFrame, wParam );
aKeyEvt.mnRepeat = nRepeat;
nLastChar = 0;
nLastVKChar = 0;
long nRet = pFrame->CallCallback( SALEVENT_KEYINPUT, &aKeyEvt );
pFrame->CallCallback( SALEVENT_KEYUP, &aKeyEvt );
2000-09-18 16:07:07 +00:00
return nRet;
}
// #i11583#, MCD, 2003-01-13, Support for WM_UNICHAR & Keyman 6.0; addition begins
else if( nMsg == WM_UNICHAR )
{
// If Windows is asking if we accept WM_UNICHAR, return TRUE
if(wParam == UNICODE_NOCHAR)
{
rResult = TRUE; // ssa: this will actually return TRUE to windows
return 1; // ...but this will only avoid calling the defwindowproc
}
SalKeyEvent aKeyEvt;
aKeyEvt.mnCode = nModCode; // Or should it be 0? - as this is always a character returned
aKeyEvt.mnTime = GetMessageTime();
aKeyEvt.mnRepeat = 0;
if( wParam >= Uni_SupplementaryPlanesStart )
{
// character is supplementary char in UTF-32 format - must be converted to UTF-16 supplementary pair
// sal_Unicode ch = (sal_Unicode) Uni_UTF32ToSurrogate1(wParam);
nLastChar = 0;
nLastVKChar = 0;
pFrame->CallCallback( SALEVENT_KEYINPUT, &aKeyEvt );
pFrame->CallCallback( SALEVENT_KEYUP, &aKeyEvt );
wParam = (sal_Unicode) Uni_UTF32ToSurrogate2( wParam );
}
aKeyEvt.mnCharCode = (sal_Unicode) wParam;
nLastChar = 0;
nLastVKChar = 0;
long nRet = pFrame->CallCallback( SALEVENT_KEYINPUT, &aKeyEvt );
pFrame->CallCallback( SALEVENT_KEYUP, &aKeyEvt );
return nRet;
}
// MCD, 2003-01-13, Support for WM_UNICHAR & Keyman 6.0; addition ends
2000-09-18 16:07:07 +00:00
else
{
// for shift, control and menu we issue a KeyModChange event
2000-09-18 16:07:07 +00:00
if ( (wParam == VK_SHIFT) || (wParam == VK_CONTROL) || (wParam == VK_MENU) )
{
SalKeyModEvent aModEvt;
aModEvt.mnTime = GetMessageTime();
aModEvt.mnCode = nModCode;
aModEvt.mnModKeyCode = 0; // no command events will be sent if this member is 0
sal_uInt16 tmpCode = 0;
if( GetKeyState( VK_LSHIFT ) & 0x8000 )
tmpCode |= MODKEY_LSHIFT;
if( GetKeyState( VK_RSHIFT ) & 0x8000 )
tmpCode |= MODKEY_RSHIFT;
if( GetKeyState( VK_LCONTROL ) & 0x8000 )
tmpCode |= MODKEY_LMOD1;
if( GetKeyState( VK_RCONTROL ) & 0x8000 )
tmpCode |= MODKEY_RMOD1;
if( GetKeyState( VK_LMENU ) & 0x8000 )
tmpCode |= MODKEY_LMOD2;
if( GetKeyState( VK_RMENU ) & 0x8000 )
tmpCode |= MODKEY_RMOD2;
if( tmpCode < nLastModKeyCode )
{
aModEvt.mnModKeyCode = nLastModKeyCode;
nLastModKeyCode = 0;
bWaitForModKeyRelease = true;
}
else
{
if( !bWaitForModKeyRelease )
nLastModKeyCode = tmpCode;
}
if( !tmpCode )
bWaitForModKeyRelease = false;
return pFrame->CallCallback( SALEVENT_KEYMODCHANGE, &aModEvt );
2000-09-18 16:07:07 +00:00
}
else
{
SalKeyEvent aKeyEvt;
sal_uInt16 nEvent;
2000-09-18 16:07:07 +00:00
MSG aCharMsg;
BOOL bCharPeek = FALSE;
2000-09-18 16:07:07 +00:00
UINT nCharMsg = WM_CHAR;
bool bKeyUp = (nMsg == WM_KEYUP) || (nMsg == WM_SYSKEYUP);
2000-09-18 16:07:07 +00:00
nLastModKeyCode = 0; // make sure no modkey messages are sent if they belong to a hotkey (see above)
aKeyEvt.mnCharCode = 0;
aKeyEvt.mnCode = 0;
2000-09-18 16:07:07 +00:00
aKeyEvt.mnCode = ImplSalGetKeyCode( wParam );
if ( !bKeyUp )
{
// check for charcode
// Get the related WM_CHAR message using PeekMessage, if available.
// The WM_CHAR message is always at the beginning of the
// message queue. Also it is made certain that there is always only
// one WM_CHAR message in the queue.
bCharPeek = PeekMessageW( &aCharMsg, hWnd,
2000-09-18 16:07:07 +00:00
WM_CHAR, WM_CHAR, PM_NOREMOVE | PM_NOYIELD );
if ( bCharPeek && (nDeadChar == aCharMsg.wParam) )
{
bCharPeek = FALSE;
nDeadChar = 0;
if ( wParam == VK_BACK )
{
PeekMessageW( &aCharMsg, hWnd,
2000-09-18 16:07:07 +00:00
nCharMsg, nCharMsg, PM_REMOVE | PM_NOYIELD );
return 0;
}
}
else
{
if ( !bCharPeek )
{
bCharPeek = PeekMessageW( &aCharMsg, hWnd,
2000-09-18 16:07:07 +00:00
WM_SYSCHAR, WM_SYSCHAR, PM_NOREMOVE | PM_NOYIELD );
nCharMsg = WM_SYSCHAR;
}
}
if ( bCharPeek )
aKeyEvt.mnCharCode = ImplGetCharCode( pFrame, aCharMsg.wParam );
else
aKeyEvt.mnCharCode = 0;
nLastChar = aKeyEvt.mnCharCode;
nLastVKChar = wParam;
}
else
{
if ( wParam == nLastVKChar )
{
aKeyEvt.mnCharCode = nLastChar;
nLastChar = 0;
nLastVKChar = 0;
}
}
if ( aKeyEvt.mnCode || aKeyEvt.mnCharCode )
{
if ( bKeyUp )
nEvent = SALEVENT_KEYUP;
else
nEvent = SALEVENT_KEYINPUT;
aKeyEvt.mnTime = GetMessageTime();
aKeyEvt.mnCode |= nModCode;
aKeyEvt.mnRepeat = nRepeat;
if( (nModCode & (KEY_MOD1|KEY_MOD2)) == (KEY_MOD1|KEY_MOD2) &&
aKeyEvt.mnCharCode )
{
// this is actually AltGr and should not be handled as Alt
aKeyEvt.mnCode &= ~(KEY_MOD1|KEY_MOD2);
}
bIgnoreCharMsg = bCharPeek ? TRUE : FALSE;
long nRet = pFrame->CallCallback( nEvent, &aKeyEvt );
// independent part only reacts on keyup but Windows does not send
// keyup for VK_HANJA
if( aKeyEvt.mnCode == KEY_HANGUL_HANJA )
nRet = pFrame->CallCallback( SALEVENT_KEYUP, &aKeyEvt );
2000-09-18 16:07:07 +00:00
bIgnoreCharMsg = FALSE;
// char-message, than remove or ignore
if ( bCharPeek )
{
nDeadChar = 0;
if ( nRet )
{
PeekMessageW( &aCharMsg, hWnd,
2000-09-18 16:07:07 +00:00
nCharMsg, nCharMsg, PM_REMOVE | PM_NOYIELD );
}
else
bIgnoreCharMsg = TRUE;
}
return nRet;
}
else
return 0;
}
}
}
long ImplHandleSalObjKeyMsg( HWND hWnd, UINT nMsg,
WPARAM wParam, LPARAM lParam )
{
if ( (nMsg == WM_KEYDOWN) || (nMsg == WM_KEYUP) )
{
WinSalFrame* pFrame = GetWindowPtr( hWnd );
2000-09-18 16:07:07 +00:00
if ( !pFrame )
return 0;
sal_uInt16 nRepeat = LOWORD( lParam )-1;
sal_uInt16 nModCode = 0;
2000-09-18 16:07:07 +00:00
// determine modifiers
if ( GetKeyState( VK_SHIFT ) & 0x8000 )
nModCode |= KEY_SHIFT;
if ( GetKeyState( VK_CONTROL ) & 0x8000 )
nModCode |= KEY_MOD1;
if ( GetKeyState( VK_MENU ) & 0x8000 )
nModCode |= KEY_MOD2;
if ( (wParam != VK_SHIFT) && (wParam != VK_CONTROL) && (wParam != VK_MENU) )
{
SalKeyEvent aKeyEvt;
sal_uInt16 nEvent;
bool bKeyUp = (nMsg == WM_KEYUP) || (nMsg == WM_SYSKEYUP);
2000-09-18 16:07:07 +00:00
// convert KeyCode
aKeyEvt.mnCode = ImplSalGetKeyCode( wParam );
aKeyEvt.mnCharCode = 0;
if ( aKeyEvt.mnCode )
{
if ( bKeyUp )
nEvent = SALEVENT_KEYUP;
else
nEvent = SALEVENT_KEYINPUT;
aKeyEvt.mnTime = GetMessageTime();
aKeyEvt.mnCode |= nModCode;
aKeyEvt.mnRepeat = nRepeat;
long nRet = pFrame->CallCallback( nEvent, &aKeyEvt );
2000-09-18 16:07:07 +00:00
return nRet;
}
else
return 0;
}
}
return 0;
}
long ImplHandleSalObjSysCharMsg( HWND hWnd, WPARAM wParam, LPARAM lParam )
{
WinSalFrame* pFrame = GetWindowPtr( hWnd );
2000-09-18 16:07:07 +00:00
if ( !pFrame )
return 0;
sal_uInt16 nRepeat = LOWORD( lParam )-1;
sal_uInt16 nModCode = 0;
sal_uInt16 cKeyCode = (sal_uInt16)wParam;
2000-09-18 16:07:07 +00:00
// determine modifiers
if ( GetKeyState( VK_SHIFT ) & 0x8000 )
nModCode |= KEY_SHIFT;
if ( GetKeyState( VK_CONTROL ) & 0x8000 )
nModCode |= KEY_MOD1;
nModCode |= KEY_MOD2;
// assemble KeyEvent
2000-09-18 16:07:07 +00:00
SalKeyEvent aKeyEvt;
aKeyEvt.mnTime = GetMessageTime();
if ( (cKeyCode >= 48) && (cKeyCode <= 57) )
aKeyEvt.mnCode = KEY_0+(cKeyCode-48);
else if ( (cKeyCode >= 65) && (cKeyCode <= 90) )
aKeyEvt.mnCode = KEY_A+(cKeyCode-65);
else if ( (cKeyCode >= 97) && (cKeyCode <= 122) )
aKeyEvt.mnCode = KEY_A+(cKeyCode-97);
else
aKeyEvt.mnCode = 0;
aKeyEvt.mnCode |= nModCode;
aKeyEvt.mnCharCode = ImplGetCharCode( pFrame, cKeyCode );
aKeyEvt.mnRepeat = nRepeat;
long nRet = pFrame->CallCallback( SALEVENT_KEYINPUT, &aKeyEvt );
pFrame->CallCallback( SALEVENT_KEYUP, &aKeyEvt );
2000-09-18 16:07:07 +00:00
return nRet;
}
static bool ImplHandlePaintMsg( HWND hWnd )
2000-09-18 16:07:07 +00:00
{
bool bMutex = FALSE;
2000-09-18 16:07:07 +00:00
if ( ImplSalYieldMutexTryToAcquire() )
2000-12-14 12:39:14 +00:00
bMutex = TRUE;
2000-09-18 16:07:07 +00:00
2000-12-14 12:39:14 +00:00
// if we don't get the mutex, we can also change the clip region,
// because other threads doesn't use the mutex from the main
// thread --> see AcquireGraphics()
2000-09-18 16:07:07 +00:00
WinSalFrame* pFrame = GetWindowPtr( hWnd );
2000-12-14 12:39:14 +00:00
if ( pFrame )
2000-09-18 16:07:07 +00:00
{
// clip-region must be reset, as we do not get a proper
// bounding-rectangle otherwise
if ( pFrame->mpGraphics && pFrame->mpGraphics->getRegion() )
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
SelectClipRgn( pFrame->mpGraphics->getHDC(), 0 );
2000-12-14 12:39:14 +00:00
// according to Window-Documentation one shall check first if
// there really is a paint-region
2000-12-14 12:39:14 +00:00
if ( GetUpdateRect( hWnd, NULL, FALSE ) )
2000-09-18 16:07:07 +00:00
{
2000-12-14 12:39:14 +00:00
// Call BeginPaint/EndPaint to query the rect and send
// this Notofication to rect
RECT aUpdateRect;
PAINTSTRUCT aPs;
BeginPaint( hWnd, &aPs );
CopyRect( &aUpdateRect, &aPs.rcPaint );
// Paint
// reset ClipRegion
if ( pFrame->mpGraphics && pFrame->mpGraphics->getRegion() )
2000-09-18 16:07:07 +00:00
{
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
SelectClipRgn( pFrame->mpGraphics->getHDC(),
pFrame->mpGraphics->getRegion() );
2000-09-18 16:07:07 +00:00
}
2000-12-14 12:39:14 +00:00
if ( bMutex )
{
SalPaintEvent aPEvt( aUpdateRect.left, aUpdateRect.top, aUpdateRect.right-aUpdateRect.left, aUpdateRect.bottom-aUpdateRect.top, pFrame->mbPresentation );
pFrame->CallCallback( SALEVENT_PAINT, &aPEvt );
2000-12-14 12:39:14 +00:00
}
else
{
RECT* pRect = new RECT;
CopyRect( pRect, &aUpdateRect );
PostMessageW( hWnd, SAL_MSG_POSTPAINT, (WPARAM)pRect, 0 );
2000-12-14 12:39:14 +00:00
}
EndPaint( hWnd, &aPs );
2000-12-14 12:39:14 +00:00
}
else
{
// reset ClipRegion
if ( pFrame->mpGraphics && pFrame->mpGraphics->getRegion() )
2000-12-14 12:39:14 +00:00
{
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
SelectClipRgn( pFrame->mpGraphics->getHDC(),
pFrame->mpGraphics->getRegion() );
2000-12-14 12:39:14 +00:00
}
2000-09-18 16:07:07 +00:00
}
}
2000-12-14 12:39:14 +00:00
if ( bMutex )
ImplSalYieldMutexRelease();
return bMutex;
2000-09-18 16:07:07 +00:00
}
static void ImplHandlePaintMsg2( HWND hWnd, RECT* pRect )
{
// Paint
if ( ImplSalYieldMutexTryToAcquire() )
{
WinSalFrame* pFrame = GetWindowPtr( hWnd );
2000-09-18 16:07:07 +00:00
if ( pFrame )
{
SalPaintEvent aPEvt( pRect->left, pRect->top, pRect->right-pRect->left, pRect->bottom-pRect->top );
pFrame->CallCallback( SALEVENT_PAINT, &aPEvt );
2000-09-18 16:07:07 +00:00
}
ImplSalYieldMutexRelease();
delete pRect;
}
else
PostMessageW( hWnd, SAL_MSG_POSTPAINT, (WPARAM)pRect, 0 );
2000-09-18 16:07:07 +00:00
}
static void SetMaximizedFrameGeometry( HWND hWnd, WinSalFrame* pFrame, RECT* pParentRect )
{
// calculate and set frame geometry of a maximized window - useful if the window is still hidden
// dualmonitor support:
// Get screensize of the monitor with the mouse pointer
RECT aRectMouse;
if( ! pParentRect )
{
POINT pt;
GetCursorPos( &pt );
aRectMouse.left = pt.x;
aRectMouse.top = pt.y;
aRectMouse.right = pt.x+2;
aRectMouse.bottom = pt.y+2;
pParentRect = &aRectMouse;
}
RECT aRect;
ImplSalGetWorkArea( hWnd, &aRect, pParentRect );
// a maximized window has no other borders than the caption
pFrame->maGeometry.nLeftDecoration = pFrame->maGeometry.nRightDecoration = pFrame->maGeometry.nBottomDecoration = 0;
pFrame->maGeometry.nTopDecoration = pFrame->mbCaption ? GetSystemMetrics( SM_CYCAPTION ) : 0;
aRect.top += pFrame->maGeometry.nTopDecoration;
pFrame->maGeometry.nX = aRect.left;
pFrame->maGeometry.nY = aRect.top;
pFrame->maGeometry.nWidth = aRect.right - aRect.left;
pFrame->maGeometry.nHeight = aRect.bottom - aRect.top;
}
static void UpdateFrameGeometry( HWND hWnd, WinSalFrame* pFrame )
2001-10-24 07:57:18 +00:00
{
if( !pFrame )
return;
RECT aRect;
GetWindowRect( hWnd, &aRect );
2001-11-23 11:39:27 +00:00
memset(&pFrame->maGeometry, 0, sizeof(SalFrameGeometry) );
2001-11-14 10:15:25 +00:00
if ( IsIconic( hWnd ) )
return;
2001-11-14 10:15:25 +00:00
POINT aPt;
aPt.x=0;
aPt.y=0;
ClientToScreen(hWnd, &aPt);
int cx = aPt.x - aRect.left;
pFrame->maGeometry.nTopDecoration = aPt.y - aRect.top;
2001-10-30 09:47:03 +00:00
pFrame->maGeometry.nLeftDecoration = cx;
pFrame->maGeometry.nRightDecoration = cx;
2001-10-30 09:47:03 +00:00
2001-11-14 10:15:25 +00:00
pFrame->maGeometry.nX = aPt.x;
pFrame->maGeometry.nY = aPt.y;
2001-10-24 07:57:18 +00:00
2001-11-14 10:15:25 +00:00
RECT aInnerRect;
GetClientRect( hWnd, &aInnerRect );
if( aInnerRect.right )
{
// improve right decoration
aPt.x=aInnerRect.right;
aPt.y=aInnerRect.top;
ClientToScreen(hWnd, &aPt);
pFrame->maGeometry.nRightDecoration = aRect.right - aPt.x;
}
if( aInnerRect.bottom ) // may be zero if window was not shown yet
pFrame->maGeometry.nBottomDecoration += aRect.bottom - aPt.y - aInnerRect.bottom;
else
// bottom border is typically the same as left/right
pFrame->maGeometry.nBottomDecoration = pFrame->maGeometry.nLeftDecoration;
int nWidth = aRect.right - aRect.left
- pFrame->maGeometry.nRightDecoration - pFrame->maGeometry.nLeftDecoration;
int nHeight = aRect.bottom - aRect.top
- pFrame->maGeometry.nBottomDecoration - pFrame->maGeometry.nTopDecoration;
// clamp to zero
pFrame->maGeometry.nHeight = nHeight < 0 ? 0 : nHeight;
pFrame->maGeometry.nWidth = nWidth < 0 ? 0 : nWidth;
pFrame->updateScreenNumber();
2001-10-24 07:57:18 +00:00
}
static void ImplCallMoveHdl( HWND hWnd )
{
WinSalFrame* pFrame = GetWindowPtr( hWnd );
2001-10-24 07:57:18 +00:00
if ( pFrame )
{
pFrame->CallCallback( SALEVENT_MOVE, 0 );
// to avoid doing Paint twice by VCL and SAL
//if ( IsWindowVisible( hWnd ) && !pFrame->mbInShow )
2001-10-31 18:59:11 +00:00
// UpdateWindow( hWnd );
2001-10-24 07:57:18 +00:00
}
}
2002-03-21 17:35:44 +00:00
static void ImplCallClosePopupsHdl( HWND hWnd )
{
WinSalFrame* pFrame = GetWindowPtr( hWnd );
2002-03-21 17:35:44 +00:00
if ( pFrame )
{
pFrame->CallCallback( SALEVENT_CLOSEPOPUPS, 0 );
2002-03-21 17:35:44 +00:00
}
}
2000-09-18 16:07:07 +00:00
static void ImplHandleMoveMsg( HWND hWnd )
{
if ( ImplSalYieldMutexTryToAcquire() )
{
WinSalFrame* pFrame = GetWindowPtr( hWnd );
2000-09-18 16:07:07 +00:00
if ( pFrame )
{
2001-10-24 07:57:18 +00:00
UpdateFrameGeometry( hWnd, pFrame );
2000-09-18 16:07:07 +00:00
if ( GetWindowStyle( hWnd ) & WS_VISIBLE )
pFrame->mbDefPos = FALSE;
2000-09-18 16:07:07 +00:00
// protect against recursion
if ( !pFrame->mbInMoveMsg )
2000-09-18 16:07:07 +00:00
{
// adjust window again for FullScreenMode
pFrame->mbInMoveMsg = TRUE;
if ( pFrame->mbFullScreen )
2000-09-18 16:07:07 +00:00
ImplSalFrameFullScreenPos( pFrame );
pFrame->mbInMoveMsg = FALSE;
2000-09-18 16:07:07 +00:00
}
// save state
2000-09-18 16:07:07 +00:00
ImplSaveFrameState( pFrame );
2001-10-31 18:59:11 +00:00
2001-10-24 07:57:18 +00:00
// Call Hdl
//#93851 if we call this handler, VCL floating windows are not updated correctly
2001-10-31 18:59:11 +00:00
ImplCallMoveHdl( hWnd );
2000-09-18 16:07:07 +00:00
}
ImplSalYieldMutexRelease();
}
else
PostMessageW( hWnd, SAL_MSG_POSTMOVE, 0, 0 );
2000-09-18 16:07:07 +00:00
}
static void ImplCallSizeHdl( HWND hWnd )
{
// as Windows can send these messages also, we have to use
// the Solar semaphore
2000-09-18 16:07:07 +00:00
if ( ImplSalYieldMutexTryToAcquire() )
{
WinSalFrame* pFrame = GetWindowPtr( hWnd );
2000-09-18 16:07:07 +00:00
if ( pFrame )
{
pFrame->CallCallback( SALEVENT_RESIZE, 0 );
// to avoid double Paints by VCL and SAL
if ( IsWindowVisible( hWnd ) && !pFrame->mbInShow )
2000-09-18 16:07:07 +00:00
UpdateWindow( hWnd );
}
ImplSalYieldMutexRelease();
}
else
PostMessageW( hWnd, SAL_MSG_POSTCALLSIZE, 0, 0 );
2000-09-18 16:07:07 +00:00
}
static void ImplHandleSizeMsg( HWND hWnd, WPARAM wParam, LPARAM lParam )
{
if ( (wParam != SIZE_MAXSHOW) && (wParam != SIZE_MAXHIDE) )
{
WinSalFrame* pFrame = GetWindowPtr( hWnd );
2000-09-18 16:07:07 +00:00
if ( pFrame )
{
2001-10-24 07:57:18 +00:00
UpdateFrameGeometry( hWnd, pFrame );
pFrame->mnWidth = (int)LOWORD(lParam);
pFrame->mnHeight = (int)HIWORD(lParam);
// save state
2000-09-18 16:07:07 +00:00
ImplSaveFrameState( pFrame );
// Call Hdl
ImplCallSizeHdl( hWnd );
}
}
}
static void ImplHandleFocusMsg( HWND hWnd )
{
if ( ImplSalYieldMutexTryToAcquire() )
{
WinSalFrame* pFrame = GetWindowPtr( hWnd );
if ( pFrame && !WinSalFrame::mbInReparent )
2000-09-18 16:07:07 +00:00
{
if ( ::GetFocus() == hWnd )
{
if ( IsWindowVisible( hWnd ) && !pFrame->mbInShow )
2000-09-18 16:07:07 +00:00
UpdateWindow( hWnd );
// do we support IME?
if ( pFrame->mbIME && pFrame->mhDefIMEContext )
{
UINT nImeProps = ImmGetProperty( GetKeyboardLayout( 0 ), IGP_PROPERTY );
pFrame->mbSpezIME = (nImeProps & IME_PROP_SPECIAL_UI) != 0;
pFrame->mbAtCursorIME = (nImeProps & IME_PROP_AT_CARET) != 0;
pFrame->mbHandleIME = !pFrame->mbSpezIME;
}
pFrame->CallCallback( SALEVENT_GETFOCUS, 0 );
2000-09-18 16:07:07 +00:00
}
else
{
pFrame->CallCallback( SALEVENT_LOSEFOCUS, 0 );
2000-09-18 16:07:07 +00:00
}
}
ImplSalYieldMutexRelease();
}
else
PostMessageW( hWnd, SAL_MSG_POSTFOCUS, 0, 0 );
2000-09-18 16:07:07 +00:00
}
static void ImplHandleCloseMsg( HWND hWnd )
{
if ( ImplSalYieldMutexTryToAcquire() )
{
WinSalFrame* pFrame = GetWindowPtr( hWnd );
2000-09-18 16:07:07 +00:00
if ( pFrame )
{
pFrame->CallCallback( SALEVENT_CLOSE, 0 );
2000-09-18 16:07:07 +00:00
}
ImplSalYieldMutexRelease();
}
else
PostMessageW( hWnd, WM_CLOSE, 0, 0 );
2000-09-18 16:07:07 +00:00
}
static long ImplHandleShutDownMsg( HWND hWnd )
{
ImplSalYieldMutexAcquireWithWait();
long nRet = 0;
WinSalFrame* pFrame = GetWindowPtr( hWnd );
2000-09-18 16:07:07 +00:00
if ( pFrame )
{
nRet = pFrame->CallCallback( SALEVENT_SHUTDOWN, 0 );
2000-09-18 16:07:07 +00:00
}
ImplSalYieldMutexRelease();
return nRet;
}
static void ImplHandleSettingsChangeMsg( HWND hWnd, UINT nMsg,
WPARAM wParam, LPARAM lParam )
{
sal_uInt16 nSalEvent = SALEVENT_SETTINGSCHANGED;
2000-09-18 16:07:07 +00:00
if ( nMsg == WM_DEVMODECHANGE )
nSalEvent = SALEVENT_PRINTERCHANGED;
else if ( nMsg == WM_DISPLAYCHANGE )
nSalEvent = SALEVENT_DISPLAYCHANGED;
else if ( nMsg == WM_FONTCHANGE )
nSalEvent = SALEVENT_FONTCHANGED;
else if ( nMsg == WM_WININICHANGE )
{
if ( lParam )
{
2011-01-24 04:00:57 +02:00
if ( ImplSalWICompareAscii( (const wchar_t*)lParam, "devices" ) == 0 )
nSalEvent = SALEVENT_PRINTERCHANGED;
2000-09-18 16:07:07 +00:00
}
}
if ( nMsg == WM_SETTINGCHANGE )
{
if ( wParam == SPI_SETWHEELSCROLLLINES )
aSalShlData.mnWheelScrollLines = ImplSalGetWheelScrollLines();
else if( wParam == SPI_SETWHEELSCROLLCHARS )
aSalShlData.mnWheelScrollChars = ImplSalGetWheelScrollChars();
2000-09-18 16:07:07 +00:00
}
if ( WM_SYSCOLORCHANGE == nMsg && GetSalData()->mhDitherPal )
ImplUpdateSysColorEntries();
ImplSalYieldMutexAcquireWithWait();
WinSalFrame* pFrame = GetWindowPtr( hWnd );
2000-09-18 16:07:07 +00:00
if ( pFrame )
{
if ( (nMsg == WM_DISPLAYCHANGE) || (nMsg == WM_WININICHANGE) )
{
if ( pFrame->mbFullScreen )
2000-09-18 16:07:07 +00:00
ImplSalFrameFullScreenPos( pFrame );
}
pFrame->CallCallback( nSalEvent, 0 );
2000-09-18 16:07:07 +00:00
}
ImplSalYieldMutexRelease();
}
static void ImplHandleUserEvent( HWND hWnd, LPARAM lParam )
{
ImplSalYieldMutexAcquireWithWait();
WinSalFrame* pFrame = GetWindowPtr( hWnd );
2000-09-18 16:07:07 +00:00
if ( pFrame )
{
pFrame->CallCallback( SALEVENT_USEREVENT, (void*)lParam );
2000-09-18 16:07:07 +00:00
}
ImplSalYieldMutexRelease();
}
static void ImplHandleForcePalette( HWND hWnd )
{
SalData* pSalData = GetSalData();
HPALETTE hPal = pSalData->mhDitherPal;
if ( hPal )
{
if ( !ImplSalYieldMutexTryToAcquire() )
{
PostMessageW( hWnd, SAL_MSG_FORCEPALETTE, 0, 0 );
2000-09-18 16:07:07 +00:00
return;
}
WinSalFrame* pFrame = GetWindowPtr( hWnd );
if ( pFrame && pFrame->mpGraphics )
2000-09-18 16:07:07 +00:00
{
WinSalGraphics* pGraphics = pFrame->mpGraphics;
if ( pGraphics && pGraphics->getDefPal() )
2000-09-18 16:07:07 +00:00
{
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
SelectPalette( pGraphics->getHDC(), hPal, FALSE );
if ( RealizePalette( pGraphics->getHDC() ) )
2000-09-18 16:07:07 +00:00
{
InvalidateRect( hWnd, NULL, FALSE );
UpdateWindow( hWnd );
pFrame->CallCallback( SALEVENT_DISPLAYCHANGED, 0 );
2000-09-18 16:07:07 +00:00
}
}
}
ImplSalYieldMutexRelease();
}
}
static LRESULT ImplHandlePalette( bool bFrame, HWND hWnd, UINT nMsg,
2000-09-18 16:07:07 +00:00
WPARAM wParam, LPARAM lParam, int& rDef )
{
SalData* pSalData = GetSalData();
HPALETTE hPal = pSalData->mhDitherPal;
if ( !hPal )
return 0;
rDef = FALSE;
if ( pSalData->mbInPalChange )
return 0;
if ( (nMsg == WM_PALETTECHANGED) || (nMsg == SAL_MSG_POSTPALCHANGED) )
{
if ( (HWND)wParam == hWnd )
return 0;
}
bool bReleaseMutex = FALSE;
2000-09-18 16:07:07 +00:00
if ( (nMsg == WM_QUERYNEWPALETTE) || (nMsg == WM_PALETTECHANGED) )
{
// as Windows can send these messages also, we have to use
// the Solar semaphore
2000-09-18 16:07:07 +00:00
if ( ImplSalYieldMutexTryToAcquire() )
bReleaseMutex = TRUE;
else if ( nMsg == WM_QUERYNEWPALETTE )
PostMessageW( hWnd, SAL_MSG_POSTQUERYNEWPAL, wParam, lParam );
2000-09-18 16:07:07 +00:00
else /* ( nMsg == WM_PALETTECHANGED ) */
PostMessageW( hWnd, SAL_MSG_POSTPALCHANGED, wParam, lParam );
2000-09-18 16:07:07 +00:00
}
WinSalVirtualDevice*pTempVD;
WinSalFrame* pTempFrame;
WinSalGraphics* pGraphics;
2000-09-18 16:07:07 +00:00
HDC hDC;
HPALETTE hOldPal;
UINT nCols;
bool bStdDC;
bool bUpdate;
2000-09-18 16:07:07 +00:00
pSalData->mbInPalChange = TRUE;
// reset all palettes in VirDevs and Frames
2000-09-18 16:07:07 +00:00
pTempVD = pSalData->mpFirstVD;
while ( pTempVD )
{
pGraphics = pTempVD->mpGraphics;
if ( pGraphics->getDefPal() )
2000-09-18 16:07:07 +00:00
{
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
SelectPalette( pGraphics->getHDC(),
pGraphics->getDefPal(),
2000-09-18 16:07:07 +00:00
TRUE );
}
pTempVD = pTempVD->mpNext;
2000-09-18 16:07:07 +00:00
}
pTempFrame = pSalData->mpFirstFrame;
while ( pTempFrame )
{
pGraphics = pTempFrame->mpGraphics;
if ( pGraphics && pGraphics->getDefPal() )
2000-09-18 16:07:07 +00:00
{
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
SelectPalette( pGraphics->getHDC(),
pGraphics->getDefPal(),
2000-09-18 16:07:07 +00:00
TRUE );
}
pTempFrame = pTempFrame->mpNextFrame;
2000-09-18 16:07:07 +00:00
}
// re-initialize palette
WinSalFrame* pFrame = NULL;
2000-09-18 16:07:07 +00:00
if ( bFrame )
pFrame = GetWindowPtr( hWnd );
if ( pFrame && pFrame->mpGraphics )
2000-09-18 16:07:07 +00:00
{
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
hDC = pFrame->mpGraphics->getHDC();
2000-09-18 16:07:07 +00:00
bStdDC = TRUE;
}
else
{
hDC = GetDC( hWnd );
bStdDC = FALSE;
}
UnrealizeObject( hPal );
hOldPal = SelectPalette( hDC, hPal, TRUE );
nCols = RealizePalette( hDC );
bUpdate = nCols != 0;
if ( !bStdDC )
{
SelectPalette( hDC, hOldPal, TRUE );
ReleaseDC( hWnd, hDC );
}
// reset all palettes in VirDevs and Frames
2000-09-18 16:07:07 +00:00
pTempVD = pSalData->mpFirstVD;
while ( pTempVD )
{
pGraphics = pTempVD->mpGraphics;
if ( pGraphics->getDefPal() )
2000-09-18 16:07:07 +00:00
{
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
SelectPalette( pGraphics->getHDC(), hPal, TRUE );
RealizePalette( pGraphics->getHDC() );
2000-09-18 16:07:07 +00:00
}
pTempVD = pTempVD->mpNext;
2000-09-18 16:07:07 +00:00
}
pTempFrame = pSalData->mpFirstFrame;
while ( pTempFrame )
{
if ( pTempFrame != pFrame )
{
pGraphics = pTempFrame->mpGraphics;
if ( pGraphics && pGraphics->getDefPal() )
2000-09-18 16:07:07 +00:00
{
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
SelectPalette( pGraphics->getHDC(), hPal, TRUE );
if ( RealizePalette( pGraphics->getHDC() ) )
2000-09-18 16:07:07 +00:00
bUpdate = TRUE;
}
}
pTempFrame = pTempFrame->mpNextFrame;
2000-09-18 16:07:07 +00:00
}
// if colors changed, update the window
2000-09-18 16:07:07 +00:00
if ( bUpdate )
{
pTempFrame = pSalData->mpFirstFrame;
while ( pTempFrame )
{
pGraphics = pTempFrame->mpGraphics;
if ( pGraphics && pGraphics->getDefPal() )
2000-09-18 16:07:07 +00:00
{
InvalidateRect( pTempFrame->mhWnd, NULL, FALSE );
UpdateWindow( pTempFrame->mhWnd );
pTempFrame->CallCallback( SALEVENT_DISPLAYCHANGED, 0 );
2000-09-18 16:07:07 +00:00
}
pTempFrame = pTempFrame->mpNextFrame;
2000-09-18 16:07:07 +00:00
}
}
pSalData->mbInPalChange = FALSE;
if ( bReleaseMutex )
ImplSalYieldMutexRelease();
if ( nMsg == WM_PALETTECHANGED )
return 0;
else
return nCols;
}
static int ImplHandleMinMax( HWND hWnd, LPARAM lParam )
{
int bRet = FALSE;
if ( ImplSalYieldMutexTryToAcquire() )
{
WinSalFrame* pFrame = GetWindowPtr( hWnd );
2000-09-18 16:07:07 +00:00
if ( pFrame )
{
MINMAXINFO* pMinMax = (MINMAXINFO*)lParam;
if ( pFrame->mbFullScreen )
2000-09-18 16:07:07 +00:00
{
int nX;
int nY;
int nDX;
int nDY;
ImplSalCalcFullScreenSize( pFrame, nX, nY, nDX, nDY );
if ( pMinMax->ptMaxPosition.x > nX )
pMinMax->ptMaxPosition.x = nX;
if ( pMinMax->ptMaxPosition.y > nY )
pMinMax->ptMaxPosition.y = nY;
if ( pMinMax->ptMaxSize.x < nDX )
pMinMax->ptMaxSize.x = nDX;
if ( pMinMax->ptMaxSize.y < nDY )
pMinMax->ptMaxSize.y = nDY;
if ( pMinMax->ptMaxTrackSize.x < nDX )
pMinMax->ptMaxTrackSize.x = nDX;
if ( pMinMax->ptMaxTrackSize.y < nDY )
pMinMax->ptMaxTrackSize.y = nDY;
pMinMax->ptMinTrackSize.x = nDX;
pMinMax->ptMinTrackSize.y = nDY;
bRet = TRUE;
}
if ( pFrame->mnMinWidth || pFrame->mnMinHeight )
{
int nWidth = pFrame->mnMinWidth;
int nHeight = pFrame->mnMinHeight;
ImplSalAddBorder( pFrame, nWidth, nHeight );
if ( pMinMax->ptMinTrackSize.x < nWidth )
pMinMax->ptMinTrackSize.x = nWidth;
if ( pMinMax->ptMinTrackSize.y < nHeight )
pMinMax->ptMinTrackSize.y = nHeight;
}
if ( pFrame->mnMaxWidth || pFrame->mnMaxHeight )
{
int nWidth = pFrame->mnMaxWidth;
int nHeight = pFrame->mnMaxHeight;
ImplSalAddBorder( pFrame, nWidth, nHeight );
if( nWidth > 0 && nHeight > 0 ) // protect against int overflow due to INT_MAX initialisation
{
if ( pMinMax->ptMaxTrackSize.x > nWidth )
pMinMax->ptMaxTrackSize.x = nWidth;
if ( pMinMax->ptMaxTrackSize.y > nHeight )
pMinMax->ptMaxTrackSize.y = nHeight;
}
}
2000-09-18 16:07:07 +00:00
}
ImplSalYieldMutexRelease();
}
return bRet;
}
// retrieves the SalMenuItem pointer from a hMenu
// the pointer is stored in every item, so if no position
// is specified we just use the first item (ie, pos=0)
// if bByPosition is FALSE then nPos denotes a menu id instead of a position
static WinSalMenuItem* ImplGetSalMenuItem( HMENU hMenu, UINT nPos, bool bByPosition=TRUE )
{
MENUITEMINFOW mi;
memset(&mi, 0, sizeof(mi));
mi.cbSize = sizeof( mi );
mi.fMask = MIIM_DATA;
if( !GetMenuItemInfoW( hMenu, nPos, bByPosition, &mi) )
2011-04-18 21:29:37 +01:00
ImplWriteLastError( GetLastError(), "ImplGetSalMenuItem" );
2003-11-20 12:03:14 +00:00
return (WinSalMenuItem *) mi.dwItemData;
}
// returns the index of the currently selected item if any or -1
static int ImplGetSelectedIndex( HMENU hMenu )
{
MENUITEMINFOW mi;
memset(&mi, 0, sizeof(mi));
mi.cbSize = sizeof( mi );
mi.fMask = MIIM_STATE;
int n = GetMenuItemCount( hMenu );
if( n != -1 )
{
for(int i=0; i<n; i++ )
{
if( !GetMenuItemInfoW( hMenu, i, TRUE, &mi) )
2011-04-18 21:29:37 +01:00
ImplWriteLastError( GetLastError(), "ImplGetSelectedIndex" );
else
{
if( mi.fState & MFS_HILITE )
return i;
}
}
}
return -1;
}
static int ImplMenuChar( HWND, WPARAM wParam, LPARAM lParam )
{
int nRet = MNC_IGNORE;
HMENU hMenu = (HMENU) lParam;
OUString aMnemonic( "&" + OUString((sal_Unicode) LOWORD(wParam)) );
aMnemonic = aMnemonic.toAsciiLowerCase(); // we only have ascii mnemonics
// search the mnemonic in the current menu
int nItemCount = GetMenuItemCount( hMenu );
int nFound = 0;
int idxFound = -1;
int idxSelected = ImplGetSelectedIndex( hMenu );
int idx = idxSelected != -1 ? idxSelected+1 : 0; // if duplicate mnemonics cycle through menu
for( int i=0; i< nItemCount; i++, idx++ )
{
2003-11-20 12:03:14 +00:00
WinSalMenuItem* pSalMenuItem = ImplGetSalMenuItem( hMenu, idx % nItemCount );
if( !pSalMenuItem )
continue;
OUString aStr = pSalMenuItem->mText;
aStr = aStr.toAsciiLowerCase();
if( aStr.indexOf( aMnemonic ) != -1 )
{
if( idxFound == -1 )
idxFound = idx % nItemCount;
if( nFound++ )
break; // duplicate found
}
}
if( nFound == 1 )
nRet = MAKELRESULT( idxFound, MNC_EXECUTE );
else
2010-12-04 13:22:40 +09:00
// duplicate mnemonics, just select the next occurrence
nRet = MAKELRESULT( idxFound, MNC_SELECT );
return nRet;
}
static int ImplMeasureItem( HWND hWnd, WPARAM wParam, LPARAM lParam )
{
int nRet = 0;
if( !wParam )
{
// request was sent by a menu
nRet = 1;
MEASUREITEMSTRUCT *pMI = (LPMEASUREITEMSTRUCT) lParam;
if( pMI->CtlType != ODT_MENU )
return 0;
2003-11-20 12:03:14 +00:00
WinSalMenuItem *pSalMenuItem = (WinSalMenuItem *) pMI->itemData;
if( !pSalMenuItem )
return 0;
HDC hdc = GetDC( hWnd );
SIZE strSize;
NONCLIENTMETRICS ncm;
memset( &ncm, 0, sizeof(ncm) );
ncm.cbSize = sizeof( ncm );
SystemParametersInfo( SPI_GETNONCLIENTMETRICS, 0, (PVOID) &ncm, 0 );
// Assume every menu item can be default and printed bold
//ncm.lfMenuFont.lfWeight = FW_BOLD;
HFONT hfntOld = (HFONT) SelectObject(hdc, (HFONT) CreateFontIndirect( &ncm.lfMenuFont ));
// menu text and accelerator
OUString aStr(pSalMenuItem->mText);
if( pSalMenuItem->mAccelText.getLength() )
{
aStr += " ";
aStr += pSalMenuItem->mAccelText;
}
GetTextExtentPoint32W( hdc, (LPWSTR) aStr.getStr(),
aStr.getLength(), &strSize );
// image
Size bmpSize( 16, 16 );
2003-11-20 12:03:14 +00:00
//if( !!pSalMenuItem->maBitmap )
// bmpSize = pSalMenuItem->maBitmap.GetSizePixel();
// checkmark
Size checkSize( GetSystemMetrics( SM_CXMENUCHECK ), GetSystemMetrics( SM_CYMENUCHECK ) );
pMI->itemWidth = checkSize.Width() + 3 + bmpSize.Width() + 3 + strSize.cx;
pMI->itemHeight = std::max( std::max( checkSize.Height(), bmpSize.Height() ), strSize.cy );
pMI->itemHeight += 4;
DeleteObject( SelectObject(hdc, hfntOld) );
ReleaseDC( hWnd, hdc );
}
return nRet;
}
static int ImplDrawItem(HWND, WPARAM wParam, LPARAM lParam )
{
int nRet = 0;
if( !wParam )
{
// request was sent by a menu
nRet = 1;
DRAWITEMSTRUCT *pDI = (LPDRAWITEMSTRUCT) lParam;
if( pDI->CtlType != ODT_MENU )
return 0;
2003-11-20 12:03:14 +00:00
WinSalMenuItem *pSalMenuItem = (WinSalMenuItem *) pDI->itemData;
if( !pSalMenuItem )
return 0;
COLORREF clrPrevText, clrPrevBkgnd;
HFONT hfntOld;
HBRUSH hbrOld;
bool fChecked = (pDI->itemState & ODS_CHECKED) ? TRUE : FALSE;
bool fSelected = (pDI->itemState & ODS_SELECTED) ? TRUE : FALSE;
bool fDisabled = (pDI->itemState & (ODS_DISABLED | ODS_GRAYED)) ? TRUE : FALSE;
// Set the appropriate foreground and background colors.
RECT aRect = pDI->rcItem;
clrPrevBkgnd = SetBkColor( pDI->hDC, GetSysColor( COLOR_MENU ) );
if ( fDisabled )
clrPrevText = SetTextColor( pDI->hDC, GetSysColor( COLOR_GRAYTEXT ) );
else
clrPrevText = SetTextColor( pDI->hDC, GetSysColor( fSelected ? COLOR_HIGHLIGHTTEXT : COLOR_MENUTEXT ) );
DWORD colBackground = GetSysColor( fSelected ? COLOR_HIGHLIGHT : COLOR_MENU );
2012-02-21 19:48:28 +01:00
clrPrevBkgnd = SetBkColor( pDI->hDC, colBackground );
hbrOld = (HBRUSH)SelectObject( pDI->hDC, CreateSolidBrush( GetBkColor( pDI->hDC ) ) );
// Fill background
if(!PatBlt( pDI->hDC, aRect.left, aRect.top, aRect.right-aRect.left, aRect.bottom-aRect.top, PATCOPY ))
2011-04-18 21:29:37 +01:00
ImplWriteLastError(GetLastError(), "ImplDrawItem");
int lineHeight = aRect.bottom-aRect.top;
int x = aRect.left;
int y = aRect.top;
int checkWidth = GetSystemMetrics( SM_CXMENUCHECK );
int checkHeight = GetSystemMetrics( SM_CYMENUCHECK );
if( fChecked )
{
RECT r;
r.left = 0;
r.top = 0;
r.right = checkWidth;
r.bottom = checkWidth;
HDC memDC = CreateCompatibleDC( pDI->hDC );
HBITMAP memBmp = CreateCompatibleBitmap( pDI->hDC, checkWidth, checkHeight );
HBITMAP hOldBmp = (HBITMAP) SelectObject( memDC, memBmp );
DrawFrameControl( memDC, &r, DFC_MENU, DFCS_MENUCHECK );
BitBlt( pDI->hDC, x, y+(lineHeight-checkHeight)/2, checkWidth, checkHeight, memDC, 0, 0, SRCAND );
DeleteObject( SelectObject( memDC, hOldBmp ) );
DeleteDC( memDC );
}
x += checkWidth+3;
//Size bmpSize = aBitmap.GetSizePixel();
Size bmpSize(16, 16);
2003-11-20 12:03:14 +00:00
if( !!pSalMenuItem->maBitmap )
{
2003-11-20 12:03:14 +00:00
Bitmap aBitmap( pSalMenuItem->maBitmap );
// set transparent pixels to background color
if( fDisabled )
colBackground = RGB(255,255,255);
aBitmap.Replace( Color( COL_LIGHTMAGENTA ),
Color( GetRValue(colBackground),GetGValue(colBackground),GetBValue(colBackground) ), 0);
2003-11-20 12:03:14 +00:00
WinSalBitmap* pSalBmp = static_cast<WinSalBitmap*>(aBitmap.ImplGetImpBitmap()->ImplGetSalBitmap());
HGLOBAL hDrawDIB = pSalBmp->ImplGethDIB();
if( hDrawDIB )
{
PBITMAPINFO pBI = (PBITMAPINFO) GlobalLock( hDrawDIB );
PBITMAPINFOHEADER pBIH = (PBITMAPINFOHEADER) pBI;
PBYTE pBits = (PBYTE) pBI + *(DWORD*) pBI +
pSalBmp->ImplGetDIBColorCount( hDrawDIB ) * sizeof( RGBQUAD );
HBITMAP hBmp = CreateDIBitmap( pDI->hDC, pBIH, CBM_INIT, pBits, pBI, DIB_RGB_COLORS );
GlobalUnlock( hDrawDIB );
HBRUSH hbrIcon = CreateSolidBrush( GetSysColor( COLOR_GRAYTEXT ) );
DrawStateW( pDI->hDC, (HBRUSH)hbrIcon, (DRAWSTATEPROC)NULL, (LPARAM)hBmp, (WPARAM)0,
x, y+(lineHeight-bmpSize.Height())/2, bmpSize.Width(), bmpSize.Height(),
DST_BITMAP | (fDisabled ? (fSelected ? DSS_MONO : DSS_DISABLED) : DSS_NORMAL) );
DeleteObject( hbrIcon );
DeleteObject( hBmp );
}
}
x += bmpSize.Width() + 3;
aRect.left = x;
NONCLIENTMETRICS ncm;
memset( &ncm, 0, sizeof(ncm) );
ncm.cbSize = sizeof( ncm );
SystemParametersInfo( SPI_GETNONCLIENTMETRICS, 0, (PVOID) &ncm, 0 );
// Print default menu entry with bold font
//if ( pDI->itemState & ODS_DEFAULT )
// ncm.lfMenuFont.lfWeight = FW_BOLD;
hfntOld = (HFONT) SelectObject(pDI->hDC, (HFONT) CreateFontIndirect( &ncm.lfMenuFont ));
SIZE strSize;
OUString aStr( pSalMenuItem->mText );
GetTextExtentPoint32W( pDI->hDC, (LPWSTR) aStr.getStr(),
aStr.getLength(), &strSize );
if(!DrawStateW( pDI->hDC, (HBRUSH)NULL, (DRAWSTATEPROC)NULL,
(LPARAM)(LPWSTR) aStr.getStr(),
(WPARAM)0, aRect.left, aRect.top + (lineHeight - strSize.cy)/2, 0, 0,
DST_PREFIXTEXT | (fDisabled && !fSelected ? DSS_DISABLED : DSS_NORMAL) ) )
2011-04-18 21:29:37 +01:00
ImplWriteLastError(GetLastError(), "ImplDrawItem");
if( pSalMenuItem->mAccelText.getLength() )
{
SIZE strSizeA;
2003-11-20 12:03:14 +00:00
aStr = pSalMenuItem->mAccelText;
GetTextExtentPoint32W( pDI->hDC, (LPWSTR) aStr.getStr(),
aStr.getLength(), &strSizeA );
TEXTMETRIC tm;
GetTextMetrics( pDI->hDC, &tm );
// position the accelerator string to the right but leave space for the
// (potential) submenu arrow (tm.tmMaxCharWidth)
if(!DrawStateW( pDI->hDC, (HBRUSH)NULL, (DRAWSTATEPROC)NULL,
(LPARAM)(LPWSTR) aStr.getStr(),
(WPARAM)0, aRect.right-strSizeA.cx-tm.tmMaxCharWidth, aRect.top + (lineHeight - strSizeA.cy)/2, 0, 0,
DST_TEXT | (fDisabled && !fSelected ? DSS_DISABLED : DSS_NORMAL) ) )
2011-04-18 21:29:37 +01:00
ImplWriteLastError(GetLastError(), "ImplDrawItem");
}
// Restore the original font and colors.
DeleteObject( SelectObject( pDI->hDC, hbrOld ) );
DeleteObject( SelectObject( pDI->hDC, hfntOld) );
SetTextColor(pDI->hDC, clrPrevText);
SetBkColor(pDI->hDC, clrPrevBkgnd);
}
return nRet;
}
static int ImplHandleMenuActivate( HWND hWnd, WPARAM wParam, LPARAM )
{
// Menu activation
2003-11-20 12:03:14 +00:00
WinSalFrame* pFrame = GetWindowPtr( hWnd );
if ( !pFrame )
return 0;
HMENU hMenu = (HMENU) wParam;
// WORD nPos = LOWORD (lParam);
// bool bWindowMenu = (bool) HIWORD(lParam);
2011-12-06 23:04:19 -08:00
// Send activate and deactivate together, so we have not keep track of opened menus
// this will be enough to have the menus updated correctly
SalMenuEvent aMenuEvt;
2003-11-20 12:03:14 +00:00
WinSalMenuItem *pSalMenuItem = ImplGetSalMenuItem( hMenu, 0 );
if( pSalMenuItem )
2003-11-20 12:03:14 +00:00
aMenuEvt.mpMenu = pSalMenuItem->mpMenu;
else
aMenuEvt.mpMenu = NULL;
2003-11-20 12:03:14 +00:00
long nRet = pFrame->CallCallback( SALEVENT_MENUACTIVATE, &aMenuEvt );
if( nRet )
2003-11-20 12:03:14 +00:00
nRet = pFrame->CallCallback( SALEVENT_MENUDEACTIVATE, &aMenuEvt );
if( nRet )
2003-11-20 12:03:14 +00:00
pFrame->mLastActivatedhMenu = hMenu;
return (nRet!=0);
}
static int ImplHandleMenuSelect( HWND hWnd, WPARAM wParam, LPARAM lParam )
{
// Menu selection
2003-11-20 12:03:14 +00:00
WinSalFrame* pFrame = GetWindowPtr( hWnd );
if ( !pFrame )
return 0;
WORD nId = LOWORD(wParam); // menu item or submenu index
WORD nFlags = HIWORD(wParam);
HMENU hMenu = (HMENU) lParam;
// check if we have to process the message
if( !GetSalData()->IsKnownMenuHandle( hMenu ) )
return 0;
bool bByPosition = FALSE;
if( nFlags & MF_POPUP )
bByPosition = TRUE;
long nRet = 0;
2003-11-20 12:03:14 +00:00
if ( hMenu && !pFrame->mLastActivatedhMenu )
{
2010-12-04 13:22:40 +09:00
// we never activated a menu (ie, no WM_INITMENUPOPUP has occurred yet)
// which means this must be the menubar -> send activation/deactivation
SalMenuEvent aMenuEvt;
2003-11-20 12:03:14 +00:00
WinSalMenuItem *pSalMenuItem = ImplGetSalMenuItem( hMenu, nId, bByPosition );
if( pSalMenuItem )
2003-11-20 12:03:14 +00:00
aMenuEvt.mpMenu = pSalMenuItem->mpMenu;
else
aMenuEvt.mpMenu = NULL;
2003-11-20 12:03:14 +00:00
nRet = pFrame->CallCallback( SALEVENT_MENUACTIVATE, &aMenuEvt );
if( nRet )
2003-11-20 12:03:14 +00:00
nRet = pFrame->CallCallback( SALEVENT_MENUDEACTIVATE, &aMenuEvt );
if( nRet )
2003-11-20 12:03:14 +00:00
pFrame->mLastActivatedhMenu = hMenu;
}
if( !hMenu && nFlags == 0xFFFF )
{
// all menus are closed, reset activation logic
2003-11-20 12:03:14 +00:00
pFrame->mLastActivatedhMenu = NULL;
}
if( hMenu )
{
// hMenu must be saved, as it is not passed in WM_COMMAND which always occurs after a selection
// if a menu is closed due to a command selection then hMenu is NULL, but WM_COMMAND comes later
// so we must not overwrite it in this case
2003-11-20 12:03:14 +00:00
pFrame->mSelectedhMenu = hMenu;
// send highlight event
if( nFlags & MF_POPUP )
{
// submenu selected
// wParam now carries an index instead of an id -> retrieve id
MENUITEMINFOW mi;
memset(&mi, 0, sizeof(mi));
mi.cbSize = sizeof( mi );
mi.fMask = MIIM_ID;
if( GetMenuItemInfoW( hMenu, LOWORD(wParam), TRUE, &mi) )
nId = sal::static_int_cast<WORD>(mi.wID);
}
SalMenuEvent aMenuEvt;
aMenuEvt.mnId = nId;
2003-11-20 12:03:14 +00:00
WinSalMenuItem *pSalMenuItem = ImplGetSalMenuItem( hMenu, nId, FALSE );
if( pSalMenuItem )
2003-11-20 12:03:14 +00:00
aMenuEvt.mpMenu = pSalMenuItem->mpMenu;
else
aMenuEvt.mpMenu = NULL;
2003-11-20 12:03:14 +00:00
nRet = pFrame->CallCallback( SALEVENT_MENUHIGHLIGHT, &aMenuEvt );
}
return (nRet != 0);
}
static int ImplHandleCommand( HWND hWnd, WPARAM wParam, LPARAM )
{
2003-11-20 12:03:14 +00:00
WinSalFrame* pFrame = GetWindowPtr( hWnd );
if ( !pFrame )
return 0;
long nRet = 0;
if( !HIWORD(wParam) )
{
// Menu command
WORD nId = LOWORD(wParam);
if( nId ) // zero for separators
{
SalMenuEvent aMenuEvt;
aMenuEvt.mnId = nId;
2003-11-20 12:03:14 +00:00
WinSalMenuItem *pSalMenuItem = ImplGetSalMenuItem( pFrame->mSelectedhMenu, nId, FALSE );
if( pSalMenuItem )
2003-11-20 12:03:14 +00:00
aMenuEvt.mpMenu = pSalMenuItem->mpMenu;
else
aMenuEvt.mpMenu = NULL;
2003-11-20 12:03:14 +00:00
nRet = pFrame->CallCallback( SALEVENT_MENUCOMMAND, &aMenuEvt );
}
}
return (nRet != 0);
}
2000-09-18 16:07:07 +00:00
static int ImplHandleSysCommand( HWND hWnd, WPARAM wParam, LPARAM lParam )
{
WinSalFrame* pFrame = GetWindowPtr( hWnd );
2000-09-18 16:07:07 +00:00
if ( !pFrame )
return 0;
WPARAM nCommand = wParam & 0xFFF0;
if ( pFrame->mbFullScreen )
2000-09-18 16:07:07 +00:00
{
BOOL bMaximize = IsZoomed( pFrame->mhWnd );
BOOL bMinimize = IsIconic( pFrame->mhWnd );
2000-09-18 16:07:07 +00:00
if ( (nCommand == SC_SIZE) ||
(!bMinimize && (nCommand == SC_MOVE)) ||
(!bMaximize && (nCommand == SC_MAXIMIZE)) ||
(bMaximize && (nCommand == SC_RESTORE)) )
{
return TRUE;
}
}
if ( nCommand == SC_KEYMENU )
{
// do not process SC_KEYMENU if we have a native menu
// Windows should handle this
if( GetMenu( hWnd ) )
return FALSE;
// Process here KeyMenu events only for Alt to activate the MenuBar,
// or if a SysChild window is in focus, as Alt-key-combinations are
// only processed via this event
2000-09-18 16:07:07 +00:00
if ( !LOWORD( lParam ) )
{
// Only trigger if no other key is pressed.
// Contrary to Docu the CharCode is delivered with the x-coordinate
// that is pressed in addition.
// Also 32 for space, 99 for c, 100 for d, ...
// As this is not documented, we check the state of the space-bar
2000-09-18 16:07:07 +00:00
if ( GetKeyState( VK_SPACE ) & 0x8000 )
return 0;
// to avoid activating the MenuBar for Alt+MouseKey
2000-09-18 16:07:07 +00:00
if ( (GetKeyState( VK_LBUTTON ) & 0x8000) ||
(GetKeyState( VK_RBUTTON ) & 0x8000) ||
(GetKeyState( VK_MBUTTON ) & 0x8000) ||
(GetKeyState( VK_SHIFT ) & 0x8000) )
2000-09-18 16:07:07 +00:00
return 1;
SalKeyEvent aKeyEvt;
aKeyEvt.mnTime = GetMessageTime();
aKeyEvt.mnCode = KEY_MENU;
aKeyEvt.mnCharCode = 0;
aKeyEvt.mnRepeat = 0;
long nRet = pFrame->CallCallback( SALEVENT_KEYINPUT, &aKeyEvt );
pFrame->CallCallback( SALEVENT_KEYUP, &aKeyEvt );
2000-09-18 16:07:07 +00:00
return (nRet != 0);
}
else
{
// check if a SysChild is in focus
2000-09-18 16:07:07 +00:00
HWND hFocusWnd = ::GetFocus();
if ( hFocusWnd && ImplFindSalObject( hFocusWnd ) )
{
char cKeyCode = (char)(unsigned char)LOWORD( lParam );
// LowerCase
if ( (cKeyCode >= 65) && (cKeyCode <= 90) )
cKeyCode += 32;
// We only accept 0-9 and A-Z; all other keys have to be
// processed by the SalObj hook
2000-09-18 16:07:07 +00:00
if ( ((cKeyCode >= 48) && (cKeyCode <= 57)) ||
((cKeyCode >= 97) && (cKeyCode <= 122)) )
{
sal_uInt16 nModCode = 0;
2000-09-18 16:07:07 +00:00
if ( GetKeyState( VK_SHIFT ) & 0x8000 )
nModCode |= KEY_SHIFT;
if ( GetKeyState( VK_CONTROL ) & 0x8000 )
nModCode |= KEY_MOD1;
nModCode |= KEY_MOD2;
SalKeyEvent aKeyEvt;
aKeyEvt.mnTime = GetMessageTime();
if ( (cKeyCode >= 48) && (cKeyCode <= 57) )
aKeyEvt.mnCode = KEY_0+(cKeyCode-48);
else
aKeyEvt.mnCode = KEY_A+(cKeyCode-97);
aKeyEvt.mnCode |= nModCode;
aKeyEvt.mnCharCode = cKeyCode;
aKeyEvt.mnRepeat = 0;
long nRet = pFrame->CallCallback( SALEVENT_KEYINPUT, &aKeyEvt );
pFrame->CallCallback( SALEVENT_KEYUP, &aKeyEvt );
2000-09-18 16:07:07 +00:00
return (nRet != 0);
}
}
}
}
return FALSE;
}
static void ImplHandleInputLangChange( HWND hWnd, WPARAM, LPARAM lParam )
2000-09-18 16:07:07 +00:00
{
ImplSalYieldMutexAcquireWithWait();
// check if we support IME
WinSalFrame* pFrame = GetWindowPtr( hWnd );
if ( !pFrame )
return;
if ( pFrame->mbIME && pFrame->mhDefIMEContext )
2000-09-18 16:07:07 +00:00
{
HKL hKL = (HKL)lParam;
UINT nImeProps = ImmGetProperty( hKL, IGP_PROPERTY );
pFrame->mbSpezIME = (nImeProps & IME_PROP_SPECIAL_UI) != 0;
pFrame->mbAtCursorIME = (nImeProps & IME_PROP_AT_CARET) != 0;
pFrame->mbHandleIME = !pFrame->mbSpezIME;
2000-09-18 16:07:07 +00:00
}
// trigger input language and codepage update
UINT nLang = pFrame->mnInputLang;
ImplUpdateInputLang( pFrame );
// notify change
if( nLang != pFrame->mnInputLang )
pFrame->CallCallback( SALEVENT_INPUTLANGUAGECHANGE, 0 );
2000-09-18 16:07:07 +00:00
ImplSalYieldMutexRelease();
}
static void ImplUpdateIMECursorPos( WinSalFrame* pFrame, HIMC hIMC )
{
COMPOSITIONFORM aForm;
memset( &aForm, 0, sizeof( aForm ) );
// get cursor position and from it calculate default position
// for the composition window
SalExtTextInputPosEvent aPosEvt;
pFrame->CallCallback( SALEVENT_EXTTEXTINPUTPOS, (void*)&aPosEvt );
if ( (aPosEvt.mnX == -1) && (aPosEvt.mnY == -1) )
aForm.dwStyle |= CFS_DEFAULT;
else
{
aForm.dwStyle |= CFS_POINT;
aForm.ptCurrentPos.x = aPosEvt.mnX;
aForm.ptCurrentPos.y = aPosEvt.mnY;
}
ImmSetCompositionWindow( hIMC, &aForm );
// Because not all IME's use this values, we create
// a Windows caret to force the Position from the IME
if ( GetFocus() == pFrame->mhWnd )
{
CreateCaret( pFrame->mhWnd, 0,
aPosEvt.mnWidth, aPosEvt.mnHeight );
SetCaretPos( aPosEvt.mnX, aPosEvt.mnY );
}
}
static bool ImplHandleIMEStartComposition( HWND hWnd )
2000-09-18 16:07:07 +00:00
{
bool bDef = TRUE;
2000-09-18 16:07:07 +00:00
ImplSalYieldMutexAcquireWithWait();
WinSalFrame* pFrame = GetWindowPtr( hWnd );
2000-09-18 16:07:07 +00:00
if ( pFrame )
{
2000-11-03 13:17:43 +00:00
HIMC hIMC = ImmGetContext( hWnd );
if ( hIMC )
2000-09-18 16:07:07 +00:00
{
ImplUpdateIMECursorPos( pFrame, hIMC );
2000-11-03 13:17:43 +00:00
ImmReleaseContext( hWnd, hIMC );
}
2000-09-18 16:07:07 +00:00
if ( pFrame->mbHandleIME )
2000-11-03 13:17:43 +00:00
{
if ( pFrame->mbAtCursorIME )
2000-09-18 16:07:07 +00:00
bDef = FALSE;
}
}
ImplSalYieldMutexRelease();
return bDef;
}
static bool ImplHandleIMECompositionInput( WinSalFrame* pFrame,
HIMC hIMC, LPARAM lParam )
{
bool bDef = TRUE;
// Init Event
SalExtTextInputEvent aEvt;
aEvt.mnTime = GetMessageTime();
aEvt.mpTextAttr = NULL;
aEvt.mnCursorPos = 0;
aEvt.mbOnlyCursor = FALSE;
aEvt.mnCursorFlags = 0;
// If we get a result string, then we handle this input
if ( lParam & GCS_RESULTSTR )
{
bDef = FALSE;
LONG nTextLen = ImmGetCompositionStringW( hIMC, GCS_RESULTSTR, 0, 0 ) / sizeof( WCHAR );
if ( nTextLen >= 0 )
{
WCHAR* pTextBuf = new WCHAR[nTextLen];
ImmGetCompositionStringW( hIMC, GCS_RESULTSTR, pTextBuf, nTextLen*sizeof( WCHAR ) );
aEvt.maText = OUString( reinterpret_cast<const sal_Unicode*>(pTextBuf), (sal_Int32)nTextLen );
delete [] pTextBuf;
}
aEvt.mnCursorPos = aEvt.maText.getLength();
pFrame->CallCallback( SALEVENT_EXTTEXTINPUT, (void*)&aEvt );
pFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, (void*)NULL );
ImplUpdateIMECursorPos( pFrame, hIMC );
}
// If the IME doesn't support OnSpot input, then there is nothing to do
if ( !pFrame->mbAtCursorIME )
return !bDef;
// If we get new Composition data, then we handle this new input
if ( (lParam & (GCS_COMPSTR | GCS_COMPATTR)) ||
((lParam & GCS_CURSORPOS) && !(lParam & GCS_RESULTSTR)) )
{
bDef = FALSE;
sal_uInt16* pSalAttrAry = NULL;
LONG nTextLen = ImmGetCompositionStringW( hIMC, GCS_COMPSTR, 0, 0 ) / sizeof( WCHAR );
if ( nTextLen > 0 )
{
WCHAR* pTextBuf = new WCHAR[nTextLen];
ImmGetCompositionStringW( hIMC, GCS_COMPSTR, pTextBuf, nTextLen*sizeof( WCHAR ) );
aEvt.maText = OUString( reinterpret_cast<const sal_Unicode*>(pTextBuf), (sal_Int32)nTextLen );
delete [] pTextBuf;
BYTE* pAttrBuf = NULL;
LONG nAttrLen = ImmGetCompositionStringW( hIMC, GCS_COMPATTR, 0, 0 );
if ( nAttrLen > 0 )
{
pAttrBuf = new BYTE[nAttrLen];
ImmGetCompositionStringW( hIMC, GCS_COMPATTR, pAttrBuf, nAttrLen );
}
if ( pAttrBuf )
{
sal_Int32 nTextLen2 = aEvt.maText.getLength();
pSalAttrAry = new sal_uInt16[nTextLen2];
memset( pSalAttrAry, 0, nTextLen2*sizeof( sal_uInt16 ) );
for( sal_Int32 i = 0; (i < nTextLen2) && (i < nAttrLen); i++ )
{
BYTE nWinAttr = pAttrBuf[i];
sal_uInt16 nSalAttr;
if ( nWinAttr == ATTR_TARGET_CONVERTED )
{
nSalAttr = EXTTEXTINPUT_ATTR_BOLDUNDERLINE;
aEvt.mnCursorFlags |= EXTTEXTINPUT_CURSOR_INVISIBLE;
}
else if ( nWinAttr == ATTR_CONVERTED )
nSalAttr = EXTTEXTINPUT_ATTR_DASHDOTUNDERLINE;
else if ( nWinAttr == ATTR_TARGET_NOTCONVERTED )
nSalAttr = EXTTEXTINPUT_ATTR_HIGHLIGHT;
else if ( nWinAttr == ATTR_INPUT_ERROR )
nSalAttr = EXTTEXTINPUT_ATTR_REDTEXT | EXTTEXTINPUT_ATTR_DOTTEDUNDERLINE;
else /* ( nWinAttr == ATTR_INPUT ) */
nSalAttr = EXTTEXTINPUT_ATTR_DOTTEDUNDERLINE;
pSalAttrAry[i] = nSalAttr;
}
aEvt.mpTextAttr = pSalAttrAry;
delete [] pAttrBuf;
}
}
// Only when we get new composition data, we must send this event
if ( (nTextLen > 0) || !(lParam & GCS_RESULTSTR) )
{
// End the mode, if the last character is deleted
if ( !nTextLen && !pFrame->mbCandidateMode )
{
pFrame->CallCallback( SALEVENT_EXTTEXTINPUT, (void*)&aEvt );
pFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, (void*)NULL );
}
else
{
// Because Cursor-Position and DeltaStart never updated
// from the korean input engine, we must handle this here
if ( lParam & CS_INSERTCHAR )
{
aEvt.mnCursorPos = nTextLen;
if ( aEvt.mnCursorPos && (lParam & CS_NOMOVECARET) )
aEvt.mnCursorPos--;
}
else
aEvt.mnCursorPos = LOWORD( ImmGetCompositionStringW( hIMC, GCS_CURSORPOS, 0, 0 ) );
if ( pFrame->mbCandidateMode )
aEvt.mnCursorFlags |= EXTTEXTINPUT_CURSOR_INVISIBLE;
if ( lParam & CS_NOMOVECARET )
aEvt.mnCursorFlags |= EXTTEXTINPUT_CURSOR_OVERWRITE;
pFrame->CallCallback( SALEVENT_EXTTEXTINPUT, (void*)&aEvt );
}
ImplUpdateIMECursorPos( pFrame, hIMC );
}
if ( pSalAttrAry )
delete [] pSalAttrAry;
}
return !bDef;
}
static bool ImplHandleIMEComposition( HWND hWnd, LPARAM lParam )
2000-09-18 16:07:07 +00:00
{
bool bDef = TRUE;
2000-11-03 13:17:43 +00:00
ImplSalYieldMutexAcquireWithWait();
WinSalFrame* pFrame = GetWindowPtr( hWnd );
2000-11-03 13:17:43 +00:00
if ( pFrame && (!lParam || (lParam & GCS_RESULTSTR)) )
2000-09-18 16:07:07 +00:00
{
// reset the background mode for each text input,
// as some tools such as RichWin may have changed it
if ( pFrame->mpGraphics &&
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
pFrame->mpGraphics->getHDC() )
SetBkMode( pFrame->mpGraphics->getHDC(), TRANSPARENT );
2000-11-03 13:17:43 +00:00
}
2000-09-18 16:07:07 +00:00
if ( pFrame && pFrame->mbHandleIME )
2000-11-03 13:17:43 +00:00
{
if ( !lParam )
{
SalExtTextInputEvent aEvt;
aEvt.mnTime = GetMessageTime();
aEvt.mpTextAttr = NULL;
aEvt.mnCursorPos = 0;
aEvt.mbOnlyCursor = FALSE;
aEvt.mnCursorFlags = 0;
pFrame->CallCallback( SALEVENT_EXTTEXTINPUT, (void*)&aEvt );
pFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, (void*)NULL );
2000-11-03 13:17:43 +00:00
}
else if ( lParam & (GCS_RESULTSTR | GCS_COMPSTR | GCS_COMPATTR | GCS_CURSORPOS) )
2000-09-18 16:07:07 +00:00
{
HIMC hIMC = ImmGetContext( hWnd );
if ( hIMC )
{
if ( ImplHandleIMECompositionInput( pFrame, hIMC, lParam ) )
2000-11-03 13:17:43 +00:00
bDef = FALSE;
ImmReleaseContext( hWnd, hIMC );
}
2000-09-18 16:07:07 +00:00
}
}
2000-11-03 13:17:43 +00:00
ImplSalYieldMutexRelease();
2000-09-18 16:07:07 +00:00
return bDef;
}
static bool ImplHandleIMEEndComposition( HWND hWnd )
2000-09-18 16:07:07 +00:00
{
bool bDef = TRUE;
2000-09-18 16:07:07 +00:00
ImplSalYieldMutexAcquireWithWait();
WinSalFrame* pFrame = GetWindowPtr( hWnd );
if ( pFrame && pFrame->mbHandleIME )
2000-09-18 16:07:07 +00:00
{
if ( pFrame->mbAtCursorIME )
2000-09-18 16:07:07 +00:00
bDef = FALSE;
}
ImplSalYieldMutexRelease();
return bDef;
}
static boolean ImplHandleAppCommand( HWND hWnd, LPARAM lParam, LRESULT & nRet )
{
MediaCommand nCommand;
switch( GET_APPCOMMAND_LPARAM(lParam) )
{
case APPCOMMAND_MEDIA_CHANNEL_DOWN: nCommand = MediaCommand::ChannelDown; break;
case APPCOMMAND_MEDIA_CHANNEL_UP: nCommand = MediaCommand::ChannelUp; break;
case APPCOMMAND_MEDIA_NEXTTRACK: nCommand = MediaCommand::NextTrack; break;
case APPCOMMAND_MEDIA_PAUSE: nCommand = MediaCommand::Pause; break;
case APPCOMMAND_MEDIA_PLAY: nCommand = MediaCommand::Play; break;
case APPCOMMAND_MEDIA_PLAY_PAUSE: nCommand = MediaCommand::PlayPause; break;
case APPCOMMAND_MEDIA_PREVIOUSTRACK: nCommand = MediaCommand::PreviousTrack; break;
case APPCOMMAND_MEDIA_RECORD: nCommand = MediaCommand::Record; break;
case APPCOMMAND_MEDIA_REWIND: nCommand = MediaCommand::Rewind; break;
case APPCOMMAND_MEDIA_STOP: nCommand = MediaCommand::Stop; break;
case APPCOMMAND_MIC_ON_OFF_TOGGLE: nCommand = MediaCommand::MicOnOffToggle; break;
case APPCOMMAND_MICROPHONE_VOLUME_DOWN: nCommand = MediaCommand::MicrophoneVolumeDown; break;
case APPCOMMAND_MICROPHONE_VOLUME_MUTE: nCommand = MediaCommand::MicrophoneVolumeMute; break;
case APPCOMMAND_MICROPHONE_VOLUME_UP: nCommand = MediaCommand::MicrophoneVolumeUp; break;
case APPCOMMAND_VOLUME_DOWN: nCommand = MediaCommand::VolumeDown; break;
case APPCOMMAND_VOLUME_MUTE: nCommand = MediaCommand::VolumeMute; break;
case APPCOMMAND_VOLUME_UP: nCommand = MediaCommand::VolumeUp; break;
default:
return false;
}
WinSalFrame* pFrame = GetWindowPtr( hWnd );
vcl::Window *pWindow = pFrame ? pFrame->GetWindow() : NULL;
if( pWindow )
{
const Point aPoint;
CommandMediaData aMediaData(nCommand);
CommandEvent aCEvt( aPoint, CommandEventId::Media, FALSE, &aMediaData );
NotifyEvent aNCmdEvt( MouseNotifyEvent::COMMAND, pWindow, &aCEvt );
if ( !ImplCallPreNotify( aNCmdEvt ) )
{
pWindow->Command( aCEvt );
nRet = 1;
return !aMediaData.GetPassThroughToOS();
}
}
return false;
}
2000-09-18 16:07:07 +00:00
static void ImplHandleIMENotify( HWND hWnd, WPARAM wParam )
{
if ( wParam == (WPARAM)IMN_OPENCANDIDATE )
{
ImplSalYieldMutexAcquireWithWait();
WinSalFrame* pFrame = GetWindowPtr( hWnd );
if ( pFrame && pFrame->mbHandleIME &&
pFrame->mbAtCursorIME )
2000-09-18 16:07:07 +00:00
{
// we want to hide der cursor
pFrame->mbCandidateMode = TRUE;
2000-09-18 16:07:07 +00:00
ImplHandleIMEComposition( hWnd, GCS_CURSORPOS );
HWND hWnd2 = pFrame->mhWnd;
HIMC hIMC = ImmGetContext( hWnd2 );
2000-09-18 16:07:07 +00:00
if ( hIMC )
{
LONG nBufLen = ImmGetCompositionStringW( hIMC, GCS_COMPSTR, 0, 0 );
if ( nBufLen >= 1 )
{
2000-11-03 13:17:43 +00:00
SalExtTextInputPosEvent aPosEvt;
pFrame->CallCallback( SALEVENT_EXTTEXTINPUTPOS, (void*)&aPosEvt );
2000-09-18 16:07:07 +00:00
2000-11-03 13:17:43 +00:00
// Vertical !!!
2000-09-18 16:07:07 +00:00
CANDIDATEFORM aForm;
aForm.dwIndex = 0;
aForm.dwStyle = CFS_EXCLUDE;
2000-11-03 13:17:43 +00:00
aForm.ptCurrentPos.x = aPosEvt.mnX;
aForm.ptCurrentPos.y = aPosEvt.mnY+1;
aForm.rcArea.left = aPosEvt.mnX;
aForm.rcArea.top = aPosEvt.mnY;
aForm.rcArea.right = aForm.rcArea.left+aPosEvt.mnExtWidth+1;
aForm.rcArea.bottom = aForm.rcArea.top+aPosEvt.mnHeight+1;
2000-09-18 16:07:07 +00:00
ImmSetCandidateWindow( hIMC, &aForm );
}
ImmReleaseContext( hWnd2, hIMC );
2000-09-18 16:07:07 +00:00
}
}
ImplSalYieldMutexRelease();
}
else if ( wParam == (WPARAM)IMN_CLOSECANDIDATE )
{
ImplSalYieldMutexAcquireWithWait();
WinSalFrame* pFrame = GetWindowPtr( hWnd );
2000-09-18 16:07:07 +00:00
if ( pFrame )
pFrame->mbCandidateMode = FALSE;
2000-09-18 16:07:07 +00:00
ImplSalYieldMutexRelease();
}
}
static bool
ImplHandleGetObject(HWND hWnd, LPARAM lParam, WPARAM wParam, LRESULT & nRet)
{
// IA2 should be enabled automatically
AllSettings aSettings = Application::GetSettings();
MiscSettings aMisc = aSettings.GetMiscSettings();
aMisc.SetEnableATToolSupport( true );
aSettings.SetMiscSettings( aMisc );
Application::SetSettings( aSettings );
if (!Application::GetSettings().GetMiscSettings().GetEnableATToolSupport())
return false; // locked down somehow ?
ImplSVData* pSVData = ImplGetSVData();
// Make sure to launch Accessibility only the following criteria are satisfied
// to avoid RFT interrupts regular accessibility processing
if ( !pSVData->mxAccessBridge.is() )
{
if( !InitAccessBridge() )
return false;
}
uno::Reference< accessibility::XMSAAService > xMSAA( pSVData->mxAccessBridge, uno::UNO_QUERY );
if ( xMSAA.is() )
{
// mhOnSetTitleWnd not set to reasonable value anywhere...
if ( lParam == OBJID_CLIENT )
{
nRet = xMSAA->getAccObjectPtr(
reinterpret_cast<sal_Int64>(hWnd), lParam, wParam);
if( nRet != 0 )
return true;
}
}
return false;
}
2008-10-29 09:25:50 +00:00
static LRESULT ImplHandleIMEReconvertString( HWND hWnd, LPARAM lParam )
{
WinSalFrame* pFrame = GetWindowPtr( hWnd );
LPRECONVERTSTRING pReconvertString = (LPRECONVERTSTRING) lParam;
LRESULT nRet = 0;
SalSurroundingTextRequestEvent aEvt;
aEvt.maText.clear();
2008-10-29 09:25:50 +00:00
aEvt.mnStart = aEvt.mnEnd = 0;
UINT nImeProps = ImmGetProperty( GetKeyboardLayout( 0 ), IGP_SETCOMPSTR );
if( (nImeProps & SCS_CAP_SETRECONVERTSTRING) == 0 )
{
// This IME does not support reconversion.
return 0;
}
if( !pReconvertString )
{
// The first call for reconversion.
pFrame->CallCallback( SALEVENT_STARTRECONVERSION, (void*)NULL );
// Retrieve the surrounding text from the focused control.
pFrame->CallCallback( SALEVENT_SURROUNDINGTEXTREQUEST, (void*)&aEvt );
if( aEvt.maText.isEmpty())
2008-10-29 09:25:50 +00:00
{
return 0;
}
nRet = sizeof(RECONVERTSTRING) + (aEvt.maText.getLength() + 1) * sizeof(WCHAR);
2008-10-29 09:25:50 +00:00
}
else
{
// The second call for reconversion.
// Retrieve the surrounding text from the focused control.
pFrame->CallCallback( SALEVENT_SURROUNDINGTEXTREQUEST, (void*)&aEvt );
nRet = sizeof(RECONVERTSTRING) + (aEvt.maText.getLength() + 1) * sizeof(WCHAR);
2008-10-29 09:25:50 +00:00
pReconvertString->dwStrOffset = sizeof(RECONVERTSTRING);
pReconvertString->dwStrLen = aEvt.maText.getLength();
2008-10-29 09:25:50 +00:00
pReconvertString->dwCompStrOffset = aEvt.mnStart * sizeof(WCHAR);
pReconvertString->dwCompStrLen = aEvt.mnEnd - aEvt.mnStart;
pReconvertString->dwTargetStrOffset = pReconvertString->dwCompStrOffset;
pReconvertString->dwTargetStrLen = pReconvertString->dwCompStrLen;
memcpy( (LPWSTR)(pReconvertString + 1), aEvt.maText.getStr(), (aEvt.maText.getLength() + 1) * sizeof(WCHAR) );
2008-10-29 09:25:50 +00:00
}
// just return the required size of buffer to reconvert.
return nRet;
}
static LRESULT ImplHandleIMEConfirmReconvertString( HWND hWnd, LPARAM lParam )
{
WinSalFrame* pFrame = GetWindowPtr( hWnd );
LPRECONVERTSTRING pReconvertString = (LPRECONVERTSTRING) lParam;
SalSurroundingTextRequestEvent aEvt;
aEvt.maText.clear();
2008-10-29 09:25:50 +00:00
aEvt.mnStart = aEvt.mnEnd = 0;
pFrame->CallCallback( SALEVENT_SURROUNDINGTEXTREQUEST, (void*)&aEvt );
sal_uLong nTmpStart = pReconvertString->dwCompStrOffset / sizeof(WCHAR);
sal_uLong nTmpEnd = nTmpStart + pReconvertString->dwCompStrLen;
2008-10-29 09:25:50 +00:00
if( nTmpStart != aEvt.mnStart || nTmpEnd != aEvt.mnEnd )
{
SalSurroundingTextSelectionChangeEvent aSelEvt;
aSelEvt.mnStart = nTmpStart;
aSelEvt.mnEnd = nTmpEnd;
pFrame->CallCallback( SALEVENT_SURROUNDINGTEXTSELECTIONCHANGE, (void*)&aSelEvt );
}
return TRUE;
}
static LRESULT ImplHandleIMEQueryCharPosition( HWND hWnd, LPARAM lParam ) {
WinSalFrame* pFrame = GetWindowPtr( hWnd );
PIMECHARPOSITION pQueryCharPosition = (PIMECHARPOSITION) lParam;
if ( pQueryCharPosition->dwSize < sizeof(IMECHARPOSITION) )
return FALSE;
SalQueryCharPositionEvent aEvt;
aEvt.mbValid = false;
aEvt.mnCharPos = pQueryCharPosition->dwCharPos;
pFrame->CallCallback( SALEVENT_QUERYCHARPOSITION, (void*)&aEvt );
if ( !aEvt.mbValid )
return FALSE;
if ( aEvt.mbVertical )
{
// For vertical writing, the base line is left edge of the rectangle
// and the target position is top-right corner.
pQueryCharPosition->pt.x = aEvt.mnCursorBoundX + aEvt.mnCursorBoundWidth;
pQueryCharPosition->pt.y = aEvt.mnCursorBoundY;
pQueryCharPosition->cLineHeight = aEvt.mnCursorBoundWidth;
}
else
{
// For horizontal writing, the base line is the bottom edge of the rectangle.
// and the target position is top-left corner.
pQueryCharPosition->pt.x = aEvt.mnCursorBoundX;
pQueryCharPosition->pt.y = aEvt.mnCursorBoundY;
pQueryCharPosition->cLineHeight = aEvt.mnCursorBoundHeight;
}
// Currently not supported but many IMEs usually ignore them.
pQueryCharPosition->rcDocument.left = 0;
pQueryCharPosition->rcDocument.top = 0;
pQueryCharPosition->rcDocument.right = 0;
pQueryCharPosition->rcDocument.bottom = 0;
return TRUE;
}
2000-09-18 16:07:07 +00:00
void SalTestMouseLeave()
{
SalData* pSalData = GetSalData();
if ( pSalData->mhWantLeaveMsg && !::GetCapture() )
{
POINT aPt;
GetCursorPos( &aPt );
if ( pSalData->mhWantLeaveMsg != WindowFromPoint( aPt ) )
SendMessageW( pSalData->mhWantLeaveMsg, SAL_MSG_MOUSELEAVE, 0, MAKELPARAM( aPt.x, aPt.y ) );
2000-09-18 16:07:07 +00:00
}
}
static int ImplSalWheelMousePos( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam ,
LRESULT& rResult )
{
POINT aPt;
POINT aScreenPt;
aScreenPt.x = (short)LOWORD( lParam );
aScreenPt.y = (short)HIWORD( lParam );
// find child window that is at this position
2000-09-18 16:07:07 +00:00
HWND hChildWnd;
HWND hWheelWnd = hWnd;
do
{
hChildWnd = hWheelWnd;
aPt = aScreenPt;
ScreenToClient( hChildWnd, &aPt );
hWheelWnd = ChildWindowFromPointEx( hChildWnd, aPt, CWP_SKIPINVISIBLE | CWP_SKIPTRANSPARENT );
}
while ( hWheelWnd && (hWheelWnd != hChildWnd) );
if ( hWheelWnd && (hWheelWnd != hWnd) &&
(hWheelWnd != ::GetFocus()) && IsWindowEnabled( hWheelWnd ) )
{
rResult = SendMessageW( hWheelWnd, nMsg, wParam, lParam );
2000-09-18 16:07:07 +00:00
return FALSE;
}
return TRUE;
}
LRESULT CALLBACK SalFrameWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, int& rDef )
{
LRESULT nRet = 0;
static int bInWheelMsg = FALSE;
static int bInQueryEnd = FALSE;
2000-09-18 16:07:07 +00:00
// By WM_CRETAE we connect the frame with the window handle
if ( nMsg == WM_CREATE )
{
// Save Window-Instance in Windowhandle
2000-09-18 16:07:07 +00:00
// Can also be used for the W-Version, because the struct
// to access lpCreateParams is the same structure
CREATESTRUCTA* pStruct = (CREATESTRUCTA*)lParam;
WinSalFrame* pFrame = (WinSalFrame*)pStruct->lpCreateParams;
if ( pFrame != 0 )
{
SetWindowPtr( hWnd, pFrame );
// Set HWND already here, as data might be used already
// when messages are being sent by CreateWindow()
pFrame->mhWnd = hWnd;
pFrame->maSysData.hWnd = hWnd;
}
2000-09-18 16:07:07 +00:00
return 0;
}
ImplSVData* pSVData = ImplGetSVData();
// #i72707# TODO: the mbDeInit check will not be needed
// once all windows that are not properly closed on exit got fixed
if( pSVData->mbDeInit )
return 0;
if ( WM_USER_SYSTEM_WINDOW_ACTIVATED == nMsg )
{
ImplHideSplash();
return 0;
}
bool bCheckTimers = false;
2000-09-18 16:07:07 +00:00
switch( nMsg )
{
case WM_MOUSEMOVE:
case WM_LBUTTONDOWN:
case WM_MBUTTONDOWN:
case WM_RBUTTONDOWN:
case WM_LBUTTONUP:
case WM_MBUTTONUP:
case WM_RBUTTONUP:
case WM_NCMOUSEMOVE:
case SAL_MSG_MOUSELEAVE:
ImplSalYieldMutexAcquireWithWait();
rDef = !ImplHandleMouseMsg( hWnd, nMsg, wParam, lParam );
ImplSalYieldMutexRelease();
break;
2001-11-06 09:08:39 +00:00
case WM_NCLBUTTONDOWN:
case WM_NCMBUTTONDOWN:
case WM_NCRBUTTONDOWN:
ImplSalYieldMutexAcquireWithWait();
2002-03-21 17:35:44 +00:00
ImplCallClosePopupsHdl( hWnd ); // close popups...
2001-11-06 09:08:39 +00:00
ImplSalYieldMutexRelease();
break;
2000-09-18 16:07:07 +00:00
case WM_MOUSEACTIVATE:
if ( LOWORD( lParam ) == HTCLIENT )
{
ImplSalYieldMutexAcquireWithWait();
nRet = ImplHandleMouseActivateMsg( hWnd );
ImplSalYieldMutexRelease();
if ( nRet )
{
nRet = MA_NOACTIVATE;
rDef = FALSE;
}
}
break;
case WM_KEYDOWN:
case WM_KEYUP:
case WM_DEADCHAR:
case WM_CHAR:
case WM_UNICHAR: // MCD, 2003-01-13, Support for WM_UNICHAR & Keyman 6.0
2000-09-18 16:07:07 +00:00
case WM_SYSKEYDOWN:
case WM_SYSKEYUP:
case WM_SYSCHAR:
ImplSalYieldMutexAcquireWithWait();
rDef = !ImplHandleKeyMsg( hWnd, nMsg, wParam, lParam, nRet );
2000-09-18 16:07:07 +00:00
ImplSalYieldMutexRelease();
break;
case WM_MOUSEWHEEL:
// FALLTHROUGH intended
case WM_MOUSEHWHEEL:
// protect against recursion, in case the message is returned
// by IE or the external window
2000-09-18 16:07:07 +00:00
if ( !bInWheelMsg )
{
bInWheelMsg++;
rDef = !ImplHandleWheelMsg( hWnd, nMsg, wParam, lParam );
// If we did not process the message, re-check if here is a
// connected (?) window that we have to notify.
2000-09-18 16:07:07 +00:00
if ( rDef )
rDef = ImplSalWheelMousePos( hWnd, nMsg, wParam, lParam, nRet );
bInWheelMsg--;
}
break;
case WM_COMMAND:
ImplSalYieldMutexAcquireWithWait();
rDef = !ImplHandleCommand( hWnd, wParam, lParam );
ImplSalYieldMutexRelease();
break;
case WM_INITMENUPOPUP:
ImplSalYieldMutexAcquireWithWait();
rDef = !ImplHandleMenuActivate( hWnd, wParam, lParam );
ImplSalYieldMutexRelease();
break;
case WM_MENUSELECT:
ImplSalYieldMutexAcquireWithWait();
rDef = !ImplHandleMenuSelect( hWnd, wParam, lParam );
ImplSalYieldMutexRelease();
break;
2000-09-18 16:07:07 +00:00
case WM_SYSCOMMAND:
ImplSalYieldMutexAcquireWithWait();
nRet = ImplHandleSysCommand( hWnd, wParam, lParam );
ImplSalYieldMutexRelease();
if ( nRet )
rDef = FALSE;
break;
case WM_MENUCHAR:
nRet = ImplMenuChar( hWnd, wParam, lParam );
if( nRet )
rDef = FALSE;
break;
case WM_MEASUREITEM:
nRet = ImplMeasureItem(hWnd, wParam, lParam);
if( nRet )
rDef = FALSE;
break;
case WM_DRAWITEM:
nRet = ImplDrawItem(hWnd, wParam, lParam);
if( nRet )
rDef = FALSE;
break;
2000-09-18 16:07:07 +00:00
case WM_MOVE:
case SAL_MSG_POSTMOVE:
ImplHandleMoveMsg( hWnd );
rDef = FALSE;
break;
case WM_SIZE:
ImplHandleSizeMsg( hWnd, wParam, lParam );
rDef = FALSE;
break;
case SAL_MSG_POSTCALLSIZE:
ImplCallSizeHdl( hWnd );
rDef = FALSE;
break;
case WM_GETMINMAXINFO:
if ( ImplHandleMinMax( hWnd, lParam ) )
rDef = FALSE;
break;
case WM_ERASEBKGND:
nRet = 1;
rDef = FALSE;
break;
case WM_PAINT:
bCheckTimers = ImplHandlePaintMsg( hWnd );
2000-09-18 16:07:07 +00:00
rDef = FALSE;
break;
case SAL_MSG_POSTPAINT:
ImplHandlePaintMsg2( hWnd, (RECT*)wParam );
bCheckTimers = true;
2000-09-18 16:07:07 +00:00
rDef = FALSE;
break;
case SAL_MSG_FORCEPALETTE:
ImplHandleForcePalette( hWnd );
rDef = FALSE;
break;
case WM_QUERYNEWPALETTE:
case SAL_MSG_POSTQUERYNEWPAL:
nRet = ImplHandlePalette( TRUE, hWnd, nMsg, wParam, lParam, rDef );
break;
case WM_ACTIVATE:
// Getting activated, we also want to set our palette.
// We do this in Activate, so that other external child windows
// can overwrite our palette. Thus our palette is set only once
// and not recursively, as at all other places it is set only as
// the background palette.
2000-09-18 16:07:07 +00:00
if ( LOWORD( wParam ) != WA_INACTIVE )
SendMessageW( hWnd, SAL_MSG_FORCEPALETTE, 0, 0 );
2000-09-18 16:07:07 +00:00
break;
case WM_ENABLE:
// #95133# a system dialog is opened/closed, using our app window as parent
{
WinSalFrame* pFrame = GetWindowPtr( hWnd );
vcl::Window *pWin = NULL;
if( pFrame )
pWin = pFrame->GetWindow();
if( !wParam )
{
pSVData->maAppData.mnModalMode++;
ImplHideSplash();
if( pWin )
{
pWin->EnableInput( FALSE, TRUE, TRUE, NULL );
pWin->ImplIncModalCount(); // #106303# support frame based modal count
}
}
else
{
ImplGetSVData()->maAppData.mnModalMode--;
if( pWin )
{
pWin->EnableInput( TRUE, TRUE, TRUE, NULL );
pWin->ImplDecModalCount(); // #106303# support frame based modal count
}
}
}
break;
2000-09-18 16:07:07 +00:00
case WM_KILLFOCUS:
DestroyCaret();
case WM_SETFOCUS:
2000-09-18 16:07:07 +00:00
case SAL_MSG_POSTFOCUS:
ImplHandleFocusMsg( hWnd );
rDef = FALSE;
break;
case WM_CLOSE:
ImplHandleCloseMsg( hWnd );
rDef = FALSE;
break;
case WM_QUERYENDSESSION:
if( !bInQueryEnd )
{
// handle queryendsession only once
bInQueryEnd = TRUE;
nRet = !ImplHandleShutDownMsg( hWnd );
rDef = FALSE;
// Issue #16314#: ImplHandleShutDownMsg causes a PostMessage in case of allowing shutdown.
// This posted message was never processed and cause Windows XP to hang after log off
// if there are multiple sessions and the current session wasn't the first one started.
// So if shutdown is allowed we assume that a post message was done and retrieve all
// messages in the message queue and dispatch them before we return control to the system.
if ( nRet )
{
MSG msg;
while( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )
{
DispatchMessage( &msg );
}
}
}
else
{
ImplSalYieldMutexAcquireWithWait();
ImplSalYieldMutexRelease();
rDef = TRUE;
}
break;
case WM_ENDSESSION:
if( !wParam )
bInQueryEnd = FALSE; // no shutdown: allow query again
nRet = FALSE;
2000-09-18 16:07:07 +00:00
rDef = FALSE;
break;
case WM_DISPLAYCHANGE:
case WM_SETTINGCHANGE:
case WM_DEVMODECHANGE:
case WM_FONTCHANGE:
case WM_SYSCOLORCHANGE:
case WM_TIMECHANGE:
ImplHandleSettingsChangeMsg( hWnd, nMsg, wParam, lParam );
break;
case WM_THEMECHANGED:
GetSalData()->mbThemeChanged = TRUE;
break;
2000-09-18 16:07:07 +00:00
case SAL_MSG_USEREVENT:
ImplHandleUserEvent( hWnd, lParam );
rDef = FALSE;
break;
case SAL_MSG_CAPTUREMOUSE:
SetCapture( hWnd );
rDef = FALSE;
break;
case SAL_MSG_RELEASEMOUSE:
if ( ::GetCapture() == hWnd )
ReleaseCapture();
rDef = FALSE;
break;
case SAL_MSG_TOTOP:
ImplSalToTop( hWnd, (sal_uInt16)wParam );
2000-09-18 16:07:07 +00:00
rDef = FALSE;
break;
case SAL_MSG_SHOW:
ImplSalShow( hWnd, (bool)wParam, (bool)lParam );
2000-09-18 16:07:07 +00:00
rDef = FALSE;
break;
2001-06-22 13:15:50 +00:00
case SAL_MSG_SETINPUTCONTEXT:
ImplSalFrameSetInputContext( hWnd, (const SalInputContext*)(void*)lParam );
rDef = FALSE;
break;
case SAL_MSG_ENDEXTTEXTINPUT:
ImplSalFrameEndExtTextInput( hWnd, (EndExtTextInputFlags)(sal_uLong)(void*)wParam );
2001-06-22 13:15:50 +00:00
rDef = FALSE;
break;
2000-09-18 16:07:07 +00:00
case WM_INPUTLANGCHANGE:
ImplHandleInputLangChange( hWnd, wParam, lParam );
break;
case WM_IME_CHAR:
// #103487#, some IMEs (eg, those that do not work onspot)
// may send WM_IME_CHAR instead of WM_IME_COMPOSITION
// we just handle it like a WM_CHAR message - seems to work fine
ImplSalYieldMutexAcquireWithWait();
rDef = !ImplHandleKeyMsg( hWnd, WM_CHAR, wParam, lParam, nRet );
ImplSalYieldMutexRelease();
break;
case WM_IME_STARTCOMPOSITION:
2000-09-18 16:07:07 +00:00
rDef = ImplHandleIMEStartComposition( hWnd );
break;
case WM_IME_COMPOSITION:
rDef = ImplHandleIMEComposition( hWnd, lParam );
break;
case WM_IME_ENDCOMPOSITION:
rDef = ImplHandleIMEEndComposition( hWnd );
break;
case WM_IME_NOTIFY:
ImplHandleIMENotify( hWnd, wParam );
break;
case WM_GETOBJECT:
ImplSalYieldMutexAcquireWithWait();
if ( ImplHandleGetObject( hWnd, lParam, wParam, nRet ) )
{
rDef = false;
}
ImplSalYieldMutexRelease();
break;
case WM_APPCOMMAND:
if( ImplHandleAppCommand( hWnd, lParam, nRet ) )
{
rDef = false;
}
break;
2008-10-29 09:25:50 +00:00
case WM_IME_REQUEST:
2011-01-23 23:45:55 +02:00
if ( (sal_uIntPtr)( wParam ) == IMR_RECONVERTSTRING )
2008-10-29 09:25:50 +00:00
{
nRet = ImplHandleIMEReconvertString( hWnd, lParam );
rDef = FALSE;
}
else if( (sal_uIntPtr)( wParam ) == IMR_CONFIRMRECONVERTSTRING )
{
nRet = ImplHandleIMEConfirmReconvertString( hWnd, lParam );
rDef = FALSE;
}
else if ( (sal_uIntPtr)( wParam ) == IMR_QUERYCHARPOSITION )
{
nRet = ImplHandleIMEQueryCharPosition( hWnd, lParam );
rDef = FALSE;
}
2008-10-29 09:25:50 +00:00
break;
2000-09-18 16:07:07 +00:00
}
// catch WheelMouse-Message
2000-09-18 16:07:07 +00:00
if ( rDef && (nMsg == aSalShlData.mnWheelMsgId) && aSalShlData.mnWheelMsgId )
{
// protect against recursion, in case the message is returned
// by IE or the external window
2000-09-18 16:07:07 +00:00
if ( !bInWheelMsg )
{
bInWheelMsg++;
// First dispatch the message; and then give the SystemWindow a turn
2000-09-18 16:07:07 +00:00
WORD nKeyState = 0;
if ( GetKeyState( VK_SHIFT ) & 0x8000 )
nKeyState |= MK_SHIFT;
if ( GetKeyState( VK_CONTROL ) & 0x8000 )
nKeyState |= MK_CONTROL;
// Mutex handling is inside from this call
rDef = !ImplHandleWheelMsg( hWnd,
WM_MOUSEWHEEL,
MAKEWPARAM( nKeyState, (WORD)wParam ),
lParam );
2000-09-18 16:07:07 +00:00
if ( rDef )
{
HWND hWheelWnd = ::GetFocus();
if ( hWheelWnd && (hWheelWnd != hWnd) )
{
nRet = SendMessageW( hWheelWnd, nMsg, wParam, lParam );
2000-09-18 16:07:07 +00:00
rDef = FALSE;
}
else
rDef = ImplSalWheelMousePos( hWnd, nMsg, wParam, lParam, nRet );
}
bInWheelMsg--;
}
}
if( bCheckTimers )
{
SalData* pSalData = GetSalData();
if( pSalData->mnNextTimerTime )
{
DWORD nCurTime = GetTickCount();
if( pSalData->mnNextTimerTime < nCurTime )
{
MSG aMsg;
if( ! PeekMessageW( &aMsg, 0, WM_PAINT, WM_PAINT, PM_NOREMOVE | PM_NOYIELD ) )
PostMessageW( pSalData->mpFirstInstance->mhComWnd, SAL_MSG_POSTTIMER, 0, nCurTime );
}
}
}
2000-09-18 16:07:07 +00:00
return nRet;
}
LRESULT CALLBACK SalFrameWndProcW( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam )
{
int bDef = TRUE;
LRESULT nRet = 0;
#if defined ( __MINGW32__ ) && !defined ( _WIN64 )
jmp_buf jmpbuf;
__SEHandler han;
if (__builtin_setjmp(jmpbuf) == 0)
{
han.Set(jmpbuf, NULL, (__SEHandler::PF)EXCEPTION_EXECUTE_HANDLER);
#else
__try
{
#endif
nRet = SalFrameWndProc( hWnd, nMsg, wParam, lParam, bDef );
}
#if defined ( __MINGW32__ ) && !defined ( _WIN64 )
han.Reset();
#else
__except(WinSalInstance::WorkaroundExceptionHandlingInUSER32Lib(GetExceptionCode(), GetExceptionInformation()))
{
}
#endif
2000-09-18 16:07:07 +00:00
if ( bDef )
nRet = DefWindowProcW( hWnd, nMsg, wParam, lParam );
return nRet;
}
bool ImplHandleGlobalMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, LRESULT& rlResult )
2000-09-18 16:07:07 +00:00
{
// handle all messages concerning all frames so they get processed only once
2000-09-18 16:07:07 +00:00
// Must work for Unicode and none Unicode
bool bResult = FALSE;
2000-09-18 16:07:07 +00:00
if ( (nMsg == WM_PALETTECHANGED) || (nMsg == SAL_MSG_POSTPALCHANGED) )
{
int bDef = TRUE;
rlResult = ImplHandlePalette( FALSE, hWnd, nMsg, wParam, lParam, bDef );
bResult = (bDef != 0);
2000-09-18 16:07:07 +00:00
}
else if( nMsg == WM_DISPLAYCHANGE )
{
WinSalSystem* pSys = static_cast<WinSalSystem*>(ImplGetSalSystem());
if( pSys )
pSys->clearMonitors();
bResult = (pSys != NULL);
}
return bResult;
2000-09-18 16:07:07 +00:00
}
void ImplWriteLastError(DWORD lastError, const char *szApiCall)
{
#if OSL_DEBUG_LEVEL > 0
LPVOID lpMsgBuf;
if (FormatMessageA(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
lastError & 0xffff,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
(LPTSTR) &lpMsgBuf,
0,
NULL ))
{
SAL_WARN("vcl", "API call: " << szApiCall << " returned " << lastError << " (0x" << std::hex << lastError << "): " << (LPTSTR) lpMsgBuf);
LocalFree(lpMsgBuf);
}
else
SAL_WARN("vcl", "API call: " << szApiCall << " returned " << lastError << " (0x" << std::hex << lastError << ")");
#endif
}
#ifdef _WIN32
bool HasAtHook()
{
BOOL bIsRunning = FALSE;
// pvParam must be BOOL
return SystemParametersInfo(SPI_GETSCREENREADER, 0, &bIsRunning, 0)
&& bIsRunning;
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */