/** * timered scrollbar fade out callback * @val - the Alpha value for the stuff in the session bar * @_data - the pointer to the session bar struct */ static void session_bar_fade_out_cb(int val, void *_data) { Session_Bar *sb = (Session_Bar *) _data; Evas_List *l = NULL; if (val > 0) { int r, g, b, a; Estyle *es; for (l = sb->sessions; l; l = l->next) { es = (Estyle *) l->data; estyle_get_color(es, &r, &g, &b, &a); estyle_set_color(es, r, g, b, val); } evas_object_color_get(sb->listbg, &r, &g, &b, &a); if (a >= val) evas_object_color_set(sb->listbg, r, g, b, val); evas_object_color_get(sb->bullet, &r, &g, &b, &a); evas_object_color_set(sb->bullet, r, g, b, val); val -= 5; ecore_add_event_timer("session_bar_fade", 0.00005, session_bar_fade_out_cb, val, _data); } else { evas_object_hide(sb->listbg); evas_object_hide(sb->bullet); for (l = sb->sessions; l; l = l->next) estyle_hide((Estyle *) l->data); } }
END_TEST START_TEST(edje_test_simple_layout_geometry) { int x, y, w, h; int r, g, b, a; Evas *evas = EDJE_TEST_INIT_EVAS(); Evas_Object *obj, *bg; obj = edje_object_add(evas); fail_unless(edje_object_file_set(obj, test_layout_get("test_layout.edj"), "test_group")); /* rel1.relative: 0.0 0.0; * rel2.relative: 1.0 1.0; */ evas_object_resize(obj, 1000, 1000); edje_object_part_geometry_get(obj, "background", &x, &y, &w, &h); fail_if(x != 0 || y != 0); fail_if(w != 1000 || h != 1000); bg = edje_object_part_object_get(obj, "background"); fail_if(!bg); evas_object_color_get(bg, &r, &g, &b, &a); fail_if(r != 255 || g != 255 || b != 255 || a != 255); EDJE_TEST_FREE_EVAS(); }
EAPI void emotion_object_bg_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a) { Smart_Data *sd; E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); evas_object_color_get(sd->bg, r, g, b, a); }
Color Object::getColor() const { int r; int g; int b; int a; evas_object_color_get( o, &r, &g, &b, &a ); return Color( r, g, b, a ); }
Widget::Widget(Evas_Object *obj) : _obj(obj), _initColor(), _conform(NULL) { evas_object_color_get(_obj, &_initColor.red, &_initColor.green, &_initColor.blue, &_initColor.alpha); }
static void cb_related_color_select(void *data, Evas *e, Evas_Object *obj, void *event_info) { Evas_Event_Mouse_Up *ev; Elicit *el; int r, g, b; el = data; ev = event_info; evas_object_color_get(obj, &r, &g, &b, NULL); color_rgba_set(el->color, r, g, b, 255); }
/** * timered scroolbar fade in callback * @val - the Alpha value for the stuff in the session bar * @_data - the pointer to the session bar struct */ static void session_bar_fade_in_cb(int val, void *_data) { Session_Bar *sb = (Session_Bar *) _data; Evas_List *l = NULL; if (val < 255) { int r, g, b, a; Estyle *es; for (l = sb->sessions; l; l = l->next) { es = (Estyle *) l->data; estyle_get_color(es, &r, &g, &b, &a); estyle_set_color(es, r, g, b, val); if (!val) estyle_show(es); } if (val < 100) { evas_object_color_get(sb->listbg, &r, &g, &b, &a); evas_object_color_set(sb->listbg, r, g, b, val); } evas_object_color_get(sb->bullet, &r, &g, &b, &a); evas_object_color_set(sb->bullet, r, g, b, val); if (!val) { evas_object_show(sb->listbg); evas_object_show(sb->bullet); } val += 5; ecore_add_event_timer("session_bar_fade", 0.00005, session_bar_fade_in_cb, val, _data); } }
Widget::Widget(const char *filename,const char *groupe, int x, int y, int width, int heigh, bool isElementary) : _obj(NULL), _initColor(), _conform(NULL) { if(isElementary){ init_widget_elm_edje_file(this,filename,groupe,x,y,width,heigh); } else{ init_widget_edje_file(this,filename,groupe,x,y,width,heigh); } evas_object_color_get(_obj, &_initColor.red, &_initColor.green, &_initColor.blue, &_initColor.alpha); }
static void _default_layout(Container *cont) { Eina_List *l; double ax, ay, aw, ah; // element area geom double ix, iy, iw, ih; // new x, y, w, h double L; // length of all objects at original size (for nonhomog) int num; // number of elements double error = 0; int r,g,b; /* FIXME: add a 'changed' flag to prevent excessive recalcs */ // evas_object_geometry_get(cont->grabber, &ax, &ay, &aw, &ah); ax = cont->x; ay = cont->y; aw = cont->w; ah = cont->h; /* adjust for padding */ ax += cont->padding.l; ay += cont->padding.t; aw -= cont->padding.l + cont->padding.r; ah -= cont->padding.t + cont->padding.b; if (aw == 0 || ah == 0) return; ix = ax; iy = ay; if (cont->direction) iy += cont->scroll.offset; else ix += cont->scroll.offset; L = esmart_container_elements_orig_length_get(cont->obj); num = eina_list_count(cont->elements); evas_object_color_get(cont->clipper, &r, &g, &b, NULL); for (l = cont->elements; l; l = l->next) { Container_Element *el = l->data; Evas_Coord ew, eh; // old element size if(!el) { continue; } evas_object_geometry_get(el->obj, NULL, NULL, &ew, &eh); if (ew == 0) ew = el->orig_w; if (eh == 0) eh = el->orig_h; evas_object_resize(el->grabber, ew, eh); /* vertical */ if (cont->direction) { if (cont->fill & CONTAINER_FILL_POLICY_FILL) { iw = aw; if (cont->fill & CONTAINER_FILL_POLICY_HOMOGENOUS) ih = (ah - cont->spacing * (num - 1) ) / num; else ih = el->orig_h * (ah - cont->spacing * (num - 1) ) / L; } else if (cont->fill & CONTAINER_FILL_POLICY_FILL_X) { if (cont->fill & CONTAINER_FILL_POLICY_KEEP_ASPECT) { iw = aw; ih = eh * iw/ew; } else { iw = aw; ih = eh; } } else if (cont->fill & CONTAINER_FILL_POLICY_FILL_Y) { if (cont->fill & CONTAINER_FILL_POLICY_HOMOGENOUS) ih = (ah - cont->spacing * (num - 1) ) / num; else ih = el->orig_h * (ah - cont->spacing * (num - 1) ) / L; if (cont->fill & CONTAINER_FILL_POLICY_KEEP_ASPECT) iw = ew * ih/eh; else iw = ew; } else { iw = ew; ih = eh; } if (cont->align == CONTAINER_ALIGN_LEFT) ix = ax; else if (cont->align == CONTAINER_ALIGN_CENTER) ix = ax + (aw - iw) / 2; else if (cont->align == CONTAINER_ALIGN_RIGHT) ix = ax + aw - iw; evas_object_move(el->obj, ix, iy); evas_object_resize(el->obj, iw, ih); if (!strcmp(evas_object_type_get(el->obj), "image")) { evas_object_image_fill_set(el->obj, 0, 0, iw, ih); } evas_object_move(el->grabber, ix, iy); evas_object_resize(el->grabber, iw, ih); iy += ih + cont->spacing; } /* horizontal */ else { if (cont->fill & CONTAINER_FILL_POLICY_FILL) { ih = ah; if (cont->fill & CONTAINER_FILL_POLICY_HOMOGENOUS) iw = (aw - cont->spacing * (num - 1) ) / num; else { iw = el->orig_w * (aw - cont->spacing * (num - 1) ) / L; } } else if (cont->fill & CONTAINER_FILL_POLICY_FILL_X) { if (cont->fill & CONTAINER_FILL_POLICY_HOMOGENOUS) { iw = (aw - cont->spacing * (num - 1) ) / num; } else { iw = el->orig_w * (aw - cont->spacing * (num - 1) ) / L; } if (cont->fill & CONTAINER_FILL_POLICY_KEEP_ASPECT) ih = eh * iw/ew; else ih = eh; } else if (cont->fill & CONTAINER_FILL_POLICY_FILL_Y) { if (cont->fill & CONTAINER_FILL_POLICY_KEEP_ASPECT) { ih = ah; iw = ew * ih/eh; } else { ih = ah; iw = ew; } } else { iw = ew; ih = eh; } if (cont->align == CONTAINER_ALIGN_TOP) iy = ay; else if (cont->align == CONTAINER_ALIGN_CENTER) iy = ay + (ah - ih) / 2; else if (cont->align == CONTAINER_ALIGN_BOTTOM) iy = ay + ah - ih; /* make sure that the elements fill the container exactly */ if (error >= 1) { iw++; error -= 1; } else if (error <= -1) { iw--; error += 1; } error += iw - (int)iw; iw = (int)iw; evas_object_move(el->obj, ix, iy); evas_object_resize(el->obj, iw, ih); if (!strcmp(evas_object_type_get(el->obj), "image")) { evas_object_image_fill_set(el->obj, 0, 0, iw, ih); } evas_object_move(el->grabber, ix, iy); evas_object_resize(el->grabber, iw, ih); ix += iw + cont->spacing; } evas_object_geometry_get(el->obj, NULL, NULL, &ew, &eh); evas_object_resize(el->grabber, ew, eh); } }