From 56a75a90abeed8eedc97aa5d3009e80687753b69 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Sat, 9 Jun 2012 01:37:43 +0200 Subject: [PATCH] CHANGED: #1471 Finally moved some of the basic widget classes and the widget manager, action handler manager to the GUI lib. Also moved some GUI related methods back to CLuaIHM. --HG-- branch : gui-refactoring --- .../include/nel/gui}/action_handler.h | 0 .../include/nel/gui}/ctrl_base.h | 2 +- .../include/nel/gui}/ctrl_draggable.h | 2 +- .../include/nel/gui}/ctrl_scroll_base.h | 2 +- code/nel/include/nel/gui/event_descriptor.h | 1 + .../include/nel/gui}/group_container_base.h | 2 +- .../include/nel/gui}/group_editbox_base.h | 2 +- .../include/nel/gui}/group_frame.h | 2 +- .../include/nel/gui}/group_modal.h | 2 +- .../include/nel/gui}/interface_element.h | 1 + .../include/nel/gui}/interface_group.h | 4 +- .../include/nel/gui}/interface_link.h | 0 .../include/nel/gui}/interface_options.h | 5 +- code/nel/include/nel/gui/lua_ihm.h | 20 +- .../include/nel/gui}/view_base.h | 2 +- .../include/nel/gui}/view_pointer_base.h | 2 +- .../include/nel/gui}/widget_manager.h | 0 .../src/gui}/action_handler.cpp | 9 +- .../src/gui}/ctrl_base.cpp | 10 +- .../src/gui}/ctrl_draggable.cpp | 2 +- .../src/gui}/ctrl_scroll_base.cpp | 2 +- .../src/gui}/group_container_base.cpp | 2 +- .../src/gui}/group_editbox_base.cpp | 2 +- .../src/gui}/group_frame.cpp | 8 +- .../src/gui}/group_modal.cpp | 4 +- .../src/gui}/interface_element.cpp | 10 +- .../src/gui}/interface_group.cpp | 23 +- .../src/gui}/interface_link.cpp | 11 +- .../src/gui}/interface_options.cpp | 4 +- code/nel/src/gui/lua_ihm.cpp | 432 ++++++++++++++- .../src/gui}/view_base.cpp | 6 +- .../src/gui}/view_pointer_base.cpp | 2 +- .../src/gui}/widget_manager.cpp | 16 +- code/ryzom/client/src/camera_recorder.cpp | 2 +- code/ryzom/client/src/client_chat_manager.cpp | 2 +- code/ryzom/client/src/connection.cpp | 2 +- code/ryzom/client/src/entity_cl.cpp | 2 +- code/ryzom/client/src/game_context_menu.h | 2 +- code/ryzom/client/src/init.cpp | 2 +- code/ryzom/client/src/init_main_loop.cpp | 2 +- .../src/interface_v3/action_handler_debug.cpp | 2 +- .../src/interface_v3/action_handler_edit.cpp | 2 +- .../src/interface_v3/action_handler_game.cpp | 4 +- .../src/interface_v3/action_handler_help.cpp | 2 +- .../src/interface_v3/action_handler_item.cpp | 2 +- .../src/interface_v3/action_handler_misc.cpp | 2 +- .../src/interface_v3/action_handler_misc.h | 2 +- .../src/interface_v3/action_handler_move.cpp | 2 +- .../interface_v3/action_handler_outpost.cpp | 2 +- .../interface_v3/action_handler_phrase.cpp | 2 +- .../src/interface_v3/action_handler_tools.cpp | 2 +- .../src/interface_v3/action_handler_ui.cpp | 2 +- .../src/interface_v3/action_phrase_faber.cpp | 2 +- .../src/interface_v3/bot_chat_manager.cpp | 4 +- .../client/src/interface_v3/bot_chat_page.cpp | 2 +- .../bot_chat_page_create_guild.cpp | 4 +- .../bot_chat_page_dynamic_mission.cpp | 4 +- .../interface_v3/bot_chat_page_mission.cpp | 4 +- .../bot_chat_page_mission_end.cpp | 2 +- .../src/interface_v3/bot_chat_page_news.cpp | 2 +- .../bot_chat_page_player_gift.cpp | 4 +- .../src/interface_v3/bot_chat_page_trade.cpp | 4 +- .../client/src/interface_v3/character_3d.h | 4 +- .../client/src/interface_v3/chat_window.cpp | 2 +- .../src/interface_v3/ctrl_base_button.h | 4 +- .../client/src/interface_v3/ctrl_col_pick.h | 2 +- .../client/src/interface_v3/ctrl_polygon.h | 2 +- .../client/src/interface_v3/ctrl_quad.cpp | 2 +- .../ryzom/client/src/interface_v3/ctrl_quad.h | 2 +- .../client/src/interface_v3/ctrl_scroll.cpp | 6 +- .../client/src/interface_v3/ctrl_scroll.h | 2 +- .../src/interface_v3/ctrl_text_button.cpp | 2 +- .../client/src/interface_v3/ctrl_tooltip.h | 2 +- .../client/src/interface_v3/dbctrl_sheet.cpp | 4 +- .../client/src/interface_v3/dbctrl_sheet.h | 4 +- .../src/interface_v3/dbgroup_build_phrase.h | 2 +- .../src/interface_v3/dbgroup_combo_box.cpp | 2 +- .../src/interface_v3/dbgroup_combo_box.h | 2 +- .../src/interface_v3/dbgroup_list_sheet.cpp | 2 +- .../interface_v3/dbgroup_list_sheet_text.cpp | 2 +- .../interface_v3/dbgroup_list_sheet_trade.cpp | 2 +- .../interface_v3/dbgroup_select_number.cpp | 2 +- .../src/interface_v3/dbgroup_select_number.h | 2 +- .../client/src/interface_v3/dbview_digit.h | 2 +- .../client/src/interface_v3/group_career.cpp | 2 +- .../client/src/interface_v3/group_compas.cpp | 2 +- .../src/interface_v3/group_container.cpp | 4 +- .../client/src/interface_v3/group_container.h | 4 +- .../client/src/interface_v3/group_editbox.cpp | 2 +- .../client/src/interface_v3/group_editbox.h | 4 +- .../client/src/interface_v3/group_html.cpp | 2 +- .../client/src/interface_v3/group_html.h | 2 +- .../interface_v3/group_in_scene_bubble.cpp | 2 +- .../interface_v3/group_in_scene_user_info.cpp | 2 +- .../client/src/interface_v3/group_list.cpp | 18 +- .../client/src/interface_v3/group_list.h | 2 +- .../client/src/interface_v3/group_map.cpp | 2 +- .../ryzom/client/src/interface_v3/group_map.h | 2 +- .../client/src/interface_v3/group_menu.cpp | 20 +- .../client/src/interface_v3/group_menu.h | 4 +- .../src/interface_v3/group_modal_get_key.h | 2 +- .../src/interface_v3/group_paragraph.cpp | 2 +- .../client/src/interface_v3/group_paragraph.h | 2 +- .../interface_v3/group_phrase_skill_filter.h | 2 +- .../src/interface_v3/group_quick_help.cpp | 2 +- .../src/interface_v3/group_scrolltext.cpp | 2 +- .../src/interface_v3/group_scrolltext.h | 2 +- .../client/src/interface_v3/group_skills.h | 2 +- .../client/src/interface_v3/group_tab.cpp | 8 +- .../ryzom/client/src/interface_v3/group_tab.h | 2 +- .../client/src/interface_v3/group_table.cpp | 2 +- .../client/src/interface_v3/group_table.h | 2 +- .../client/src/interface_v3/group_tree.cpp | 6 +- .../client/src/interface_v3/group_tree.h | 2 +- .../client/src/interface_v3/group_wheel.h | 2 +- .../client/src/interface_v3/guild_manager.cpp | 2 +- .../src/interface_v3/interface_3d_scene.cpp | 2 +- .../src/interface_v3/interface_3d_scene.h | 2 +- .../src/interface_v3/interface_anim.cpp | 2 +- .../client/src/interface_v3/interface_anim.h | 4 +- .../client/src/interface_v3/interface_ddx.cpp | 4 +- .../client/src/interface_v3/interface_ddx.h | 2 +- .../interface_expr_user_fct_game.cpp | 2 +- .../src/interface_v3/interface_manager.cpp | 8 +- .../src/interface_v3/interface_manager.h | 10 +- .../interface_v3/interface_options_ryzom.cpp | 2 +- .../interface_v3/interface_options_ryzom.h | 2 +- .../src/interface_v3/interface_parser.cpp | 8 +- .../src/interface_v3/interface_parser.h | 4 +- .../src/interface_v3/inventory_manager.cpp | 2 +- .../client/src/interface_v3/list_sheet_base.h | 2 +- .../client/src/interface_v3/lua_ihm_ryzom.cpp | 494 ++---------------- .../client/src/interface_v3/lua_ihm_ryzom.h | 12 - .../client/src/interface_v3/macrocmd_key.cpp | 2 +- .../src/interface_v3/macrocmd_manager.cpp | 2 +- .../client/src/interface_v3/music_player.cpp | 2 +- .../src/interface_v3/people_interraction.cpp | 2 +- .../client/src/interface_v3/people_list.cpp | 2 +- .../client/src/interface_v3/player_trade.cpp | 2 +- .../register_interface_elements.cpp | 18 +- .../client/src/interface_v3/skill_manager.cpp | 2 +- .../client/src/interface_v3/sphrase_manager.h | 2 +- .../src/interface_v3/task_bar_manager.cpp | 2 +- .../client/src/interface_v3/view_bitmap.h | 2 +- .../src/interface_v3/view_bitmap_combo.h | 2 +- .../client/src/interface_v3/view_pointer.h | 2 +- .../client/src/interface_v3/view_polygon.h | 2 +- .../client/src/interface_v3/view_quad.cpp | 2 +- .../ryzom/client/src/interface_v3/view_quad.h | 2 +- .../client/src/interface_v3/view_radar.h | 2 +- .../ryzom/client/src/interface_v3/view_text.h | 2 +- code/ryzom/client/src/main_loop.cpp | 4 +- code/ryzom/client/src/r2/displayer_base.cpp | 2 +- code/ryzom/client/src/r2/displayer_base.h | 2 +- code/ryzom/client/src/r2/instance.h | 2 +- code/ryzom/client/src/r2/island_collision.h | 2 +- code/ryzom/client/src/r2/tool.h | 2 +- 157 files changed, 737 insertions(+), 727 deletions(-) rename code/{ryzom/client/src/interface_v3 => nel/include/nel/gui}/action_handler.h (100%) rename code/{ryzom/client/src/interface_v3 => nel/include/nel/gui}/ctrl_base.h (97%) rename code/{ryzom/client/src/interface_v3 => nel/include/nel/gui}/ctrl_draggable.h (93%) rename code/{ryzom/client/src/interface_v3 => nel/include/nel/gui}/ctrl_scroll_base.h (95%) rename code/{ryzom/client/src/interface_v3 => nel/include/nel/gui}/group_container_base.h (96%) rename code/{ryzom/client/src/interface_v3 => nel/include/nel/gui}/group_editbox_base.h (95%) rename code/{ryzom/client/src/interface_v3 => nel/include/nel/gui}/group_frame.h (94%) rename code/{ryzom/client/src/interface_v3 => nel/include/nel/gui}/group_modal.h (95%) rename code/{ryzom/client/src/interface_v3 => nel/include/nel/gui}/interface_element.h (96%) rename code/{ryzom/client/src/interface_v3 => nel/include/nel/gui}/interface_group.h (97%) rename code/{ryzom/client/src/interface_v3 => nel/include/nel/gui}/interface_link.h (100%) rename code/{ryzom/client/src/interface_v3 => nel/include/nel/gui}/interface_options.h (93%) rename code/{ryzom/client/src/interface_v3 => nel/include/nel/gui}/view_base.h (95%) rename code/{ryzom/client/src/interface_v3 => nel/include/nel/gui}/view_pointer_base.h (94%) rename code/{ryzom/client/src/interface_v3 => nel/include/nel/gui}/widget_manager.h (100%) rename code/{ryzom/client/src/interface_v3 => nel/src/gui}/action_handler.cpp (96%) rename code/{ryzom/client/src/interface_v3 => nel/src/gui}/ctrl_base.cpp (93%) rename code/{ryzom/client/src/interface_v3 => nel/src/gui}/ctrl_draggable.cpp (79%) rename code/{ryzom/client/src/interface_v3 => nel/src/gui}/ctrl_scroll_base.cpp (94%) rename code/{ryzom/client/src/interface_v3 => nel/src/gui}/group_container_base.cpp (95%) rename code/{ryzom/client/src/interface_v3 => nel/src/gui}/group_editbox_base.cpp (81%) rename code/{ryzom/client/src/interface_v3 => nel/src/gui}/group_frame.cpp (95%) rename code/{ryzom/client/src/interface_v3 => nel/src/gui}/group_modal.cpp (94%) rename code/{ryzom/client/src/interface_v3 => nel/src/gui}/interface_element.cpp (95%) rename code/{ryzom/client/src/interface_v3 => nel/src/gui}/interface_group.cpp (95%) rename code/{ryzom/client/src/interface_v3 => nel/src/gui}/interface_link.cpp (95%) rename code/{ryzom/client/src/interface_v3 => nel/src/gui}/interface_options.cpp (95%) rename code/{ryzom/client/src/interface_v3 => nel/src/gui}/view_base.cpp (91%) rename code/{ryzom/client/src/interface_v3 => nel/src/gui}/view_pointer_base.cpp (95%) rename code/{ryzom/client/src/interface_v3 => nel/src/gui}/widget_manager.cpp (95%) diff --git a/code/ryzom/client/src/interface_v3/action_handler.h b/code/nel/include/nel/gui/action_handler.h similarity index 100% rename from code/ryzom/client/src/interface_v3/action_handler.h rename to code/nel/include/nel/gui/action_handler.h diff --git a/code/ryzom/client/src/interface_v3/ctrl_base.h b/code/nel/include/nel/gui/ctrl_base.h similarity index 97% rename from code/ryzom/client/src/interface_v3/ctrl_base.h rename to code/nel/include/nel/gui/ctrl_base.h index bc0caa7e4..44ad924ec 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_base.h +++ b/code/nel/include/nel/gui/ctrl_base.h @@ -20,7 +20,7 @@ #define RZ_CTRL_BASE_H #include "nel/misc/types_nl.h" -#include "view_base.h" +#include "nel/gui/view_base.h" #include "nel/gui/event_descriptor.h" class CCtrlBase : public CViewBase diff --git a/code/ryzom/client/src/interface_v3/ctrl_draggable.h b/code/nel/include/nel/gui/ctrl_draggable.h similarity index 93% rename from code/ryzom/client/src/interface_v3/ctrl_draggable.h rename to code/nel/include/nel/gui/ctrl_draggable.h index 120fabde6..256ce345b 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_draggable.h +++ b/code/nel/include/nel/gui/ctrl_draggable.h @@ -1,7 +1,7 @@ #ifndef CTRL_DRAGGABLE_H #define CTRL_DRAGGABLE_H -#include "ctrl_base.h" +#include "nel/gui/ctrl_base.h" class CCtrlDraggable : public CCtrlBase { diff --git a/code/ryzom/client/src/interface_v3/ctrl_scroll_base.h b/code/nel/include/nel/gui/ctrl_scroll_base.h similarity index 95% rename from code/ryzom/client/src/interface_v3/ctrl_scroll_base.h rename to code/nel/include/nel/gui/ctrl_scroll_base.h index 43b82c05a..16eee9c59 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_scroll_base.h +++ b/code/nel/include/nel/gui/ctrl_scroll_base.h @@ -17,7 +17,7 @@ #ifndef CTRL_SCROLL_BASE_H #define CTRL_SCROLL_BASE_H -#include "ctrl_base.h" +#include "nel/gui/ctrl_base.h" class CInterfaceGroup; diff --git a/code/nel/include/nel/gui/event_descriptor.h b/code/nel/include/nel/gui/event_descriptor.h index 54b561e6a..1c543d7ea 100644 --- a/code/nel/include/nel/gui/event_descriptor.h +++ b/code/nel/include/nel/gui/event_descriptor.h @@ -20,6 +20,7 @@ #define RZ_EVENT_DESCRIPTOR_H #include "nel/misc/types_nl.h" +#include "nel/misc/events.h" namespace NLGUI { diff --git a/code/ryzom/client/src/interface_v3/group_container_base.h b/code/nel/include/nel/gui/group_container_base.h similarity index 96% rename from code/ryzom/client/src/interface_v3/group_container_base.h rename to code/nel/include/nel/gui/group_container_base.h index 4e2e2f28e..b3ed6e501 100644 --- a/code/ryzom/client/src/interface_v3/group_container_base.h +++ b/code/nel/include/nel/gui/group_container_base.h @@ -18,7 +18,7 @@ #ifndef GROUP_CONTAINER_BASE_H #define GROUP_CONTAINER_BASE_H -#include "interface_group.h" +#include "nel/gui/interface_group.h" class CGroupContainerBase : public CInterfaceGroup diff --git a/code/ryzom/client/src/interface_v3/group_editbox_base.h b/code/nel/include/nel/gui/group_editbox_base.h similarity index 95% rename from code/ryzom/client/src/interface_v3/group_editbox_base.h rename to code/nel/include/nel/gui/group_editbox_base.h index 77aed7b08..3f77fa8ba 100644 --- a/code/ryzom/client/src/interface_v3/group_editbox_base.h +++ b/code/nel/include/nel/gui/group_editbox_base.h @@ -18,7 +18,7 @@ #ifndef GROUP_EDITBOX_BASE_H #define GROUP_EDITBOX_BASE_H -#include "interface_group.h" +#include "nel/gui/interface_group.h" class CGroupEditBoxBase : public CInterfaceGroup { diff --git a/code/ryzom/client/src/interface_v3/group_frame.h b/code/nel/include/nel/gui/group_frame.h similarity index 94% rename from code/ryzom/client/src/interface_v3/group_frame.h rename to code/nel/include/nel/gui/group_frame.h index 4f1663a9e..a8a1bca38 100644 --- a/code/ryzom/client/src/interface_v3/group_frame.h +++ b/code/nel/include/nel/gui/group_frame.h @@ -20,7 +20,7 @@ #define NL_GROUP_FRAME_H #include "nel/misc/types_nl.h" -#include "interface_group.h" +#include "nel/gui/interface_group.h" // *************************************************************************** diff --git a/code/ryzom/client/src/interface_v3/group_modal.h b/code/nel/include/nel/gui/group_modal.h similarity index 95% rename from code/ryzom/client/src/interface_v3/group_modal.h rename to code/nel/include/nel/gui/group_modal.h index 622a3051c..9fab37b2a 100644 --- a/code/ryzom/client/src/interface_v3/group_modal.h +++ b/code/nel/include/nel/gui/group_modal.h @@ -20,7 +20,7 @@ #define NL_GROUP_MODAL_H #include "nel/misc/types_nl.h" -#include "group_frame.h" +#include "nel/gui/group_frame.h" // *************************************************************************** diff --git a/code/ryzom/client/src/interface_v3/interface_element.h b/code/nel/include/nel/gui/interface_element.h similarity index 96% rename from code/ryzom/client/src/interface_v3/interface_element.h rename to code/nel/include/nel/gui/interface_element.h index 7c7706ba7..fc876fa61 100644 --- a/code/ryzom/client/src/interface_v3/interface_element.h +++ b/code/nel/include/nel/gui/interface_element.h @@ -22,6 +22,7 @@ #include "nel/misc/types_nl.h" #include "nel/misc/string_mapper.h" #include "nel/misc/smart_ptr.h" +#include "nel/misc/vector.h" #include "nel/gui/interface_property.h" #include "nel/gui/reflect.h" #include "nel/gui/interface_common.h" diff --git a/code/ryzom/client/src/interface_v3/interface_group.h b/code/nel/include/nel/gui/interface_group.h similarity index 97% rename from code/ryzom/client/src/interface_v3/interface_group.h rename to code/nel/include/nel/gui/interface_group.h index 5e1b1f716..09f248f00 100644 --- a/code/ryzom/client/src/interface_v3/interface_group.h +++ b/code/nel/include/nel/gui/interface_group.h @@ -19,8 +19,8 @@ #ifndef NL_INTERFACE_GROUP_H #define NL_INTERFACE_GROUP_H -#include "ctrl_base.h" -#include "action_handler.h" +#include "nel/gui/ctrl_base.h" +#include "nel/gui/action_handler.h" // ---------------------------------------------------------------------------- class CInterfaceGroup : public CCtrlBase diff --git a/code/ryzom/client/src/interface_v3/interface_link.h b/code/nel/include/nel/gui/interface_link.h similarity index 100% rename from code/ryzom/client/src/interface_v3/interface_link.h rename to code/nel/include/nel/gui/interface_link.h diff --git a/code/ryzom/client/src/interface_v3/interface_options.h b/code/nel/include/nel/gui/interface_options.h similarity index 93% rename from code/ryzom/client/src/interface_v3/interface_options.h rename to code/nel/include/nel/gui/interface_options.h index e05d390f8..990f1ab19 100644 --- a/code/ryzom/client/src/interface_v3/interface_options.h +++ b/code/nel/include/nel/gui/interface_options.h @@ -19,12 +19,13 @@ #ifndef RZ_INTERFACE_LAYER_H #define RZ_INTERFACE_LAYER_H +#include "nel/misc/debug.h" #include "nel/misc/smart_ptr.h" - +#include "nel/misc/rgba.h" namespace NL3D { -class UAnimationSet; + class UAnimationSet; } diff --git a/code/nel/include/nel/gui/lua_ihm.h b/code/nel/include/nel/gui/lua_ihm.h index bd7b5627a..c19460b87 100644 --- a/code/nel/include/nel/gui/lua_ihm.h +++ b/code/nel/include/nel/gui/lua_ihm.h @@ -19,6 +19,7 @@ #include "nel/misc/types_nl.h" #include "nel/gui/lua_helper.h" +#include "nel/gui/interface_element.h" #define IHM_LUA_METATABLE "__ui_metatable" #define IHM_LUA_ENVTABLE "__ui_envtable" @@ -122,14 +123,29 @@ namespace NLGUI // push a reflected property on the stack // NB : no check is done that 'property' is part of the class info of 'reflectedObject' static void luaValueFromReflectedProperty(CLuaState &ls, CReflectable &reflectedObject, const CReflectedProperty &property); + + private: + // Functions for the ui metatable + static class CInterfaceElement* getUIRelative( CInterfaceElement *pIE, const std::string &propName ); + static int luaUIIndex( CLuaState &ls ); + static int luaUINewIndex( CLuaState &ls ); + static int luaUIEq( CLuaState &ls ); + static int luaUINext( CLuaState &ls ); + static int luaUIDtor( CLuaState &ls ); - - private: static void registerBasics(CLuaState &ls); static void registerIHM(CLuaState &ls); static void createLuaEnumTable(CLuaState &ls, const std::string &str); + public: + static void pushUIOnStack(CLuaState &ls, CInterfaceElement *pIE); + static bool isUIOnStack(CLuaState &ls, sint index); + static CInterfaceElement *getUIOnStack(CLuaState &ls, sint index); + static void checkArgTypeUIElement(CLuaState &ls, const char *funcName, uint index); + + private: + //////////////////////////////////////////// Exported functions ////////////////////////////////////////////////////// static uint32 getLocalTime(); diff --git a/code/ryzom/client/src/interface_v3/view_base.h b/code/nel/include/nel/gui/view_base.h similarity index 95% rename from code/ryzom/client/src/interface_v3/view_base.h rename to code/nel/include/nel/gui/view_base.h index f4faaa204..e8ab73680 100644 --- a/code/ryzom/client/src/interface_v3/view_base.h +++ b/code/nel/include/nel/gui/view_base.h @@ -21,7 +21,7 @@ #include "nel/misc/types_nl.h" #include "nel/misc/factory.h" -#include "interface_element.h" +#include "nel/gui/interface_element.h" class CViewBase : public CInterfaceElement { diff --git a/code/ryzom/client/src/interface_v3/view_pointer_base.h b/code/nel/include/nel/gui/view_pointer_base.h similarity index 94% rename from code/ryzom/client/src/interface_v3/view_pointer_base.h rename to code/nel/include/nel/gui/view_pointer_base.h index 388180804..341ab4259 100644 --- a/code/ryzom/client/src/interface_v3/view_pointer_base.h +++ b/code/nel/include/nel/gui/view_pointer_base.h @@ -1,7 +1,7 @@ #ifndef VIEW_POINTER_BASE_H #define VIEW_POINTER_BASE_H -#include "view_base.h" +#include "nel/gui/view_base.h" class CViewPointerBase : public CViewBase { diff --git a/code/ryzom/client/src/interface_v3/widget_manager.h b/code/nel/include/nel/gui/widget_manager.h similarity index 100% rename from code/ryzom/client/src/interface_v3/widget_manager.h rename to code/nel/include/nel/gui/widget_manager.h diff --git a/code/ryzom/client/src/interface_v3/action_handler.cpp b/code/nel/src/gui/action_handler.cpp similarity index 96% rename from code/ryzom/client/src/interface_v3/action_handler.cpp rename to code/nel/src/gui/action_handler.cpp index 1961a5315..110fbb37c 100644 --- a/code/ryzom/client/src/interface_v3/action_handler.cpp +++ b/code/nel/src/gui/action_handler.cpp @@ -14,14 +14,13 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -#include "action_handler.h" -//#include "group_container.h" -#include "group_container_base.h" +#include "nel/gui/action_handler.h" +#include "nel/gui/group_container_base.h" #include "nel/gui/interface_property.h" #include "nel/gui/interface_expr.h" #include "nel/gui/db_manager.h" -#include "interface_link.h" -#include "widget_manager.h" +#include "nel/gui/interface_link.h" +#include "nel/gui/widget_manager.h" using namespace std; using namespace NLMISC; diff --git a/code/ryzom/client/src/interface_v3/ctrl_base.cpp b/code/nel/src/gui/ctrl_base.cpp similarity index 93% rename from code/ryzom/client/src/interface_v3/ctrl_base.cpp rename to code/nel/src/gui/ctrl_base.cpp index 1eea06182..2577fba21 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_base.cpp +++ b/code/nel/src/gui/ctrl_base.cpp @@ -14,11 +14,13 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . - +#include "libxml/globals.h" +#include "nel/misc/debug.h" #include "nel/misc/xml_auto_ptr.h" -#include "ctrl_base.h" -#include "interface_group.h" -#include "widget_manager.h" +#include "nel/gui/ctrl_base.h" +#include "nel/gui/interface_group.h" +#include "nel/gui/widget_manager.h" +#include "nel/misc/i18n.h" using namespace NLMISC; diff --git a/code/ryzom/client/src/interface_v3/ctrl_draggable.cpp b/code/nel/src/gui/ctrl_draggable.cpp similarity index 79% rename from code/ryzom/client/src/interface_v3/ctrl_draggable.cpp rename to code/nel/src/gui/ctrl_draggable.cpp index 7d98e7794..0e38d5c8f 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_draggable.cpp +++ b/code/nel/src/gui/ctrl_draggable.cpp @@ -1,4 +1,4 @@ -#include "ctrl_draggable.h" +#include "nel/gui/ctrl_draggable.h" CCtrlDraggable* CCtrlDraggable::_LastDraggedSheet = NULL; diff --git a/code/ryzom/client/src/interface_v3/ctrl_scroll_base.cpp b/code/nel/src/gui/ctrl_scroll_base.cpp similarity index 94% rename from code/ryzom/client/src/interface_v3/ctrl_scroll_base.cpp rename to code/nel/src/gui/ctrl_scroll_base.cpp index b0cff5373..a3ed058ac 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_scroll_base.cpp +++ b/code/nel/src/gui/ctrl_scroll_base.cpp @@ -14,7 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -#include "ctrl_scroll_base.h" +#include "nel/gui/ctrl_scroll_base.h" CCtrlScrollBase::CCtrlScrollBase( const TCtorParam ¶m ) : CCtrlBase( param ) diff --git a/code/ryzom/client/src/interface_v3/group_container_base.cpp b/code/nel/src/gui/group_container_base.cpp similarity index 95% rename from code/ryzom/client/src/interface_v3/group_container_base.cpp rename to code/nel/src/gui/group_container_base.cpp index 79144c787..9946f5e0c 100644 --- a/code/ryzom/client/src/interface_v3/group_container_base.cpp +++ b/code/nel/src/gui/group_container_base.cpp @@ -15,7 +15,7 @@ // along with this program. If not, see . -#include "group_container_base.h" +#include "nel/gui/group_container_base.h" CGroupContainerBase::CGroupContainerBase( const CViewBase::TCtorParam ¶m ) : CInterfaceGroup( param ) diff --git a/code/ryzom/client/src/interface_v3/group_editbox_base.cpp b/code/nel/src/gui/group_editbox_base.cpp similarity index 81% rename from code/ryzom/client/src/interface_v3/group_editbox_base.cpp rename to code/nel/src/gui/group_editbox_base.cpp index a7c968f97..3c67d7d2f 100644 --- a/code/ryzom/client/src/interface_v3/group_editbox_base.cpp +++ b/code/nel/src/gui/group_editbox_base.cpp @@ -1,4 +1,4 @@ -#include "group_editbox_base.h" +#include "nel/gui/group_editbox_base.h" CGroupEditBoxBase *CGroupEditBoxBase::_CurrSelection = NULL; diff --git a/code/ryzom/client/src/interface_v3/group_frame.cpp b/code/nel/src/gui/group_frame.cpp similarity index 95% rename from code/ryzom/client/src/interface_v3/group_frame.cpp rename to code/nel/src/gui/group_frame.cpp index f6978a959..e8fbfa228 100644 --- a/code/ryzom/client/src/interface_v3/group_frame.cpp +++ b/code/nel/src/gui/group_frame.cpp @@ -14,10 +14,10 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -#include "group_frame.h" -#include "widget_manager.h" -#include "interface_options.h" -#include "interface_element.h" +#include "nel/gui/group_frame.h" +#include "nel/gui/widget_manager.h" +#include "nel/gui/interface_options.h" +#include "nel/gui/interface_element.h" #include "nel/gui/view_renderer.h" #include "nel/misc/xml_auto_ptr.h" diff --git a/code/ryzom/client/src/interface_v3/group_modal.cpp b/code/nel/src/gui/group_modal.cpp similarity index 94% rename from code/ryzom/client/src/interface_v3/group_modal.cpp rename to code/nel/src/gui/group_modal.cpp index 555f6b4d5..1b763fad5 100644 --- a/code/ryzom/client/src/interface_v3/group_modal.cpp +++ b/code/nel/src/gui/group_modal.cpp @@ -16,8 +16,8 @@ -#include "group_modal.h" -#include "interface_element.h" +#include "nel/gui/group_modal.h" +#include "nel/gui/interface_element.h" #include "nel/misc/xml_auto_ptr.h" #include "nel/gui/view_renderer.h" diff --git a/code/ryzom/client/src/interface_v3/interface_element.cpp b/code/nel/src/gui/interface_element.cpp similarity index 95% rename from code/ryzom/client/src/interface_v3/interface_element.cpp rename to code/nel/src/gui/interface_element.cpp index a66b5881b..a90e2639a 100644 --- a/code/ryzom/client/src/interface_v3/interface_element.cpp +++ b/code/nel/src/gui/interface_element.cpp @@ -14,15 +14,15 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -#include "interface_group.h" +#include "nel/gui/interface_group.h" #include "nel/gui/interface_property.h" #include "nel/gui/view_renderer.h" -#include "widget_manager.h" +#include "nel/gui/widget_manager.h" #include "nel/gui/db_manager.h" -#include "interface_link.h" +#include "nel/gui/interface_link.h" #include "nel/misc/xml_auto_ptr.h" #include "nel/gui/lua_ihm.h" -#include "lua_ihm_ryzom.h" +#include "nel/gui/lua_ihm.h" #include "nel/misc/mem_stream.h" // @@ -1167,7 +1167,7 @@ int CInterfaceElement::luaSetPosRef(CLuaState &ls) int CInterfaceElement::luaSetParentPos(CLuaState &ls) { CLuaIHM::checkArgCount(ls, "setParentPos", 1); - CInterfaceElement *ie = CLuaIHMRyzom::getUIOnStack(ls, 1); + CInterfaceElement *ie = CLuaIHM::getUIOnStack(ls, 1); if(ie) { setParentPos(ie); diff --git a/code/ryzom/client/src/interface_v3/interface_group.cpp b/code/nel/src/gui/interface_group.cpp similarity index 95% rename from code/ryzom/client/src/interface_v3/interface_group.cpp rename to code/nel/src/gui/interface_group.cpp index bb0b0bbbf..9b1ae75fb 100644 --- a/code/ryzom/client/src/interface_v3/interface_group.cpp +++ b/code/nel/src/gui/interface_group.cpp @@ -14,17 +14,18 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include "libxml/globals.h" +#include "nel/misc/debug.h" #include "nel/misc/xml_auto_ptr.h" #include "nel/misc/stream.h" #include "nel/gui/lua_manager.h" #include "nel/gui/lua_ihm.h" #include "nel/gui/view_renderer.h" - -#include "interface_group.h" -#include "interface_link.h" -#include "widget_manager.h" -#include "ctrl_scroll_base.h" -#include "lua_ihm_ryzom.h" +#include "nel/gui/interface_group.h" +#include "nel/gui/interface_link.h" +#include "nel/gui/widget_manager.h" +#include "nel/gui/ctrl_scroll_base.h" +#include "nel/gui/lua_ihm.h" using namespace std; using namespace NL3D; @@ -444,7 +445,7 @@ void CInterfaceGroup::addGroup (CInterfaceGroup *child, sint eltOrder /*= -1*/) int CInterfaceGroup::luaAddGroup (CLuaState &ls) { CLuaIHM::checkArgCount(ls, "CInterfaceGroup::addTab", 1); - CInterfaceGroup * group = dynamic_cast(CLuaIHMRyzom::getUIOnStack(ls, 1)); + CInterfaceGroup * group = dynamic_cast(CLuaIHM::getUIOnStack(ls, 1)); if(group) { group->setParent(this); @@ -615,7 +616,7 @@ bool CInterfaceGroup::delGroup (CInterfaceGroup *child, bool dontDelete /* = fal int CInterfaceGroup::luaDelGroup (CLuaState &ls) { CLuaIHM::checkArgCount(ls, "CInterfaceGroup::delTab", 1); - CInterfaceGroup * group = dynamic_cast(CLuaIHMRyzom::getUIOnStack(ls, 1)); + CInterfaceGroup * group = dynamic_cast(CLuaIHM::getUIOnStack(ls, 1)); if(group) { delGroup(group); @@ -642,7 +643,7 @@ int CInterfaceGroup::luaGetGroup(CLuaState &ls) { CLuaIHM::fails(ls, "getGroup : try to index group %s, but there are only %d son groups", ls.toString(1), (int) _ChildrenGroups.size()); } - CLuaIHMRyzom::pushUIOnStack(ls, _ChildrenGroups[index]); + CLuaIHM::pushUIOnStack(ls, _ChildrenGroups[index]); return 1; } @@ -1851,7 +1852,7 @@ int CInterfaceGroup::luaFind(CLuaState &ls) } else { - CLuaIHMRyzom::pushUIOnStack(ls, element); + CLuaIHM::pushUIOnStack(ls, element); } return 1; } @@ -1870,7 +1871,7 @@ CInterfaceElement* CInterfaceGroup::findFromShortId(const std::string &id) int CInterfaceGroup::luaGetEnclosingContainer(CLuaState &ls) { CLuaIHM::checkArgCount(ls, "CInterfaceGroup::getEnclosingContainer", 0); - CLuaIHMRyzom::pushUIOnStack(ls, getEnclosingContainer()); + CLuaIHM::pushUIOnStack(ls, getEnclosingContainer()); return 1; } diff --git a/code/ryzom/client/src/interface_v3/interface_link.cpp b/code/nel/src/gui/interface_link.cpp similarity index 95% rename from code/ryzom/client/src/interface_v3/interface_link.cpp rename to code/nel/src/gui/interface_link.cpp index 1b0ee7619..68e9a194c 100644 --- a/code/ryzom/client/src/interface_v3/interface_link.cpp +++ b/code/nel/src/gui/interface_link.cpp @@ -19,11 +19,12 @@ #include "nel/gui/reflect.h" #include "nel/gui/db_manager.h" #include "nel/misc/cdb_branch.h" -#include "action_handler.h" -#include "interface_link.h" -#include "interface_element.h" -#include "interface_group.h" -#include "widget_manager.h" +#include "nel/gui/action_handler.h" +#include "nel/gui/interface_link.h" +#include "nel/gui/interface_element.h" +#include "nel/gui/interface_group.h" +#include "nel/gui/widget_manager.h" +#include "nel/misc/algo.h" using namespace std; using namespace NLMISC; diff --git a/code/ryzom/client/src/interface_v3/interface_options.cpp b/code/nel/src/gui/interface_options.cpp similarity index 95% rename from code/ryzom/client/src/interface_v3/interface_options.cpp rename to code/nel/src/gui/interface_options.cpp index a73d2c170..2c9bd97d8 100644 --- a/code/ryzom/client/src/interface_v3/interface_options.cpp +++ b/code/nel/src/gui/interface_options.cpp @@ -16,9 +16,9 @@ +#include "nel/gui/interface_element.h" #include "nel/misc/xml_auto_ptr.h" -#include "interface_options.h" -#include "interface_element.h" +#include "nel/gui/interface_options.h" using namespace std; using namespace NLMISC; diff --git a/code/nel/src/gui/lua_ihm.cpp b/code/nel/src/gui/lua_ihm.cpp index 8cd1ea463..1194b48ec 100644 --- a/code/nel/src/gui/lua_ihm.cpp +++ b/code/nel/src/gui/lua_ihm.cpp @@ -16,6 +16,7 @@ #include "nel/gui/lua_helper.h" +#include "nel/gui/interface_group.h" #include @@ -258,6 +259,402 @@ namespace NLGUI namespace NLGUI { + static CLuaString lstr_Env("Env"); + static CLuaString lstr_isNil("isNil"); + + // *************************************************************************** + int CLuaIHM::luaUIIndex(CLuaState &ls) + { + //H_AUTO(Lua_CLuaIHM_luaUIIndex) + nlassert(ls.getTop()==2); + // get the userdata and key + CReflectableLuaRef *pRefElm = (CReflectableLuaRef *) ls.toUserData(1); + + const char *propName = ls.toString(2); + CReflectableRefPtrTarget *pRPT= (CReflectableRefPtrTarget*)(pRefElm->Ptr); + // ** try to get the Env Table (interface group only) + if(propName==lstr_isNil) + { + ls.push(pRPT==NULL); + return 1; + } + + // Check the object is not NULL or freed + if(pRPT==NULL) + { + return 0; + } + + // ** try to get the Env Table (interface group only) + if(propName==lstr_Env) + { + // Env can be bound to a CInterfaceGroup only + CInterfaceGroup *group= dynamic_cast(pRPT); + if(group==NULL) + { + ls.pushNil(); + return 1; + } + else + { + group->pushLUAEnvTable(); + return 1; + } + } + + // ** try to get the property + const CReflectedProperty *prop = pRefElm->getProp(propName); + if (prop) + { + CLuaIHM::luaValueFromReflectedProperty(ls, *pRPT, *prop); + return 1; + } + + // ** try to get a UI relative + CInterfaceElement *uiRelative= getUIRelative(dynamic_cast(pRPT), propName); + if(uiRelative) + { + // push the UI onto the stack + pushUIOnStack(ls, uiRelative); + return 1; + } + + + // Fail to find any Attributes or elements + // Yoyo: don't write any message or warning because this may be a feature (if user want to test that something exit in the ui) + ls.pushNil(); + return 1; + } + + // *************************************************************************** + int CLuaIHM::luaUINewIndex(CLuaState &ls) + { + //H_AUTO(Lua_CLuaIHM_luaUINewIndex) + nlassert(ls.getTop()==3); + // get the userdata and key + CReflectableLuaRef *pRefElm = (CReflectableLuaRef *) ls.toUserData(1); + nlassert(pRefElm); + CReflectableRefPtrTarget *pRPT= (CReflectableRefPtrTarget*)(pRefElm->Ptr); + // Check the UI is not NULL or freed + if(pRPT == NULL) + { + return 0; + } + + const char *propName = ls.toString(2); + // ** try to set the Env Table (interface group only) + if(propName == lstr_Env) + { + CInterfaceElement *pIE = dynamic_cast(pRPT); + std::string name ; + if (pIE) + { + name = pIE->getId(); + } + else + { + name = ""; + } + // Exception!!! not allowed + throw ELuaIHMException("You cannot change the Env Table of '%s'", name.c_str()); + } + + + // ** try to set the property + const CReflectedProperty *prop = pRefElm->getProp(propName); + if (prop) + { + CLuaIHM::luaValueToReflectedProperty(ls, 3, *pRPT, *prop); + return 0; + } + + CInterfaceElement *pIE = dynamic_cast(pRPT); + // ** try to get another UI (child or parent) + CInterfaceElement *uiRelative= getUIRelative(pIE, propName); + if(uiRelative) + { + // Exception!!! not allowed + throw ELuaIHMException("You cannot write into the UI '%s' of '%s'", propName, pIE->getId().c_str()); + } + + // ** Prop Not Found + throw ELuaIHMException("Property '%s' not found in '%s' of type %s", propName, pIE ? pIE->getId().c_str() : "", typeid(*pRPT).name()); + + // Fail to find any Attributes or elements + return 0; + } + + // *************************************************************************** + int CLuaIHM::luaUIEq(CLuaState &ls) + { + //H_AUTO(Lua_CLuaIHM_luaUIEq) + nlassert(ls.getTop() == 2); + // read lhs & rhs + // get the userdata and key + CReflectableLuaRef *lhs = (CReflectableLuaRef *) ls.toUserData(1); + CReflectableLuaRef *rhs = (CReflectableLuaRef *) ls.toUserData(2); + nlassert(lhs); + nlassert(rhs); + ls.push(lhs->Ptr == rhs->Ptr); + return 1; + } + + + // *************************************************************************** + int CLuaIHM::luaUIDtor(CLuaState &ls) + { + //H_AUTO(Lua_CLuaIHM_luaUIDtor) + nlassert(ls.getTop()==1); + // get the userdata + CReflectableLuaRef *pRefElm = (CReflectableLuaRef *) ls.toUserData(1); + nlassert(pRefElm); + + // call dtor + pRefElm->~CReflectableLuaRef(); + + return 0; + } + + // *************************************************************************** + int CLuaIHM::luaUINext(CLuaState &ls) + { + //H_AUTO(Lua_CLuaIHM_luaUINext) + // Code below allow enumeration of properties of a reflectable object + // From lua standpoint, the object is seen as a table with (key, value) pairs + // If object is a CInterfaceGroup, iteration is also done on sons (groups, controls & view). + + if (ls.getTop() != 2) + { + CLuaIHM::fails(ls, "__next metamethod require 2 arguments (table & key)"); + } + CLuaIHM::check(ls, CLuaIHM::isReflectableOnStack(ls, 1), "__next : require ui element as first arg"); + CReflectableRefPtrTarget *reflectedObject = CLuaIHM::getReflectableOnStack(ls, 1); + // To traverse all properties / field of the object, we must be able to determine the next key from a previous key + // (keys are ordered) + // We use the 'TValueType' enum to know which kind of property we are traversing, and an index in this group of properties + // The key which uniquely identify an element / property in the reflectable object + struct CKey + { + enum TValueType + { + VTGroup = 0, // children groups (If the object is a CInterfaceGroup) + VTView, // children views (If the object is a CInterfaceView) + VTCtrl, // children controls (If the object is a CInterfaceCtrl) + VTProp // List of exported proeprties (For all relfectable objects) + }; + TValueType ValueType; + sint Index; + const CClassInfo *ClassInfo; // if ValueType is "VTProp" -> give the class for which property are currently enumerated + // + static int tostring(CLuaState &ls) // '__print' metamathod + { + CLuaIHM::checkArgCount(ls, "reflected object metatable:__print", 1); + CKey key; + key.pop(ls); + switch(key.ValueType) + { + case VTGroup: ls.push(toString("_Group %d", key.Index)); break; + case VTView: ls.push(toString("_View %d", key.Index)); break; + case VTCtrl: ls.push(toString("_Ctrl %d", key.Index)); break; + case VTProp: ls.push(key.ClassInfo->Properties[key.Index].Name); break; + } + return 1; + } + // push the key on the lua stack + void push(CLuaState &ls) + { + void *ud = ls.newUserData(sizeof(*this)); + *(CKey *) ud = *this; + getMetaTable(ls).push(); + ls.setMetaTable(-2); + } + // pop the key from the lua stack + void pop(CLuaState &ls) + { + CLuaStackChecker lsc(&ls, -1); + if (!ls.isUserData(-1)) + { + CLuaIHM::fails(ls, "Can't pop object, not a user data"); + } + // check that metatable is good (it is share between all keys) + ls.getMetaTable(-1); + getMetaTable(ls).push(); + if (!ls.rawEqual(-1, -2)) + { + CLuaIHM::fails(ls, "Bad metatable for reflectable object key"); + } + ls.pop(2); + // retrieve key + *this = *(CKey *) ls.toUserData(-1); + ls.pop(); + } + // get the metatable for a CKey + CLuaObject &getMetaTable(CLuaState &ls) + { + static CLuaObject metatable; + if (!metatable.isValid()) + { + // first build + CLuaStackChecker lsc(&ls); + ls.newTable(); + ls.push("__tostring"); + ls.push(CKey::tostring); + ls.setTable(-3); + metatable.pop(ls); + } + return metatable; + } + }; + // Pop the current key to continue enumeration + CKey key; + if (ls.isNil(2)) + { + // no key -> start of table + key.ValueType = CKey::VTGroup; + key.Index = -1; + } + else + { + key.pop(ls); + } + // + CInterfaceGroup *group = dynamic_cast(reflectedObject); + bool enumerate = true; + while (enumerate) + { + switch(key.ValueType) + { + case CKey::VTGroup: + if (!group || (key.Index + 1) == (sint) group->getGroups().size()) + { + key.Index = -1; + key.ValueType = CKey::VTView; // continue enumeration with views + } + else + { + ++ key.Index; + key.push(ls); + pushUIOnStack(ls, group->getGroups()[key.Index]); + return 2; + } + break; + case CKey::VTView: + if (!group || (key.Index + 1) == (sint) group->getViews().size()) + { + key.Index = -1; + key.ValueType = CKey::VTCtrl; // continue enumeration with controls + } + else + { + ++ key.Index; + key.push(ls); + pushUIOnStack(ls, group->getViews()[key.Index]); + return 2; + } + break; + case CKey::VTCtrl: + if (!group || (key.Index + 1) == (sint) group->getControls().size()) + { + key.Index = -1; + key.ValueType = CKey::VTProp; // continue enumeration with properties + key.ClassInfo = reflectedObject->getClassInfo(); + } + else + { + ++ key.Index; + key.push(ls); + pushUIOnStack(ls, group->getControls()[key.Index]); + return 2; + } + break; + case CKey::VTProp: + if (!key.ClassInfo) + { + enumerate = false; + break; + } + if ((sint) key.ClassInfo->Properties.size() == (key.Index + 1)) + { + key.ClassInfo = key.ClassInfo->ParentClass; // continue enumeration in parent class + key.Index = -1; + } + else + { + ++ key.Index; + key.push(ls); + CLuaIHM::luaValueFromReflectedProperty(ls, *reflectedObject, key.ClassInfo->Properties[key.Index]); + return 2; + } + break; + default: + nlassert(0); + break; + } + } + ls.pushNil(); + return 0; + } + + // *************************************************************************** + void CLuaIHM::pushUIOnStack(CLuaState &ls, CInterfaceElement *pIE) + { + //H_AUTO(Lua_CLuaIHM_pushUIOnStack) + CLuaIHM::pushReflectableOnStack(ls, pIE); + } + + // *************************************************************************** + bool CLuaIHM::isUIOnStack(CLuaState &ls, sint index) + { + //H_AUTO(Lua_CLuaIHM_isUIOnStack) + return getUIOnStack(ls, index) != NULL; + } + + // *************************************************************************** + CInterfaceElement *CLuaIHM::getUIOnStack(CLuaState &ls, sint index) + { + //H_AUTO(Lua_CLuaIHM_getUIOnStack) + return dynamic_cast(CLuaIHM::getReflectableOnStack(ls, index)); + } + + // *************************************************************************** + void CLuaIHM::checkArgTypeUIElement(CLuaState &ls, const char *funcName, uint index) + { + //H_AUTO(Lua_CLuaIHM_checkArgTypeUIElement) + nlassert(index > 0); + if (ls.getTop() < (int) index) + { + CLuaIHM::fails(ls, "%s : argument %d of expected type ui element was not defined", funcName, index); + } + if (!isUIOnStack(ls, index)) + { + CLuaIHM::fails(ls, "%s : argument %d of expected type ui element has bad type : %s", funcName, index, ls.getTypename(ls.type(index)), ls.type(index)); + } + } + + + // *************************************************************************** + CInterfaceElement *CLuaIHM::getUIRelative(CInterfaceElement *pIE, const std::string &propName) + { + //H_AUTO(Lua_CLuaIHM_getUIRelative) + if (pIE == NULL) return NULL; + // If the prop is "parent", then return the parent of the ui + if(propName=="parent") + { + return pIE->getParent(); + } + // else try to get a child (if group/exist) + else + { + CInterfaceGroup *group= dynamic_cast(pIE); + if(group) + { + return group->getElement(group->getId()+":"+propName); + } + } + + return NULL; + } + // *************************************************************************** void CLuaIHM::registerBasics(CLuaState &ls) @@ -420,9 +817,6 @@ namespace NLGUI } } - static CLuaString lstr_Env("Env"); - static CLuaString lstr_isNil("isNil"); - // *************************************************************************** void CLuaIHM::luaValueToReflectedProperty(CLuaState &ls, int stackIndex, CReflectable &target, const CReflectedProperty &property) throw(ELuaIHMException) { @@ -545,6 +939,38 @@ namespace NLGUI ls.setTable(LUA_REGISTRYINDEX); + // *** Register the MetaTable for UI userdata + ls.push(IHM_LUA_METATABLE); // "__ui_metatable" + ls.newTable(); // "__ui_metatable" {} + // set the '__index' method + ls.push("__index"); + ls.push(luaUIIndex); + nlassert(ls.isCFunction()); + ls.setTable(-3); // "__ui_metatable" {"__index"= CFunc_luaUIIndex} + // set the '__newindex' method + ls.push("__newindex"); + ls.push(luaUINewIndex); + nlassert(ls.isCFunction()); + ls.setTable(-3); + // set the '__newindex' method + ls.push("__gc"); + ls.push(luaUIDtor); + nlassert(ls.isCFunction()); + ls.setTable(-3); + // set the '__eq' method + ls.push("__eq"); + ls.push(luaUIEq); + nlassert(ls.isCFunction()); + ls.setTable(-3); + // set the custom '__next' method + ls.push("__next"); + ls.push(luaUINext); + nlassert(ls.isCFunction()); + ls.setTable(-3); + // set registry + ls.setTable(LUA_REGISTRYINDEX); + + // *** Register Functions // Through LUABind API diff --git a/code/ryzom/client/src/interface_v3/view_base.cpp b/code/nel/src/gui/view_base.cpp similarity index 91% rename from code/ryzom/client/src/interface_v3/view_base.cpp rename to code/nel/src/gui/view_base.cpp index 70bf9255c..56761c571 100644 --- a/code/ryzom/client/src/interface_v3/view_base.cpp +++ b/code/nel/src/gui/view_base.cpp @@ -14,9 +14,9 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -#include "view_base.h" -#include "interface_group.h" -#include "widget_manager.h" +#include "nel/gui/view_base.h" +#include "nel/gui/interface_group.h" +#include "nel/gui/widget_manager.h" CViewBase::~CViewBase() { diff --git a/code/ryzom/client/src/interface_v3/view_pointer_base.cpp b/code/nel/src/gui/view_pointer_base.cpp similarity index 95% rename from code/ryzom/client/src/interface_v3/view_pointer_base.cpp rename to code/nel/src/gui/view_pointer_base.cpp index e4b124dc3..b89febad9 100644 --- a/code/ryzom/client/src/interface_v3/view_pointer_base.cpp +++ b/code/nel/src/gui/view_pointer_base.cpp @@ -1,4 +1,4 @@ -#include "view_pointer_base.h" +#include "nel/gui/view_pointer_base.h" CViewPointerBase::CViewPointerBase( const CViewBase::TCtorParam ¶m ) : CViewBase( param ) diff --git a/code/ryzom/client/src/interface_v3/widget_manager.cpp b/code/nel/src/gui/widget_manager.cpp similarity index 95% rename from code/ryzom/client/src/interface_v3/widget_manager.cpp rename to code/nel/src/gui/widget_manager.cpp index c3ec5bc4e..aaf0813ef 100644 --- a/code/ryzom/client/src/interface_v3/widget_manager.cpp +++ b/code/nel/src/gui/widget_manager.cpp @@ -16,14 +16,14 @@ #include "nel/gui/db_manager.h" #include "nel/gui/view_renderer.h" -#include "widget_manager.h" -#include "view_pointer_base.h" -#include "ctrl_draggable.h" -#include "interface_group.h" -#include "group_container_base.h" -#include "group_modal.h" -#include "group_editbox_base.h" -#include "interface_options.h" +#include "nel/gui/widget_manager.h" +#include "nel/gui/view_pointer_base.h" +#include "nel/gui/ctrl_draggable.h" +#include "nel/gui/interface_group.h" +#include "nel/gui/group_container_base.h" +#include "nel/gui/group_modal.h" +#include "nel/gui/group_editbox_base.h" +#include "nel/gui/interface_options.h" CWidgetManager* CWidgetManager::instance = NULL; diff --git a/code/ryzom/client/src/camera_recorder.cpp b/code/ryzom/client/src/camera_recorder.cpp index 309eee039..68c0ddf4e 100644 --- a/code/ryzom/client/src/camera_recorder.cpp +++ b/code/ryzom/client/src/camera_recorder.cpp @@ -20,7 +20,7 @@ #include "nel/misc/command.h" #include "nel/misc/file.h" #include "nel/3d/u_camera.h" -#include "interface_v3/action_handler.h" +#include "nel/gui/action_handler.h" #include "client_cfg.h" #include "view.h" // diff --git a/code/ryzom/client/src/client_chat_manager.cpp b/code/ryzom/client/src/client_chat_manager.cpp index b9ed783b3..ed4d5948f 100644 --- a/code/ryzom/client/src/client_chat_manager.cpp +++ b/code/ryzom/client/src/client_chat_manager.cpp @@ -28,7 +28,7 @@ #include "interface_v3/people_interraction.h" #include "string_manager_client.h" #include "entity_cl.h" -#include "interface_v3/action_handler.h" +#include "nel/gui/action_handler.h" #include "entities.h" #include "interface_v3/group_editbox.h" #include "permanent_ban.h" diff --git a/code/ryzom/client/src/connection.cpp b/code/ryzom/client/src/connection.cpp index 86f26961f..1da19926a 100644 --- a/code/ryzom/client/src/connection.cpp +++ b/code/ryzom/client/src/connection.cpp @@ -45,7 +45,7 @@ #include // Client #include "connection.h" -#include "interface_v3/action_handler.h" +#include "nel/gui/action_handler.h" #include "sound_manager.h" #include "input.h" #include "login.h" diff --git a/code/ryzom/client/src/entity_cl.cpp b/code/ryzom/client/src/entity_cl.cpp index b05c8ae69..da31caebc 100644 --- a/code/ryzom/client/src/entity_cl.cpp +++ b/code/ryzom/client/src/entity_cl.cpp @@ -52,7 +52,7 @@ #include "debug_client.h" #include "misc.h" #include "client_cfg.h" -#include "interface_v3/action_handler.h" +#include "nel/gui/action_handler.h" #include "interface_v3/interface_manager.h" #include "interface_v3/group_container.h" #include "interface_v3/guild_manager.h" diff --git a/code/ryzom/client/src/game_context_menu.h b/code/ryzom/client/src/game_context_menu.h index e1a854507..0e5dde414 100644 --- a/code/ryzom/client/src/game_context_menu.h +++ b/code/ryzom/client/src/game_context_menu.h @@ -22,7 +22,7 @@ #include "nel/misc/types_nl.h" #include "main_loop.h" #include "interface_v3/ctrl_text_button.h" -#include "interface_v3/interface_group.h" +#include "nel/gui/interface_group.h" #include "interface_v3/interface_pointer.h" #include "game_share/bot_chat_types.h" diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index 531b8ed61..075a17dcc 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -69,7 +69,7 @@ #include "sheet_manager.h" #include "interface_v3/sbrick_manager.h" -#include "interface_v3/widget_manager.h" +#include "nel/gui/widget_manager.h" // #include "gabarit.h" #include "hair_set.h" diff --git a/code/ryzom/client/src/init_main_loop.cpp b/code/ryzom/client/src/init_main_loop.cpp index 4b2247566..d35d00561 100644 --- a/code/ryzom/client/src/init_main_loop.cpp +++ b/code/ryzom/client/src/init_main_loop.cpp @@ -55,7 +55,7 @@ #include "interface_v3/view_bitmap.h" -#include "interface_v3/interface_link.h" +#include "nel/gui/interface_link.h" #include "cursor_functions.h" #include "pacs_client.h" #include "ig_client.h" diff --git a/code/ryzom/client/src/interface_v3/action_handler_debug.cpp b/code/ryzom/client/src/interface_v3/action_handler_debug.cpp index eaa24e354..8f74e3076 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_debug.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_debug.cpp @@ -20,7 +20,7 @@ using namespace std; using namespace NLMISC; using namespace NL3D; -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "../misc.h" #include "../prim_file.h" #include "../graph.h" diff --git a/code/ryzom/client/src/interface_v3/action_handler_edit.cpp b/code/ryzom/client/src/interface_v3/action_handler_edit.cpp index d16df8fa4..72931f511 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_edit.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_edit.cpp @@ -22,7 +22,7 @@ using namespace std; using namespace NLMISC; -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "group_editbox.h" #include "interface_manager.h" #include "../client_chat_manager.h" diff --git a/code/ryzom/client/src/interface_v3/action_handler_game.cpp b/code/ryzom/client/src/interface_v3/action_handler_game.cpp index 39fff2c6d..ddaad5b5e 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_game.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_game.cpp @@ -21,7 +21,7 @@ // Interface includes #include "interface_manager.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "action_handler_base.h" #include "action_handler_misc.h" #include "bot_chat_manager.h" @@ -61,7 +61,7 @@ #include "../game_context_menu.h" #include "../sound_manager.h" #include "../far_tp.h" -#include "interface_link.h" +#include "nel/gui/interface_link.h" #include "../npc_icon.h" // Game Share diff --git a/code/ryzom/client/src/interface_v3/action_handler_help.cpp b/code/ryzom/client/src/interface_v3/action_handler_help.cpp index 7812df510..04bc833e7 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_help.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_help.cpp @@ -19,7 +19,7 @@ #include "stdpch.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "interface_manager.h" #include "bot_chat_manager.h" #include "../sheet_manager.h" diff --git a/code/ryzom/client/src/interface_v3/action_handler_item.cpp b/code/ryzom/client/src/interface_v3/action_handler_item.cpp index e86c0691e..0066dd948 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_item.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_item.cpp @@ -19,7 +19,7 @@ #include "stdpch.h" #include "action_handler_item.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "interface_manager.h" #include "../sheet_manager.h" #include "dbctrl_sheet.h" diff --git a/code/ryzom/client/src/interface_v3/action_handler_misc.cpp b/code/ryzom/client/src/interface_v3/action_handler_misc.cpp index 082669574..5c3fb746a 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_misc.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_misc.cpp @@ -23,7 +23,7 @@ #include "people_interraction.h" #include "nel/misc/algo.h" #include "nel/gui/interface_expr.h" -#include "interface_link.h" +#include "nel/gui/interface_link.h" #include "../client_chat_manager.h" #include "../motion/user_controls.h" #include "../entity_cl.h" diff --git a/code/ryzom/client/src/interface_v3/action_handler_misc.h b/code/ryzom/client/src/interface_v3/action_handler_misc.h index 5e9328832..d0fabdcfc 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_misc.h +++ b/code/ryzom/client/src/interface_v3/action_handler_misc.h @@ -20,7 +20,7 @@ #define NL_ACTION_HANDLER_MISC_H #include "nel/misc/types_nl.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "interface_manager.h" class CInterfaceGroup; diff --git a/code/ryzom/client/src/interface_v3/action_handler_move.cpp b/code/ryzom/client/src/interface_v3/action_handler_move.cpp index 67d0c7b72..782617ac3 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_move.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_move.cpp @@ -22,7 +22,7 @@ using namespace std; using namespace NLMISC; -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "../motion/user_controls.h" #include "../view.h" #include "../misc.h" diff --git a/code/ryzom/client/src/interface_v3/action_handler_outpost.cpp b/code/ryzom/client/src/interface_v3/action_handler_outpost.cpp index f38ecdfe7..125836a2f 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_outpost.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_outpost.cpp @@ -18,7 +18,7 @@ // Interface includes #include "interface_manager.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "action_handler_tools.h" #include "game_share/outpost.h" #include "nel/gui/interface_expr.h" diff --git a/code/ryzom/client/src/interface_v3/action_handler_phrase.cpp b/code/ryzom/client/src/interface_v3/action_handler_phrase.cpp index 2eda5c560..d702689dd 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_phrase.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_phrase.cpp @@ -20,7 +20,7 @@ #include "stdpch.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "../motion/user_controls.h" #include "../view.h" #include "../misc.h" diff --git a/code/ryzom/client/src/interface_v3/action_handler_tools.cpp b/code/ryzom/client/src/interface_v3/action_handler_tools.cpp index 19da51db6..06019f5da 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_tools.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_tools.cpp @@ -20,7 +20,7 @@ // Interface includes #include "interface_manager.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "../net_manager.h" diff --git a/code/ryzom/client/src/interface_v3/action_handler_ui.cpp b/code/ryzom/client/src/interface_v3/action_handler_ui.cpp index 94bd9e9b3..fd5d58329 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_ui.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_ui.cpp @@ -22,7 +22,7 @@ // Interface #include "interface_manager.h" #include "bot_chat_manager.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "group_container.h" #include "macrocmd_manager.h" #include "chat_window.h" diff --git a/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp b/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp index f469e53b1..d7fc952ed 100644 --- a/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp +++ b/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp @@ -22,7 +22,7 @@ #include "interface_manager.h" #include "../sheet_manager.h" #include "inventory_manager.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "../client_cfg.h" #include "ctrl_base_button.h" #include "group_container.h" diff --git a/code/ryzom/client/src/interface_v3/bot_chat_manager.cpp b/code/ryzom/client/src/interface_v3/bot_chat_manager.cpp index 1e1f123db..9e96fb602 100644 --- a/code/ryzom/client/src/interface_v3/bot_chat_manager.cpp +++ b/code/ryzom/client/src/interface_v3/bot_chat_manager.cpp @@ -20,11 +20,11 @@ #include "bot_chat_manager.h" #include "bot_chat_page.h" #include "../net_manager.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "../user_entity.h" #include "interface_manager.h" #include "view_text_id.h" -#include "interface_group.h" +#include "nel/gui/interface_group.h" #include "game_share/prerequisit_infos.h" using namespace std; diff --git a/code/ryzom/client/src/interface_v3/bot_chat_page.cpp b/code/ryzom/client/src/interface_v3/bot_chat_page.cpp index 1194c649f..b7624b365 100644 --- a/code/ryzom/client/src/interface_v3/bot_chat_page.cpp +++ b/code/ryzom/client/src/interface_v3/bot_chat_page.cpp @@ -19,7 +19,7 @@ #include "stdpch.h" #include "bot_chat_page.h" #include "interface_manager.h" -#include "interface_group.h" +#include "nel/gui/interface_group.h" #include "../user_entity.h" diff --git a/code/ryzom/client/src/interface_v3/bot_chat_page_create_guild.cpp b/code/ryzom/client/src/interface_v3/bot_chat_page_create_guild.cpp index 2e7c95ca2..ec3ff4d64 100644 --- a/code/ryzom/client/src/interface_v3/bot_chat_page_create_guild.cpp +++ b/code/ryzom/client/src/interface_v3/bot_chat_page_create_guild.cpp @@ -20,8 +20,8 @@ #include "bot_chat_page_create_guild.h" #include "interface_manager.h" #include "guild_manager.h" -#include "interface_group.h" -#include "action_handler.h" +#include "nel/gui/interface_group.h" +#include "nel/gui/action_handler.h" #include "group_editbox.h" #include "dbctrl_sheet.h" #include "bot_chat_manager.h" diff --git a/code/ryzom/client/src/interface_v3/bot_chat_page_dynamic_mission.cpp b/code/ryzom/client/src/interface_v3/bot_chat_page_dynamic_mission.cpp index 15f3dc6aa..2d744f4ad 100644 --- a/code/ryzom/client/src/interface_v3/bot_chat_page_dynamic_mission.cpp +++ b/code/ryzom/client/src/interface_v3/bot_chat_page_dynamic_mission.cpp @@ -19,9 +19,9 @@ #include "stdpch.h" #include "bot_chat_page_dynamic_mission.h" #include "interface_manager.h" -#include "interface_group.h" +#include "nel/gui/interface_group.h" #include "../string_manager_client.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "dbgroup_combo_box.h" #include "bot_chat_page_all.h" #include "bot_chat_manager.h" diff --git a/code/ryzom/client/src/interface_v3/bot_chat_page_mission.cpp b/code/ryzom/client/src/interface_v3/bot_chat_page_mission.cpp index fc84aedde..6a8f75e8c 100644 --- a/code/ryzom/client/src/interface_v3/bot_chat_page_mission.cpp +++ b/code/ryzom/client/src/interface_v3/bot_chat_page_mission.cpp @@ -19,11 +19,11 @@ #include "stdpch.h" #include "bot_chat_page_mission.h" #include "interface_manager.h" -#include "interface_group.h" +#include "nel/gui/interface_group.h" #include "bot_chat_manager.h" #include "bot_chat_page_all.h" #include "dbgroup_list_sheet_trade.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "group_container.h" #include "dbctrl_sheet.h" #include "view_text_id.h" diff --git a/code/ryzom/client/src/interface_v3/bot_chat_page_mission_end.cpp b/code/ryzom/client/src/interface_v3/bot_chat_page_mission_end.cpp index acc65410b..c27997d4f 100644 --- a/code/ryzom/client/src/interface_v3/bot_chat_page_mission_end.cpp +++ b/code/ryzom/client/src/interface_v3/bot_chat_page_mission_end.cpp @@ -20,7 +20,7 @@ #include "stdpch.h" #include "bot_chat_page_mission_end.h" #include "interface_manager.h" -#include "interface_group.h" +#include "nel/gui/interface_group.h" #include "bot_chat_manager.h" #include "interface_manager.h" #include "../client_cfg.h" diff --git a/code/ryzom/client/src/interface_v3/bot_chat_page_news.cpp b/code/ryzom/client/src/interface_v3/bot_chat_page_news.cpp index da960c5a5..e5555b44c 100644 --- a/code/ryzom/client/src/interface_v3/bot_chat_page_news.cpp +++ b/code/ryzom/client/src/interface_v3/bot_chat_page_news.cpp @@ -19,7 +19,7 @@ #include "stdpch.h" #include "bot_chat_page_news.h" #include "interface_manager.h" -#include "interface_group.h" +#include "nel/gui/interface_group.h" static const char *WIN_BOT_CHAT_PAGE_NEWS = "ui:interface:bot_chat_news"; diff --git a/code/ryzom/client/src/interface_v3/bot_chat_page_player_gift.cpp b/code/ryzom/client/src/interface_v3/bot_chat_page_player_gift.cpp index 0a310db57..c21d3cc13 100644 --- a/code/ryzom/client/src/interface_v3/bot_chat_page_player_gift.cpp +++ b/code/ryzom/client/src/interface_v3/bot_chat_page_player_gift.cpp @@ -19,8 +19,8 @@ #include "stdpch.h" #include "bot_chat_page_player_gift.h" #include "interface_manager.h" -#include "interface_group.h" -#include "action_handler.h" +#include "nel/gui/interface_group.h" +#include "nel/gui/action_handler.h" #include "../net_manager.h" #include "bot_chat_manager.h" #include "bot_chat_page_all.h" diff --git a/code/ryzom/client/src/interface_v3/bot_chat_page_trade.cpp b/code/ryzom/client/src/interface_v3/bot_chat_page_trade.cpp index 809a433e9..7085a1c55 100644 --- a/code/ryzom/client/src/interface_v3/bot_chat_page_trade.cpp +++ b/code/ryzom/client/src/interface_v3/bot_chat_page_trade.cpp @@ -27,10 +27,10 @@ // #include "bot_chat_page_trade.h" #include "interface_manager.h" -#include "interface_group.h" +#include "nel/gui/interface_group.h" #include "inventory_manager.h" #include "../net_manager.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "bot_chat_page_all.h" #include "bot_chat_manager.h" #include "dbctrl_sheet.h" diff --git a/code/ryzom/client/src/interface_v3/character_3d.h b/code/ryzom/client/src/interface_v3/character_3d.h index d5cc5d8b0..526816f1b 100644 --- a/code/ryzom/client/src/interface_v3/character_3d.h +++ b/code/ryzom/client/src/interface_v3/character_3d.h @@ -23,9 +23,9 @@ #include "game_share/character_summary.h" #include "game_share/slot_types.h" #include "nel/3d/u_skeleton.h" -#include "interface_options.h" +#include "nel/gui/interface_options.h" #include "interface_options_ryzom.h" -#include "interface_element.h" +#include "nel/gui/interface_element.h" // ------------------------------------------------------------------------------------------------ diff --git a/code/ryzom/client/src/interface_v3/chat_window.cpp b/code/ryzom/client/src/interface_v3/chat_window.cpp index 62548652e..d1f376b17 100644 --- a/code/ryzom/client/src/interface_v3/chat_window.cpp +++ b/code/ryzom/client/src/interface_v3/chat_window.cpp @@ -34,7 +34,7 @@ #include "group_editbox.h" #include "group_tab.h" #include "interface_manager.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "../client_chat_manager.h" // #include "../session_browser_impl.h" diff --git a/code/ryzom/client/src/interface_v3/ctrl_base_button.h b/code/ryzom/client/src/interface_v3/ctrl_base_button.h index 25d3dddf7..3f202dcf7 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_base_button.h +++ b/code/ryzom/client/src/interface_v3/ctrl_base_button.h @@ -19,8 +19,8 @@ #ifndef NL_CTRL_BASE_BUTTON_H #define NL_CTRL_BASE_BUTTON_H -#include "ctrl_base.h" -#include "action_handler.h" +#include "nel/gui/ctrl_base.h" +#include "nel/gui/action_handler.h" // *************************************************************************** diff --git a/code/ryzom/client/src/interface_v3/ctrl_col_pick.h b/code/ryzom/client/src/interface_v3/ctrl_col_pick.h index 741341b5f..956f077a7 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_col_pick.h +++ b/code/ryzom/client/src/interface_v3/ctrl_col_pick.h @@ -20,7 +20,7 @@ #define RZ_CTRL_COL_PICK_H #include "nel/misc/types_nl.h" -#include "ctrl_base.h" +#include "nel/gui/ctrl_base.h" /** * Class handling a Color Picker diff --git a/code/ryzom/client/src/interface_v3/ctrl_polygon.h b/code/ryzom/client/src/interface_v3/ctrl_polygon.h index 4ad4cd34e..78b852ba4 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_polygon.h +++ b/code/ryzom/client/src/interface_v3/ctrl_polygon.h @@ -18,7 +18,7 @@ #ifndef RZ_CTRL_POLYGON_H #define RZ_CTRL_POLYGON_H -#include "ctrl_base.h" +#include "nel/gui/ctrl_base.h" #include "nel/gui/view_renderer.h" #include "nel/misc/geom_ext.h" #include "nel/misc/polygon.h" diff --git a/code/ryzom/client/src/interface_v3/ctrl_quad.cpp b/code/ryzom/client/src/interface_v3/ctrl_quad.cpp index 5269eaaf4..f1da0754b 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_quad.cpp +++ b/code/ryzom/client/src/interface_v3/ctrl_quad.cpp @@ -16,7 +16,7 @@ #include "stdpch.h" #include "ctrl_quad.h" -#include "interface_group.h" +#include "nel/gui/interface_group.h" #include "interface_manager.h" using namespace NLMISC; diff --git a/code/ryzom/client/src/interface_v3/ctrl_quad.h b/code/ryzom/client/src/interface_v3/ctrl_quad.h index 1f3f5328c..2e4ec17ca 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_quad.h +++ b/code/ryzom/client/src/interface_v3/ctrl_quad.h @@ -18,7 +18,7 @@ #ifndef RZ_CTRL_QUAD_H #define RZ_CTRL_QUAD_H -#include "ctrl_base.h" +#include "nel/gui/ctrl_base.h" #include "nel/gui/view_renderer.h" #include "nel/misc/geom_ext.h" diff --git a/code/ryzom/client/src/interface_v3/ctrl_scroll.cpp b/code/ryzom/client/src/interface_v3/ctrl_scroll.cpp index 58d099712..834d3ee5e 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_scroll.cpp +++ b/code/ryzom/client/src/interface_v3/ctrl_scroll.cpp @@ -16,7 +16,7 @@ #include "interface_manager.h" -#include "widget_manager.h" +#include "nel/gui/widget_manager.h" #include "ctrl_scroll.h" #include "nel/misc/xml_auto_ptr.h" #include "group_menu.h" @@ -908,7 +908,7 @@ int CCtrlScroll::luaEnsureVisible(CLuaState &ls) { const char *funcName = "ensureVisible"; CLuaIHM::checkArgCount(ls, funcName, 3); - CLuaIHMRyzom::checkArgTypeUIElement(ls, funcName, 1); + CLuaIHM::checkArgTypeUIElement(ls, funcName, 1); CLuaIHM::checkArgType(ls, funcName, 2, LUA_TSTRING); CLuaIHM::checkArgType(ls, funcName, 3, LUA_TSTRING); THotSpot hs[2]; @@ -959,7 +959,7 @@ int CCtrlScroll::luaEnsureVisible(CLuaState &ls) } } } - ensureVisible(CLuaIHMRyzom::getUIOnStack(ls, 1), hs[0], hs[1]); + ensureVisible(CLuaIHM::getUIOnStack(ls, 1), hs[0], hs[1]); return 0; } diff --git a/code/ryzom/client/src/interface_v3/ctrl_scroll.h b/code/ryzom/client/src/interface_v3/ctrl_scroll.h index e4f1b4db3..d1e6fe2d3 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_scroll.h +++ b/code/ryzom/client/src/interface_v3/ctrl_scroll.h @@ -20,7 +20,7 @@ #define RZ_CTRL_SCROLL_H #include "nel/misc/types_nl.h" -#include "ctrl_scroll_base.h" +#include "nel/gui/ctrl_scroll_base.h" /** * Class handling scollbar function diff --git a/code/ryzom/client/src/interface_v3/ctrl_text_button.cpp b/code/ryzom/client/src/interface_v3/ctrl_text_button.cpp index 3e2fd0a92..efa54d33c 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_text_button.cpp +++ b/code/ryzom/client/src/interface_v3/ctrl_text_button.cpp @@ -549,7 +549,7 @@ int CCtrlTextButton::luaGetViewText(CLuaState &ls) { const char *funcName = "getViewText"; CLuaIHM::checkArgCount(ls, funcName, 0); - CLuaIHMRyzom::pushUIOnStack(ls, getViewText()); + CLuaIHM::pushUIOnStack(ls, getViewText()); return 1; } diff --git a/code/ryzom/client/src/interface_v3/ctrl_tooltip.h b/code/ryzom/client/src/interface_v3/ctrl_tooltip.h index 5564a8e5c..67fa2ccd3 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_tooltip.h +++ b/code/ryzom/client/src/interface_v3/ctrl_tooltip.h @@ -19,7 +19,7 @@ #ifndef RZ_CTRL_TOOLTIP_H #define RZ_CTRL_TOOLTIP_H -#include "ctrl_base.h" +#include "nel/gui/ctrl_base.h" #include "nel/3d/u_texture.h" namespace NLGUI diff --git a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp index 7159c3987..586817ac4 100644 --- a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp +++ b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp @@ -30,7 +30,7 @@ #include "game_share/inventories.h" #include "list_sheet_base.h" #include "../string_manager_client.h" -#include "interface_options.h" +#include "nel/gui/interface_options.h" #include "inventory_manager.h" #include "skill_manager.h" #include "../user_entity.h" @@ -130,7 +130,7 @@ ucstring CControlSheetTooltipInfoWaiter::infoValidated(CDBCtrlSheet* ctrlSheet, // *************************************************************************** int CDBCtrlSheet::luaGetDraggedSheet(CLuaState &ls) { - CLuaIHMRyzom::pushUIOnStack(ls, dynamic_cast( dynamic_cast< CDBCtrlSheet* >( CCtrlDraggable::getDraggedSheet() ) )); + CLuaIHM::pushUIOnStack(ls, dynamic_cast( dynamic_cast< CDBCtrlSheet* >( CCtrlDraggable::getDraggedSheet() ) )); return 1; } diff --git a/code/ryzom/client/src/interface_v3/dbctrl_sheet.h b/code/ryzom/client/src/interface_v3/dbctrl_sheet.h index 3071d78df..c055ac8d0 100644 --- a/code/ryzom/client/src/interface_v3/dbctrl_sheet.h +++ b/code/ryzom/client/src/interface_v3/dbctrl_sheet.h @@ -24,9 +24,9 @@ #include "nel/misc/smart_ptr.h" // client #include "nel/gui/reflect.h" -#include "ctrl_draggable.h" +#include "nel/gui/ctrl_draggable.h" #include "nel/gui/interface_expr.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "sphrase_manager.h" // game share #include "game_share/brick_types.h" diff --git a/code/ryzom/client/src/interface_v3/dbgroup_build_phrase.h b/code/ryzom/client/src/interface_v3/dbgroup_build_phrase.h index e828c56e6..bcbd1e972 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_build_phrase.h +++ b/code/ryzom/client/src/interface_v3/dbgroup_build_phrase.h @@ -20,7 +20,7 @@ #define NL_DBGROUP_BUILD_PHRASE_H #include "nel/misc/types_nl.h" -#include "interface_group.h" +#include "nel/gui/interface_group.h" #include "game_share/sphrase_com.h" #include "game_share/brick_types.h" #include "game_share/skills.h" diff --git a/code/ryzom/client/src/interface_v3/dbgroup_combo_box.cpp b/code/ryzom/client/src/interface_v3/dbgroup_combo_box.cpp index f376c306a..5dfa3810e 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_combo_box.cpp +++ b/code/ryzom/client/src/interface_v3/dbgroup_combo_box.cpp @@ -22,7 +22,7 @@ #include "nel/misc/xml_auto_ptr.h" #include "interface_manager.h" #include "ctrl_button.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "nel/gui/lua_ihm.h" #include "nel/gui/lua_ihm.h" diff --git a/code/ryzom/client/src/interface_v3/dbgroup_combo_box.h b/code/ryzom/client/src/interface_v3/dbgroup_combo_box.h index 62be81037..69c1754c0 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_combo_box.h +++ b/code/ryzom/client/src/interface_v3/dbgroup_combo_box.h @@ -20,7 +20,7 @@ #define NL_DBGROUP_COMBO_BOX_H #include "nel/misc/types_nl.h" -#include "interface_group.h" +#include "nel/gui/interface_group.h" diff --git a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet.cpp b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet.cpp index 83d29b76f..77d234b12 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet.cpp +++ b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet.cpp @@ -24,7 +24,7 @@ #include "ctrl_button.h" #include "nel/gui/interface_property.h" #include "interface_manager.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "../sheet_manager.h" #include "game_share/animal_status.h" diff --git a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.cpp b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.cpp index 02ee3fa14..61687b4f7 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.cpp +++ b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.cpp @@ -24,7 +24,7 @@ #include "../sheet_manager.h" #include "ctrl_button.h" #include "view_text.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "../time_client.h" #include "game_share/animal_status.h" diff --git a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_trade.cpp b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_trade.cpp index 24efaaa88..04c40f9d5 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_trade.cpp +++ b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_trade.cpp @@ -24,7 +24,7 @@ #include "../sheet_manager.h" #include "ctrl_button.h" #include "view_text.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "sphrase_manager.h" #include "game_share/time_weather_season/time_and_season.h" #include "game_share/pvp_clan.h" diff --git a/code/ryzom/client/src/interface_v3/dbgroup_select_number.cpp b/code/ryzom/client/src/interface_v3/dbgroup_select_number.cpp index 3e99469fd..69440ff5a 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_select_number.cpp +++ b/code/ryzom/client/src/interface_v3/dbgroup_select_number.cpp @@ -26,7 +26,7 @@ #include "ctrl_button.h" #include "nel/gui/interface_property.h" #include "interface_manager.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" using namespace std; diff --git a/code/ryzom/client/src/interface_v3/dbgroup_select_number.h b/code/ryzom/client/src/interface_v3/dbgroup_select_number.h index 0375e920d..4a103161b 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_select_number.h +++ b/code/ryzom/client/src/interface_v3/dbgroup_select_number.h @@ -20,7 +20,7 @@ #define NL_DBGROUP_SELECT_NUMBER_H #include "nel/misc/types_nl.h" -#include "interface_group.h" +#include "nel/gui/interface_group.h" diff --git a/code/ryzom/client/src/interface_v3/dbview_digit.h b/code/ryzom/client/src/interface_v3/dbview_digit.h index c24b5c69f..0589e38d8 100644 --- a/code/ryzom/client/src/interface_v3/dbview_digit.h +++ b/code/ryzom/client/src/interface_v3/dbview_digit.h @@ -21,7 +21,7 @@ #include "nel/misc/types_nl.h" -#include "view_base.h" +#include "nel/gui/view_base.h" // *************************************************************************** diff --git a/code/ryzom/client/src/interface_v3/group_career.cpp b/code/ryzom/client/src/interface_v3/group_career.cpp index 04916f007..b50e1ab36 100644 --- a/code/ryzom/client/src/interface_v3/group_career.cpp +++ b/code/ryzom/client/src/interface_v3/group_career.cpp @@ -20,7 +20,7 @@ #include "group_career.h" #include "interface_manager.h" -#include "interface_element.h" +#include "nel/gui/interface_element.h" //#include "game_share/jobs.h" #include "nel/misc/xml_auto_ptr.h" diff --git a/code/ryzom/client/src/interface_v3/group_compas.cpp b/code/ryzom/client/src/interface_v3/group_compas.cpp index 356393fe2..d6e883b64 100644 --- a/code/ryzom/client/src/interface_v3/group_compas.cpp +++ b/code/ryzom/client/src/interface_v3/group_compas.cpp @@ -23,7 +23,7 @@ #include "group_compas.h" #include "interface_3d_scene.h" #include "../entities.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "group_map.h" #include "../continent.h" #include "../continent_manager.h" diff --git a/code/ryzom/client/src/interface_v3/group_container.cpp b/code/ryzom/client/src/interface_v3/group_container.cpp index 0714dd2eb..ce5499c11 100644 --- a/code/ryzom/client/src/interface_v3/group_container.cpp +++ b/code/ryzom/client/src/interface_v3/group_container.cpp @@ -21,10 +21,10 @@ #include "group_container.h" #include "interface_manager.h" -#include "interface_options.h" +#include "nel/gui/interface_options.h" #include "interface_options_ryzom.h" #include "nel/misc/xml_auto_ptr.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "../time_client.h" #include "group_editbox.h" #include "view_text_formated.h" diff --git a/code/ryzom/client/src/interface_v3/group_container.h b/code/ryzom/client/src/interface_v3/group_container.h index c1268870c..330342ed1 100644 --- a/code/ryzom/client/src/interface_v3/group_container.h +++ b/code/ryzom/client/src/interface_v3/group_container.h @@ -19,8 +19,8 @@ #ifndef RZ_GROUP_CONTAINER_H #define RZ_GROUP_CONTAINER_H -#include "interface_group.h" -#include "group_container_base.h" +#include "nel/gui/interface_group.h" +#include "nel/gui/group_container_base.h" #include "nel/misc/smart_ptr.h" namespace NLGUI diff --git a/code/ryzom/client/src/interface_v3/group_editbox.cpp b/code/ryzom/client/src/interface_v3/group_editbox.cpp index c49752dce..7d51be171 100644 --- a/code/ryzom/client/src/interface_v3/group_editbox.cpp +++ b/code/ryzom/client/src/interface_v3/group_editbox.cpp @@ -24,7 +24,7 @@ #include "nel/misc/command.h" #include "view_text.h" #include "nel/misc/xml_auto_ptr.h" -#include "interface_options.h" +#include "nel/gui/interface_options.h" #include "dbctrl_sheet.h" #include "group_container.h" #include "../time_client.h" diff --git a/code/ryzom/client/src/interface_v3/group_editbox.h b/code/ryzom/client/src/interface_v3/group_editbox.h index e892b134a..99a07c093 100644 --- a/code/ryzom/client/src/interface_v3/group_editbox.h +++ b/code/ryzom/client/src/interface_v3/group_editbox.h @@ -19,8 +19,8 @@ #ifndef RZ_CTRL_EDITBOX_H #define RZ_CTRL_EDITBOX_H -#include "interface_group.h" -#include "group_editbox_base.h" +#include "nel/gui/interface_group.h" +#include "nel/gui/group_editbox_base.h" #include "nel/3d/u_texture.h" namespace NLGUI diff --git a/code/ryzom/client/src/interface_v3/group_html.cpp b/code/ryzom/client/src/interface_v3/group_html.cpp index 82c543ac6..950990e82 100644 --- a/code/ryzom/client/src/interface_v3/group_html.cpp +++ b/code/ryzom/client/src/interface_v3/group_html.cpp @@ -36,7 +36,7 @@ extern "C" #include "ctrl_button.h" #include "dbctrl_sheet.h" #include "ctrl_text_button.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "group_paragraph.h" #include "group_editbox.h" #include "interface_manager.h" diff --git a/code/ryzom/client/src/interface_v3/group_html.h b/code/ryzom/client/src/interface_v3/group_html.h index f8e3e09f9..5d5fc9041 100644 --- a/code/ryzom/client/src/interface_v3/group_html.h +++ b/code/ryzom/client/src/interface_v3/group_html.h @@ -24,7 +24,7 @@ #include #include "nel/misc/types_nl.h" -#include "interface_group.h" +#include "nel/gui/interface_group.h" #include "group_scrolltext.h" #include "group_tree.h" #include "ctrl_button.h" diff --git a/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp b/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp index 2c8211619..32ab05086 100644 --- a/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp +++ b/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp @@ -21,7 +21,7 @@ #include "interface_manager.h" #include "skill_manager.h" #include "../character_cl.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "../entities.h" #include "group_paragraph.h" // For CCtrlLink #include "../net_manager.h" diff --git a/code/ryzom/client/src/interface_v3/group_in_scene_user_info.cpp b/code/ryzom/client/src/interface_v3/group_in_scene_user_info.cpp index 7d0253978..16a16393b 100644 --- a/code/ryzom/client/src/interface_v3/group_in_scene_user_info.cpp +++ b/code/ryzom/client/src/interface_v3/group_in_scene_user_info.cpp @@ -20,7 +20,7 @@ #include "interface_manager.h" #include "view_bitmap.h" #include "group_in_scene_user_info.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "../entities.h" #include "../user_entity.h" #include "../forage_source_cl.h" diff --git a/code/ryzom/client/src/interface_v3/group_list.cpp b/code/ryzom/client/src/interface_v3/group_list.cpp index b20f9d46e..e77f675d6 100644 --- a/code/ryzom/client/src/interface_v3/group_list.cpp +++ b/code/ryzom/client/src/interface_v3/group_list.cpp @@ -20,7 +20,7 @@ #include "group_list.h" #include "interface_manager.h" -#include "interface_element.h" +#include "nel/gui/interface_element.h" #include "../client_chat_manager.h" #include "view_bitmap.h" #include "view_text_id.h" @@ -915,7 +915,7 @@ sint32 CGroupList::getElementIndex(CViewBase* child) const int CGroupList::luaGetElementIndex(CLuaState &ls) { CLuaIHM::checkArgCount(ls, "getElementIndex", 1); - CViewBase * viewBase = dynamic_cast(CLuaIHMRyzom::getUIOnStack(ls, 1)); + CViewBase * viewBase = dynamic_cast(CLuaIHM::getUIOnStack(ls, 1)); ls.push((double) getElementIndex(viewBase)); return 1; } @@ -967,7 +967,7 @@ void CGroupList::swapChildren(uint index1, uint index2) int CGroupList::luaUpChild(CLuaState &ls) { CLuaIHM::checkArgCount(ls, "upChild", 1); - CViewBase * viewBase = dynamic_cast(CLuaIHMRyzom::getUIOnStack(ls, 1)); + CViewBase * viewBase = dynamic_cast(CLuaIHM::getUIOnStack(ls, 1)); sint32 indexUpChild = getElementIndex(viewBase); if(indexUpChild > 0) { @@ -980,7 +980,7 @@ int CGroupList::luaUpChild(CLuaState &ls) int CGroupList::luaDownChild(CLuaState &ls) { CLuaIHM::checkArgCount(ls, "downChild", 1); - CViewBase * viewBase = dynamic_cast(CLuaIHMRyzom::getUIOnStack(ls, 1)); + CViewBase * viewBase = dynamic_cast(CLuaIHM::getUIOnStack(ls, 1)); sint32 indexDownChild = getElementIndex(viewBase); if(indexDownChild < (sint32) (_Elements.size()-1)) { @@ -1001,7 +1001,7 @@ int CGroupList::luaGetChild(CLuaState &ls) CLuaIHM::fails(ls, "getChild : trying to access element %d in list '%s', which has %d elements", index, getId().c_str(), (int) _Elements.size()); } - CLuaIHMRyzom::pushUIOnStack(ls, getChild((uint) index)); + CLuaIHM::pushUIOnStack(ls, getChild((uint) index)); return 1; } @@ -1090,7 +1090,7 @@ int CGroupList::luaAddChild(CLuaState &ls) { const char *funcName = "addChild"; CLuaIHM::checkArgCount(ls, funcName, 1); - CViewBase *vb = dynamic_cast(CLuaIHMRyzom::getUIOnStack(ls, 1)); + CViewBase *vb = dynamic_cast(CLuaIHM::getUIOnStack(ls, 1)); if (!vb) { CLuaIHM::fails(ls, "%s requires a view, group or control", funcName); @@ -1108,7 +1108,7 @@ int CGroupList::luaAddChildAtIndex(CLuaState &ls) const char *funcName = "addChildAtIndex"; CLuaIHM::checkArgCount(ls, funcName, 2); CLuaIHM::checkArgType(ls, funcName, 2, LUA_TNUMBER); - CViewBase *vb = dynamic_cast(CLuaIHMRyzom::getUIOnStack(ls, 1)); + CViewBase *vb = dynamic_cast(CLuaIHM::getUIOnStack(ls, 1)); if (!vb) { CLuaIHM::fails(ls, "%s requires a view, group or control", funcName); @@ -1125,7 +1125,7 @@ int CGroupList::luaDetachChild(CLuaState &ls) { const char *funcName = "detachChild"; CLuaIHM::checkArgCount(ls, funcName, 1); - CViewBase *vb = dynamic_cast(CLuaIHMRyzom::getUIOnStack(ls, 1)); + CViewBase *vb = dynamic_cast(CLuaIHM::getUIOnStack(ls, 1)); if (!vb) { nlwarning("%s requires a view, group or control", funcName); @@ -1142,7 +1142,7 @@ int CGroupList::luaDetachChild(CLuaState &ls) int CGroupList::luaDelChild(CLuaState &ls) { CLuaIHM::checkArgCount(ls, "CGroupList::delChild", 1); - CViewBase *vb = dynamic_cast(CLuaIHMRyzom::getUIOnStack(ls, 1)); + CViewBase *vb = dynamic_cast(CLuaIHM::getUIOnStack(ls, 1)); if (vb) delChild(vb); updateCoords(); return 0; diff --git a/code/ryzom/client/src/interface_v3/group_list.h b/code/ryzom/client/src/interface_v3/group_list.h index 1053a2241..b7fe975d2 100644 --- a/code/ryzom/client/src/interface_v3/group_list.h +++ b/code/ryzom/client/src/interface_v3/group_list.h @@ -20,7 +20,7 @@ #define NL_GROUP_LIST_H #include "nel/misc/types_nl.h" -#include "group_frame.h" +#include "nel/gui/group_frame.h" #include "view_text.h" diff --git a/code/ryzom/client/src/interface_v3/group_map.cpp b/code/ryzom/client/src/interface_v3/group_map.cpp index fa197ef51..99bf1edf6 100644 --- a/code/ryzom/client/src/interface_v3/group_map.cpp +++ b/code/ryzom/client/src/interface_v3/group_map.cpp @@ -28,7 +28,7 @@ #include "group_editbox.h" #include "../string_manager_client.h" #include "group_container.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "../dummy_progress.h" #include "group_compas.h" #include "../connection.h" diff --git a/code/ryzom/client/src/interface_v3/group_map.h b/code/ryzom/client/src/interface_v3/group_map.h index 30a8b9ded..a4d162068 100644 --- a/code/ryzom/client/src/interface_v3/group_map.h +++ b/code/ryzom/client/src/interface_v3/group_map.h @@ -25,7 +25,7 @@ #include "../client_sheets/world_sheet.h" -#include "interface_group.h" +#include "nel/gui/interface_group.h" #include "ctrl_button.h" #include "view_bitmap.h" #include "view_text.h" diff --git a/code/ryzom/client/src/interface_v3/group_menu.cpp b/code/ryzom/client/src/interface_v3/group_menu.cpp index 3ca9a7db3..bd2f44088 100644 --- a/code/ryzom/client/src/interface_v3/group_menu.cpp +++ b/code/ryzom/client/src/interface_v3/group_menu.cpp @@ -23,7 +23,7 @@ #include "group_menu.h" #include "nel/misc/xml_auto_ptr.h" #include "view_bitmap.h" -#include "action_handler.h" // Just for getAllParams +#include "nel/gui/action_handler.h" // Just for getAllParams #include "nel/gui/lua_ihm.h" #include "lua_ihm_ryzom.h" @@ -1693,7 +1693,7 @@ int CGroupSubMenu::luaGetSubMenu(CLuaState &ls) const char *funcName = "getSubMenu"; CLuaIHM::checkArgCount(ls, funcName, 1); CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER); - CLuaIHMRyzom::pushUIOnStack(ls, getSubMenu((uint) ls.toNumber(1))); + CLuaIHM::pushUIOnStack(ls, getSubMenu((uint) ls.toNumber(1))); return 1; } @@ -1704,7 +1704,7 @@ int CGroupSubMenu::luaAddSubMenu(CLuaState &ls) CLuaIHM::checkArgCount(ls, funcName, 1); CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER); setSubMenu((uint) ls.toNumber(1), new CGroupSubMenu(CViewText::TCtorParam())); - CLuaIHMRyzom::pushUIOnStack(ls, getSubMenu((uint) ls.toNumber(1))); + CLuaIHM::pushUIOnStack(ls, getSubMenu((uint) ls.toNumber(1))); return 1; } @@ -1804,11 +1804,11 @@ int CGroupSubMenu::luaSetUserGroupRight(CLuaState &ls) const char *funcName = "setUserGroupRight"; CLuaIHM::checkArgCount(ls, funcName, 2); CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER); - if (!(CLuaIHMRyzom::isUIOnStack(ls, 2) || ls.isNil(2))) + if (!(CLuaIHM::isUIOnStack(ls, 2) || ls.isNil(2))) { CLuaIHM::fails(ls, "%s : Group required as argument 2", funcName); } - CInterfaceElement *el = CLuaIHMRyzom::getUIOnStack(ls, 2); + CInterfaceElement *el = CLuaIHM::getUIOnStack(ls, 2); CInterfaceGroup *group = dynamic_cast(el); if (el && !group) { @@ -1824,11 +1824,11 @@ int CGroupSubMenu::luaSetUserGroupLeft(CLuaState &ls) const char *funcName = "setUserGroupLeft"; CLuaIHM::checkArgCount(ls, funcName, 2); CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER); - if (!(CLuaIHMRyzom::isUIOnStack(ls, 2) || ls.isNil(2))) + if (!(CLuaIHM::isUIOnStack(ls, 2) || ls.isNil(2))) { CLuaIHM::fails(ls, "%s : Group required as argument 2", funcName); } - CInterfaceElement *el = CLuaIHMRyzom::getUIOnStack(ls, 2); + CInterfaceElement *el = CLuaIHM::getUIOnStack(ls, 2); CInterfaceGroup *group = dynamic_cast(el); if (el && !group) { @@ -1845,7 +1845,7 @@ int CGroupSubMenu::luaGetUserGroupRight(CLuaState &ls) const char *funcName = "getUserGroupRight"; CLuaIHM::checkArgCount(ls, funcName, 1); CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER); - CLuaIHMRyzom::pushUIOnStack(ls, getUserGroupRight((uint) ls.toNumber(1))); + CLuaIHM::pushUIOnStack(ls, getUserGroupRight((uint) ls.toNumber(1))); return 1; } @@ -1859,7 +1859,7 @@ int CGroupSubMenu::luaGetUserGroupLeft(CLuaState &ls) CInterfaceElement *pIE = getUserGroupLeft((uint) ls.toNumber(1)); if (pIE) { - CLuaIHMRyzom::pushUIOnStack(ls, pIE); + CLuaIHM::pushUIOnStack(ls, pIE); return 1; } else return 0; @@ -2282,7 +2282,7 @@ void CGroupMenu::setUserGroupLeft(uint line, CInterfaceGroup *gr, bool ownerShip int CGroupMenu::luaGetRootMenu(CLuaState &ls) { CLuaIHM::checkArgCount(ls, "getRootMenu", 0); - CLuaIHMRyzom::pushUIOnStack(ls, getRootMenu()); + CLuaIHM::pushUIOnStack(ls, getRootMenu()); return 1; } diff --git a/code/ryzom/client/src/interface_v3/group_menu.h b/code/ryzom/client/src/interface_v3/group_menu.h index d0ec9f82c..8f3098996 100644 --- a/code/ryzom/client/src/interface_v3/group_menu.h +++ b/code/ryzom/client/src/interface_v3/group_menu.h @@ -19,8 +19,8 @@ #ifndef RZ_GROUP_MENU_H #define RZ_GROUP_MENU_H -#include "interface_group.h" -#include "group_modal.h" +#include "nel/gui/interface_group.h" +#include "nel/gui/group_modal.h" #include "view_text.h" #include "ctrl_text_button.h" diff --git a/code/ryzom/client/src/interface_v3/group_modal_get_key.h b/code/ryzom/client/src/interface_v3/group_modal_get_key.h index 54a594e7e..afa789917 100644 --- a/code/ryzom/client/src/interface_v3/group_modal_get_key.h +++ b/code/ryzom/client/src/interface_v3/group_modal_get_key.h @@ -21,7 +21,7 @@ #include "nel/misc/types_nl.h" #include "../actions.h" // CLIENT -#include "group_modal.h" +#include "nel/gui/group_modal.h" // *************************************************************************** diff --git a/code/ryzom/client/src/interface_v3/group_paragraph.cpp b/code/ryzom/client/src/interface_v3/group_paragraph.cpp index f75afccf0..2ac417734 100644 --- a/code/ryzom/client/src/interface_v3/group_paragraph.cpp +++ b/code/ryzom/client/src/interface_v3/group_paragraph.cpp @@ -21,7 +21,7 @@ #include "group_paragraph.h" #include "group_html.h" #include "interface_manager.h" -#include "interface_element.h" +#include "nel/gui/interface_element.h" #include "../client_chat_manager.h" #include "view_bitmap.h" #include "view_text_id.h" diff --git a/code/ryzom/client/src/interface_v3/group_paragraph.h b/code/ryzom/client/src/interface_v3/group_paragraph.h index ab37a1814..f2c38bd05 100644 --- a/code/ryzom/client/src/interface_v3/group_paragraph.h +++ b/code/ryzom/client/src/interface_v3/group_paragraph.h @@ -20,7 +20,7 @@ #define NL_GROUP_PARAGRAPH_H #include "nel/misc/types_nl.h" -#include "group_frame.h" +#include "nel/gui/group_frame.h" #include "view_text.h" #include "view_link.h" #include "ctrl_button.h" diff --git a/code/ryzom/client/src/interface_v3/group_phrase_skill_filter.h b/code/ryzom/client/src/interface_v3/group_phrase_skill_filter.h index 26099f8e3..8da02ee10 100644 --- a/code/ryzom/client/src/interface_v3/group_phrase_skill_filter.h +++ b/code/ryzom/client/src/interface_v3/group_phrase_skill_filter.h @@ -22,7 +22,7 @@ #include "nel/misc/types_nl.h" #include "game_share/brick_families.h" #include "game_share/skills.h" -#include "interface_group.h" +#include "nel/gui/interface_group.h" #include "group_tree.h" diff --git a/code/ryzom/client/src/interface_v3/group_quick_help.cpp b/code/ryzom/client/src/interface_v3/group_quick_help.cpp index 5de2f530d..108d07a9b 100644 --- a/code/ryzom/client/src/interface_v3/group_quick_help.cpp +++ b/code/ryzom/client/src/interface_v3/group_quick_help.cpp @@ -26,7 +26,7 @@ #include "group_paragraph.h" #include "../libwww.h" #include "interface_manager.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "nel/misc/xml_auto_ptr.h" #include "../client_cfg.h" diff --git a/code/ryzom/client/src/interface_v3/group_scrolltext.cpp b/code/ryzom/client/src/interface_v3/group_scrolltext.cpp index 2a0885133..c3321e185 100644 --- a/code/ryzom/client/src/interface_v3/group_scrolltext.cpp +++ b/code/ryzom/client/src/interface_v3/group_scrolltext.cpp @@ -25,7 +25,7 @@ #include "view_text.h" #include "ctrl_scroll.h" #include "ctrl_button.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "../time_client.h" #include "nel/misc/i18n.h" diff --git a/code/ryzom/client/src/interface_v3/group_scrolltext.h b/code/ryzom/client/src/interface_v3/group_scrolltext.h index c9baa1889..520a416af 100644 --- a/code/ryzom/client/src/interface_v3/group_scrolltext.h +++ b/code/ryzom/client/src/interface_v3/group_scrolltext.h @@ -21,7 +21,7 @@ #define CL_GROUP_SCROLLTEXT_H #include "nel/misc/types_nl.h" -#include "interface_group.h" +#include "nel/gui/interface_group.h" class CGroupList; class CCtrlScroll; diff --git a/code/ryzom/client/src/interface_v3/group_skills.h b/code/ryzom/client/src/interface_v3/group_skills.h index e486ae098..a29af8a03 100644 --- a/code/ryzom/client/src/interface_v3/group_skills.h +++ b/code/ryzom/client/src/interface_v3/group_skills.h @@ -20,7 +20,7 @@ #define NL_GROUP_SKILLS_H #include "nel/misc/types_nl.h" -#include "interface_group.h" +#include "nel/gui/interface_group.h" #include "group_tree.h" // *************************************************************************** diff --git a/code/ryzom/client/src/interface_v3/group_tab.cpp b/code/ryzom/client/src/interface_v3/group_tab.cpp index af6ea1fae..f5b05c5ed 100644 --- a/code/ryzom/client/src/interface_v3/group_tab.cpp +++ b/code/ryzom/client/src/interface_v3/group_tab.cpp @@ -235,7 +235,7 @@ void CGroupTab::addTab(CCtrlTabButton * tabB, sint index) int CGroupTab::luaAddTab(CLuaState &ls) { CLuaIHM::checkArgCount(ls, "CGroupTab::addTab", 1); - CCtrlTabButton *tabB = dynamic_cast(CLuaIHMRyzom::getUIOnStack(ls, 1)); + CCtrlTabButton *tabB = dynamic_cast(CLuaIHM::getUIOnStack(ls, 1)); if (tabB) { // don't use addTab to avoid selection of new tab @@ -260,7 +260,7 @@ int CGroupTab::luaAddTabWithOrder(CLuaState &ls) CLuaIHM::checkArgCount(ls, funcName, 2); CLuaIHM::checkArgType(ls, funcName, 2, LUA_TNUMBER); - CCtrlTabButton *tabB = dynamic_cast(CLuaIHMRyzom::getUIOnStack(ls, 1)); + CCtrlTabButton *tabB = dynamic_cast(CLuaIHM::getUIOnStack(ls, 1)); if (tabB) { // don't use addTab to avoid selection of new tab @@ -395,7 +395,7 @@ int CGroupTab::luaGetTabButton(CLuaState &ls) CCtrlTabButton* tab = getTabButton((uint) ls.toNumber(1)); if(tab != NULL) { - CLuaIHMRyzom::pushUIOnStack(ls, tab); + CLuaIHM::pushUIOnStack(ls, tab); return 1; } return 0; @@ -726,7 +726,7 @@ int CGroupTab::luaGetGroup(CLuaState &ls) CInterfaceGroup* group = getGroup((uint) ls.toNumber(1)); if(group != NULL) { - CLuaIHMRyzom::pushUIOnStack(ls, group); + CLuaIHM::pushUIOnStack(ls, group); return 1; } return 0; diff --git a/code/ryzom/client/src/interface_v3/group_tab.h b/code/ryzom/client/src/interface_v3/group_tab.h index 42914506e..1e8e8c792 100644 --- a/code/ryzom/client/src/interface_v3/group_tab.h +++ b/code/ryzom/client/src/interface_v3/group_tab.h @@ -20,7 +20,7 @@ #define NL_GROUP_TAB_H #include "nel/misc/types_nl.h" -#include "interface_group.h" +#include "nel/gui/interface_group.h" #include "ctrl_text_button.h" diff --git a/code/ryzom/client/src/interface_v3/group_table.cpp b/code/ryzom/client/src/interface_v3/group_table.cpp index 347f0373f..09d3b9283 100644 --- a/code/ryzom/client/src/interface_v3/group_table.cpp +++ b/code/ryzom/client/src/interface_v3/group_table.cpp @@ -20,7 +20,7 @@ #include "group_table.h" #include "interface_manager.h" -#include "interface_element.h" +#include "nel/gui/interface_element.h" #include "../client_chat_manager.h" #include "view_bitmap.h" #include "view_text_id.h" diff --git a/code/ryzom/client/src/interface_v3/group_table.h b/code/ryzom/client/src/interface_v3/group_table.h index 888d6dbe3..f4aa0b8fd 100644 --- a/code/ryzom/client/src/interface_v3/group_table.h +++ b/code/ryzom/client/src/interface_v3/group_table.h @@ -20,7 +20,7 @@ #define NL_GROUP_TABLE_H #include "nel/misc/types_nl.h" -#include "group_frame.h" +#include "nel/gui/group_frame.h" #include "view_text.h" #include "view_link.h" #include "ctrl_button.h" diff --git a/code/ryzom/client/src/interface_v3/group_tree.cpp b/code/ryzom/client/src/interface_v3/group_tree.cpp index 46ce4434f..1d6282ffd 100644 --- a/code/ryzom/client/src/interface_v3/group_tree.cpp +++ b/code/ryzom/client/src/interface_v3/group_tree.cpp @@ -20,11 +20,11 @@ #include "group_tree.h" #include "interface_manager.h" -#include "interface_element.h" +#include "nel/gui/interface_element.h" #include "view_bitmap.h" #include "view_text.h" #include "group_container.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "nel/gui/lua_ihm.h" #include "lua_ihm_ryzom.h" @@ -1491,7 +1491,7 @@ int CGroupTree::SNode::luaGetParentTree(CLuaState &ls) CLuaIHM::checkArgCount(ls, "getParentTree", 0); if (ParentTree) { - CLuaIHMRyzom::pushUIOnStack(ls, ParentTree); + CLuaIHM::pushUIOnStack(ls, ParentTree); } else { diff --git a/code/ryzom/client/src/interface_v3/group_tree.h b/code/ryzom/client/src/interface_v3/group_tree.h index 444a0fe4d..038db0cf0 100644 --- a/code/ryzom/client/src/interface_v3/group_tree.h +++ b/code/ryzom/client/src/interface_v3/group_tree.h @@ -20,7 +20,7 @@ #define NL_GROUP_TREE_H #include "nel/misc/types_nl.h" -#include "group_frame.h" +#include "nel/gui/group_frame.h" #include "nel/misc/smart_ptr.h" class CViewBitmap; diff --git a/code/ryzom/client/src/interface_v3/group_wheel.h b/code/ryzom/client/src/interface_v3/group_wheel.h index a3b3f7c23..d2f12ca3c 100644 --- a/code/ryzom/client/src/interface_v3/group_wheel.h +++ b/code/ryzom/client/src/interface_v3/group_wheel.h @@ -19,7 +19,7 @@ #ifndef RZ_GROUP_CONTAINER_H #define RZ_GROUP_CONTAINER_H -#include "interface_group.h" +#include "nel/gui/interface_group.h" diff --git a/code/ryzom/client/src/interface_v3/guild_manager.cpp b/code/ryzom/client/src/interface_v3/guild_manager.cpp index 9271753f9..3e880bb22 100644 --- a/code/ryzom/client/src/interface_v3/guild_manager.cpp +++ b/code/ryzom/client/src/interface_v3/guild_manager.cpp @@ -21,7 +21,7 @@ #include "interface_manager.h" #include "../string_manager_client.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "view_text.h" #include "dbctrl_sheet.h" #include "group_container.h" diff --git a/code/ryzom/client/src/interface_v3/interface_3d_scene.cpp b/code/ryzom/client/src/interface_v3/interface_3d_scene.cpp index 589b9bf18..5df5b61eb 100644 --- a/code/ryzom/client/src/interface_v3/interface_3d_scene.cpp +++ b/code/ryzom/client/src/interface_v3/interface_3d_scene.cpp @@ -30,7 +30,7 @@ #include "nel/3d/u_animation_set.h" #include "nel/misc/xml_auto_ptr.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "nel/gui/lua_ihm.h" diff --git a/code/ryzom/client/src/interface_v3/interface_3d_scene.h b/code/ryzom/client/src/interface_v3/interface_3d_scene.h index 339497f43..28daa87af 100644 --- a/code/ryzom/client/src/interface_v3/interface_3d_scene.h +++ b/code/ryzom/client/src/interface_v3/interface_3d_scene.h @@ -19,7 +19,7 @@ #ifndef RZ_INTERFACE_SCENE_3D_H #define RZ_INTERFACE_SCENE_3D_H -#include "interface_group.h" +#include "nel/gui/interface_group.h" #include "nel/3d/u_point_light.h" #include "nel/3d/u_particle_system_instance.h" diff --git a/code/ryzom/client/src/interface_v3/interface_anim.cpp b/code/ryzom/client/src/interface_v3/interface_anim.cpp index a27c248d6..be39bc9b1 100644 --- a/code/ryzom/client/src/interface_v3/interface_anim.cpp +++ b/code/ryzom/client/src/interface_v3/interface_anim.cpp @@ -23,7 +23,7 @@ #include "interface_manager.h" #include "nel/gui/interface_expr.h" #include "nel/misc/xml_auto_ptr.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "../time_client.h" // ---------------------------------------------------------------------------- diff --git a/code/ryzom/client/src/interface_v3/interface_anim.h b/code/ryzom/client/src/interface_v3/interface_anim.h index 9965d3723..c8b06df5e 100644 --- a/code/ryzom/client/src/interface_v3/interface_anim.h +++ b/code/ryzom/client/src/interface_v3/interface_anim.h @@ -20,8 +20,8 @@ #define RZ_INTERFACE_ANIM_H #include "nel/gui/interface_property.h" -#include "interface_group.h" -#include "interface_link.h" +#include "nel/gui/interface_group.h" +#include "nel/gui/interface_link.h" #include "nel/3d/u_track.h" diff --git a/code/ryzom/client/src/interface_v3/interface_ddx.cpp b/code/ryzom/client/src/interface_v3/interface_ddx.cpp index 73f4873b4..5447ea2cd 100644 --- a/code/ryzom/client/src/interface_v3/interface_ddx.cpp +++ b/code/ryzom/client/src/interface_v3/interface_ddx.cpp @@ -20,9 +20,9 @@ #include "interface_manager.h" #include "interface_ddx.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "ctrl_button.h" -#include "group_modal.h" +#include "nel/gui/group_modal.h" #include "../client_cfg.h" #include "nel/misc/xml_auto_ptr.h" diff --git a/code/ryzom/client/src/interface_v3/interface_ddx.h b/code/ryzom/client/src/interface_v3/interface_ddx.h index fbf05920e..3957ab459 100644 --- a/code/ryzom/client/src/interface_v3/interface_ddx.h +++ b/code/ryzom/client/src/interface_v3/interface_ddx.h @@ -20,7 +20,7 @@ #define NL_INTERFACE_DDX_H #include "nel/misc/types_nl.h" -#include "interface_element.h" +#include "nel/gui/interface_element.h" #include "interface_pointer.h" // Values for float (scrollbar float) must not exceed 200,00 this is due to storing on diff --git a/code/ryzom/client/src/interface_v3/interface_expr_user_fct_game.cpp b/code/ryzom/client/src/interface_v3/interface_expr_user_fct_game.cpp index e2b782a1d..f08d99672 100644 --- a/code/ryzom/client/src/interface_v3/interface_expr_user_fct_game.cpp +++ b/code/ryzom/client/src/interface_v3/interface_expr_user_fct_game.cpp @@ -20,7 +20,7 @@ // Interface #include "nel/gui/interface_expr.h" #include "interface_manager.h" -#include "interface_element.h" +#include "nel/gui/interface_element.h" #include "chat_window.h" #include "group_container.h" // client diff --git a/code/ryzom/client/src/interface_v3/interface_manager.cpp b/code/ryzom/client/src/interface_v3/interface_manager.cpp index 94b1bc3dd..7feafadbe 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.cpp +++ b/code/ryzom/client/src/interface_v3/interface_manager.cpp @@ -38,7 +38,7 @@ #include "nel/gui/interface_expr.h" #include "register_interface_elements.h" // Action / Observers -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "interface_observer.h" #include "interface_anim.h" #include "interface_ddx.h" @@ -60,7 +60,7 @@ #include "group_list.h" #include "group_menu.h" #include "group_container.h" -#include "group_modal.h" +#include "nel/gui/group_modal.h" #include "group_editbox.h" #include "group_in_scene_bubble.h" #include "group_skills.h" @@ -4815,9 +4815,9 @@ void CInterfaceManager::getLuaValueInfo(std::string &str, sint index) // If its a Userdata, try to display UI info else if(type==LUA_TUSERDATA) { - if(CLuaIHMRyzom::isUIOnStack(ls, index)) + if(CLuaIHM::isUIOnStack(ls, index)) { - CInterfaceElement *ui= CLuaIHMRyzom::getUIOnStack(ls, index); + CInterfaceElement *ui= CLuaIHM::getUIOnStack(ls, index); str+= NLMISC::toString(" (ui=%p)", ui); } } diff --git a/code/ryzom/client/src/interface_v3/interface_manager.h b/code/ryzom/client/src/interface_v3/interface_manager.h index 92e32b6d1..93b72c97e 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.h +++ b/code/ryzom/client/src/interface_v3/interface_manager.h @@ -23,13 +23,13 @@ #include "nel/misc/cdb_manager.h" #include "nel/3d/u_texture.h" #include "nel/3d/u_text_context.h" -#include "interface_group.h" -#include "interface_link.h" +#include "nel/gui/interface_group.h" +#include "nel/gui/interface_link.h" #include "group_list.h" -#include "view_base.h" +#include "nel/gui/view_base.h" #include "view_pointer.h" -#include "ctrl_base.h" +#include "nel/gui/ctrl_base.h" #include "ctrl_scroll.h" #include "nel/gui/view_renderer.h" @@ -37,7 +37,7 @@ // InterfaceV3 #include "interface_parser.h" #include "ctrl_sheet_selection.h" -#include "interface_options.h" +#include "nel/gui/interface_options.h" #include "interface_config.h" #include "interface_pointer.h" #include "flying_text_manager.h" diff --git a/code/ryzom/client/src/interface_v3/interface_options_ryzom.cpp b/code/ryzom/client/src/interface_v3/interface_options_ryzom.cpp index 9e9731c8c..8e29004fa 100644 --- a/code/ryzom/client/src/interface_v3/interface_options_ryzom.cpp +++ b/code/ryzom/client/src/interface_v3/interface_options_ryzom.cpp @@ -19,7 +19,7 @@ #include "stdpch.h" -#include "interface_options.h" +#include "nel/gui/interface_options.h" #include "interface_manager.h" #include "group_menu.h" #include "nel/misc/xml_auto_ptr.h" diff --git a/code/ryzom/client/src/interface_v3/interface_options_ryzom.h b/code/ryzom/client/src/interface_v3/interface_options_ryzom.h index f5bf6bc97..2d830c1fb 100644 --- a/code/ryzom/client/src/interface_v3/interface_options_ryzom.h +++ b/code/ryzom/client/src/interface_v3/interface_options_ryzom.h @@ -18,7 +18,7 @@ #ifndef IF_OPTIONS_RZ #define IP_OPTIONS_RZ -#include "interface_options.h" +#include "nel/gui/interface_options.h" // *************************************************************************** class COptionsLayer : public CInterfaceOptions diff --git a/code/ryzom/client/src/interface_v3/interface_parser.cpp b/code/ryzom/client/src/interface_v3/interface_parser.cpp index 1539a2d29..a8b42df12 100644 --- a/code/ryzom/client/src/interface_v3/interface_parser.cpp +++ b/code/ryzom/client/src/interface_v3/interface_parser.cpp @@ -31,7 +31,7 @@ #include "interface_parser.h" #include "interface_observer.h" -#include "interface_options.h" +#include "nel/gui/interface_options.h" #include "interface_options_ryzom.h" #include "interface_anim.h" #include "interface_3d_scene.h" @@ -61,9 +61,9 @@ // DBCtrl #include "dbctrl_sheet.h" // Group -#include "group_frame.h" +#include "nel/gui/group_frame.h" #include "group_career.h" -#include "group_modal.h" +#include "nel/gui/group_modal.h" #include "group_modal_get_key.h" #include "group_list.h" #include "group_tree.h" @@ -99,7 +99,7 @@ #include "dbgroup_list_sheet_bonus_malus.h" #include "dbgroup_list_sheet_icon_phrase.h" // Misc. -#include "interface_link.h" +#include "nel/gui/interface_link.h" #include "interface_ddx.h" #include "../actions.h" #include "macrocmd_manager.h" diff --git a/code/ryzom/client/src/interface_v3/interface_parser.h b/code/ryzom/client/src/interface_v3/interface_parser.h index 135483d5c..b94ffaa70 100644 --- a/code/ryzom/client/src/interface_v3/interface_parser.h +++ b/code/ryzom/client/src/interface_v3/interface_parser.h @@ -22,11 +22,11 @@ #include "nel/misc/types_nl.h" #include "nel/3d/u_texture.h" #include "ctrl_sheet_selection.h" -#include "interface_link.h" +#include "nel/gui/interface_link.h" #include "nel/misc/smart_ptr.h" #include "game_share/brick_types.h" #include "nel/gui/lua_helper.h" -#include "widget_manager.h" +#include "nel/gui/widget_manager.h" using namespace NLGUI; // *************************************************************************** diff --git a/code/ryzom/client/src/interface_v3/inventory_manager.cpp b/code/ryzom/client/src/interface_v3/inventory_manager.cpp index 2756e6391..15dbc354c 100644 --- a/code/ryzom/client/src/interface_v3/inventory_manager.cpp +++ b/code/ryzom/client/src/interface_v3/inventory_manager.cpp @@ -38,7 +38,7 @@ #include "sphrase_manager.h" // For handlers -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "dbctrl_sheet.h" #include "../sheet_manager.h" diff --git a/code/ryzom/client/src/interface_v3/list_sheet_base.h b/code/ryzom/client/src/interface_v3/list_sheet_base.h index bc4207ca5..1ef13e4ca 100644 --- a/code/ryzom/client/src/interface_v3/list_sheet_base.h +++ b/code/ryzom/client/src/interface_v3/list_sheet_base.h @@ -20,7 +20,7 @@ #define NL_LIST_SHEET_BASE_H #include "nel/misc/types_nl.h" -#include "interface_group.h" +#include "nel/gui/interface_group.h" class CDBCtrlSheet; diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp index eecd9afe8..505bc1fd2 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -45,14 +45,14 @@ #include "nel/gui/lua_ihm.h" #include "nel/gui/reflect.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "action_handler_tools.h" #include "interface_manager.h" -#include "interface_group.h" +#include "nel/gui/interface_group.h" #include "view_text.h" #include "game_share/people_pd.h" #include "group_tree.h" -#include "interface_link.h" +#include "nel/gui/interface_link.h" #include "nel/gui/interface_expr.h" #include "people_interraction.h" #include "nel/misc/algo.h" @@ -310,403 +310,9 @@ int CLuaIHMRyzom::luaClientCfgNewIndex(CLuaState &ls) throw ELuaWrappedFunctionException(&ls, "Can't write into config file from lua."); } -// *************************************************************************** -CInterfaceElement *CLuaIHMRyzom::getUIRelative(CInterfaceElement *pIE, const std::string &propName) -{ - //H_AUTO(Lua_CLuaIHM_getUIRelative) - if (pIE == NULL) return NULL; - // If the prop is "parent", then return the parent of the ui - if(propName=="parent") - { - return pIE->getParent(); - } - // else try to get a child (if group/exist) - else - { - CInterfaceGroup *group= dynamic_cast(pIE); - if(group) - { - return group->getElement(group->getId()+":"+propName); - } - } - - return NULL; -} - static CLuaString lstr_Env("Env"); static CLuaString lstr_isNil("isNil"); -// *************************************************************************** -int CLuaIHMRyzom::luaUIIndex(CLuaState &ls) -{ - //H_AUTO(Lua_CLuaIHM_luaUIIndex) - nlassert(ls.getTop()==2); - // get the userdata and key - CReflectableLuaRef *pRefElm = (CReflectableLuaRef *) ls.toUserData(1); - - const char *propName = ls.toString(2); - CReflectableRefPtrTarget *pRPT= (CReflectableRefPtrTarget*)(pRefElm->Ptr); - // ** try to get the Env Table (interface group only) - if(propName==lstr_isNil) - { - ls.push(pRPT==NULL); - return 1; - } - - // Check the object is not NULL or freed - if(pRPT==NULL) - { - return 0; - } - - // ** try to get the Env Table (interface group only) - if(propName==lstr_Env) - { - // Env can be bound to a CInterfaceGroup only - CInterfaceGroup *group= dynamic_cast(pRPT); - if(group==NULL) - { - ls.pushNil(); - return 1; - } - else - { - group->pushLUAEnvTable(); - return 1; - } - } - - // ** try to get the property - const CReflectedProperty *prop = pRefElm->getProp(propName); - if (prop) - { - CLuaIHM::luaValueFromReflectedProperty(ls, *pRPT, *prop); - return 1; - } - - // ** try to get a UI relative - CInterfaceElement *uiRelative= getUIRelative(dynamic_cast(pRPT), propName); - if(uiRelative) - { - // push the UI onto the stack - pushUIOnStack(ls, uiRelative); - return 1; - } - - - // Fail to find any Attributes or elements - // Yoyo: don't write any message or warning because this may be a feature (if user want to test that something exit in the ui) - ls.pushNil(); - return 1; -} - -// *************************************************************************** -int CLuaIHMRyzom::luaUINewIndex(CLuaState &ls) -{ - //H_AUTO(Lua_CLuaIHM_luaUINewIndex) - nlassert(ls.getTop()==3); - // get the userdata and key - CReflectableLuaRef *pRefElm = (CReflectableLuaRef *) ls.toUserData(1); - nlassert(pRefElm); - CReflectableRefPtrTarget *pRPT= (CReflectableRefPtrTarget*)(pRefElm->Ptr); - // Check the UI is not NULL or freed - if(pRPT == NULL) - { - return 0; - } - - const char *propName = ls.toString(2); - // ** try to set the Env Table (interface group only) - if(propName == lstr_Env) - { - CInterfaceElement *pIE = dynamic_cast(pRPT); - std::string name ; - if (pIE) - { - name = pIE->getId(); - } - else - { - name = ""; - } - // Exception!!! not allowed - throw ELuaIHMException("You cannot change the Env Table of '%s'", name.c_str()); - } - - - // ** try to set the property - const CReflectedProperty *prop = pRefElm->getProp(propName); - if (prop) - { - CLuaIHM::luaValueToReflectedProperty(ls, 3, *pRPT, *prop); - return 0; - } - - CInterfaceElement *pIE = dynamic_cast(pRPT); - // ** try to get another UI (child or parent) - CInterfaceElement *uiRelative= getUIRelative(pIE, propName); - if(uiRelative) - { - // Exception!!! not allowed - throw ELuaIHMException("You cannot write into the UI '%s' of '%s'", propName, pIE->getId().c_str()); - } - - // ** Prop Not Found - throw ELuaIHMException("Property '%s' not found in '%s' of type %s", propName, pIE ? pIE->getId().c_str() : "", typeid(*pRPT).name()); - - // Fail to find any Attributes or elements - return 0; -} - -// *************************************************************************** -int CLuaIHMRyzom::luaUIEq(CLuaState &ls) -{ - //H_AUTO(Lua_CLuaIHM_luaUIEq) - nlassert(ls.getTop() == 2); - // read lhs & rhs - // get the userdata and key - CReflectableLuaRef *lhs = (CReflectableLuaRef *) ls.toUserData(1); - CReflectableLuaRef *rhs = (CReflectableLuaRef *) ls.toUserData(2); - nlassert(lhs); - nlassert(rhs); - ls.push(lhs->Ptr == rhs->Ptr); - return 1; -} - - -// *************************************************************************** -int CLuaIHMRyzom::luaUIDtor(CLuaState &ls) -{ - //H_AUTO(Lua_CLuaIHM_luaUIDtor) - nlassert(ls.getTop()==1); - // get the userdata - CReflectableLuaRef *pRefElm = (CReflectableLuaRef *) ls.toUserData(1); - nlassert(pRefElm); - - // call dtor - pRefElm->~CReflectableLuaRef(); - - return 0; -} - -// *************************************************************************** -int CLuaIHMRyzom::luaUINext(CLuaState &ls) -{ - //H_AUTO(Lua_CLuaIHM_luaUINext) - // Code below allow enumeration of properties of a reflectable object - // From lua standpoint, the object is seen as a table with (key, value) pairs - // If object is a CInterfaceGroup, iteration is also done on sons (groups, controls & view). - - if (ls.getTop() != 2) - { - CLuaIHM::fails(ls, "__next metamethod require 2 arguments (table & key)"); - } - CLuaIHM::check(ls, CLuaIHM::isReflectableOnStack(ls, 1), "__next : require ui element as first arg"); - CReflectableRefPtrTarget *reflectedObject = CLuaIHM::getReflectableOnStack(ls, 1); - // To traverse all properties / field of the object, we must be able to determine the next key from a previous key - // (keys are ordered) - // We use the 'TValueType' enum to know which kind of property we are traversing, and an index in this group of properties - // The key which uniquely identify an element / property in the reflectable object - struct CKey - { - enum TValueType - { - VTGroup = 0, // children groups (If the object is a CInterfaceGroup) - VTView, // children views (If the object is a CInterfaceView) - VTCtrl, // children controls (If the object is a CInterfaceCtrl) - VTProp // List of exported proeprties (For all relfectable objects) - }; - TValueType ValueType; - sint Index; - const CClassInfo *ClassInfo; // if ValueType is "VTProp" -> give the class for which property are currently enumerated - // - static int tostring(CLuaState &ls) // '__print' metamathod - { - CLuaIHM::checkArgCount(ls, "reflected object metatable:__print", 1); - CKey key; - key.pop(ls); - switch(key.ValueType) - { - case VTGroup: ls.push(toString("_Group %d", key.Index)); break; - case VTView: ls.push(toString("_View %d", key.Index)); break; - case VTCtrl: ls.push(toString("_Ctrl %d", key.Index)); break; - case VTProp: ls.push(key.ClassInfo->Properties[key.Index].Name); break; - } - return 1; - } - // push the key on the lua stack - void push(CLuaState &ls) - { - void *ud = ls.newUserData(sizeof(*this)); - *(CKey *) ud = *this; - getMetaTable(ls).push(); - ls.setMetaTable(-2); - } - // pop the key from the lua stack - void pop(CLuaState &ls) - { - CLuaStackChecker lsc(&ls, -1); - if (!ls.isUserData(-1)) - { - CLuaIHM::fails(ls, "Can't pop object, not a user data"); - } - // check that metatable is good (it is share between all keys) - ls.getMetaTable(-1); - getMetaTable(ls).push(); - if (!ls.rawEqual(-1, -2)) - { - CLuaIHM::fails(ls, "Bad metatable for reflectable object key"); - } - ls.pop(2); - // retrieve key - *this = *(CKey *) ls.toUserData(-1); - ls.pop(); - } - // get the metatable for a CKey - CLuaObject &getMetaTable(CLuaState &ls) - { - static CLuaObject metatable; - if (!metatable.isValid()) - { - // first build - CLuaStackChecker lsc(&ls); - ls.newTable(); - ls.push("__tostring"); - ls.push(CKey::tostring); - ls.setTable(-3); - metatable.pop(ls); - } - return metatable; - } - }; - // Pop the current key to continue enumeration - CKey key; - if (ls.isNil(2)) - { - // no key -> start of table - key.ValueType = CKey::VTGroup; - key.Index = -1; - } - else - { - key.pop(ls); - } - // - CInterfaceGroup *group = dynamic_cast(reflectedObject); - bool enumerate = true; - while (enumerate) - { - switch(key.ValueType) - { - case CKey::VTGroup: - if (!group || (key.Index + 1) == (sint) group->getGroups().size()) - { - key.Index = -1; - key.ValueType = CKey::VTView; // continue enumeration with views - } - else - { - ++ key.Index; - key.push(ls); - pushUIOnStack(ls, group->getGroups()[key.Index]); - return 2; - } - break; - case CKey::VTView: - if (!group || (key.Index + 1) == (sint) group->getViews().size()) - { - key.Index = -1; - key.ValueType = CKey::VTCtrl; // continue enumeration with controls - } - else - { - ++ key.Index; - key.push(ls); - pushUIOnStack(ls, group->getViews()[key.Index]); - return 2; - } - break; - case CKey::VTCtrl: - if (!group || (key.Index + 1) == (sint) group->getControls().size()) - { - key.Index = -1; - key.ValueType = CKey::VTProp; // continue enumeration with properties - key.ClassInfo = reflectedObject->getClassInfo(); - } - else - { - ++ key.Index; - key.push(ls); - pushUIOnStack(ls, group->getControls()[key.Index]); - return 2; - } - break; - case CKey::VTProp: - if (!key.ClassInfo) - { - enumerate = false; - break; - } - if ((sint) key.ClassInfo->Properties.size() == (key.Index + 1)) - { - key.ClassInfo = key.ClassInfo->ParentClass; // continue enumeration in parent class - key.Index = -1; - } - else - { - ++ key.Index; - key.push(ls); - CLuaIHM::luaValueFromReflectedProperty(ls, *reflectedObject, key.ClassInfo->Properties[key.Index]); - return 2; - } - break; - default: - nlassert(0); - break; - } - } - ls.pushNil(); - return 0; -} - -// *************************************************************************** -void CLuaIHMRyzom::pushUIOnStack(CLuaState &ls, class CInterfaceElement *pIE) -{ - //H_AUTO(Lua_CLuaIHM_pushUIOnStack) - CLuaIHM::pushReflectableOnStack(ls, pIE); -} - -// *************************************************************************** -bool CLuaIHMRyzom::isUIOnStack(CLuaState &ls, sint index) -{ - //H_AUTO(Lua_CLuaIHM_isUIOnStack) - return getUIOnStack(ls, index) != NULL; -} - -// *************************************************************************** -CInterfaceElement *CLuaIHMRyzom::getUIOnStack(CLuaState &ls, sint index) -{ - //H_AUTO(Lua_CLuaIHM_getUIOnStack) - return dynamic_cast(CLuaIHM::getReflectableOnStack(ls, index)); -} - -// *************************************************************************** -void CLuaIHMRyzom::checkArgTypeUIElement(CLuaState &ls, const char *funcName, uint index) -{ - //H_AUTO(Lua_CLuaIHM_checkArgTypeUIElement) - nlassert(index > 0); - if (ls.getTop() < (int) index) - { - CLuaIHM::fails(ls, "%s : argument %d of expected type ui element was not defined", funcName, index); - } - if (!isUIOnStack(ls, index)) - { - CLuaIHM::fails(ls, "%s : argument %d of expected type ui element has bad type : %s", funcName, index, ls.getTypename(ls.type(index)), ls.type(index)); - } -} - - - // *************************************************************************** void CLuaIHMRyzom::createLuaEnumTable(CLuaState &ls, const std::string &str) { @@ -755,38 +361,6 @@ void CLuaIHMRyzom::RegisterRyzomFunctions( NLGUI::CLuaState &ls ) mt.setValue("__newindex", luaClientCfgNewIndex); globals.setNil("__cfmt"); // remove temp metatable - // *** Register the MetaTable for UI userdata - ls.push(IHM_LUA_METATABLE); // "__ui_metatable" - ls.newTable(); // "__ui_metatable" {} - // set the '__index' method - ls.push("__index"); - ls.push(luaUIIndex); - nlassert(ls.isCFunction()); - ls.setTable(-3); // "__ui_metatable" {"__index"= CFunc_luaUIIndex} - // set the '__newindex' method - ls.push("__newindex"); - ls.push(luaUINewIndex); - nlassert(ls.isCFunction()); - ls.setTable(-3); - // set the '__newindex' method - ls.push("__gc"); - ls.push(luaUIDtor); - nlassert(ls.isCFunction()); - ls.setTable(-3); - // set the '__eq' method - ls.push("__eq"); - ls.push(luaUIEq); - nlassert(ls.isCFunction()); - ls.setTable(-3); - // set the custom '__next' method - ls.push("__next"); - ls.push(luaUINext); - nlassert(ls.isCFunction()); - ls.setTable(-3); - // set registry - ls.setTable(LUA_REGISTRYINDEX); - - ls.registerFunc( "getUI", getUI ); ls.registerFunc("setOnDraw", setOnDraw); ls.registerFunc("setCaptureKeyboard", setCaptureKeyboard); @@ -1032,7 +606,7 @@ int CLuaIHMRyzom::getUI(CLuaState &ls) } else { - pushUIOnStack(ls, pIE); + CLuaIHM::pushUIOnStack(ls, pIE); } return 1; } @@ -1043,8 +617,8 @@ int CLuaIHMRyzom::setCaptureKeyboard(CLuaState &ls) //H_AUTO(Lua_CLuaIHM_setCaptureKeyboard) const char *funcName = "setCaptureKeyboard"; CLuaIHM::checkArgCount(ls, funcName, 1); - checkArgTypeUIElement(ls, funcName, 1); - CCtrlBase *ctrl = dynamic_cast( getUIOnStack(ls, 1)); + CLuaIHM::checkArgTypeUIElement(ls, funcName, 1); + CCtrlBase *ctrl = dynamic_cast( CLuaIHM::getUIOnStack(ls, 1)); if (!ctrl) { CLuaIHM::fails(ls, "%s waits a ui control as arg 1", funcName); @@ -1074,11 +648,11 @@ int CLuaIHMRyzom::setOnDraw(CLuaState &ls) // params: CInterfaceGroup*, "script". // return: none CLuaIHM::checkArgCount(ls, "setOnDraw", 2); - CLuaIHM::check(ls, isUIOnStack(ls, 1), "setOnDraw() requires a UI object in param 1"); + CLuaIHM::check(ls, CLuaIHM::isUIOnStack(ls, 1), "setOnDraw() requires a UI object in param 1"); CLuaIHM::check(ls, ls.isString(2), "setOnDraw() requires a string in param 2"); // retrieve args - CInterfaceElement *pIE= getUIOnStack(ls, 1); + CInterfaceElement *pIE= CLuaIHM::getUIOnStack(ls, 1); std::string script; ls.toString(2, script); @@ -1101,12 +675,12 @@ int CLuaIHMRyzom::addOnDbChange(CLuaState &ls) // params: CInterfaceGroup*, "dblist", "script". // return: none CLuaIHM::checkArgCount(ls, "addOnDbChange", 3); - CLuaIHM::check(ls, isUIOnStack(ls, 1), "addOnDbChange() requires a UI object in param 1"); + CLuaIHM::check(ls, CLuaIHM::isUIOnStack(ls, 1), "addOnDbChange() requires a UI object in param 1"); CLuaIHM::check(ls, ls.isString(2), "addOnDbChange() requires a string in param 2"); CLuaIHM::check(ls, ls.isString(3), "addOnDbChange() requires a string in param 3"); // retrieve args - CInterfaceElement *pIE= getUIOnStack(ls, 1); + CInterfaceElement *pIE= CLuaIHM::getUIOnStack(ls, 1); std::string dbList, script; ls.toString(2, dbList); ls.toString(3, script); @@ -1131,11 +705,11 @@ int CLuaIHMRyzom::removeOnDbChange(CLuaState &ls) // params: CInterfaceGroup*, "dbList" // return: none CLuaIHM::checkArgCount(ls, "removeOnDbChange", 2); - CLuaIHM::check(ls, isUIOnStack(ls, 1), "removeOnDbChange() requires a UI object in param 1"); + CLuaIHM::check(ls, CLuaIHM::isUIOnStack(ls, 1), "removeOnDbChange() requires a UI object in param 1"); CLuaIHM::check(ls, ls.isString(2), "removeOnDbChange() requires a string in param 2"); // retrieve args - CInterfaceElement *pIE= getUIOnStack(ls, 1); + CInterfaceElement *pIE= CLuaIHM::getUIOnStack(ls, 1); std::string dbList; ls.toString(2, dbList); @@ -1159,12 +733,12 @@ int CLuaIHMRyzom::runAH(CLuaState &ls) // params: CInterfaceElement *, "ah", "params". // return: none CLuaIHM::checkArgCount(ls, "runAH", 3); - CLuaIHM::check(ls, isUIOnStack(ls, 1) || ls.isNil(1), "runAH() requires a UI object in param 1 (or Nil)"); + CLuaIHM::check(ls, CLuaIHM::isUIOnStack(ls, 1) || ls.isNil(1), "runAH() requires a UI object in param 1 (or Nil)"); CLuaIHM::check(ls, ls.isString(2), "runAH() requires a string in param 2"); CLuaIHM::check(ls, ls.isString(3), "runAH() requires a string in param 3"); // retrieve args - CInterfaceElement *pIE= getUIOnStack(ls, 1); + CInterfaceElement *pIE= CLuaIHM::getUIOnStack(ls, 1); std::string ah, params; ls.toString(2, ah); ls.toString(3, params); @@ -1374,10 +948,10 @@ int CLuaIHMRyzom::deleteUI(CLuaState &ls) // params: CInterfaceElement * // return: none CLuaIHM::checkArgCount(ls, "deleteUI", 1); - CLuaIHM::check(ls, isUIOnStack(ls, 1), "deleteUI() requires a UI object in param 1"); + CLuaIHM::check(ls, CLuaIHM::isUIOnStack(ls, 1), "deleteUI() requires a UI object in param 1"); // retrieve args - CInterfaceElement *pIE= getUIOnStack(ls, 1); + CInterfaceElement *pIE= CLuaIHM::getUIOnStack(ls, 1); if(!pIE) return 0; @@ -1442,10 +1016,10 @@ int CLuaIHMRyzom::dumpUI(CLuaState &ls) // params: CInterfaceElement * // return: none CLuaIHM::checkArgCount(ls, "dumpUI", 1); - CLuaIHM::check(ls, isUIOnStack(ls, 1), "dumpUI() requires a UI object in param 1"); + CLuaIHM::check(ls, CLuaIHM::isUIOnStack(ls, 1), "dumpUI() requires a UI object in param 1"); // retrieve args - CInterfaceElement *pIE= getUIOnStack(ls, 1); + CInterfaceElement *pIE= CLuaIHM::getUIOnStack(ls, 1); if(!pIE) debugInfo("UI: NULL"); else @@ -1498,7 +1072,7 @@ int CLuaIHMRyzom::setTopWindow(CLuaState &ls) //H_AUTO(Lua_CLuaIHM_setTopWindow) const char *funcName = "setTopWindow"; CLuaIHM::checkArgCount(ls, funcName, 1); - CInterfaceGroup *wnd = dynamic_cast( getUIOnStack(ls, 1)); + CInterfaceGroup *wnd = dynamic_cast( CLuaIHM::getUIOnStack(ls, 1)); if (!wnd) { CLuaIHM::fails(ls, "%s : interface group expected as arg 1", funcName); @@ -1624,8 +1198,8 @@ int CLuaIHMRyzom::setTextFormatTaged(CLuaState &ls) CLuaIHM::checkArgCount(ls, "setTextFormatTaged", 2); // *** check and retrieve param 1 - CLuaIHM::check(ls, isUIOnStack(ls, 1), "setTextFormatTaged() requires a UI object in param 1"); - CInterfaceElement *pIE= getUIOnStack(ls, 1); + CLuaIHM::check(ls, CLuaIHM::isUIOnStack(ls, 1), "setTextFormatTaged() requires a UI object in param 1"); + CInterfaceElement *pIE= CLuaIHM::getUIOnStack(ls, 1); // *** check and retrieve param 2. must be a string or a ucstring ucstring text; @@ -1986,10 +1560,10 @@ int CLuaIHMRyzom::enableModalWindow(CLuaState &ls) const char *funcName = "enableModalWindow"; CLuaIHM::checkArgCount(ls, funcName, 2); - CLuaIHM::check(ls, isUIOnStack(ls, 1), "enableModalWindow() requires a UI object in param 1"); + CLuaIHM::check(ls, CLuaIHM::isUIOnStack(ls, 1), "enableModalWindow() requires a UI object in param 1"); CLuaIHM::checkArgType(ls, funcName, 2, LUA_TSTRING); - CInterfaceElement *pIE= getUIOnStack(ls, 1); + CInterfaceElement *pIE= CLuaIHM::getUIOnStack(ls, 1); std::string modalId = ls.toString(2); // convert to id @@ -2206,10 +1780,10 @@ int CLuaIHMRyzom::disableContextHelpForControl(CLuaState &ls) // params: CCtrlBase* // return: none CLuaIHM::checkArgCount(ls, "disableContextHelpForControl", 1); - CLuaIHM::check(ls, isUIOnStack(ls, 1), "disableContextHelpForControl() requires a UI object in param 1"); + CLuaIHM::check(ls, CLuaIHM::isUIOnStack(ls, 1), "disableContextHelpForControl() requires a UI object in param 1"); // retrieve args - CInterfaceElement *pIE= getUIOnStack(ls, 1); + CInterfaceElement *pIE= CLuaIHM::getUIOnStack(ls, 1); // go CInterfaceManager *pIM= CInterfaceManager::getInstance(); @@ -2409,7 +1983,7 @@ int CLuaIHMRyzom::getUICaller(CLuaState &ls) } else { - pushUIOnStack(ls, pIE); + CLuaIHM::pushUIOnStack(ls, pIE); } return 1; } @@ -2427,7 +2001,7 @@ int CLuaIHMRyzom::getCurrentWindowUnder(CLuaState &ls) } else { - pushUIOnStack(ls, pIE); + CLuaIHM::pushUIOnStack(ls, pIE); } return 1; } @@ -2441,10 +2015,10 @@ int CLuaIHMRyzom::getUIId(CLuaState &ls) // params: CInterfaceElement* // return: "ui:interface:...". (empty if error) CLuaIHM::checkArgCount(ls, "getUIId", 1); - CLuaIHM::check(ls, isUIOnStack(ls, 1), "getUIId() requires a UI object in param 1"); + CLuaIHM::check(ls, CLuaIHM::isUIOnStack(ls, 1), "getUIId() requires a UI object in param 1"); // retrieve args - CInterfaceElement *pIE= getUIOnStack(ls, 1); + CInterfaceElement *pIE= CLuaIHM::getUIOnStack(ls, 1); // convert to id if(pIE) @@ -2464,10 +2038,10 @@ int CLuaIHMRyzom::getIndexInDB(CLuaState &ls) // params: CDBCtrlSheet* // return: index in DB of a dbctrlsheet (empty if error) CLuaIHM::checkArgCount(ls, "getIndexInDB", 1); - CLuaIHM::check(ls, isUIOnStack(ls, 1), "getIndexInDB() requires a UI object in param 1"); + CLuaIHM::check(ls, CLuaIHM::isUIOnStack(ls, 1), "getIndexInDB() requires a UI object in param 1"); // retrieve args - CInterfaceElement *pIE= getUIOnStack(ls, 1); + CInterfaceElement *pIE= CLuaIHM::getUIOnStack(ls, 1); CDBCtrlSheet *pCS= dynamic_cast(pIE); // get the index in db @@ -2513,7 +2087,7 @@ int CLuaIHMRyzom::createGroupInstance(CLuaState &ls) } else { - pushUIOnStack(ls, result); + CLuaIHM::pushUIOnStack(ls, result); } return 1; } @@ -2560,7 +2134,7 @@ int CLuaIHMRyzom::createRootGroupInstance(CLuaState &ls) if (pRoot) pRoot->addGroup(result); result->setActive(true); - pushUIOnStack(ls, result); + CLuaIHM::pushUIOnStack(ls, result); } return 1; } @@ -2599,7 +2173,7 @@ int CLuaIHMRyzom::createUIElement(CLuaState &ls) } else { - pushUIOnStack(ls, result); + CLuaIHM::pushUIOnStack(ls, result); } return 1; } diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h index 71fe3f398..3d7c32860 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h @@ -16,20 +16,8 @@ private: static int luaClientCfgIndex(CLuaState &ls); static int luaClientCfgNewIndex(CLuaState &ls); - // Functions for the ui metatable - static class CInterfaceElement *getUIRelative(class CInterfaceElement *pIE, const std::string &propName); - static int luaUIIndex(CLuaState &ls); - static int luaUINewIndex(CLuaState &ls); - static int luaUIEq(CLuaState &ls); - static int luaUINext(CLuaState &ls); - static int luaUIDtor(CLuaState &ls); - // CInterfaceElement management on stack, stored by a CRefPtr. public: - static void pushUIOnStack(CLuaState &ls, class CInterfaceElement *pIE); - static bool isUIOnStack(CLuaState &ls, sint index); - static CInterfaceElement *getUIOnStack(CLuaState &ls, sint index); - static void checkArgTypeUIElement(CLuaState &ls, const char *funcName, uint index); private: diff --git a/code/ryzom/client/src/interface_v3/macrocmd_key.cpp b/code/ryzom/client/src/interface_v3/macrocmd_key.cpp index d7b2bdb4b..1b91b3dd4 100644 --- a/code/ryzom/client/src/interface_v3/macrocmd_key.cpp +++ b/code/ryzom/client/src/interface_v3/macrocmd_key.cpp @@ -23,7 +23,7 @@ #include "macrocmd_manager.h" #include "interface_manager.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "ctrl_button.h" #include "group_editbox.h" #include "group_list.h" diff --git a/code/ryzom/client/src/interface_v3/macrocmd_manager.cpp b/code/ryzom/client/src/interface_v3/macrocmd_manager.cpp index b1b0d9e12..679fa5900 100644 --- a/code/ryzom/client/src/interface_v3/macrocmd_manager.cpp +++ b/code/ryzom/client/src/interface_v3/macrocmd_manager.cpp @@ -23,7 +23,7 @@ #include "macrocmd_key.h" #include "interface_manager.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "dbctrl_sheet.h" #include "ctrl_button.h" #include "group_editbox.h" diff --git a/code/ryzom/client/src/interface_v3/music_player.cpp b/code/ryzom/client/src/interface_v3/music_player.cpp index 1aeabb9cb..10309a211 100644 --- a/code/ryzom/client/src/interface_v3/music_player.cpp +++ b/code/ryzom/client/src/interface_v3/music_player.cpp @@ -19,7 +19,7 @@ #include "stdpch.h" #include "music_player.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "../input.h" #include "../sound_manager.h" #include "interface_manager.h" diff --git a/code/ryzom/client/src/interface_v3/people_interraction.cpp b/code/ryzom/client/src/interface_v3/people_interraction.cpp index 668c5f977..ead0fe307 100644 --- a/code/ryzom/client/src/interface_v3/people_interraction.cpp +++ b/code/ryzom/client/src/interface_v3/people_interraction.cpp @@ -22,7 +22,7 @@ #include "people_interraction.h" #include "nel/gui/interface_expr.h" #include "interface_manager.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "action_handler_misc.h" #include "chat_window.h" #include "../entity_animation_manager.h" diff --git a/code/ryzom/client/src/interface_v3/people_list.cpp b/code/ryzom/client/src/interface_v3/people_list.cpp index 5c4821e72..a5ddacdbf 100644 --- a/code/ryzom/client/src/interface_v3/people_list.cpp +++ b/code/ryzom/client/src/interface_v3/people_list.cpp @@ -22,7 +22,7 @@ #include "group_list.h" #include "view_bitmap.h" #include "interface_manager.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "group_editbox.h" #include "../client_chat_manager.h" #include "chat_text_manager.h" diff --git a/code/ryzom/client/src/interface_v3/player_trade.cpp b/code/ryzom/client/src/interface_v3/player_trade.cpp index 1e4c4a172..799b3ec43 100644 --- a/code/ryzom/client/src/interface_v3/player_trade.cpp +++ b/code/ryzom/client/src/interface_v3/player_trade.cpp @@ -22,7 +22,7 @@ #include "interface_manager.h" #include "dbctrl_sheet.h" #include "dbgroup_list_sheet.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "inventory_manager.h" // #include "game_share/inventories.h" diff --git a/code/ryzom/client/src/interface_v3/register_interface_elements.cpp b/code/ryzom/client/src/interface_v3/register_interface_elements.cpp index 227540244..196497e65 100644 --- a/code/ryzom/client/src/interface_v3/register_interface_elements.cpp +++ b/code/ryzom/client/src/interface_v3/register_interface_elements.cpp @@ -17,35 +17,35 @@ #include "stdpch.h" -#include "interface_element.h" +#include "nel/gui/interface_element.h" #include "interface_3d_scene.h" -#include "view_base.h" +#include "nel/gui/view_base.h" #include "view_text.h" #include "view_text_id.h" #include "view_bitmap.h" #include "view_radar.h" #include "group_menu.h" -#include "ctrl_base.h" -#include "interface_group.h" -#include "group_frame.h" -#include "group_container_base.h" +#include "nel/gui/ctrl_base.h" +#include "nel/gui/interface_group.h" +#include "nel/gui/group_frame.h" +#include "nel/gui/group_container_base.h" #include "group_container.h" #include "group_list.h" #include "dbgroup_select_number.h" #include "ctrl_button.h" #include "ctrl_text_button.h" #include "ctrl_col_pick.h" -#include "ctrl_draggable.h" +#include "nel/gui/ctrl_draggable.h" #include "dbctrl_sheet.h" #include "dbgroup_list_sheet.h" -#include "group_editbox_base.h" +#include "nel/gui/group_editbox_base.h" #include "group_editbox.h" #include "group_tree.h" #include "nel/gui/reflect.h" #include "dbview_bar.h" #include "dbview_bar3.h" #include "group_list.h" -#include "ctrl_scroll_base.h" +#include "nel/gui/ctrl_scroll_base.h" #include "ctrl_scroll.h" #include "dbgroup_combo_box.h" #include "group_tab.h" diff --git a/code/ryzom/client/src/interface_v3/skill_manager.cpp b/code/ryzom/client/src/interface_v3/skill_manager.cpp index 832b23f2b..d31a4d034 100644 --- a/code/ryzom/client/src/interface_v3/skill_manager.cpp +++ b/code/ryzom/client/src/interface_v3/skill_manager.cpp @@ -25,7 +25,7 @@ #include "game_share/fame.h" #include "../sheet_manager.h" #include "nel/misc/cdb_leaf.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "sbrick_manager.h" #include "dbgroup_combo_box.h" #include "view_bitmap.h" diff --git a/code/ryzom/client/src/interface_v3/sphrase_manager.h b/code/ryzom/client/src/interface_v3/sphrase_manager.h index f14dfcf0d..8673f650c 100644 --- a/code/ryzom/client/src/interface_v3/sphrase_manager.h +++ b/code/ryzom/client/src/interface_v3/sphrase_manager.h @@ -26,7 +26,7 @@ #include "brick_learned_callback.h" #include "skill_change_callback.h" #include "trade_common.h" -#include "interface_element.h" +#include "nel/gui/interface_element.h" #include "../time_client.h" diff --git a/code/ryzom/client/src/interface_v3/task_bar_manager.cpp b/code/ryzom/client/src/interface_v3/task_bar_manager.cpp index aa76e0fa8..5b780aa9f 100644 --- a/code/ryzom/client/src/interface_v3/task_bar_manager.cpp +++ b/code/ryzom/client/src/interface_v3/task_bar_manager.cpp @@ -24,7 +24,7 @@ #include "macrocmd_manager.h" #include "dbgroup_list_sheet.h" -#include "action_handler.h" +#include "nel/gui/action_handler.h" #include "group_container.h" #include "../actions_client.h" #include "ctrl_button.h" diff --git a/code/ryzom/client/src/interface_v3/view_bitmap.h b/code/ryzom/client/src/interface_v3/view_bitmap.h index ce3be1d6a..3d63cbfe8 100644 --- a/code/ryzom/client/src/interface_v3/view_bitmap.h +++ b/code/ryzom/client/src/interface_v3/view_bitmap.h @@ -19,7 +19,7 @@ #ifndef NL_VIEW_BITMAP_H #define NL_VIEW_BITMAP_H -#include "view_base.h" +#include "nel/gui/view_base.h" #include "nel/3d/u_texture.h" #include "nel/gui/view_renderer.h" diff --git a/code/ryzom/client/src/interface_v3/view_bitmap_combo.h b/code/ryzom/client/src/interface_v3/view_bitmap_combo.h index 767499c95..1d4c34a0b 100644 --- a/code/ryzom/client/src/interface_v3/view_bitmap_combo.h +++ b/code/ryzom/client/src/interface_v3/view_bitmap_combo.h @@ -21,7 +21,7 @@ #define NL_VIEW_BITMAP_COMBO_H #include "nel/misc/cdb.h" -#include "view_base.h" +#include "nel/gui/view_base.h" #include "nel/3d/u_texture.h" #include #include diff --git a/code/ryzom/client/src/interface_v3/view_pointer.h b/code/ryzom/client/src/interface_v3/view_pointer.h index 8002f5e9d..ebaa84225 100644 --- a/code/ryzom/client/src/interface_v3/view_pointer.h +++ b/code/ryzom/client/src/interface_v3/view_pointer.h @@ -21,7 +21,7 @@ #include "nel/misc/types_nl.h" #include "nel/misc/events.h" -#include "view_pointer_base.h" +#include "nel/gui/view_pointer_base.h" class CGroupContainer; class CCtrlBase; diff --git a/code/ryzom/client/src/interface_v3/view_polygon.h b/code/ryzom/client/src/interface_v3/view_polygon.h index 581f96f4e..1c9c97463 100644 --- a/code/ryzom/client/src/interface_v3/view_polygon.h +++ b/code/ryzom/client/src/interface_v3/view_polygon.h @@ -18,7 +18,7 @@ #ifndef RZ_VIEW_POLYGON_H #define RZ_VIEW_POLYGON_H -#include "view_base.h" +#include "nel/gui/view_base.h" #include "nel/gui/view_renderer.h" // #include "nel/misc/geom_ext.h" diff --git a/code/ryzom/client/src/interface_v3/view_quad.cpp b/code/ryzom/client/src/interface_v3/view_quad.cpp index ca983cb92..424868331 100644 --- a/code/ryzom/client/src/interface_v3/view_quad.cpp +++ b/code/ryzom/client/src/interface_v3/view_quad.cpp @@ -16,7 +16,7 @@ #include "stdpch.h" #include "view_quad.h" -#include "interface_group.h" +#include "nel/gui/interface_group.h" #include "interface_manager.h" using namespace NLMISC; diff --git a/code/ryzom/client/src/interface_v3/view_quad.h b/code/ryzom/client/src/interface_v3/view_quad.h index 3d6b82923..e16becb69 100644 --- a/code/ryzom/client/src/interface_v3/view_quad.h +++ b/code/ryzom/client/src/interface_v3/view_quad.h @@ -18,7 +18,7 @@ #ifndef RZ_VIEW_QUAD_H #define RZ_VIEW_QUAD_H -#include "view_base.h" +#include "nel/gui/view_base.h" #include "nel/gui/view_renderer.h" #include "nel/misc/geom_ext.h" diff --git a/code/ryzom/client/src/interface_v3/view_radar.h b/code/ryzom/client/src/interface_v3/view_radar.h index accad18d2..74d99c065 100644 --- a/code/ryzom/client/src/interface_v3/view_radar.h +++ b/code/ryzom/client/src/interface_v3/view_radar.h @@ -19,7 +19,7 @@ #ifndef RY_VIEW_RADAR_H #define RY_VIEW_RADAR_H -#include "view_base.h" +#include "nel/gui/view_base.h" #include "nel/3d/u_texture.h" #include "nel/gui/view_renderer.h" diff --git a/code/ryzom/client/src/interface_v3/view_text.h b/code/ryzom/client/src/interface_v3/view_text.h index 0f75ea3ba..3620bbe77 100644 --- a/code/ryzom/client/src/interface_v3/view_text.h +++ b/code/ryzom/client/src/interface_v3/view_text.h @@ -19,7 +19,7 @@ #ifndef NL_VIEW_TEXT_H #define NL_VIEW_TEXT_H -#include "view_base.h" +#include "nel/gui/view_base.h" #include "../misc.h" #include "nel/3d/u_text_context.h" diff --git a/code/ryzom/client/src/main_loop.cpp b/code/ryzom/client/src/main_loop.cpp index d3cee7381..ab53744c3 100644 --- a/code/ryzom/client/src/main_loop.cpp +++ b/code/ryzom/client/src/main_loop.cpp @@ -91,7 +91,7 @@ #include "misc.h" #include "interface_v3/people_interraction.h" #include "debug_client.h" -#include "interface_v3/action_handler.h" +#include "nel/gui/action_handler.h" #include "interface_v3/action_handler_misc.h" #include "interface_v3/action_handler_item.h" #include "fx_manager.h" @@ -3234,7 +3234,7 @@ class CHandlerDebugUiDumpElementUnderMouse : public IActionHandler CLuaState *lua = CLuaManager::getInstance().getLuaState(); if (!lua) return; CLuaStackRestorer lsr(lua, 0); - CLuaIHMRyzom::pushUIOnStack(*lua, HighlightedDebugUI); + CLuaIHM::pushUIOnStack(*lua, HighlightedDebugUI); lua->pushValue(LUA_GLOBALSINDEX); CLuaObject env(*lua); env["inspect"].callNoThrow(1, 0); diff --git a/code/ryzom/client/src/r2/displayer_base.cpp b/code/ryzom/client/src/r2/displayer_base.cpp index 941081169..38b80f626 100644 --- a/code/ryzom/client/src/r2/displayer_base.cpp +++ b/code/ryzom/client/src/r2/displayer_base.cpp @@ -21,7 +21,7 @@ #include "game_share/object.h" // #include "nel/gui/lua_ihm.h" -#include "../interface_v3/interface_element.h" +#include "nel/gui/interface_element.h" namespace R2 { diff --git a/code/ryzom/client/src/r2/displayer_base.h b/code/ryzom/client/src/r2/displayer_base.h index 40f077af2..4d60a9f59 100644 --- a/code/ryzom/client/src/r2/displayer_base.h +++ b/code/ryzom/client/src/r2/displayer_base.h @@ -19,7 +19,7 @@ #include "nel/misc/smart_ptr.h" #include "nel/misc/class_registry.h" -#include "../interface_v3/interface_element.h" +#include "nel/gui/interface_element.h" namespace NLGUI { diff --git a/code/ryzom/client/src/r2/instance.h b/code/ryzom/client/src/r2/instance.h index cc71b28ae..d31641419 100644 --- a/code/ryzom/client/src/r2/instance.h +++ b/code/ryzom/client/src/r2/instance.h @@ -23,7 +23,7 @@ // #include "game_share/object.h" #include "displayer_base.h" -#include "../interface_v3/interface_element.h" +#include "nel/gui/interface_element.h" #include "lua_event_forwarder.h" class CEntityCL; diff --git a/code/ryzom/client/src/r2/island_collision.h b/code/ryzom/client/src/r2/island_collision.h index f1c8de182..3b9c5f473 100644 --- a/code/ryzom/client/src/r2/island_collision.h +++ b/code/ryzom/client/src/r2/island_collision.h @@ -27,7 +27,7 @@ #include "nel/3d/packed_world.h" // #include "nel/gui/view_renderer.h" -#include "../interface_v3/interface_element.h" +#include "nel/gui/interface_element.h" namespace NL3D { diff --git a/code/ryzom/client/src/r2/tool.h b/code/ryzom/client/src/r2/tool.h index 1152687bb..9b82fc724 100644 --- a/code/ryzom/client/src/r2/tool.h +++ b/code/ryzom/client/src/r2/tool.h @@ -21,7 +21,7 @@ #include "nel/misc/smart_ptr.h" #include "nel/misc/array_2d.h" // -#include "../interface_v3/interface_element.h" +#include "nel/gui/interface_element.h" #include "game_share/scenario_entry_points.h" //