Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * Copyright 2003 Phil Mellor <monkeyson@users.sourceforge.net>
  3.  * Copyright 2006 James Bursa <bursa@users.sourceforge.net>
  4.  * Copyright 2010 Michael Drake <tlsa@netsurf-browser.org>
  5.  *
  6.  * This file is part of NetSurf, http://www.netsurf-browser.org/
  7.  *
  8.  * NetSurf is free software; you can redistribute it and/or modify
  9.  * it under the terms of the GNU General Public License as published by
  10.  * the Free Software Foundation; version 2 of the License.
  11.  *
  12.  * NetSurf is distributed in the hope that it will be useful,
  13.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.  * GNU General Public License for more details.
  16.  *
  17.  * You should have received a copy of the GNU General Public License
  18.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  19.  */
  20.  
  21. /** \file
  22.  * Core mouse state.
  23.  */
  24.  
  25. #ifndef _NETSURF_DESKTOP_MOUSE_H_
  26. #define _NETSURF_DESKTOP_MOUSE_H_
  27.  
  28. /* Mouse state. 1 is    primary mouse button (e.g. Select on RISC OS).
  29.  *              2 is  secondary mouse button (e.g. Adjust on RISC OS). */
  30. typedef enum {
  31.         BROWSER_MOUSE_HOVER = 0,                /* No mouse buttons pressed,
  32.                                                  * May be used to indicate
  33.                                                  * hover or end of drag. */
  34.  
  35.         BROWSER_MOUSE_PRESS_1   = (1 << 0),     /* button 1 pressed */
  36.         BROWSER_MOUSE_PRESS_2   = (1 << 1),     /* button 2 pressed */
  37.  
  38.                                         /* note: click meaning is different for
  39.                                          * different front ends. On RISC OS, it
  40.                                          * is standard to act on press, so a
  41.                                          * click is fired at the same time as a
  42.                                          * mouse button is pressed. With GTK, it
  43.                                          * is standard to act on release, so a
  44.                                          * click is fired when the mouse button
  45.                                          * is released, if the operation wasn't
  46.                                          * a drag. */
  47.  
  48.         BROWSER_MOUSE_CLICK_1   = (1 << 2),     /* button 1 clicked. */
  49.         BROWSER_MOUSE_CLICK_2   = (1 << 3),     /* button 2 clicked. */
  50.  
  51.         BROWSER_MOUSE_DOUBLE_CLICK = (1 << 4)/* button 1 double clicked */
  52.  
  53.         BROWSER_MOUSE_DRAG_1    = (1 << 5),     /* start of button 1 drag */
  54.         BROWSER_MOUSE_DRAG_2    = (1 << 6),     /* start of button 2 drag */
  55.  
  56.         BROWSER_MOUSE_DRAG_ON   = (1 << 7),     /* a drag operation was started
  57.                                                  * and a mouse button is still
  58.                                                  * pressed */
  59.  
  60.         BROWSER_MOUSE_HOLDING_1 = (1 << 8),     /* during button 1 drag */
  61.         BROWSER_MOUSE_HOLDING_2 = (1 << 9),     /* during button 2 drag */
  62.  
  63.  
  64.         BROWSER_MOUSE_MOD_1     = (1 << 10),    /* 1st modifier key pressed
  65.                                                  * (eg. Shift) */
  66.         BROWSER_MOUSE_MOD_2     = (1 << 11),    /* 2nd modifier key pressed
  67.                                                  * (eg. Ctrl) */
  68.         BROWSER_MOUSE_MOD_3     = (1 << 12)     /* 3rd modifier key pressed
  69.                                                  * (eg. Alt) */
  70. } browser_mouse_state;
  71.  
  72.  
  73. typedef enum { GUI_POINTER_DEFAULT, GUI_POINTER_POINT, GUI_POINTER_CARET,
  74.                GUI_POINTER_MENU, GUI_POINTER_UP, GUI_POINTER_DOWN,
  75.                GUI_POINTER_LEFT, GUI_POINTER_RIGHT, GUI_POINTER_RU,
  76.                GUI_POINTER_LD, GUI_POINTER_LU, GUI_POINTER_RD,
  77.                GUI_POINTER_CROSS, GUI_POINTER_MOVE, GUI_POINTER_WAIT,
  78.                GUI_POINTER_HELP, GUI_POINTER_NO_DROP, GUI_POINTER_NOT_ALLOWED,
  79.                GUI_POINTER_PROGRESS } gui_pointer_shape;
  80.  
  81. /** Mouse pointer type */
  82. typedef enum {
  83.         BROWSER_POINTER_DEFAULT         = GUI_POINTER_DEFAULT,
  84.         BROWSER_POINTER_POINT           = GUI_POINTER_POINT,
  85.         BROWSER_POINTER_CARET           = GUI_POINTER_CARET,
  86.         BROWSER_POINTER_MENU            = GUI_POINTER_MENU,
  87.         BROWSER_POINTER_UP              = GUI_POINTER_UP,
  88.         BROWSER_POINTER_DOWN            = GUI_POINTER_DOWN,
  89.         BROWSER_POINTER_LEFT            = GUI_POINTER_LEFT,
  90.         BROWSER_POINTER_RIGHT           = GUI_POINTER_RIGHT,
  91.         BROWSER_POINTER_RU              = GUI_POINTER_RU,
  92.         BROWSER_POINTER_LD              = GUI_POINTER_LD,
  93.         BROWSER_POINTER_LU              = GUI_POINTER_LU,
  94.         BROWSER_POINTER_RD              = GUI_POINTER_RD,
  95.         BROWSER_POINTER_CROSS           = GUI_POINTER_CROSS,
  96.         BROWSER_POINTER_MOVE            = GUI_POINTER_MOVE,
  97.         BROWSER_POINTER_WAIT            = GUI_POINTER_WAIT,
  98.         BROWSER_POINTER_HELP            = GUI_POINTER_HELP,
  99.         BROWSER_POINTER_NO_DROP         = GUI_POINTER_NO_DROP,
  100.         BROWSER_POINTER_NOT_ALLOWED     = GUI_POINTER_NOT_ALLOWED,
  101.         BROWSER_POINTER_PROGRESS        = GUI_POINTER_PROGRESS,
  102.         BROWSER_POINTER_AUTO
  103. } browser_pointer_shape;
  104.  
  105.  
  106. void browser_mouse_state_dump(browser_mouse_state mouse);
  107.  
  108. #endif
  109.