From b25d4b628fb836e3e6fdf06fdb704f21a7ca454b Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Sun, 17 Feb 2013 14:30:05 +0100 Subject: [PATCH] MODIFIED: Resolved some GCC build errors. --- code/nel/include/nel/gui/lua_loadlib.h | 6 +-- code/nel/src/gui/CMakeLists.txt | 19 +++++++++ code/nel/src/gui/ctrl_base.cpp | 2 +- code/nel/src/gui/ctrl_base_button.cpp | 30 ++++++++------ code/nel/src/gui/ctrl_button.cpp | 2 +- code/nel/src/gui/ctrl_scroll.cpp | 3 +- code/nel/src/gui/group_container.cpp | 40 +++++++++++-------- code/nel/src/gui/group_editbox.cpp | 3 +- code/nel/src/gui/group_frame.cpp | 2 +- code/nel/src/gui/group_list.cpp | 2 +- code/nel/src/gui/group_menu.cpp | 2 +- code/nel/src/gui/group_paragraph.cpp | 2 +- code/nel/src/gui/group_wheel.cpp | 10 +++-- code/nel/src/gui/interface_element.cpp | 4 +- code/nel/src/gui/interface_group.cpp | 30 ++++++++------ code/nel/src/gui/interface_parser.cpp | 8 ++-- code/nel/src/gui/view_text.cpp | 2 + code/ryzom/client/src/entities.cpp | 19 ++++++--- .../group_phrase_skill_filter.cpp | 4 +- .../client/src/interface_v3/group_skills.cpp | 9 ++++- .../src/interface_v3/interface_manager.cpp | 8 +++- .../src/interface_v3/interface_observer.h | 5 ++- 22 files changed, 140 insertions(+), 72 deletions(-) diff --git a/code/nel/include/nel/gui/lua_loadlib.h b/code/nel/include/nel/gui/lua_loadlib.h index 1fe0abcd3..adab3ec0b 100644 --- a/code/nel/include/nel/gui/lua_loadlib.h +++ b/code/nel/include/nel/gui/lua_loadlib.h @@ -19,9 +19,9 @@ extern "C" { -#include -#include -#include +#include +#include +#include } // load the lua dll, return 1 on success diff --git a/code/nel/src/gui/CMakeLists.txt b/code/nel/src/gui/CMakeLists.txt index 67e664ac3..1db5ed186 100644 --- a/code/nel/src/gui/CMakeLists.txt +++ b/code/nel/src/gui/CMakeLists.txt @@ -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 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_ADD_RUNTIME_FLAGS(nelgui) +INCLUDE_DIRECTORIES( ${LUA_INCLUDE_DIR} ) + 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) INSTALL(TARGETS nelgui LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) diff --git a/code/nel/src/gui/ctrl_base.cpp b/code/nel/src/gui/ctrl_base.cpp index a38f3706c..8cd51f026 100644 --- a/code/nel/src/gui/ctrl_base.cpp +++ b/code/nel/src/gui/ctrl_base.cpp @@ -146,7 +146,7 @@ namespace NLGUI _ToolTipParent= TTCtrl; if(prop) { - _ToolTipParent = stringToToolTipParent( std::string( prop ) ); + _ToolTipParent = stringToToolTipParent( std::string( (const char*)prop ) ); } // Tooltip special parent diff --git a/code/nel/src/gui/ctrl_base_button.cpp b/code/nel/src/gui/ctrl_base_button.cpp index bfad912b5..4c892ecc7 100644 --- a/code/nel/src/gui/ctrl_base_button.cpp +++ b/code/nel/src/gui/ctrl_base_button.cpp @@ -282,7 +282,8 @@ namespace NLGUI else if( name == "onover" ) { - _AHOnOver = CAHManager::getInstance()->getAH( value, std::string() ); + std::string dummy; + _AHOnOver = CAHManager::getInstance()->getAH( value, dummy ); mapAHString( "onover", value ); return; } @@ -295,7 +296,8 @@ namespace NLGUI else if( name == "onclick_l" ) { - _AHOnLeftClick = CAHManager::getInstance()->getAH( value, std::string() ); + std::string dummy; + _AHOnLeftClick = CAHManager::getInstance()->getAH( value, dummy ); mapAHString( "onclick_l", value ); return; } @@ -308,7 +310,8 @@ namespace NLGUI else if( name == "ondblclick_l" ) { - _AHOnLeftDblClick = CAHManager::getInstance()->getAH( value, std::string() ); + std::string dummy; + _AHOnLeftDblClick = CAHManager::getInstance()->getAH( value, dummy ); mapAHString( "ondblclick_l", value ); return; } @@ -321,7 +324,8 @@ namespace NLGUI else if( name == "onlongclick_l" ) { - _AHOnLeftLongClick = CAHManager::getInstance()->getAH( value, std::string() ); + std::string dummy; + _AHOnLeftLongClick = CAHManager::getInstance()->getAH( value, dummy ); mapAHString( "onlongclick_l", value ); return; } @@ -334,7 +338,8 @@ namespace NLGUI else if( name == "onclick_r" ) { - _AHOnRightClick = CAHManager::getInstance()->getAH( value, std::string() ); + std::string dummy; + _AHOnRightClick = CAHManager::getInstance()->getAH( value, dummy ); mapAHString( "onclick_r", value ); return; } @@ -347,7 +352,8 @@ namespace NLGUI else if( name == "onclock_tick" ) { - _AHOnClockTick = CAHManager::getInstance()->getAH( value, std::string() ); + std::string dummy; + _AHOnClockTick = CAHManager::getInstance()->getAH( value, dummy ); mapAHString( "onclock_tick", value ); return; } @@ -543,27 +549,27 @@ namespace NLGUI { prop = (char*) xmlGetProp( cur, BAD_CAST "onover" ); if( prop != NULL ) - mapAHString( "onover", std::string( prop ) ); + mapAHString( "onover", std::string( (const char*)prop ) ); prop = (char*) xmlGetProp( cur, BAD_CAST "onclick_l" ); 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" ); 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" ); 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" ); 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" ); if( prop != NULL ) - mapAHString( "onclock_tick", std::string( prop ) ); + mapAHString( "onclock_tick", std::string( (const char*)prop ) ); } // Context menu association diff --git a/code/nel/src/gui/ctrl_button.cpp b/code/nel/src/gui/ctrl_button.cpp index b774a9337..e4ad08074 100644 --- a/code/nel/src/gui/ctrl_button.cpp +++ b/code/nel/src/gui/ctrl_button.cpp @@ -231,7 +231,7 @@ namespace NLGUI prop = (char*) xmlGetProp (cur, (xmlChar*)"align"); if (prop) { - setAlignFromString( std::string( prop ) ); + setAlignFromString( std::string( (const char*)prop ) ); } diff --git a/code/nel/src/gui/ctrl_scroll.cpp b/code/nel/src/gui/ctrl_scroll.cpp index bfcd16de8..d7c6a0fe1 100644 --- a/code/nel/src/gui/ctrl_scroll.cpp +++ b/code/nel/src/gui/ctrl_scroll.cpp @@ -292,7 +292,8 @@ namespace NLGUI { _IsDBLink = true; _DBLink.link( value.c_str() ); - _DBLink.getNodePtr()->addObserver( this, ICDBNode::CTextId() ); + ICDBNode::CTextId dummy; + _DBLink.getNodePtr()->addObserver( this, dummy ); } return; } diff --git a/code/nel/src/gui/group_container.cpp b/code/nel/src/gui/group_container.cpp index 5089f1f35..1c4181e49 100644 --- a/code/nel/src/gui/group_container.cpp +++ b/code/nel/src/gui/group_container.cpp @@ -1733,7 +1733,8 @@ namespace NLGUI else if( name == "on_open" ) { - _AHOnOpen = CAHManager::getInstance()->getAH( value, std::string() ); + std::string dummy; + _AHOnOpen = CAHManager::getInstance()->getAH( value, dummy ); mapAHString( name, value ); return; } @@ -1746,7 +1747,8 @@ namespace NLGUI else if( name == "on_close" ) { - _AHOnClose = CAHManager::getInstance()->getAH( value, std::string() ); + std::string dummy; + _AHOnClose = CAHManager::getInstance()->getAH( value, dummy ); mapAHString( name, value ); return; } @@ -1759,7 +1761,8 @@ namespace NLGUI else if( name == "on_close_button" ) { - _AHOnCloseButton = CAHManager::getInstance()->getAH( value, std::string() ); + std::string dummy; + _AHOnCloseButton = CAHManager::getInstance()->getAH( value, dummy ); mapAHString( name, value ); return; } @@ -1772,7 +1775,8 @@ namespace NLGUI else if( name == "on_move" ) { - _AHOnMove = CAHManager::getInstance()->getAH( value, std::string() ); + std::string dummy; + _AHOnMove = CAHManager::getInstance()->getAH( value, dummy ); mapAHString( name, value ); return; } @@ -1785,7 +1789,8 @@ namespace NLGUI else if( name == "on_deactive_check" ) { - _AHOnDeactiveCheck = CAHManager::getInstance()->getAH( value, std::string() ); + std::string dummy; + _AHOnDeactiveCheck = CAHManager::getInstance()->getAH( value, dummy ); mapAHString( name, value ); return; } @@ -1798,7 +1803,8 @@ namespace NLGUI else if( name == "on_resize" ) { - _AHOnResize = CAHManager::getInstance()->getAH( value, std::string() ); + std::string dummy; + _AHOnResize = CAHManager::getInstance()->getAH( value, dummy ); mapAHString( name, value ); return; } @@ -1811,7 +1817,8 @@ namespace NLGUI else 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 ); return; } @@ -1824,7 +1831,8 @@ namespace NLGUI else if( name == "on_begin_move" ) { - _AHOnBeginMove = CAHManager::getInstance()->getAH( value, std::string() ); + std::string dummy; + _AHOnBeginMove = CAHManager::getInstance()->getAH( value, dummy ); mapAHString( name, value ); return; } @@ -2224,35 +2232,35 @@ namespace NLGUI { ptr = xmlGetProp( cur, BAD_CAST "on_open" ); if( ptr != NULL ) - mapAHString( "on_open", std::string( ptr ) ); + mapAHString( "on_open", std::string( (const char*)ptr ) ); ptr = xmlGetProp( cur, BAD_CAST "on_close" ); 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" ); 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" ); 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" ); 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" ); 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" ); 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" ); 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"); diff --git a/code/nel/src/gui/group_editbox.cpp b/code/nel/src/gui/group_editbox.cpp index 5d532cfcc..77e8f1b6a 100644 --- a/code/nel/src/gui/group_editbox.cpp +++ b/code/nel/src/gui/group_editbox.cpp @@ -25,6 +25,7 @@ #include "nel/gui/widget_manager.h" #include "nel/gui/view_renderer.h" #include "nel/gui/db_manager.h" +#include using namespace std; using namespace NLMISC; @@ -538,7 +539,7 @@ namespace NLGUI { prop = (char*) xmlGetProp( cur, BAD_CAST "onenter" ); if( prop != NULL ) - mapAHString( "onenter", std::string( prop ) ); + mapAHString( "onenter", std::string( (const char*)prop ) ); } prop = (char*) xmlGetProp( cur, (xmlChar*)"onchange" ); diff --git a/code/nel/src/gui/group_frame.cpp b/code/nel/src/gui/group_frame.cpp index c14e24f20..0d8855acb 100644 --- a/code/nel/src/gui/group_frame.cpp +++ b/code/nel/src/gui/group_frame.cpp @@ -139,7 +139,7 @@ namespace NLGUI ptr = (char*) xmlGetProp( cur, (xmlChar*)"options" ); if (ptr) { - _Options = std::string( ptr ); + _Options = std::string( (const char*)ptr ); } // The first type in display type struct is the default display type diff --git a/code/nel/src/gui/group_list.cpp b/code/nel/src/gui/group_list.cpp index 485418d22..25c0668cb 100644 --- a/code/nel/src/gui/group_list.cpp +++ b/code/nel/src/gui/group_list.cpp @@ -507,7 +507,7 @@ namespace NLGUI ptr = (char*) xmlGetProp( cur, (xmlChar*)"hardtext" ); if (ptr) { - _HardText = std::string( ptr ); + _HardText = std::string( (const char*)ptr ); const char *propPtr = ptr; ucstring Text = ucstring(propPtr); if ((strlen(propPtr)>2) && (propPtr[0] == 'u') && (propPtr[1] == 'i')) diff --git a/code/nel/src/gui/group_menu.cpp b/code/nel/src/gui/group_menu.cpp index ac630b554..b1c5ff1fb 100644 --- a/code/nel/src/gui/group_menu.cpp +++ b/code/nel/src/gui/group_menu.cpp @@ -2180,7 +2180,7 @@ namespace NLGUI if (prop) { if( editorMode ) - _Extends = std::string( prop ); + _Extends = std::string( (const char*)prop ); CGroupMenu *gm = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(prop)); if (!gm) diff --git a/code/nel/src/gui/group_paragraph.cpp b/code/nel/src/gui/group_paragraph.cpp index b38be9d78..f05d7e3a1 100644 --- a/code/nel/src/gui/group_paragraph.cpp +++ b/code/nel/src/gui/group_paragraph.cpp @@ -462,7 +462,7 @@ namespace NLGUI ptr = (char*) xmlGetProp( cur, (xmlChar*)"hardtext" ); if (ptr) { - _HardText = std::string( ptr ); + _HardText = std::string( (const char*)ptr ); const char *propPtr = ptr; ucstring Text = ucstring(propPtr); if ((strlen(propPtr)>2) && (propPtr[0] == 'u') && (propPtr[1] == 'i')) diff --git a/code/nel/src/gui/group_wheel.cpp b/code/nel/src/gui/group_wheel.cpp index 7baeabcaa..9c1097092 100644 --- a/code/nel/src/gui/group_wheel.cpp +++ b/code/nel/src/gui/group_wheel.cpp @@ -61,7 +61,8 @@ namespace NLGUI { if( name == "on_wheel_up" ) { - _AHWheelUp = CAHManager::getInstance()->getAH( value, std::string() ); + std::string dummy; + _AHWheelUp = CAHManager::getInstance()->getAH( value, dummy ); mapAHString( name, value ); return; } @@ -74,7 +75,8 @@ namespace NLGUI else if( name == "on_wheel_down" ) { - _AHWheelDown = CAHManager::getInstance()->getAH( value, std::string() ); + std::string dummy; + _AHWheelDown = CAHManager::getInstance()->getAH( value, dummy ); mapAHString( name, value ); return; } @@ -119,11 +121,11 @@ namespace NLGUI { CXMLAutoPtr ptr( (char*) xmlGetProp( cur, BAD_CAST "on_wheel_up" ) ); 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" ); if( ptr != NULL ) - mapAHString( "on_wheel_down", std::string( ptr ) ); + mapAHString( "on_wheel_down", std::string( (const char*)ptr ) ); } diff --git a/code/nel/src/gui/interface_element.cpp b/code/nel/src/gui/interface_element.cpp index a2e236e1c..b369b96d1 100644 --- a/code/nel/src/gui/interface_element.cpp +++ b/code/nel/src/gui/interface_element.cpp @@ -362,13 +362,13 @@ namespace NLGUI ptr = (char*) xmlGetProp( cur, (xmlChar*)"posparent" ); if (ptr) { - setPosParent( std::string( ptr ) ); + setPosParent( std::string( (const char*)ptr ) ); } ptr = (char*) xmlGetProp( cur, (xmlChar*)"sizeparent" ); if (ptr) { - setSizeParent( std::string( ptr ) ); + setSizeParent( std::string( (const char*)ptr ) ); } ptr = (char*) xmlGetProp (cur, (xmlChar*)"sizeref"); diff --git a/code/nel/src/gui/interface_group.cpp b/code/nel/src/gui/interface_group.cpp index a2bb0a8c2..c4ba1e950 100644 --- a/code/nel/src/gui/interface_group.cpp +++ b/code/nel/src/gui/interface_group.cpp @@ -348,27 +348,27 @@ namespace NLGUI { ptr = (char*) xmlGetProp( cur, BAD_CAST "on_active" ); 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" ); 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" ); 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" ); 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" ); 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" ); if( ptr != NULL ) - mapAHString( "on_escape", std::string( ptr ) ); + mapAHString( "on_escape", std::string( (const char*)ptr ) ); } @@ -562,7 +562,8 @@ namespace NLGUI else if( name == "on_active" ) { - _AHOnActive = CAHManager::getInstance()->getAH( value, std::string() ); + std::string dummy; + _AHOnActive = CAHManager::getInstance()->getAH( value, dummy ); mapAHString( name, value ); return; } @@ -575,7 +576,8 @@ namespace NLGUI else if( name == "on_deactive" ) { - _AHOnDeactive = CAHManager::getInstance()->getAH( value, std::string() ); + std::string dummy; + _AHOnDeactive = CAHManager::getInstance()->getAH( value, dummy ); mapAHString( name, value ); return; } @@ -623,7 +625,8 @@ namespace NLGUI else if( name == "group_onclick_r" ) { - _AHOnRightClick = CAHManager::getInstance()->getAH( value, std::string() ); + std::string dummy; + _AHOnRightClick = CAHManager::getInstance()->getAH( value, dummy ); mapAHString( name, value ); return; } @@ -636,7 +639,8 @@ namespace NLGUI else if( name == "group_onclick_l" ) { - _AHOnLeftClick = CAHManager::getInstance()->getAH( value, std::string() ); + std::string dummy; + _AHOnLeftClick = CAHManager::getInstance()->getAH( value, dummy ); mapAHString( name, value ); return; } @@ -649,7 +653,8 @@ namespace NLGUI else if( name == "on_enter" ) { - _AHOnEnter = CAHManager::getInstance()->getAH( value, std::string() ); + std::string dummy; + _AHOnEnter = CAHManager::getInstance()->getAH( value, dummy ); mapAHString( name, value ); return; } @@ -678,7 +683,8 @@ namespace NLGUI else if( name == "on_escape" ) { - _AHOnEscape = CAHManager::getInstance()->getAH( value, std::string() ); + std::string dummy; + _AHOnEscape = CAHManager::getInstance()->getAH( value, dummy ); mapAHString( name, value ); return; } diff --git a/code/nel/src/gui/interface_parser.cpp b/code/nel/src/gui/interface_parser.cpp index 235fb56a5..cdc42c661 100644 --- a/code/nel/src/gui/interface_parser.cpp +++ b/code/nel/src/gui/interface_parser.cpp @@ -1000,7 +1000,7 @@ namespace NLGUI std::string target; if( ptr != NULL ) { - target = std::string( ptr ); + target = std::string( (const char*)ptr ); if( !editorMode ) CInterfaceLink::splitLinkTargets(std::string((const char*)ptr), parentGroup, targets); } @@ -1134,17 +1134,17 @@ namespace NLGUI ptr = xmlGetProp( cur, BAD_CAST "entry" ); if( ptr != NULL ) - data.entry = std::string( ptr ); + data.entry = std::string( (const char*)ptr ); data.type = type; ptr = xmlGetProp( cur, BAD_CAST "value" ); if( ptr != NULL ) - data.value = std::string( ptr ); + data.value = std::string( (const char*)ptr ); ptr = xmlGetProp( cur, BAD_CAST "size" ); if( ptr != NULL ) - fromString( std::string( ptr ), data.size ); + fromString( std::string( (const char*)ptr ), data.size ); variableCache[ data.entry ] = data; } diff --git a/code/nel/src/gui/view_text.cpp b/code/nel/src/gui/view_text.cpp index a15f8adba..85e76a09c 100644 --- a/code/nel/src/gui/view_text.cpp +++ b/code/nel/src/gui/view_text.cpp @@ -26,6 +26,8 @@ #include "nel/gui/lua_ihm.h" #include "nel/gui/view_pointer_base.h" +#include + using namespace std; using namespace NLMISC; using namespace NL3D; diff --git a/code/ryzom/client/src/entities.cpp b/code/ryzom/client/src/entities.cpp index 9bc81c1fc..eec5a6b5a 100644 --- a/code/ryzom/client/src/entities.cpp +++ b/code/ryzom/client/src/entities.cpp @@ -426,6 +426,8 @@ void CEntityManager::initialize(uint nbMaxEntity) _Entities.resize(_NbMaxEntity, 0); _EntityGroundFXHandle.resize(_NbMaxEntity); } + + ICDBNode::CTextId textId; // Add an observer on the mission database CInterfaceManager *pIM = CInterfaceManager::getInstance(); @@ -433,21 +435,28 @@ void CEntityManager::initialize(uint nbMaxEntity) for (i=0; igetDB()->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 for (i=0; igetDB()->addObserver(&TeamUIDObserver, ICDBNode::CTextId( toString(TEAM_DB_PATH ":%d:UID", i) ) ); - NLGUI::CDBManager::getInstance()->getDB()->addObserver(&TeamPresentObserver, ICDBNode::CTextId( toString(TEAM_DB_PATH ":%d:NAME", i) )); + textId = ICDBNode::CTextId( toString(TEAM_DB_PATH ":%d:UID", 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 for (i=0; igetDB()->addObserver(&AnimalUIDObserver, 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) )); + textId = ICDBNode::CTextId( toString("SERVER:PACK_ANIMAL:BEAST%d:UID",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 // diff --git a/code/ryzom/client/src/interface_v3/group_phrase_skill_filter.cpp b/code/ryzom/client/src/interface_v3/group_phrase_skill_filter.cpp index dfecd20fe..8d55726a1 100644 --- a/code/ryzom/client/src/interface_v3/group_phrase_skill_filter.cpp +++ b/code/ryzom/client/src/interface_v3/group_phrase_skill_filter.cpp @@ -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 string sTmp; + ICDBNode::CTextId textId; for (uint k = 0; k < BRICK_FAMILIES::NbFamilies; ++k) { _BrickFamilyObs[k].Owner= this; _BrickFamilyObs[k].BrickFamily= (BRICK_FAMILIES::TBrickFamily)k; 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; diff --git a/code/ryzom/client/src/interface_v3/group_skills.cpp b/code/ryzom/client/src/interface_v3/group_skills.cpp index dcbc9c262..e414ab4e4 100644 --- a/code/ryzom/client/src/interface_v3/group_skills.cpp +++ b/code/ryzom/client/src/interface_v3/group_skills.cpp @@ -86,10 +86,13 @@ bool CGroupSkills::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup) _SkillsObs.Owner = this; string sTmp; + ICDBNode::CTextId textId; + for (uint k = 0; k < SKILLS::NUM_SKILLS; ++k) { 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; @@ -280,10 +283,12 @@ CGroupSkills::~CGroupSkills() CInterfaceManager *pIM= CInterfaceManager::getInstance(); string sTmp; + ICDBNode::CTextId textId; for (uint k = 0; k < SKILLS::NUM_SKILLS; ++k) { 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 diff --git a/code/ryzom/client/src/interface_v3/interface_manager.cpp b/code/ryzom/client/src/interface_v3/interface_manager.cpp index e1855395c..65eda61e8 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.cpp +++ b/code/ryzom/client/src/interface_v3/interface_manager.cpp @@ -3520,12 +3520,16 @@ void CInterfaceManager::CServerToLocalAutoCopy::init(const std::string &dbPath) // if found if(_ServerCounter) { + ICDBNode::CTextId textId; + // **** Add Observers on all nodes // 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 - 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 // Parse all Local Nodes diff --git a/code/ryzom/client/src/interface_v3/interface_observer.h b/code/ryzom/client/src/interface_v3/interface_observer.h index ea411d6a8..4261f10a4 100644 --- a/code/ryzom/client/src/interface_v3/interface_observer.h +++ b/code/ryzom/client/src/interface_v3/interface_observer.h @@ -118,6 +118,8 @@ public: char * end = ptr.getDatas() + strlen( ptr.getDatas() ); char * dataTok = strtok( ptr.getDatas()," ,"); + NLMISC::ICDBNode::CTextId textId; + while(dataTok) { std::string data (dataTok); @@ -160,7 +162,8 @@ public: 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; }