~3v1n0/unity/light-shortcuts

« back to all changes in this revision

Viewing changes to dash/FilterBasicButton.h

  • Committer: Marco Trevisan (Treviño)
  • Date: 2013-04-26 12:41:09 UTC
  • Revision ID: mail@3v1n0.net-20130426124109-t3b2shjah2omiqa2
Unity: Remove all the views, but the Shortcuts

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright 2011 Canonical Ltd.
3
 
 *
4
 
 * This program is free software: you can redistribute it and/or modify it
5
 
 * under the terms of the GNU Lesser General Public License version 3, as
6
 
 * published by the  Free Software Foundation.
7
 
 *
8
 
 * This program is distributed in the hope that it will be useful, but
9
 
 * WITHOUT ANY WARRANTY; without even the implied warranties of
10
 
 * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
11
 
 * PURPOSE.  See the applicable version of the GNU Lesser General Public
12
 
 * License for more details.
13
 
 *
14
 
 * You should have received a copy of both the GNU Lesser General Public
15
 
 * License version 3 along with this program.  If not, see
16
 
 * <http://www.gnu.org/licenses/>
17
 
 *
18
 
 * Authored by: Gordon Allott <gord.allott@canonical.com>
19
 
 *
20
 
 */
21
 
 
22
 
#ifndef UNITYSHELL_FILTERBASICBUTTON_H
23
 
#define UNITYSHELL_FILTERBASICBUTTON_H
24
 
 
25
 
#include <Nux/Nux.h>
26
 
#include <Nux/CairoWrapper.h>
27
 
#include <Nux/ToggleButton.h>
28
 
 
29
 
namespace unity
30
 
{
31
 
namespace dash
32
 
{
33
 
 
34
 
class FilterBasicButton : public nux::ToggleButton
35
 
{
36
 
  NUX_DECLARE_OBJECT_TYPE(FilterBasicButton, nux::ToggleButton);
37
 
public:
38
 
  FilterBasicButton(nux::TextureArea* image, NUX_FILE_LINE_PROTO);
39
 
  FilterBasicButton(std::string const& label, NUX_FILE_LINE_PROTO);
40
 
  FilterBasicButton(std::string const& label, nux::TextureArea* image, NUX_FILE_LINE_PROTO);
41
 
  FilterBasicButton(NUX_FILE_LINE_PROTO);
42
 
  virtual ~FilterBasicButton();
43
 
 
44
 
  void SetClearBeforeDraw(bool clear_before_draw);
45
 
protected:
46
 
  virtual long ComputeContentSize();
47
 
  virtual void Draw(nux::GraphicsEngine& GfxContext, bool force_draw);
48
 
 
49
 
  void Init();
50
 
  void InitTheme();
51
 
  void RedrawTheme(nux::Geometry const& geom, cairo_t* cr, nux::ButtonVisualState faked_state);
52
 
  void RedrawFocusOverlay(nux::Geometry const& geom, cairo_t* cr);
53
 
 
54
 
  typedef std::unique_ptr<nux::CairoWrapper> NuxCairoPtr;
55
 
 
56
 
  NuxCairoPtr prelight_;
57
 
  NuxCairoPtr active_;
58
 
  NuxCairoPtr normal_;
59
 
  NuxCairoPtr focus_;
60
 
 
61
 
  nux::Geometry cached_geometry_;
62
 
 
63
 
private:
64
 
  std::string label_;
65
 
  bool clear_before_draw_;
66
 
};
67
 
 
68
 
} // namespace dash
69
 
} // namespace unity
70
 
 
71
 
#endif // UNITYSHELL_FILTERBASICBUTTON_H