~ubuntu-branches/ubuntu/precise/pingus/precise

« back to all changes in this revision

Viewing changes to contrib/clanlib/clanlib_x11_mousewheel.diff

  • Committer: Bazaar Package Importer
  • Author(s): Cyril Brulebois
  • Date: 2008-02-28 19:44:25 UTC
  • mfrom: (4.1.4 hardy)
  • Revision ID: james.westby@ubuntu.com-20080228194425-e8ilohlijv02kgcf
Tags: 0.7.2-2
* Fix FTBFS with gcc-4.3 by adding the missing include in
  src/input/evdev_device.cpp (Closes: #462238):
   + debian/patches/20_fix_FTBFS_with_gcc-4.3.
* Rename former patch so that the filename reflects the order in which
  the patches are applied:
   - debian/patches/data_dir.patch
   + debian/patches/10_fix_data_directory.
* Bump Standards-Version from 3.7.2 to 3.7.3, no changes needed.
* Add a dh_desktop call in the arch-dep part of debian/rules.
* Adjust the “missing-dep-for-interpreter guile” override since lintian
  now lists an alternative for that dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Index: Sources/Display/Input/X11/mouse_x11.cpp
2
 
===================================================================
3
 
RCS file: /var/lib/cvs/Libs/ClanLib-0.6/Sources/Display/Input/X11/mouse_x11.cpp,v
4
 
retrieving revision 1.11
5
 
diff -u -r1.11 mouse_x11.cpp
6
 
--- Sources/Display/Input/X11/mouse_x11.cpp     17 May 2002 08:47:58 -0000      1.11
7
 
+++ Sources/Display/Input/X11/mouse_x11.cpp     30 Mar 2003 13:09:11 -0000
8
 
@@ -54,6 +54,8 @@
9
 
        for (int i=0; i<NUM_MOUSE_BUTTONS; i++)
10
 
                buttons[i] = new CL_InputButton_Mouse_XWin();
11
 
        have_focus = false;
12
 
+
13
 
+        on_xevent_slot = CL_XWindow_CompatibleCard::sig_xevent.connect(this, &CL_Mouse_XWin::on_xevent);
14
 
 }
15
 
 
16
 
 CL_Mouse_XWin::~CL_Mouse_XWin()
17
 
@@ -63,6 +65,28 @@
18
 
 
19
 
        for (int i=0; i<NUM_MOUSE_BUTTONS; i++) delete buttons[i];
20
 
        delete[] buttons;
21
 
+}
22
 
+
23
 
+void
24
 
+CL_Mouse_XWin::on_xevent(XEvent& event)
25
 
+{
26
 
+  switch (event.type)
27
 
+    {
28
 
+    case ButtonPress:
29
 
+      {
30
 
+        if (event.xbutton.button == 4)
31
 
+          CL_Mouse::sig_button_press()(CL_Key(CL_MOUSE_WHEELUP, CL_Key::Pressed, -1, cursor->x, cursor->y));
32
 
+        else if (event.xbutton.button == 5)
33
 
+          CL_Mouse::sig_button_press()(CL_Key(CL_MOUSE_WHEELDOWN, CL_Key::Pressed, -1, cursor->x, cursor->y));
34
 
+      }
35
 
+      break;
36
 
+    case ButtonRelease:
37
 
+        if (event.xbutton.button == 4)
38
 
+          CL_Mouse::sig_button_release()(CL_Key(CL_MOUSE_WHEELUP, CL_Key::Released, -1, cursor->x, cursor->y));
39
 
+        else if (event.xbutton.button == 5)
40
 
+          CL_Mouse::sig_button_release()(CL_Key(CL_MOUSE_WHEELDOWN, CL_Key::Released, -1, cursor->x, cursor->y));
41
 
+      break;
42
 
+    }
43
 
 }
44
 
 
45
 
 CL_InputDevice::InputDeviceType CL_Mouse_XWin::get_type() const
46
 
Index: Sources/Display/Input/X11/mouse_x11.h
47
 
===================================================================
48
 
RCS file: /var/lib/cvs/Libs/ClanLib-0.6/Sources/Display/Input/X11/mouse_x11.h,v
49
 
retrieving revision 1.3
50
 
diff -u -r1.3 mouse_x11.h
51
 
--- Sources/Display/Input/X11/mouse_x11.h       17 May 2002 08:47:59 -0000      1.3
52
 
+++ Sources/Display/Input/X11/mouse_x11.h       30 Mar 2003 13:09:12 -0000
53
 
@@ -78,6 +78,7 @@
54
 
        CL_InputButton_Mouse_XWin **buttons;
55
 
        CL_InputCursor_Mouse_XWin *cursor;
56
 
        CL_InputAxis_Mouse_XWin *axes;
57
 
+        CL_Slot on_xevent_slot;
58
 
 
59
 
 public:
60
 
        CL_Mouse_XWin(CL_XWindow_CompatibleCard *card);
61
 
@@ -100,6 +101,8 @@
62
 
        virtual CL_InputCursor *get_cursor(int cursor_num);
63
 
 
64
 
        virtual void keep_alive();
65
 
+
66
 
+        void on_xevent(XEvent&);
67
 
 };
68
 
 
69
 
 #endif /* USE_X11 */