/*************************************************************************** * Copyright (C) 2004 by Christoph Freundl * * Christoph.Freundl@informatik.uni-erlangen.de * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef SDLWIDGETS_ROOTCONTAINER_H #define SDLWIDGETS_ROOTCONTAINER_H #include #include "widget.h" #include "focusable.h" #include "focusmanager.h" namespace SDLwidgets { class RootContainer : public WidgetComposite { private: SDL_Surface* _surface; FocusManager _focus_manager; public: RootContainer( SDL_Surface* surface ) : _surface( surface ) { } virtual RootContainer* getRoot() { return this; } virtual bool handleEvent( SDL_Event* event ); void draw() const; virtual int getWidth() const { return _surface->w; } virtual int getHeight() const { return _surface->h; } void requestFocus( Focusable* widget ) { _focus_manager.requestFocus( widget ); } void removeFocus( Focusable* widget ) { _focus_manager.removeFocus( widget ); } virtual void remove( Widget* widget ); virtual void removeAll(); virtual void removeAndDeleteAll(); }; }; #endif // SDLWIDGETS_ROOTCONTAINER_H