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_factory.hpp"
27 #include "macosx_graphics.hpp"
28 #include "macosx_loop.hpp"
29 #include "macosx_popup.hpp"
30 #include "macosx_timer.hpp"
31 #include "macosx_window.hpp"
32 #include "macosx_tooltip.hpp"
35 MacOSXFactory::MacOSXFactory( intf_thread_t *pIntf ): OSFactory( pIntf ),
42 MacOSXFactory::~MacOSXFactory()
48 bool MacOSXFactory::init()
55 OSGraphics *MacOSXFactory::createOSGraphics( int width, int height )
57 return new MacOSXGraphics( getIntf(), width, height );
61 OSLoop *MacOSXFactory::getOSLoop()
63 return MacOSXLoop::instance( getIntf() );
67 void MacOSXFactory::destroyOSLoop()
69 MacOSXLoop::destroy( getIntf() );
72 void MacOSXFactory::minimize()
77 void MacOSXFactory::restore()
82 void MacOSXFactory::addInTray()
87 void MacOSXFactory::removeFromTray()
92 OSTimer *MacOSXFactory::createOSTimer( const Callback &rCallback )
94 return new MacOSXTimer( getIntf(), rCallback );
98 OSWindow *MacOSXFactory::createOSWindow( GenericWindow &rWindow, bool dragDrop,
99 bool playOnDrop, OSWindow *pParent )
101 return new MacOSXWindow( getIntf(), rWindow, dragDrop,
102 playOnDrop, (MacOSXWindow*)pParent );
106 OSTooltip *MacOSXFactory::createOSTooltip()
108 return new MacOSXTooltip( getIntf() );
112 OSPopup *MacOSXFactory::createOSPopup()
114 return new MacOSXPopup( getIntf() );
118 int MacOSXFactory::getScreenWidth() const
125 int MacOSXFactory::getScreenHeight() const
132 Rect MacOSXFactory::getWorkArea() const
135 return Rect( 0, 0, getScreenWidth(), getScreenHeight() );
139 void MacOSXFactory::getMousePos( int &rXPos, int &rYPos ) const
145 void MacOSXFactory::rmDir( const string &rPath )