Planeshift

npcgui.h

Go to the documentation of this file.
00001 /*
00002 * npcgui.h - Author: Mike Gist
00003 *
00004 * Copyright (C) 2009 Atomic Blue ([email protected], http://www.atomicblue.org)
00005 *
00006 *
00007 * This program is free software; you can redistribute it and/or
00008 * modify it under the terms of the GNU General Public License
00009 * as published by the Free Software Foundation (version 2 of the License)
00010 * This program is distributed in the hope that it will be useful,
00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 * GNU General Public License for more details.
00014 * You should have received a copy of the GNU General Public License
00015 * along with this program; if not, write to the Free Software
00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00017 *
00018 */
00019 
00020 #ifndef __NPCGUI_H__
00021 #define __NPCGUI_H__
00022 
00023 #include "util/genericevent.h"
00024 
00025 #include "paws/pawswidget.h"
00026 
00031 class EventHandler;
00032 class PawsManager;
00033 class pawsComboBox;
00034 class pawsNPCClientWindowFactory;
00035 class pawsMainWidget;
00036 class pawsOkBox;
00037 class pawsYesNoBox;
00038 class psNPCClient;
00039 struct iGraphics2D;
00040 struct iGraphics3D;
00041 struct iObjectRegistry;
00042 
00043 class NpcGui
00044 {
00045 public:
00046     NpcGui(iObjectRegistry* object_reg, psNPCClient* npcclient);
00047     ~NpcGui();
00048 
00049     bool Initialise();
00050 
00051 private:
00052     iObjectRegistry* object_reg;
00053     psNPCClient* npcclient;
00054     csRef<iGraphics3D> g3d;
00055     csRef<iGraphics2D> g2d;
00056 
00057     // PAWS
00058     PawsManager*    paws;
00059     pawsMainWidget* mainWidget;
00060 
00061     // Event handling.
00062     DeclareGenericEventHandler(EventHandler, NpcGui, "planeshift.launcher");
00063     csRef<EventHandler> event_handler;
00064     csRef<iEventQueue> queue;
00065 
00066     /* Handles an event from the event handler */
00067     bool HandleEvent(iEvent &ev);
00068 
00069     /* keeps track of whether the window is visible or not. */
00070     bool drawScreen;
00071 
00072     /* Limits the frame rate either by sleeping. */
00073     void FrameLimit();
00074 
00075     /* Time when the last frame was drawn. */
00076     csTicks elapsed;
00077 
00078     /* Widget for npcclient gui. */
00079     pawsNPCClientWindowFactory* guiWidget;
00080 };
00081 
00082 class pawsNPCClientWindow : public pawsWidget
00083 {
00084 public:
00085     pawsNPCClientWindow();
00086 
00087 private:
00088 };
00089 
00090 CREATE_PAWS_FACTORY(pawsNPCClientWindow);
00091 
00094 #endif // __NPCGUI_H__