all repos — openbox @ 17d63184998b747e1a0554dc4364a36238b039e1

openbox fork - make it a bit more like ryudo

src/labelwidget.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
37
38
39
40
41
42
43
44
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
#ifndef   __oblabelwidget_hh
#define   __oblabelwidget_hh

#include "widgetbase.hh"
#include "otk/widget.hh"
#include "otk/font.hh"
#include "otk/style.hh"
#include "otk/ustring.hh"

namespace ob {

class LabelWidget : public otk::Widget, public WidgetBase
{
private:
  void setTextures();
  const otk::Font *_font;
  otk::Color *_text_color;
  int _sidemargin;
  otk::Style::TextJustify _justify;
  otk::ustring _text;
  //! Object used by Xft to render to the drawable
  XftDraw *_xftdraw;
  
public:
  LabelWidget(otk::Widget *parent, WidgetBase::WidgetType type);
  virtual ~LabelWidget();

  virtual void setStyle(otk::Style *style);

  virtual void adjust();

  virtual void focus();
  virtual void unfocus();

  virtual void update();

  inline const otk::ustring &text() const { return _text; }
  void setText(const otk::ustring &text);
};

}

#endif // __oblabelwidget_hh