llmousehandler.cpp 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /**
  2. * @file llmousehandler.cpp
  3. * @brief LLMouseHandler class implementation
  4. *
  5. * $LicenseInfo:firstyear=2001&license=viewergpl$
  6. *
  7. * Copyright (c) 2001-2007, 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://secondlife.com/developers/opensource/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 http://secondlife.com/developers/opensource/flossexception
  21. *
  22. * By copying, modifying or distributing this software, you acknowledge
  23. * that you have read and understood your obligations described above,
  24. * and agree to abide by those obligations.
  25. *
  26. * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  27. * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  28. * COMPLETENESS OR PERFORMANCE.
  29. * $/LicenseInfo$
  30. */
  31. #include "llmousehandler.h"
  32. //virtual
  33. bool LLMouseHandler::handleAnyMouseClick(S32 x, S32 y, MASK mask,
  34. EClickType clicktype, bool down)
  35. {
  36. bool handled = false;
  37. if (down)
  38. {
  39. switch (clicktype)
  40. {
  41. case CLICK_LEFT:
  42. handled = handleMouseDown(x, y, mask);
  43. break;
  44. case CLICK_RIGHT:
  45. handled = handleRightMouseDown(x, y, mask);
  46. break;
  47. case CLICK_MIDDLE:
  48. handled = handleMiddleMouseDown(x, y, mask);
  49. break;
  50. case CLICK_DOUBLELEFT:
  51. handled = handleDoubleClick(x, y, mask);
  52. }
  53. }
  54. else
  55. {
  56. switch (clicktype)
  57. {
  58. case CLICK_LEFT:
  59. handled = handleMouseUp(x, y, mask);
  60. break;
  61. case CLICK_RIGHT:
  62. handled = handleRightMouseUp(x, y, mask);
  63. break;
  64. case CLICK_MIDDLE:
  65. handled = handleMiddleMouseUp(x, y, mask);
  66. break;
  67. case CLICK_DOUBLELEFT:
  68. handled = handleDoubleClick(x, y, mask);
  69. }
  70. }
  71. return handled;
  72. }