00001 /***************************************************************************** 00002 * MacOSX_loop.hpp 00003 ***************************************************************************** 00004 * Copyright (C) 2003 the VideoLAN team 00005 * $Id$ 00006 * 00007 * Authors: Cyril Deguet <asmax@via.ecp.fr> 00008 * 00009 * This program is free software; you can redistribute it and/or modify 00010 * it under the terms of the GNU General Public License as published by 00011 * the Free Software Foundation; either version 2 of the License, or 00012 * (at your option) any later version. 00013 * 00014 * This program is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 * GNU General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU General Public License 00020 * along with this program; if not, write to the Free Software 00021 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 00022 *****************************************************************************/ 00023 00024 #ifndef MACOSX_LOOP_HPP 00025 #define MACOSX_LOOP_HPP 00026 00027 #include "../src/os_loop.hpp" 00028 #include <Carbon/Carbon.h> 00029 00030 class MacOSXDisplay; 00031 class GenericWindow; 00032 00033 /// Main event loop for MacOSX (singleton) 00034 class MacOSXLoop: public OSLoop 00035 { 00036 public: 00037 /// Get the instance of MacOSXLoop 00038 static OSLoop *instance( intf_thread_t *pIntf ); 00039 00040 /// Destroy the instance of MacOSXLoop 00041 static void destroy( intf_thread_t *pIntf ); 00042 00043 /// Enter the event loop 00044 virtual void run(); 00045 00046 /// Exit the main loop 00047 virtual void exit(); 00048 00049 // Handle a window event 00050 void registerWindow( GenericWindow &rGenWin, WindowRef win ); 00051 00052 private: 00053 // Private because it's a singleton 00054 MacOSXLoop( intf_thread_t *pIntf ); 00055 virtual ~MacOSXLoop(); 00056 // Flag set to exit the loop 00057 bool m_exit; 00058 }; 00059 00060 #endif
1.5.1