summaryrefslogtreecommitdiff
path: root/indra/integration_tests/llui_libtest
diff options
context:
space:
mode:
Diffstat (limited to 'indra/integration_tests/llui_libtest')
-rw-r--r--indra/integration_tests/llui_libtest/llui_libtest.cpp66
-rw-r--r--indra/integration_tests/llui_libtest/llwidgetreg.cpp80
-rw-r--r--indra/integration_tests/llui_libtest/llwidgetreg.h2
3 files changed, 84 insertions, 64 deletions
diff --git a/indra/integration_tests/llui_libtest/llui_libtest.cpp b/indra/integration_tests/llui_libtest/llui_libtest.cpp
index f8caa7990b..54fc167adf 100644
--- a/indra/integration_tests/llui_libtest/llui_libtest.cpp
+++ b/indra/integration_tests/llui_libtest/llui_libtest.cpp
@@ -41,6 +41,7 @@
#include "lldir.h"
#include "llerrorcontrol.h"
#include "llfloater.h"
+#include "llfontfreetype.h"
#include "llfontgl.h"
#include "lltrans.h"
#include "llui.h"
@@ -72,6 +73,7 @@ public:
}
};
+class LLTexture ;
// We need to supply dummy images
class TestImageProvider : public LLImageProviderInterface
{
@@ -92,7 +94,7 @@ public:
LLPointer<LLUIImage> makeImage()
{
- LLPointer<LLImageGL> image_gl;
+ LLPointer<LLTexture> image_gl;
LLPointer<LLUIImage> image = new LLUIImage( std::string(), image_gl);
return image;
}
@@ -101,28 +103,30 @@ public:
static std::string get_xui_dir()
{
std::string delim = gDirUtilp->getDirDelimiter();
- return gDirUtilp->getAppRODataDir() + delim + std::string("skins") + delim + "default" + delim + "xui" + delim;
+ return gDirUtilp->getSkinBaseDir() + delim + "default" + delim + "xui" + delim;
}
-int main(int argc, char** argv)
+void init_llui()
{
- // Must init LLError for llerrs to actually cause errors.
- LLError::initForApplication(".");
-
// Font lookup needs directory support
- gDirUtilp->initAppDirs("SecondLife", "../../../newview");
+#if LL_DARWIN
+ const char* newview_path = "../../../../newview";
+#else
+ const char* newview_path = "../../../newview";
+#endif
+ gDirUtilp->initAppDirs("SecondLife", newview_path);
gDirUtilp->setSkinFolder("default");
-
+
std::string config_filename = gDirUtilp->getExpandedFilename(
- LL_PATH_APP_SETTINGS, "settings.xml");
+ LL_PATH_APP_SETTINGS, "settings.xml");
LLControlGroup config_group("config");
config_group.loadFromFile(config_filename);
-
+
std::string color_filename = gDirUtilp->getExpandedFilename(
- LL_PATH_DEFAULT_SKIN, "colors.xml");
+ LL_PATH_DEFAULT_SKIN, "colors.xml");
LLControlGroup color_group("color");
color_group.loadFromFile(color_filename);
-
+
LLControlGroup floater_group("floater");
LLControlGroup ignores_group("ignores");
LLUI::settings_map_t settings;
@@ -130,14 +134,14 @@ int main(int argc, char** argv)
settings["color"] = &color_group;
settings["floater"] = &floater_group;
settings["ignores"] = &ignores_group;
-
+
// Don't use real images as we don't have a GL context
TestImageProvider image_provider;
LLUI::initClass(settings, &image_provider);
-
+
const bool no_register_widgets = false;
LLWidgetReg::initClass( no_register_widgets );
-
+
// Unclear if this is needed
LLUI::setupPaths();
// Otherwise we get translation warnings when setting up floaters
@@ -146,14 +150,14 @@ int main(int argc, char** argv)
LLTrans::parseStrings("strings.xml", default_args);
LLFontManager::initClass();
-
+
// Creating widgets apparently requires fonts to be initialized,
// otherwise it crashes.
LLFontGL::initClass(96.f, 1.f, 1.f,
- gDirUtilp->getAppRODataDir(),
- LLUI::getXUIPaths(),
- false ); // don't create gl textures
-
+ gDirUtilp->getAppRODataDir(),
+ LLUI::getXUIPaths(),
+ false ); // don't create gl textures
+
LLFloaterView::Params fvparams;
fvparams.name("Floater View");
fvparams.rect( LLRect(0,480,640,0) );
@@ -161,7 +165,10 @@ int main(int argc, char** argv)
fvparams.follows.flags(FOLLOWS_ALL);
fvparams.tab_stop(false);
gFloaterView = LLUICtrlFactory::create<LLFloaterView> (fvparams);
+}
+void export_test_floaters()
+{
// Convert all test floaters to new XML format
std::string delim = gDirUtilp->getDirDelimiter();
std::string xui_dir = get_xui_dir() + "en" + delim;
@@ -178,19 +185,30 @@ int main(int argc, char** argv)
LLXMLNodePtr output_node = new LLXMLNode();
LLFloater* floater = new LLFloater();
LLUICtrlFactory::getInstance()->buildFloater(floater,
- filename,
- FALSE, // don't open floater
- output_node);
+ filename,
+ FALSE, // don't open floater
+ output_node);
std::string out_filename = xui_dir + filename;
std::string::size_type extension_pos = out_filename.rfind(".xml");
out_filename.resize(extension_pos);
out_filename += "_new.xml";
-
+
llinfos << "Output: " << out_filename << llendl;
LLFILE* floater_file = LLFile::fopen(out_filename.c_str(), "w");
LLXMLNode::writeHeaderToFile(floater_file);
output_node->writeToFile(floater_file);
fclose(floater_file);
}
+}
+
+int main(int argc, char** argv)
+{
+ // Must init LLError for llerrs to actually cause errors.
+ LLError::initForApplication(".");
+
+ init_llui();
+
+ export_test_floaters();
+
return 0;
}
diff --git a/indra/integration_tests/llui_libtest/llwidgetreg.cpp b/indra/integration_tests/llui_libtest/llwidgetreg.cpp
index 417f3059d6..5a97f2aefd 100644
--- a/indra/integration_tests/llui_libtest/llwidgetreg.cpp
+++ b/indra/integration_tests/llui_libtest/llwidgetreg.cpp
@@ -42,6 +42,7 @@
#include "llmultisliderctrl.h"
#include "llprogressbar.h"
#include "llradiogroup.h"
+#include "llsearcheditor.h"
#include "llscrollcontainer.h"
#include "llscrollingpanellist.h"
#include "llscrolllistctrl.h"
@@ -53,7 +54,7 @@
#include "lltextbox.h"
#include "lltexteditor.h"
#include "llflyoutbutton.h"
-#include "llsearcheditor.h"
+#include "llfiltereditor.h"
#include "lllayoutstack.h"
void LLWidgetReg::initClass(bool register_widgets)
@@ -62,45 +63,46 @@ void LLWidgetReg::initClass(bool register_widgets)
// references to the object files.
if (register_widgets)
{
- LLDefaultWidgetRegistry::Register<LLButton> button("button");
- LLDefaultWidgetRegistry::Register<LLCheckBoxCtrl> check_box("check_box");
- LLDefaultWidgetRegistry::Register<LLComboBox> combo_box("combo_box");
- LLDefaultWidgetRegistry::Register<LLFlyoutButton> flyout_button("flyout_button");
- LLDefaultWidgetRegistry::Register<LLContainerView> container_view("container_view");
- LLDefaultWidgetRegistry::Register<LLIconCtrl> icon("icon");
- LLDefaultWidgetRegistry::Register<LLLineEditor> line_editor("line_editor");
- LLDefaultWidgetRegistry::Register<LLSearchEditor> search_editor("search_editor");
- LLDefaultWidgetRegistry::Register<LLMenuItemSeparatorGL> menu_item_separator("menu_item_separator");
- LLDefaultWidgetRegistry::Register<LLMenuItemCallGL> menu_item_call_gl("menu_item_call");
- LLDefaultWidgetRegistry::Register<LLMenuItemCheckGL> menu_item_check_gl("menu_item_check");
- LLDefaultWidgetRegistry::Register<LLMenuGL> menu("menu");
- LLDefaultWidgetRegistry::Register<LLMenuBarGL> menu_bar("menu_bar");
- LLDefaultWidgetRegistry::Register<LLContextMenu> context_menu("context_menu");
- LLDefaultWidgetRegistry::Register<LLMultiSlider> multi_slider_bar("multi_slider_bar");
- LLDefaultWidgetRegistry::Register<LLMultiSliderCtrl> multi_slider("multi_slider");
- LLDefaultWidgetRegistry::Register<LLPanel> panel("panel", &LLPanel::fromXML);
- LLDefaultWidgetRegistry::Register<LLLayoutStack> layout_stack("layout_stack", &LLLayoutStack::fromXML);
- LLDefaultWidgetRegistry::Register<LLProgressBar> progress_bar("progress_bar");
- LLDefaultWidgetRegistry::Register<LLRadioGroup> radio_group("radio_group");
- LLDefaultWidgetRegistry::Register<LLRadioCtrl> radio_item("radio_item");
- LLDefaultWidgetRegistry::Register<LLScrollContainer> scroll_container("scroll_container");
- LLDefaultWidgetRegistry::Register<LLScrollingPanelList> scrolling_panel_list("scrolling_panel_list");
- LLDefaultWidgetRegistry::Register<LLScrollListCtrl> scroll_list("scroll_list");
- LLDefaultWidgetRegistry::Register<LLSlider> slider_bar("slider_bar");
- LLDefaultWidgetRegistry::Register<LLSliderCtrl> slider("slider");
- LLDefaultWidgetRegistry::Register<LLSpinCtrl> spinner("spinner");
- LLDefaultWidgetRegistry::Register<LLStatBar> stat_bar("stat_bar");
- //LLDefaultWidgetRegistry::Register<LLPlaceHolderPanel> placeholder("placeholder");
- LLDefaultWidgetRegistry::Register<LLTabContainer> tab_container("tab_container");
- LLDefaultWidgetRegistry::Register<LLTextBox> text("text");
- LLDefaultWidgetRegistry::Register<LLTextEditor> simple_text_editor("simple_text_editor");
- LLDefaultWidgetRegistry::Register<LLUICtrl> ui_ctrl("ui_ctrl");
- LLDefaultWidgetRegistry::Register<LLStatView> stat_view("stat_view");
- //LLDefaultWidgetRegistry::Register<LLUICtrlLocate> locate("locate");
- //LLDefaultWidgetRegistry::Register<LLUICtrlLocate> pad("pad");
- LLDefaultWidgetRegistry::Register<LLViewBorder> view_border("view_border");
+ LLDefaultChildRegistry::Register<LLButton> button("button");
+ LLDefaultChildRegistry::Register<LLCheckBoxCtrl> check_box("check_box");
+ LLDefaultChildRegistry::Register<LLComboBox> combo_box("combo_box");
+ LLDefaultChildRegistry::Register<LLFilterEditor> filter_editor("filter_editor");
+ LLDefaultChildRegistry::Register<LLFlyoutButton> flyout_button("flyout_button");
+ LLDefaultChildRegistry::Register<LLContainerView> container_view("container_view");
+ LLDefaultChildRegistry::Register<LLIconCtrl> icon("icon");
+ LLDefaultChildRegistry::Register<LLLineEditor> line_editor("line_editor");
+ LLDefaultChildRegistry::Register<LLMenuItemSeparatorGL> menu_item_separator("menu_item_separator");
+ LLDefaultChildRegistry::Register<LLMenuItemCallGL> menu_item_call_gl("menu_item_call");
+ LLDefaultChildRegistry::Register<LLMenuItemCheckGL> menu_item_check_gl("menu_item_check");
+ LLDefaultChildRegistry::Register<LLMenuGL> menu("menu");
+ LLDefaultChildRegistry::Register<LLMenuBarGL> menu_bar("menu_bar");
+ LLDefaultChildRegistry::Register<LLContextMenu> context_menu("context_menu");
+ LLDefaultChildRegistry::Register<LLMultiSlider> multi_slider_bar("multi_slider_bar");
+ LLDefaultChildRegistry::Register<LLMultiSliderCtrl> multi_slider("multi_slider");
+ LLDefaultChildRegistry::Register<LLPanel> panel("panel", &LLPanel::fromXML);
+ LLDefaultChildRegistry::Register<LLLayoutStack> layout_stack("layout_stack", &LLLayoutStack::fromXML);
+ LLDefaultChildRegistry::Register<LLProgressBar> progress_bar("progress_bar");
+ LLDefaultChildRegistry::Register<LLRadioGroup> radio_group("radio_group");
+ LLDefaultChildRegistry::Register<LLRadioCtrl> radio_item("radio_item");
+ LLDefaultChildRegistry::Register<LLSearchEditor> search_editor("search_editor");
+ LLDefaultChildRegistry::Register<LLScrollContainer> scroll_container("scroll_container");
+ LLDefaultChildRegistry::Register<LLScrollingPanelList> scrolling_panel_list("scrolling_panel_list");
+ LLDefaultChildRegistry::Register<LLScrollListCtrl> scroll_list("scroll_list");
+ LLDefaultChildRegistry::Register<LLSlider> slider_bar("slider_bar");
+ LLDefaultChildRegistry::Register<LLSliderCtrl> slider("slider");
+ LLDefaultChildRegistry::Register<LLSpinCtrl> spinner("spinner");
+ LLDefaultChildRegistry::Register<LLStatBar> stat_bar("stat_bar");
+ //LLDefaultChildRegistry::Register<LLPlaceHolderPanel> placeholder("placeholder");
+ LLDefaultChildRegistry::Register<LLTabContainer> tab_container("tab_container");
+ LLDefaultChildRegistry::Register<LLTextBox> text("text");
+ LLDefaultChildRegistry::Register<LLTextEditor> simple_text_editor("simple_text_editor");
+ LLDefaultChildRegistry::Register<LLUICtrl> ui_ctrl("ui_ctrl");
+ LLDefaultChildRegistry::Register<LLStatView> stat_view("stat_view");
+ //LLDefaultChildRegistry::Register<LLUICtrlLocate> locate("locate");
+ //LLDefaultChildRegistry::Register<LLUICtrlLocate> pad("pad");
+ LLDefaultChildRegistry::Register<LLViewBorder> view_border("view_border");
}
// *HACK: Usually this is registered as a viewer text editor
- LLDefaultWidgetRegistry::Register<LLTextEditor> text_editor("text_editor");
+ LLDefaultChildRegistry::Register<LLTextEditor> text_editor("text_editor");
}
diff --git a/indra/integration_tests/llui_libtest/llwidgetreg.h b/indra/integration_tests/llui_libtest/llwidgetreg.h
index eac818608d..4e0bc5377a 100644
--- a/indra/integration_tests/llui_libtest/llwidgetreg.h
+++ b/indra/integration_tests/llui_libtest/llwidgetreg.h
@@ -33,7 +33,7 @@
// Register all widgets with the builder registry.
// Useful on Windows where linker discards all references to the
-// static LLDefaultWidgetRegistry::Register<> calls.
+// static LLDefaultChildRegistry::Register<> calls.
class LLWidgetReg
{
public: