aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llcompilequeue.h
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/llcompilequeue.h
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/llcompilequeue.h')
-rw-r--r--linden/indra/newview/llcompilequeue.h230
1 files changed, 230 insertions, 0 deletions
diff --git a/linden/indra/newview/llcompilequeue.h b/linden/indra/newview/llcompilequeue.h
new file mode 100644
index 0000000..72d91ef
--- /dev/null
+++ b/linden/indra/newview/llcompilequeue.h
@@ -0,0 +1,230 @@
1/**
2 * @file llcompilequeue.h
3 * @brief LLCompileQueue class header file
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_LLCOMPILEQUEUE_H
29#define LL_LLCOMPILEQUEUE_H
30
31#include "lldarray.h"
32#include "llinventory.h"
33#include "llviewerobject.h"
34#include "llvoinventorylistener.h"
35#include "llmap.h"
36#include "lluuid.h"
37
38#include "llfloater.h"
39#include "llscrolllistctrl.h"
40
41#include "llviewerinventory.h"
42
43//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
44// Class LLFloaterScriptQueue
45//
46// This class provides a mechanism of adding objects to a list that
47// will go through and execute action for the scripts on each object. The
48// objects will be accessed serially and the scripts may be
49// manipulated in parallel. For example, selecting two objects each
50// with three scripts will result in the first object having all three
51// scripts manipulated.
52//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
53
54class LLFloaterScriptQueue : public LLFloater, public LLVOInventoryListener
55{
56public:
57 // addObject() accepts an object id.
58 void addObject(const LLUUID& id);
59
60 // start() returns TRUE if the queue has started, otherwise FALSE.
61 BOOL start();
62
63protected:
64 LLFloaterScriptQueue(const std::string& name, const LLRect& rect,
65 const char* title, const char* start_string);
66 virtual ~LLFloaterScriptQueue();
67
68 // This is the callback method for the viewer object currently
69 // being worked on.
70 /*virtual*/ void inventoryChanged(LLViewerObject* obj,
71 InventoryObjectList* inv,
72 S32 serial_num,
73 void* queue);
74
75 // This is called by inventoryChanged
76 virtual void handleInventory(LLViewerObject* viewer_obj,
77 InventoryObjectList* inv) = 0;
78
79 static void onCloseBtn(void* user_data);
80
81 // returns true if this is done
82 BOOL isDone() const;
83
84 // go to the next object. If no objects left, it falls out
85 // silently and waits to be killed by the deleteIfDone() callback.
86 BOOL nextObject();
87 BOOL popNext();
88
89 // Get this instances ID.
90 const LLUUID& getID() const { return mID; }
91
92 // find an instance by ID. Return NULL if it does not exist.
93 static LLFloaterScriptQueue* findInstance(const LLUUID& id);
94
95protected:
96 // UI
97 LLScrollListCtrl* mMessages;
98 LLButton* mCloseBtn;
99
100 // Object Queue
101 LLDynamicArray<LLUUID> mObjectIDs;
102 LLUUID mCurrentObjectID;
103 BOOL mDone;
104
105 LLUUID mID;
106 static LLMap<LLUUID, LLFloaterScriptQueue*> sInstances;
107
108 const char* mStartString;
109};
110
111//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
112// Class LLFloaterCompileQueue
113//
114// This script queue will recompile each script.
115//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
116
117class LLFloaterCompileQueue : public LLFloaterScriptQueue
118{
119public:
120 // Use this method to create a compile queue. Once created, it
121 // will be responsible for it's own destruction.
122 static LLFloaterCompileQueue* create();
123
124protected:
125 LLFloaterCompileQueue(const std::string& name, const LLRect& rect);
126 virtual ~LLFloaterCompileQueue();
127
128 // This is called by inventoryChanged
129 virtual void handleInventory(LLViewerObject* viewer_obj,
130 InventoryObjectList* inv);
131
132 // This is the callback for when each script arrives
133 static void scriptArrived(LLVFS *vfs, const LLUUID& asset_id,
134 LLAssetType::EType type,
135 void* user_data, S32 status);
136
137 static void onSaveTextComplete(const LLUUID& asset_id, void* user_data, S32 status);
138 static void onSaveBytecodeComplete(const LLUUID& asset_id,
139 void* user_data,
140 S32 status);
141
142 // compile the file given and save it out.
143 void compile(const char* filename, const LLUUID& asset_id);
144
145 // remove any object in mScriptScripts with the matching uuid.
146 void removeItemByAssetID(const LLUUID& asset_id);
147
148 // save the items indicatd by the asset id.
149 void saveItemByAssetID(const LLUUID& asset_id);
150
151 // find old_asst_id, and set the asset id to new_asset_id
152 void updateAssetID(const LLUUID& old_asset_id, const LLUUID& new_asset_id);
153
154protected:
155 LLViewerInventoryItem::item_array_t mCurrentScripts;
156};
157
158//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
159// Class LLFloaterResetQueue
160//
161// This script queue will reset each script.
162//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
163
164class LLFloaterResetQueue : public LLFloaterScriptQueue
165{
166public:
167 // Use this method to create a reset queue. Once created, it
168 // will be responsible for it's own destruction.
169 static LLFloaterResetQueue* create();
170
171protected:
172 LLFloaterResetQueue(const std::string& name, const LLRect& rect);
173 virtual ~LLFloaterResetQueue();
174
175 // This is called by inventoryChanged
176 virtual void handleInventory(LLViewerObject* viewer_obj,
177 InventoryObjectList* inv);
178
179protected:
180};
181
182//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
183// Class LLFloaterRunQueue
184//
185// This script queue will set each script as running.
186//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
187
188class LLFloaterRunQueue : public LLFloaterScriptQueue
189{
190public:
191 // Use this method to create a run queue. Once created, it
192 // will be responsible for it's own destruction.
193 static LLFloaterRunQueue* create();
194
195protected:
196 LLFloaterRunQueue(const std::string& name, const LLRect& rect);
197 virtual ~LLFloaterRunQueue();
198
199 // This is called by inventoryChanged
200 virtual void handleInventory(LLViewerObject* viewer_obj,
201 InventoryObjectList* inv);
202
203protected:
204};
205
206//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
207// Class LLFloaterNotRunQueue
208//
209// This script queue will set each script as not running.
210//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
211
212class LLFloaterNotRunQueue : public LLFloaterScriptQueue
213{
214public:
215 // Use this method to create a not run queue. Once created, it
216 // will be responsible for it's own destruction.
217 static LLFloaterNotRunQueue* create();
218
219protected:
220 LLFloaterNotRunQueue(const std::string& name, const LLRect& rect);
221 virtual ~LLFloaterNotRunQueue();
222
223 // This is called by inventoryChanged
224 virtual void handleInventory(LLViewerObject* viewer_obj,
225 InventoryObjectList* inv);
226
227protected:
228};
229
230#endif // LL_LLCOMPILEQUEUE_H