Image.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <etk/types.hpp>
9 #include <ewol/debug.hpp>
10 #include <ewol/widget/Widget.hpp>
13 #include <ewol/widget/Manager.hpp>
14 #include <esignal/Signal.hpp>
15 
16 namespace ewol {
17  namespace widget {
18  class Image;
19  using ImageShared = ememory::SharedPtr<ewol::widget::Image>;
20  using ImageWeak = ememory::WeakPtr<ewol::widget::Image>;
24  class Image :public ewol::Widget {
25  public: // signals
26  esignal::Signal<> signalPressed;
27  public: // properties
37  protected:
40  int32_t m_colorId;
41  public:
45  Image();
46  public:
47  DECLARE_WIDGET_FACTORY(Image, "Image");
51  virtual ~Image();
57  void set(const std::string& _file, const gale::Dimension& _border);
58  protected:
60  protected:
61  void onDraw() override;
62  public:
63  void calculateMinMaxSize() override;
64  void onRegenerateDisplay() override;
65  bool onEventInput(const ewol::event::Input& _event) override;
66  bool loadXML(const exml::Element& _node) override;
67  protected:
68  virtual void onChangePropertySource();
69  virtual void onChangePropertyImageSize();
70  virtual void onChangePropertyGlobalSize();
71  virtual void onChangePropertySmooth();
72  virtual void onChangePropertyDistanceFieldMode();
73  virtual void onChangePropertyUseThemeColor();
74  };
75  };
76 };
bool loadXML(const exml::Element &_node) override
load properties with an XML node.
eproperty::Value< bool > propertyUseThemeColor
Use the themo color management ("{ewol}THEME:COLOR:Image.json") default false.
Definition: Image.hpp:36
Definition: Input.hpp:12
vec2 m_imageRenderSize
size of the image when we render it
Definition: Image.hpp:59
eproperty::Value< bool > propertyKeepRatio
keep the image ratio between width and hight
Definition: Image.hpp:31
eproperty::Value< std::string > propertySource
file name of the image.
Definition: Image.hpp:28
eproperty::Value< gale::Dimension > propertyImageSize
border to add at the image.
Definition: Image.hpp:30
eproperty::Value< bool > propertySmooth
display is done in the pixed approximation if false
Definition: Image.hpp:35
Definition: Image.hpp:24
Definition: Area.hpp:16
void onRegenerateDisplay() override
Event generated when a redraw is needed.
void onDraw() override
Common widget drawing function (called by the drawing thread [Android, X11, ...]) ...
eproperty::Range< vec2 > propertyPosStart
position in the image to start the sisplay (when we want not to display all the image) ...
Definition: Image.hpp:32
int32_t m_colorId
Color of the image.
Definition: Image.hpp:40
Widget class is the main widget interface, it hase some generic properties: :** known his parent :** ...
Definition: Widget.hpp:73
Definition: Image.hpp:16
eproperty::Value< gale::Dimension > propertyBorder
border to add at the image.
Definition: Image.hpp:29
bool onEventInput(const ewol::event::Input &_event) override
Event on an input of this Widget (finger, mouse, stilet)
void calculateMinMaxSize() override
calculate the minimum and maximum size (need to estimate expend properties of the widget) ...
ememory::SharedPtr< ewol::resource::ColorFile > m_colorProperty
theme color property
Definition: Image.hpp:39
eproperty::Range< vec2 > propertyPosStop
position in the image to start the sisplay (when we want not to display all the image) ...
Definition: Image.hpp:33
ewol::compositing::Image m_compositing
compositing element of the image.
Definition: Image.hpp:38
eproperty::Value< bool > propertyDistanceFieldMode
to have a parameter
Definition: Image.hpp:34