File: slider.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 (27 lines) | stat: -rw-r--r-- 589 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
#ifndef _SLIDER_H
#define _SLIDER_H

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

class Slider : public Applet {
  public:
    Slider(AppletWindowParams params, int slide_dist);

    enum SlideDir { SLIDE_W, SLIDE_E, SLIDE_N, SLIDE_S, NO_SLIDE };

    void AddAction(SlideDir dir, std::string action);

    virtual AppAction OnMousePress(int x, int y);
    virtual AppAction OnMouseRelease(int x, int y);
    virtual void OnRotate(Rotation r){}

  private:
    SlideDir slide_dir(int px, int py, int kx, int ky);

    AppAction actions[5];
    int pressx, pressy;
    int slide_dist;
};

#endif