2010-10-14 08:27:31 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-10-02 14:13:40 +01: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 .
|
|
|
|
*/
|
2002-07-11 10:07:56 +00:00
|
|
|
|
2011-02-23 19:38:56 -08:00
|
|
|
|
|
|
|
#include <boost/ptr_container/ptr_vector.hpp>
|
|
|
|
|
2002-11-12 09:10:49 +00:00
|
|
|
#include <com/sun/star/beans/PropertyAttribute.hpp>
|
|
|
|
|
2001-02-05 08:33:16 +00:00
|
|
|
#include <stdio.h>
|
2011-03-28 01:31:21 -06:00
|
|
|
#ifdef WNT
|
|
|
|
#include <prewin.h>
|
|
|
|
#include <postwin.h>
|
|
|
|
#endif
|
2010-10-07 13:22:07 +02:00
|
|
|
#include <com/sun/star/awt/ImageScaleMode.hpp>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <com/sun/star/awt/WindowAttribute.hpp>
|
|
|
|
#include <com/sun/star/awt/VclWindowPeerAttribute.hpp>
|
|
|
|
#include <com/sun/star/awt/WindowClass.hpp>
|
2006-12-01 14:09:13 +00:00
|
|
|
#include <com/sun/star/awt/MessageBoxButtons.hpp>
|
2001-02-21 14:24:30 +00:00
|
|
|
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
2001-02-05 08:33:16 +00:00
|
|
|
#include <com/sun/star/lang/SystemDependent.hpp>
|
2003-12-11 10:56:46 +00:00
|
|
|
#include <com/sun/star/awt/FocusEvent.hpp>
|
|
|
|
#include <com/sun/star/awt/KeyEvent.hpp>
|
|
|
|
#include <com/sun/star/awt/KeyModifier.hpp>
|
|
|
|
#include <com/sun/star/lang/EventObject.hpp>
|
|
|
|
#include <com/sun/star/uno/Reference.hxx>
|
|
|
|
#include <com/sun/star/uno/Sequence.hxx>
|
|
|
|
#include <com/sun/star/uno/XInterface.hpp>
|
2007-12-07 10:59:06 +00:00
|
|
|
#include <com/sun/star/beans/NamedValue.hpp>
|
2013-01-14 16:05:07 +02:00
|
|
|
#include <com/sun/star/datatransfer/clipboard/SystemClipboard.hpp>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <cppuhelper/typeprovider.hxx>
|
2001-02-22 17:22:48 +00:00
|
|
|
#include <osl/conditn.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <rtl/uuid.h>
|
2001-02-05 08:33:16 +00:00
|
|
|
#include <rtl/process.h>
|
2009-05-18 12:01:49 +00:00
|
|
|
|
2013-01-11 11:07:23 +02:00
|
|
|
#ifdef MACOSX
|
2009-05-18 12:01:49 +00:00
|
|
|
#include "premac.h"
|
|
|
|
#include <Cocoa/Cocoa.h>
|
|
|
|
#include "postmac.h"
|
|
|
|
#endif
|
2011-07-15 01:40:22 +03:00
|
|
|
|
2012-06-11 20:02:11 +03:00
|
|
|
#ifdef ANDROID
|
|
|
|
#include <sal/ByteBufferWrapper.hxx>
|
|
|
|
using org::libreoffice::touch::ByteBufferWrapper;
|
|
|
|
#endif
|
|
|
|
|
2009-05-18 12:01:49 +00:00
|
|
|
#include <vcl/sysdata.hxx>
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <toolkit/awt/vclxwindows.hxx>
|
|
|
|
#include <toolkit/awt/vclxsystemdependentwindow.hxx>
|
|
|
|
#include <toolkit/awt/vclxregion.hxx>
|
|
|
|
#include <toolkit/awt/vclxtoolkit.hxx>
|
2010-08-12 17:36:53 +02:00
|
|
|
#include <toolkit/awt/vclxtabpagecontainer.hxx>
|
|
|
|
#include <toolkit/awt/vclxtabpagemodel.hxx>
|
2006-12-20 12:52:30 +00:00
|
|
|
|
2010-10-06 14:21:47 +02:00
|
|
|
#include <toolkit/awt/animatedimagespeer.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <toolkit/awt/vclxtopwindow.hxx>
|
|
|
|
#include <toolkit/awt/vclxwindow.hxx>
|
|
|
|
#include <toolkit/helper/vclunohelper.hxx>
|
2001-02-22 17:22:48 +00:00
|
|
|
#include <toolkit/helper/unowrapper.hxx>
|
2001-09-04 05:50:36 +00:00
|
|
|
#include <toolkit/helper/servicenames.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
#include <toolkit/helper/macros.hxx>
|
|
|
|
#include <toolkit/helper/convert.hxx>
|
2001-03-15 10:44:20 +00:00
|
|
|
#include <vcl/unohelp.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <vcl/btndlg.hxx>
|
|
|
|
#include <vcl/button.hxx>
|
|
|
|
#include <vcl/combobox.hxx>
|
|
|
|
#include <vcl/ctrl.hxx>
|
|
|
|
#include <vcl/dialog.hxx>
|
2004-11-16 13:08:49 +00:00
|
|
|
#include <vcl/dockingarea.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <vcl/dockwin.hxx>
|
|
|
|
#include <vcl/edit.hxx>
|
|
|
|
#include <vcl/field.hxx>
|
|
|
|
#include <vcl/fixed.hxx>
|
|
|
|
#include <vcl/floatwin.hxx>
|
|
|
|
#include <vcl/group.hxx>
|
|
|
|
#include <vcl/imgctrl.hxx>
|
|
|
|
#include <vcl/longcurr.hxx>
|
|
|
|
#include <vcl/lstbox.hxx>
|
|
|
|
#include <vcl/menubtn.hxx>
|
|
|
|
#include <vcl/morebtn.hxx>
|
|
|
|
#include <vcl/msgbox.hxx>
|
|
|
|
#include <vcl/scrbar.hxx>
|
|
|
|
#include <vcl/spin.hxx>
|
|
|
|
#include <vcl/split.hxx>
|
|
|
|
#include <vcl/splitwin.hxx>
|
|
|
|
#include <vcl/status.hxx>
|
|
|
|
#include <vcl/svapp.hxx>
|
|
|
|
#include <vcl/syschild.hxx>
|
|
|
|
#include <vcl/tabctrl.hxx>
|
|
|
|
#include <vcl/tabdlg.hxx>
|
|
|
|
#include <vcl/tabpage.hxx>
|
|
|
|
#include <vcl/toolbox.hxx>
|
|
|
|
#include <vcl/virdev.hxx>
|
|
|
|
#include <vcl/window.hxx>
|
|
|
|
#include <vcl/wrkwin.hxx>
|
2010-10-07 13:22:07 +02:00
|
|
|
#include <vcl/throbber.hxx>
|
2003-12-11 10:56:46 +00:00
|
|
|
#include "toolkit/awt/vclxspinbutton.hxx"
|
2012-09-03 15:03:03 +01:00
|
|
|
#include "toolkit/awt/scrollabledialog.hxx"
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <tools/debug.hxx>
|
2001-02-21 14:24:30 +00:00
|
|
|
#include <comphelper/processfactory.hxx>
|
2012-09-03 15:03:03 +01:00
|
|
|
#include <toolkit/awt/scrollabledialog.hxx>
|
2001-02-21 14:24:30 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
#define VCLWINDOW_FRAMEWINDOW 0x1000
|
|
|
|
#define VCLWINDOW_SYSTEMCHILDWINDOW 0x1001
|
|
|
|
|
2007-07-05 07:03:46 +00:00
|
|
|
#if (defined WNT)
|
2001-02-05 08:33:16 +00:00
|
|
|
#define SYSTEM_DEPENDENT_TYPE ::com::sun::star::lang::SystemDependent::SYSTEM_WIN32
|
2013-01-11 11:07:23 +02:00
|
|
|
#elif (defined MACOSX)
|
2007-07-05 07:03:46 +00:00
|
|
|
#define SYSTEM_DEPENDENT_TYPE ::com::sun::star::lang::SystemDependent::SYSTEM_MAC
|
|
|
|
#elif (defined UNX)
|
|
|
|
#define SYSTEM_DEPENDENT_TYPE ::com::sun::star::lang::SystemDependent::SYSTEM_XWINDOW
|
2001-02-05 08:33:16 +00:00
|
|
|
#endif
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-03-06 10:42:37 +00:00
|
|
|
TOOLKIT_DLLPUBLIC WinBits ImplGetWinBits( sal_uInt32 nComponentAttribs, sal_uInt16 nCompType )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-05 14:55:06 +00:00
|
|
|
WinBits nWinBits = 0;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2013-08-28 04:53:40 +09:00
|
|
|
bool bMessBox = false;
|
2000-09-18 16:07:07 +00:00
|
|
|
if ( ( nCompType == WINDOW_INFOBOX ) ||
|
|
|
|
( nCompType == WINDOW_MESSBOX ) ||
|
|
|
|
( nCompType == WINDOW_QUERYBOX ) ||
|
|
|
|
( nCompType == WINDOW_WARNINGBOX ) ||
|
|
|
|
( nCompType == WINDOW_ERRORBOX ) )
|
|
|
|
{
|
2013-08-28 04:53:40 +09:00
|
|
|
bMessBox = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2008-12-01 12:31:27 +00:00
|
|
|
bool bDecoratedWindow = false;
|
|
|
|
if ( bMessBox
|
|
|
|
|| ( nCompType == WINDOW_DIALOG )
|
|
|
|
|| ( nCompType == WINDOW_MODELESSDIALOG )
|
|
|
|
|| ( nCompType == WINDOW_MODALDIALOG )
|
|
|
|
|| ( nCompType == WINDOW_SYSTEMDIALOG )
|
|
|
|
|| ( nCompType == WINDOW_PATHDIALOG )
|
|
|
|
|| ( nCompType == WINDOW_FILEDIALOG )
|
|
|
|
|| ( nCompType == WINDOW_PRINTERSETUPDIALOG )
|
|
|
|
|| ( nCompType == WINDOW_PRINTDIALOG )
|
|
|
|
|| ( nCompType == WINDOW_COLORDIALOG )
|
|
|
|
|| ( nCompType == WINDOW_FONTDIALOG )
|
|
|
|
|| ( nCompType == WINDOW_DOCKINGWINDOW )
|
|
|
|
|| ( nCompType == WINDOW_TABDIALOG )
|
|
|
|
|| ( nCompType == WINDOW_BUTTONDIALOG )
|
|
|
|
|| ( nCompType == WINDOW_SYSTEMCHILDWINDOW )
|
|
|
|
)
|
|
|
|
{
|
|
|
|
bDecoratedWindow = true;
|
|
|
|
}
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
if( nComponentAttribs & ::com::sun::star::awt::WindowAttribute::BORDER )
|
|
|
|
nWinBits |= WB_BORDER;
|
|
|
|
if( nComponentAttribs & ::com::sun::star::awt::VclWindowPeerAttribute::NOBORDER )
|
|
|
|
nWinBits |= WB_NOBORDER;
|
|
|
|
if( nComponentAttribs & ::com::sun::star::awt::WindowAttribute::SIZEABLE )
|
|
|
|
nWinBits |= WB_SIZEABLE;
|
|
|
|
if( nComponentAttribs & ::com::sun::star::awt::WindowAttribute::MOVEABLE )
|
|
|
|
nWinBits |= WB_MOVEABLE;
|
|
|
|
if( nComponentAttribs & ::com::sun::star::awt::WindowAttribute::CLOSEABLE )
|
|
|
|
nWinBits |= WB_CLOSEABLE;
|
|
|
|
if( nComponentAttribs & ::com::sun::star::awt::VclWindowPeerAttribute::HSCROLL )
|
|
|
|
nWinBits |= WB_HSCROLL;
|
|
|
|
if( nComponentAttribs & ::com::sun::star::awt::VclWindowPeerAttribute::VSCROLL )
|
|
|
|
nWinBits |= WB_VSCROLL;
|
|
|
|
if( nComponentAttribs & ::com::sun::star::awt::VclWindowPeerAttribute::LEFT )
|
|
|
|
nWinBits |= WB_LEFT;
|
|
|
|
if( nComponentAttribs & ::com::sun::star::awt::VclWindowPeerAttribute::CENTER )
|
|
|
|
nWinBits |= WB_CENTER;
|
|
|
|
if( nComponentAttribs & ::com::sun::star::awt::VclWindowPeerAttribute::RIGHT )
|
|
|
|
nWinBits |= WB_RIGHT;
|
|
|
|
if( nComponentAttribs & ::com::sun::star::awt::VclWindowPeerAttribute::SPIN )
|
|
|
|
nWinBits |= WB_SPIN;
|
|
|
|
if( nComponentAttribs & ::com::sun::star::awt::VclWindowPeerAttribute::SORT )
|
|
|
|
nWinBits |= WB_SORT;
|
|
|
|
if( nComponentAttribs & ::com::sun::star::awt::VclWindowPeerAttribute::DROPDOWN )
|
|
|
|
nWinBits |= WB_DROPDOWN;
|
|
|
|
if( nComponentAttribs & ::com::sun::star::awt::VclWindowPeerAttribute::DEFBUTTON )
|
|
|
|
nWinBits |= WB_DEFBUTTON;
|
|
|
|
if( nComponentAttribs & ::com::sun::star::awt::VclWindowPeerAttribute::READONLY )
|
|
|
|
nWinBits |= WB_READONLY;
|
|
|
|
if( nComponentAttribs & ::com::sun::star::awt::VclWindowPeerAttribute::CLIPCHILDREN )
|
|
|
|
nWinBits |= WB_CLIPCHILDREN;
|
2007-11-27 10:57:07 +00:00
|
|
|
if( nComponentAttribs & ::com::sun::star::awt::VclWindowPeerAttribute::GROUP )
|
|
|
|
nWinBits |= WB_GROUP;
|
|
|
|
if( nComponentAttribs & ::com::sun::star::awt::VclWindowPeerAttribute::NOLABEL ) //added for issue79712
|
|
|
|
nWinBits |= WB_NOLABEL;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
// These bits are not uniqe
|
|
|
|
if ( bMessBox )
|
|
|
|
{
|
|
|
|
if( nComponentAttribs & ::com::sun::star::awt::VclWindowPeerAttribute::OK )
|
|
|
|
nWinBits |= WB_OK;
|
|
|
|
if( nComponentAttribs & ::com::sun::star::awt::VclWindowPeerAttribute::OK_CANCEL )
|
|
|
|
nWinBits |= WB_OK_CANCEL;
|
|
|
|
if( nComponentAttribs & ::com::sun::star::awt::VclWindowPeerAttribute::YES_NO )
|
|
|
|
nWinBits |= WB_YES_NO;
|
|
|
|
if( nComponentAttribs & ::com::sun::star::awt::VclWindowPeerAttribute::YES_NO_CANCEL )
|
|
|
|
nWinBits |= WB_YES_NO_CANCEL;
|
|
|
|
if( nComponentAttribs & ::com::sun::star::awt::VclWindowPeerAttribute::RETRY_CANCEL )
|
|
|
|
nWinBits |= WB_RETRY_CANCEL;
|
|
|
|
if( nComponentAttribs & ::com::sun::star::awt::VclWindowPeerAttribute::DEF_OK )
|
|
|
|
nWinBits |= WB_DEF_OK;
|
|
|
|
if( nComponentAttribs & ::com::sun::star::awt::VclWindowPeerAttribute::DEF_CANCEL )
|
|
|
|
nWinBits |= WB_DEF_CANCEL;
|
|
|
|
if( nComponentAttribs & ::com::sun::star::awt::VclWindowPeerAttribute::DEF_RETRY )
|
|
|
|
nWinBits |= WB_DEF_RETRY;
|
|
|
|
if( nComponentAttribs & ::com::sun::star::awt::VclWindowPeerAttribute::DEF_YES )
|
|
|
|
nWinBits |= WB_DEF_YES;
|
|
|
|
if( nComponentAttribs & ::com::sun::star::awt::VclWindowPeerAttribute::DEF_NO )
|
|
|
|
nWinBits |= WB_DEF_NO;
|
|
|
|
}
|
2013-03-03 03:55:35 +01:00
|
|
|
if ( nCompType == WINDOW_MULTILINEEDIT || nCompType == WINDOW_DIALOG || nCompType == WINDOW_GROUPBOX )
|
2007-07-06 13:26:42 +00:00
|
|
|
{
|
|
|
|
if( nComponentAttribs & ::com::sun::star::awt::VclWindowPeerAttribute::AUTOHSCROLL )
|
|
|
|
nWinBits |= WB_AUTOHSCROLL;
|
|
|
|
if( nComponentAttribs & ::com::sun::star::awt::VclWindowPeerAttribute::AUTOVSCROLL )
|
|
|
|
nWinBits |= WB_AUTOVSCROLL;
|
|
|
|
}
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-12-01 12:31:27 +00:00
|
|
|
if ( bDecoratedWindow )
|
2007-06-20 09:25:08 +00:00
|
|
|
{
|
2008-12-01 12:31:27 +00:00
|
|
|
if( nComponentAttribs & ::com::sun::star::awt::WindowAttribute::NODECORATION )
|
|
|
|
{
|
|
|
|
// No decoration removes several window attributes and must
|
|
|
|
// set WB_NOBORDER!
|
|
|
|
nWinBits &= ~WB_BORDER;
|
|
|
|
nWinBits &= ~WB_SIZEABLE;
|
|
|
|
nWinBits &= ~WB_MOVEABLE;
|
|
|
|
nWinBits &= ~WB_CLOSEABLE;
|
|
|
|
nWinBits |= WB_NOBORDER;
|
|
|
|
}
|
2007-06-20 09:25:08 +00:00
|
|
|
}
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
return nWinBits;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct ComponentInfo
|
|
|
|
{
|
|
|
|
const char* pName;
|
|
|
|
WindowType nWinType;
|
|
|
|
};
|
|
|
|
|
2010-12-06 10:36:19 +00:00
|
|
|
static ComponentInfo aComponentInfos [] =
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
{ "buttondialog", WINDOW_BUTTONDIALOG },
|
|
|
|
{ "cancelbutton", WINDOW_CANCELBUTTON },
|
|
|
|
{ "checkbox", WINDOW_CHECKBOX },
|
|
|
|
{ "combobox", WINDOW_COMBOBOX },
|
|
|
|
{ "control", WINDOW_CONTROL },
|
|
|
|
{ "currencybox", WINDOW_CURRENCYBOX },
|
|
|
|
{ "currencyfield", WINDOW_CURRENCYFIELD },
|
|
|
|
{ "datebox", WINDOW_DATEBOX },
|
|
|
|
{ "datefield", WINDOW_DATEFIELD },
|
|
|
|
{ "dialog", WINDOW_DIALOG },
|
2004-11-16 13:08:49 +00:00
|
|
|
{ "dockingarea", WINDOW_DOCKINGAREA },
|
2000-09-18 16:07:07 +00:00
|
|
|
{ "dockingwindow", WINDOW_DOCKINGWINDOW },
|
|
|
|
{ "edit", WINDOW_EDIT },
|
|
|
|
{ "errorbox", WINDOW_ERRORBOX },
|
|
|
|
{ "fixedbitmap", WINDOW_FIXEDBITMAP },
|
|
|
|
{ "fixedimage", WINDOW_FIXEDIMAGE },
|
|
|
|
{ "fixedline", WINDOW_FIXEDLINE },
|
|
|
|
{ "fixedtext", WINDOW_FIXEDTEXT },
|
|
|
|
{ "floatingwindow", WINDOW_FLOATINGWINDOW },
|
|
|
|
{ "framewindow", VCLWINDOW_FRAMEWINDOW },
|
|
|
|
{ "groupbox", WINDOW_GROUPBOX },
|
2010-11-02 16:55:17 +00:00
|
|
|
{ "frame", WINDOW_GROUPBOX },
|
2000-09-18 16:07:07 +00:00
|
|
|
{ "helpbutton", WINDOW_HELPBUTTON },
|
|
|
|
{ "imagebutton", WINDOW_IMAGEBUTTON },
|
|
|
|
{ "infobox", WINDOW_INFOBOX },
|
|
|
|
{ "listbox", WINDOW_LISTBOX },
|
|
|
|
{ "longcurrencybox", WINDOW_LONGCURRENCYBOX },
|
|
|
|
{ "longcurrencyfield", WINDOW_LONGCURRENCYFIELD },
|
|
|
|
{ "menubutton", WINDOW_MENUBUTTON },
|
|
|
|
{ "messbox", WINDOW_MESSBOX },
|
|
|
|
{ "metricbox", WINDOW_METRICBOX },
|
|
|
|
{ "metricfield", WINDOW_METRICFIELD },
|
|
|
|
{ "modaldialog", WINDOW_MODALDIALOG },
|
|
|
|
{ "modelessdialog", WINDOW_MODELESSDIALOG },
|
|
|
|
{ "morebutton", WINDOW_MOREBUTTON },
|
2007-07-06 13:26:42 +00:00
|
|
|
{ "multilineedit", WINDOW_MULTILINEEDIT },
|
2000-09-18 16:07:07 +00:00
|
|
|
{ "multilistbox", WINDOW_MULTILISTBOX },
|
|
|
|
{ "numericbox", WINDOW_NUMERICBOX },
|
|
|
|
{ "numericfield", WINDOW_NUMERICFIELD },
|
|
|
|
{ "okbutton", WINDOW_OKBUTTON },
|
|
|
|
{ "patternbox", WINDOW_PATTERNBOX },
|
|
|
|
{ "patternfield", WINDOW_PATTERNFIELD },
|
|
|
|
{ "pushbutton", WINDOW_PUSHBUTTON },
|
|
|
|
{ "querybox", WINDOW_QUERYBOX },
|
|
|
|
{ "radiobutton", WINDOW_RADIOBUTTON },
|
|
|
|
{ "scrollbar", WINDOW_SCROLLBAR },
|
|
|
|
{ "scrollbarbox", WINDOW_SCROLLBARBOX },
|
2010-10-06 14:21:47 +02:00
|
|
|
{ "animatedimages", WINDOW_CONTROL },
|
2000-09-18 16:07:07 +00:00
|
|
|
{ "spinbutton", WINDOW_SPINBUTTON },
|
|
|
|
{ "spinfield", WINDOW_SPINFIELD },
|
|
|
|
{ "splitter", WINDOW_SPLITTER },
|
|
|
|
{ "splitwindow", WINDOW_SPLITWINDOW },
|
|
|
|
{ "statusbar", WINDOW_STATUSBAR },
|
|
|
|
{ "systemchildwindow", VCLWINDOW_SYSTEMCHILDWINDOW },
|
|
|
|
{ "tabcontrol", WINDOW_TABCONTROL },
|
|
|
|
{ "tabdialog", WINDOW_TABDIALOG },
|
|
|
|
{ "tabpage", WINDOW_TABPAGE },
|
|
|
|
{ "timebox", WINDOW_TIMEBOX },
|
|
|
|
{ "timefield", WINDOW_TIMEFIELD },
|
|
|
|
{ "toolbox", WINDOW_TOOLBOX },
|
|
|
|
{ "tristatebox", WINDOW_TRISTATEBOX },
|
|
|
|
{ "warningbox", WINDOW_WARNINGBOX },
|
|
|
|
{ "window", WINDOW_WINDOW },
|
2010-08-12 17:36:53 +02:00
|
|
|
{ "workwindow", WINDOW_WORKWINDOW },
|
|
|
|
{ "tabpagecontainer", WINDOW_CONTROL },
|
2010-08-27 12:13:59 +02:00
|
|
|
{ "tabpagemodel", WINDOW_TABPAGE }
|
2000-09-18 16:07:07 +00:00
|
|
|
};
|
|
|
|
|
2006-06-19 22:01:53 +00:00
|
|
|
extern "C"
|
|
|
|
{
|
2011-05-26 15:02:42 +02:00
|
|
|
static int SAL_CALL ComponentInfoCompare( const void* pFirst, const void* pSecond)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
return( strcmp( ((ComponentInfo*)pFirst)->pName,
|
|
|
|
((ComponentInfo*)pSecond)->pName ) );
|
|
|
|
}
|
2006-06-19 22:01:53 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2013-09-16 08:58:50 +02:00
|
|
|
sal_uInt16 ImplGetComponentType( const OUString& rServiceName )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2013-08-28 04:53:40 +09:00
|
|
|
static bool bSorted = false;
|
2000-09-18 16:07:07 +00:00
|
|
|
if( !bSorted )
|
|
|
|
{
|
|
|
|
qsort( (void*) aComponentInfos,
|
|
|
|
sizeof( aComponentInfos ) / sizeof( ComponentInfo ),
|
|
|
|
sizeof( ComponentInfo ),
|
|
|
|
ComponentInfoCompare );
|
2013-08-28 04:53:40 +09:00
|
|
|
bSorted = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ComponentInfo aSearch;
|
2013-04-07 12:06:47 +02:00
|
|
|
OString aServiceName(OUStringToOString(rServiceName, osl_getThreadTextEncoding()).toAsciiLowerCase());
|
2012-01-16 15:46:57 -02:00
|
|
|
if ( !aServiceName.isEmpty() )
|
2011-11-27 20:37:42 +00:00
|
|
|
aSearch.pName = aServiceName.getStr();
|
2000-09-18 16:07:07 +00:00
|
|
|
else
|
|
|
|
aSearch.pName = "window";
|
|
|
|
|
|
|
|
ComponentInfo* pInf = (ComponentInfo*) bsearch( &aSearch,
|
|
|
|
(void*) aComponentInfos,
|
|
|
|
sizeof( aComponentInfos ) / sizeof( ComponentInfo ),
|
|
|
|
sizeof( ComponentInfo ),
|
|
|
|
ComponentInfoCompare );
|
|
|
|
|
|
|
|
return pInf ? pInf->nWinType : 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-12-24 08:07:25 +00:00
|
|
|
namespace
|
|
|
|
{
|
|
|
|
struct MessageBoxTypeInfo
|
|
|
|
{
|
|
|
|
css::awt::MessageBoxType eType;
|
|
|
|
const sal_Char *pName;
|
|
|
|
sal_Int32 nLen;
|
|
|
|
};
|
|
|
|
|
2013-07-17 14:58:15 +09:00
|
|
|
static const MessageBoxTypeInfo aMessageBoxTypeInfo[] =
|
2012-12-24 08:07:25 +00:00
|
|
|
{
|
|
|
|
{ css::awt::MessageBoxType_MESSAGEBOX, RTL_CONSTASCII_STRINGPARAM("messbox") },
|
|
|
|
{ css::awt::MessageBoxType_INFOBOX, RTL_CONSTASCII_STRINGPARAM("infobox") },
|
|
|
|
{ css::awt::MessageBoxType_WARNINGBOX, RTL_CONSTASCII_STRINGPARAM("warningbox") },
|
|
|
|
{ css::awt::MessageBoxType_ERRORBOX, RTL_CONSTASCII_STRINGPARAM("errorbox") },
|
|
|
|
{ css::awt::MessageBoxType_QUERYBOX, RTL_CONSTASCII_STRINGPARAM("querybox") },
|
|
|
|
{ css::awt::MessageBoxType_MAKE_FIXED_SIZE, 0, 0 }
|
|
|
|
};
|
|
|
|
|
|
|
|
static bool lcl_convertMessageBoxType(
|
|
|
|
rtl::OUString &sType,
|
|
|
|
css::awt::MessageBoxType eType )
|
|
|
|
{
|
|
|
|
const MessageBoxTypeInfo *pMap = aMessageBoxTypeInfo;
|
|
|
|
css::awt::MessageBoxType eVal = css::awt::MessageBoxType_MAKE_FIXED_SIZE;
|
|
|
|
|
|
|
|
while ( pMap->pName )
|
|
|
|
{
|
|
|
|
if ( pMap->eType == eType )
|
|
|
|
{
|
|
|
|
eVal = eType;
|
|
|
|
sType = rtl::OUString( pMap->pName, pMap->nLen, RTL_TEXTENCODING_ASCII_US );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
pMap++;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ( eVal != css::awt::MessageBoxType_MAKE_FIXED_SIZE );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// ----------------------------------------------------
|
|
|
|
// class VCLXToolkit
|
|
|
|
// ----------------------------------------------------
|
|
|
|
|
2001-08-23 14:16:08 +00:00
|
|
|
static sal_Int32 nVCLToolkitInstanceCount = 0;
|
2013-08-28 04:53:40 +09:00
|
|
|
static bool bInitedByVCLToolkit = false;
|
2001-02-22 17:22:48 +00:00
|
|
|
|
|
|
|
static osl::Mutex & getInitMutex()
|
|
|
|
{
|
|
|
|
static osl::Mutex * pM;
|
|
|
|
if( !pM )
|
|
|
|
{
|
|
|
|
osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() );
|
|
|
|
if( !pM )
|
|
|
|
{
|
|
|
|
static osl::Mutex aMutex;
|
|
|
|
pM = &aMutex;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return *pM;
|
|
|
|
}
|
|
|
|
|
|
|
|
static osl::Condition & getInitCondition()
|
|
|
|
{
|
|
|
|
static osl::Condition * pC = 0;
|
|
|
|
if( !pC )
|
|
|
|
{
|
|
|
|
osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() );
|
|
|
|
if( !pC )
|
|
|
|
{
|
|
|
|
static osl::Condition aCondition;
|
|
|
|
pC = &aCondition;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return *pC;
|
|
|
|
}
|
|
|
|
|
2006-06-19 22:01:53 +00:00
|
|
|
extern "C"
|
|
|
|
{
|
2001-02-22 17:22:48 +00:00
|
|
|
static void SAL_CALL ToolkitWorkerFunction( void* pArgs )
|
|
|
|
{
|
2012-10-31 09:22:53 +01:00
|
|
|
VCLXToolkit * pTk = (VCLXToolkit *)pArgs;
|
|
|
|
bInitedByVCLToolkit = InitVCL();
|
2001-02-22 17:22:48 +00:00
|
|
|
if( bInitedByVCLToolkit )
|
|
|
|
{
|
2012-10-31 09:22:53 +01:00
|
|
|
UnoWrapper* pUnoWrapper = new UnoWrapper( pTk );
|
2001-02-22 17:22:48 +00:00
|
|
|
Application::SetUnoWrapper( pUnoWrapper );
|
|
|
|
}
|
|
|
|
getInitCondition().set();
|
|
|
|
if( bInitedByVCLToolkit )
|
|
|
|
{
|
|
|
|
{
|
2010-10-14 16:43:53 -05:00
|
|
|
SolarMutexGuard aGuard;
|
|
|
|
Application::Execute();
|
2001-02-22 17:22:48 +00:00
|
|
|
}
|
|
|
|
try
|
|
|
|
{
|
2012-10-31 09:22:53 +01:00
|
|
|
pTk->dispose();
|
2001-02-22 17:22:48 +00:00
|
|
|
}
|
|
|
|
catch( com::sun::star::uno::Exception & )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
DeInitVCL();
|
|
|
|
}
|
2001-08-23 14:16:08 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
JoinMainLoopThread();
|
|
|
|
}
|
2001-02-22 17:22:48 +00:00
|
|
|
}
|
2006-06-19 22:01:53 +00:00
|
|
|
}
|
2001-02-22 17:22:48 +00:00
|
|
|
|
|
|
|
// contructor, which might initialize VCL
|
2012-10-31 09:22:53 +01:00
|
|
|
VCLXToolkit::VCLXToolkit():
|
2012-10-17 10:52:52 +02:00
|
|
|
cppu::WeakComponentImplHelper2<
|
2012-10-16 15:45:22 +02:00
|
|
|
::com::sun::star::awt::XToolkitExperimental,
|
2012-10-17 10:52:52 +02:00
|
|
|
::com::sun::star::lang::XServiceInfo>( GetMutex() ),
|
2002-07-11 10:07:56 +00:00
|
|
|
m_aTopWindowListeners(rBHelper.rMutex),
|
|
|
|
m_aKeyHandlers(rBHelper.rMutex),
|
|
|
|
m_aFocusListeners(rBHelper.rMutex),
|
2002-07-22 12:30:00 +00:00
|
|
|
m_aEventListenerLink(LINK(this, VCLXToolkit, eventListenerHandler)),
|
|
|
|
m_aKeyListenerLink(LINK(this, VCLXToolkit, keyListenerHandler)),
|
|
|
|
m_bEventListener(false),
|
|
|
|
m_bKeyListener(false)
|
2001-02-22 17:22:48 +00:00
|
|
|
{
|
2001-03-15 10:44:20 +00:00
|
|
|
hSvToolsLib = NULL;
|
|
|
|
fnSvtCreateWindow = NULL;
|
|
|
|
|
2001-02-22 17:22:48 +00:00
|
|
|
osl::Guard< osl::Mutex > aGuard( getInitMutex() );
|
2001-08-23 14:16:08 +00:00
|
|
|
nVCLToolkitInstanceCount++;
|
|
|
|
if( ( nVCLToolkitInstanceCount == 1 ) && ( !Application::IsInMain() ) )
|
2001-02-22 17:22:48 +00:00
|
|
|
{
|
|
|
|
// setup execute thread
|
2012-10-31 09:22:53 +01:00
|
|
|
CreateMainLoopThread( ToolkitWorkerFunction, this );
|
2001-02-22 17:22:48 +00:00
|
|
|
getInitCondition().wait();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
VCLXToolkit::~VCLXToolkit()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void SAL_CALL VCLXToolkit::disposing()
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2012-10-04 07:08:51 +03:00
|
|
|
#ifndef DISABLE_DYNLOADING
|
2001-03-15 10:44:20 +00:00
|
|
|
if ( hSvToolsLib )
|
|
|
|
{
|
|
|
|
osl_unloadModule( hSvToolsLib );
|
|
|
|
hSvToolsLib = NULL;
|
|
|
|
fnSvtCreateWindow = NULL;
|
|
|
|
}
|
2012-10-04 07:08:51 +03:00
|
|
|
#endif
|
2001-03-15 10:44:20 +00:00
|
|
|
|
2001-02-22 17:22:48 +00:00
|
|
|
{
|
2002-07-11 10:07:56 +00:00
|
|
|
osl::Guard< osl::Mutex > aGuard( getInitMutex() );
|
|
|
|
if( --nVCLToolkitInstanceCount == 0 )
|
2001-02-22 17:22:48 +00:00
|
|
|
{
|
2002-07-11 10:07:56 +00:00
|
|
|
if( bInitedByVCLToolkit )
|
|
|
|
{
|
|
|
|
Application::Quit();
|
|
|
|
JoinMainLoopThread();
|
2013-08-28 04:53:40 +09:00
|
|
|
bInitedByVCLToolkit = false;
|
2002-07-11 10:07:56 +00:00
|
|
|
}
|
2001-02-22 17:22:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-07-22 12:30:00 +00:00
|
|
|
if (m_bEventListener)
|
2002-07-11 10:07:56 +00:00
|
|
|
{
|
2002-07-22 12:30:00 +00:00
|
|
|
::Application::RemoveEventListener(m_aEventListenerLink);
|
|
|
|
m_bEventListener = false;
|
2002-07-11 10:07:56 +00:00
|
|
|
}
|
2002-07-22 12:30:00 +00:00
|
|
|
if (m_bKeyListener)
|
2002-07-11 10:07:56 +00:00
|
|
|
{
|
2002-07-22 12:30:00 +00:00
|
|
|
::Application::RemoveKeyListener(m_aKeyListenerLink);
|
|
|
|
m_bKeyListener = false;
|
2002-07-11 10:07:56 +00:00
|
|
|
}
|
2013-04-02 09:01:37 +02:00
|
|
|
css::lang::EventObject aEvent(
|
2002-07-11 10:07:56 +00:00
|
|
|
static_cast< ::cppu::OWeakObject * >(this));
|
|
|
|
m_aTopWindowListeners.disposeAndClear(aEvent);
|
|
|
|
m_aKeyHandlers.disposeAndClear(aEvent);
|
|
|
|
m_aFocusListeners.disposeAndClear(aEvent);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > VCLXToolkit::getDesktopWindow( ) throw(::com::sun::star::uno::RuntimeException)
|
|
|
|
{
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > xRef;
|
|
|
|
// 07/00: AppWindow doesn't exist anymore...
|
|
|
|
return xRef;
|
|
|
|
}
|
|
|
|
|
|
|
|
::com::sun::star::awt::Rectangle VCLXToolkit::getWorkArea( ) throw(::com::sun::star::uno::RuntimeException)
|
|
|
|
{
|
fdo#66762 - Other: com.sun.star.awt.DisplayAccess removed
API_CHANGE:
I removed the undocumented internal API
"com.sun.star.awt.DisplayAccess"
in commit dde234b6955a421d51d2b37e4fc3972c660146f0
"fdo#46808, remove awt::DisplayAccess service."
However, it appears someone was actually using this.
Now, at the same time, we have a method in XToolkit, getWorkArea(),
which looks like it was designed to return this exact information,
but which has been returning zero for as far back as our commit
history goes.
So, to kill two birds with one stone, this commit changes
getWorkArea() to return the information the customer needs, to wit,
the size and position of the primary display.
Change-Id: I76300bac604e9e4b7be95b0872a7f95cb6781903
Reviewed-on: https://gerrit.libreoffice.org/4919
Reviewed-by: Michael Meeks <michael.meeks@suse.com>
Tested-by: Michael Meeks <michael.meeks@suse.com>
2013-07-15 14:49:01 +02:00
|
|
|
sal_Int32 nDisplay = Application::GetDisplayBuiltInScreen();
|
|
|
|
Rectangle aWorkRect = Application::GetScreenPosSizePixel( nDisplay );
|
|
|
|
com::sun::star::awt::Rectangle aNotherRect;
|
|
|
|
aNotherRect.X = aWorkRect.getX();
|
|
|
|
aNotherRect.Y = aWorkRect.getY();
|
|
|
|
aNotherRect.Width = aWorkRect.getWidth();
|
|
|
|
aNotherRect.Height = aWorkRect.getHeight();
|
|
|
|
return aNotherRect;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > VCLXToolkit::createWindow( const ::com::sun::star::awt::WindowDescriptor& rDescriptor ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
|
|
|
|
{
|
2006-12-01 14:09:13 +00:00
|
|
|
return ImplCreateWindow( rDescriptor, WinBits(0) );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > VCLXToolkit::createScreenCompatibleDevice( sal_Int32 Width, sal_Int32 Height ) throw(::com::sun::star::uno::RuntimeException)
|
2012-06-11 20:02:11 +03:00
|
|
|
{
|
2012-06-18 22:32:35 +03:00
|
|
|
return createScreenCompatibleDeviceUsingBuffer( Width, Height, 1, 1, 0, 0, 0 );
|
2012-06-11 20:02:11 +03:00
|
|
|
}
|
|
|
|
|
2012-06-18 22:32:35 +03:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > VCLXToolkit::createScreenCompatibleDeviceUsingBuffer( sal_Int32 Width, sal_Int32 Height, sal_Int32 ScaleNumerator, sal_Int32 ScaleDenominator, sal_Int32 XOffset, sal_Int32 YOffset, sal_Int64 addressOfMemoryBufferForSharedArrayWrapper ) throw(::com::sun::star::uno::RuntimeException)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
|
|
|
|
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > xRef;
|
|
|
|
VCLXVirtualDevice* pVDev = new VCLXVirtualDevice;
|
2001-04-11 12:55:47 +00:00
|
|
|
|
2010-10-14 16:43:53 -05:00
|
|
|
SolarMutexGuard aSolarGuard;
|
2001-04-11 12:55:47 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
VirtualDevice* pV = new VirtualDevice;
|
2012-06-11 20:02:11 +03:00
|
|
|
if ( addressOfMemoryBufferForSharedArrayWrapper != 0 ) {
|
|
|
|
#if defined(ANDROID)
|
|
|
|
ByteBufferWrapper *bbw = (ByteBufferWrapper *) (intptr_t) addressOfMemoryBufferForSharedArrayWrapper;
|
2012-06-18 22:32:35 +03:00
|
|
|
pV->SetOutputSizePixelScaleOffsetAndBuffer( Size( Width, Height ), Fraction(ScaleNumerator, ScaleDenominator), Point( XOffset, YOffset), basebmp::RawMemorySharedArray( bbw->pointer(), *bbw ));
|
|
|
|
#else
|
2013-01-07 00:35:54 +02:00
|
|
|
pV->SetOutputSizePixelScaleOffsetAndBuffer( Size( Width, Height ), Fraction(ScaleNumerator, ScaleDenominator), Point( XOffset, YOffset), basebmp::RawMemorySharedArray( (sal_uInt8*) (sal_uIntPtr) addressOfMemoryBufferForSharedArrayWrapper ));
|
2012-06-11 20:02:11 +03:00
|
|
|
#endif
|
|
|
|
} else {
|
|
|
|
pV->SetOutputSizePixel( Size( Width, Height ) );
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
pVDev->SetVirtualDevice( pV );
|
|
|
|
|
|
|
|
xRef = pVDev;
|
|
|
|
return xRef;
|
|
|
|
}
|
|
|
|
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion > VCLXToolkit::createRegion( ) throw(::com::sun::star::uno::RuntimeException)
|
|
|
|
{
|
|
|
|
::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
|
|
|
|
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion > xRef = new VCLXRegion;
|
|
|
|
return xRef;
|
|
|
|
}
|
|
|
|
|
2001-03-15 10:44:20 +00:00
|
|
|
Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp,
|
2004-07-05 14:55:06 +00:00
|
|
|
const ::com::sun::star::awt::WindowDescriptor& rDescriptor,
|
|
|
|
Window* pParent, WinBits nWinBits )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2013-09-09 23:35:25 +02:00
|
|
|
OUString aServiceName( rDescriptor.WindowServiceName );
|
|
|
|
aServiceName = aServiceName.toAsciiLowerCase();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
Window* pNewWindow = NULL;
|
|
|
|
sal_uInt16 nType = ImplGetComponentType( aServiceName );
|
2010-11-02 16:55:17 +00:00
|
|
|
bool bFrameControl = false;
|
2013-09-09 23:35:25 +02:00
|
|
|
if ( aServiceName == "frame" )
|
2010-11-02 16:55:17 +00:00
|
|
|
bFrameControl = true;
|
2013-09-09 23:35:25 +02:00
|
|
|
if ( aServiceName == "tabcontrolnotabs" )
|
2010-11-02 16:55:17 +00:00
|
|
|
{
|
|
|
|
nWinBits |= WB_NOBORDER;
|
2013-09-16 08:58:50 +02:00
|
|
|
nType = ImplGetComponentType( OUString( "tabcontrol" ) );
|
2010-11-02 16:55:17 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
if ( !pParent )
|
|
|
|
{
|
|
|
|
// Wenn die Component einen Parent braucht, dann NULL zurueckgeben,
|
|
|
|
// spaeter mal ::com::sun::star::uno::Exception...
|
2013-08-28 04:53:40 +09:00
|
|
|
bool bException = true;
|
2010-05-28 15:23:19 +02:00
|
|
|
if ( ( nType == WINDOW_DIALOG )
|
|
|
|
|| ( nType == WINDOW_MODALDIALOG )
|
|
|
|
|| ( nType == WINDOW_MODELESSDIALOG )
|
|
|
|
|| ( nType == WINDOW_MESSBOX )
|
|
|
|
|| ( nType == WINDOW_INFOBOX )
|
|
|
|
|| ( nType == WINDOW_WARNINGBOX )
|
|
|
|
|| ( nType == WINDOW_ERRORBOX )
|
|
|
|
|| ( nType == WINDOW_QUERYBOX )
|
|
|
|
)
|
2013-08-28 04:53:40 +09:00
|
|
|
bException = false;
|
2000-09-18 16:07:07 +00:00
|
|
|
else if ( ( nType == WINDOW_WINDOW ) ||
|
|
|
|
( nType == WINDOW_WORKWINDOW ) ||
|
|
|
|
( nType == VCLWINDOW_FRAMEWINDOW ) )
|
|
|
|
{
|
|
|
|
if ( rDescriptor.Type == ::com::sun::star::awt::WindowClass_TOP )
|
2013-08-28 04:53:40 +09:00
|
|
|
bException = false;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( bException )
|
|
|
|
{
|
|
|
|
*ppNewComp = NULL;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( nType )
|
|
|
|
{
|
2010-10-14 16:43:53 -05:00
|
|
|
SolarMutexGuard aVclGuard;
|
2000-09-18 16:07:07 +00:00
|
|
|
switch ( (WindowType)nType )
|
|
|
|
{
|
|
|
|
case WINDOW_CANCELBUTTON:
|
|
|
|
pNewWindow = new CancelButton( pParent, nWinBits );
|
|
|
|
*ppNewComp = new VCLXButton;
|
|
|
|
break;
|
|
|
|
case WINDOW_CHECKBOX:
|
|
|
|
pNewWindow = new CheckBox( pParent, nWinBits );
|
|
|
|
*ppNewComp = new VCLXCheckBox;
|
|
|
|
break;
|
|
|
|
case WINDOW_COMBOBOX:
|
2002-07-01 13:11:13 +00:00
|
|
|
pNewWindow = new ComboBox( pParent, nWinBits|WB_AUTOHSCROLL );
|
2013-05-20 12:15:51 +01:00
|
|
|
((ComboBox*)pNewWindow)->EnableAutoSize( false );
|
2000-09-18 16:07:07 +00:00
|
|
|
*ppNewComp = new VCLXComboBox;
|
|
|
|
break;
|
|
|
|
case WINDOW_CURRENCYBOX:
|
|
|
|
pNewWindow = new CurrencyBox( pParent, nWinBits );
|
|
|
|
break;
|
|
|
|
case WINDOW_CURRENCYFIELD:
|
|
|
|
pNewWindow = new CurrencyField( pParent, nWinBits );
|
2010-11-05 10:31:15 +08:00
|
|
|
static_cast<CurrencyField*>(pNewWindow)->EnableEmptyFieldValue( sal_True );
|
2000-09-18 16:07:07 +00:00
|
|
|
*ppNewComp = new VCLXNumericField;
|
|
|
|
((VCLXFormattedSpinField*)*ppNewComp)->SetFormatter( (FormatterBase*)(CurrencyField*)pNewWindow );
|
|
|
|
break;
|
|
|
|
case WINDOW_DATEBOX:
|
|
|
|
pNewWindow = new DateBox( pParent, nWinBits );
|
|
|
|
break;
|
|
|
|
case WINDOW_DATEFIELD:
|
|
|
|
pNewWindow = new DateField( pParent, nWinBits );
|
2010-11-05 10:31:15 +08:00
|
|
|
static_cast<DateField*>(pNewWindow)->EnableEmptyFieldValue( sal_True );
|
2000-09-18 16:07:07 +00:00
|
|
|
*ppNewComp = new VCLXDateField;
|
|
|
|
((VCLXFormattedSpinField*)*ppNewComp)->SetFormatter( (FormatterBase*)(DateField*)pNewWindow );
|
|
|
|
break;
|
2004-11-16 13:08:49 +00:00
|
|
|
case WINDOW_DOCKINGAREA:
|
|
|
|
pNewWindow = new DockingAreaWindow( pParent );
|
|
|
|
break;
|
2007-07-06 13:26:42 +00:00
|
|
|
case WINDOW_MULTILINEEDIT:
|
2000-09-18 16:07:07 +00:00
|
|
|
case WINDOW_EDIT:
|
|
|
|
pNewWindow = new Edit( pParent, nWinBits );
|
|
|
|
*ppNewComp = new VCLXEdit;
|
|
|
|
break;
|
|
|
|
case WINDOW_ERRORBOX:
|
2013-09-16 08:58:50 +02:00
|
|
|
pNewWindow = new ErrorBox( pParent, nWinBits, OUString() );
|
2000-09-18 16:07:07 +00:00
|
|
|
*ppNewComp = new VCLXMessageBox;
|
|
|
|
break;
|
|
|
|
case WINDOW_FIXEDBITMAP:
|
|
|
|
pNewWindow = new FixedBitmap( pParent, nWinBits );
|
|
|
|
break;
|
|
|
|
case WINDOW_FIXEDIMAGE:
|
|
|
|
pNewWindow = new ImageControl( pParent, nWinBits );
|
|
|
|
*ppNewComp = new VCLXImageControl;
|
|
|
|
break;
|
|
|
|
case WINDOW_FIXEDLINE:
|
|
|
|
pNewWindow = new FixedLine( pParent, nWinBits );
|
|
|
|
break;
|
|
|
|
case WINDOW_FIXEDTEXT:
|
|
|
|
pNewWindow = new FixedText( pParent, nWinBits );
|
|
|
|
*ppNewComp = new VCLXFixedText;
|
|
|
|
break;
|
|
|
|
case WINDOW_FLOATINGWINDOW:
|
|
|
|
pNewWindow = new FloatingWindow( pParent, nWinBits );
|
|
|
|
break;
|
|
|
|
case WINDOW_GROUPBOX:
|
2010-11-02 16:55:17 +00:00
|
|
|
{
|
2013-03-18 17:05:51 +01:00
|
|
|
#ifdef SCROLLABLEFRAME
|
2012-09-06 18:36:00 +01:00
|
|
|
if ( bFrameControl )
|
2012-09-07 12:17:31 +01:00
|
|
|
{
|
|
|
|
pNewWindow = new toolkit::ScrollableWrapper< GroupBox >( pParent, nWinBits | WB_VSCROLL );
|
|
|
|
}
|
2012-09-06 18:36:00 +01:00
|
|
|
else
|
2012-09-11 16:03:31 +01:00
|
|
|
#endif
|
2012-09-06 18:36:00 +01:00
|
|
|
pNewWindow = new GroupBox( pParent, nWinBits );
|
2010-11-02 16:55:17 +00:00
|
|
|
if ( bFrameControl )
|
|
|
|
{
|
|
|
|
GroupBox* pGroupBox = static_cast< GroupBox* >( pNewWindow );
|
|
|
|
*ppNewComp = new VCLXFrame;
|
2013-03-03 17:11:39 +01:00
|
|
|
// Frame control needs to receive
|
2010-11-02 16:55:17 +00:00
|
|
|
// Mouse events
|
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
|
|
|
pGroupBox->SetMouseTransparent( sal_False );
|
2010-11-02 16:55:17 +00:00
|
|
|
}
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
break;
|
|
|
|
case WINDOW_HELPBUTTON:
|
|
|
|
pNewWindow = new HelpButton( pParent, nWinBits );
|
|
|
|
*ppNewComp = new VCLXButton;
|
|
|
|
break;
|
|
|
|
case WINDOW_IMAGEBUTTON:
|
|
|
|
pNewWindow = new ImageButton( pParent, nWinBits );
|
|
|
|
*ppNewComp = new VCLXButton;
|
|
|
|
break;
|
|
|
|
case WINDOW_INFOBOX:
|
2013-09-16 08:58:50 +02:00
|
|
|
pNewWindow = new InfoBox( pParent, OUString() );
|
2000-09-18 16:07:07 +00:00
|
|
|
*ppNewComp = new VCLXMessageBox;
|
|
|
|
break;
|
|
|
|
case WINDOW_LISTBOX:
|
2002-07-01 13:11:13 +00:00
|
|
|
pNewWindow = new ListBox( pParent, nWinBits|WB_SIMPLEMODE|WB_AUTOHSCROLL );
|
2013-05-20 12:15:51 +01:00
|
|
|
((ListBox*)pNewWindow)->EnableAutoSize( false );
|
2000-09-18 16:07:07 +00:00
|
|
|
*ppNewComp = new VCLXListBox;
|
|
|
|
break;
|
|
|
|
case WINDOW_LONGCURRENCYBOX:
|
|
|
|
pNewWindow = new LongCurrencyBox( pParent, nWinBits );
|
|
|
|
break;
|
|
|
|
case WINDOW_LONGCURRENCYFIELD:
|
|
|
|
pNewWindow = new LongCurrencyField( pParent, nWinBits );
|
|
|
|
*ppNewComp = new VCLXCurrencyField;
|
|
|
|
((VCLXFormattedSpinField*)*ppNewComp)->SetFormatter( (FormatterBase*)(LongCurrencyField*)pNewWindow );
|
|
|
|
break;
|
|
|
|
case WINDOW_MENUBUTTON:
|
|
|
|
pNewWindow = new MenuButton( pParent, nWinBits );
|
|
|
|
*ppNewComp = new VCLXButton;
|
|
|
|
break;
|
|
|
|
case WINDOW_MESSBOX:
|
2013-09-16 08:58:50 +02:00
|
|
|
pNewWindow = new MessBox( pParent, nWinBits, OUString(), OUString() );
|
2000-09-18 16:07:07 +00:00
|
|
|
*ppNewComp = new VCLXMessageBox;
|
|
|
|
break;
|
|
|
|
case WINDOW_METRICBOX:
|
|
|
|
pNewWindow = new MetricBox( pParent, nWinBits );
|
|
|
|
break;
|
|
|
|
case WINDOW_METRICFIELD:
|
|
|
|
pNewWindow = new MetricField( pParent, nWinBits );
|
2008-01-14 11:56:48 +00:00
|
|
|
*ppNewComp = new VCLXMetricField;
|
|
|
|
((VCLXFormattedSpinField*)*ppNewComp)->SetFormatter( (FormatterBase*)(MetricField*)pNewWindow );
|
2000-09-18 16:07:07 +00:00
|
|
|
break;
|
2001-07-27 08:31:30 +00:00
|
|
|
case WINDOW_DIALOG:
|
2000-09-18 16:07:07 +00:00
|
|
|
case WINDOW_MODALDIALOG:
|
|
|
|
case WINDOW_MODELESSDIALOG:
|
2007-06-20 09:25:08 +00:00
|
|
|
{
|
2000-09-18 16:07:07 +00:00
|
|
|
// Modal/Modeless nur durch Show/Execute
|
2007-07-06 13:26:42 +00:00
|
|
|
if ( (pParent == NULL ) && ( rDescriptor.ParentIndex == -1 ) )
|
|
|
|
pParent = DIALOG_NO_PARENT;
|
2012-09-06 19:25:12 +01:00
|
|
|
pNewWindow = new toolkit::ScrollableWrapper<Dialog>( pParent, nWinBits );
|
2011-02-28 10:00:23 +01:00
|
|
|
// #i70217# Don't always create a new component object. It's possible that VCL has called
|
|
|
|
// GetComponentInterface( sal_True ) in the Dialog ctor itself (see Window::IsTopWindow() )
|
|
|
|
// which creates a component object.
|
|
|
|
css::uno::Reference< css::awt::XWindowPeer > xWinPeer = pNewWindow->GetComponentInterface( sal_False );
|
|
|
|
if ( xWinPeer.is() )
|
|
|
|
*ppNewComp = dynamic_cast< VCLXDialog* >( xWinPeer.get() );
|
|
|
|
else
|
|
|
|
*ppNewComp = new VCLXDialog;
|
2007-06-20 09:25:08 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
break;
|
|
|
|
case WINDOW_MOREBUTTON:
|
|
|
|
pNewWindow = new MoreButton( pParent, nWinBits );
|
|
|
|
*ppNewComp = new VCLXButton;
|
|
|
|
break;
|
|
|
|
case WINDOW_MULTILISTBOX:
|
|
|
|
pNewWindow = new MultiListBox( pParent, nWinBits );
|
|
|
|
*ppNewComp = new VCLXListBox;
|
|
|
|
break;
|
|
|
|
case WINDOW_NUMERICBOX:
|
|
|
|
pNewWindow = new NumericBox( pParent, nWinBits );
|
|
|
|
break;
|
|
|
|
case WINDOW_NUMERICFIELD:
|
|
|
|
pNewWindow = new NumericField( pParent, nWinBits );
|
2010-11-05 10:31:15 +08:00
|
|
|
static_cast<NumericField*>(pNewWindow)->EnableEmptyFieldValue( sal_True );
|
2000-09-18 16:07:07 +00:00
|
|
|
*ppNewComp = new VCLXNumericField;
|
|
|
|
((VCLXFormattedSpinField*)*ppNewComp)->SetFormatter( (FormatterBase*)(NumericField*)pNewWindow );
|
|
|
|
break;
|
|
|
|
case WINDOW_OKBUTTON:
|
|
|
|
pNewWindow = new OKButton( pParent, nWinBits );
|
|
|
|
*ppNewComp = new VCLXButton;
|
|
|
|
break;
|
|
|
|
case WINDOW_PATTERNBOX:
|
|
|
|
pNewWindow = new PatternBox( pParent, nWinBits );
|
|
|
|
break;
|
|
|
|
case WINDOW_PATTERNFIELD:
|
|
|
|
pNewWindow = new PatternField( pParent, nWinBits );
|
|
|
|
*ppNewComp = new VCLXPatternField;
|
|
|
|
((VCLXFormattedSpinField*)*ppNewComp)->SetFormatter( (FormatterBase*)(PatternField*)pNewWindow );
|
|
|
|
break;
|
|
|
|
case WINDOW_PUSHBUTTON:
|
|
|
|
pNewWindow = new PushButton( pParent, nWinBits );
|
|
|
|
*ppNewComp = new VCLXButton;
|
|
|
|
break;
|
|
|
|
case WINDOW_QUERYBOX:
|
2013-09-16 08:58:50 +02:00
|
|
|
pNewWindow = new QueryBox( pParent, nWinBits, OUString() );
|
2000-09-18 16:07:07 +00:00
|
|
|
*ppNewComp = new VCLXMessageBox;
|
|
|
|
break;
|
|
|
|
case WINDOW_RADIOBUTTON:
|
|
|
|
pNewWindow = new RadioButton( pParent, nWinBits );
|
|
|
|
*ppNewComp = new VCLXRadioButton;
|
2001-08-07 10:15:51 +00:00
|
|
|
|
|
|
|
// by default, disable RadioCheck
|
|
|
|
// Since the VCLXRadioButton really cares for it's RadioCheck settings, this is important:
|
|
|
|
// if we enable it, the VCLXRadioButton will use RadioButton::Check instead of RadioButton::SetState
|
|
|
|
// This leads to a strange behaviour if the control is newly created: when settings the initial
|
2010-11-05 10:31:15 +08:00
|
|
|
// state to "checked", the RadioButton::Check (called because RadioCheck=sal_True) will uncheck
|
2001-08-07 10:15:51 +00:00
|
|
|
// _all_other_ radio buttons in the same group. However, at this moment the grouping of the controls
|
|
|
|
// is not really valid: the controls are grouped after they have been created, but we're still in
|
|
|
|
// the creation process, so the RadioButton::Check relies on invalid grouping information.
|
|
|
|
// 07.08.2001 - #87254# - frank.schoenheit@sun.com
|
2010-11-05 10:31:15 +08:00
|
|
|
static_cast<RadioButton*>(pNewWindow)->EnableRadioCheck( sal_False );
|
2000-09-18 16:07:07 +00:00
|
|
|
break;
|
|
|
|
case WINDOW_SCROLLBAR:
|
|
|
|
pNewWindow = new ScrollBar( pParent, nWinBits );
|
|
|
|
*ppNewComp = new VCLXScrollBar;
|
|
|
|
break;
|
|
|
|
case WINDOW_SCROLLBARBOX:
|
|
|
|
pNewWindow = new ScrollBarBox( pParent, nWinBits );
|
|
|
|
break;
|
|
|
|
case WINDOW_SPINBUTTON:
|
|
|
|
pNewWindow = new SpinButton( pParent, nWinBits );
|
2003-12-11 10:56:46 +00:00
|
|
|
*ppNewComp = new ::toolkit::VCLXSpinButton;
|
2000-09-18 16:07:07 +00:00
|
|
|
break;
|
|
|
|
case WINDOW_SPINFIELD:
|
|
|
|
pNewWindow = new SpinField( pParent, nWinBits );
|
|
|
|
*ppNewComp = new VCLXNumericField;
|
|
|
|
break;
|
|
|
|
case WINDOW_SPLITTER:
|
|
|
|
pNewWindow = new Splitter( pParent, nWinBits );
|
|
|
|
break;
|
|
|
|
case WINDOW_SPLITWINDOW:
|
|
|
|
pNewWindow = new SplitWindow( pParent, nWinBits );
|
|
|
|
break;
|
|
|
|
case WINDOW_STATUSBAR:
|
|
|
|
pNewWindow = new StatusBar( pParent, nWinBits );
|
|
|
|
break;
|
|
|
|
case VCLWINDOW_SYSTEMCHILDWINDOW:
|
|
|
|
pNewWindow = new SystemChildWindow( pParent, nWinBits );
|
|
|
|
*ppNewComp = new VCLXSystemDependentWindow();
|
|
|
|
break;
|
|
|
|
case WINDOW_TABCONTROL:
|
|
|
|
pNewWindow = new TabControl( pParent, nWinBits );
|
2010-11-02 16:55:17 +00:00
|
|
|
*ppNewComp = new VCLXMultiPage;
|
2000-09-18 16:07:07 +00:00
|
|
|
break;
|
|
|
|
case WINDOW_TABDIALOG:
|
|
|
|
pNewWindow = new TabDialog( pParent, nWinBits );
|
|
|
|
break;
|
|
|
|
case WINDOW_TABPAGE:
|
2010-08-12 17:36:53 +02:00
|
|
|
{
|
|
|
|
pNewWindow = new TabPage( pParent, nWinBits );
|
|
|
|
*ppNewComp = new VCLXTabPage;
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
break;
|
|
|
|
case WINDOW_TIMEBOX:
|
|
|
|
pNewWindow = new TimeBox( pParent, nWinBits );
|
|
|
|
break;
|
|
|
|
case WINDOW_TIMEFIELD:
|
|
|
|
pNewWindow = new TimeField( pParent, nWinBits );
|
2010-11-05 10:31:15 +08:00
|
|
|
static_cast<TimeField*>(pNewWindow)->EnableEmptyFieldValue( sal_True );
|
2000-09-18 16:07:07 +00:00
|
|
|
*ppNewComp = new VCLXTimeField;
|
|
|
|
((VCLXFormattedSpinField*)*ppNewComp)->SetFormatter( (FormatterBase*)(TimeField*)pNewWindow );
|
|
|
|
break;
|
|
|
|
case WINDOW_TOOLBOX:
|
|
|
|
pNewWindow = new ToolBox( pParent, nWinBits );
|
2002-05-30 12:16:56 +00:00
|
|
|
*ppNewComp = new VCLXToolBox;
|
2000-09-18 16:07:07 +00:00
|
|
|
break;
|
|
|
|
case WINDOW_TRISTATEBOX:
|
|
|
|
pNewWindow = new TriStateBox( pParent, nWinBits );
|
|
|
|
break;
|
|
|
|
case WINDOW_WARNINGBOX:
|
2013-09-16 08:58:50 +02:00
|
|
|
pNewWindow = new WarningBox( pParent, nWinBits, OUString() );
|
2000-09-18 16:07:07 +00:00
|
|
|
*ppNewComp = new VCLXMessageBox;
|
|
|
|
break;
|
|
|
|
case WINDOW_WORKWINDOW:
|
|
|
|
case WINDOW_WINDOW:
|
|
|
|
case VCLWINDOW_FRAMEWINDOW:
|
|
|
|
case WINDOW_DOCKINGWINDOW:
|
|
|
|
if ( rDescriptor.Type == ::com::sun::star::awt::WindowClass_TOP )
|
|
|
|
{
|
|
|
|
if (nType == WINDOW_DOCKINGWINDOW )
|
|
|
|
pNewWindow = new DockingWindow( pParent, nWinBits );
|
|
|
|
else
|
2001-02-05 08:33:16 +00:00
|
|
|
{
|
|
|
|
if ((pParent == NULL) && rDescriptor.Parent.is())
|
|
|
|
{
|
|
|
|
// try to get a system dependent window handle
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::awt::XSystemDependentWindowPeer > xSystemDepParent(rDescriptor.Parent, ::com::sun::star::uno::UNO_QUERY);
|
|
|
|
|
|
|
|
if (xSystemDepParent.is())
|
|
|
|
{
|
|
|
|
sal_Int8 processID[16];
|
|
|
|
|
|
|
|
rtl_getGlobalProcessId( (sal_uInt8*)processID );
|
|
|
|
|
2013-02-18 20:35:25 -06:00
|
|
|
::com::sun::star::uno::Sequence<sal_Int8> processIdSeq((sal_Int8*)processID, 16);
|
2001-02-05 08:33:16 +00:00
|
|
|
|
|
|
|
::com::sun::star::uno::Any anyHandle = xSystemDepParent->getWindowHandle(processIdSeq, SYSTEM_DEPENDENT_TYPE);
|
|
|
|
|
2013-03-03 17:11:39 +01:00
|
|
|
// use sal_Int64 here to accommodate all int types
|
2007-12-07 10:59:06 +00:00
|
|
|
// uno::Any shift operator whill upcast if necessary
|
|
|
|
sal_Int64 nWindowHandle = 0;
|
|
|
|
sal_Bool bXEmbed = sal_False;
|
2007-11-27 10:57:07 +00:00
|
|
|
|
2007-12-07 10:59:06 +00:00
|
|
|
bool bUseParentData = true;
|
|
|
|
if( ! (anyHandle >>= nWindowHandle) )
|
2007-07-06 13:26:42 +00:00
|
|
|
{
|
2007-12-07 10:59:06 +00:00
|
|
|
css::uno::Sequence< css::beans::NamedValue > aProps;
|
|
|
|
if( anyHandle >>= aProps )
|
|
|
|
{
|
|
|
|
const int nProps = aProps.getLength();
|
|
|
|
const css::beans::NamedValue* pProps = aProps.getConstArray();
|
|
|
|
for( int i = 0; i < nProps; i++ )
|
|
|
|
{
|
2012-04-06 14:28:18 +02:00
|
|
|
if ( pProps[i].Name == "WINDOW" )
|
2007-12-07 10:59:06 +00:00
|
|
|
pProps[i].Value >>= nWindowHandle;
|
2012-04-06 14:28:18 +02:00
|
|
|
else if ( pProps[i].Name == "XEMBED" )
|
2007-12-07 10:59:06 +00:00
|
|
|
pProps[i].Value >>= bXEmbed;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
bUseParentData = false;
|
2007-07-06 13:26:42 +00:00
|
|
|
}
|
2007-11-27 10:57:07 +00:00
|
|
|
|
2007-12-07 10:59:06 +00:00
|
|
|
if( bUseParentData )
|
2007-11-27 10:57:07 +00:00
|
|
|
{
|
|
|
|
SystemParentData aParentData;
|
|
|
|
aParentData.nSize = sizeof( aParentData );
|
2013-01-11 11:07:23 +02:00
|
|
|
#if defined MACOSX
|
2007-12-07 10:59:06 +00:00
|
|
|
aParentData.pView = reinterpret_cast<NSView*>(nWindowHandle);
|
2013-03-27 02:11:39 +02:00
|
|
|
#elif defined ANDROID
|
|
|
|
// Nothing
|
2013-03-27 00:38:36 +02:00
|
|
|
#elif defined IOS
|
|
|
|
// Nothing
|
2007-12-07 10:59:06 +00:00
|
|
|
#elif defined UNX
|
|
|
|
aParentData.aWindow = nWindowHandle;
|
|
|
|
aParentData.bXEmbedSupport = bXEmbed;
|
2008-07-22 15:40:29 +00:00
|
|
|
#elif defined WNT
|
2007-12-07 10:59:06 +00:00
|
|
|
aParentData.hWnd = reinterpret_cast<HWND>(nWindowHandle);
|
|
|
|
#endif
|
2007-11-27 10:57:07 +00:00
|
|
|
pNewWindow = new WorkWindow( &aParentData );
|
|
|
|
}
|
2001-02-05 08:33:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!pNewWindow)
|
|
|
|
pNewWindow = new WorkWindow( pParent, nWinBits );
|
|
|
|
}
|
2005-07-20 11:22:20 +00:00
|
|
|
|
|
|
|
*ppNewComp = new VCLXTopWindow( pNewWindow->GetType() == WINDOW_WORKWINDOW );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else if ( rDescriptor.Type == ::com::sun::star::awt::WindowClass_CONTAINER )
|
|
|
|
{
|
|
|
|
if (nType == WINDOW_DOCKINGWINDOW )
|
|
|
|
pNewWindow = new DockingWindow( pParent, nWinBits );
|
|
|
|
else
|
|
|
|
pNewWindow = new Window( pParent, nWinBits );
|
|
|
|
*ppNewComp = new VCLXContainer;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (nType == WINDOW_DOCKINGWINDOW )
|
|
|
|
pNewWindow = new DockingWindow( pParent, nWinBits );
|
|
|
|
else
|
|
|
|
pNewWindow = new Window( pParent, nWinBits );
|
|
|
|
*ppNewComp = new VCLXWindow;
|
|
|
|
}
|
|
|
|
break;
|
2006-12-20 12:52:30 +00:00
|
|
|
case WINDOW_CONTROL:
|
2012-12-20 03:56:35 +00:00
|
|
|
if ( rDescriptor.WindowServiceName.equalsIgnoreAsciiCase(
|
2013-03-19 11:32:06 +01:00
|
|
|
"tabpagecontainer" ) )
|
2010-08-12 17:36:53 +02:00
|
|
|
{
|
2010-08-27 12:13:59 +02:00
|
|
|
pNewWindow = new TabControl( pParent, nWinBits );
|
2010-08-12 17:36:53 +02:00
|
|
|
*ppNewComp = new VCLXTabPageContainer;
|
|
|
|
}
|
2013-09-09 23:35:25 +02:00
|
|
|
else if ( aServiceName == "animatedimages" )
|
2010-10-06 14:21:47 +02:00
|
|
|
{
|
2010-10-07 13:22:07 +02:00
|
|
|
pNewWindow = new Throbber( pParent, nWinBits );
|
2010-10-06 14:21:47 +02:00
|
|
|
*ppNewComp = new ::toolkit::AnimatedImagesPeer;
|
|
|
|
}
|
2006-12-20 12:52:30 +00:00
|
|
|
break;
|
2010-10-06 14:21:47 +02:00
|
|
|
default:
|
|
|
|
OSL_ENSURE( false, "VCLXToolkit::ImplCreateWindow: unknown window type!" );
|
|
|
|
break;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return pNewWindow;
|
|
|
|
}
|
|
|
|
|
2012-10-04 07:08:51 +03:00
|
|
|
#ifndef DISABLE_DYNLOADING
|
|
|
|
|
2007-12-07 10:59:06 +00:00
|
|
|
extern "C" { static void SAL_CALL thisModule() {} }
|
|
|
|
|
2012-10-04 07:08:51 +03:00
|
|
|
#else
|
|
|
|
|
|
|
|
extern "C" Window* SAL_CALL CreateWindow( VCLXWindow** ppNewComp, const ::com::sun::star::awt::WindowDescriptor* pDescriptor, Window* pParent, WinBits nWinBits );
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2006-12-01 14:09:13 +00:00
|
|
|
css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::ImplCreateWindow(
|
|
|
|
const css::awt::WindowDescriptor& rDescriptor,
|
|
|
|
WinBits nForceWinBits )
|
|
|
|
{
|
|
|
|
::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
|
|
|
|
|
2010-10-14 16:43:53 -05:00
|
|
|
SolarMutexGuard aSolarGuard;
|
2006-12-01 14:09:13 +00:00
|
|
|
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > xRef;
|
|
|
|
|
|
|
|
Window* pParent = NULL;
|
|
|
|
if ( rDescriptor.Parent.is() )
|
|
|
|
{
|
|
|
|
VCLXWindow* pParentComponent = VCLXWindow::GetImplementation( rDescriptor.Parent );
|
|
|
|
|
2011-06-16 21:36:00 +01:00
|
|
|
// #103939# Don't throw assertion, may be it's a system dependend window, used in ImplCreateWindow.
|
2006-12-01 14:09:13 +00:00
|
|
|
// DBG_ASSERT( pParentComponent, "ParentComponent not valid" );
|
|
|
|
|
|
|
|
if ( pParentComponent )
|
|
|
|
pParent = pParentComponent->GetWindow();
|
|
|
|
}
|
|
|
|
WinBits nWinBits = ImplGetWinBits( rDescriptor.WindowAttributes,
|
|
|
|
ImplGetComponentType( rDescriptor.WindowServiceName ) );
|
|
|
|
nWinBits |= nForceWinBits;
|
|
|
|
|
|
|
|
VCLXWindow* pNewComp = NULL;
|
|
|
|
|
|
|
|
Window* pNewWindow = NULL;
|
|
|
|
// Try to create the window with SvTools
|
|
|
|
// (do this _before_ creating it on our own: The old mechanism (extended toolkit in SvTools) did it this way,
|
|
|
|
// and we need to stay compatible)
|
|
|
|
// try to load the lib
|
2012-10-04 07:08:51 +03:00
|
|
|
if ( !fnSvtCreateWindow
|
|
|
|
#ifndef DISABLE_DYNLOADING
|
|
|
|
&& !hSvToolsLib
|
|
|
|
#endif
|
|
|
|
)
|
2006-12-01 14:09:13 +00:00
|
|
|
{
|
2012-10-04 07:08:51 +03:00
|
|
|
#ifndef DISABLE_DYNLOADING
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString aLibName = ::vcl::unohelper::CreateLibraryName(
|
2012-02-24 15:06:52 +00:00
|
|
|
#ifdef LIBO_MERGELIBS
|
|
|
|
"merged",
|
|
|
|
#else
|
|
|
|
"svt",
|
|
|
|
#endif
|
|
|
|
sal_True );
|
2007-12-07 10:59:06 +00:00
|
|
|
hSvToolsLib = osl_loadModuleRelative(
|
|
|
|
&thisModule, aLibName.pData, SAL_LOADMODULE_DEFAULT );
|
2006-12-01 14:09:13 +00:00
|
|
|
if ( hSvToolsLib )
|
|
|
|
{
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString aFunctionName( "CreateWindow" );
|
2006-12-01 14:09:13 +00:00
|
|
|
fnSvtCreateWindow = (FN_SvtCreateWindow)osl_getFunctionSymbol( hSvToolsLib, aFunctionName.pData );
|
|
|
|
}
|
2012-10-04 07:08:51 +03:00
|
|
|
#else
|
|
|
|
fnSvtCreateWindow = CreateWindow;
|
|
|
|
#endif
|
2006-12-01 14:09:13 +00:00
|
|
|
}
|
|
|
|
// ask the SvTool creation function
|
|
|
|
if ( fnSvtCreateWindow )
|
|
|
|
pNewWindow = fnSvtCreateWindow( &pNewComp, &rDescriptor, pParent, nWinBits );
|
|
|
|
|
|
|
|
// if SvTools could not provide a window, create it ourself
|
|
|
|
if ( !pNewWindow )
|
|
|
|
pNewWindow = ImplCreateWindow( &pNewComp, rDescriptor, pParent, nWinBits );
|
|
|
|
|
|
|
|
DBG_ASSERT( pNewWindow, "createWindow: Unknown Component!" );
|
|
|
|
DBG_ASSERTWARNING( pNewComp, "createWindow: No special Interface!" );
|
|
|
|
|
|
|
|
if ( pNewWindow )
|
|
|
|
{
|
|
|
|
pNewWindow->SetCreatedWithToolkit( sal_True );
|
|
|
|
//pNewWindow->SetPosPixel( Point() ); // do not force (0,0) position, keep default pos instead
|
|
|
|
|
|
|
|
if ( rDescriptor.WindowAttributes & ::com::sun::star::awt::WindowAttribute::MINSIZE )
|
|
|
|
{
|
|
|
|
pNewWindow->SetSizePixel( Size() );
|
|
|
|
}
|
|
|
|
else if ( rDescriptor.WindowAttributes & ::com::sun::star::awt::WindowAttribute::FULLSIZE )
|
|
|
|
{
|
|
|
|
if ( pParent )
|
|
|
|
pNewWindow->SetSizePixel( pParent->GetOutputSizePixel() );
|
|
|
|
}
|
|
|
|
else if ( !VCLUnoHelper::IsZero( rDescriptor.Bounds ) )
|
|
|
|
{
|
|
|
|
Rectangle aRect = VCLRectangle( rDescriptor.Bounds );
|
|
|
|
pNewWindow->SetPosSizePixel( aRect.TopLeft(), aRect.GetSize() );
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( !pNewComp )
|
|
|
|
{
|
|
|
|
// Default-Interface
|
|
|
|
xRef = pNewWindow->GetComponentInterface( sal_True );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-11-05 10:31:15 +08:00
|
|
|
pNewComp->SetCreatedWithToolkit( sal_True );
|
2006-12-01 14:09:13 +00:00
|
|
|
xRef = pNewComp;
|
|
|
|
pNewWindow->SetComponentInterface( xRef );
|
|
|
|
}
|
2010-11-05 10:31:15 +08:00
|
|
|
DBG_ASSERT( pNewWindow->GetComponentInterface( sal_False ) == xRef,
|
2006-12-01 14:09:13 +00:00
|
|
|
"VCLXToolkit::createWindow: did #133706# resurge?" );
|
|
|
|
|
|
|
|
if ( rDescriptor.WindowAttributes & ::com::sun::star::awt::WindowAttribute::SHOW )
|
|
|
|
pNewWindow->Show();
|
|
|
|
}
|
|
|
|
|
|
|
|
return xRef;
|
|
|
|
}
|
|
|
|
|
|
|
|
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > > VCLXToolkit::createWindows( const ::com::sun::star::uno::Sequence< ::com::sun::star::awt::WindowDescriptor >& rDescriptors ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
|
|
|
|
{
|
|
|
|
::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
|
|
|
|
|
|
|
|
sal_uInt32 nComponents = rDescriptors.getLength();
|
|
|
|
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > > aSeq( nComponents );
|
|
|
|
for ( sal_uInt32 n = 0; n < nComponents; n++ )
|
|
|
|
{
|
|
|
|
::com::sun::star::awt::WindowDescriptor aDescr = rDescriptors.getConstArray()[n];
|
|
|
|
|
|
|
|
if ( aDescr.ParentIndex == (-1) )
|
|
|
|
aDescr.Parent = NULL;
|
|
|
|
else if ( ( aDescr.ParentIndex >= 0 ) && ( aDescr.ParentIndex < (short)n ) )
|
|
|
|
aDescr.Parent = aSeq.getConstArray()[aDescr.ParentIndex];
|
|
|
|
aSeq.getArray()[n] = createWindow( aDescr );
|
|
|
|
}
|
|
|
|
return aSeq;
|
|
|
|
}
|
|
|
|
|
2001-03-16 13:45:13 +00:00
|
|
|
// ::com::sun::star::awt::XSystemChildFactory
|
2006-06-19 22:01:53 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > VCLXToolkit::createSystemChild( const ::com::sun::star::uno::Any& Parent, const ::com::sun::star::uno::Sequence< sal_Int8 >& /*ProcessId*/, sal_Int16 nSystemType ) throw(::com::sun::star::uno::RuntimeException)
|
2001-03-16 13:45:13 +00:00
|
|
|
{
|
|
|
|
Window* pChildWindow = NULL;
|
|
|
|
if ( nSystemType == SYSTEM_DEPENDENT_TYPE )
|
|
|
|
{
|
2013-03-03 17:11:39 +01:00
|
|
|
// use sal_Int64 here to accommodate all int types
|
2007-12-07 10:59:06 +00:00
|
|
|
// uno::Any shift operator whill upcast if necessary
|
|
|
|
sal_Int64 nWindowHandle = 0;
|
|
|
|
sal_Bool bXEmbed = sal_False;
|
|
|
|
|
|
|
|
bool bUseParentData = true;
|
|
|
|
if( ! (Parent >>= nWindowHandle) )
|
|
|
|
{
|
|
|
|
css::uno::Sequence< css::beans::NamedValue > aProps;
|
|
|
|
if( Parent >>= aProps )
|
2001-03-16 13:45:13 +00:00
|
|
|
{
|
2007-12-07 10:59:06 +00:00
|
|
|
const int nProps = aProps.getLength();
|
|
|
|
const css::beans::NamedValue* pProps = aProps.getConstArray();
|
|
|
|
for( int i = 0; i < nProps; i++ )
|
2007-11-27 10:57:07 +00:00
|
|
|
{
|
2012-04-06 14:28:18 +02:00
|
|
|
if ( pProps[i].Name == "WINDOW" )
|
2007-12-07 10:59:06 +00:00
|
|
|
pProps[i].Value >>= nWindowHandle;
|
2012-04-06 14:28:18 +02:00
|
|
|
else if ( pProps[i].Name == "XEMBED" )
|
2007-12-07 10:59:06 +00:00
|
|
|
pProps[i].Value >>= bXEmbed;
|
2005-01-31 12:10:04 +00:00
|
|
|
}
|
2001-03-16 13:45:13 +00:00
|
|
|
}
|
2007-12-07 10:59:06 +00:00
|
|
|
else
|
|
|
|
bUseParentData = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( bUseParentData )
|
|
|
|
{
|
|
|
|
SystemParentData aParentData;
|
|
|
|
aParentData.nSize = sizeof( aParentData );
|
2013-01-11 11:07:23 +02:00
|
|
|
#if defined MACOSX
|
2007-12-10 08:46:08 +00:00
|
|
|
aParentData.pView = reinterpret_cast<NSView*>(nWindowHandle);
|
2013-03-27 02:11:39 +02:00
|
|
|
#elif defined ANDROID
|
|
|
|
// Nothing
|
2013-03-27 00:38:36 +02:00
|
|
|
#elif defined IOS
|
|
|
|
// Nothing
|
2007-12-07 10:59:06 +00:00
|
|
|
#elif defined UNX
|
|
|
|
aParentData.aWindow = nWindowHandle;
|
|
|
|
aParentData.bXEmbedSupport = bXEmbed;
|
2008-07-22 15:40:29 +00:00
|
|
|
#elif defined WNT
|
2007-12-07 10:59:06 +00:00
|
|
|
aParentData.hWnd = reinterpret_cast<HWND>(nWindowHandle);
|
|
|
|
#endif
|
2010-10-14 16:43:53 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2007-12-07 10:59:06 +00:00
|
|
|
try
|
2001-03-16 13:45:13 +00:00
|
|
|
{
|
2007-12-07 10:59:06 +00:00
|
|
|
pChildWindow = new WorkWindow( &aParentData );
|
2007-07-05 07:03:46 +00:00
|
|
|
}
|
2012-01-07 15:50:41 +09:00
|
|
|
catch ( const ::com::sun::star::uno::RuntimeException & rEx )
|
2007-07-05 07:03:46 +00:00
|
|
|
{
|
2007-12-07 10:59:06 +00:00
|
|
|
// system child window could not be created
|
|
|
|
OSL_TRACE(
|
|
|
|
"VCLXToolkit::createSystemChild: caught %s\n",
|
2013-04-07 12:06:47 +02:00
|
|
|
OUStringToOString(
|
2007-12-07 10:59:06 +00:00
|
|
|
rEx.Message, RTL_TEXTENCODING_UTF8).getStr());
|
|
|
|
pChildWindow = NULL;
|
2001-03-16 13:45:13 +00:00
|
|
|
}
|
2007-12-07 10:59:06 +00:00
|
|
|
}
|
2001-03-16 13:45:13 +00:00
|
|
|
}
|
2002-04-09 07:28:42 +00:00
|
|
|
else if (nSystemType == com::sun::star::lang::SystemDependent::SYSTEM_JAVA)
|
|
|
|
{
|
2010-10-14 16:43:53 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2002-04-09 07:28:42 +00:00
|
|
|
pChildWindow = new WorkWindow(0, Parent);
|
|
|
|
}
|
2001-03-16 13:45:13 +00:00
|
|
|
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > xPeer;
|
|
|
|
if ( pChildWindow )
|
|
|
|
{
|
2004-02-25 16:57:58 +00:00
|
|
|
VCLXTopWindow* pPeer = new VCLXTopWindow(true);
|
2010-10-14 16:43:53 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2001-03-16 13:45:13 +00:00
|
|
|
pPeer->SetWindow( pChildWindow );
|
|
|
|
xPeer = pPeer;
|
|
|
|
}
|
|
|
|
|
|
|
|
return xPeer;
|
|
|
|
}
|
|
|
|
|
2006-12-01 14:09:13 +00:00
|
|
|
// ::com::sun::star::awt::XMessageBoxFactory
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::awt::XMessageBox > SAL_CALL VCLXToolkit::createMessageBox(
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& aParent,
|
2012-12-24 08:07:25 +00:00
|
|
|
::com::sun::star::awt::MessageBoxType eType,
|
2006-12-01 14:09:13 +00:00
|
|
|
::sal_Int32 aButtons,
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString& aTitle,
|
|
|
|
const OUString& aMessage ) throw (::com::sun::star::uno::RuntimeException)
|
2006-12-01 14:09:13 +00:00
|
|
|
{
|
|
|
|
::com::sun::star::awt::WindowDescriptor aDescriptor;
|
|
|
|
|
|
|
|
sal_Int32 nWindowAttributes = css::awt::WindowAttribute::BORDER|css::awt::WindowAttribute::MOVEABLE|css::awt::WindowAttribute::CLOSEABLE;
|
|
|
|
|
|
|
|
// Map button definitions to window attributes
|
|
|
|
if (( aButtons & 0x0000ffffL ) == css::awt::MessageBoxButtons::BUTTONS_OK )
|
|
|
|
nWindowAttributes |= css::awt::VclWindowPeerAttribute::OK;
|
|
|
|
else if (( aButtons & 0x0000ffffL ) == css::awt::MessageBoxButtons::BUTTONS_OK_CANCEL )
|
|
|
|
nWindowAttributes |= css::awt::VclWindowPeerAttribute::OK_CANCEL;
|
|
|
|
else if (( aButtons & 0x0000ffffL ) == css::awt::MessageBoxButtons::BUTTONS_YES_NO )
|
|
|
|
nWindowAttributes |= css::awt::VclWindowPeerAttribute::YES_NO;
|
|
|
|
else if (( aButtons & 0x0000ffffL ) == css::awt::MessageBoxButtons::BUTTONS_YES_NO_CANCEL )
|
|
|
|
nWindowAttributes |= css::awt::VclWindowPeerAttribute::YES_NO_CANCEL;
|
|
|
|
else if (( aButtons & 0x0000ffffL ) == css::awt::MessageBoxButtons::BUTTONS_RETRY_CANCEL )
|
|
|
|
nWindowAttributes |= css::awt::VclWindowPeerAttribute::RETRY_CANCEL;
|
|
|
|
|
|
|
|
// Map default button definitions to window attributes
|
|
|
|
if (sal_Int32( aButtons & 0xffff0000L ) == css::awt::MessageBoxButtons::DEFAULT_BUTTON_OK )
|
|
|
|
nWindowAttributes |= css::awt::VclWindowPeerAttribute::DEF_OK;
|
|
|
|
else if (sal_Int32( aButtons & 0xffff0000L ) == css::awt::MessageBoxButtons::DEFAULT_BUTTON_CANCEL )
|
|
|
|
nWindowAttributes |= css::awt::VclWindowPeerAttribute::DEF_CANCEL;
|
|
|
|
else if (sal_Int32( aButtons & 0xffff0000L ) == css::awt::MessageBoxButtons::DEFAULT_BUTTON_YES )
|
|
|
|
nWindowAttributes |= css::awt::VclWindowPeerAttribute::DEF_YES;
|
|
|
|
else if (sal_Int32( aButtons & 0xffff0000L ) == css::awt::MessageBoxButtons::DEFAULT_BUTTON_NO )
|
|
|
|
nWindowAttributes |= css::awt::VclWindowPeerAttribute::DEF_NO;
|
|
|
|
else if (sal_Int32( aButtons & 0xffff0000L ) == css::awt::MessageBoxButtons::DEFAULT_BUTTON_RETRY )
|
|
|
|
nWindowAttributes |= css::awt::VclWindowPeerAttribute::DEF_RETRY;
|
|
|
|
|
|
|
|
// No more bits for VclWindowPeerAttribute possible. Mapping must be
|
|
|
|
// done explicitly using VCL methods
|
|
|
|
WinBits nAddWinBits( 0 );
|
|
|
|
if (( aButtons & 0x0000ffffL ) == css::awt::MessageBoxButtons::BUTTONS_ABORT_IGNORE_RETRY )
|
|
|
|
nAddWinBits |= WB_ABORT_RETRY_IGNORE;
|
2008-01-29 14:05:25 +00:00
|
|
|
if ( sal_Int32( aButtons & 0xffff0000L ) == css::awt::MessageBoxButtons::DEFAULT_BUTTON_IGNORE )
|
|
|
|
nAddWinBits |= WB_DEF_IGNORE;
|
2006-12-01 14:09:13 +00:00
|
|
|
|
2012-12-24 08:07:25 +00:00
|
|
|
rtl::OUString aType;
|
|
|
|
lcl_convertMessageBoxType( aType, eType );
|
|
|
|
|
2006-12-01 14:09:13 +00:00
|
|
|
aDescriptor.Type = css::awt::WindowClass_MODALTOP;
|
|
|
|
aDescriptor.WindowServiceName = aType;
|
|
|
|
aDescriptor.ParentIndex = -1;
|
|
|
|
aDescriptor.Parent = aParent;
|
|
|
|
aDescriptor.WindowAttributes = nWindowAttributes;
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::awt::XMessageBox > xMsgBox(
|
|
|
|
ImplCreateWindow( aDescriptor, nAddWinBits ), css::uno::UNO_QUERY );
|
|
|
|
css::uno::Reference< css::awt::XWindow > xWindow( xMsgBox, css::uno::UNO_QUERY );
|
|
|
|
if ( xMsgBox.is() && xWindow.is() )
|
|
|
|
{
|
|
|
|
Window * pWindow = VCLUnoHelper::GetWindow( xWindow );
|
|
|
|
if ( pWindow )
|
|
|
|
{
|
2010-10-14 16:43:53 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2006-12-01 14:09:13 +00:00
|
|
|
xMsgBox->setCaptionText( aTitle );
|
|
|
|
xMsgBox->setMessageText( aMessage );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return xMsgBox;
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-02-21 14:24:30 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragGestureRecognizer > SAL_CALL VCLXToolkit::getDragGestureRecognizer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& window ) throw(::com::sun::star::uno::RuntimeException)
|
|
|
|
{
|
|
|
|
Window * pWindow = VCLUnoHelper::GetWindow( window );
|
|
|
|
|
|
|
|
if( pWindow )
|
|
|
|
return pWindow->GetDragGestureRecognizer();
|
|
|
|
|
|
|
|
return ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragGestureRecognizer >();
|
|
|
|
}
|
|
|
|
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource > SAL_CALL VCLXToolkit::getDragSource( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& window ) throw(::com::sun::star::uno::RuntimeException)
|
|
|
|
{
|
|
|
|
Window * pWindow = VCLUnoHelper::GetWindow( window );
|
|
|
|
|
|
|
|
if( pWindow )
|
|
|
|
return pWindow->GetDragSource();
|
|
|
|
|
|
|
|
return ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource >();
|
|
|
|
}
|
|
|
|
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTarget > SAL_CALL VCLXToolkit::getDropTarget( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& window ) throw(::com::sun::star::uno::RuntimeException)
|
|
|
|
{
|
|
|
|
Window * pWindow = VCLUnoHelper::GetWindow( window );
|
|
|
|
|
|
|
|
if( pWindow )
|
|
|
|
return pWindow->GetDropTarget();
|
|
|
|
|
|
|
|
return ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTarget >();
|
|
|
|
}
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > SAL_CALL VCLXToolkit::getClipboard( const OUString& clipboardName ) throw(::com::sun::star::uno::RuntimeException)
|
2001-02-21 14:24:30 +00:00
|
|
|
{
|
2012-01-16 15:46:57 -02:00
|
|
|
if( clipboardName.isEmpty() )
|
2001-02-21 14:24:30 +00:00
|
|
|
{
|
|
|
|
if( !mxClipboard.is() )
|
|
|
|
{
|
2013-01-14 16:05:07 +02:00
|
|
|
// remember clipboard here
|
2013-07-11 10:21:15 +02:00
|
|
|
mxClipboard = css::datatransfer::clipboard::SystemClipboard::create(
|
|
|
|
comphelper::getProcessComponentContext());
|
2001-02-21 14:24:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return mxClipboard;
|
|
|
|
}
|
|
|
|
|
2012-04-06 14:09:04 +02:00
|
|
|
else if( clipboardName == "Selection" )
|
2001-02-21 14:24:30 +00:00
|
|
|
{
|
|
|
|
return mxSelection;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >();
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-09-04 05:50:36 +00:00
|
|
|
// XServiceInfo
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString VCLXToolkit::getImplementationName() throw(::com::sun::star::uno::RuntimeException)
|
2001-09-04 05:50:36 +00:00
|
|
|
{
|
2013-04-07 12:06:47 +02:00
|
|
|
return OUString("stardiv.Toolkit.VCLXToolkit");
|
2001-09-04 05:50:36 +00:00
|
|
|
}
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
sal_Bool VCLXToolkit::supportsService( const OUString& rServiceName ) throw(::com::sun::star::uno::RuntimeException)
|
2001-09-04 05:50:36 +00:00
|
|
|
{
|
|
|
|
::osl::MutexGuard aGuard( GetMutex() );
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
::com::sun::star::uno::Sequence< OUString > aSNL = getSupportedServiceNames();
|
|
|
|
const OUString* pArray = aSNL.getConstArray();
|
|
|
|
const OUString* pArrayEnd = aSNL.getConstArray();
|
2001-09-04 05:50:36 +00:00
|
|
|
for (; pArray != pArrayEnd; ++pArray )
|
|
|
|
if( *pArray == rServiceName )
|
|
|
|
break;
|
|
|
|
|
|
|
|
return pArray != pArrayEnd;
|
|
|
|
}
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
::com::sun::star::uno::Sequence< OUString > VCLXToolkit::getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException)
|
2001-09-04 05:50:36 +00:00
|
|
|
{
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString aServiceName( OUString::createFromAscii( szServiceName2_Toolkit ) );
|
|
|
|
return ::com::sun::star::uno::Sequence< OUString >( &aServiceName, 1);
|
2001-09-04 05:50:36 +00:00
|
|
|
}
|
2002-07-11 10:07:56 +00:00
|
|
|
|
2003-04-24 14:09:51 +00:00
|
|
|
// css::awt::XExtendedToolkit:
|
2002-07-11 10:07:56 +00:00
|
|
|
|
|
|
|
// virtual
|
|
|
|
::sal_Int32 SAL_CALL VCLXToolkit::getTopWindowCount()
|
2013-04-02 09:01:37 +02:00
|
|
|
throw (css::uno::RuntimeException)
|
2002-07-11 10:07:56 +00:00
|
|
|
{
|
2002-07-22 12:30:00 +00:00
|
|
|
return static_cast< ::sal_Int32 >(::Application::GetTopWindowCount());
|
|
|
|
// XXX numeric overflow
|
2002-07-11 10:07:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// virtual
|
2013-04-02 09:01:37 +02:00
|
|
|
css::uno::Reference< css::awt::XTopWindow > SAL_CALL
|
2002-07-11 10:07:56 +00:00
|
|
|
VCLXToolkit::getTopWindow(::sal_Int32 nIndex)
|
2013-04-02 09:01:37 +02:00
|
|
|
throw (css::uno::RuntimeException)
|
2002-07-11 10:07:56 +00:00
|
|
|
{
|
2002-07-22 12:30:00 +00:00
|
|
|
::Window * p = ::Application::GetTopWindow(static_cast< long >(nIndex));
|
|
|
|
// XXX numeric overflow
|
2013-04-02 09:01:37 +02:00
|
|
|
return css::uno::Reference< css::awt::XTopWindow >(
|
|
|
|
p == 0 ? 0 : static_cast< css::awt::XWindow * >(p->GetWindowPeer()),
|
|
|
|
css::uno::UNO_QUERY);
|
2002-07-11 10:07:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// virtual
|
2013-04-02 09:01:37 +02:00
|
|
|
css::uno::Reference< css::awt::XTopWindow > SAL_CALL
|
|
|
|
VCLXToolkit::getActiveTopWindow() throw (css::uno::RuntimeException)
|
2002-07-11 10:07:56 +00:00
|
|
|
{
|
2002-07-22 12:30:00 +00:00
|
|
|
::Window * p = ::Application::GetActiveTopWindow();
|
2013-04-02 09:01:37 +02:00
|
|
|
return css::uno::Reference< css::awt::XTopWindow >(
|
|
|
|
p == 0 ? 0 : static_cast< css::awt::XWindow * >(p->GetWindowPeer()),
|
|
|
|
css::uno::UNO_QUERY);
|
2002-07-11 10:07:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// virtual
|
|
|
|
void SAL_CALL VCLXToolkit::addTopWindowListener(
|
2013-04-02 09:01:37 +02:00
|
|
|
css::uno::Reference< css::awt::XTopWindowListener > const & rListener)
|
|
|
|
throw (css::uno::RuntimeException)
|
2002-07-11 10:07:56 +00:00
|
|
|
{
|
|
|
|
OSL_ENSURE(rListener.is(), "Null rListener");
|
|
|
|
::osl::ClearableMutexGuard aGuard(rBHelper.rMutex);
|
|
|
|
if (rBHelper.bDisposed || rBHelper.bInDispose)
|
|
|
|
{
|
|
|
|
aGuard.clear();
|
|
|
|
rListener->disposing(
|
2013-04-02 09:01:37 +02:00
|
|
|
css::lang::EventObject(
|
2002-07-11 10:07:56 +00:00
|
|
|
static_cast< ::cppu::OWeakObject * >(this)));
|
|
|
|
}
|
|
|
|
else if (m_aTopWindowListeners.addInterface(rListener) == 1
|
2002-07-22 12:30:00 +00:00
|
|
|
&& !m_bEventListener)
|
2002-07-11 10:07:56 +00:00
|
|
|
{
|
2002-07-22 12:30:00 +00:00
|
|
|
m_bEventListener = true;
|
|
|
|
::Application::AddEventListener(m_aEventListenerLink);
|
2002-07-11 10:07:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// virtual
|
|
|
|
void SAL_CALL VCLXToolkit::removeTopWindowListener(
|
2013-04-02 09:01:37 +02:00
|
|
|
css::uno::Reference< css::awt::XTopWindowListener > const & rListener)
|
|
|
|
throw (css::uno::RuntimeException)
|
2002-07-11 10:07:56 +00:00
|
|
|
{
|
|
|
|
::osl::MutexGuard aGuard(rBHelper.rMutex);
|
|
|
|
if (!(rBHelper.bDisposed || rBHelper.bInDispose)
|
|
|
|
&& m_aTopWindowListeners.removeInterface(rListener) == 0
|
2002-07-22 12:30:00 +00:00
|
|
|
&& m_aFocusListeners.getLength() == 0 && m_bEventListener)
|
2002-07-11 10:07:56 +00:00
|
|
|
{
|
2002-07-22 12:30:00 +00:00
|
|
|
::Application::RemoveEventListener(m_aEventListenerLink);
|
|
|
|
m_bEventListener = false;
|
2002-07-11 10:07:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// virtual
|
|
|
|
void SAL_CALL VCLXToolkit::addKeyHandler(
|
2013-04-02 09:01:37 +02:00
|
|
|
css::uno::Reference< css::awt::XKeyHandler > const & rHandler)
|
|
|
|
throw (css::uno::RuntimeException)
|
2002-07-11 10:07:56 +00:00
|
|
|
{
|
|
|
|
OSL_ENSURE(rHandler.is(), "Null rHandler");
|
|
|
|
::osl::ClearableMutexGuard aGuard(rBHelper.rMutex);
|
|
|
|
if (rBHelper.bDisposed || rBHelper.bInDispose)
|
|
|
|
{
|
|
|
|
aGuard.clear();
|
|
|
|
rHandler->disposing(
|
2013-04-02 09:01:37 +02:00
|
|
|
css::lang::EventObject(
|
2002-07-11 10:07:56 +00:00
|
|
|
static_cast< ::cppu::OWeakObject * >(this)));
|
|
|
|
}
|
2002-07-22 12:30:00 +00:00
|
|
|
else if (m_aKeyHandlers.addInterface(rHandler) == 1 && !m_bKeyListener)
|
2002-07-11 10:07:56 +00:00
|
|
|
{
|
2002-07-22 12:30:00 +00:00
|
|
|
m_bKeyListener = true;
|
|
|
|
::Application::AddKeyListener(m_aKeyListenerLink);
|
2002-07-11 10:07:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// virtual
|
|
|
|
void SAL_CALL VCLXToolkit::removeKeyHandler(
|
2013-04-02 09:01:37 +02:00
|
|
|
css::uno::Reference< css::awt::XKeyHandler > const & rHandler)
|
|
|
|
throw (css::uno::RuntimeException)
|
2002-07-11 10:07:56 +00:00
|
|
|
{
|
|
|
|
::osl::MutexGuard aGuard(rBHelper.rMutex);
|
|
|
|
if (!(rBHelper.bDisposed || rBHelper.bInDispose)
|
2002-07-22 12:30:00 +00:00
|
|
|
&& m_aKeyHandlers.removeInterface(rHandler) == 0 && m_bKeyListener)
|
2002-07-11 10:07:56 +00:00
|
|
|
{
|
2002-07-22 12:30:00 +00:00
|
|
|
::Application::RemoveKeyListener(m_aKeyListenerLink);
|
|
|
|
m_bKeyListener = false;
|
2002-07-11 10:07:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// virtual
|
|
|
|
void SAL_CALL VCLXToolkit::addFocusListener(
|
2013-04-02 09:01:37 +02:00
|
|
|
css::uno::Reference< css::awt::XFocusListener > const & rListener)
|
|
|
|
throw (css::uno::RuntimeException)
|
2002-07-11 10:07:56 +00:00
|
|
|
{
|
|
|
|
OSL_ENSURE(rListener.is(), "Null rListener");
|
|
|
|
::osl::ClearableMutexGuard aGuard(rBHelper.rMutex);
|
|
|
|
if (rBHelper.bDisposed || rBHelper.bInDispose)
|
|
|
|
{
|
|
|
|
aGuard.clear();
|
|
|
|
rListener->disposing(
|
2013-04-02 09:01:37 +02:00
|
|
|
css::lang::EventObject(
|
2002-07-11 10:07:56 +00:00
|
|
|
static_cast< ::cppu::OWeakObject * >(this)));
|
|
|
|
}
|
|
|
|
else if (m_aFocusListeners.addInterface(rListener) == 1
|
2002-07-22 12:30:00 +00:00
|
|
|
&& !m_bEventListener)
|
2002-07-11 10:07:56 +00:00
|
|
|
{
|
2002-07-22 12:30:00 +00:00
|
|
|
m_bEventListener = true;
|
|
|
|
::Application::AddEventListener(m_aEventListenerLink);
|
2002-07-11 10:07:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// virtual
|
|
|
|
void SAL_CALL VCLXToolkit::removeFocusListener(
|
2013-04-02 09:01:37 +02:00
|
|
|
css::uno::Reference< css::awt::XFocusListener > const & rListener)
|
|
|
|
throw (css::uno::RuntimeException)
|
2002-07-11 10:07:56 +00:00
|
|
|
{
|
|
|
|
::osl::MutexGuard aGuard(rBHelper.rMutex);
|
|
|
|
if (!(rBHelper.bDisposed || rBHelper.bInDispose)
|
|
|
|
&& m_aFocusListeners.removeInterface(rListener) == 0
|
2002-07-22 12:30:00 +00:00
|
|
|
&& m_aTopWindowListeners.getLength() == 0 && m_bEventListener)
|
2002-07-11 10:07:56 +00:00
|
|
|
{
|
2002-07-22 12:30:00 +00:00
|
|
|
::Application::RemoveEventListener(m_aEventListenerLink);
|
|
|
|
m_bEventListener = false;
|
2002-07-11 10:07:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-08-21 10:41:31 +00:00
|
|
|
// virtual
|
|
|
|
void SAL_CALL VCLXToolkit::fireFocusGained(
|
|
|
|
::com::sun::star::uno::Reference<
|
2006-06-19 22:01:53 +00:00
|
|
|
::com::sun::star::uno::XInterface > const &)
|
2002-08-21 10:41:31 +00:00
|
|
|
throw (::com::sun::star::uno::RuntimeException)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// virtual
|
2002-08-23 11:44:15 +00:00
|
|
|
void SAL_CALL VCLXToolkit::fireFocusLost(
|
2002-08-21 10:41:31 +00:00
|
|
|
::com::sun::star::uno::Reference<
|
2006-06-19 22:01:53 +00:00
|
|
|
::com::sun::star::uno::XInterface > const &)
|
2002-08-21 10:41:31 +00:00
|
|
|
throw (::com::sun::star::uno::RuntimeException)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-07-22 12:30:00 +00:00
|
|
|
IMPL_LINK(VCLXToolkit, eventListenerHandler, ::VclSimpleEvent const *, pEvent)
|
2002-07-11 10:07:56 +00:00
|
|
|
{
|
2002-07-22 12:30:00 +00:00
|
|
|
switch (pEvent->GetId())
|
2002-07-16 08:40:56 +00:00
|
|
|
{
|
2002-07-22 12:30:00 +00:00
|
|
|
case VCLEVENT_WINDOW_SHOW:
|
|
|
|
callTopWindowListeners(
|
2013-04-02 09:01:37 +02:00
|
|
|
pEvent, &css::awt::XTopWindowListener::windowOpened);
|
2002-07-22 12:30:00 +00:00
|
|
|
break;
|
|
|
|
case VCLEVENT_WINDOW_HIDE:
|
|
|
|
callTopWindowListeners(
|
2013-04-02 09:01:37 +02:00
|
|
|
pEvent, &css::awt::XTopWindowListener::windowClosed);
|
2002-07-22 12:30:00 +00:00
|
|
|
break;
|
|
|
|
case VCLEVENT_WINDOW_ACTIVATE:
|
|
|
|
callTopWindowListeners(
|
2013-04-02 09:01:37 +02:00
|
|
|
pEvent, &css::awt::XTopWindowListener::windowActivated);
|
2002-07-22 12:30:00 +00:00
|
|
|
break;
|
|
|
|
case VCLEVENT_WINDOW_DEACTIVATE:
|
|
|
|
callTopWindowListeners(
|
2013-04-02 09:01:37 +02:00
|
|
|
pEvent, &css::awt::XTopWindowListener::windowDeactivated);
|
2002-07-22 12:30:00 +00:00
|
|
|
break;
|
|
|
|
case VCLEVENT_WINDOW_CLOSE:
|
|
|
|
callTopWindowListeners(
|
2013-04-02 09:01:37 +02:00
|
|
|
pEvent, &css::awt::XTopWindowListener::windowClosing);
|
2002-07-22 12:30:00 +00:00
|
|
|
break;
|
|
|
|
case VCLEVENT_WINDOW_GETFOCUS:
|
|
|
|
callFocusListeners(pEvent, true);
|
|
|
|
break;
|
|
|
|
case VCLEVENT_WINDOW_LOSEFOCUS:
|
|
|
|
callFocusListeners(pEvent, false);
|
|
|
|
break;
|
|
|
|
case VCLEVENT_WINDOW_MINIMIZE:
|
|
|
|
callTopWindowListeners(
|
2013-04-02 09:01:37 +02:00
|
|
|
pEvent, &css::awt::XTopWindowListener::windowMinimized);
|
2002-07-22 12:30:00 +00:00
|
|
|
break;
|
|
|
|
case VCLEVENT_WINDOW_NORMALIZE:
|
|
|
|
callTopWindowListeners(
|
2013-04-02 09:01:37 +02:00
|
|
|
pEvent, &css::awt::XTopWindowListener::windowNormalized);
|
2002-07-22 12:30:00 +00:00
|
|
|
break;
|
2002-07-16 08:40:56 +00:00
|
|
|
}
|
2002-07-22 12:30:00 +00:00
|
|
|
return 0;
|
2002-07-11 10:07:56 +00:00
|
|
|
}
|
|
|
|
|
2002-07-22 12:30:00 +00:00
|
|
|
IMPL_LINK(VCLXToolkit, keyListenerHandler, ::VclSimpleEvent const *, pEvent)
|
2002-07-11 10:07:56 +00:00
|
|
|
{
|
2002-07-22 12:30:00 +00:00
|
|
|
switch (pEvent->GetId())
|
2002-07-16 08:40:56 +00:00
|
|
|
{
|
2002-07-22 12:30:00 +00:00
|
|
|
case VCLEVENT_WINDOW_KEYINPUT:
|
|
|
|
return callKeyHandlers(pEvent, true);
|
|
|
|
case VCLEVENT_WINDOW_KEYUP:
|
|
|
|
return callKeyHandlers(pEvent, false);
|
2002-07-16 08:40:56 +00:00
|
|
|
}
|
2002-07-22 12:30:00 +00:00
|
|
|
return 0;
|
2002-07-11 10:07:56 +00:00
|
|
|
}
|
|
|
|
|
2002-07-22 12:30:00 +00:00
|
|
|
void VCLXToolkit::callTopWindowListeners(
|
|
|
|
::VclSimpleEvent const * pEvent,
|
2013-04-02 09:01:37 +02:00
|
|
|
void (SAL_CALL css::awt::XTopWindowListener::* pFn)(
|
|
|
|
css::lang::EventObject const &))
|
2002-07-11 10:07:56 +00:00
|
|
|
{
|
2002-07-22 12:30:00 +00:00
|
|
|
::Window * pWindow
|
|
|
|
= static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow();
|
|
|
|
if (pWindow->IsTopWindow())
|
2002-07-16 08:40:56 +00:00
|
|
|
{
|
2013-04-02 09:01:37 +02:00
|
|
|
css::uno::Sequence< css::uno::Reference< css::uno::XInterface > >
|
2002-07-11 10:07:56 +00:00
|
|
|
aListeners(m_aTopWindowListeners.getElements());
|
2002-07-22 12:30:00 +00:00
|
|
|
if (aListeners.hasElements())
|
|
|
|
{
|
2013-04-02 09:01:37 +02:00
|
|
|
css::lang::EventObject aAwtEvent(
|
|
|
|
static_cast< css::awt::XWindow * >(pWindow->GetWindowPeer()));
|
2002-07-22 12:30:00 +00:00
|
|
|
for (::sal_Int32 i = 0; i < aListeners.getLength(); ++i)
|
|
|
|
{
|
2013-04-02 09:01:37 +02:00
|
|
|
css::uno::Reference< css::awt::XTopWindowListener >
|
|
|
|
xListener(aListeners[i], css::uno::UNO_QUERY);
|
2002-07-22 12:30:00 +00:00
|
|
|
try
|
|
|
|
{
|
|
|
|
(xListener.get()->*pFn)(aAwtEvent);
|
|
|
|
}
|
2013-04-02 09:01:37 +02:00
|
|
|
catch (const css::uno::RuntimeException & rEx)
|
2002-07-22 12:30:00 +00:00
|
|
|
{
|
|
|
|
OSL_TRACE(
|
|
|
|
"VCLXToolkit::callTopWindowListeners: caught %s\n",
|
2013-04-07 12:06:47 +02:00
|
|
|
OUStringToOString(
|
2002-07-22 12:30:00 +00:00
|
|
|
rEx.Message, RTL_TEXTENCODING_UTF8).getStr());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2002-07-16 08:40:56 +00:00
|
|
|
}
|
2002-07-11 10:07:56 +00:00
|
|
|
}
|
|
|
|
|
2002-07-22 12:30:00 +00:00
|
|
|
long VCLXToolkit::callKeyHandlers(::VclSimpleEvent const * pEvent,
|
|
|
|
bool bPressed)
|
2002-07-11 10:07:56 +00:00
|
|
|
{
|
2013-04-02 09:01:37 +02:00
|
|
|
css::uno::Sequence< css::uno::Reference< css::uno::XInterface > >
|
2002-08-23 09:21:28 +00:00
|
|
|
aHandlers(m_aKeyHandlers.getElements());
|
|
|
|
|
|
|
|
if (aHandlers.hasElements())
|
2002-07-16 08:40:56 +00:00
|
|
|
{
|
2002-08-23 09:21:28 +00:00
|
|
|
::Window * pWindow = static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow();
|
|
|
|
|
|
|
|
// See implementation in vclxwindow.cxx for mapping between VCL and UNO AWT event
|
|
|
|
::KeyEvent * pKeyEvent = static_cast< ::KeyEvent * >(
|
|
|
|
static_cast< ::VclWindowEvent const * >(pEvent)->GetData());
|
2013-04-02 09:01:37 +02:00
|
|
|
css::awt::KeyEvent aAwtEvent(
|
|
|
|
static_cast< css::awt::XWindow * >(pWindow->GetWindowPeer()),
|
2002-08-23 09:21:28 +00:00
|
|
|
(pKeyEvent->GetKeyCode().IsShift()
|
2013-04-02 09:01:37 +02:00
|
|
|
? css::awt::KeyModifier::SHIFT : 0)
|
2002-08-23 09:21:28 +00:00
|
|
|
| (pKeyEvent->GetKeyCode().IsMod1()
|
2013-04-02 09:01:37 +02:00
|
|
|
? css::awt::KeyModifier::MOD1 : 0)
|
2002-08-23 09:21:28 +00:00
|
|
|
| (pKeyEvent->GetKeyCode().IsMod2()
|
2013-04-02 09:01:37 +02:00
|
|
|
? css::awt::KeyModifier::MOD2 : 0)
|
2009-04-12 04:24:43 +00:00
|
|
|
| (pKeyEvent->GetKeyCode().IsMod3()
|
2013-04-02 09:01:37 +02:00
|
|
|
? css::awt::KeyModifier::MOD3 : 0),
|
2002-08-23 09:21:28 +00:00
|
|
|
pKeyEvent->GetKeyCode().GetCode(), pKeyEvent->GetCharCode(),
|
2006-10-12 09:31:38 +00:00
|
|
|
sal::static_int_cast< sal_Int16 >(
|
|
|
|
pKeyEvent->GetKeyCode().GetFunction()));
|
2002-08-23 09:21:28 +00:00
|
|
|
for (::sal_Int32 i = 0; i < aHandlers.getLength(); ++i)
|
2002-07-22 12:30:00 +00:00
|
|
|
{
|
2013-04-02 09:01:37 +02:00
|
|
|
css::uno::Reference< css::awt::XKeyHandler > xHandler(
|
|
|
|
aHandlers[i], css::uno::UNO_QUERY);
|
2002-08-23 09:21:28 +00:00
|
|
|
try
|
2002-07-22 12:30:00 +00:00
|
|
|
{
|
2002-08-23 09:21:28 +00:00
|
|
|
if ((bPressed ? xHandler->keyPressed(aAwtEvent)
|
|
|
|
: xHandler->keyReleased(aAwtEvent)))
|
|
|
|
return 1;
|
|
|
|
}
|
2013-04-02 09:01:37 +02:00
|
|
|
catch (const css::uno::RuntimeException & rEx)
|
2002-08-23 09:21:28 +00:00
|
|
|
{
|
|
|
|
OSL_TRACE(
|
|
|
|
"VCLXToolkit::callKeyHandlers: caught %s\n",
|
2013-04-07 12:06:47 +02:00
|
|
|
OUStringToOString(
|
2002-08-23 09:21:28 +00:00
|
|
|
rEx.Message, RTL_TEXTENCODING_UTF8).getStr());
|
2002-07-22 12:30:00 +00:00
|
|
|
}
|
|
|
|
}
|
2002-07-16 08:40:56 +00:00
|
|
|
}
|
2002-07-22 12:30:00 +00:00
|
|
|
return 0;
|
2002-07-11 10:07:56 +00:00
|
|
|
}
|
|
|
|
|
2002-07-22 12:30:00 +00:00
|
|
|
void VCLXToolkit::callFocusListeners(::VclSimpleEvent const * pEvent,
|
|
|
|
bool bGained)
|
2002-07-11 10:07:56 +00:00
|
|
|
{
|
2002-07-22 12:30:00 +00:00
|
|
|
::Window * pWindow
|
|
|
|
= static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow();
|
|
|
|
if (pWindow->IsTopWindow())
|
2002-07-16 08:40:56 +00:00
|
|
|
{
|
2013-04-02 09:01:37 +02:00
|
|
|
css::uno::Sequence< css::uno::Reference< css::uno::XInterface > >
|
2002-07-11 10:07:56 +00:00
|
|
|
aListeners(m_aFocusListeners.getElements());
|
2002-07-22 12:30:00 +00:00
|
|
|
if (aListeners.hasElements())
|
|
|
|
{
|
|
|
|
// Ignore the interior of compound controls when determining the
|
|
|
|
// window that gets the focus next (see implementation in
|
|
|
|
// vclxwindow.cxx for mapping between VCL and UNO AWT event):
|
2013-04-02 09:01:37 +02:00
|
|
|
css::uno::Reference< css::uno::XInterface > xNext;
|
2002-07-22 12:30:00 +00:00
|
|
|
::Window * pFocus = ::Application::GetFocusWindow();
|
|
|
|
for (::Window * p = pFocus; p != 0; p = p->GetParent())
|
|
|
|
if (!p->IsCompoundControl())
|
|
|
|
{
|
|
|
|
pFocus = p;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (pFocus != 0)
|
|
|
|
xNext = pFocus->GetComponentInterface(true);
|
2013-04-02 09:01:37 +02:00
|
|
|
css::awt::FocusEvent aAwtEvent(
|
|
|
|
static_cast< css::awt::XWindow * >(pWindow->GetWindowPeer()),
|
2002-07-22 12:30:00 +00:00
|
|
|
pWindow->GetGetFocusFlags(), xNext, false);
|
|
|
|
for (::sal_Int32 i = 0; i < aListeners.getLength(); ++i)
|
|
|
|
{
|
2013-04-02 09:01:37 +02:00
|
|
|
css::uno::Reference< css::awt::XFocusListener > xListener(
|
|
|
|
aListeners[i], css::uno::UNO_QUERY);
|
2002-07-22 12:30:00 +00:00
|
|
|
try
|
|
|
|
{
|
|
|
|
bGained ? xListener->focusGained(aAwtEvent)
|
|
|
|
: xListener->focusLost(aAwtEvent);
|
|
|
|
}
|
2013-04-02 09:01:37 +02:00
|
|
|
catch (const css::uno::RuntimeException & rEx)
|
2002-07-22 12:30:00 +00:00
|
|
|
{
|
|
|
|
OSL_TRACE(
|
|
|
|
"VCLXToolkit::callFocusListeners: caught %s\n",
|
2013-04-07 12:06:47 +02:00
|
|
|
OUStringToOString(
|
2002-07-22 12:30:00 +00:00
|
|
|
rEx.Message, RTL_TEXTENCODING_UTF8).getStr());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2002-07-16 08:40:56 +00:00
|
|
|
}
|
2002-07-11 10:07:56 +00:00
|
|
|
}
|
2005-03-08 14:31:42 +00:00
|
|
|
|
|
|
|
// css::awt::XReschedule:
|
|
|
|
|
|
|
|
void SAL_CALL VCLXToolkit::reschedule()
|
|
|
|
throw (::com::sun::star::uno::RuntimeException)
|
|
|
|
{
|
2006-07-10 15:28:52 +00:00
|
|
|
Application::Reschedule(true);
|
2005-03-08 14:31:42 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 08:27:31 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|