PageRenderTime 21ms CodeModel.GetById 11ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/llwindow/llmousehandler.cpp

https://bitbucket.org/lindenlab/viewer-beta/
C++ | 58 lines | 30 code | 2 blank | 26 comment | 3 complexity | 22fd09727ec65cab9f3a5a3146cb80d5 MD5 | raw file
 1/** 
 2 * @file llmousehandler.cpp
 3 * @brief LLMouseHandler class implementation
 4 *
 5 * $LicenseInfo:firstyear=2001&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#include "llmousehandler.h"
28
29//virtual
30BOOL LLMouseHandler::handleAnyMouseClick(S32 x, S32 y, MASK mask, EClickType clicktype, BOOL down)
31{
32	BOOL handled = FALSE;
33	if (down)
34	{
35		switch (clicktype)
36		{
37		case CLICK_LEFT: handled = handleMouseDown(x, y, mask); break;
38		case CLICK_RIGHT: handled = handleRightMouseDown(x, y, mask); break;
39		case CLICK_MIDDLE: handled = handleMiddleMouseDown(x, y, mask); break;
40		case CLICK_DOUBLELEFT: handled = handleDoubleClick(x, y, mask); break;
41		default:
42			llwarns << "Unhandled enum." << llendl;
43		}
44	}
45	else
46	{
47		switch (clicktype)
48		{
49		case CLICK_LEFT: handled = handleMouseUp(x, y, mask); break;
50		case CLICK_RIGHT: handled = handleRightMouseUp(x, y, mask); break;
51		case CLICK_MIDDLE: handled = handleMiddleMouseUp(x, y, mask); break;
52		case CLICK_DOUBLELEFT: handled = handleDoubleClick(x, y, mask); break;
53		default:
54			llwarns << "Unhandled enum." << llendl;
55		}
56	}
57	return handled;
58}