all repos — openbox @ 99cd843fc6dc7a7f55b6c90fd1162f233853aad2

openbox fork - make it a bit more like ryudo

otk/button.hh (raw)

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
36
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
#ifndef __button_hh
#define __button_hh

#include "label.hh"

namespace otk {

class Button : public Label {

public:
  Button(Widget *parent);
  virtual ~Button();

  virtual inline bool isDefault() const { return _default; }
  virtual void setDefault(bool d);
  
  virtual inline bool isPressed() const { return _pressed; }

  virtual void press(unsigned int mouse_button);
  virtual void release(unsigned int mouse_button);

  virtual void buttonPressHandler(const XButtonEvent &e);
  virtual void buttonReleaseHandler(const XButtonEvent &e);

  virtual void styleChanged(const RenderStyle &style);
 
private:
  bool _default;
  bool _pressed;
  unsigned int _mouse_button;
};

}

#endif