From 48f2750dc33d0241fc86f20e5054c98b1652140a Mon Sep 17 00:00:00 2001 From: "Junseok, Kim" Date: Tue, 3 Aug 2021 13:35:43 +0900 Subject: [PATCH] e_test_win: added set color method Change-Id: Ide5bd6d51fb747d5abdbc8dc955d0f58d24e5d3e --- src/e_test_win.cpp | 27 +++++++++++++++++++++++++++ src/e_test_win.h | 2 ++ 2 files changed, 29 insertions(+) diff --git a/src/e_test_win.cpp b/src/e_test_win.cpp index 4b852d4..d1631c3 100644 --- a/src/e_test_win.cpp +++ b/src/e_test_win.cpp @@ -125,6 +125,33 @@ void etWin::resize(int w, int h) evas_object_resize(elm_win, w, h); } +void etWin::setColor(E_TC_Win_Color color) +{ + switch (color) + { + case E_TC_WIN_COLOR_BLACK: elm_bg_color_set(this->bg.obj, 0, 0, 0); break; + case E_TC_WIN_COLOR_WHITE: elm_bg_color_set(this->bg.obj, 255, 255, 255); break; + case E_TC_WIN_COLOR_RED: elm_bg_color_set(this->bg.obj, 255, 0, 0); break; + case E_TC_WIN_COLOR_GREEN: elm_bg_color_set(this->bg.obj, 0, 255, 0); break; + case E_TC_WIN_COLOR_BLUE: elm_bg_color_set(this->bg.obj, 0, 0, 255); break; + case E_TC_WIN_COLOR_YELLOW: elm_bg_color_set(this->bg.obj, 255, 255, 0); break; + case E_TC_WIN_COLOR_CYAN: elm_bg_color_set(this->bg.obj, 0, 255, 255); break; + case E_TC_WIN_COLOR_PURPLE: elm_bg_color_set(this->bg.obj, 255, 0, 255); break; + case E_TC_WIN_COLOR_ORANGE: elm_bg_color_set(this->bg.obj, 255, 165, 0); break; + case E_TC_WIN_COLOR_INDIGO: elm_bg_color_set(this->bg.obj, 75, 0, 130); break; + case E_TC_WIN_COLOR_KHAKI: elm_bg_color_set(this->bg.obj, 240, 230, 140); break; + case E_TC_WIN_COLOR_GRAY: elm_bg_color_set(this->bg.obj, 128, 128, 128); break; + default: elm_bg_color_set(this->bg.obj, 100, 100, 100); break; + } + evas_object_show(this->bg.obj); +} + +void etWin::setColor(int r, int g, int b) +{ + elm_bg_color_set(this->bg.obj, r, g, b); + evas_object_show(this->bg.obj); +} + static Eina_Bool _cb_timeout(void *data) { int r = 0, g = 0, b = 0; diff --git a/src/e_test_win.h b/src/e_test_win.h index cdeccd2..b4de12a 100644 --- a/src/e_test_win.h +++ b/src/e_test_win.h @@ -74,6 +74,8 @@ public: } void move(int x, int y); void resize(int w, int h); + void setColor(E_TC_Win_Color color); + void setColor(int r, int g, int b); void startBGColor(double time); void stopBGColor(); -- 2.7.4