From bc339e6b36dc59a0cb3be4af83edb8cd36df6484 Mon Sep 17 00:00:00 2001 From: Joe Konno Date: Tue, 19 Jun 2012 11:23:47 -0700 Subject: [PATCH] Add background widget object Signed-off-by: Joe Konno --- src/efl/Makefile.am | 1 + src/efl/background.cpp | 25 +++++++++++++++++++++++++ src/efl/background.h | 24 ++++++++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 src/efl/background.cpp create mode 100644 src/efl/background.h diff --git a/src/efl/Makefile.am b/src/efl/Makefile.am index 610d5d5..4efc149 100644 --- a/src/efl/Makefile.am +++ b/src/efl/Makefile.am @@ -21,6 +21,7 @@ bin_PROGRAMS = $(TESTS) wayland_efl_test_SOURCES = \ evasobject.cpp \ actionslider.cpp \ + background.cpp \ window.cpp \ application.cpp \ elmtestharness.cpp \ diff --git a/src/efl/background.cpp b/src/efl/background.cpp new file mode 100644 index 0000000..34abf79 --- /dev/null +++ b/src/efl/background.cpp @@ -0,0 +1,25 @@ +#include "background.h" + +Background::Background(Evas_Object *parent) + : EvasObject::EvasObject( + elm_bg_add(parent) + ) + , parent(parent) +{ + return; +} + +void Background::setColor(int red, int green, int blue) +{ + elm_bg_color_set(*this, red, green, blue); +} + +void Background::getColor(int* red, int* green, int* blue) +{ + elm_bg_color_get(*this, red, green, blue); +} + +Background::operator Evas_Object*() +{ + return EvasObject::obj_; +} diff --git a/src/efl/background.h b/src/efl/background.h new file mode 100644 index 0000000..aa6682c --- /dev/null +++ b/src/efl/background.h @@ -0,0 +1,24 @@ +#ifndef __WAYLAND_EFL_BACKGROUND_H__ +#define __WAYLAND_EFL_BACKGROUND_H__ + +#include +#include + +#include "evasobject.h" + +class Background : public EvasObject +{ +public: + Background(Evas_Object *parent); + + void setColor(int, int, int); + + void getColor(int*, int*, int*); + + operator Evas_Object*(); + +private: + Evas_Object *parent; +}; + +#endif -- 2.7.4