Umasoft
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Capture.h
1 #ifndef CAPTURE_H
2 #define CAPTURE_H
3 
4 #include <map>
5 
8 class Capture
9 {
10 public:
11  Capture(void* winId);
12  ~Capture();
13 
14  void init();
15  bool ok() {return _ok;}
16 
17  LRESULT CALLBACK wndProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam);
18  static LRESULT CALLBACK s_wndProc( HWND hWnd, UINT, WPARAM, LPARAM );
19  static std::map <void*, Capture*> registry;
20 
21  virtual void OnLButtonDown(UINT flags, int x, int y) {}
22  virtual void OnMButtonDown(UINT flags, int x, int y) {}
23  virtual void OnRButtonDown(UINT flags, int x, int y) {}
24  virtual void OnLButtonUp(UINT flags, int x, int y) {}
25  virtual void OnMButtonUp(UINT flags, int x, int y) {}
26  virtual void OnRButtonUp(UINT flags, int x, int y) {}
27  virtual void OnMouseMove(UINT flags, int x, int y) {}
28 
29 protected:
30  bool _ok;
31  void* _winId; // often a winId is needed when accessing an input device
32 
33 private:
34  WNDPROC _oldWndProc;
35 };
36 
37 #endif // CAPTURE_H