/src/libreoffice/toolkit/source/awt/vclxsystemdependentwindow.cxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
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/. |
8 | | * |
9 | | * This file incorporates work covered by the following license notice: |
10 | | * |
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 . |
18 | | */ |
19 | | |
20 | | #include <com/sun/star/lang/SystemDependent.hpp> |
21 | | |
22 | | #if defined UNX && ! defined MACOSX |
23 | | #include <com/sun/star/awt/SystemDependentXWindow.hpp> |
24 | | #endif |
25 | | |
26 | | #include <awt/vclxsystemdependentwindow.hxx> |
27 | | |
28 | | #ifdef MACOSX |
29 | | #include <premac.h> |
30 | | #include <Cocoa/Cocoa.h> |
31 | | #include <postmac.h> |
32 | | #endif |
33 | | |
34 | | #include <vcl/svapp.hxx> |
35 | | #include <vcl/syschild.hxx> |
36 | | #include <vcl/sysdata.hxx> |
37 | | |
38 | | |
39 | | |
40 | | VCLXSystemDependentWindow::VCLXSystemDependentWindow() |
41 | 0 | { |
42 | 0 | } |
43 | | |
44 | | VCLXSystemDependentWindow::~VCLXSystemDependentWindow() |
45 | 0 | { |
46 | 0 | } |
47 | | |
48 | | css::uno::Any VCLXSystemDependentWindow::getWindowHandle( const css::uno::Sequence< sal_Int8 >& /*ProcessId*/, sal_Int16 SystemType ) |
49 | 0 | { |
50 | 0 | SolarMutexGuard aGuard; |
51 | | |
52 | | // TODO, check the process id |
53 | 0 | css::uno::Any aRet; |
54 | 0 | VclPtr<vcl::Window> pWindow = GetWindow(); |
55 | 0 | if ( pWindow ) |
56 | 0 | { |
57 | 0 | const SystemEnvData* pSysData = static_cast<SystemChildWindow *>(pWindow.get())->GetSystemData(); |
58 | 0 | if( pSysData ) |
59 | 0 | { |
60 | | #if defined(_WIN32) |
61 | | if( SystemType == css::lang::SystemDependent::SYSTEM_WIN32 ) |
62 | | { |
63 | | aRet <<= reinterpret_cast<sal_IntPtr>(pSysData->hWnd); |
64 | | } |
65 | | #elif defined(MACOSX) |
66 | | if( SystemType == css::lang::SystemDependent::SYSTEM_MAC ) |
67 | | { |
68 | | aRet <<= reinterpret_cast<sal_IntPtr>(pSysData->mpNSView); |
69 | | } |
70 | | #elif defined(ANDROID) |
71 | | // Nothing |
72 | | (void) SystemType; |
73 | | #elif defined(IOS) |
74 | | // Nothing |
75 | | (void) SystemType; |
76 | | #elif defined(UNX) |
77 | 0 | if( SystemType == css::lang::SystemDependent::SYSTEM_XWINDOW ) |
78 | 0 | { |
79 | 0 | css::awt::SystemDependentXWindow aSD; |
80 | 0 | aSD.DisplayPointer = sal::static_int_cast< sal_Int64 >(reinterpret_cast< sal_IntPtr >(pSysData->pDisplay)); |
81 | 0 | aSD.WindowHandle = pSysData->GetWindowHandle(pWindow->ImplGetFrame()); |
82 | 0 | aRet <<= aSD; |
83 | 0 | } |
84 | 0 | #endif |
85 | 0 | } |
86 | 0 | } |
87 | 0 | return aRet; |
88 | 0 | } |
89 | | |
90 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |