llviewermenu.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. /**
  2. * @file llviewermenu.h
  3. * @brief Builds menus out of objects
  4. *
  5. * $LicenseInfo:firstyear=2002&license=viewergpl$
  6. *
  7. * Copyright (c) 2002-2009, Linden Research, Inc.
  8. *
  9. * Second Life Viewer Source Code
  10. * The source code in this file ("Source Code") is provided by Linden Lab
  11. * to you under the terms of the GNU General Public License, version 2.0
  12. * ("GPL"), unless you have obtained a separate licensing agreement
  13. * ("Other License"), formally executed by you and Linden Lab. Terms of
  14. * the GPL can be found in doc/GPL-license.txt in this distribution, or
  15. * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  16. *
  17. * There are special exceptions to the terms and conditions of the GPL as
  18. * it is applied to this Source Code. View the full text of the exception
  19. * in the file doc/FLOSS-exception.txt in this software distribution, or
  20. * online at
  21. * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  22. *
  23. * By copying, modifying or distributing this software, you acknowledge
  24. * that you have read and understood your obligations described above,
  25. * and agree to abide by those obligations.
  26. *
  27. * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  28. * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  29. * COMPLETENESS OR PERFORMANCE.
  30. * $/LicenseInfo$
  31. */
  32. #ifndef LL_LLVIEWERMENU_H
  33. #define LL_LLVIEWERMENU_H
  34. #include <string>
  35. #include "llassetstorage.h"
  36. #include "llfoldertype.h"
  37. #include "llmenugl.h"
  38. #include "llsafehandle.h"
  39. #include "llvector3.h"
  40. class LLView;
  41. class LLParcelSelection;
  42. class LLObjectSelection;
  43. class LLViewerObject;
  44. class LLVOAvatar;
  45. // Called in llviewerwindow.cpp
  46. void pre_init_menus();
  47. void init_menus();
  48. void cleanup_menus();
  49. // Called in llviewercontrol.cpp
  50. void show_debug_menus();
  51. void clear_assets_cache(void*);
  52. void load_hdri_sky(bool force);
  53. // Called from several places. Returns true when successfully executed or
  54. // false when delayed (when in customize avatar mode and when wearables are
  55. // dirty) or refused (camera constrained by RestrainedLove).
  56. bool handle_reset_view();
  57. // Called in llfloaterpathfindingobjects.
  58. void handle_copy(void*);
  59. void handle_take();
  60. void handle_take_copy();
  61. void handle_object_delete();
  62. void handle_object_return();
  63. bool visible_take_object();
  64. bool enable_object_take_copy();
  65. bool enable_object_return();
  66. bool enable_object_delete();
  67. // Called in lltoolpie.cpp
  68. void handle_buy(void*);
  69. bool handle_sit_or_stand();
  70. bool handle_give_money_dialog();
  71. bool handle_object_open();
  72. bool handle_go_to();
  73. // Called from llstartup.cpp
  74. void set_underclothes_menu_options();
  75. // Called from llstartup.cpp and llviewermessage.cpp
  76. void update_upload_costs_in_menus();
  77. // Called from llappearancemgr.cpp
  78. void confirm_replace_attachment(S32 option, void* user_data);
  79. // Called from llvoavatarself.cpp
  80. bool object_attached(void* user_data);
  81. bool object_selected_and_point_valid(void*);
  82. void handle_detach(void*);
  83. void handle_detach_from_avatar(void* user_data);
  84. void detach_label(std::string& label, void* user_data);
  85. // Called from llinventorybridge.cpp and llvoavatarself.cpp
  86. void attach_label(std::string& label, void* user_data);
  87. // Called from llpuppetmotion.cpp
  88. void handle_reset_avatars_animations(void*);
  89. // Called from llstatusbar.cpp and llfloateravatartextures.cpp
  90. void handle_rebake_textures(void*);
  91. // Formerly declared in the now removed llmenucommands.h
  92. // Called from lltoolbar.cpp and hbviewerautomation.cpp
  93. void handle_chat(void*);
  94. void handle_inventory(void*);
  95. #if 0
  96. // Export to XML or Collada
  97. void handle_export_selected(void*);
  98. #endif
  99. //MK
  100. // Called from mkrlinterface.cpp
  101. void handle_toggle_wireframe(void*);
  102. void handle_toggle_flycam();
  103. //mk
  104. // Called from llfloatertools.cpp
  105. void select_face_or_linked_prim(const std::string& action);
  106. // Called from llinventorybridge.cpp
  107. bool handle_object_edit();
  108. bool handle_object_inspect();
  109. // Called from llfloateravatartextures.cpp
  110. // When refresh_all = false, only refresh the backed textures.
  111. void handle_refresh_avatar(LLVOAvatar* avatarp, bool refresh_all);
  112. bool enable_avatar_textures(void*);
  113. // Called from hbviewerautomation.cpp
  114. bool sit_on_ground();
  115. bool sit_on_object(LLViewerObject* object,
  116. const LLVector3& offset = LLVector3::zero);
  117. bool stand_up();
  118. bool derender_object(const LLUUID& object_id);
  119. // *HACK: called from llagent.cpp and llstartup.cpp, each time we need to
  120. // ensure that all objects will properly rez after the agent moved into a new
  121. // region or TPed beyond draw distance in the same region.
  122. enum eRegionChangeType : U32
  123. {
  124. AFTER_LOGIN = 0,
  125. AFTER_CROSS_BORDER,
  126. AFTER_FAR_TP,
  127. };
  128. // 'type' is 1 for refresh on login, 2 for refresh on sim border crossing, and
  129. // 4 for refresh after a TP.
  130. // *TODO: find the race condition causing the failed rezzing; probably in the
  131. // code for objects caching or culling... HB
  132. void schedule_objects_visibility_refresh(U32 type);
  133. // Also called (without delay) from in mkrlinterface.cpp and on some settings
  134. // changes from llviewercontrol.cpp. HB
  135. void handle_objects_visibility(void*);
  136. // Also called on probes settings changes in llpipeline.cpp, llpanelvolume.cpp,
  137. // and llviewercontrol.cpp. HB
  138. void handle_refresh_probes(void*);
  139. // Used in the debug menu (see llviewermenu.cpp)
  140. void handle_compress_image(void*);
  141. // Used in llviewerregion.cpp
  142. void update_upload_costs_in_menus();
  143. class LLViewerMenuHolderGL final : public LLMenuHolderGL
  144. {
  145. public:
  146. LLViewerMenuHolderGL();
  147. bool hideMenus() override;
  148. void setParcelSelection(LLSafeHandle<LLParcelSelection> selection);
  149. void setObjectSelection(LLSafeHandle<LLObjectSelection> selection);
  150. const LLRect getMenuRect() const override;
  151. protected:
  152. LLSafeHandle<LLParcelSelection> mParcelSelection;
  153. LLSafeHandle<LLObjectSelection> mObjectSelection;
  154. };
  155. ///////////////////////////////////////////////////////////////////////////////
  156. // Global variables
  157. ///////////////////////////////////////////////////////////////////////////////
  158. extern LLMenuBarGL* gMenuBarViewp;
  159. extern LLViewerMenuHolderGL* gMenuHolderp;
  160. extern LLMenuBarGL* gLoginMenuBarViewp;
  161. // Pie menus
  162. extern LLPieMenu* gPieSelfp;
  163. extern LLPieMenu* gPieAvatarp;
  164. extern LLPieMenu* gPieObjectp;
  165. extern LLPieMenu* gPieAttachmentp;
  166. extern LLPieMenu* gPieLandp;
  167. extern LLPieMenu* gPieParticlep;
  168. // Sub-menu of gPieAvatarp
  169. extern LLPieMenu* gMutesPieMenup;
  170. // Sub-menu of gPieObjectp
  171. extern LLPieMenu* gPieObjectMutep;
  172. // Needed to build menus when attachment site list available
  173. extern LLMenuGL* gDetachSubMenup;
  174. extern LLPieMenu* gAttachScreenPieMenup;
  175. extern LLPieMenu* gDetachScreenPieMenup;
  176. extern LLPieMenu* gAttachPieMenup;
  177. extern LLPieMenu* gDetachPieMenup;
  178. #endif