Add background widget object
authorJoe Konno <joe.konno@intel.com>
Tue, 19 Jun 2012 18:23:47 +0000 (11:23 -0700)
committerJoe Konno <joe.konno@intel.com>
Tue, 19 Jun 2012 18:23:47 +0000 (11:23 -0700)
Signed-off-by: Joe Konno <joe.konno@intel.com>
src/efl/Makefile.am
src/efl/background.cpp [new file with mode: 0644]
src/efl/background.h [new file with mode: 0644]

index 610d5d5..4efc149 100644 (file)
@@ -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 (file)
index 0000000..34abf79
--- /dev/null
@@ -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 (file)
index 0000000..aa6682c
--- /dev/null
@@ -0,0 +1,24 @@
+#ifndef __WAYLAND_EFL_BACKGROUND_H__
+#define __WAYLAND_EFL_BACKGROUND_H__
+
+#include <string>
+#include <Elementary.h>
+
+#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