[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libcvd-members] libcvd cvd/glwindow.h cvd_src/glwindow.cc
From: |
Gerhard Reitmayr |
Subject: |
[libcvd-members] libcvd cvd/glwindow.h cvd_src/glwindow.cc |
Date: |
Wed, 29 Aug 2007 16:51:58 +0000 |
CVSROOT: /cvsroot/libcvd
Module name: libcvd
Changes by: Gerhard Reitmayr <gerhard> 07/08/29 16:51:58
Modified files:
cvd : glwindow.h
cvd_src : glwindow.cc
Log message:
better cursor handling in event summary
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd/glwindow.h?cvsroot=libcvd&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd_src/glwindow.cc?cvsroot=libcvd&r1=1.10&r2=1.11
Patches:
Index: cvd/glwindow.h
===================================================================
RCS file: /cvsroot/libcvd/libcvd/cvd/glwindow.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- cvd/glwindow.h 16 Jul 2007 22:15:30 -0000 1.7
+++ cvd/glwindow.h 29 Aug 2007 16:51:58 -0000 1.8
@@ -72,7 +72,7 @@
/// A summary of multiple events
struct EventSummary {
- EventSummary() : cursor(-1,-1) {}
+ EventSummary() : cursor(-1,-1), cursor_moved(false) {}
/// key->frequency mapping for key presses and releases
std::map<int,int> key_down, key_up;
typedef std::map<int,int>::const_iterator key_iterator;
@@ -87,6 +87,8 @@
bool should_quit() const;
/// last seen cursor position from mouse_move
ImageRef cursor;
+ /// was the cursor moved during the recording of the history
+ bool cursor_moved;
};
/// Construct a GLWindow of the given size and colour depth, with the
given title.
Index: cvd_src/glwindow.cc
===================================================================
RCS file: /cvsroot/libcvd/libcvd/cvd_src/glwindow.cc,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- cvd_src/glwindow.cc 28 Aug 2007 17:33:44 -0000 1.10
+++ cvd_src/glwindow.cc 29 Aug 2007 16:51:58 -0000 1.11
@@ -340,7 +340,7 @@
void on_key_down(GLWindow& win, int key) { ++summary.key_down[key]; }
void on_key_up(GLWindow& win, int key) { ++summary.key_up[key]; }
- void on_mouse_move(GLWindow& win, ImageRef where, int state) {
summary.cursor = where; }
+ void on_mouse_move(GLWindow& win, ImageRef where, int state) {
summary.cursor = where; summary.cursor_moved = true; }
void on_mouse_down(GLWindow& win, ImageRef where, int state, int button) {
summary.mouse_down[button] = std::make_pair(where,state); }
void on_mouse_up(GLWindow& win, ImageRef where, int state, int button) {
summary.mouse_up[button] = std::make_pair(where,state); }
void on_event(GLWindow& win, int event) { ++summary.events[event]; }
@@ -348,6 +348,7 @@
void GLWindow::get_events(EventSummary& summary)
{
+ summary.cursor = cursor_position();
MakeSummary ms(summary);
handle_events(ms);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libcvd-members] libcvd cvd/glwindow.h cvd_src/glwindow.cc,
Gerhard Reitmayr <=