From: Joe Konno Date: Wed, 20 Jun 2012 17:59:31 +0000 (-0700) Subject: background: wrap image setting X-Git-Tag: upstream/0.2.1~323 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=90285dd54599b5b12a749726efb9292a7510b605;p=test%2Fgeneric%2Fwayland-fits.git background: wrap image setting Signed-off-by: Joe Konno --- diff --git a/src/efl/Makefile.am b/src/efl/Makefile.am index b3c3a75..48c3320 100644 --- a/src/efl/Makefile.am +++ b/src/efl/Makefile.am @@ -4,16 +4,21 @@ if BUILD_EFL_TESTS TESTS = wayland-efl-test TESTS_ENVIRONMENT = $(SHELL) ../test-harness +MEDIA = \"$(PWD)/../../media\" + CXXFLAGS += \ -std=gnu++0x \ $(CAIRO_CFLAGS) \ $(WAYLAND_CFLAGS) \ + -DMEDIA_PATH=$(MEDIA) \ @EFL_CFLAGS@ LDFLAGS += \ $(CAIRO_LIBS) \ $(WAYLAND_LIBS) \ @EFL_LIBS@ \ + -lboost_system \ + -lboost_filesystem \ -lboost_unit_test_framework bin_PROGRAMS = $(TESTS) @@ -29,7 +34,6 @@ wayland_efl_test_SOURCES = \ test_window.cpp \ test_engine_set.cpp \ test_actionslider.cpp \ - test_background.cpp \ ../testmain.cpp endif diff --git a/src/efl/background.cpp b/src/efl/background.cpp index 34abf79..471445c 100644 --- a/src/efl/background.cpp +++ b/src/efl/background.cpp @@ -14,11 +14,25 @@ void Background::setColor(int red, int green, int blue) elm_bg_color_set(*this, red, green, blue); } +void Background::setImage(const path& p) +{ + (void) elm_bg_file_set(*this, p.c_str(), NULL); +} + void Background::getColor(int* red, int* green, int* blue) { elm_bg_color_get(*this, red, green, blue); } +void Background::getImage(path& p) +{ + char* ret = NULL; + + elm_bg_file_get(*this, const_cast(&ret), NULL); + + p = ret; +} + Background::operator Evas_Object*() { return EvasObject::obj_; diff --git a/src/efl/background.h b/src/efl/background.h index aa6682c..d9c4c03 100644 --- a/src/efl/background.h +++ b/src/efl/background.h @@ -1,19 +1,27 @@ #ifndef __WAYLAND_EFL_BACKGROUND_H__ #define __WAYLAND_EFL_BACKGROUND_H__ -#include -#include +#ifndef MEDIA_PATH +#error "The MEDIA_PATH macro must be defined-- pass definition in CXXFLAGS." +#endif +#define BOOST_FILESYSTEM_VERSION 3 +#include +#include #include "evasobject.h" +using boost::filesystem::path; + class Background : public EvasObject { public: Background(Evas_Object *parent); void setColor(int, int, int); + void setImage(const path&); void getColor(int*, int*, int*); + void getImage(path&); operator Evas_Object*();