diff options
Diffstat (limited to 'linden/indra/newview/llfloatergodtools.h')
-rw-r--r-- | linden/indra/newview/llfloatergodtools.h | 281 |
1 files changed, 281 insertions, 0 deletions
diff --git a/linden/indra/newview/llfloatergodtools.h b/linden/indra/newview/llfloatergodtools.h new file mode 100644 index 0000000..876d5e4 --- /dev/null +++ b/linden/indra/newview/llfloatergodtools.h | |||
@@ -0,0 +1,281 @@ | |||
1 | /** | ||
2 | * @file llfloatergodtools.h | ||
3 | * @brief The on-screen rectangle with tool options. | ||
4 | * | ||
5 | * Copyright (c) 2002-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 | #ifndef LL_LLFLOATERGODTOOLS_H | ||
29 | #define LL_LLFLOATERGODTOOLS_H | ||
30 | |||
31 | #include "llcoord.h" | ||
32 | #include "llhost.h" | ||
33 | #include "llframetimer.h" | ||
34 | |||
35 | #include "llfloater.h" | ||
36 | #include "llpanel.h" | ||
37 | #include <vector> | ||
38 | |||
39 | class LLButton; | ||
40 | class LLCheckBoxCtrl; | ||
41 | class LLComboBox; | ||
42 | class LLUICtrl; | ||
43 | class LLLineEditor; | ||
44 | class LLPanelGridTools; | ||
45 | class LLPanelRegionTools; | ||
46 | class LLPanelObjectTools; | ||
47 | class LLPanelRequestTools; | ||
48 | //class LLSliderCtrl; | ||
49 | class LLSpinCtrl; | ||
50 | class LLTabContainer; | ||
51 | class LLTextBox; | ||
52 | class LLMessageSystem; | ||
53 | |||
54 | class LLFloaterGodTools | ||
55 | : public LLFloater | ||
56 | { | ||
57 | public: | ||
58 | |||
59 | static LLFloaterGodTools* instance(); | ||
60 | |||
61 | enum EGodPanel | ||
62 | { | ||
63 | PANEL_GRID, | ||
64 | PANEL_REGION, | ||
65 | PANEL_OBJECT, | ||
66 | PANEL_REQUEST, | ||
67 | PANEL_COUNT | ||
68 | }; | ||
69 | |||
70 | static void show(void *); | ||
71 | static void hide(void *); | ||
72 | |||
73 | static void* createPanelGrid(void *userdata); | ||
74 | static void* createPanelRegion(void *userdata); | ||
75 | static void* createPanelObjects(void *userdata); | ||
76 | static void* createPanelRequest(void *userdata); | ||
77 | |||
78 | static void refreshAll(); | ||
79 | |||
80 | void showPanel(const LLString& panel_name); | ||
81 | |||
82 | virtual void onClose(bool app_quitting); | ||
83 | |||
84 | virtual void draw(); | ||
85 | |||
86 | // call this once per frame to handle visibility, rect location, | ||
87 | // button highlights, etc. | ||
88 | void updatePopup(LLCoordGL center, MASK mask); | ||
89 | |||
90 | // Get data to populate UI. | ||
91 | void sendRegionInfoRequest(); | ||
92 | |||
93 | // get and process region info if necessary. | ||
94 | static void processRegionInfo(LLMessageSystem* msg); | ||
95 | |||
96 | // Send possibly changed values to simulator. | ||
97 | void sendGodUpdateRegionInfo(); | ||
98 | |||
99 | static void onTabChanged(void *data, bool from_click); | ||
100 | |||
101 | protected: | ||
102 | U32 computeRegionFlags() const; | ||
103 | |||
104 | protected: | ||
105 | LLFloaterGodTools(); | ||
106 | ~LLFloaterGodTools(); | ||
107 | |||
108 | void setStatusText(const std::string& text); | ||
109 | |||
110 | // When the floater is going away, reset any options that need to be | ||
111 | // cleared. | ||
112 | void resetToolState(); | ||
113 | |||
114 | static LLFloaterGodTools* sInstance; | ||
115 | |||
116 | public: | ||
117 | LLPanelRegionTools *mPanelRegionTools; | ||
118 | LLPanelObjectTools *mPanelObjectTools; | ||
119 | |||
120 | LLHost mCurrentHost; | ||
121 | LLFrameTimer mUpdateTimer; | ||
122 | }; | ||
123 | |||
124 | |||
125 | //----------------------------------------------------------------------------- | ||
126 | // LLPanelRegionTools | ||
127 | //----------------------------------------------------------------------------- | ||
128 | |||
129 | class LLPanelRegionTools | ||
130 | : public LLPanel | ||
131 | { | ||
132 | public: | ||
133 | LLPanelRegionTools(const std::string& name); | ||
134 | /*virtual*/ ~LLPanelRegionTools(); | ||
135 | |||
136 | BOOL postBuild(); | ||
137 | |||
138 | /*virtual*/ void refresh(); | ||
139 | |||
140 | static void onSaveState(void* data); | ||
141 | static void onChangeAnything(LLUICtrl* ctrl, void* userdata); | ||
142 | static void onChangePrelude(LLUICtrl* ctrl, void* data); | ||
143 | static void onChangeSimName(LLLineEditor* caller, void* userdata); | ||
144 | static void onApplyChanges(void* userdata); | ||
145 | static void onBakeTerrain(void *userdata); | ||
146 | static void onRevertTerrain(void *userdata); | ||
147 | static void onSwapTerrain(void *userdata); | ||
148 | static void onSelectRegion(void *userdata); | ||
149 | static void onRefresh(void* userdata); | ||
150 | |||
151 | // set internal checkboxes/spinners/combos | ||
152 | const std::string getSimName() const; | ||
153 | U32 getEstateID() const; | ||
154 | U32 getParentEstateID() const; | ||
155 | U32 getRegionFlags() const; | ||
156 | U32 getRegionFlagsMask() const; | ||
157 | F32 getBillableFactor() const; | ||
158 | S32 getPricePerMeter() const; | ||
159 | S32 getGridPosX() const; | ||
160 | S32 getGridPosY() const; | ||
161 | S32 getRedirectGridX() const; | ||
162 | S32 getRedirectGridY() const; | ||
163 | |||
164 | // set internal checkboxes/spinners/combos | ||
165 | void setSimName(char *name); | ||
166 | void setEstateID(U32 id); | ||
167 | void setParentEstateID(U32 id); | ||
168 | void setCheckFlags(U32 flags); | ||
169 | void setBillableFactor(F32 billable_factor); | ||
170 | void setPricePerMeter(S32 price); | ||
171 | void setGridPosX(S32 pos); | ||
172 | void setGridPosY(S32 pos); | ||
173 | void setRedirectGridX(S32 pos); | ||
174 | void setRedirectGridY(S32 pos); | ||
175 | |||
176 | U32 computeRegionFlags(U32 initial_flags) const; | ||
177 | void clearAllWidgets(); | ||
178 | void enableAllWidgets(); | ||
179 | |||
180 | protected: | ||
181 | // gets from internal checkboxes/spinners/combos | ||
182 | void updateCurrentRegion() const; | ||
183 | }; | ||
184 | |||
185 | |||
186 | //----------------------------------------------------------------------------- | ||
187 | // LLPanelGridTools | ||
188 | //----------------------------------------------------------------------------- | ||
189 | |||
190 | class LLPanelGridTools | ||
191 | : public LLPanel | ||
192 | { | ||
193 | public: | ||
194 | LLPanelGridTools(const std::string& name); | ||
195 | virtual ~LLPanelGridTools(); | ||
196 | |||
197 | BOOL postBuild(); | ||
198 | |||
199 | void refresh(); | ||
200 | |||
201 | static void onClickKickAll(void *data); | ||
202 | static void confirmKick(S32 option, const LLString& text, void* userdata); | ||
203 | static void finishKick(S32 option, void* userdata); | ||
204 | static void onDragSunPhase(LLUICtrl *ctrl, void *userdata); | ||
205 | static void onClickFlushMapVisibilityCaches(void* data); | ||
206 | static void flushMapVisibilityCachesConfirm(S32 option, void* data); | ||
207 | |||
208 | protected: | ||
209 | LLString mKickMessage; // Message to send on kick | ||
210 | }; | ||
211 | |||
212 | |||
213 | //----------------------------------------------------------------------------- | ||
214 | // LLPanelObjectTools | ||
215 | //----------------------------------------------------------------------------- | ||
216 | |||
217 | class LLPanelObjectTools | ||
218 | : public LLPanel | ||
219 | { | ||
220 | public: | ||
221 | LLPanelObjectTools(const std::string& name); | ||
222 | /*virtual*/ ~LLPanelObjectTools(); | ||
223 | |||
224 | BOOL postBuild(); | ||
225 | |||
226 | /*virtual*/ void refresh(); | ||
227 | |||
228 | void setTargetAvatar(const LLUUID& target_id); | ||
229 | U32 computeRegionFlags(U32 initial_flags) const; | ||
230 | void clearAllWidgets(); | ||
231 | void enableAllWidgets(); | ||
232 | void setCheckFlags(U32 flags); | ||
233 | |||
234 | static void onChangeAnything(LLUICtrl* ctrl, void* data); | ||
235 | static void onApplyChanges(void* data); | ||
236 | static void onClickSet(void* data); | ||
237 | static void callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data); | ||
238 | static void onClickDeletePublicOwnedBy(void* data); | ||
239 | static void onClickDeleteAllScriptedOwnedBy(void* data); | ||
240 | static void onClickDeleteAllOwnedBy(void* data); | ||
241 | static void callbackSimWideDeletes(S32 option, void* userdata); | ||
242 | static void onGetTopColliders(void* data); | ||
243 | static void onGetTopScripts(void* data); | ||
244 | static void onGetScriptDigest(void* data); | ||
245 | static void onClickSetBySelection(void* data); | ||
246 | |||
247 | protected: | ||
248 | LLUUID mTargetAvatar; | ||
249 | |||
250 | // For all delete dialogs, store flags here for message. | ||
251 | U32 mSimWideDeletesFlags; | ||
252 | }; | ||
253 | |||
254 | |||
255 | //----------------------------------------------------------------------------- | ||
256 | // LLPanelRequestTools | ||
257 | //----------------------------------------------------------------------------- | ||
258 | |||
259 | class LLPanelRequestTools : public LLPanel | ||
260 | { | ||
261 | public: | ||
262 | LLPanelRequestTools(const std::string& name); | ||
263 | /*virtual*/ ~LLPanelRequestTools(); | ||
264 | |||
265 | BOOL postBuild(); | ||
266 | |||
267 | void refresh(); | ||
268 | |||
269 | static void sendRequest(const char* request, | ||
270 | const char* parameter, | ||
271 | const LLHost& host); | ||
272 | |||
273 | protected: | ||
274 | static void onClickRequest(void *data); | ||
275 | void sendRequest(const LLHost& host); | ||
276 | }; | ||
277 | |||
278 | // Flags are SWD_ flags. | ||
279 | void send_sim_wide_deletes(const LLUUID& owner_id, U32 flags); | ||
280 | |||
281 | #endif | ||