00001 /* 00002 * The Mana World 00003 * Copyright (C) 2004 The Mana World Development Team 00004 * 00005 * This file is part of The Mana World. 00006 * 00007 * This program is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or 00010 * any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 */ 00021 00022 #ifndef GUI 00023 #define GUI 00024 00025 #include <guichan/gui.hpp> 00026 00027 #include "../guichanfwd.h" 00028 00029 class Graphics; 00030 class GuiConfigListener; 00031 class ImageSet; 00032 class SDLInput; 00033 class Viewport; 00034 00048 class Gui : public gcn::Gui 00049 { 00050 public: 00054 Gui(Graphics *screen); 00055 00059 ~Gui(); 00060 00065 void logic(); 00066 00071 void draw(); 00072 00076 gcn::Font *getFont() const 00077 { return mGuiFont; } 00078 00083 gcn::Font *getInfoParticleFont() const 00084 { return mInfoParticleFont; } 00085 00089 void setUseCustomCursor(bool customCursor); 00090 00094 void setCursorType(int index) 00095 { mCursorType = index; } 00096 00102 enum { 00103 CURSOR_POINTER = 0, 00104 CURSOR_RESIZE_ACROSS, 00105 CURSOR_RESIZE_DOWN, 00106 CURSOR_RESIZE_DOWN_LEFT, 00107 CURSOR_RESIZE_DOWN_RIGHT, 00108 CURSOR_TOTAL 00109 }; 00110 00111 protected: 00112 void handleMouseMoved(const gcn::MouseInput &mouseInput); 00113 00114 private: 00115 GuiConfigListener *mConfigListener; 00116 gcn::Font *mGuiFont; 00117 gcn::Font *mInfoParticleFont; 00118 bool mCustomCursor; 00119 ImageSet *mMouseCursors; 00120 float mMouseCursorAlpha; 00121 int mMouseInactivityTimer; 00122 int mCursorType; 00123 }; 00124 00125 extern Gui *gui; 00126 extern SDLInput *guiInput; 00131 extern gcn::Font *boldFont; 00132 00133 #endif