Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | Related Pages

sdlhandler.h

00001 /* 00002 libwftk - Worldforge Toolkit - a widget library 00003 Copyright (C) 2002 Malcolm Walker <malcolm@worldforge.org> 00004 Based on code copyright (C) 1999-2002 Karsten Laux 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Lesser General Public 00008 License as published by the Free Software Foundation; either 00009 version 2.1 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Lesser General Public License for more details. 00015 00016 You should have received a copy of the GNU Lesser General Public 00017 License along with this library; if not, write to the 00018 Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00019 Boston, MA 02111-1307, SA. 00020 */ 00021 00022 #ifndef WFTK_SDL_HANDLER_H 00023 #define WFTK_SDL_HANDLER_H 00024 00025 #include <SDL/SDL_events.h> 00026 00027 #include <wftk/refobj.h> 00028 #include <wftk/application.h> 00029 #include <wftk/marshal.h> 00030 00031 namespace wftk { 00032 00034 class SDLFatal : public Fatal 00035 { 00036 public: 00038 SDLFatal(const std::string& reason); 00039 virtual ~SDLFatal() throw() {} 00040 00042 const std::string& error() const throw() {return sdl_error_;} 00043 00044 private: 00045 std::string sdl_error_; 00046 }; 00047 00048 // SDLEvent might be a better name, but we already have 00049 // SDL_Event, and it would be confusing 00051 class SDLHandler : public Application::Event 00052 { 00053 public: 00055 SDLHandler(const SDL_Event&); 00056 00058 virtual void operator()(); 00059 00061 static void queueEvents(); 00062 00064 static SigC::Signal1<bool,const SDL_UserEvent&,BoolMarshal> userEvent; 00065 00066 private: 00067 SDL_Event event_; 00068 }; 00069 00070 } // namespace 00071 00072 #endif // WFTK_SDL_HANDLER_H

Generated Mon Sep 6 21:58:16 2004.
Copyright © 1998-2003 by the respective authors.

This document is licensed under the terms of the GNU Free Documentation License and may be freely distributed under the conditions given by this license.