bump product version to 6.3.0.0.beta1
[LibreOffice.git] / toolkit / source / awt / vclxsystemdependentwindow.cxx
blobc9514b2c2cf0169b6a5934815ea956eba9342a35
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <com/sun/star/lang/SystemDependent.hpp>
22 #if defined UNX && ! defined MACOSX
23 #include <com/sun/star/awt/SystemDependentXWindow.hpp>
24 #endif
26 #include <toolkit/awt/vclxsystemdependentwindow.hxx>
27 #include <toolkit/helper/macros.hxx>
28 #include <cppuhelper/typeprovider.hxx>
29 #include <cppuhelper/queryinterface.hxx>
31 #ifdef MACOSX
32 #include <premac.h>
33 #include <Cocoa/Cocoa.h>
34 #include <postmac.h>
35 #endif
37 #include <vcl/svapp.hxx>
38 #include <vcl/syschild.hxx>
39 #include <vcl/sysdata.hxx>
42 // class VCLXSystemDependentWindow
44 VCLXSystemDependentWindow::VCLXSystemDependentWindow()
48 VCLXSystemDependentWindow::~VCLXSystemDependentWindow()
52 // css::uno::XInterface
53 css::uno::Any VCLXSystemDependentWindow::queryInterface( const css::uno::Type & rType )
55 css::uno::Any aRet = ::cppu::queryInterface( rType,
56 static_cast< css::awt::XSystemDependentWindowPeer* >(this) );
57 return (aRet.hasValue() ? aRet : VCLXWindow::queryInterface( rType ));
60 IMPL_IMPLEMENTATION_ID( VCLXSystemDependentWindow )
62 // css::lang::XTypeProvider
63 css::uno::Sequence< css::uno::Type > VCLXSystemDependentWindow::getTypes()
65 static const ::cppu::OTypeCollection aTypeList(
66 cppu::UnoType<css::lang::XTypeProvider>::get(),
67 cppu::UnoType<css::awt::XSystemDependentWindowPeer>::get(),
68 VCLXWindow::getTypes()
70 return aTypeList.getTypes();
73 css::uno::Any VCLXSystemDependentWindow::getWindowHandle( const css::uno::Sequence< sal_Int8 >& /*ProcessId*/, sal_Int16 SystemType )
75 SolarMutexGuard aGuard;
77 // TODO, check the process id
78 css::uno::Any aRet;
79 VclPtr<vcl::Window> pWindow = GetWindow();
80 if ( pWindow )
82 const SystemEnvData* pSysData = static_cast<SystemChildWindow *>(pWindow.get())->GetSystemData();
83 if( pSysData )
85 #if defined(_WIN32)
86 if( SystemType == css::lang::SystemDependent::SYSTEM_WIN32 )
88 aRet <<= reinterpret_cast<sal_IntPtr>(pSysData->hWnd);
90 #elif defined(MACOSX)
91 if( SystemType == css::lang::SystemDependent::SYSTEM_MAC )
93 aRet <<= reinterpret_cast<sal_IntPtr>(pSysData->mpNSView);
95 #elif defined(ANDROID)
96 // Nothing
97 (void) SystemType;
98 #elif defined(IOS)
99 // Nothing
100 (void) SystemType;
101 #elif defined(UNX)
102 if( SystemType == css::lang::SystemDependent::SYSTEM_XWINDOW )
104 css::awt::SystemDependentXWindow aSD;
105 aSD.DisplayPointer = sal::static_int_cast< sal_Int64 >(reinterpret_cast< sal_IntPtr >(pSysData->pDisplay));
106 aSD.WindowHandle = pSysData->aWindow;
107 aRet <<= aSD;
109 #endif
112 return aRet;
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */