aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llvieweruictrlfactory.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:46 -0500
committerJacek Antonelli2008-08-15 23:44:46 -0500
commit38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch)
treeadca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/newview/llvieweruictrlfactory.cpp
parentREADME.txt (diff)
downloadmeta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.zip
meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.gz
meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.bz2
meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.xz
Second Life viewer sources 1.13.2.12
Diffstat (limited to 'linden/indra/newview/llvieweruictrlfactory.cpp')
-rw-r--r--linden/indra/newview/llvieweruictrlfactory.cpp133
1 files changed, 133 insertions, 0 deletions
diff --git a/linden/indra/newview/llvieweruictrlfactory.cpp b/linden/indra/newview/llvieweruictrlfactory.cpp
new file mode 100644
index 0000000..3523c88
--- /dev/null
+++ b/linden/indra/newview/llvieweruictrlfactory.cpp
@@ -0,0 +1,133 @@
1/**
2 * @file llvieweruictrlfactory.cpp
3 * @brief factory class for creating UI controls
4 *
5 * Copyright (c) 2003-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#include "llviewerprecompiledheaders.h"
29
30#include <fstream>
31#include <boost/tokenizer.hpp>
32
33#include "v4color.h"
34
35#include "llvieweruictrlfactory.h"
36#include "llcolorswatch.h"
37#include "llinventoryview.h"
38#include "llviewertexteditor.h"
39#include "lltexturectrl.h"
40#include "llnameeditor.h"
41#include "llnamelistctrl.h"
42#include "llwebbrowserctrl.h"
43#include "llvolumesliderctrl.h"
44#include "lljoystickbutton.h"
45#include "llmediaremotectrl.h"
46#include "v4color.h"
47#include <boost/tokenizer.hpp>
48
49LLUICtrlFactory* gUICtrlFactory = NULL;
50
51
52//-----------------------------------------------------------------------------
53// LLUICtrlFactory()
54//-----------------------------------------------------------------------------
55LLViewerUICtrlFactory::LLViewerUICtrlFactory()
56: LLUICtrlFactory()
57{
58 // Register controls
59 LLUICtrlCreator<LLColorSwatchCtrl>::registerCreator(LL_COLOR_SWATCH_CTRL_TAG, this);
60 LLUICtrlCreator<LLViewerTextEditor>::registerCreator(LL_TEXT_EDITOR_TAG, this);
61 LLUICtrlCreator<LLTextureCtrl>::registerCreator(LL_TEXTURE_CTRL_TAG, this);
62 LLUICtrlCreator<LLNameListCtrl>::registerCreator(LL_NAME_LIST_CTRL_TAG, this);
63 LLUICtrlCreator<LLNameEditor>::registerCreator(LL_NAME_EDITOR_TAG, this);
64 LLUICtrlCreator<LLInventoryPanel>::registerCreator(LL_INVENTORY_PANEL_TAG, this);
65#if LL_LIBXUL_ENABLED
66 LLUICtrlCreator<LLWebBrowserCtrl>::registerCreator(LL_WEB_BROWSER_CTRL_TAG, this);
67#endif
68 LLUICtrlCreator<LLVolumeSliderCtrl>::registerCreator(LL_VOLUME_SLIDER_CTRL_TAG, this);
69 LLUICtrlCreator<LLJoystickAgentSlide>::registerCreator(LL_JOYSTICK_SLIDE, this);
70 LLUICtrlCreator<LLJoystickAgentTurn>::registerCreator(LL_JOYSTICK_TURN, this);
71 LLUICtrlCreator<LLMediaRemoteCtrl>::registerCreator(LL_MEDIA_REMOTE_CTRL_TAG, this);
72}
73
74//-----------------------------------------------------------------------------
75// ~LLUICtrlFactory()
76//-----------------------------------------------------------------------------
77LLViewerUICtrlFactory::~LLViewerUICtrlFactory()
78{
79}
80
81//-----------------------------------------------------------------------------
82//-----------------------------------------------------------------------------
83
84
85LLColorSwatchCtrl* LLViewerUICtrlFactory::getColorSwatchByName(LLPanel* panelp, const LLString& name)
86{
87 return (LLColorSwatchCtrl*) panelp->getCtrlByNameAndType(name, WIDGET_TYPE_COLOR_SWATCH);
88}
89
90LLNameListCtrl* LLViewerUICtrlFactory::getNameListByName(LLPanel* panelp, const LLString& name)
91{
92 return (LLNameListCtrl*)panelp->getCtrlByNameAndType(name, WIDGET_TYPE_NAME_LIST);
93}
94
95LLTextureCtrl* LLViewerUICtrlFactory::getTexturePickerByName(LLPanel* panelp, const LLString& name)
96{
97 return (LLTextureCtrl*)panelp->getCtrlByNameAndType(name, WIDGET_TYPE_TEXTURE_PICKER);
98}
99
100LLWebBrowserCtrl* LLViewerUICtrlFactory::getWebBrowserByName(LLPanel* panelp, const LLString& name)
101{
102 return (LLWebBrowserCtrl*)panelp->getCtrlByNameAndType(name, WIDGET_TYPE_WEBBROWSER);
103}
104
105LLVolumeSliderCtrl* LLViewerUICtrlFactory::getVolumeSliderByName(LLPanel* panelp, const LLString& name)
106{
107 return (LLVolumeSliderCtrl*)panelp->getCtrlByNameAndType(name, WIDGET_TYPE_VOLUME_SLIDER);
108}
109
110LLViewerTextEditor* LLViewerUICtrlFactory::getViewerTextEditorByName(LLPanel* panelp, const LLString& name)
111{
112 return (LLViewerTextEditor*)panelp->getCtrlByNameAndType(name, WIDGET_TYPE_TEXT_EDITOR);
113}
114
115LLNameEditor* LLViewerUICtrlFactory::getNameEditorByName(LLPanel* panelp, const LLString& name)
116{
117 return (LLNameEditor*)panelp->getCtrlByNameAndType(name, WIDGET_TYPE_NAME_EDITOR);
118}
119
120LLMediaRemoteCtrl* LLViewerUICtrlFactory::getMediaRemoteByName(LLPanel* panelp, const LLString& name)
121{
122 return (LLMediaRemoteCtrl*)panelp->getCtrlByNameAndType(name, WIDGET_TYPE_MEDIA_REMOTE);
123}
124
125LLJoystickAgentTurn* LLViewerUICtrlFactory::getJoystickAgentTurnByName(LLPanel* panelp, const LLString& name)
126{
127 return (LLJoystickAgentTurn*)panelp->getCtrlByNameAndType(name, WIDGET_TYPE_JOYSTICK_TURN);
128}
129
130LLJoystickAgentSlide* LLViewerUICtrlFactory::getJoystickAgentSlideByName(LLPanel* panelp, const LLString& name)
131{
132 return (LLJoystickAgentSlide*)panelp->getCtrlByNameAndType(name, WIDGET_TYPE_JOYSTICK_SLIDE);
133}