/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. #include "llmousehandler.h"
  27. //virtual
  28. BOOL LLMouseHandler::handleAnyMouseClick(S32 x, S32 y, MASK mask, EClickType clicktype, BOOL down)
  29. {
  30. BOOL handled = FALSE;
  31. if (down)
  32. {
  33. switch (clicktype)
  34. {
  35. case CLICK_LEFT: handled = handleMouseDown(x, y, mask); break;
  36. case CLICK_RIGHT: handled = handleRightMouseDown(x, y, mask); break;
  37. case CLICK_MIDDLE: handled = handleMiddleMouseDown(x, y, mask); break;
  38. case CLICK_DOUBLELEFT: handled = handleDoubleClick(x, y, mask); break;
  39. default:
  40. llwarns << "Unhandled enum." << llendl;
  41. }
  42. }
  43. else
  44. {
  45. switch (clicktype)
  46. {
  47. case CLICK_LEFT: handled = handleMouseUp(x, y, mask); break;
  48. case CLICK_RIGHT: handled = handleRightMouseUp(x, y, mask); break;
  49. case CLICK_MIDDLE: handled = handleMiddleMouseUp(x, y, mask); break;
  50. case CLICK_DOUBLELEFT: handled = handleDoubleClick(x, y, mask); break;
  51. default:
  52. llwarns << "Unhandled enum." << llendl;
  53. }
  54. }
  55. return handled;
  56. }