PageRenderTime 64ms CodeModel.GetById 20ms app.highlight 13ms RepoModel.GetById 17ms app.codeStats 1ms

/indra/newview/llstartup.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 126 lines | 66 code | 23 blank | 37 comment | 0 complexity | 8cc9a9130ace52b190c8f198314cd343 MD5 | raw file
  1/** 
  2 * @file llstartup.h
  3 * @brief startup routines and logic declaration
  4 *
  5 * $LicenseInfo:firstyear=2004&license=viewerlgpl$
  6 * Second Life Viewer Source Code
  7 * Copyright (C) 2010, Linden Research, Inc.
  8 * 
  9 * This library is free software; you can redistribute it and/or
 10 * modify it under the terms of the GNU Lesser General Public
 11 * License as published by the Free Software Foundation;
 12 * version 2.1 of the License only.
 13 * 
 14 * This library is distributed in the hope that it will be useful,
 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 17 * Lesser General Public License for more details.
 18 * 
 19 * You should have received a copy of the GNU Lesser General Public
 20 * License along with this library; if not, write to the Free Software
 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 22 * 
 23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
 24 * $/LicenseInfo$
 25 */
 26
 27#ifndef LL_LLSTARTUP_H
 28#define LL_LLSTARTUP_H
 29
 30#include <boost/scoped_ptr.hpp>
 31
 32class LLViewerTexture ;
 33class LLEventPump;
 34class LLStartupListener;
 35class LLSLURL;
 36
 37// functions
 38bool idle_startup();
 39void release_start_screen();
 40bool login_alert_done(const LLSD& notification, const LLSD& response);
 41
 42// constants, variables,  & enumerations
 43extern std::string SCREEN_HOME_FILENAME;
 44extern std::string SCREEN_LAST_FILENAME;
 45
 46typedef enum {
 47	STATE_FIRST,					// Initial startup
 48	STATE_BROWSER_INIT,             // Initialize web browser for login screen
 49	STATE_LOGIN_SHOW,				// Show login screen
 50	STATE_LOGIN_WAIT,				// Wait for user input at login screen
 51	STATE_LOGIN_CLEANUP,			// Get rid of login screen and start login
 52	STATE_LOGIN_AUTH_INIT,			// Start login to SL servers
 53	STATE_LOGIN_CURL_UNSTUCK,		// Update progress to remove "SL appears frozen" msg.
 54	STATE_LOGIN_PROCESS_RESPONSE,	// Check authentication reply
 55	STATE_WORLD_INIT,				// Start building the world
 56	STATE_MULTIMEDIA_INIT,			// Init the rest of multimedia library
 57	STATE_FONT_INIT,				// Load default fonts
 58	STATE_SEED_GRANTED_WAIT,		// Wait for seed cap grant
 59	STATE_SEED_CAP_GRANTED,			// Have seed cap grant 
 60	STATE_WORLD_WAIT,				// Waiting for simulator
 61	STATE_AGENT_SEND,				// Connect to a region
 62	STATE_AGENT_WAIT,				// Wait for region
 63	STATE_INVENTORY_SEND,			// Do inventory transfer
 64	STATE_MISC,						// Do more things (set bandwidth, start audio, save location, etc)
 65	STATE_PRECACHE,					// Wait a bit for textures to download
 66	STATE_WEARABLES_WAIT,			// Wait for clothing to download
 67	STATE_CLEANUP,					// Final cleanup
 68	STATE_STARTED					// Up and running in-world
 69} EStartupState;
 70
 71// exported symbols
 72extern bool gAgentMovementCompleted;
 73extern S32  gMaxAgentGroups;
 74extern LLPointer<LLViewerTexture> gStartTexture;
 75
 76class LLStartUp
 77{
 78public:
 79
 80	// Always use this to set gStartupState so changes are logged
 81	static void setStartupState( EStartupState state );
 82	static EStartupState getStartupState() { return gStartupState; };
 83	static std::string getStartupStateString() { return startupStateToString(gStartupState); };
 84
 85	static void multimediaInit();
 86		// Initialize LLViewerMedia multimedia engine.
 87
 88	// Load default fonts not already loaded at start screen
 89	static void fontInit();
 90
 91	static void initNameCache();
 92	
 93	static void cleanupNameCache();
 94
 95	// outfit_folder_name can be a folder anywhere in your inventory, 
 96	// but the name must be a case-sensitive exact match.
 97	// gender_name is either "male" or "female"
 98	static void loadInitialOutfit( const std::string& outfit_folder_name,
 99								   const std::string& gender_name );
100
101	//save loaded initial outfit into My Outfits category
102	static void saveInitialOutfit();
103
104	static std::string& getInitialOutfitName();
105	
106	static bool dispatchURL();
107		// if we have a SLURL or sim string ("Ahern/123/45") that started
108		// the viewer, dispatch it
109
110	static void postStartupState();
111	static void setStartSLURL(const LLSLURL& slurl); 
112	static LLSLURL& getStartSLURL() { return sStartSLURL; } 
113
114	static bool startLLProxy(); // Initialize the SOCKS 5 proxy
115
116private:
117	static LLSLURL sStartSLURL;
118
119	static std::string startupStateToString(EStartupState state);
120	static EStartupState gStartupState; // Do not set directly, use LLStartup::setStartupState
121	static boost::scoped_ptr<LLEventPump> sStateWatcher;
122	static boost::scoped_ptr<LLStartupListener> sListener;
123};
124
125
126#endif // LL_LLSTARTUP_H