Enlightenment CVS committal
Author : rephorm
Project : e17
Module : apps/iconbar
Dir : e17/apps/iconbar/src
Modified Files:
container.c container.h iconbar.c
Log Message:
some final cleanup.
by default, container elements are not movable. use _move_button_set() to enable
element moving (where move_button is the mouse button to move on - 1, 2, 3, etc)
the iconbar uses 2 (middle button) for now. this will eventually be configurable
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/iconbar/src/container.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- container.c 12 Aug 2003 00:10:55 -0000 1.4
+++ container.c 12 Aug 2003 04:23:12 -0000 1.5
@@ -59,9 +59,8 @@
cont = _container_fetch(container);
if (!cont) return;
-// if (cont->direction == direction) return;
+ if (cont->direction == direction) return;
- printf("*********** direction: %d\n", direction);
cont->direction = direction;
_container_elements_fix(cont);
}
@@ -156,48 +155,48 @@
return cont->fill;
}
-void e_container_scroll_set(Evas_Object *container, int scroll)
+void e_container_spacing_set(Evas_Object *container, int spacing)
{
Container *cont;
cont = _container_fetch(container);
if (!cont) return;
- cont->scroll = scroll;
+ cont->spacing = spacing;
_container_elements_fix(cont);
}
-int e_container_scroll_get(Evas_Object *container)
+int e_container_spacing_get(Evas_Object *container)
{
Container *cont;
cont = _container_fetch(container);
if (!cont) return 0;
- return cont->scroll;
+ return cont->spacing;
}
-void e_container_spacing_set(Evas_Object *container, int spacing)
+void e_container_move_button_set(Evas_Object *container, int move_button)
{
Container *cont;
cont = _container_fetch(container);
if (!cont) return;
- cont->spacing = spacing;
+ if (cont->move_button == move_button) return;
- _container_elements_fix(cont);
+ cont->move_button = move_button;
}
-int e_container_spacing_get(Evas_Object *container)
+int e_container_move_button_get(Evas_Object *container)
{
Container *cont;
cont = _container_fetch(container);
if (!cont) return 0;
- return cont->spacing;
+ return cont->move_button;
}
/*** element API ***/
@@ -694,8 +693,10 @@
info = event_info;
el = (Container_Element *)data;
-
- if (el->mouse_down && !el->dragging)
+
+ if (el->container->move_button == 0) return;
+
+ if (el->mouse_down == el->container->move_button && !el->dragging)
{
if (abs(info->cur.canvas.x - el->down.x) >= 3 ||
abs(info->cur.canvas.y - el->down.y) >= 3)
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/iconbar/src/container.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- container.h 11 Aug 2003 23:40:28 -0000 1.3
+++ container.h 12 Aug 2003 04:23:12 -0000 1.4
@@ -54,16 +54,11 @@
int spacing; /* space between elements */
int direction; /* 0 = horizontal or 1 = vertical */
-// int fit_x, fit_y; /* shrink elements if area is smaller than them */
-// int fill_x, fill_y; /* make elements fill the container */
Container_Alignment align; /* CONTAINER_ALIGN_LEFT, _CENTER, or _RIGHT */
Container_Fill_Policy fill;
int move_button; /* which button to move elements with? (0 for none) */
- int scroll;
- Ecore_Timer *scroll_timer;
-
void (*cb_order_change) (void *data);
void *data_order_change;
};
@@ -91,25 +86,31 @@
void e_container_direction_set(Evas_Object *container, int direction);
int e_container_direction_get(Evas_Object *container);
+
void e_container_padding_set(Evas_Object *container, double l, double r,
double t, double b);
void e_container_padding_get(Evas_Object *container, double *l, double *r,
double *t, double *b);
+
void e_container_fill_policy_set(Evas_Object *container,
Container_Fill_Policy fill);
Container_Fill_Policy e_container_fill_policy_get(Evas_Object *container);
+
void e_container_alignment_set(Evas_Object *container,
Container_Alignment align);
Container_Alignment e_container_alignment_get(Evas_Object *container);
-void e_container_scroll_set(Evas_Object *container, int scroll);
-int e_container_scroll_get(Evas_Object *container);
-void e_container_spacing_set(Evas_Object *container,
+void e_container_spacing_set(Evas_Object *container,
int spacing);
int e_container_spacing_get(Evas_Object *container);
+
+
+void e_container_move_button_set(Evas_Object *container, int move_button);
+int e_container_move_button_get(Evas_Object *container);
+
/* element adding/removing */
void e_container_element_append(Evas_Object *container, Evas_Object *element);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/iconbar/src/iconbar.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- iconbar.c 12 Aug 2003 00:10:55 -0000 1.4
+++ iconbar.c 12 Aug 2003 04:23:12 -0000 1.5
@@ -73,10 +73,6 @@
evas_object_resize(ib->cont, 20, 200);
evas_object_show(ib->cont);
edje_object_part_swallow(ib->gui, "icons", ib->cont); //was clip
- e_container_spacing_set(ib->cont, 5);
- e_container_alignment_set(ib->cont, CONTAINER_ALIGN_CENTER);
- e_container_fill_policy_set(ib->cont, CONTAINER_FILL_POLICY_FILL_X |
- CONTAINER_FILL_POLICY_KEEP_ASPECT);
e_container_callback_order_change_set(ib->cont, write_out_order, ib);
edje_object_signal_callback_add(ib->gui, "mouse,*", "*", cb_iconbar, ib);
@@ -148,9 +144,11 @@
ib->cont = e_container_new(evas);
e_container_direction_set(ib->cont, 1);
-
- //ib->clip = evas_object_rectangle_add(evas);
- //evas_object_layer_set(ib->clip, 100);
+ e_container_spacing_set(ib->cont, 5);
+ e_container_alignment_set(ib->cont, CONTAINER_ALIGN_CENTER);
+ e_container_fill_policy_set(ib->cont, CONTAINER_FILL_POLICY_FILL_X |
+ CONTAINER_FILL_POLICY_KEEP_ASPECT);
+ e_container_move_button_set(ib->cont, 2);
}
@@ -237,7 +235,6 @@
if (w > h)
{
- printf("**** HORIZONTAL ****\n");
e_container_direction_set(ib->cont, 0);
e_container_fill_policy_set(ib->cont, CONTAINER_FILL_POLICY_FILL_Y |
CONTAINER_FILL_POLICY_KEEP_ASPECT);
@@ -317,7 +314,6 @@
ib = (Iconbar *)data;
- printf("scroll pos!\n");
if (!ib->scroll_timer)
return(0);
@@ -494,7 +490,6 @@
char buf[PATH_MAX];
Evas_List *l, *ll;
- printf("****** WRITE OUT ORDER *****\n");
snprintf(buf, sizeof(buf), "%s/order.txt", ib->path);
@@ -580,7 +575,6 @@
{
char *exec = (char *)(sig+5);
- printf("**********exec: %s\n", exec);
if (!exec_run_in_dir(exec, get_user_home()))
{
printf("Error: failed to run \"%s\"\n", exec);
@@ -604,6 +598,5 @@
edje_object_part_text_set(ib->gui, "clock", buf);
return(1);
}
- printf("******** clock stop ***************");
return(0);
}
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs