1 #include <Elementary.h>
4 #define BASE_STEP 360.0
10 typedef enum _Color_Type
18 typedef struct _Colorselector_Data Colorselector_Data;
19 struct _Colorselector_Data
22 Evas_Object *colorbar;
28 Evas_Object *touch_area;
29 Color_Type color_type;
32 typedef struct _Widget_Data Widget_Data;
36 Colorselector_Data *cp[4];
37 Evas_Coord _x, _y, _w, _h;
45 static const char *widtype = NULL;
47 static void _del_hook(Evas_Object *obj);
48 static void _theme_hook(Evas_Object *obj);
49 static void _sizing_eval(Evas_Object *obj);
50 static void _rgb_to_hsl(void *data);
51 static void _hsl_to_rgb(void *data);
52 static void _color_with_saturation(void *data);
53 static void _color_with_lightness(void *data);
54 static void _draw_rects(void *data, double x);
56 static void _arrow_cb(void *data, Evas_Object *obj, const char *emission, const char *source);
57 static void _colorbar_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
58 static void _left_button_clicked_cb(void *data, Evas_Object * obj, void *event_info);
59 static void _left_button_repeat_cb(void *data, Evas_Object * obj, void *event_info);
60 static void _right_button_clicked_cb(void *data, Evas_Object * obj, void *event_info);
61 static void _right_button_repeat_cb(void *data, Evas_Object * obj, void *event_info);
63 static void _arrow_cb(void *data, Evas_Object *obj, const char *emission,
65 static void _colorbar_cb(void *data, Evas *e, Evas_Object *obj,
67 static void _left_button_clicked_cb(void *data, Evas_Object * obj,
69 static void _left_button_repeat_cb(void *data, Evas_Object * obj,
71 static void _right_button_clicked_cb(void *data, Evas_Object * obj,
73 static void _right_button_repeat_cb(void *data, Evas_Object * obj,
75 >>>>>>> remotes/origin/upstream
76 static void _add_colorbar(Evas_Object *obj);
77 static void _set_color(Evas_Object *obj, int r, int g, int b, int a);
79 static const char SIG_CHANGED[] = "changed";
81 static const Evas_Smart_Cb_Description _signals[] =
88 _del_hook(Evas_Object *obj)
90 Widget_Data *wd = elm_widget_data_get(obj);
94 for (i = 0; i < 4; i++) free(wd->cp[i]);
99 _theme_hook(Evas_Object *obj)
101 Widget_Data *wd = elm_widget_data_get(obj);
104 if ((!wd) || (!wd->base)) return;
106 _elm_theme_object_set(obj, wd->base, "colorselector", "bg",
107 elm_widget_style_get(obj));
109 for (i = 0; i < 4; i++)
111 evas_object_del(wd->cp[i]->colorbar);
112 wd->cp[i]->colorbar = NULL;
113 evas_object_del(wd->cp[i]->bar);
114 wd->cp[i]->bar = NULL;
115 evas_object_del(wd->cp[i]->lbt);
116 wd->cp[i]->lbt = NULL;
117 evas_object_del(wd->cp[i]->rbt);
118 wd->cp[i]->rbt = NULL;
121 evas_object_del(wd->cp[i]->bg_rect);
122 wd->cp[i]->bg_rect = NULL;
124 evas_object_del(wd->cp[i]->arrow);
125 wd->cp[i]->arrow = NULL;
126 evas_object_del(wd->cp[i]->touch_area);
127 wd->cp[i]->touch_area = NULL;
131 elm_colorselector_color_set(obj, wd->r, wd->g, wd->b, wd->a);
136 _colorselector_set_size_hints(Evas_Object *obj, int timesw, int timesh)
138 Evas_Coord minw = -1, minh = -1;
140 elm_coords_finger_size_adjust(timesw, &minw, timesh, &minh);
141 edje_object_size_min_restricted_calc(obj, &minw, &minh,
143 evas_object_size_hint_min_set(obj, minw, minh);
144 evas_object_size_hint_max_set(obj, -1, -1);
148 _sizing_eval(Evas_Object *obj)
150 Widget_Data *wd = elm_widget_data_get(obj);
151 Evas_Coord minw = -1, minh = -1;
155 elm_coords_finger_size_adjust(1, &minw, 1, &minh);
156 for (i = 0; i < 4; i++)
158 if (wd->cp[i]->bg_rect)
159 _colorselector_set_size_hints(wd->cp[i]->bg_rect, 1, 1);
160 _colorselector_set_size_hints(wd->cp[i]->bar, 1, 1);
161 _colorselector_set_size_hints(wd->cp[i]->rbt, 1, 1);
162 _colorselector_set_size_hints(wd->cp[i]->lbt, 1, 1);
164 _colorselector_set_size_hints(wd->cp[i]->colorbar, 4, 1);
167 elm_coords_finger_size_adjust(4, &minw, 4, &minh);
168 edje_object_size_min_restricted_calc(wd->base, &minw, &minh, minw, minh);
169 evas_object_size_hint_min_set(obj, minw, minh);
170 evas_object_size_hint_max_set(obj, -1, -1);
174 _rgb_to_hsl(void *data)
176 Widget_Data *wd = data;
199 wd->l = (m + v) / 2.0;
201 if (wd->l <= 0.0) return;
206 if (wd->s > 0.0) wd->s /= (wd->l <= 0.5) ? (v + m) : (2.0 - v - m);
213 if (r == v) wd->h = (g == m ? 5.0 + b2 : 1.0 - g2);
214 else if (g == v) wd->h = (b == m ? 1.0 + r2 : 3.0 - b2);
215 else wd->h = (r == m ? 3.0 + g2 : 5.0 - r2);
221 _hsl_to_rgb(void *data)
223 Widget_Data *wd = data;
224 double r = 0, g = 0, b = 0;
227 double sv, vsf, f, p, q, t, v;
233 if (_s == 0.0) r = g = b = _l;
236 if (_h == 360.0) _h = 0.0;
239 v = (_l <= 0.5) ? (_l * (1.0 + _s)) : (_l + _s - (_l * _s));
242 if (v) sv = (v - p) / v;
287 i = (int)(r * 255.0);
289 wd->r = (f <= 0.5) ? i : (i + 1);
291 i = (int)(g * 255.0);
293 wd->g = (f <= 0.5) ? i : (i + 1);
295 i = (int)(b * 255.0);
297 wd->b = (f <= 0.5) ? i : (i + 1);
301 _color_with_saturation(void *data)
303 Widget_Data *wd = data;
306 wd->sr = 127 + (int)((double)(wd->er - 127) * wd->s);
308 wd->sr = 127 - (int)((double)(127 - wd->er) * wd->s);
311 wd->sg = 127 + (int)((double)(wd->eg - 127) * wd->s);
313 wd->sg = 127 - (int)((double)(127 - wd->eg) * wd->s);
316 wd->sb = 127 + (int)((double)(wd->eb - 127) * wd->s);
318 wd->sb = 127 - (int)((double)(127 - wd->eb) * wd->s);
322 _color_with_lightness(void *data)
324 Widget_Data *wd = data;
328 wd->lr = wd->er + (int)((double)(255 - wd->er) * (wd->l - 0.5) * 2.0);
329 wd->lg = wd->eg + (int)((double)(255 - wd->eg) * (wd->l - 0.5) * 2.0);
330 wd->lb = wd->eb + (int)((double)(255 - wd->eb) * (wd->l - 0.5) * 2.0);
332 else if (wd->l < 0.5)
334 wd->lr = (double)wd->er * wd->l * 2.0;
335 wd->lg = (double)wd->eg * wd->l * 2.0;
336 wd->lb = (double)wd->eb * wd->l * 2.0;
347 _draw_rects(void *data, double x)
349 Colorselector_Data *cp = data;
350 Widget_Data *wd = elm_widget_data_get(cp->parent);
351 double one_six = 1.0 / 6.0;
353 switch (cp->color_type)
361 wd->eg = (255.0 * x * 6.0);
364 else if (x < 2 * one_six)
366 wd->er = 255 - (int)(255.0 * (x - one_six) * 6.0);
370 else if (x < 3 * one_six)
374 wd->eb = (int)(255.0 * (x - (2.0 * one_six)) * 6.0);
376 else if (x < 4 * one_six)
379 wd->eg = 255 - (int)(255.0 * (x - (3.0 * one_six)) * 6.0);
382 else if (x < 5 * one_six)
384 wd->er = 255.0 * (x - (4.0 * one_six)) * 6.0;
392 wd->eb = 255 - (int)(255.0 * (x - (5.0 * one_six)) * 6.0);
395 evas_object_color_set(wd->cp[0]->arrow, wd->er, wd->eg, wd->eb, 255);
396 evas_object_color_set(wd->cp[1]->bg_rect, wd->er, wd->eg, wd->eb, 255);
397 evas_object_color_set(wd->cp[2]->bg_rect, wd->er, wd->eg, wd->eb, 255);
398 evas_object_color_set(wd->cp[3]->bar, wd->er, wd->eg, wd->eb, 255);
400 _color_with_saturation(wd);
401 evas_object_color_set(wd->cp[1]->arrow, wd->sr, wd->sg, wd->sb, 255);
403 _color_with_lightness(wd);
404 evas_object_color_set(wd->cp[2]->arrow, wd->lr, wd->lg, wd->lb, 255);
406 evas_object_color_set(wd->cp[3]->arrow,
407 (wd->er * wd->a) / 255,
408 (wd->eg * wd->a) / 255,
409 (wd->eb * wd->a) / 255,
414 _color_with_saturation(wd);
415 evas_object_color_set(wd->cp[1]->arrow, wd->sr, wd->sg, wd->sb, 255);
419 _color_with_lightness(wd);
420 evas_object_color_set(wd->cp[2]->arrow, wd->lr, wd->lg, wd->lb, 255);
424 evas_object_color_set(wd->cp[3]->arrow,
425 (wd->er * wd->a) / 255,
426 (wd->eg * wd->a) / 255,
427 (wd->eb * wd->a) / 255,
438 _arrow_cb(void *data, Evas_Object *obj, const char *emission __UNUSED__, const char *source __UNUSED__)
440 _arrow_cb(void *data, Evas_Object *obj, const char *emission __UNUSED__,
441 const char *source __UNUSED__)
442 >>>>>>> remotes/origin/upstream
444 Colorselector_Data *cp = data;
447 edje_object_part_drag_value_get(obj, "elm.arrow", &x, &y);
448 _draw_rects(data, x);
449 evas_object_smart_callback_call(cp->parent, SIG_CHANGED, NULL);
453 _colorbar_cb(void *data, Evas *e, Evas_Object *obj __UNUSED__, void *event_info)
455 Colorselector_Data *cp = data;
456 Evas_Event_Mouse_Down *ev = event_info;
457 Evas_Coord x, y, w, h;
458 double arrow_x = 0, arrow_y;
460 evas_object_geometry_get(cp->bar, &x, &y, &w, &h);
461 edje_object_part_drag_value_get(cp->colorbar, "elm.arrow",
463 if (w > 0) arrow_x = (double)(ev->canvas.x - x) / (double)w;
464 if (arrow_x > 1) arrow_x = 1;
465 if (arrow_x < 0) arrow_x = 0;
466 edje_object_part_drag_value_set(cp->colorbar, "elm.arrow", arrow_x, arrow_y);
467 _draw_rects(data, arrow_x);
468 evas_object_smart_callback_call(cp->parent, SIG_CHANGED, NULL);
469 evas_event_feed_mouse_cancel(e, 0, NULL);
470 evas_event_feed_mouse_down(e, 1, EVAS_BUTTON_NONE, 0, NULL);
475 _left_button_clicked_cb(void *data, Evas_Object * obj __UNUSED__, void *event_info __UNUSED__)
477 _left_button_clicked_cb(void *data, Evas_Object * obj __UNUSED__,
478 void *event_info __UNUSED__)
479 >>>>>>> remotes/origin/upstream
481 Colorselector_Data *cp = data;
484 edje_object_signal_emit(cp->lbt, "elm,state,left,button,down",
486 edje_object_part_drag_value_get(cp->colorbar, "elm.arrow", &x, &y);
488 switch(cp->color_type)
506 if (x < 0.0) x = 0.0;
508 edje_object_part_drag_value_set(cp->colorbar, "elm.arrow", x, y);
509 _draw_rects(data, x);
510 evas_object_smart_callback_call(cp->parent, SIG_CHANGED, NULL);
515 _left_button_repeat_cb(void *data, Evas_Object * obj __UNUSED__, void *event_info __UNUSED__)
517 _left_button_repeat_cb(void *data, Evas_Object * obj __UNUSED__,
518 void *event_info __UNUSED__)
519 >>>>>>> remotes/origin/upstream
521 Colorselector_Data *cp = data;
524 edje_object_part_drag_value_get(cp->colorbar, "elm.arrow", &x, &y);
525 x -= 1.0 / BASE_STEP;
526 if (x < 0.0) x = 0.0;
527 edje_object_part_drag_value_set(cp->colorbar, "elm.arrow", x, y);
528 _draw_rects(data, x);
529 evas_object_smart_callback_call(cp->parent, SIG_CHANGED, NULL);
535 _right_button_clicked_cb(void *data, Evas_Object * obj __UNUSED__, void *event_info __UNUSED__)
537 _right_button_clicked_cb(void *data, Evas_Object * obj __UNUSED__,
538 void *event_info __UNUSED__)
539 >>>>>>> remotes/origin/upstream
541 Colorselector_Data *cp = data;
544 edje_object_signal_emit(cp->rbt, "elm,state,right,button,down",
546 edje_object_part_drag_value_get(cp->colorbar, "elm.arrow", &x, &y);
548 switch(cp->color_type)
566 if (x > 1.0) x = 1.0;
568 edje_object_part_drag_value_set(cp->colorbar, "elm.arrow", x, y);
569 _draw_rects(data, x);
570 evas_object_smart_callback_call(cp->parent, SIG_CHANGED, NULL);
575 _right_button_repeat_cb(void *data, Evas_Object * obj __UNUSED__, void *event_info __UNUSED__)
577 _right_button_repeat_cb(void *data, Evas_Object * obj __UNUSED__,
578 void *event_info __UNUSED__)
579 >>>>>>> remotes/origin/upstream
581 Colorselector_Data *cp = data;
584 edje_object_part_drag_value_get(cp->colorbar, "elm.arrow", &x, &y);
585 x += 1.0 / BASE_STEP;
586 if (x > 1.0) x = 1.0;
587 edje_object_part_drag_value_set(cp->colorbar, "elm.arrow", x, y);
588 _draw_rects(data, x);
589 evas_object_smart_callback_call(cp->parent, SIG_CHANGED, NULL);
593 _add_colorbar(Evas_Object *obj)
595 char colorbar_name[128];
596 char colorbar_s[128];
602 wd = elm_widget_data_get(obj);
605 e = evas_object_evas_get(obj);
607 for (i = 0; i < 4; i++)
609 wd->cp[i] = ELM_NEW(Colorselector_Data);
610 wd->cp[i]->parent = obj;
614 wd->cp[i]->color_type = HUE;
617 wd->cp[i]->color_type = SATURATION;
620 wd->cp[i]->color_type = LIGHTNESS;
623 wd->cp[i]->color_type = ALPHA;
628 /* load colorbar area */
629 wd->cp[i]->colorbar = edje_object_add(e);
630 _elm_theme_object_set(obj, wd->cp[i]->colorbar, "colorselector", "base",
631 elm_widget_style_get(obj));
632 snprintf(colorbar_name, sizeof(colorbar_name), "colorbar_%d", i);
633 snprintf(colorbar_s, sizeof(colorbar_s), "elm.colorbar_%d", i);
634 edje_object_signal_callback_add(wd->cp[i]->colorbar, "drag", "*",
635 _arrow_cb, wd->cp[i]);
636 edje_object_part_swallow(wd->base, colorbar_s, wd->cp[i]->colorbar);
637 elm_widget_sub_object_add(obj, wd->cp[i]->colorbar);
639 /* load colorbar image */
640 wd->cp[i]->bar = edje_object_add(e);
642 snprintf(buf, sizeof(buf), "%s/%s", colorbar_name, elm_widget_style_get(obj));
644 snprintf(buf, sizeof(buf), "%s/%s", colorbar_name,
645 elm_widget_style_get(obj));
646 >>>>>>> remotes/origin/upstream
647 _elm_theme_object_set(obj, wd->cp[i]->bar, "colorselector", "image",
649 edje_object_part_swallow(wd->cp[i]->colorbar, "elm.bar",
651 elm_widget_sub_object_add(obj, wd->cp[i]->bar);
653 /* provide expanded touch area */
654 wd->cp[i]->touch_area = evas_object_rectangle_add(e);
655 evas_object_color_set(wd->cp[i]->touch_area, 0, 0, 0, 0);
656 edje_object_part_swallow(wd->cp[i]->colorbar, "elm.arrow_bg",
657 wd->cp[i]->touch_area);
658 evas_object_event_callback_add(wd->cp[i]->touch_area,
659 EVAS_CALLBACK_MOUSE_DOWN, _colorbar_cb,
661 elm_widget_sub_object_add(obj, wd->cp[i]->touch_area);
663 /* load background rectangle of the colorbar. used for
664 changing color of the opacity bar */
665 if ((i == 1) || (i == 2))
667 wd->cp[i]->bg_rect = evas_object_rectangle_add(e);
668 evas_object_color_set(wd->cp[i]->bg_rect, wd->er, wd->eg, wd->eb,
670 edje_object_part_swallow(wd->cp[i]->colorbar, "elm.bar_bg",
673 elm_widget_sub_object_add(obj, wd->cp[i]->bg_rect);
677 wd->cp[i]->bg_rect = edje_object_add(e);
679 snprintf(buf, sizeof(buf), "%s/%s", colorbar_name, elm_widget_style_get(obj));
681 snprintf(buf, sizeof(buf), "%s/%s", colorbar_name,
682 elm_widget_style_get(obj));
683 >>>>>>> remotes/origin/upstream
684 _elm_theme_object_set(obj, wd->cp[i]->bg_rect, "colorselector",
686 edje_object_part_swallow(wd->cp[i]->colorbar, "elm.bar_bg",
688 elm_widget_sub_object_add(obj, wd->cp[i]->bg_rect);
689 evas_object_color_set(wd->cp[i]->bar, wd->er, wd->eg, wd->eb, 255);
691 /* load arrow image, pointing the colorbar */
692 wd->cp[i]->arrow = edje_object_add(e);
693 _elm_theme_object_set(obj, wd->cp[i]->arrow, "colorselector", "arrow",
694 elm_widget_style_get(obj));
695 edje_object_part_swallow(wd->cp[i]->colorbar, "elm.arrow_icon",
697 elm_widget_sub_object_add(obj, wd->cp[i]->arrow);
699 evas_object_color_set(wd->cp[i]->arrow, 0, 0, 0, 255);
701 evas_object_color_set(wd->cp[i]->arrow, wd->er, wd->eg, wd->eb, 255);
703 /* load left button */
704 wd->cp[i]->lbt = elm_button_add(obj);
706 snprintf(buf, sizeof(buf), "colorselector/left/%s", elm_widget_style_get(obj));
708 snprintf(buf, sizeof(buf), "colorselector/left/%s",
709 elm_widget_style_get(obj));
710 >>>>>>> remotes/origin/upstream
711 elm_object_style_set(wd->cp[i]->lbt, buf);
712 elm_widget_sub_object_add(obj, wd->cp[i]->lbt);
713 edje_object_part_swallow(wd->cp[i]->colorbar, "elm.l_button",
716 evas_object_smart_callback_add(wd->cp[i]->lbt, "clicked", _left_button_clicked_cb, wd->cp[i]);
717 elm_button_autorepeat_set(wd->cp[i]->lbt, EINA_TRUE);
718 elm_button_autorepeat_initial_timeout_set(wd->cp[i]->lbt, _elm_config->longpress_timeout);
719 elm_button_autorepeat_gap_timeout_set(wd->cp[i]->lbt, (1.0 / _elm_config->fps));
720 evas_object_smart_callback_add(wd->cp[i]->lbt, "repeated",_left_button_repeat_cb, wd->cp[i]);
722 /* load right button */
723 wd->cp[i]->rbt = elm_button_add(obj);
724 snprintf(buf, sizeof(buf), "colorselector/right/%s", elm_widget_style_get(obj));
726 evas_object_smart_callback_add(wd->cp[i]->lbt, "clicked",
727 _left_button_clicked_cb, wd->cp[i]);
728 elm_button_autorepeat_set(wd->cp[i]->lbt, EINA_TRUE);
729 elm_button_autorepeat_initial_timeout_set(wd->cp[i]->lbt,
730 _elm_config->longpress_timeout);
731 elm_button_autorepeat_gap_timeout_set(wd->cp[i]->lbt,
732 (1.0 / _elm_config->fps));
733 evas_object_smart_callback_add(wd->cp[i]->lbt, "repeated",
734 _left_button_repeat_cb, wd->cp[i]);
736 /* load right button */
737 wd->cp[i]->rbt = elm_button_add(obj);
738 snprintf(buf, sizeof(buf), "colorselector/right/%s",
739 elm_widget_style_get(obj));
740 >>>>>>> remotes/origin/upstream
741 elm_object_style_set(wd->cp[i]->rbt, buf);
742 elm_widget_sub_object_add(obj, wd->cp[i]->rbt);
743 edje_object_part_swallow(wd->cp[i]->colorbar, "elm.r_button",
746 evas_object_smart_callback_add(wd->cp[i]->rbt, "clicked", _right_button_clicked_cb, wd->cp[i]);
747 elm_button_autorepeat_set(wd->cp[i]->rbt, EINA_TRUE);
748 elm_button_autorepeat_initial_timeout_set(wd->cp[i]->rbt, _elm_config->longpress_timeout);
749 elm_button_autorepeat_gap_timeout_set(wd->cp[i]->rbt, (1.0 / _elm_config->fps));
750 evas_object_smart_callback_add(wd->cp[i]->rbt, "repeated",_right_button_repeat_cb, wd->cp[i]);
752 evas_object_smart_callback_add(wd->cp[i]->rbt, "clicked",
753 _right_button_clicked_cb, wd->cp[i]);
754 elm_button_autorepeat_set(wd->cp[i]->rbt, EINA_TRUE);
755 elm_button_autorepeat_initial_timeout_set(wd->cp[i]->rbt,
756 _elm_config->longpress_timeout);
757 elm_button_autorepeat_gap_timeout_set(wd->cp[i]->rbt,
758 (1.0 / _elm_config->fps));
759 evas_object_smart_callback_add(wd->cp[i]->rbt, "repeated",
760 _right_button_repeat_cb, wd->cp[i]);
761 >>>>>>> remotes/origin/upstream
766 _set_color(Evas_Object *obj, int r, int g, int b, int a)
768 Widget_Data *wd = elm_widget_data_get(obj);
778 edje_object_part_drag_value_get(wd->cp[0]->colorbar, "elm.arrow", &x, &y);
780 edje_object_part_drag_value_set(wd->cp[0]->colorbar, "elm.arrow", x, y);
781 _draw_rects(wd->cp[0], x);
783 edje_object_part_drag_value_get(wd->cp[1]->colorbar, "elm.arrow", &x, &y);
785 edje_object_part_drag_value_set(wd->cp[1]->colorbar, "elm.arrow", x, y);
786 _draw_rects(wd->cp[1], x);
788 edje_object_part_drag_value_get(wd->cp[2]->colorbar, "elm.arrow", &x, &y);
790 edje_object_part_drag_value_set(wd->cp[2]->colorbar, "elm.arrow", x, y);
791 _draw_rects(wd->cp[2], x);
793 edje_object_part_drag_value_get(wd->cp[3]->colorbar, "elm.arrow", &x, &y);
795 edje_object_part_drag_value_set(wd->cp[3]->colorbar, "elm.arrow", x, y);
796 _draw_rects(wd->cp[3], x);
800 elm_colorselector_add(Evas_Object *parent)
802 Evas_Object *obj = NULL;
803 Widget_Data *wd = NULL;
806 ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
808 ELM_SET_WIDTYPE(widtype, "colorselector");
809 elm_widget_type_set(obj, "colorselector");
810 elm_widget_sub_object_add(parent, obj);
811 elm_widget_data_set(obj, wd);
812 elm_widget_del_hook_set(obj, _del_hook);
813 elm_widget_theme_hook_set(obj, _theme_hook);
815 /* load background edj */
816 wd->base = edje_object_add(e);
817 _elm_theme_object_set(obj, wd->base, "colorselector", "bg", "default");
818 elm_widget_resize_object_set(obj, wd->base);
832 evas_object_smart_callbacks_descriptions_set(obj, _signals);
837 elm_colorselector_color_set(Evas_Object *obj, int r, int g, int b, int a)
839 ELM_CHECK_WIDTYPE(obj, widtype);
840 _set_color(obj, r, g, b, a);
845 elm_colorselector_color_get(const Evas_Object *obj, int *r, int *g, int *b, int*a)
847 elm_colorselector_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a)
848 >>>>>>> remotes/origin/upstream
850 Widget_Data *wd = elm_widget_data_get(obj);
851 ELM_CHECK_WIDTYPE(obj, widtype);
862 elm_colorselector_mode_set(Evas_Object *obj, Elm_Colorselector_Mode mode __UNUSED__)
864 ELM_CHECK_WIDTYPE(obj, widtype);
868 EAPI Elm_Colorselector_Mode
869 elm_colorselector_mode_get(const Evas_Object *obj)
871 ELM_CHECK_WIDTYPE(obj, widtype) ELM_COLORSELECTOR_PALETTE;
873 return ELM_COLORSELECTOR_PALETTE;
877 elm_colorselector_palette_item_color_get(const Elm_Object_Item *it, int *r __UNUSED__, int *g __UNUSED__, int *b __UNUSED__, int*a __UNUSED__)
879 ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
884 elm_colorselector_palette_item_color_set(Elm_Object_Item *it, int r __UNUSED__, int g __UNUSED__, int b __UNUSED__, int a __UNUSED__)
886 ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
890 EAPI Elm_Object_Item *
891 elm_colorselector_palette_color_add(Evas_Object *obj, int r __UNUSED__, int g __UNUSED__, int b __UNUSED__, int a __UNUSED__)
893 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
899 elm_colorselector_palette_clear(Evas_Object *obj)
901 ELM_CHECK_WIDTYPE(obj, widtype);
906 elm_colorselector_palette_name_set(Evas_Object *obj, const char *palette_name __UNUSED__)
908 ELM_CHECK_WIDTYPE(obj, widtype);
913 elm_colorselector_palette_name_get(const Evas_Object *obj)
915 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
919 >>>>>>> remotes/origin/upstream