From b010a257712b3d104035cbfc15aba8f517ffacb5 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Fri, 4 Jun 2010 09:35:08 +0000 Subject: + Refactor input handling from browser window code into content handlers. + Disentangle all box tree manipulation from browser window code and put it where it belongs. + Move other content specific and other irrelevant code from browser window handling to appropriate places. + Put mouse state enum in new mouse header, since it's not just used by browser window code, and it is used by treeview windows on the treeview branch. svn path=/trunk/netsurf/; revision=10561 --- desktop/mouse.h | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 desktop/mouse.h (limited to 'desktop/mouse.h') diff --git a/desktop/mouse.h b/desktop/mouse.h new file mode 100644 index 000000000..1d7c6cd6f --- /dev/null +++ b/desktop/mouse.h @@ -0,0 +1,66 @@ +/* + * Copyright 2003 Phil Mellor + * Copyright 2006 James Bursa + * Copyright 2010 Michael Drake + * + * This file is part of NetSurf, http://www.netsurf-browser.org/ + * + * NetSurf is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * NetSurf 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** \file + * Browser window creation and manipulation (interface). + */ + +#ifndef _NETSURF_DESKTOP_MOUSE_H_ +#define _NETSURF_DESKTOP_MOUSE_H_ + +/* Mouse state. 1 is primary mouse button (e.g. Select on RISC OS). + * 2 is secondary mouse button (e.g. Adjust on RISC OS). */ +typedef enum { + BROWSER_MOUSE_PRESS_1 = 1, /* button 1 pressed */ + BROWSER_MOUSE_PRESS_2 = 2, /* button 2 pressed */ + + /* note: click meaning is different for + * different front ends. On RISC OS, it + * is standard to act on press, so a + * click is fired at the same time as a + * mouse button is pressed. With GTK, it + * is standard to act on release, so a + * click is fired when the mouse button + * is released, if the operation wasn't + * a drag. */ + BROWSER_MOUSE_CLICK_1 = 4, /* button 1 clicked. */ + BROWSER_MOUSE_CLICK_2 = 8, /* button 2 clicked. */ + + BROWSER_MOUSE_DOUBLE_CLICK = 16, /* button 1 double clicked */ + + BROWSER_MOUSE_DRAG_1 = 32, /* start of button 1 drag operation */ + BROWSER_MOUSE_DRAG_2 = 64, /* start of button 2 drag operation */ + + BROWSER_MOUSE_DRAG_ON = 128, /* a drag operation was started and + * a mouse button is still pressed */ + + BROWSER_MOUSE_HOLDING_1 = 256, /* while button 1 drag is in progress */ + BROWSER_MOUSE_HOLDING_2 = 512, /* while button 2 drag is in progress */ + + + BROWSER_MOUSE_MOD_1 = 1024, /* primary modifier key pressed + * (eg. Shift) */ + BROWSER_MOUSE_MOD_2 = 2048, /* secondary modifier key pressed + * (eg. Ctrl) */ + BROWSER_MOUSE_MOD_3 = 4096 /* secondary modifier key pressed + * (eg. Alt) */ +} browser_mouse_state; + +#endif -- cgit v1.2.3