File: touchpad.h

package info (click to toggle)
literki 0.0.0+20100113.git1da40724-1.2
  • links: PTS, VCS
  • area: main
  • in suites: sid, stretch
  • size: 3,444 kB
  • ctags: 1,153
  • sloc: cpp: 5,263; makefile: 72
file content (35 lines) | stat: -rw-r--r-- 896 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef _TOUCHPAD_H
#define _TOUCHPAD_H

#include <string>
#include <vector>
#include "applet.h"

class Touchpad : public Applet {
  public:
    Touchpad(AppletWindowParams params, const std::string& pointer_img, double move_ratio);
    virtual AppAction OnMousePress(int x, int y);
    virtual AppAction OnMouseMove(int x, int y);
    virtual AppAction OnMouseRelease(int x, int y);
    virtual void OnRotate(Rotation r);
    virtual void OnShow();
    virtual void OnHide();
    virtual ~Touchpad(){}

  private:
    struct Button {
	int px, py, w, h;
	int num_but;
	std::string look;
	Button(int a, int b, int c, int d, int num, const std::string& l):px(a), py(b), w(c), h(d), num_but(num), look(l){}
    };
    std::vector<Button> buttons;
    void DrawButtons();
    double move_ratio;
    MyWindow pointer;
    int lastx, lasty;
    int last_px, last_py;
    int pressed_button;
};

#endif