mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-18 05:11:42 +00:00
CHANGED: #1471 Added some comments to the headers.
--HG-- branch : gui-refactoring
This commit is contained in:
parent
44643839be
commit
1c1af9fbbc
10 changed files with 69 additions and 7 deletions
|
@ -23,15 +23,39 @@
|
||||||
namespace NLGUI
|
namespace NLGUI
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
Database Manager
|
||||||
|
|
||||||
|
Provides access to a simple CDB based tree hierarchical data store
|
||||||
|
*/
|
||||||
class CDBManager : public NLMISC::CCDBManager
|
class CDBManager : public NLMISC::CCDBManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static CDBManager* getInstance();
|
static CDBManager* getInstance();
|
||||||
static void release();
|
static void release();
|
||||||
|
|
||||||
|
/**
|
||||||
|
Retrieves a leaf node from the database.
|
||||||
|
@param name - name of the data leaf node we are querying.
|
||||||
|
@param create - when true if a node cannot be found it is created.
|
||||||
|
*/
|
||||||
NLMISC::CCDBNodeLeaf* getDbProp( const std::string &name, bool create = true );
|
NLMISC::CCDBNodeLeaf* getDbProp( const std::string &name, bool create = true );
|
||||||
|
|
||||||
|
/**
|
||||||
|
Deletes a node from the database.
|
||||||
|
@param name - name of the node.
|
||||||
|
*/
|
||||||
void delDbProp( const std::string &name );
|
void delDbProp( const std::string &name );
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns a leaf node's content as an sint32
|
||||||
|
@param name - name of the leaf node.
|
||||||
|
*/
|
||||||
sint32 getDbValue32( const std::string &name );
|
sint32 getDbValue32( const std::string &name );
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns the root branch of the database.
|
||||||
|
*/
|
||||||
NLMISC::CCDBNodeBranch* getDB() const;
|
NLMISC::CCDBNodeBranch* getDB() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -63,12 +63,17 @@ namespace NLGUI
|
||||||
friend void TextEndUnparsedElement(HText *me, const char *buffer, int length);
|
friend void TextEndUnparsedElement(HText *me, const char *buffer, int length);
|
||||||
friend int requestTerminater (HTRequest * request, HTResponse * response, void * param, int status);
|
friend int requestTerminater (HTRequest * request, HTResponse * response, void * param, int status);
|
||||||
|
|
||||||
|
/// Web browser options for CGroupHTML
|
||||||
struct SWebOptions
|
struct SWebOptions
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// Id of the browser ( e.g.: Chrome, Firefox, Ryzom )
|
||||||
std::string appName;
|
std::string appName;
|
||||||
|
/// Version of the browser
|
||||||
std::string appVersion;
|
std::string appVersion;
|
||||||
|
/// Language code of the browser( e.g.: en, hu )
|
||||||
std::string languageCode;
|
std::string languageCode;
|
||||||
|
/// List of domains the widget can consider secure.
|
||||||
std::vector< std::string > trustedDomains;
|
std::vector< std::string > trustedDomains;
|
||||||
|
|
||||||
SWebOptions()
|
SWebOptions()
|
||||||
|
|
|
@ -53,15 +53,21 @@ namespace NLGUI
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
/// Interface for parser modules
|
||||||
|
/// Such modules can be plugged into CInterfaceParser, and
|
||||||
|
/// the modules then can parse GUI XMLs for widget classes that are not
|
||||||
|
/// generic enough to be in the GUI library.
|
||||||
class IParserModule
|
class IParserModule
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
/// Various parsing stages
|
||||||
enum ParsingStage
|
enum ParsingStage
|
||||||
{
|
{
|
||||||
None = 0,
|
None = 0, /// module cannot parse in any stage.
|
||||||
Unresolved = 1,
|
Unresolved = 1, /// module can parse in the first stage when styles, templates, etc have not been resolved yet
|
||||||
Resolved = 2,
|
Resolved = 2, /// module can parse after resolving styles and templates
|
||||||
GroupChildren = 4
|
GroupChildren = 4 /// module can parse when parsing the group children
|
||||||
};
|
};
|
||||||
|
|
||||||
IParserModule(){
|
IParserModule(){
|
||||||
|
@ -86,6 +92,7 @@ namespace NLGUI
|
||||||
uint parsingStage;
|
uint parsingStage;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// Interface for event handlers which can be called when setting up the options.
|
||||||
class ISetupOptionCallbackClass
|
class ISetupOptionCallbackClass
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -23,7 +23,11 @@ namespace NLGUI
|
||||||
{
|
{
|
||||||
class CLuaState;
|
class CLuaState;
|
||||||
|
|
||||||
/// Provides a single global access point to the Lua state, and related stuff. :(
|
/**
|
||||||
|
Lua Manager
|
||||||
|
|
||||||
|
Provides a single global access point to the Lua state, and related stuff. :(
|
||||||
|
*/
|
||||||
class CLuaManager
|
class CLuaManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -41,12 +45,20 @@ namespace NLGUI
|
||||||
/// Enables attaching the Lua debugger in the CLuaState instance, only matters on startup.
|
/// Enables attaching the Lua debugger in the CLuaState instance, only matters on startup.
|
||||||
static void enableLuaDebugging(){ debugLua = true; }
|
static void enableLuaDebugging(){ debugLua = true; }
|
||||||
|
|
||||||
|
/// Returns the Lua state.
|
||||||
NLGUI::CLuaState* getLuaState() const{ return luaState; }
|
NLGUI::CLuaState* getLuaState() const{ return luaState; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
Executes a Lua script
|
||||||
|
@param luaScript - the script we want to execute ( the actual script, not the filename! )
|
||||||
|
@param smallScript - true if the script is very small, so it can be cached for the possible next execution.
|
||||||
|
*/
|
||||||
bool executeLuaScript( const std::string &luaScript, bool smallScript = false );
|
bool executeLuaScript( const std::string &luaScript, bool smallScript = false );
|
||||||
|
|
||||||
|
/// Resets the Lua state, that is deallocates it and allocates a new one.
|
||||||
void ResetLuaState();
|
void ResetLuaState();
|
||||||
|
|
||||||
|
/// Forces the Garbage Collector to run.
|
||||||
void forceGarbageCollect();
|
void forceGarbageCollect();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -31,6 +31,7 @@ namespace NLGUI
|
||||||
class CCtrlSheetSelection;
|
class CCtrlSheetSelection;
|
||||||
class CInterfaceLink;
|
class CInterfaceLink;
|
||||||
|
|
||||||
|
/// Interface for the GUI XML parser class.
|
||||||
class IParser
|
class IParser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
namespace NLGUI
|
namespace NLGUI
|
||||||
{
|
{
|
||||||
|
/// Helper class to register reflectable classes
|
||||||
class CReflectableRegister
|
class CReflectableRegister
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -580,6 +580,7 @@ namespace NLGUI
|
||||||
public:
|
public:
|
||||||
static NL3D::UTextContext* getTextContext(){ return textcontext; }
|
static NL3D::UTextContext* getTextContext(){ return textcontext; }
|
||||||
|
|
||||||
|
/// Set of hw cursor images
|
||||||
static std::set< std::string > *hwCursors;
|
static std::set< std::string > *hwCursors;
|
||||||
static float hwCursorScale;
|
static float hwCursorScale;
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@ namespace NLGUI
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
/// Interface for classes which can format the text for this view.
|
||||||
class IViewTextFormatter
|
class IViewTextFormatter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -49,7 +49,7 @@ namespace NLGUI
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// Interface for classes that can provide text to CViewTextId
|
/// Interface for classes which can provide text to CViewTextId
|
||||||
class IViewTextProvider
|
class IViewTextProvider
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -47,11 +47,16 @@ namespace NLGUI
|
||||||
class CInterfaceAnim;
|
class CInterfaceAnim;
|
||||||
class CProcedure;
|
class CProcedure;
|
||||||
|
|
||||||
/// Manages the GUI widgets
|
/**
|
||||||
|
GUI Widget Manager
|
||||||
|
|
||||||
|
Manages the GUI widgets, asks them to draw themselves, etc.
|
||||||
|
*/
|
||||||
class CWidgetManager{
|
class CWidgetManager{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
/// Interface for event handlers that can be called when the screen is resized.
|
||||||
class INewScreenSizeHandler
|
class INewScreenSizeHandler
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -59,6 +64,7 @@ namespace NLGUI
|
||||||
virtual void process( uint32 w, uint32 h ) = 0;
|
virtual void process( uint32 w, uint32 h ) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// Interface for event handlers that can be called when the widgets finished drawing.
|
||||||
class IOnWidgetsDrawnHandler
|
class IOnWidgetsDrawnHandler
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -66,11 +72,15 @@ namespace NLGUI
|
||||||
virtual void process() = 0;
|
virtual void process() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// Frame render times
|
||||||
struct SInterfaceTimes
|
struct SInterfaceTimes
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// Time when the last frame was rendered in ms.
|
||||||
sint64 lastFrameMs;
|
sint64 lastFrameMs;
|
||||||
|
/// Time when the current frame was rendered in ms.
|
||||||
sint64 thisFrameMs;
|
sint64 thisFrameMs;
|
||||||
|
/// Difference between the two times in ms.
|
||||||
sint64 frameDiffMs;
|
sint64 frameDiffMs;
|
||||||
|
|
||||||
SInterfaceTimes()
|
SInterfaceTimes()
|
||||||
|
|
Loading…
Reference in a new issue