1 /*****************************************************************************
3 *****************************************************************************
4 * Copyright (C) 2003 the VideoLAN team
7 * Authors: Cyril Deguet <asmax@via.ecp.fr>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
26 #include "macosx_window.hpp"
27 #include "macosx_loop.hpp"
28 #include "../src/os_factory.hpp"
31 MacOSXWindow::MacOSXWindow( intf_thread_t *pIntf, GenericWindow &rWindow,
32 bool dragDrop, bool playOnDrop,
33 MacOSXWindow *pParentWindow ):
34 OSWindow( pIntf ), m_pParent( pParentWindow ), m_dragDrop( dragDrop )
38 SetRect( &rect, 0, 0, 0, 0 );
39 CreateNewWindow( kDocumentWindowClass, kWindowNoShadowAttribute |
40 kWindowNoTitleBarAttribute, &rect, &m_win );
42 // Create the event handler for this window
43 OSFactory *pOSFactory = OSFactory::instance( getIntf() );
44 ((MacOSXLoop*)pOSFactory->getOSLoop())->registerWindow( rWindow, m_win );
48 MacOSXWindow::~MacOSXWindow()
50 DisposeWindow( m_win );
54 void MacOSXWindow::show( int left, int top ) const
60 void MacOSXWindow::hide() const
66 void MacOSXWindow::moveResize( int left, int top, int width, int height ) const
68 MoveWindow( m_win, left, top, false );
69 SizeWindow( m_win, width, height, true );
73 void MacOSXWindow::raise() const
75 SelectWindow( m_win );
79 void MacOSXWindow::setOpacity( uint8_t value ) const
81 SetWindowAlpha( m_win, (float)value / 255.0 );
85 void MacOSXWindow::toggleOnTop( bool onTop ) const