Enlightenment CVS committal
Author : rephorm
Project : e17
Module : apps/elicit
Dir : e17/apps/elicit/src
Modified Files:
Elicit.h callbacks.c callbacks.h elicit.c
Log Message:
sliders! (for the colors)
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/elicit/src/Elicit.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- Elicit.h 9 Feb 2004 13:38:53 -0000 1.6
+++ Elicit.h 11 Feb 2004 02:49:30 -0000 1.7
@@ -54,8 +54,11 @@
char *change_sig;
};
-void elicit_ui_update_text(Elicit *el);
void elicit_ui_theme_set(Elicit *el, char *name, char *group);
+void elicit_ui_update(Elicit *el); /* this does the next two */
+void elicit_ui_update_text(Elicit *el);
+void elicit_ui_update_sliders(Elicit *el);
+
#endif
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/elicit/src/callbacks.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- callbacks.c 9 Feb 2004 13:38:53 -0000 1.8
+++ callbacks.c 11 Feb 2004 02:49:30 -0000 1.9
@@ -50,7 +50,7 @@
elicit_util_color_at_pointer_get(&(el->color.r), &(el->color.g),
&(el->color.b));
evas_object_color_set(el->swatch, el->color.r, el->color.g, el->color.b, 255);
elicit_util_colors_set_from_rgb(el);
- elicit_ui_update_text(el);
+ elicit_ui_update(el);
}
}
}
@@ -168,8 +168,6 @@
woff ? ow + w * woff : w,
hoff ? oh + h * hoff : h);
}
-
-
}
void
@@ -181,6 +179,51 @@
ecore_x_selection_primary_set(win, el->color.hex, strlen(el->color.hex));
}
+void
+elicit_cb_slider(void *data, Evas_Object *o, const char *sig, const char *src)
+{
+ Elicit *el = data;
+ double vx;
+
+ edje_object_part_drag_value_get(el->gui, src, &vx, NULL);
+
+ if (!strcmp(src, "red-slider"))
+ {
+ el->color.r = vx * 255;
+ elicit_util_colors_set_from_rgb(el);
+ }
+ else if (!strcmp(src, "green-slider"))
+ {
+ el->color.g = vx * 255;
+ elicit_util_colors_set_from_rgb(el);
+ }
+ else if (!strcmp(src, "blue-slider"))
+ {
+ el->color.b = vx * 255;
+ elicit_util_colors_set_from_rgb(el);
+ }
+ else if (!strcmp(src, "hue-slider"))
+ {
+ el->color.h = vx * 360;
+ elicit_util_colors_set_from_hsv(el);
+ }
+ else if (!strcmp(src, "sat-slider"))
+ {
+ el->color.s = vx;
+ elicit_util_colors_set_from_hsv(el);
+ }
+ else if (!strcmp(src, "val-slider"))
+ {
+ el->color.v = vx;
+ elicit_util_colors_set_from_hsv(el);
+ }
+
+ elicit_ui_update(el);
+
+}
+
+
+
static int
elicit_timer_color(void *data)
{
@@ -275,7 +318,7 @@
if (el->zoom < 1) el->zoom = 1;
}
- elicit_ui_update_text(el);
+ elicit_ui_update(el);
evas_object_color_set(el->swatch, el->color.r, el->color.g, el->color.b, 255);
el->flags.changed = 1;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/elicit/src/callbacks.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- callbacks.h 8 Feb 2004 09:25:59 -0000 1.3
+++ callbacks.h 11 Feb 2004 02:49:30 -0000 1.4
@@ -11,5 +11,6 @@
void elicit_cb_switch(void *data, Evas_Object *o, const char *sig, const char *src);
void elicit_cb_copy(void *data, Evas_Object *o, const char *sig, const char *src);
void elicit_cb_resize_sig(void *data, Evas_Object *o, const char *sig, const char
*src);
+void elicit_cb_slider(void *data, Evas_Object *o, const char *sig, const char *src);
#endif
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/elicit/src/elicit.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- elicit.c 9 Feb 2004 13:38:53 -0000 1.9
+++ elicit.c 11 Feb 2004 02:49:30 -0000 1.10
@@ -119,7 +119,7 @@
evas_object_show(el->draggie);
elicit_ui_theme_set(el, elicit_config_theme_get(el), "elicit");
- elicit_ui_update_text(el);
+ elicit_ui_update(el);
return 0;
}
@@ -153,7 +153,7 @@
/* swallow and update */
edje_object_part_swallow(el->gui, "shot", el->shot);
edje_object_part_swallow(el->gui, "swatch", el->swatch);
- elicit_ui_update_text(el);
+ elicit_ui_update(el);
/* set up edje callbacks */
edje_object_signal_callback_add(el->gui, "elicit,pick,*", "*", elicit_cb_pick, el);
@@ -166,6 +166,7 @@
edje_object_signal_callback_add(el->gui, "elicit,switch,*", "*", elicit_cb_switch,
el);
edje_object_signal_callback_add(el->gui, "elicit,copy,*", "*", elicit_cb_copy, el);
edje_object_signal_callback_add(el->gui, "elicit,resize,*", "*",
elicit_cb_resize_sig, el);
+ edje_object_signal_callback_add(el->gui, "drag", "*-slider", elicit_cb_slider, el);
evas_object_hide(el->gui);
evas_object_show(el->gui);
@@ -204,3 +205,22 @@
edje_object_thaw(el->gui);
}
+void
+elicit_ui_update_sliders(Elicit *el)
+{
+ edje_object_part_drag_value_set(el->gui, "red-slider", (double)el->color.r / 255,
1);
+ edje_object_part_drag_value_set(el->gui, "green-slider", (double)el->color.g / 255,
1);
+ edje_object_part_drag_value_set(el->gui, "blue-slider", (double)el->color.b / 255,
1);
+ edje_object_part_drag_value_set(el->gui, "hue-slider", (double)el->color.h / 360,
1);
+ edje_object_part_drag_value_set(el->gui, "sat-slider", (double)el->color.s, 1);
+ edje_object_part_drag_value_set(el->gui, "val-slider", (double)el->color.v, 1);
+}
+
+void
+elicit_ui_update(Elicit *el)
+{
+ elicit_ui_update_text(el);
+ elicit_ui_update_sliders(el);
+
+ evas_object_color_set(el->swatch, el->color.r, el->color.g, el->color.b, 255);
+}
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs