aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llappviewer.h
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llappviewer.h')
-rw-r--r--linden/indra/newview/llappviewer.h78
1 files changed, 34 insertions, 44 deletions
diff --git a/linden/indra/newview/llappviewer.h b/linden/indra/newview/llappviewer.h
index 88f3fdd..b3f3681 100644
--- a/linden/indra/newview/llappviewer.h
+++ b/linden/indra/newview/llappviewer.h
@@ -36,15 +36,21 @@ class LLTextureCache;
36class LLWorkerThread; 36class LLWorkerThread;
37class LLTextureFetch; 37class LLTextureFetch;
38 38
39class LLCommandLineParser;
40
39class LLAppViewer : public LLApp 41class LLAppViewer : public LLApp
40{ 42{
41public: 43public:
42 LLAppViewer(); 44 LLAppViewer();
43 virtual ~LLAppViewer(); 45 virtual ~LLAppViewer();
44 46
45 // *NOTE:Mani - Don't use this! 47 /**
46 // Having 48 * @brief Access to the LLAppViewer singleton.
47 static LLAppViewer* instance() {return sInstance; } 49 *
50 * The LLAppViewer singleton is created in main()/WinMain().
51 * So don't use it in pre-entry (static initialization) code.
52 */
53 static LLAppViewer* instance() {return sInstance; }
48 54
49 // 55 //
50 // Main application logic 56 // Main application logic
@@ -64,10 +70,6 @@ public:
64 bool quitRequested() { return mQuitRequested; } 70 bool quitRequested() { return mQuitRequested; }
65 bool logoutRequestSent() { return mLogoutRequestSent; } 71 bool logoutRequestSent() { return mLogoutRequestSent; }
66 72
67 // *FIX: This is meant to stay only until the command line issues are hashed out with repect to LLApp::parseCommandLine
68 // This version stores the argc and argv for later usage, make sure the params passed in last as long as this class.
69 bool tempStoreCommandOptions(int argc, char** argv);
70
71 void closeDebug(); 73 void closeDebug();
72 74
73 const LLOSInfo& getOSInfo() const { return mSysOSInfo; } 75 const LLOSInfo& getOSInfo() const { return mSysOSInfo; }
@@ -78,7 +80,9 @@ public:
78 S32 getCrashBehavior() const { return mCrashBehavior; } 80 S32 getCrashBehavior() const { return mCrashBehavior; }
79 void setCrashBehavior(S32 cb); 81 void setCrashBehavior(S32 cb);
80 virtual void handleCrashReporting() = 0; // What to do with crash report? 82 virtual void handleCrashReporting() = 0; // What to do with crash report?
81 static void handleViewerCrash(); // Hey! The viewer crashed. Do this. 83 virtual void handleSyncCrashTrace() = 0; // any low-level crash-prep that has to happen in the context of the crashing thread before the crash report is delivered.
84 static void handleViewerCrash(); // Hey! The viewer crashed. Do this, soon.
85 static void handleSyncViewerCrash(); // Hey! The viewer crashed. Do this right NOW in the context of the crashing thread.
82 86
83 // Thread accessors 87 // Thread accessors
84 static LLTextureCache* getTextureCache() { return sTextureCache; } 88 static LLTextureCache* getTextureCache() { return sTextureCache; }
@@ -87,9 +91,6 @@ public:
87 91
88 const std::string& getSerialNumber() { return mSerialNumber; } 92 const std::string& getSerialNumber() { return mSerialNumber; }
89 93
90 // *FIX:Mani purgeCache was made public for parse_args().
91 // If that beast is gone, make it private.
92 void purgeCache(); // Clear the local cache.
93 bool getPurgeCache() const { return mPurgeCache; } 94 bool getPurgeCache() const { return mPurgeCache; }
94 95
95 const LLString& getSecondLifeTitle() const; // The Second Life title. 96 const LLString& getSecondLifeTitle() const; // The Second Life title.
@@ -101,8 +102,6 @@ public:
101 const std::vector<std::string>& getLoginURIs() const; 102 const std::vector<std::string>& getLoginURIs() const;
102 const std::string& getHelperURI() const; 103 const std::string& getHelperURI() const;
103 void resetURIs() const; 104 void resetURIs() const;
104 void setLoginPage(const std::string& login_page);
105 const std::string& getLoginPage();
106 105
107 void forceDisconnect(const LLString& msg); // Force disconnection, with a message to the user. 106 void forceDisconnect(const LLString& msg); // Force disconnection, with a message to the user.
108 void badNetworkHandler(); // Cause a crash state due to bad network packet. 107 void badNetworkHandler(); // Cause a crash state due to bad network packet.
@@ -125,23 +124,39 @@ public:
125 virtual void forceErrorInifiniteLoop(); 124 virtual void forceErrorInifiniteLoop();
126 virtual void forceErrorSoftwareException(); 125 virtual void forceErrorSoftwareException();
127 126
127 // *NOTE: There are currently 3 settings files:
128 // "Global", "PerAccount" and "CrashSettings"
129 // The list is found in app_settings/settings_files.xml
130 // but since they are used explicitly in code,
131 // the follow consts should also do the trick.
132 static const std::string sGlobalSettingsName;
133 static const std::string sPerAccountSettingsName;
134 static const std::string sCrashSettingsName;
135
136 void loadSettingsFromDirectory(ELLPath path_index);
137
138 std::string getSettingsFileName(const std::string& file);
139
140
128protected: 141protected:
129 virtual bool initWindow(); // Initialize the viewer's window. 142 virtual bool initWindow(); // Initialize the viewer's window.
130 virtual bool initLogging(); // Initialize log files, logging system, return false on failure. 143 virtual bool initLogging(); // Initialize log files, logging system, return false on failure.
144 virtual void initConsole() {}; // Initialize OS level debugging console.
131 virtual bool initHardwareTest() { return true; } // A false result indicates the app should quit. 145 virtual bool initHardwareTest() { return true; } // A false result indicates the app should quit.
146
147 virtual bool initParseCommandLine(LLCommandLineParser& clp)
148 { return true; } // Allow platforms to specify the command line args.
132 149
133 virtual std::string generateSerialNumber() = 0; // Platforms specific classes generate this. 150 virtual std::string generateSerialNumber() = 0; // Platforms specific classes generate this.
134 151
135 152
136private: 153private:
137 154
138 bool initEarlyConfiguration(); // Initialize setting needed by crash reporting.
139 bool initThreads(); // Initialize viewer threads, return false on failure. 155 bool initThreads(); // Initialize viewer threads, return false on failure.
140 bool initConfiguration(); // Initialize settings from the command line/config file. 156 bool initConfiguration(); // Initialize settings from the command line/config file.
141 157
142 bool initCache(); // Initialize local client cache. 158 bool initCache(); // Initialize local client cache.
143 159 void purgeCache(); // Clear the local cache.
144 bool doConfigFromCommandLine(); // calls parse args.
145 160
146 void cleanupSavedSettings(); // Sets some config data to current or default values during cleanup. 161 void cleanupSavedSettings(); // Sets some config data to current or default values during cleanup.
147 void removeCacheFiles(const char *filemask); // Deletes cached files the match the given wildcard. 162 void removeCacheFiles(const char *filemask); // Deletes cached files the match the given wildcard.
@@ -190,6 +205,8 @@ private:
190 205
191 bool mQuitRequested; // User wants to quit, may have modified documents open. 206 bool mQuitRequested; // User wants to quit, may have modified documents open.
192 bool mLogoutRequestSent; // Disconnect message sent to simulator, no longer safe to send messages to the sim. 207 bool mLogoutRequestSent; // Disconnect message sent to simulator, no longer safe to send messages to the sim.
208 S32 mYieldTime;
209 LLSD mSettingsFileList;
193}; 210};
194 211
195// consts from viewer.h 212// consts from viewer.h
@@ -200,35 +217,18 @@ const S32 AGENT_UPDATES_PER_SECOND = 10;
200// 217//
201// "// llstartup" indicates that llstartup is the only client for this global. 218// "// llstartup" indicates that llstartup is the only client for this global.
202 219
203extern bool gVerifySSLCert; // parse_args setting used by llxmlrpctransaction.cpp
204extern BOOL gHandleKeysAsync; // gSavedSettings used by llviewerdisplay.cpp & llviewermenu.cpp 220extern BOOL gHandleKeysAsync; // gSavedSettings used by llviewerdisplay.cpp & llviewermenu.cpp
205extern BOOL gProbeHardware;
206extern LLString gDisabledMessage; // llstartup 221extern LLString gDisabledMessage; // llstartup
207extern BOOL gHideLinks; // used by llpanellogin, lllfloaterbuycurrency, llstartup 222extern BOOL gHideLinks; // used by llpanellogin, lllfloaterbuycurrency, llstartup
208extern LLSD gDebugInfo; 223extern LLSD gDebugInfo;
209 224
210extern BOOL gAllowIdleAFK; 225extern BOOL gAllowIdleAFK;
211extern F32 gAFKTimeout; 226extern BOOL gAllowTapTapHoldRun;
212extern BOOL gShowObjectUpdates; 227extern BOOL gShowObjectUpdates;
213 228
214extern BOOL gLogMessages; // llstartup
215extern std::string gChannelName;
216extern BOOL gUseAudio; // llstartup
217
218extern LLString gCmdLineFirstName; // llstartup
219extern LLString gCmdLineLastName;
220extern LLString gCmdLinePassword;
221
222extern BOOL gAutoLogin; // llstartup
223extern const char* DEFAULT_SETTINGS_FILE; // llstartup
224
225extern BOOL gRequestInventoryLibrary; // llstartup
226extern BOOL gGodConnect; // llstartup
227
228extern BOOL gAcceptTOS; 229extern BOOL gAcceptTOS;
229extern BOOL gAcceptCriticalMessage; 230extern BOOL gAcceptCriticalMessage;
230 231
231extern LLUUID gViewerDigest; // MD5 digest of the viewer's executable file.
232 232
233typedef enum 233typedef enum
234{ 234{
@@ -271,7 +271,6 @@ extern LLUUID gInventoryLibraryOwner;
271extern LLUUID gInventoryLibraryRoot; 271extern LLUUID gInventoryLibraryRoot;
272 272
273extern BOOL gDisconnected; 273extern BOOL gDisconnected;
274extern BOOL gDisableVoice;
275 274
276// Map scale in pixels per region 275// Map scale in pixels per region
277extern F32 gMapScale; 276extern F32 gMapScale;
@@ -281,9 +280,6 @@ extern LLFrameTimer gRestoreGLTimer;
281extern BOOL gRestoreGL; 280extern BOOL gRestoreGL;
282extern BOOL gUseWireframe; 281extern BOOL gUseWireframe;
283 282
284extern F32 gMouseSensitivity;
285extern BOOL gInvertMouse;
286
287// VFS globals - gVFS is for general use 283// VFS globals - gVFS is for general use
288// gStaticVFS is read-only and is shipped w/ the viewer 284// gStaticVFS is read-only and is shipped w/ the viewer
289// it has pre-cache data like the UI .TGAs 285// it has pre-cache data like the UI .TGAs
@@ -291,9 +287,6 @@ extern LLVFS *gStaticVFS;
291 287
292extern LLMemoryInfo gSysMemory; 288extern LLMemoryInfo gSysMemory;
293 289
294extern bool gPreloadImages;
295extern bool gPreloadSounds;
296
297extern LLString gLastVersionChannel; 290extern LLString gLastVersionChannel;
298 291
299extern LLVector3 gWindVec; 292extern LLVector3 gWindVec;
@@ -304,10 +297,7 @@ extern BOOL gPrintMessagesThisFrame;
304extern LLUUID gSunTextureID; 297extern LLUUID gSunTextureID;
305extern LLUUID gMoonTextureID; 298extern LLUUID gMoonTextureID;
306 299
307extern BOOL gUseConsole;
308
309extern BOOL gRandomizeFramerate; 300extern BOOL gRandomizeFramerate;
310extern BOOL gPeriodicSlowFrame; 301extern BOOL gPeriodicSlowFrame;
311 302
312extern BOOL gQAMode;
313#endif // LL_LLAPPVIEWER_H 303#endif // LL_LLAPPVIEWER_H