fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / avmedia / source / gstreamer / gstwindow.cxx
blobb95c33edaf7f890f150f1a6b9a3104e876e8b61a
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 <cppuhelper/supportsservice.hxx>
24 #include "gstwindow.hxx"
25 #include "gstplayer.hxx"
27 #define AVMEDIA_GST_WINDOW_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Window_GStreamer"
28 #define AVMEDIA_GST_WINDOW_SERVICENAME "com.sun.star.media.Window_GStreamer"
30 using namespace ::com::sun::star;
32 namespace avmedia { namespace gstreamer {
34 static ::osl::Mutex& ImplGetOwnStaticMutex()
36 static ::osl::Mutex* pMutex = NULL;
38 if( pMutex == NULL )
40 ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
42 if( pMutex == NULL )
44 static ::osl::Mutex aMutex;
45 pMutex = &aMutex;
49 return *pMutex;
52 // Window
55 Window::Window( const uno::Reference< lang::XMultiServiceFactory >& rxMgr, Player& rPlayer ) :
56 mxMgr( rxMgr ),
57 meZoomLevel( media::ZoomLevel_NOT_AVAILABLE ),
58 mrPlayer( rPlayer ),
59 mnPointerType( awt::SystemPointer::ARROW )
61 ::osl::MutexGuard aGuard( ImplGetOwnStaticMutex() );
65 Window::~Window()
69 // XPlayerWindow
72 void SAL_CALL Window::update( )
73 throw (uno::RuntimeException, std::exception)
77 sal_Bool SAL_CALL Window::setZoomLevel( media::ZoomLevel eZoomLevel )
78 throw (uno::RuntimeException, std::exception)
80 bool bRet = false;
82 if( media::ZoomLevel_NOT_AVAILABLE != meZoomLevel &&
83 media::ZoomLevel_NOT_AVAILABLE != eZoomLevel )
85 if( eZoomLevel != meZoomLevel )
87 meZoomLevel = eZoomLevel;
90 bRet = true;
93 return bRet;
96 media::ZoomLevel SAL_CALL Window::getZoomLevel( )
97 throw (uno::RuntimeException, std::exception)
99 return meZoomLevel;
102 void SAL_CALL Window::setPointerType( sal_Int32 nPointerType )
103 throw (uno::RuntimeException, std::exception)
105 mnPointerType = nPointerType;
108 // XWindow
111 void SAL_CALL Window::setPosSize( sal_Int32 /*X*/, sal_Int32 /*Y*/, sal_Int32 /*Width*/, sal_Int32 /*Height*/, sal_Int16 /*Flags*/ )
112 throw (uno::RuntimeException, std::exception)
116 awt::Rectangle SAL_CALL Window::getPosSize()
117 throw (uno::RuntimeException, std::exception)
119 awt::Rectangle aRet;
121 aRet.X = aRet.Y = 0;
122 aRet.Width = 320;
123 aRet.Height = 240;
125 return aRet;
128 void SAL_CALL Window::setVisible( sal_Bool /*bVisible*/ )
129 throw (uno::RuntimeException, std::exception)
133 void SAL_CALL Window::setEnable( sal_Bool /*bEnable*/ )
134 throw (uno::RuntimeException, std::exception)
138 void SAL_CALL Window::setFocus( )
139 throw (uno::RuntimeException, std::exception)
143 void SAL_CALL Window::addWindowListener( const uno::Reference< awt::XWindowListener >& )
144 throw (uno::RuntimeException, std::exception)
148 void SAL_CALL Window::removeWindowListener( const uno::Reference< awt::XWindowListener >& )
149 throw (uno::RuntimeException, std::exception)
153 void SAL_CALL Window::addFocusListener( const uno::Reference< awt::XFocusListener >& )
154 throw (uno::RuntimeException, std::exception)
158 void SAL_CALL Window::removeFocusListener( const uno::Reference< awt::XFocusListener >& )
159 throw (uno::RuntimeException, std::exception)
163 void SAL_CALL Window::addKeyListener( const uno::Reference< awt::XKeyListener >& )
164 throw (uno::RuntimeException, std::exception)
168 void SAL_CALL Window::removeKeyListener( const uno::Reference< awt::XKeyListener >& )
169 throw (uno::RuntimeException, std::exception)
173 void SAL_CALL Window::addMouseListener( const uno::Reference< awt::XMouseListener >& )
174 throw (uno::RuntimeException, std::exception)
178 void SAL_CALL Window::removeMouseListener( const uno::Reference< awt::XMouseListener >& )
179 throw (uno::RuntimeException, std::exception)
183 void SAL_CALL Window::addMouseMotionListener( const uno::Reference< awt::XMouseMotionListener >& )
184 throw (uno::RuntimeException, std::exception)
188 void SAL_CALL Window::removeMouseMotionListener( const uno::Reference< awt::XMouseMotionListener >& )
189 throw (uno::RuntimeException, std::exception)
193 void SAL_CALL Window::addPaintListener( const uno::Reference< awt::XPaintListener >& )
194 throw (uno::RuntimeException, std::exception)
198 void SAL_CALL Window::removePaintListener( const uno::Reference< awt::XPaintListener >& )
199 throw (uno::RuntimeException, std::exception)
203 // XComponent
206 void SAL_CALL Window::dispose( )
207 throw (uno::RuntimeException, std::exception)
211 void SAL_CALL Window::addEventListener( const uno::Reference< lang::XEventListener >& )
212 throw (uno::RuntimeException, std::exception)
216 void SAL_CALL Window::removeEventListener( const uno::Reference< lang::XEventListener >& )
217 throw (uno::RuntimeException, std::exception)
221 // XServiceInfo
224 OUString SAL_CALL Window::getImplementationName( )
225 throw (uno::RuntimeException, std::exception)
227 return OUString( AVMEDIA_GST_WINDOW_IMPLEMENTATIONNAME );
230 sal_Bool SAL_CALL Window::supportsService( const OUString& ServiceName )
231 throw (uno::RuntimeException, std::exception)
233 return cppu::supportsService(this, ServiceName);
236 uno::Sequence< OUString > SAL_CALL Window::getSupportedServiceNames( )
237 throw (uno::RuntimeException, std::exception)
239 uno::Sequence< OUString > aRet(1);
240 aRet[0] = AVMEDIA_GST_WINDOW_SERVICENAME ;
242 return aRet;
245 } // namespace gstreamer
246 } // namespace avmedia
248 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */