E_TC_Win_Color color)
{
int screen_width = 0, screen_height = 0;
- Evas_Object *bg = NULL;
parent = parent;
if (usr_geom)
elm_win_aux_hint_add(elm_win, "wm.policy.win.user.geometry", "1");
- bg = elm_bg_add(elm_win);
- evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_win_resize_object_add(elm_win, bg);
+ this->bg.obj = elm_bg_add(elm_win);
+ evas_object_size_hint_weight_set(this->bg.obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(elm_win, this->bg.obj);
switch (color)
{
- case E_TC_WIN_COLOR_BLACK: elm_bg_color_set(bg, 0, 0, 0); break;
- case E_TC_WIN_COLOR_WHITE: elm_bg_color_set(bg, 255, 255, 255); break;
- case E_TC_WIN_COLOR_RED: elm_bg_color_set(bg, 255, 0, 0); break;
- case E_TC_WIN_COLOR_GREEN: elm_bg_color_set(bg, 0, 255, 0); break;
- case E_TC_WIN_COLOR_BLUE: elm_bg_color_set(bg, 0, 0, 255); break;
- case E_TC_WIN_COLOR_YELLOW: elm_bg_color_set(bg, 255, 255, 0); break;
- case E_TC_WIN_COLOR_CYAN: elm_bg_color_set(bg, 0, 255, 255); break;
- case E_TC_WIN_COLOR_PURPLE: elm_bg_color_set(bg, 255, 0, 255); break;
- default: elm_bg_color_set(bg, 100, 100, 100); break;
+ 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;
+ default: elm_bg_color_set(this->bg.obj, 100, 100, 100); break;
}
- evas_object_show(bg);
+ evas_object_show(this->bg.obj);
elm_win_screen_size_get(elm_win, NULL, NULL, &screen_width, &screen_height);
eina_stringshare_del(name);
name = NULL;
}
+
+ if (this->bg.timer)
+ {
+ ecore_timer_del(this->bg.timer);
+ this->bg.timer = NULL;
+ }
}
void etWin::move(int x, int y)
elm_win_aux_hint_add(elm_win, "wm.policy.win.user.geometry", "1");
evas_object_resize(elm_win, w, h);
}
+
+static Eina_Bool _cb_timeout(void *data)
+{
+ int r = 0, g = 0, b = 0;
+ etWin *tw = (etWin *)data;
+ if (!tw) return EINA_FALSE;
+
+ elm_bg_color_get(tw->bg.obj, &r, &g, &b);
+ if (r)
+ {
+ r = (r + 10) % 255;
+ if (!r) r = 10;
+ }
+ if (g)
+ {
+ g = (g + 10) % 255;
+ if (!g) g = 10;
+ }
+ if (b)
+ {
+ b = (b + 10) % 255;
+ if (!b) b = 10;
+ }
+ elm_bg_color_set(tw->bg.obj, r, g, b);
+ evas_object_show(tw->bg.obj);
+ return EINA_TRUE;
+}
+
+void etWin::startBGColor(double time)
+{
+ ecore_timer_del(this->bg.timer);
+ this->bg.timer = ecore_timer_add(time,
+ _cb_timeout,
+ this);
+}
+
+void etWin::stopBGColor()
+{
+ ecore_timer_del(this->bg.timer);
+ this->bg.timer = NULL;
+}