summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.sources4
-rw-r--r--desktop/mouse.c47
-rw-r--r--desktop/mouse.h2
3 files changed, 51 insertions, 2 deletions
diff --git a/Makefile.sources b/Makefile.sources
index 5de961289..b948557b7 100644
--- a/Makefile.sources
+++ b/Makefile.sources
@@ -17,8 +17,8 @@ S_UTILS := base64.c filename.c hashtable.c http.c locale.c messages.c \
talloc.c url.c utf8.c utils.c useragent.c findresource.c log.c
S_DESKTOP := cookies.c history_global_core.c hotlist.c knockout.c \
- options.c plot_style.c print.c search.c searchweb.c scroll.c \
- sslcert.c textarea.c tree.c tree_url_node.c version.c \
+ mouse.c options.c plot_style.c print.c search.c searchweb.c \
+ scroll.c sslcert.c textarea.c tree.c tree_url_node.c version.c \
# S_COMMON are sources common to all builds
S_COMMON := $(addprefix content/,$(S_CONTENT)) \
diff --git a/desktop/mouse.c b/desktop/mouse.c
new file mode 100644
index 000000000..372ce2cb3
--- /dev/null
+++ b/desktop/mouse.c
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2010 Michael Drake <tlsa@netsurf-browser.org>
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+/** \file
+ * Browser window creation and manipulation (implementation).
+ */
+
+#include "desktop/browser.h"
+#include "utils/log.h"
+
+/**
+ * Debug function logs a browser mouse state.
+ *
+ * \param mouse browser_mouse_state to dump
+ */
+void browser_mouse_state_dump(browser_mouse_state mouse)
+{
+ LOG(("mouse state: %s %s %s %s %s %s %s %s %s %s %s %s %s",
+ mouse & BROWSER_MOUSE_PRESS_1 ? "P1" : " ",
+ mouse & BROWSER_MOUSE_PRESS_2 ? "P2" : " ",
+ mouse & BROWSER_MOUSE_CLICK_1 ? "C1" : " ",
+ mouse & BROWSER_MOUSE_CLICK_2 ? "C2" : " ",
+ mouse & BROWSER_MOUSE_DOUBLE_CLICK ? "DC" : " ",
+ mouse & BROWSER_MOUSE_DRAG_1 ? "D1" : " ",
+ mouse & BROWSER_MOUSE_DRAG_2 ? "D2" : " ",
+ mouse & BROWSER_MOUSE_DRAG_ON ? "DO" : " ",
+ mouse & BROWSER_MOUSE_HOLDING_1 ? "H1" : " ",
+ mouse & BROWSER_MOUSE_HOLDING_2 ? "H2" : " ",
+ mouse & BROWSER_MOUSE_MOD_1 ? "M1" : " ",
+ mouse & BROWSER_MOUSE_MOD_2 ? "M2" : " ",
+ mouse & BROWSER_MOUSE_MOD_3 ? "M3" : " "));
+}
diff --git a/desktop/mouse.h b/desktop/mouse.h
index 625b54571..84af82f69 100644
--- a/desktop/mouse.h
+++ b/desktop/mouse.h
@@ -63,4 +63,6 @@ typedef enum {
* (eg. Alt) */
} browser_mouse_state;
+void browser_mouse_state_dump(browser_mouse_state mouse);
+
#endif