~ubuntu-branches/ubuntu/raring/workrave/raring

« back to all changes in this revision

Viewing changes to backend/src/unix/X11InputMonitor.hh

  • Committer: Package Import Robot
  • Author(s): Francois Marier, Francois Marier, Jordi Mallach
  • Date: 2012-05-28 11:29:40 UTC
  • mfrom: (1.2.9)
  • Revision ID: package-import@ubuntu.com-20120528112940-bbbsjkk30fom9s8x
Tags: 1.9.909+abc941eb70-1
[ Francois Marier ]
* New upstream snapshot
  - Drop leak-fix patch (applied upstream)
  - Document how the tarball is built in README.source
* Build GNOME applets and use gsettings
* Massive update of Build-Depends as per configure.ac

* Update README.source with snapshot instructions
* Switch to machine-readable copyright file
* Update alioth git repo links
* Bump debhelper version to 9
* Bump Standards-Version to 3.9.3

[ Jordi Mallach ]
* Avoid references to GNU/Linux in manpage.
* Drop build dependency on libgnet-dev, it's obsolete and unneeded.
* Add myself to Uploaders.
* Rewrite d/rules into dh style.
  - Move all install tweaks to .install files.
  - Install manpages using dh_installman.
* As a side effect, the package installs arch-dependant data in the
  arch triplet directory; add the required Pre-Depends for m-a-support.
* Bring back GNOME Panel applet (for GNOME 3 fallback mode) and ship the
  new GNOME Shell extension (closes: #642514, #666100).
* Add private_dirs.patch: move libworkrave-private and GObject
  Introspection files to a private dir, so they are really out of the
  way, but disable it for now as it breaks the Shell extension.
* Move typelib out of the triplet dir as gobject-introspection is not
  M-A ready yet.
* Enable dh_autoreconf for the above patches.
* Add lintian overrides.
* Add necessary Breaks/Replaces as the xpm icon has moved to workrave-data.
* Prefix all debhelper files with package name.
* Suggest gnome-shell and gnome-panel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// X11InputMonitor.hh --- ActivityMonitor for X11
2
2
//
3
 
// Copyright (C) 2001, 2002, 2003, 2006, 2007, 2008, 2009, 2010 Rob Caelers <robc@krandor.nl>
 
3
// Copyright (C) 2001 - 2012 Rob Caelers <robc@krandor.nl>
4
4
// All rights reserved.
5
5
//
6
6
// This program is free software: you can redistribute it and/or modify
25
25
#include <X11/X.h>
26
26
#include <X11/Xlib.h>
27
27
 
28
 
#include <X11/extensions/record.h>
29
 
 
30
28
#include "InputMonitor.hh"
31
29
 
32
30
#include "Runnable.hh"
51
49
  virtual void terminate();
52
50
 
53
51
private:
54
 
 
55
52
  //! The monitor's execution thread.
56
53
  virtual void run();
57
54
 
58
 
#ifdef HAVE_XRECORD_FALLBACK  
59
 
  //! the events execution thread.
60
 
  void run_events();
61
 
#endif
62
 
  
63
55
  void error_trap_enter();
64
56
  void error_trap_exit();
65
 
  
66
 
  //! Initialize
67
 
  bool init_xrecord();
68
 
 
69
 
  //! the XRecord execution thread.
70
 
  void run_xrecord();
71
 
 
72
 
  //! Stop the capturing.
73
 
  bool stop_xrecord();
74
 
 
75
 
  void handle_xrecord_handle_key_event(XRecordInterceptData *data);
76
 
  void handle_xrecord_handle_motion_event(XRecordInterceptData *data);
77
 
  void handle_xrecord_handle_button_event(XRecordInterceptData *data);
78
 
  void handle_xrecord_handle_device_key_event(bool press, XRecordInterceptData *data);
79
 
  void handle_xrecord_handle_device_motion_event(XRecordInterceptData *data);
80
 
  void handle_xrecord_handle_device_button_event(XRecordInterceptData *data);
81
 
 
82
 
  static void handle_xrecord_callback(XPointer closure, XRecordInterceptData * data);
83
 
  static gboolean static_report_failure(void *data);
84
57
 
85
58
private:
86
 
#ifdef HAVE_XRECORD_FALLBACK  
87
59
  //! Internal X magic
88
60
  void set_event_mask(Window window);
89
61
 
98
70
 
99
71
  //! Handle a mouse button event.
100
72
  void handle_button(XEvent *event);
101
 
#endif
102
 
  
 
73
 
103
74
private:
104
75
  //! The X11 display name.
105
76
  std::string x11_display_name;
107
78
  //! The X11 display handle.
108
79
  Display *x11_display;
109
80
 
110
 
#ifdef HAVE_XRECORD_FALLBACK  
111
81
  //! The X11 root window handle.
112
82
  Window root_window;
113
 
#endif
114
83
 
115
84
  //! Abort the main loop
116
85
  bool abort;
117
86
 
118
87
  //! The activity monitor thread.
119
88
  Thread *monitor_thread;
120
 
 
121
 
  //! Is the X Record extension used ?
122
 
  bool use_xrecord;
123
 
 
124
 
  //! XRecord context. Defines clients and events to capture.
125
 
  XRecordContext xrecord_context;
126
 
 
127
 
  //! X Connection for event capturing.
128
 
  Display *xrecord_datalink;
129
 
 
130
 
  // Event base for Xinput events
131
 
  static int xi_event_base;
132
89
};
133
90
 
134
91
#endif // X11INPUTMONITOR_HH