Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include <com/sun/star/lang/SystemDependent.hpp>
30 : :
31 : : #if defined UNX && ! defined QUARTZ && ! defined _COM_SUN_STAR_AWT_SYSTEMDEPENDENTXWINDOW_HPP_
32 : : #include <com/sun/star/awt/SystemDependentXWindow.hpp>
33 : : #endif
34 : :
35 : : #include <toolkit/awt/vclxsystemdependentwindow.hxx>
36 : : #include <toolkit/helper/macros.hxx>
37 : : #include <cppuhelper/typeprovider.hxx>
38 : :
39 : : #ifdef QUARTZ
40 : : #include "premac.h"
41 : : #include <Cocoa/Cocoa.h>
42 : : #include "postmac.h"
43 : : #endif
44 : :
45 : : #ifdef IOS
46 : : #include "premac.h"
47 : : #include <UIKit/UIKit.h>
48 : : #include "postmac.h"
49 : : #endif
50 : :
51 : : #include <vcl/svapp.hxx>
52 : : #include <vcl/syschild.hxx>
53 : : #include <vcl/sysdata.hxx>
54 : :
55 : : // ----------------------------------------------------
56 : : // class VCLXSystemDependentWindow
57 : : // ----------------------------------------------------
58 [ # # ]: 0 : VCLXSystemDependentWindow::VCLXSystemDependentWindow()
59 : : {
60 : 0 : }
61 : :
62 [ # # ]: 0 : VCLXSystemDependentWindow::~VCLXSystemDependentWindow()
63 : : {
64 [ # # ]: 0 : }
65 : :
66 : : // ::com::sun::star::uno::XInterface
67 : 0 : ::com::sun::star::uno::Any VCLXSystemDependentWindow::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
68 : : {
69 : : ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType,
70 [ # # ]: 0 : (static_cast< ::com::sun::star::awt::XSystemDependentWindowPeer* >(this)) );
71 [ # # ][ # # ]: 0 : return (aRet.hasValue() ? aRet : VCLXWindow::queryInterface( rType ));
72 : : }
73 : :
74 : : // ::com::sun::star::lang::XTypeProvider
75 [ # # ][ # # ]: 0 : IMPL_XTYPEPROVIDER_START( VCLXSystemDependentWindow )
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
76 [ # # ]: 0 : getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XSystemDependentWindowPeer>* ) NULL ),
77 : : VCLXWindow::getTypes()
78 [ # # ][ # # ]: 0 : IMPL_XTYPEPROVIDER_END
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
79 : :
80 : 0 : ::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)
81 : : {
82 [ # # ]: 0 : SolarMutexGuard aGuard;
83 : :
84 : : // TODO, check the process id
85 : 0 : ::com::sun::star::uno::Any aRet;
86 : 0 : Window* pWindow = GetWindow();
87 [ # # ]: 0 : if ( pWindow )
88 : : {
89 [ # # ]: 0 : const SystemEnvData* pSysData = ((SystemChildWindow *)pWindow)->GetSystemData();
90 [ # # ]: 0 : if( pSysData )
91 : : {
92 : : #if (defined WNT)
93 : : if( SystemType == ::com::sun::star::lang::SystemDependent::SYSTEM_WIN32 )
94 : : {
95 : : aRet <<= (sal_Int32)pSysData->hWnd;
96 : : }
97 : : #elif (defined QUARTZ)
98 : : if( SystemType == ::com::sun::star::lang::SystemDependent::SYSTEM_MAC )
99 : : {
100 : : aRet <<= (sal_IntPtr)pSysData->pView;
101 : : }
102 : : #elif (defined IOS)
103 : : if( SystemType == ::com::sun::star::lang::SystemDependent::SYSTEM_IOS )
104 : : {
105 : : aRet <<= (sal_IntPtr)pSysData->pView;
106 : : }
107 : : #elif (defined UNX)
108 [ # # ]: 0 : if( SystemType == ::com::sun::star::lang::SystemDependent::SYSTEM_XWINDOW )
109 : : {
110 : 0 : ::com::sun::star::awt::SystemDependentXWindow aSD;
111 : 0 : aSD.DisplayPointer = sal::static_int_cast< sal_Int64 >(reinterpret_cast< sal_IntPtr >(pSysData->pDisplay));
112 : 0 : aSD.WindowHandle = pSysData->aWindow;
113 [ # # ]: 0 : aRet <<= aSD;
114 : : }
115 : : #endif
116 : : }
117 : : }
118 [ # # ]: 0 : return aRet;
119 : : }
120 : :
121 : :
122 : :
123 : :
124 : :
125 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|