fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / avmedia / source / gstreamer / gstwindow.cxx
blobf1d4a9670b78ae1a3e67caaa801ecf036aa766d0
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/awt/SystemPointer.hpp>
22 #include "gstwindow.hxx"
23 #include "gstplayer.hxx"
25 #define AVMEDIA_GST_WINDOW_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Window_GStreamer"
26 #define AVMEDIA_GST_WINDOW_SERVICENAME "com.sun.star.media.Window_GStreamer"
28 using namespace ::com::sun::star;
30 namespace avmedia { namespace gstreamer {
32 static ::osl::Mutex& ImplGetOwnStaticMutex()
34 static ::osl::Mutex* pMutex = NULL;
36 if( pMutex == NULL )
38 ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
40 if( pMutex == NULL )
42 static ::osl::Mutex aMutex;
43 pMutex = &aMutex;
47 return *pMutex;
50 // Window
51 // ------------------------------------------------------------------------------
53 Window::Window( const uno::Reference< lang::XMultiServiceFactory >& rxMgr, Player& rPlayer ) :
54 mxMgr( rxMgr ),
55 meZoomLevel( media::ZoomLevel_NOT_AVAILABLE ),
56 mrPlayer( rPlayer ),
57 mnPointerType( awt::SystemPointer::ARROW )
59 ::osl::MutexGuard aGuard( ImplGetOwnStaticMutex() );
63 Window::~Window()
67 // XPlayerWindow
68 // ------------------------------------------------------------------------------
70 void SAL_CALL Window::update( )
71 throw (uno::RuntimeException)
75 sal_Bool SAL_CALL Window::setZoomLevel( media::ZoomLevel eZoomLevel )
76 throw (uno::RuntimeException)
78 sal_Bool bRet = false;
80 if( media::ZoomLevel_NOT_AVAILABLE != meZoomLevel &&
81 media::ZoomLevel_NOT_AVAILABLE != eZoomLevel )
83 if( eZoomLevel != meZoomLevel )
85 meZoomLevel = eZoomLevel;
88 bRet = true;
91 return bRet;
94 media::ZoomLevel SAL_CALL Window::getZoomLevel( )
95 throw (uno::RuntimeException)
97 return meZoomLevel;
100 void SAL_CALL Window::setPointerType( sal_Int32 nPointerType )
101 throw (uno::RuntimeException)
103 mnPointerType = nPointerType;
106 // XWindow
107 // ------------------------------------------------------------------------------
109 void SAL_CALL Window::setPosSize( sal_Int32 /*X*/, sal_Int32 /*Y*/, sal_Int32 /*Width*/, sal_Int32 /*Height*/, sal_Int16 /*Flags*/ )
110 throw (uno::RuntimeException)
114 awt::Rectangle SAL_CALL Window::getPosSize()
115 throw (uno::RuntimeException)
117 awt::Rectangle aRet;
119 aRet.X = aRet.Y = 0;
120 aRet.Width = 320;
121 aRet.Height = 240;
123 return aRet;
126 void SAL_CALL Window::setVisible( sal_Bool /*bVisible*/ )
127 throw (uno::RuntimeException)
131 void SAL_CALL Window::setEnable( sal_Bool /*bEnable*/ )
132 throw (uno::RuntimeException)
136 void SAL_CALL Window::setFocus( )
137 throw (uno::RuntimeException)
141 void SAL_CALL Window::addWindowListener( const uno::Reference< awt::XWindowListener >& )
142 throw (uno::RuntimeException)
146 void SAL_CALL Window::removeWindowListener( const uno::Reference< awt::XWindowListener >& )
147 throw (uno::RuntimeException)
151 void SAL_CALL Window::addFocusListener( const uno::Reference< awt::XFocusListener >& )
152 throw (uno::RuntimeException)
156 void SAL_CALL Window::removeFocusListener( const uno::Reference< awt::XFocusListener >& )
157 throw (uno::RuntimeException)
161 void SAL_CALL Window::addKeyListener( const uno::Reference< awt::XKeyListener >& )
162 throw (uno::RuntimeException)
166 void SAL_CALL Window::removeKeyListener( const uno::Reference< awt::XKeyListener >& )
167 throw (uno::RuntimeException)
171 void SAL_CALL Window::addMouseListener( const uno::Reference< awt::XMouseListener >& )
172 throw (uno::RuntimeException)
176 void SAL_CALL Window::removeMouseListener( const uno::Reference< awt::XMouseListener >& )
177 throw (uno::RuntimeException)
181 void SAL_CALL Window::addMouseMotionListener( const uno::Reference< awt::XMouseMotionListener >& )
182 throw (uno::RuntimeException)
186 void SAL_CALL Window::removeMouseMotionListener( const uno::Reference< awt::XMouseMotionListener >& )
187 throw (uno::RuntimeException)
191 void SAL_CALL Window::addPaintListener( const uno::Reference< awt::XPaintListener >& )
192 throw (uno::RuntimeException)
196 void SAL_CALL Window::removePaintListener( const uno::Reference< awt::XPaintListener >& )
197 throw (uno::RuntimeException)
201 // XComponent
202 // ------------------------------------------------------------------------------
204 void SAL_CALL Window::dispose( )
205 throw (uno::RuntimeException)
209 void SAL_CALL Window::addEventListener( const uno::Reference< lang::XEventListener >& )
210 throw (uno::RuntimeException)
214 void SAL_CALL Window::removeEventListener( const uno::Reference< lang::XEventListener >& )
215 throw (uno::RuntimeException)
219 // XServiceInfo
220 // ------------------------------------------------------------------------------
222 OUString SAL_CALL Window::getImplementationName( )
223 throw (uno::RuntimeException)
225 return OUString( AVMEDIA_GST_WINDOW_IMPLEMENTATIONNAME );
228 sal_Bool SAL_CALL Window::supportsService( const OUString& ServiceName )
229 throw (uno::RuntimeException)
231 return ServiceName == AVMEDIA_GST_WINDOW_SERVICENAME;
234 uno::Sequence< OUString > SAL_CALL Window::getSupportedServiceNames( )
235 throw (uno::RuntimeException)
237 uno::Sequence< OUString > aRet(1);
238 aRet[0] = AVMEDIA_GST_WINDOW_SERVICENAME ;
240 return aRet;
243 } // namespace gstreamer
244 } // namespace avmedia
246 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */