summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerwindow.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerwindow.h')
-rw-r--r--indra/newview/llviewerwindow.h452
1 files changed, 262 insertions, 190 deletions
diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h
index 09ad3fc270..633c3a41d2 100644
--- a/indra/newview/llviewerwindow.h
+++ b/indra/newview/llviewerwindow.h
@@ -2,30 +2,25 @@
* @file llviewerwindow.h
* @brief Description of the LLViewerWindow class.
*
- * $LicenseInfo:firstyear=2001&license=viewergpl$
- *
- * Copyright (c) 2001-2007, Linden Research, Inc.
- *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab. Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlife.com/developers/opensource/gplv2
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
*
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at http://secondlife.com/developers/opensource/flossexception
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
*
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -43,24 +38,93 @@
#include "v3dmath.h"
#include "v2math.h"
-#include "llwindow.h"
+#include "llwindowcallbacks.h"
#include "lltimer.h"
#include "llstat.h"
-#include "llalertdialog.h"
+#include "llmousehandler.h"
+#include "llcursortypes.h"
+#include "llhandle.h"
+#include "llimage.h"
+
+#include <boost/function.hpp>
+#include <boost/signals2.hpp>
+#include <boost/scoped_ptr.hpp>
+
class LLView;
class LLViewerObject;
class LLUUID;
-class LLMouseHandler;
class LLProgressView;
class LLTool;
class LLVelocityBar;
-class LLViewerWindow;
-class LLTextBox;
+class LLPanel;
class LLImageRaw;
class LLHUDIcon;
+class LLWindow;
+class LLRootView;
+class LLViewerWindowListener;
+class LLPopupView;
+
+#define PICK_HALF_WIDTH 5
+#define PICK_DIAMETER (2 * PICK_HALF_WIDTH + 1)
+
+class LLPickInfo
+{
+public:
+ typedef enum
+ {
+ PICK_OBJECT,
+ PICK_FLORA,
+ PICK_LAND,
+ PICK_ICON,
+ PICK_PARCEL_WALL,
+ PICK_INVALID
+ } EPickType;
+
+public:
+ LLPickInfo();
+ LLPickInfo(const LLCoordGL& mouse_pos,
+ MASK keyboard_mask,
+ BOOL pick_transparent,
+ BOOL pick_surface_info,
+ void (*pick_callback)(const LLPickInfo& pick_info));
+
+ void fetchResults();
+ LLPointer<LLViewerObject> getObject() const;
+ LLUUID getObjectID() const { return mObjectID; }
+ bool isValid() const { return mPickType != PICK_INVALID; }
+
+ static bool isFlora(LLViewerObject* object);
+
+public:
+ LLCoordGL mMousePt;
+ MASK mKeyMask;
+ void (*mPickCallback)(const LLPickInfo& pick_info);
+
+ EPickType mPickType;
+ LLCoordGL mPickPt;
+ LLVector3d mPosGlobal;
+ LLVector3 mObjectOffset;
+ LLUUID mObjectID;
+ S32 mObjectFace;
+ LLHUDIcon* mHUDIcon;
+ LLVector3 mIntersection;
+ LLVector2 mUVCoords;
+ LLVector2 mSTCoords;
+ LLCoordScreen mXYCoords;
+ LLVector3 mNormal;
+ LLVector3 mBinormal;
+ BOOL mPickTransparent;
+ void getSurfaceInfo();
+
+private:
+ void updateXYCoords();
+
+ BOOL mWantSurfaceInfo; // do we populate mUVCoord, mNormal, mBinormal?
-#define MAX_IMAGE_SIZE 6144 //6 * 1024, max snapshot image size 6144 * 6144
+};
+
+static const U32 MAX_SNAPSHOT_IMAGE_SIZE = 6 * 1024; // max snapshot image size 6144 * 6144
class LLViewerWindow : public LLWindowCallbacks
{
@@ -68,14 +132,20 @@ public:
//
// CREATORS
//
- LLViewerWindow(char* title, char* name, S32 x, S32 y, S32 width, S32 height, BOOL fullscreen, BOOL ignore_pixel_depth);
+ LLViewerWindow(const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, BOOL fullscreen, BOOL ignore_pixel_depth);
virtual ~LLViewerWindow();
+ void shutdownViews();
+ void shutdownGL();
+
void initGLDefaults();
void initBase();
- void adjustRectanglesForFirstUse(const LLRect& full_window);
+ void adjustRectanglesForFirstUse(const LLRect& window);
+ void adjustControlRectanglesForFirstUse(const LLRect& window);
void initWorldUI();
+ BOOL handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK mask, LLMouseHandler::EClickType clicktype, BOOL down);
+
//
// LLWindowCallback interface implementation
//
@@ -91,12 +161,14 @@ public:
/*virtual*/ BOOL handleRightMouseUp(LLWindow *window, LLCoordGL pos, MASK mask);
/*virtual*/ BOOL handleMiddleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask);
/*virtual*/ BOOL handleMiddleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask);
- /*virtual*/ void handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask);
+ /*virtual*/ LLWindowCallbacks::DragNDropResult handleDragNDrop(LLWindow *window, LLCoordGL pos, MASK mask, LLWindowCallbacks::DragNDropAction action, std::string data);
+ void handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask);
/*virtual*/ void handleMouseLeave(LLWindow *window);
/*virtual*/ void handleResize(LLWindow *window, S32 x, S32 y);
/*virtual*/ void handleFocus(LLWindow *window);
/*virtual*/ void handleFocusLost(LLWindow *window);
/*virtual*/ BOOL handleActivate(LLWindow *window, BOOL activated);
+ /*virtual*/ BOOL handleActivateApp(LLWindow *window, BOOL activating);
/*virtual*/ void handleMenuSelect(LLWindow *window, S32 menu_item);
/*virtual*/ BOOL handlePaint(LLWindow *window, S32 x, S32 y, S32 width, S32 height);
/*virtual*/ void handleScrollWheel(LLWindow *window, S32 clicks);
@@ -104,21 +176,56 @@ public:
/*virtual*/ void handleWindowBlock(LLWindow *window);
/*virtual*/ void handleWindowUnblock(LLWindow *window);
/*virtual*/ void handleDataCopy(LLWindow *window, S32 data_type, void *data);
-
+ /*virtual*/ BOOL handleTimerEvent(LLWindow *window);
+ /*virtual*/ BOOL handleDeviceChange(LLWindow *window);
+
+ /*virtual*/ void handlePingWatchdog(LLWindow *window, const char * msg);
+ /*virtual*/ void handlePauseWatchdog(LLWindow *window);
+ /*virtual*/ void handleResumeWatchdog(LLWindow *window);
+ /*virtual*/ std::string translateString(const char* tag);
+ /*virtual*/ std::string translateString(const char* tag,
+ const std::map<std::string, std::string>& args);
+
+ // signal on bottom tray width changed
+ typedef boost::function<void (void)> bottom_tray_callback_t;
+ typedef boost::signals2::signal<void (void)> bottom_tray_signal_t;
+ bottom_tray_signal_t mOnBottomTrayWidthChanged;
+ boost::signals2::connection setOnBottomTrayWidthChanged(bottom_tray_callback_t cb) { return mOnBottomTrayWidthChanged.connect(cb); }
+ // signal on update of WorldView rect
+ typedef boost::function<void (LLRect old_world_rect, LLRect new_world_rect)> world_rect_callback_t;
+ typedef boost::signals2::signal<void (LLRect old_world_rect, LLRect new_world_rect)> world_rect_signal_t;
+ world_rect_signal_t mOnWorldViewRectUpdated;
+ boost::signals2::connection setOnWorldViewRectUpdated(world_rect_callback_t cb) { return mOnWorldViewRectUpdated.connect(cb); }
//
// ACCESSORS
//
- LLView* getRootView() const { return mRootView; }
- const LLRect& getWindowRect() const { return mWindowRect; };
- const LLRect& getVirtualWindowRect() const { return mVirtualWindowRect; };
- S32 getWindowHeight() const;
- S32 getWindowWidth() const;
- S32 getWindowDisplayHeight() const;
- S32 getWindowDisplayWidth() const;
+ LLRootView* getRootView() const;
+
+ // 3D world area in scaled pixels (via UI scale), use for most UI computations
+ LLRect getWorldViewRectScaled() const;
+ S32 getWorldViewHeightScaled() const;
+ S32 getWorldViewWidthScaled() const;
+
+ // 3D world area, in raw unscaled pixels
+ LLRect getWorldViewRectRaw() const { return mWorldViewRectRaw; }
+ S32 getWorldViewHeightRaw() const;
+ S32 getWorldViewWidthRaw() const;
+
+ // Window in scaled pixels (via UI scale), use for most UI computations
+ LLRect getWindowRectScaled() const { return mWindowRectScaled; }
+ S32 getWindowHeightScaled() const;
+ S32 getWindowWidthScaled() const;
+
+ // Window in raw pixels as seen on screen.
+ LLRect getWindowRectRaw() const { return mWindowRectRaw; }
+ S32 getWindowHeightRaw() const;
+ S32 getWindowWidthRaw() const;
+
LLWindow* getWindow() const { return mWindow; }
- void* getPlatformWindow() const { return mWindow->getPlatformWindow(); }
- void focusClient() const { return mWindow->focusClient(); };
+ void* getPlatformWindow() const;
+ void* getMediaWindow() const;
+ void focusClient() const;
LLCoordGL getLastMouse() const { return mLastMousePoint; }
S32 getLastMouseX() const { return mLastMousePoint.mX; }
@@ -131,28 +238,25 @@ public:
LLCoordGL getCurrentMouseDelta() const { return mCurrentMouseDelta; }
LLStat * getMouseVelocityStat() { return &mMouseVelocityStat; }
BOOL getLeftMouseDown() const { return mLeftMouseDown; }
+ BOOL getMiddleMouseDown() const { return mMiddleMouseDown; }
BOOL getRightMouseDown() const { return mRightMouseDown; }
- LLUICtrl* getTopCtrl() const;
- BOOL hasTopCtrl(LLView* view) const;
+ const LLPickInfo& getLastPick() const { return mLastPick; }
- void setupViewport(S32 x_offset = 0, S32 y_offset = 0);
+ void setup2DViewport(S32 x_offset = 0, S32 y_offset = 0);
+ void setup3DViewport(S32 x_offset = 0, S32 y_offset = 0);
void setup3DRender();
void setup2DRender();
- BOOL isPickPending() { return mPickPending; }
-
LLVector3 mouseDirectionGlobal(const S32 x, const S32 y) const;
LLVector3 mouseDirectionCamera(const S32 x, const S32 y) const;
+ LLVector3 mousePointHUD(const S32 x, const S32 y) const;
+
// Is window of our application frontmost?
BOOL getActive() const { return mActive; }
- void getTargetWindow(BOOL& fullscreen, S32& width, S32& height) const;
- // The 'target' is where the user wants the window to be. It may not be
- // there yet, because we may be supressing fullscreen prior to login.
-
- const LLString& getInitAlert() { return mInitAlert; }
+ const std::string& getInitAlert() { return mInitAlert; }
//
// MANIPULATORS
@@ -162,46 +266,44 @@ public:
void setCursor( ECursorType c );
void showCursor();
void hideCursor();
+ BOOL getCursorHidden() { return mCursorHidden; }
void moveCursorToCenter(); // move to center of window
void setShowProgress(const BOOL show);
BOOL getShowProgress() const;
- void moveProgressViewToFront();
- void setProgressString(const LLString& string);
+ void setProgressString(const std::string& string);
void setProgressPercent(const F32 percent);
- void setProgressMessage(const LLString& msg);
- void setProgressCancelButtonVisible( BOOL b, const LLString& label );
+ void setProgressMessage(const std::string& msg);
+ void setProgressCancelButtonVisible( BOOL b, const std::string& label = LLStringUtil::null );
LLProgressView *getProgressView() const;
void updateObjectUnderCursor();
- BOOL handlePerFrameHover(); // Once per frame, update UI based on mouse position
+ void updateUI(); // Once per frame, update UI based on mouse position, calls following update* functions
+ void updateLayout();
+ void updateMouseDelta();
+ void updateKeyboardFocus();
+ void updateWorldViewRect(bool use_full_window=false);
+ LLView* getNonSideTrayView() { return mNonSideTrayView.get(); }
+ LLView* getFloaterViewHolder() { return mFloaterViewHolder.get(); }
+ LLView* getHintHolder() { return mHintHolder.get(); }
BOOL handleKey(KEY key, MASK mask);
void handleScrollWheel (S32 clicks);
+ // add and remove views from "popup" layer
+ void addPopup(LLView* popup);
+ void removePopup(LLView* popup);
+ void clearPopups();
+
// Hide normal UI when a logon fails, re-show everything when logon is attempted again
void setNormalControlsVisible( BOOL visible );
- void setMenuBackgroundColor(bool god_mode = false, bool dev_grid = false);
-
- // Handle the application becoming active (frontmost) or inactive
- //BOOL handleActivate(BOOL activate);
-
- void setKeyboardFocus(LLUICtrl* new_focus); // new_focus = NULL to release the focus.
- LLUICtrl* getKeyboardFocus();
- BOOL hasKeyboardFocus( const LLUICtrl* possible_focus ) const;
- BOOL childHasKeyboardFocus( const LLView* parent ) const;
-
- void setMouseCapture(LLMouseHandler* new_captor); // new_captor = NULL to release the mouse.
- LLMouseHandler* getMouseCaptor() const;
-
- void setTopCtrl(LLUICtrl* new_top); // set new_top = NULL to release top_view.
+ void setMenuBackgroundColor(bool god_mode = false, bool dev_grid = false);
void reshape(S32 width, S32 height);
void sendShapeToSim();
void draw();
-// void drawSelectedObjects();
void updateDebugText();
void drawDebugText();
@@ -209,38 +311,55 @@ public:
static void movieSize(S32 new_width, S32 new_height);
- typedef enum e_snapshot_type
+ // snapshot functionality.
+ // perhaps some of this should move to llfloatershapshot? -MG
+ typedef enum
{
SNAPSHOT_TYPE_COLOR,
SNAPSHOT_TYPE_DEPTH,
SNAPSHOT_TYPE_OBJECT_ID
} ESnapshotType;
-
- BOOL saveSnapshot(const LLString& filename, S32 image_width, S32 image_height, BOOL show_ui = TRUE, BOOL do_rebuild = FALSE, ESnapshotType type = SNAPSHOT_TYPE_COLOR);
+ BOOL saveSnapshot(const std::string& filename, S32 image_width, S32 image_height, BOOL show_ui = TRUE, BOOL do_rebuild = FALSE, ESnapshotType type = SNAPSHOT_TYPE_COLOR);
BOOL rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_height, BOOL keep_window_aspect = TRUE, BOOL is_texture = FALSE,
- BOOL show_ui = TRUE, BOOL do_rebuild = FALSE, ESnapshotType type = SNAPSHOT_TYPE_COLOR, S32 max_size = MAX_IMAGE_SIZE );
- BOOL saveImageNumbered(LLImageRaw *raw, const LLString& extension = LLString());
+ BOOL show_ui = TRUE, BOOL do_rebuild = FALSE, ESnapshotType type = SNAPSHOT_TYPE_COLOR, S32 max_size = MAX_SNAPSHOT_IMAGE_SIZE );
+ BOOL thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 preview_height, BOOL show_ui, BOOL do_rebuild, ESnapshotType type) ;
+ BOOL isSnapshotLocSet() const { return ! sSnapshotDir.empty(); }
+ void resetSnapshotLoc() const { sSnapshotDir.clear(); }
+ BOOL saveImageNumbered(LLImageFormatted *image);
+
+ // Reset the directory where snapshots are saved.
+ // Client will open directory picker on next snapshot save.
+ void resetSnapshotLoc();
void playSnapshotAnimAndSound();
// draws selection boxes around selected objects, must call displayObjects first
void renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls, BOOL for_hud );
void performPick();
-
- void hitObjectOrLandGlobalAsync(S32 x, S32 y_from_bot, MASK mask, void (*callback)(S32 x, S32 y, MASK mask), BOOL pick_transparent = FALSE, BOOL pick_parcel_walls = FALSE);
- void hitObjectOrLandGlobalImmediate(S32 x, S32 y, void (*callback)(S32 x, S32 y, MASK mask), BOOL pick_transparent);
+ void returnEmptyPicks();
+
+ void pickAsync(S32 x, S32 y_from_bot, MASK mask, void (*callback)(const LLPickInfo& pick_info), BOOL pick_transparent = FALSE);
+ LLPickInfo pickImmediate(S32 x, S32 y, BOOL pick_transparent);
+ LLHUDIcon* cursorIntersectIcon(S32 mouse_x, S32 mouse_y, F32 depth,
+ LLVector3* intersection);
+
+ LLViewerObject* cursorIntersect(S32 mouse_x = -1, S32 mouse_y = -1, F32 depth = 512.f,
+ LLViewerObject *this_object = NULL,
+ S32 this_face = -1,
+ BOOL pick_transparent = FALSE,
+ S32* face_hit = NULL,
+ LLVector3 *intersection = NULL,
+ LLVector2 *uv = NULL,
+ LLVector3 *normal = NULL,
+ LLVector3 *binormal = NULL);
- void hitUIElementAsync(S32 x, S32 y_from_bot, MASK mask, void (*callback)(S32 x, S32 y, MASK mask));
- void hitUIElementImmediate(S32 x, S32 y, void (*callback)(S32 x, S32 y, MASK mask));
-
- LLViewerObject* getObjectUnderCursor(const F32 depth = 16.0f);
// Returns a pointer to the last object hit
- LLViewerObject *lastObjectHit();
- LLViewerObject *lastNonFloraObjectHit();
+ //LLViewerObject *getObject();
+ //LLViewerObject *lastNonFloraObjectHit();
- const LLVector3d& lastObjectHitOffset();
- const LLVector3d& lastNonFloraObjectHitOffset();
+ //const LLVector3d& getObjectOffset();
+ //const LLVector3d& lastNonFloraObjectHitOffset();
// mousePointOnLand() returns true if found point
BOOL mousePointOnLandGlobal(const S32 x, const S32 y, LLVector3d *land_pos_global);
@@ -251,68 +370,42 @@ public:
// Prints window implementation details
void dumpState();
- // Request display setting changes
- void toggleFullscreen(BOOL show_progress);
-
// handle shutting down GL and bringing it back up
- BOOL checkSettings();
+ void requestResolutionUpdate();
+ void checkSettings();
void restartDisplay(BOOL show_progress_bar);
- BOOL changeDisplaySettings(BOOL fullscreen, LLCoordScreen size, BOOL disable_vsync, BOOL show_progress_bar);
+ BOOL changeDisplaySettings(LLCoordScreen size, BOOL disable_vsync, BOOL show_progress_bar);
BOOL getIgnoreDestroyWindow() { return mIgnoreActivate; }
- F32 getDisplayAspectRatio() const;
+ F32 getWorldViewAspectRatio() const;
const LLVector2& getDisplayScale() const { return mDisplayScale; }
void calcDisplayScale();
-
- void drawPickBuffer() const;
-
- LLAlertDialog* alertXml(const std::string& xml_filename,
- LLAlertDialog::alert_callback_t callback = NULL, void* user_data = NULL);
- LLAlertDialog* alertXml(const std::string& xml_filename, const LLString::format_map_t& args,
- LLAlertDialog::alert_callback_t callback = NULL, void* user_data = NULL);
- LLAlertDialog* alertXmlEditText(const std::string& xml_filename, const LLString::format_map_t& args,
- LLAlertDialog::alert_callback_t callback, void* user_data,
- LLAlertDialog::alert_text_callback_t text_callback, void *text_data,
- const LLString::format_map_t& edit_args = LLString::format_map_t(),
- BOOL draw_asterixes = FALSE);
-
- static bool alertCallback(S32 modal);
-
-#ifdef SABINRIG
- //Silly rig stuff
- void printFeedback(); //RIG STUFF!
-#endif //SABINRIG
+ static LLRect calcScaledRect(const LLRect & rect, const LLVector2& display_scale);
private:
+ bool shouldShowToolTipFor(LLMouseHandler *mh);
+ static bool onAlert(const LLSD& notify);
+
void switchToolByMask(MASK mask);
void destroyWindow();
void drawMouselookInstructions();
void stopGL(BOOL save_state = TRUE);
- void restoreGL(const LLString& progress_message = LLString::null);
+ void restoreGL(const std::string& progress_message = LLStringUtil::null);
void initFonts(F32 zoom_factor = 1.f);
-
- void analyzeHit(
- S32 x, // input
- S32 y_from_bot, // input
- LLViewerObject* objectp, // input
- U32 te_offset, // input
- LLUUID* hit_object_id_p,// output
- S32* hit_face_p, // output
- LLVector3d* hit_pos_p, // output
- BOOL* hit_land, // output
- F32* hit_u_coord, // output
- F32* hit_v_coord); // output
+ void schedulePick(LLPickInfo& pick_info);
+ S32 getChatConsoleBottomPad(); // Vertical padding for child console rect, varied by bottom clutter
+ LLRect getChatConsoleRect(); // Get optimal cosole rect.
-
public:
LLWindow* mWindow; // graphical window object
protected:
BOOL mActive;
- BOOL mWantFullscreen;
- BOOL mShowFullscreenProgress;
- LLRect mWindowRect;
- LLRect mVirtualWindowRect;
- LLView* mRootView; // a view of size mWindowRect, containing all child views
+
+ LLRect mWindowRectRaw; // whole window, including UI
+ LLRect mWindowRectScaled; // whole window, scaled by UI size
+ LLRect mWorldViewRectRaw; // area of screen for 3D world
+ LLRect mWorldViewRectScaled; // area of screen for 3D world scaled by UI size
+ LLRootView* mRootView; // a view of size mWindowRectRaw, containing all child views
LLVector2 mDisplayScale;
LLCoordGL mCurrentMousePoint; // last mouse position in GL coords
@@ -320,110 +413,89 @@ protected:
LLCoordGL mCurrentMouseDelta; //amount mouse moved this frame
LLStat mMouseVelocityStat;
BOOL mLeftMouseDown;
+ BOOL mMiddleMouseDown;
BOOL mRightMouseDown;
LLProgressView *mProgressView;
- LLTextBox* mToolTip;
- BOOL mToolTipBlocked; // True after a key press or a mouse button event. False once the mouse moves again.
+ LLFrameTimer mToolTipFadeTimer;
+ LLPanel* mToolTip;
+ std::string mLastToolTipMessage;
LLRect mToolTipStickyRect; // Once a tool tip is shown, it will stay visible until the mouse leaves this rect.
BOOL mMouseInWindow; // True if the mouse is over our window or if we have captured the mouse.
BOOL mFocusCycleMode;
+ typedef std::set<LLHandle<LLView> > view_handle_set_t;
+ view_handle_set_t mMouseHoverViews;
// Variables used for tool override switching based on modifier keys. JC
MASK mLastMask; // used to detect changes in modifier mask
LLTool* mToolStored; // the tool we're overriding
- BOOL mSuppressToolbox; // sometimes hide the toolbox, despite
- // having a camera tool selected
BOOL mHideCursorPermanent; // true during drags, mouselook
- LLCoordGL mPickPoint;
- LLCoordGL mPickOffset;
- MASK mPickMask;
- BOOL mPickPending;
- void (*mPickCallback)(S32 x, S32 y, MASK mask);
+ BOOL mCursorHidden;
+ LLPickInfo mLastPick;
+ std::vector<LLPickInfo> mPicks;
+ LLRect mPickScreenRegion; // area of frame buffer for rendering pick frames (generally follows mouse to avoid going offscreen)
+ LLTimer mPickTimer; // timer for scheduling n picks per second
- LLString mOverlayTitle; // Used for special titles such as "Second Life - Special E3 2003 Beta"
+ std::string mOverlayTitle; // Used for special titles such as "Second Life - Special E3 2003 Beta"
BOOL mIgnoreActivate;
- U8* mPickBuffer;
- LLString mInitAlert; // Window / GL initialization requires an alert
+ std::string mInitAlert; // Window / GL initialization requires an alert
+
+ LLHandle<LLView> mWorldViewPlaceholder; // widget that spans the portion of screen dedicated to rendering the 3d world
+ LLHandle<LLView> mNonSideTrayView; // parent of world view + bottom bar, etc...everything but the side tray
+ LLHandle<LLView> mFloaterViewHolder; // container for floater_view
+ LLHandle<LLView> mHintHolder; // container for hints
+ LLPopupView* mPopupView; // container for transient popups
class LLDebugText* mDebugText; // Internal class for debug text
+
+ bool mResDirty;
+ bool mStatesDirty;
+ U32 mCurrResolutionIndex;
-protected:
- static char sSnapshotBaseName[LL_MAX_PATH]; /* Flawfinder: ignore */
- static char sSnapshotDir[LL_MAX_PATH]; /* Flawfinder: ignore */
-
- static char sMovieBaseName[LL_MAX_PATH]; /* Flawfinder: ignore */
-};
-
-class LLBottomPanel : public LLPanel
-{
-public:
- LLBottomPanel(const LLRect& rect);
- void setFocusIndicator(LLView * indicator);
- LLView * getFocusIndicator() { return mIndicator; }
- /*virtual*/ void draw();
-
- static void* createHUD(void* data);
- static void* createOverlayBar(void* data);
- static void* createToolBar(void* data);
+ boost::scoped_ptr<LLViewerWindowListener> mViewerWindowListener;
protected:
- LLView * mIndicator;
+ static std::string sSnapshotBaseName;
+ static std::string sSnapshotDir;
+
+ static std::string sMovieBaseName;
+
+private:
+ // Object temporarily hovered over while dragging
+ LLPointer<LLViewerObject> mDragHoveredObject;
};
-extern LLBottomPanel * gBottomPanel;
void toggle_flying(void*);
void toggle_first_person();
void toggle_build(void*);
void reset_viewer_state_on_sim(void);
-void update_saved_window_size(const LLString& control,S32 delta_width, S32 delta_height);
-//
-// Constants
-//
-
+void update_saved_window_size(const std::string& control,S32 delta_width, S32 delta_height);
//
// Globals
//
-extern LLVelocityBar* gVelocityBar;
extern LLViewerWindow* gViewerWindow;
-extern LLFrameTimer gMouseIdleTimer; // how long has it been since the mouse last moved?
extern LLFrameTimer gAwayTimer; // tracks time before setting the avatar away state to true
extern LLFrameTimer gAwayTriggerTimer; // how long the avatar has been away
-extern LLVector3d gLastHitPosGlobal;
-extern LLVector3d gLastHitObjectOffset;
-extern LLUUID gLastHitObjectID;
-extern S32 gLastHitObjectFace;
-extern BOOL gLastHitLand;
-extern F32 gLastHitUCoord;
-extern F32 gLastHitVCoord;
-
-
-extern LLVector3d gLastHitNonFloraPosGlobal;
-extern LLVector3d gLastHitNonFloraObjectOffset;
-extern LLUUID gLastHitNonFloraObjectID;
-extern S32 gLastHitNonFloraObjectFace;
-
-extern S32 gLastHitUIElement;
-extern LLHUDIcon* gLastHitHUDIcon;
-extern BOOL gLastHitParcelWall;
-extern BOOL gDebugSelect;
-extern BOOL gPickFaces;
-extern BOOL gPickTransparent;
+extern LLViewerObject* gDebugRaycastObject;
+extern LLVector3 gDebugRaycastIntersection;
+extern LLVector2 gDebugRaycastTexCoord;
+extern LLVector3 gDebugRaycastNormal;
+extern LLVector3 gDebugRaycastBinormal;
+extern S32 gDebugRaycastFaceHit;
-extern BOOL gDebugFastUIRender;
extern S32 CHAT_BAR_HEIGHT;
extern BOOL gDisplayCameraPos;
extern BOOL gDisplayWindInfo;
-extern BOOL gDisplayNearestWater;
extern BOOL gDisplayFOV;
+extern BOOL gDisplayBadge;
#endif