File: switcher.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 (32 lines) | stat: -rw-r--r-- 865 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
#ifndef _SWITCHER_H
#define _SWITCHER_H

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

class Switcher : public Applet {
  public:
    Switcher(AppletWindowParams params, const std::string& apps_icon, const std::string& phone_icon, const std::string& launch_icon);
    virtual AppAction OnMousePress(int x, int y);
    virtual AppAction OnMouseRelease(int x, int y);
    virtual void OnRotate(Rotation r);
    virtual ~Switcher(){}

  private:
    struct Button {
	int px, py, w, h;
	std::string action;
	std::string look;
	Button(int a, int b, int c, int d, const std::string& t, const std::string& l):px(a), py(b), w(c), h(d), action(t), look(l){}
    };
    int lastx, lasty;
    int pressed_button;
    std::vector<Button> buttons;
    void DrawButtons();
    std::string apps_icon;
    std::string phone_icon;
    std::string launch_icon;
};

#endif