Merge with siana/future
This commit is contained in:
@@ -49,6 +49,7 @@ set(llwindow_HEADER_FILES
|
||||
|
||||
set(viewer_SOURCE_FILES
|
||||
llwindow.cpp
|
||||
llmousehandler.cpp
|
||||
)
|
||||
|
||||
set(viewer_HEADER_FILES
|
||||
|
||||
58
indra/llwindow/llmousehandler.cpp
Normal file
58
indra/llwindow/llmousehandler.cpp
Normal file
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* @file llmousehandler.cpp
|
||||
* @brief LLMouseHandler class implementation
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "llmousehandler.h"
|
||||
|
||||
//virtual
|
||||
BOOL LLMouseHandler::handleAnyMouseClick(S32 x, S32 y, MASK mask, EClickType clicktype, BOOL down)
|
||||
{
|
||||
BOOL handled = FALSE;
|
||||
if (down)
|
||||
{
|
||||
switch (clicktype)
|
||||
{
|
||||
case CLICK_LEFT: handled = handleMouseDown(x, y, mask); break;
|
||||
case CLICK_RIGHT: handled = handleRightMouseDown(x, y, mask); break;
|
||||
case CLICK_MIDDLE: handled = handleMiddleMouseDown(x, y, mask); break;
|
||||
case CLICK_DOUBLELEFT: handled = handleDoubleClick(x, y, mask); break;
|
||||
default:
|
||||
llwarns << "Unhandled enum." << llendl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (clicktype)
|
||||
{
|
||||
case CLICK_LEFT: handled = handleMouseUp(x, y, mask); break;
|
||||
case CLICK_RIGHT: handled = handleRightMouseUp(x, y, mask); break;
|
||||
case CLICK_MIDDLE: handled = handleMiddleMouseUp(x, y, mask); break;
|
||||
case CLICK_DOUBLELEFT: handled = handleDoubleClick(x, y, mask); break;
|
||||
default:
|
||||
llwarns << "Unhandled enum." << llendl;
|
||||
}
|
||||
}
|
||||
return handled;
|
||||
}
|
||||
@@ -33,9 +33,10 @@
|
||||
#ifndef LL_MOUSEHANDLER_H
|
||||
#define LL_MOUSEHANDLER_H
|
||||
|
||||
#include "llstring.h"
|
||||
#include "linden_common.h"
|
||||
#include "llrect.h"
|
||||
|
||||
// Abstract interface.
|
||||
// Mostly-abstract interface.
|
||||
// Intended for use via multiple inheritance.
|
||||
// A class may have as many interfaces as it likes, but never needs to inherit one more than once.
|
||||
|
||||
@@ -49,13 +50,23 @@ public:
|
||||
SHOW_IF_NOT_BLOCKED,
|
||||
SHOW_ALWAYS,
|
||||
} EShowToolTip;
|
||||
typedef enum {
|
||||
CLICK_LEFT,
|
||||
CLICK_MIDDLE,
|
||||
CLICK_RIGHT,
|
||||
CLICK_DOUBLELEFT
|
||||
} EClickType;
|
||||
virtual BOOL handleAnyMouseClick(S32 x, S32 y, MASK mask, EClickType clicktype, BOOL down);
|
||||
virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask) = 0;
|
||||
virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask) = 0;
|
||||
virtual BOOL handleHover(S32 x, S32 y, MASK mask) = 0;
|
||||
virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) = 0;
|
||||
virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask) = 0;
|
||||
virtual BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask) = 0;
|
||||
virtual BOOL handleMiddleMouseUp(S32 x, S32 y, MASK mask) = 0;
|
||||
virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) = 0;
|
||||
virtual BOOL handleRightMouseUp(S32 x, S32 y, MASK mask) = 0;
|
||||
virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask) = 0;
|
||||
|
||||
virtual BOOL handleHover(S32 x, S32 y, MASK mask) = 0;
|
||||
virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) = 0;
|
||||
virtual BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen) = 0;
|
||||
virtual EShowToolTip getShowToolTip() { return SHOW_IF_NOT_BLOCKED; };
|
||||
virtual const std::string& getName() const = 0;
|
||||
|
||||
@@ -1372,7 +1372,7 @@ BOOL LLWindowSDL::pasteTextFromPrimary(LLWString &dst)
|
||||
|
||||
BOOL LLWindowSDL::copyTextToPrimary(const LLWString &s)
|
||||
{
|
||||
return FALSE; // unsupported
|
||||
return FALSE; // unsupported
|
||||
}
|
||||
|
||||
#endif // LL_GTK
|
||||
|
||||
@@ -82,6 +82,7 @@ public:
|
||||
/*virtual*/ void captureMouse();
|
||||
/*virtual*/ void releaseMouse();
|
||||
/*virtual*/ void setMouseClipping( BOOL b );
|
||||
|
||||
/*virtual*/ BOOL isClipboardTextAvailable();
|
||||
/*virtual*/ BOOL pasteTextFromClipboard(LLWString &dst);
|
||||
/*virtual*/ BOOL copyTextToClipboard(const LLWString & src);
|
||||
@@ -89,7 +90,7 @@ public:
|
||||
/*virtual*/ BOOL isPrimaryTextAvailable();
|
||||
/*virtual*/ BOOL pasteTextFromPrimary(LLWString &dst);
|
||||
/*virtual*/ BOOL copyTextToPrimary(const LLWString & src);
|
||||
|
||||
|
||||
/*virtual*/ void flashIcon(F32 seconds);
|
||||
/*virtual*/ F32 getGamma();
|
||||
/*virtual*/ BOOL setGamma(const F32 gamma); // Set the gamma
|
||||
|
||||
Reference in New Issue
Block a user