aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/lluictrlfactory.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/llui/lluictrlfactory.h64
1 files changed, 4 insertions, 60 deletions
diff --git a/linden/indra/llui/lluictrlfactory.h b/linden/indra/llui/lluictrlfactory.h
index e6a2cd3..b9325a0 100644
--- a/linden/indra/llui/lluictrlfactory.h
+++ b/linden/indra/llui/lluictrlfactory.h
@@ -41,7 +41,7 @@
41class LLView; 41class LLView;
42class LLPanel; 42class LLPanel;
43 43
44class LLUICtrlFactory 44class LLUICtrlFactory : public LLSingleton<LLUICtrlFactory>
45{ 45{
46public: 46public:
47 LLUICtrlFactory(); 47 LLUICtrlFactory();
@@ -49,7 +49,7 @@ public:
49 virtual ~LLUICtrlFactory() {} 49 virtual ~LLUICtrlFactory() {}
50 50
51 void setupPaths(); 51 void setupPaths();
52 52
53 void buildFloater(LLFloater* floaterp, const LLString &filename, 53 void buildFloater(LLFloater* floaterp, const LLString &filename,
54 const LLCallbackMap::map_t* factory_map = NULL, BOOL open = TRUE); 54 const LLCallbackMap::map_t* factory_map = NULL, BOOL open = TRUE);
55 BOOL buildPanel(LLPanel* panelp, const LLString &filename, 55 BOOL buildPanel(LLPanel* panelp, const LLString &filename,
@@ -65,84 +65,28 @@ public:
65 // Returns 0 on success 65 // Returns 0 on success
66 S32 saveToXML(LLView* viewp, const LLString& filename); 66 S32 saveToXML(LLView* viewp, const LLString& filename);
67 67
68
69 // Rebuilds all currently built panels. 68 // Rebuilds all currently built panels.
70 void rebuild(); 69 void rebuild();
71 70
72 static EWidgetType getWidgetType(const LLString& ctrl_type);
73 static LLString getWidgetType(EWidgetType ctrl_type);
74 static BOOL getAttributeColor(LLXMLNodePtr node, const LLString& name, LLColor4& color); 71 static BOOL getAttributeColor(LLXMLNodePtr node, const LLString& name, LLColor4& color);
75 72
76 // specific typed getters
77 static class LLButton* getButtonByName( const LLPanel* panelp, const LLString& name);
78 static class LLCheckBoxCtrl* getCheckBoxByName( const LLPanel* panelp, const LLString& name);
79 static class LLComboBox* getComboBoxByName( const LLPanel* panelp, const LLString& name);
80 static class LLIconCtrl* getIconByName( const LLPanel* panelp, const LLString& name);
81 static class LLLineEditor* getLineEditorByName( const LLPanel* panelp, const LLString& name);
82 static class LLRadioGroup* getRadioGroupByName( const LLPanel* panelp, const LLString& name);
83 static class LLScrollListCtrl* getScrollListByName( const LLPanel* panelp, const LLString& name);
84 static class LLSliderCtrl* getSliderByName( const LLPanel* panelp, const LLString& name);
85 static class LLSlider* getSliderBarByName( const LLPanel* panelp, const LLString& name);
86 static class LLSpinCtrl* getSpinnerByName( const LLPanel* panelp, const LLString& name);
87 static class LLTextBox* getTextBoxByName( const LLPanel* panelp, const LLString& name);
88 static class LLTextEditor* getTextEditorByName( const LLPanel* panelp, const LLString& name);
89 static class LLTabContainer* getTabContainerByName( const LLPanel* panelp, const LLString& name);
90 static class LLScrollableContainerView* getScrollableContainerByName(const LLPanel* panelp, const LLString& name);
91 static class LLPanel* getPanelByName( const LLPanel* panelp, const LLString& name);
92 static class LLMenuItemCallGL* getMenuItemCallByName( const LLPanel* panelp, const LLString& name);
93 static class LLScrollingPanelList* getScrollingPanelList( const LLPanel* panelp, const LLString& name);
94 static class LLMultiSliderCtrl* getMultiSliderByName( const LLPanel* panelp, const LLString& name);
95 static class LLMultiSlider* getMultiSliderBarByName(const LLPanel* panelp, const LLString& name);
96
97 // interface getters
98 static LLCtrlListInterface* getListInterfaceByName( const LLPanel* panelp, const LLString& name);
99 static LLCtrlSelectionInterface* getSelectionInterfaceByName(const LLPanel* panelp, const LLString& name);
100 static LLCtrlScrollInterface* getScrollInterfaceByName(const LLPanel* panelp, const LLString& name);
101
102 LLPanel* createFactoryPanel(LLString name); 73 LLPanel* createFactoryPanel(LLString name);
103 74
104 virtual LLView* createCtrlWidget(LLPanel *parent, LLXMLNodePtr node); 75 virtual LLView* createCtrlWidget(LLPanel *parent, LLXMLNodePtr node);
105 virtual void createWidget(LLPanel *parent, LLXMLNodePtr node); 76 virtual LLView* createWidget(LLPanel *parent, LLXMLNodePtr node);
106
107 template <class T> T* createDummyWidget(const LLString& name)
108 {
109 return NULL;
110 //static LLPanel dummy_panel;
111 //LLXMLNodePtr new_node_ptr = new LLXMLNode(T::getWidgetTag(), FALSE);
112 //return createWidget(&dummy_panel, new_node_ptr);
113 }
114
115 // Creator library
116 typedef LLView* (*creator_function_t)(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
117 void registerCreator(LLString ctrlname, creator_function_t function);
118 77
119 static bool getLayeredXMLNode(const LLString &filename, LLXMLNodePtr& root); 78 static bool getLayeredXMLNode(const LLString &filename, LLXMLNodePtr& root);
120 79
121protected:
122
123 template<class T>
124 class LLUICtrlCreator
125 {
126 public:
127 static void registerCreator(LLString name, LLUICtrlFactory *factory)
128 {
129 factory->registerCreator(name, T::fromXML);
130 }
131 };
132
133private: 80private:
134 81
135 typedef std::map<LLHandle<LLPanel>, LLString> built_panel_t; 82 typedef std::map<LLHandle<LLPanel>, LLString> built_panel_t;
136 built_panel_t mBuiltPanels; 83 built_panel_t mBuiltPanels;
84
137 typedef std::map<LLHandle<LLFloater>, LLString> built_floater_t; 85 typedef std::map<LLHandle<LLFloater>, LLString> built_floater_t;
138 built_floater_t mBuiltFloaters; 86 built_floater_t mBuiltFloaters;
139 87
140 std::deque<const LLCallbackMap::map_t*> mFactoryStack; 88 std::deque<const LLCallbackMap::map_t*> mFactoryStack;
141 89
142 static const LLString sUICtrlNames[];
143
144 typedef std::map<LLString, creator_function_t> creator_list_t;
145 creator_list_t mCreatorFunctions;
146 static std::vector<LLString> mXUIPaths; 90 static std::vector<LLString> mXUIPaths;
147}; 91};
148 92