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 .
|
|
|
|
*/
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
#include <com/sun/star/lang/SystemDependent.hpp>
|
|
|
|
|
2013-01-11 11:07:23 +02:00
|
|
|
#if defined UNX && ! defined MACOSX && ! defined _COM_SUN_STAR_AWT_SYSTEMDEPENDENTXWINDOW_HPP_
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <com/sun/star/awt/SystemDependentXWindow.hpp>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <toolkit/awt/vclxsystemdependentwindow.hxx>
|
|
|
|
#include <toolkit/helper/macros.hxx>
|
|
|
|
#include <cppuhelper/typeprovider.hxx>
|
|
|
|
|
2013-01-11 11:07:23 +02:00
|
|
|
#ifdef MACOSX
|
2007-12-07 10:58:45 +00:00
|
|
|
#include "premac.h"
|
|
|
|
#include <Cocoa/Cocoa.h>
|
|
|
|
#include "postmac.h"
|
|
|
|
#endif
|
|
|
|
|
2010-11-01 00:22:41 -05:00
|
|
|
#include <vcl/svapp.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <vcl/syschild.hxx>
|
|
|
|
#include <vcl/sysdata.hxx>
|
|
|
|
|
|
|
|
// ----------------------------------------------------
|
|
|
|
// class VCLXSystemDependentWindow
|
|
|
|
// ----------------------------------------------------
|
|
|
|
VCLXSystemDependentWindow::VCLXSystemDependentWindow()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
VCLXSystemDependentWindow::~VCLXSystemDependentWindow()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// ::com::sun::star::uno::XInterface
|
|
|
|
::com::sun::star::uno::Any VCLXSystemDependentWindow::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
|
|
|
|
{
|
|
|
|
::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType,
|
2012-05-04 15:51:56 +02:00
|
|
|
(static_cast< ::com::sun::star::awt::XSystemDependentWindowPeer* >(this)) );
|
2000-09-18 16:07:07 +00:00
|
|
|
return (aRet.hasValue() ? aRet : VCLXWindow::queryInterface( rType ));
|
|
|
|
}
|
|
|
|
|
|
|
|
// ::com::sun::star::lang::XTypeProvider
|
|
|
|
IMPL_XTYPEPROVIDER_START( VCLXSystemDependentWindow )
|
|
|
|
getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XSystemDependentWindowPeer>* ) NULL ),
|
|
|
|
VCLXWindow::getTypes()
|
|
|
|
IMPL_XTYPEPROVIDER_END
|
|
|
|
|
2006-06-19 22:01:39 +00:00
|
|
|
::com::sun::star::uno::Any VCLXSystemDependentWindow::getWindowHandle( const ::com::sun::star::uno::Sequence< sal_Int8 >& /*ProcessId*/, sal_Int16 SystemType ) throw(::com::sun::star::uno::RuntimeException)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2010-11-01 00:22:41 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
// TODO, check the process id
|
|
|
|
::com::sun::star::uno::Any aRet;
|
|
|
|
Window* pWindow = GetWindow();
|
|
|
|
if ( pWindow )
|
|
|
|
{
|
|
|
|
const SystemEnvData* pSysData = ((SystemChildWindow *)pWindow)->GetSystemData();
|
|
|
|
if( pSysData )
|
|
|
|
{
|
2007-07-05 07:03:28 +00:00
|
|
|
#if (defined WNT)
|
2000-09-18 16:07:07 +00:00
|
|
|
if( SystemType == ::com::sun::star::lang::SystemDependent::SYSTEM_WIN32 )
|
|
|
|
{
|
|
|
|
aRet <<= (sal_Int32)pSysData->hWnd;
|
|
|
|
}
|
2013-01-11 11:07:23 +02:00
|
|
|
#elif (defined MACOSX)
|
2007-07-05 07:03:28 +00:00
|
|
|
if( SystemType == ::com::sun::star::lang::SystemDependent::SYSTEM_MAC )
|
|
|
|
{
|
2007-12-07 10:58:45 +00:00
|
|
|
aRet <<= (sal_IntPtr)pSysData->pView;
|
2007-07-05 07:03:28 +00:00
|
|
|
}
|
2013-03-27 00:38:36 +02:00
|
|
|
#elif (defined IOS)
|
|
|
|
// Nothing
|
|
|
|
(void) SystemType;
|
2007-07-05 07:03:28 +00:00
|
|
|
#elif (defined UNX)
|
|
|
|
if( SystemType == ::com::sun::star::lang::SystemDependent::SYSTEM_XWINDOW )
|
|
|
|
{
|
|
|
|
::com::sun::star::awt::SystemDependentXWindow aSD;
|
|
|
|
aSD.DisplayPointer = sal::static_int_cast< sal_Int64 >(reinterpret_cast< sal_IntPtr >(pSysData->pDisplay));
|
|
|
|
aSD.WindowHandle = pSysData->aWindow;
|
|
|
|
aRet <<= aSD;
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return aRet;
|
|
|
|
}
|
|
|
|
|
2010-10-14 08:27:31 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|