Planeshift
pawsprefmanager.h
Go to the documentation of this file.
1 /*
2  * pawsprefmanager.h - Author: Andrew Craig
3  *
4  * Copyright (C) 2003 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 // pawsprefmanager.h: interface for the pawsPrefManager class.
20 //
22 
23 #ifndef PAWS_PREF_MANAGER_HEADER
24 #define PAWS_PREF_MANAGER_HEADER
25 
26 #include <iutil/document.h>
27 #include <csutil/parray.h>
28 #include <csutil/csstring.h>
29 
30 struct iObjectRegistry;
31 struct iVFS;
32 struct iGraphics2D;
33 struct iFont;
34 struct BorderDefinition;
35 class PawsManager;
36 
41 #define BORDER_COLOURS 5
42 
43 
47 {
48 public:
50  virtual ~pawsPrefManager();
51 
52  bool LoadPrefFile(const char* file);
53  bool LoadBorderFile(const char* file);
54 
55  iFont* GetDefaultFont(bool scaled = true)
56  {
57  return scaled?defaultScaledFont:defaultFont;
58  }
59  const char* GetDefaultFontName()
60  {
61  return defaultFontName;
62  }
64  {
65  return defaultFontColour;
66  }
67  int GetBorderColour(int index)
68  {
69  return borderColours[index];
70  }
71 
72  BorderDefinition* GetBorderDefinition(const char* name);
73 private:
74 
75  iObjectRegistry* objectReg;
76  csRef<iVFS> vfs;
77  csRef<iDocumentSystem> xml;
78  csRef<iGraphics2D> graphics2D;
79 
80  csRef<iFont> defaultFont, defaultScaledFont;
81  int defaultFontColour;
82  csString defaultFontName;
83 
84  int borderColours[BORDER_COLOURS];
85 
86  void LoadBorderColours(iDocumentNode* node);
87 
88  csPDelArray<BorderDefinition> borders;
89 };
90 
93 #endif
94 
#define BORDER_COLOURS
const char * GetDefaultFontName()
Defines the images that make the border up.
Definition: pawsborder.h:63
Main PlaneShift Window manager.
Definition: pawsmanager.h:82
iFont * GetDefaultFont(bool scaled=true)
bool LoadPrefFile(const char *file)
int GetDefaultFontColour()
bool LoadBorderFile(const char *file)
Holds/Loads the prefs from a pref file.
int GetBorderColour(int index)
virtual ~pawsPrefManager()
BorderDefinition * GetBorderDefinition(const char *name)