Planeshift
npcgui.h
Go to the documentation of this file.
1 /*
2 * npcgui.h - Author: Mike Gist
3 *
4 * Copyright (C) 2009 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5 *
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation (version 2 of the License)
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 *
18 */
19 
20 #ifndef __NPCGUI_H__
21 #define __NPCGUI_H__
22 
23 #include "util/genericevent.h"
24 
25 #include "paws/pawswidget.h"
26 
31 class EventHandler;
32 class PawsManager;
33 class pawsComboBox;
34 class pawsNPCClientWindowFactory;
35 class pawsMainWidget;
36 class pawsOkBox;
37 class pawsYesNoBox;
38 class psNPCClient;
39 struct iGraphics2D;
40 struct iGraphics3D;
41 struct iObjectRegistry;
42 
43 class NpcGui
44 {
45 public:
46  NpcGui(iObjectRegistry* object_reg, psNPCClient* npcclient);
47  ~NpcGui();
48 
49  bool Initialise();
50 
51 private:
52  iObjectRegistry* object_reg;
53  psNPCClient* npcclient;
54  csRef<iGraphics3D> g3d;
55  csRef<iGraphics2D> g2d;
56 
57  // PAWS
58  PawsManager* paws;
59  pawsMainWidget* mainWidget;
60 
61  // Event handling.
62  DeclareGenericEventHandler(EventHandler, NpcGui, "planeshift.launcher");
63  csRef<EventHandler> event_handler;
64  csRef<iEventQueue> queue;
65 
66  /* Handles an event from the event handler */
67  bool HandleEvent(iEvent &ev);
68 
69  /* keeps track of whether the window is visible or not. */
70  bool drawScreen;
71 
72  /* Limits the frame rate either by sleeping. */
73  void FrameLimit();
74 
75  /* Time when the last frame was drawn. */
76  csTicks elapsed;
77 
78  /* Widget for npcclient gui. */
79  pawsNPCClientWindowFactory* guiWidget;
80 };
81 
83 {
84 public:
86 
87 private:
88 };
89 
91 
94 #endif // __NPCGUI_H__
The main base widget that all other widgets should inherit from.
Definition: pawswidget.h:116
NpcGui(iObjectRegistry *object_reg, psNPCClient *npcclient)
This is an ok button window box.
Definition: pawsokbox.h:39
Main PlaneShift Window manager.
Definition: pawsmanager.h:82
bool Initialise()
The main NPC Client class holding references to important superclient objects.
Definition: npcclient.h:81
The main or desktop widget.
This is a yes/no box used to do confirms.
Definition: pawsyesnobox.h:41
CREATE_PAWS_FACTORY(pawsNPCClientWindow)
A basic combo box widget.
Definition: pawscombo.h:53
Definition: npcgui.h:43