PageRenderTime 79ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/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
Possible License(s): LGPL-2.1
  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. #ifndef LL_LLSTARTUP_H
  27. #define LL_LLSTARTUP_H
  28. #include <boost/scoped_ptr.hpp>
  29. class LLViewerTexture ;
  30. class LLEventPump;
  31. class LLStartupListener;
  32. class LLSLURL;
  33. // functions
  34. bool idle_startup();
  35. void release_start_screen();
  36. bool login_alert_done(const LLSD& notification, const LLSD& response);
  37. // constants, variables, & enumerations
  38. extern std::string SCREEN_HOME_FILENAME;
  39. extern std::string SCREEN_LAST_FILENAME;
  40. typedef enum {
  41. STATE_FIRST, // Initial startup
  42. STATE_BROWSER_INIT, // Initialize web browser for login screen
  43. STATE_LOGIN_SHOW, // Show login screen
  44. STATE_LOGIN_WAIT, // Wait for user input at login screen
  45. STATE_LOGIN_CLEANUP, // Get rid of login screen and start login
  46. STATE_LOGIN_AUTH_INIT, // Start login to SL servers
  47. STATE_LOGIN_CURL_UNSTUCK, // Update progress to remove "SL appears frozen" msg.
  48. STATE_LOGIN_PROCESS_RESPONSE, // Check authentication reply
  49. STATE_WORLD_INIT, // Start building the world
  50. STATE_MULTIMEDIA_INIT, // Init the rest of multimedia library
  51. STATE_FONT_INIT, // Load default fonts
  52. STATE_SEED_GRANTED_WAIT, // Wait for seed cap grant
  53. STATE_SEED_CAP_GRANTED, // Have seed cap grant
  54. STATE_WORLD_WAIT, // Waiting for simulator
  55. STATE_AGENT_SEND, // Connect to a region
  56. STATE_AGENT_WAIT, // Wait for region
  57. STATE_INVENTORY_SEND, // Do inventory transfer
  58. STATE_MISC, // Do more things (set bandwidth, start audio, save location, etc)
  59. STATE_PRECACHE, // Wait a bit for textures to download
  60. STATE_WEARABLES_WAIT, // Wait for clothing to download
  61. STATE_CLEANUP, // Final cleanup
  62. STATE_STARTED // Up and running in-world
  63. } EStartupState;
  64. // exported symbols
  65. extern bool gAgentMovementCompleted;
  66. extern S32 gMaxAgentGroups;
  67. extern LLPointer<LLViewerTexture> gStartTexture;
  68. class LLStartUp
  69. {
  70. public:
  71. // Always use this to set gStartupState so changes are logged
  72. static void setStartupState( EStartupState state );
  73. static EStartupState getStartupState() { return gStartupState; };
  74. static std::string getStartupStateString() { return startupStateToString(gStartupState); };
  75. static void multimediaInit();
  76. // Initialize LLViewerMedia multimedia engine.
  77. // Load default fonts not already loaded at start screen
  78. static void fontInit();
  79. static void initNameCache();
  80. static void cleanupNameCache();
  81. // outfit_folder_name can be a folder anywhere in your inventory,
  82. // but the name must be a case-sensitive exact match.
  83. // gender_name is either "male" or "female"
  84. static void loadInitialOutfit( const std::string& outfit_folder_name,
  85. const std::string& gender_name );
  86. //save loaded initial outfit into My Outfits category
  87. static void saveInitialOutfit();
  88. static std::string& getInitialOutfitName();
  89. static bool dispatchURL();
  90. // if we have a SLURL or sim string ("Ahern/123/45") that started
  91. // the viewer, dispatch it
  92. static void postStartupState();
  93. static void setStartSLURL(const LLSLURL& slurl);
  94. static LLSLURL& getStartSLURL() { return sStartSLURL; }
  95. static bool startLLProxy(); // Initialize the SOCKS 5 proxy
  96. private:
  97. static LLSLURL sStartSLURL;
  98. static std::string startupStateToString(EStartupState state);
  99. static EStartupState gStartupState; // Do not set directly, use LLStartup::setStartupState
  100. static boost::scoped_ptr<LLEventPump> sStateWatcher;
  101. static boost::scoped_ptr<LLStartupListener> sListener;
  102. };
  103. #endif // LL_LLSTARTUP_H