MODIFIED: Resolved some GCC build errors.

This commit is contained in:
dfighter1985 2013-02-17 14:30:05 +01:00
parent d71a00399b
commit 6208a10c26
22 changed files with 140 additions and 72 deletions

View file

@ -19,9 +19,9 @@
extern "C" extern "C"
{ {
#include <lua/lua.h> #include <lua.h>
#include <lua/lauxlib.h> #include <lauxlib.h>
#include <lua/lualib.h> #include <lualib.h>
} }
// load the lua dll, return 1 on success // load the lua dll, return 1 on success

View file

@ -1,3 +1,8 @@
FIND_PACKAGE( Libwww REQUIRED )
FIND_PACKAGE( CURL REQUIRED )
FIND_PACKAGE( Lua51 REQUIRED )
FIND_PACKAGE( Luabind REQUIRED )
FILE(GLOB SRC *.cpp *.h) FILE(GLOB SRC *.cpp *.h)
FILE(GLOB HEADERS ../../include/nel/gui/*.h) FILE(GLOB HEADERS ../../include/nel/gui/*.h)
@ -7,8 +12,22 @@ SET_TARGET_PROPERTIES(nelgui PROPERTIES LINK_INTERFACE_LIBRARIES "")
NL_DEFAULT_PROPS(nelgui "NeL, Library: NeL GUI") NL_DEFAULT_PROPS(nelgui "NeL, Library: NeL GUI")
NL_ADD_RUNTIME_FLAGS(nelgui) NL_ADD_RUNTIME_FLAGS(nelgui)
INCLUDE_DIRECTORIES( ${LUA_INCLUDE_DIR} )
NL_ADD_LIB_SUFFIX(nelgui) NL_ADD_LIB_SUFFIX(nelgui)
#MESSAGE( "libww libs: ${LIBWWW_LIBRARIES}" )
TARGET_LINK_LIBRARIES( nelgui
nelmisc
nel3d
${LUA_LIBRARIES}
${LUABIND_LIBRARIES}
${LIBXML2_LIBRARIES}
${LIBWWW_LIBRARIES}
${CURL_LIBRARIES}
)
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
INSTALL(TARGETS nelgui LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) INSTALL(TARGETS nelgui LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries)
ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)

View file

@ -146,7 +146,7 @@ namespace NLGUI
_ToolTipParent= TTCtrl; _ToolTipParent= TTCtrl;
if(prop) if(prop)
{ {
_ToolTipParent = stringToToolTipParent( std::string( prop ) ); _ToolTipParent = stringToToolTipParent( std::string( (const char*)prop ) );
} }
// Tooltip special parent // Tooltip special parent

View file

@ -282,7 +282,8 @@ namespace NLGUI
else else
if( name == "onover" ) if( name == "onover" )
{ {
_AHOnOver = CAHManager::getInstance()->getAH( value, std::string() ); std::string dummy;
_AHOnOver = CAHManager::getInstance()->getAH( value, dummy );
mapAHString( "onover", value ); mapAHString( "onover", value );
return; return;
} }
@ -295,7 +296,8 @@ namespace NLGUI
else else
if( name == "onclick_l" ) if( name == "onclick_l" )
{ {
_AHOnLeftClick = CAHManager::getInstance()->getAH( value, std::string() ); std::string dummy;
_AHOnLeftClick = CAHManager::getInstance()->getAH( value, dummy );
mapAHString( "onclick_l", value ); mapAHString( "onclick_l", value );
return; return;
} }
@ -308,7 +310,8 @@ namespace NLGUI
else else
if( name == "ondblclick_l" ) if( name == "ondblclick_l" )
{ {
_AHOnLeftDblClick = CAHManager::getInstance()->getAH( value, std::string() ); std::string dummy;
_AHOnLeftDblClick = CAHManager::getInstance()->getAH( value, dummy );
mapAHString( "ondblclick_l", value ); mapAHString( "ondblclick_l", value );
return; return;
} }
@ -321,7 +324,8 @@ namespace NLGUI
else else
if( name == "onlongclick_l" ) if( name == "onlongclick_l" )
{ {
_AHOnLeftLongClick = CAHManager::getInstance()->getAH( value, std::string() ); std::string dummy;
_AHOnLeftLongClick = CAHManager::getInstance()->getAH( value, dummy );
mapAHString( "onlongclick_l", value ); mapAHString( "onlongclick_l", value );
return; return;
} }
@ -334,7 +338,8 @@ namespace NLGUI
else else
if( name == "onclick_r" ) if( name == "onclick_r" )
{ {
_AHOnRightClick = CAHManager::getInstance()->getAH( value, std::string() ); std::string dummy;
_AHOnRightClick = CAHManager::getInstance()->getAH( value, dummy );
mapAHString( "onclick_r", value ); mapAHString( "onclick_r", value );
return; return;
} }
@ -347,7 +352,8 @@ namespace NLGUI
else else
if( name == "onclock_tick" ) if( name == "onclock_tick" )
{ {
_AHOnClockTick = CAHManager::getInstance()->getAH( value, std::string() ); std::string dummy;
_AHOnClockTick = CAHManager::getInstance()->getAH( value, dummy );
mapAHString( "onclock_tick", value ); mapAHString( "onclock_tick", value );
return; return;
} }
@ -543,27 +549,27 @@ namespace NLGUI
{ {
prop = (char*) xmlGetProp( cur, BAD_CAST "onover" ); prop = (char*) xmlGetProp( cur, BAD_CAST "onover" );
if( prop != NULL ) if( prop != NULL )
mapAHString( "onover", std::string( prop ) ); mapAHString( "onover", std::string( (const char*)prop ) );
prop = (char*) xmlGetProp( cur, BAD_CAST "onclick_l" ); prop = (char*) xmlGetProp( cur, BAD_CAST "onclick_l" );
if( prop != NULL ) if( prop != NULL )
mapAHString( "onclick_l", std::string( prop ) ); mapAHString( "onclick_l", std::string( (const char*)prop ) );
prop = (char*) xmlGetProp( cur, BAD_CAST "ondblclick_l" ); prop = (char*) xmlGetProp( cur, BAD_CAST "ondblclick_l" );
if( prop != NULL ) if( prop != NULL )
mapAHString( "ondblclick_l", std::string( prop ) ); mapAHString( "ondblclick_l", std::string( (const char*)prop ) );
prop = (char*) xmlGetProp( cur, BAD_CAST "onclick_r" ); prop = (char*) xmlGetProp( cur, BAD_CAST "onclick_r" );
if( prop != NULL ) if( prop != NULL )
mapAHString( "onclick_r", std::string( prop ) ); mapAHString( "onclick_r", std::string( (const char*)prop ) );
prop = (char*) xmlGetProp( cur, BAD_CAST "onlongclick_l" ); prop = (char*) xmlGetProp( cur, BAD_CAST "onlongclick_l" );
if( prop != NULL ) if( prop != NULL )
mapAHString( "onlongclick_l", std::string( prop ) ); mapAHString( "onlongclick_l", std::string( (const char*)prop ) );
prop = (char*) xmlGetProp( cur, BAD_CAST "onclock_tick" ); prop = (char*) xmlGetProp( cur, BAD_CAST "onclock_tick" );
if( prop != NULL ) if( prop != NULL )
mapAHString( "onclock_tick", std::string( prop ) ); mapAHString( "onclock_tick", std::string( (const char*)prop ) );
} }
// Context menu association // Context menu association

View file

@ -231,7 +231,7 @@ namespace NLGUI
prop = (char*) xmlGetProp (cur, (xmlChar*)"align"); prop = (char*) xmlGetProp (cur, (xmlChar*)"align");
if (prop) if (prop)
{ {
setAlignFromString( std::string( prop ) ); setAlignFromString( std::string( (const char*)prop ) );
} }

View file

@ -292,7 +292,8 @@ namespace NLGUI
{ {
_IsDBLink = true; _IsDBLink = true;
_DBLink.link( value.c_str() ); _DBLink.link( value.c_str() );
_DBLink.getNodePtr()->addObserver( this, ICDBNode::CTextId() ); ICDBNode::CTextId dummy;
_DBLink.getNodePtr()->addObserver( this, dummy );
} }
return; return;
} }

View file

@ -1733,7 +1733,8 @@ namespace NLGUI
else else
if( name == "on_open" ) if( name == "on_open" )
{ {
_AHOnOpen = CAHManager::getInstance()->getAH( value, std::string() ); std::string dummy;
_AHOnOpen = CAHManager::getInstance()->getAH( value, dummy );
mapAHString( name, value ); mapAHString( name, value );
return; return;
} }
@ -1746,7 +1747,8 @@ namespace NLGUI
else else
if( name == "on_close" ) if( name == "on_close" )
{ {
_AHOnClose = CAHManager::getInstance()->getAH( value, std::string() ); std::string dummy;
_AHOnClose = CAHManager::getInstance()->getAH( value, dummy );
mapAHString( name, value ); mapAHString( name, value );
return; return;
} }
@ -1759,7 +1761,8 @@ namespace NLGUI
else else
if( name == "on_close_button" ) if( name == "on_close_button" )
{ {
_AHOnCloseButton = CAHManager::getInstance()->getAH( value, std::string() ); std::string dummy;
_AHOnCloseButton = CAHManager::getInstance()->getAH( value, dummy );
mapAHString( name, value ); mapAHString( name, value );
return; return;
} }
@ -1772,7 +1775,8 @@ namespace NLGUI
else else
if( name == "on_move" ) if( name == "on_move" )
{ {
_AHOnMove = CAHManager::getInstance()->getAH( value, std::string() ); std::string dummy;
_AHOnMove = CAHManager::getInstance()->getAH( value, dummy );
mapAHString( name, value ); mapAHString( name, value );
return; return;
} }
@ -1785,7 +1789,8 @@ namespace NLGUI
else else
if( name == "on_deactive_check" ) if( name == "on_deactive_check" )
{ {
_AHOnDeactiveCheck = CAHManager::getInstance()->getAH( value, std::string() ); std::string dummy;
_AHOnDeactiveCheck = CAHManager::getInstance()->getAH( value, dummy );
mapAHString( name, value ); mapAHString( name, value );
return; return;
} }
@ -1798,7 +1803,8 @@ namespace NLGUI
else else
if( name == "on_resize" ) if( name == "on_resize" )
{ {
_AHOnResize = CAHManager::getInstance()->getAH( value, std::string() ); std::string dummy;
_AHOnResize = CAHManager::getInstance()->getAH( value, dummy );
mapAHString( name, value ); mapAHString( name, value );
return; return;
} }
@ -1811,7 +1817,8 @@ namespace NLGUI
else else
if( name == "on_alpha_settings_changed" ) if( name == "on_alpha_settings_changed" )
{ {
_AHOnAlphaSettingsChanged = CAHManager::getInstance()->getAH( value, std::string() ); std::string dummy;
_AHOnAlphaSettingsChanged = CAHManager::getInstance()->getAH( value, dummy );
mapAHString( name, value ); mapAHString( name, value );
return; return;
} }
@ -1824,7 +1831,8 @@ namespace NLGUI
else else
if( name == "on_begin_move" ) if( name == "on_begin_move" )
{ {
_AHOnBeginMove = CAHManager::getInstance()->getAH( value, std::string() ); std::string dummy;
_AHOnBeginMove = CAHManager::getInstance()->getAH( value, dummy );
mapAHString( name, value ); mapAHString( name, value );
return; return;
} }
@ -2224,35 +2232,35 @@ namespace NLGUI
{ {
ptr = xmlGetProp( cur, BAD_CAST "on_open" ); ptr = xmlGetProp( cur, BAD_CAST "on_open" );
if( ptr != NULL ) if( ptr != NULL )
mapAHString( "on_open", std::string( ptr ) ); mapAHString( "on_open", std::string( (const char*)ptr ) );
ptr = xmlGetProp( cur, BAD_CAST "on_close" ); ptr = xmlGetProp( cur, BAD_CAST "on_close" );
if( ptr != NULL ) if( ptr != NULL )
mapAHString( "on_close", std::string( ptr ) ); mapAHString( "on_close", std::string( (const char*)ptr ) );
ptr = xmlGetProp( cur, BAD_CAST "on_close_button" ); ptr = xmlGetProp( cur, BAD_CAST "on_close_button" );
if( ptr != NULL ) if( ptr != NULL )
mapAHString( "on_close_button", std::string( ptr ) ); mapAHString( "on_close_button", std::string( (const char*)ptr ) );
ptr = xmlGetProp( cur, BAD_CAST "on_move" ); ptr = xmlGetProp( cur, BAD_CAST "on_move" );
if( ptr != NULL ) if( ptr != NULL )
mapAHString( "on_move", std::string( ptr ) ); mapAHString( "on_move", std::string( (const char*)ptr ) );
ptr = xmlGetProp( cur, BAD_CAST "on_deactive_check" ); ptr = xmlGetProp( cur, BAD_CAST "on_deactive_check" );
if( ptr != NULL ) if( ptr != NULL )
mapAHString( "on_deactive_check", std::string( ptr ) ); mapAHString( "on_deactive_check", std::string( (const char*)ptr ) );
ptr = xmlGetProp( cur, BAD_CAST "on_resize" ); ptr = xmlGetProp( cur, BAD_CAST "on_resize" );
if( ptr != NULL ) if( ptr != NULL )
mapAHString( "on_resize", std::string( ptr ) ); mapAHString( "on_resize", std::string( (const char*)ptr ) );
ptr = xmlGetProp( cur, BAD_CAST "on_alpha_settings_changed" ); ptr = xmlGetProp( cur, BAD_CAST "on_alpha_settings_changed" );
if( ptr != NULL ) if( ptr != NULL )
mapAHString( "on_alpha_settings_changed", std::string( ptr ) ); mapAHString( "on_alpha_settings_changed", std::string( (const char*)ptr ) );
ptr = xmlGetProp( cur, BAD_CAST "on_begin_move" ); ptr = xmlGetProp( cur, BAD_CAST "on_begin_move" );
if( ptr != NULL ) if( ptr != NULL )
mapAHString( "on_begin_move", std::string( ptr ) ); mapAHString( "on_begin_move", std::string( (const char*)ptr ) );
} }
ptr = xmlGetProp (cur, (xmlChar*)"max_w"); ptr = xmlGetProp (cur, (xmlChar*)"max_w");

View file

@ -25,6 +25,7 @@
#include "nel/gui/widget_manager.h" #include "nel/gui/widget_manager.h"
#include "nel/gui/view_renderer.h" #include "nel/gui/view_renderer.h"
#include "nel/gui/db_manager.h" #include "nel/gui/db_manager.h"
#include <limits>
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;
@ -538,7 +539,7 @@ namespace NLGUI
{ {
prop = (char*) xmlGetProp( cur, BAD_CAST "onenter" ); prop = (char*) xmlGetProp( cur, BAD_CAST "onenter" );
if( prop != NULL ) if( prop != NULL )
mapAHString( "onenter", std::string( prop ) ); mapAHString( "onenter", std::string( (const char*)prop ) );
} }
prop = (char*) xmlGetProp( cur, (xmlChar*)"onchange" ); prop = (char*) xmlGetProp( cur, (xmlChar*)"onchange" );

View file

@ -139,7 +139,7 @@ namespace NLGUI
ptr = (char*) xmlGetProp( cur, (xmlChar*)"options" ); ptr = (char*) xmlGetProp( cur, (xmlChar*)"options" );
if (ptr) if (ptr)
{ {
_Options = std::string( ptr ); _Options = std::string( (const char*)ptr );
} }
// The first type in display type struct is the default display type // The first type in display type struct is the default display type

View file

@ -507,7 +507,7 @@ namespace NLGUI
ptr = (char*) xmlGetProp( cur, (xmlChar*)"hardtext" ); ptr = (char*) xmlGetProp( cur, (xmlChar*)"hardtext" );
if (ptr) if (ptr)
{ {
_HardText = std::string( ptr ); _HardText = std::string( (const char*)ptr );
const char *propPtr = ptr; const char *propPtr = ptr;
ucstring Text = ucstring(propPtr); ucstring Text = ucstring(propPtr);
if ((strlen(propPtr)>2) && (propPtr[0] == 'u') && (propPtr[1] == 'i')) if ((strlen(propPtr)>2) && (propPtr[0] == 'u') && (propPtr[1] == 'i'))

View file

@ -2180,7 +2180,7 @@ namespace NLGUI
if (prop) if (prop)
{ {
if( editorMode ) if( editorMode )
_Extends = std::string( prop ); _Extends = std::string( (const char*)prop );
CGroupMenu *gm = dynamic_cast<CGroupMenu *>(CWidgetManager::getInstance()->getElementFromId(prop)); CGroupMenu *gm = dynamic_cast<CGroupMenu *>(CWidgetManager::getInstance()->getElementFromId(prop));
if (!gm) if (!gm)

View file

@ -462,7 +462,7 @@ namespace NLGUI
ptr = (char*) xmlGetProp( cur, (xmlChar*)"hardtext" ); ptr = (char*) xmlGetProp( cur, (xmlChar*)"hardtext" );
if (ptr) if (ptr)
{ {
_HardText = std::string( ptr ); _HardText = std::string( (const char*)ptr );
const char *propPtr = ptr; const char *propPtr = ptr;
ucstring Text = ucstring(propPtr); ucstring Text = ucstring(propPtr);
if ((strlen(propPtr)>2) && (propPtr[0] == 'u') && (propPtr[1] == 'i')) if ((strlen(propPtr)>2) && (propPtr[0] == 'u') && (propPtr[1] == 'i'))

View file

@ -61,7 +61,8 @@ namespace NLGUI
{ {
if( name == "on_wheel_up" ) if( name == "on_wheel_up" )
{ {
_AHWheelUp = CAHManager::getInstance()->getAH( value, std::string() ); std::string dummy;
_AHWheelUp = CAHManager::getInstance()->getAH( value, dummy );
mapAHString( name, value ); mapAHString( name, value );
return; return;
} }
@ -74,7 +75,8 @@ namespace NLGUI
else else
if( name == "on_wheel_down" ) if( name == "on_wheel_down" )
{ {
_AHWheelDown = CAHManager::getInstance()->getAH( value, std::string() ); std::string dummy;
_AHWheelDown = CAHManager::getInstance()->getAH( value, dummy );
mapAHString( name, value ); mapAHString( name, value );
return; return;
} }
@ -119,11 +121,11 @@ namespace NLGUI
{ {
CXMLAutoPtr ptr( (char*) xmlGetProp( cur, BAD_CAST "on_wheel_up" ) ); CXMLAutoPtr ptr( (char*) xmlGetProp( cur, BAD_CAST "on_wheel_up" ) );
if( ptr != NULL ) if( ptr != NULL )
mapAHString( "on_wheel_up", std::string( ptr ) ); mapAHString( "on_wheel_up", std::string( (const char*)ptr ) );
ptr = (char*) xmlGetProp( cur, BAD_CAST "on_wheel_down" ); ptr = (char*) xmlGetProp( cur, BAD_CAST "on_wheel_down" );
if( ptr != NULL ) if( ptr != NULL )
mapAHString( "on_wheel_down", std::string( ptr ) ); mapAHString( "on_wheel_down", std::string( (const char*)ptr ) );
} }

View file

@ -362,13 +362,13 @@ namespace NLGUI
ptr = (char*) xmlGetProp( cur, (xmlChar*)"posparent" ); ptr = (char*) xmlGetProp( cur, (xmlChar*)"posparent" );
if (ptr) if (ptr)
{ {
setPosParent( std::string( ptr ) ); setPosParent( std::string( (const char*)ptr ) );
} }
ptr = (char*) xmlGetProp( cur, (xmlChar*)"sizeparent" ); ptr = (char*) xmlGetProp( cur, (xmlChar*)"sizeparent" );
if (ptr) if (ptr)
{ {
setSizeParent( std::string( ptr ) ); setSizeParent( std::string( (const char*)ptr ) );
} }
ptr = (char*) xmlGetProp (cur, (xmlChar*)"sizeref"); ptr = (char*) xmlGetProp (cur, (xmlChar*)"sizeref");

View file

@ -348,27 +348,27 @@ namespace NLGUI
{ {
ptr = (char*) xmlGetProp( cur, BAD_CAST "on_active" ); ptr = (char*) xmlGetProp( cur, BAD_CAST "on_active" );
if( ptr != NULL ) if( ptr != NULL )
mapAHString( "on_active", std::string( ptr ) ); mapAHString( "on_active", std::string( (const char*)ptr ) );
ptr = (char*) xmlGetProp( cur, BAD_CAST "on_deactive" ); ptr = (char*) xmlGetProp( cur, BAD_CAST "on_deactive" );
if( ptr != NULL ) if( ptr != NULL )
mapAHString( "on_deactive", std::string( ptr ) ); mapAHString( "on_deactive", std::string( (const char*)ptr ) );
ptr = (char*) xmlGetProp( cur, BAD_CAST "group_onclick_r" ); ptr = (char*) xmlGetProp( cur, BAD_CAST "group_onclick_r" );
if( ptr != NULL ) if( ptr != NULL )
mapAHString( "group_onclick_r", std::string( ptr ) ); mapAHString( "group_onclick_r", std::string( (const char*)ptr ) );
ptr = (char*) xmlGetProp( cur, BAD_CAST "group_onclick_l" ); ptr = (char*) xmlGetProp( cur, BAD_CAST "group_onclick_l" );
if( ptr != NULL ) if( ptr != NULL )
mapAHString( "group_onclick_l", std::string( ptr ) ); mapAHString( "group_onclick_l", std::string( (const char*)ptr ) );
ptr = (char*) xmlGetProp( cur, BAD_CAST "on_enter" ); ptr = (char*) xmlGetProp( cur, BAD_CAST "on_enter" );
if( ptr != NULL ) if( ptr != NULL )
mapAHString( "on_enter", std::string( ptr ) ); mapAHString( "on_enter", std::string( (const char*)ptr ) );
ptr = (char*) xmlGetProp( cur, BAD_CAST "on_escape" ); ptr = (char*) xmlGetProp( cur, BAD_CAST "on_escape" );
if( ptr != NULL ) if( ptr != NULL )
mapAHString( "on_escape", std::string( ptr ) ); mapAHString( "on_escape", std::string( (const char*)ptr ) );
} }
@ -562,7 +562,8 @@ namespace NLGUI
else else
if( name == "on_active" ) if( name == "on_active" )
{ {
_AHOnActive = CAHManager::getInstance()->getAH( value, std::string() ); std::string dummy;
_AHOnActive = CAHManager::getInstance()->getAH( value, dummy );
mapAHString( name, value ); mapAHString( name, value );
return; return;
} }
@ -575,7 +576,8 @@ namespace NLGUI
else else
if( name == "on_deactive" ) if( name == "on_deactive" )
{ {
_AHOnDeactive = CAHManager::getInstance()->getAH( value, std::string() ); std::string dummy;
_AHOnDeactive = CAHManager::getInstance()->getAH( value, dummy );
mapAHString( name, value ); mapAHString( name, value );
return; return;
} }
@ -623,7 +625,8 @@ namespace NLGUI
else else
if( name == "group_onclick_r" ) if( name == "group_onclick_r" )
{ {
_AHOnRightClick = CAHManager::getInstance()->getAH( value, std::string() ); std::string dummy;
_AHOnRightClick = CAHManager::getInstance()->getAH( value, dummy );
mapAHString( name, value ); mapAHString( name, value );
return; return;
} }
@ -636,7 +639,8 @@ namespace NLGUI
else else
if( name == "group_onclick_l" ) if( name == "group_onclick_l" )
{ {
_AHOnLeftClick = CAHManager::getInstance()->getAH( value, std::string() ); std::string dummy;
_AHOnLeftClick = CAHManager::getInstance()->getAH( value, dummy );
mapAHString( name, value ); mapAHString( name, value );
return; return;
} }
@ -649,7 +653,8 @@ namespace NLGUI
else else
if( name == "on_enter" ) if( name == "on_enter" )
{ {
_AHOnEnter = CAHManager::getInstance()->getAH( value, std::string() ); std::string dummy;
_AHOnEnter = CAHManager::getInstance()->getAH( value, dummy );
mapAHString( name, value ); mapAHString( name, value );
return; return;
} }
@ -678,7 +683,8 @@ namespace NLGUI
else else
if( name == "on_escape" ) if( name == "on_escape" )
{ {
_AHOnEscape = CAHManager::getInstance()->getAH( value, std::string() ); std::string dummy;
_AHOnEscape = CAHManager::getInstance()->getAH( value, dummy );
mapAHString( name, value ); mapAHString( name, value );
return; return;
} }

View file

@ -1000,7 +1000,7 @@ namespace NLGUI
std::string target; std::string target;
if( ptr != NULL ) if( ptr != NULL )
{ {
target = std::string( ptr ); target = std::string( (const char*)ptr );
if( !editorMode ) if( !editorMode )
CInterfaceLink::splitLinkTargets(std::string((const char*)ptr), parentGroup, targets); CInterfaceLink::splitLinkTargets(std::string((const char*)ptr), parentGroup, targets);
} }
@ -1134,17 +1134,17 @@ namespace NLGUI
ptr = xmlGetProp( cur, BAD_CAST "entry" ); ptr = xmlGetProp( cur, BAD_CAST "entry" );
if( ptr != NULL ) if( ptr != NULL )
data.entry = std::string( ptr ); data.entry = std::string( (const char*)ptr );
data.type = type; data.type = type;
ptr = xmlGetProp( cur, BAD_CAST "value" ); ptr = xmlGetProp( cur, BAD_CAST "value" );
if( ptr != NULL ) if( ptr != NULL )
data.value = std::string( ptr ); data.value = std::string( (const char*)ptr );
ptr = xmlGetProp( cur, BAD_CAST "size" ); ptr = xmlGetProp( cur, BAD_CAST "size" );
if( ptr != NULL ) if( ptr != NULL )
fromString( std::string( ptr ), data.size ); fromString( std::string( (const char*)ptr ), data.size );
variableCache[ data.entry ] = data; variableCache[ data.entry ] = data;
} }

View file

@ -26,6 +26,8 @@
#include "nel/gui/lua_ihm.h" #include "nel/gui/lua_ihm.h"
#include "nel/gui/view_pointer_base.h" #include "nel/gui/view_pointer_base.h"
#include <limits>
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;
using namespace NL3D; using namespace NL3D;

View file

@ -427,27 +427,36 @@ void CEntityManager::initialize(uint nbMaxEntity)
_EntityGroundFXHandle.resize(_NbMaxEntity); _EntityGroundFXHandle.resize(_NbMaxEntity);
} }
ICDBNode::CTextId textId;
// Add an observer on the mission database // Add an observer on the mission database
CInterfaceManager *pIM = CInterfaceManager::getInstance(); CInterfaceManager *pIM = CInterfaceManager::getInstance();
uint i,j; uint i,j;
for (i=0; i<MAX_NUM_MISSIONS; i++) for (i=0; i<MAX_NUM_MISSIONS; i++)
for (j=0; j<MAX_NUM_MISSION_TARGETS; j++) for (j=0; j<MAX_NUM_MISSION_TARGETS; j++)
{ {
NLGUI::CDBManager::getInstance()->getDB()->addObserver(&MissionTargetObserver, ICDBNode::CTextId( "SERVER:MISSIONS:"+toString(i)+":TARGET"+toString(j)+":TITLE" ) ); textId = ICDBNode::CTextId( "SERVER:MISSIONS:"+toString(i)+":TARGET"+toString(j)+":TITLE" );
NLGUI::CDBManager::getInstance()->getDB()->addObserver(&MissionTargetObserver, textId );
} }
// Add an Observer to the Team database // Add an Observer to the Team database
for (i=0; i<MaxNumPeopleInTeam; i++) for (i=0; i<MaxNumPeopleInTeam; i++)
{ {
NLGUI::CDBManager::getInstance()->getDB()->addObserver(&TeamUIDObserver, ICDBNode::CTextId( toString(TEAM_DB_PATH ":%d:UID", i) ) ); textId = ICDBNode::CTextId( toString(TEAM_DB_PATH ":%d:UID", i) );
NLGUI::CDBManager::getInstance()->getDB()->addObserver(&TeamPresentObserver, ICDBNode::CTextId( toString(TEAM_DB_PATH ":%d:NAME", i) )); NLGUI::CDBManager::getInstance()->getDB()->addObserver(&TeamUIDObserver, textId );
textId = ICDBNode::CTextId( toString(TEAM_DB_PATH ":%d:NAME", i) );
NLGUI::CDBManager::getInstance()->getDB()->addObserver(&TeamPresentObserver, textId );
} }
// Add an Observer to the Animal database // Add an Observer to the Animal database
for (i=0; i<MAX_INVENTORY_ANIMAL; i++) for (i=0; i<MAX_INVENTORY_ANIMAL; i++)
{ {
NLGUI::CDBManager::getInstance()->getDB()->addObserver(&AnimalUIDObserver, ICDBNode::CTextId( toString("SERVER:PACK_ANIMAL:BEAST%d:UID",i) )); textId = ICDBNode::CTextId( toString("SERVER:PACK_ANIMAL:BEAST%d:UID",i) );
NLGUI::CDBManager::getInstance()->getDB()->addObserver(&AnimalStatusObserver, ICDBNode::CTextId( toString("SERVER:PACK_ANIMAL:BEAST%d:STATUS",i) )); NLGUI::CDBManager::getInstance()->getDB()->addObserver(&AnimalUIDObserver, textId );
textId = ICDBNode::CTextId( toString("SERVER:PACK_ANIMAL:BEAST%d:STATUS",i) );
NLGUI::CDBManager::getInstance()->getDB()->addObserver(&AnimalStatusObserver, textId );
} }
}// initialize // }// initialize //

View file

@ -86,12 +86,14 @@ bool CGroupPhraseSkillFilter::parse (xmlNodePtr cur, CInterfaceGroup *parentGrou
// Add observer on each Brick Families because if some brick is learned, a new skill may be displayed // Add observer on each Brick Families because if some brick is learned, a new skill may be displayed
string sTmp; string sTmp;
ICDBNode::CTextId textId;
for (uint k = 0; k < BRICK_FAMILIES::NbFamilies; ++k) for (uint k = 0; k < BRICK_FAMILIES::NbFamilies; ++k)
{ {
_BrickFamilyObs[k].Owner= this; _BrickFamilyObs[k].Owner= this;
_BrickFamilyObs[k].BrickFamily= (BRICK_FAMILIES::TBrickFamily)k; _BrickFamilyObs[k].BrickFamily= (BRICK_FAMILIES::TBrickFamily)k;
sTmp = string(DB_BRICKS)+":"+NLMISC::toString((sint32)k)+":BRICKS"; sTmp = string(DB_BRICKS)+":"+NLMISC::toString((sint32)k)+":BRICKS";
NLGUI::CDBManager::getInstance()->getDB()->addObserver(&(_BrickFamilyObs[k]), ICDBNode::CTextId( sTmp )); textId = ICDBNode::CTextId( sTmp );
NLGUI::CDBManager::getInstance()->getDB()->addObserver(&(_BrickFamilyObs[k]), textId );
} }
_MustRebuild = true; _MustRebuild = true;

View file

@ -86,10 +86,13 @@ bool CGroupSkills::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup)
_SkillsObs.Owner = this; _SkillsObs.Owner = this;
string sTmp; string sTmp;
ICDBNode::CTextId textId;
for (uint k = 0; k < SKILLS::NUM_SKILLS; ++k) for (uint k = 0; k < SKILLS::NUM_SKILLS; ++k)
{ {
sTmp = string(DB_SKILLS)+":"+NLMISC::toString((sint32)k)+":BaseSKILL"; sTmp = string(DB_SKILLS)+":"+NLMISC::toString((sint32)k)+":BaseSKILL";
NLGUI::CDBManager::getInstance()->getDB()->addObserver (&_SkillsObs, ICDBNode::CTextId( sTmp )); textId = ICDBNode::CTextId( sTmp );
NLGUI::CDBManager::getInstance()->getDB()->addObserver (&_SkillsObs, textId );
} }
_MustRebuild = true; _MustRebuild = true;
@ -280,10 +283,12 @@ CGroupSkills::~CGroupSkills()
CInterfaceManager *pIM= CInterfaceManager::getInstance(); CInterfaceManager *pIM= CInterfaceManager::getInstance();
string sTmp; string sTmp;
ICDBNode::CTextId textId;
for (uint k = 0; k < SKILLS::NUM_SKILLS; ++k) for (uint k = 0; k < SKILLS::NUM_SKILLS; ++k)
{ {
sTmp = string(DB_SKILLS)+":"+NLMISC::toString((sint32)k)+":BaseSKILL"; sTmp = string(DB_SKILLS)+":"+NLMISC::toString((sint32)k)+":BaseSKILL";
NLGUI::CDBManager::getInstance()->getDB()->removeObserver(&_SkillsObs, ICDBNode::CTextId( sTmp ) ); textId = ICDBNode::CTextId( sTmp );
NLGUI::CDBManager::getInstance()->getDB()->removeObserver(&_SkillsObs, textId );
} }
// first remove any nodes from the tree group // first remove any nodes from the tree group

View file

@ -3520,12 +3520,16 @@ void CInterfaceManager::CServerToLocalAutoCopy::init(const std::string &dbPath)
// if found // if found
if(_ServerCounter) if(_ServerCounter)
{ {
ICDBNode::CTextId textId;
// **** Add Observers on all nodes // **** Add Observers on all nodes
// add the observers when server node change // add the observers when server node change
NLGUI::CDBManager::getInstance()->getDB()->addObserver(&_ServerObserver, ICDBNode::CTextId( string("SERVER:") + dbPath ) ); textId = ICDBNode::CTextId( string("SERVER:") + dbPath );
NLGUI::CDBManager::getInstance()->getDB()->addObserver(&_ServerObserver, textId );
// add the observers when local node change // add the observers when local node change
NLGUI::CDBManager::getInstance()->getDB()->addObserver(&_LocalObserver, ICDBNode::CTextId( string("LOCAL:") + dbPath ) ); textId = ICDBNode::CTextId( string("LOCAL:") + dbPath );
NLGUI::CDBManager::getInstance()->getDB()->addObserver(&_LocalObserver, textId );
// **** Init the Nodes shortcut // **** Init the Nodes shortcut
// Parse all Local Nodes // Parse all Local Nodes

View file

@ -118,6 +118,8 @@ public:
char * end = ptr.getDatas() + strlen( ptr.getDatas() ); char * end = ptr.getDatas() + strlen( ptr.getDatas() );
char * dataTok = strtok( ptr.getDatas()," ,"); char * dataTok = strtok( ptr.getDatas()," ,");
NLMISC::ICDBNode::CTextId textId;
while(dataTok) while(dataTok)
{ {
std::string data (dataTok); std::string data (dataTok);
@ -160,7 +162,8 @@ public:
return NULL; return NULL;
} }
} }
if ( ! NLGUI::CDBManager::getInstance()->getDB()->addObserver(obs,NLMISC::ICDBNode::CTextId (data) ) ) textId = NLMISC::ICDBNode::CTextId( data );
if ( ! NLGUI::CDBManager::getInstance()->getDB()->addObserver(obs,textId ) )
{ {
return NULL; return NULL;
} }