2
* Copyright 2011 Canonical Ltd.
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.
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.
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/>
18
* Authored by: Gordon Allott <gord.allott@canonical.com>
22
#ifndef UNITYSHELL_FILTERBASICBUTTON_H
23
#define UNITYSHELL_FILTERBASICBUTTON_H
26
#include <Nux/CairoWrapper.h>
27
#include <Nux/ToggleButton.h>
34
class FilterBasicButton : public nux::ToggleButton
36
NUX_DECLARE_OBJECT_TYPE(FilterBasicButton, nux::ToggleButton);
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();
44
void SetClearBeforeDraw(bool clear_before_draw);
46
virtual long ComputeContentSize();
47
virtual void Draw(nux::GraphicsEngine& GfxContext, bool force_draw);
51
void RedrawTheme(nux::Geometry const& geom, cairo_t* cr, nux::ButtonVisualState faked_state);
52
void RedrawFocusOverlay(nux::Geometry const& geom, cairo_t* cr);
54
typedef std::unique_ptr<nux::CairoWrapper> NuxCairoPtr;
56
NuxCairoPtr prelight_;
61
nux::Geometry cached_geometry_;
65
bool clear_before_draw_;
71
#endif // UNITYSHELL_FILTERBASICBUTTON_H