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>
24
#ifndef FILTERBASICBUTTON_H
25
#define FILTERBASICBUTTON_H
28
#include <Nux/CairoWrapper.h>
29
#include <Nux/Button.h>
30
#include <Nux/TextureArea.h>
31
#include <UnityCore/Hud.h>
32
#include "Introspectable.h"
36
class HudButton : public nux::Button, public unity::debug::Introspectable
38
typedef nux::ObjectPtr<nux::BaseTexture> BaseTexturePtr;
40
typedef nux::ObjectPtr<HudButton> Ptr;
41
HudButton (nux::TextureArea *image, NUX_FILE_LINE_PROTO);
42
HudButton (const std::string label, NUX_FILE_LINE_PROTO);
43
HudButton (const std::string label, nux::TextureArea *image, NUX_FILE_LINE_PROTO);
44
HudButton (NUX_FILE_LINE_PROTO);
47
void SetQuery(Query::Ptr query);
48
std::shared_ptr<Query> GetQuery();
50
nux::Property<std::string> label;
51
nux::Property<std::string> hint;
52
nux::Property<bool> is_rounded;
53
nux::Property<bool> fake_focused;
56
virtual bool AcceptKeyNavFocus();
57
virtual long ComputeContentSize();
58
virtual void Draw(nux::GraphicsEngine& GfxContext, bool force_draw);
59
virtual void DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw);
60
virtual void PostDraw(nux::GraphicsEngine& GfxContext, bool force_draw);
62
std::string GetName() const;
63
void AddProperties(GVariantBuilder* builder);
67
void RedrawTheme(nux::Geometry const& geom, cairo_t* cr, nux::ButtonVisualState faked_state);
68
typedef std::unique_ptr<nux::CairoWrapper> NuxCairoPtr;
70
NuxCairoPtr prelight_;
78
nux::Geometry cached_geometry_;
83
#endif // FILTERBASICBUTTON_H