summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2011-02-24 14:41:08 +0000
committerCedric BAIL <cedric.bail@free.fr>2011-02-24 14:41:08 +0000
commitc54cc95085482ab2a64eb906e262d2aae282bb10 (patch)
treef7e7e7c18a06286bc6c83237ca593ef2ac005cf2 /legacy
parenta8f52f4378a04b867134a140517064580dec07e6 (diff)
edje: fix signal comming from box/table part.
Thanks to the report by Jonathan "Watchwolf" Atton. SVN revision: 57299
Diffstat (limited to 'legacy')
-rw-r--r--legacy/edje/ChangeLog5
-rw-r--r--legacy/edje/src/lib/edje_load.c62
-rw-r--r--legacy/edje/src/lib/edje_private.h50
3 files changed, 88 insertions, 29 deletions
diff --git a/legacy/edje/ChangeLog b/legacy/edje/ChangeLog
index f0a5df2101..abeaabdde6 100644
--- a/legacy/edje/ChangeLog
+++ b/legacy/edje/ChangeLog
@@ -32,3 +32,8 @@
322011-02-10 Cedric BAIL 322011-02-10 Cedric BAIL
33 33
34 * Fix propagation of recursive events on existing part. 34 * Fix propagation of recursive events on existing part.
35
362011-02-24 Cedric BAIL
37
38 * fix signal comming from box/table item to include their
39 index or name correctly.
diff --git a/legacy/edje/src/lib/edje_load.c b/legacy/edje/src/lib/edje_load.c
index 5edb012463..fef632d15c 100644
--- a/legacy/edje/src/lib/edje_load.c
+++ b/legacy/edje/src/lib/edje_load.c
@@ -785,8 +785,8 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
785 return 0; 785 return 0;
786 } 786 }
787 child_ed = _edje_fetch(child_obj); 787 child_ed = _edje_fetch(child_obj);
788 child_ed->parent = eina_stringshare_add(rp->part->name); 788 child_ed->parent = eina_stringshare_add(rp->part->name);
789 789
790 group_path = eina_list_remove(group_path, group_path_entry); 790 group_path = eina_list_remove(group_path, group_path_entry);
791 eina_stringshare_del(group_path_entry); 791 eina_stringshare_del(group_path_entry);
792 792
@@ -798,10 +798,13 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
798 } 798 }
799 else 799 else
800 { 800 {
801 pack_it->parent = rp;
802
801 _edje_object_pack_item_hints_set(child_obj, pack_it); 803 _edje_object_pack_item_hints_set(child_obj, pack_it);
802 evas_object_show(child_obj); 804 evas_object_show(child_obj);
803 if (pack_it->name) 805 if (pack_it->name)
804 evas_object_name_set(child_obj, pack_it->name); 806 evas_object_name_set(child_obj, pack_it->name);
807
805 if (rp->part->type == EDJE_PART_TYPE_BOX) 808 if (rp->part->type == EDJE_PART_TYPE_BOX)
806 { 809 {
807 _edje_real_part_box_append(rp, child_obj); 810 _edje_real_part_box_append(rp, child_obj);
@@ -1421,26 +1424,77 @@ _edje_find_alias(Eina_Hash *aliased, char *src, int *length)
1421static void 1424static void
1422_cb_signal_repeat(void *data, Evas_Object *obj, const char *signal, const char *source) 1425_cb_signal_repeat(void *data, Evas_Object *obj, const char *signal, const char *source)
1423{ 1426{
1427 Edje_Pack_Element *pack_it;
1424 Evas_Object *parent; 1428 Evas_Object *parent;
1425 Edje *ed; 1429 Edje *ed;
1426 Edje *ed_parent; 1430 Edje *ed_parent;
1427 char new_src[4096]; /* XXX is this max reasonable? */ 1431 char new_src[4096]; /* XXX is this max reasonable? */
1428 size_t length_parent = 0; 1432 size_t length_parent = 0;
1433 size_t length_index = 0;
1429 size_t length_source; 1434 size_t length_source;
1435 int i = 0;
1430 const char *alias = NULL; 1436 const char *alias = NULL;
1431 1437
1432 parent = data; 1438 parent = data;
1433 ed = _edje_fetch(obj); 1439 ed = _edje_fetch(obj);
1434 if (!ed) return; 1440 if (!ed) return;
1441
1442 pack_it = evas_object_data_get(obj, "\377 edje.box_item");
1443 if (!pack_it) pack_it = evas_object_data_get(obj, "\377 edje.table_item");
1444 if (pack_it)
1445 {
1446 if (!pack_it->name)
1447 {
1448 Eina_List *child = NULL;
1449 Evas_Object *o;
1450
1451 if (pack_it->parent->part->type == EDJE_PART_TYPE_BOX)
1452 {
1453 child = evas_object_box_children_get(pack_it->parent->object);
1454 }
1455 else if (pack_it->parent->part->type == EDJE_PART_TYPE_TABLE)
1456 {
1457 child = evas_object_table_children_get(pack_it->parent->object);
1458 }
1459
1460 EINA_LIST_FREE(child, o)
1461 {
1462 if (o == obj) break;
1463 i++;
1464 }
1465
1466 eina_list_free(child);
1467
1468 length_index = 12;
1469 }
1470 else
1471 {
1472 length_index = strlen(pack_it->name) + 2;
1473 }
1474 }
1475
1435 /* Replace snprint("%s%c%s") == memcpy + *new_src + memcat */ 1476 /* Replace snprint("%s%c%s") == memcpy + *new_src + memcat */
1436 if (ed->parent) 1477 if (ed->parent)
1437 length_parent = strlen(ed->parent); 1478 length_parent = strlen(ed->parent);
1438 length_source = strlen(source); 1479 length_source = strlen(source);
1439 if (length_source + length_parent + 2 > sizeof(new_src)) 1480 if (length_source + length_parent + 2 + length_index > sizeof(new_src))
1440 return; 1481 return;
1441 1482
1442 if (ed->parent) 1483 if (ed->parent)
1443 memcpy(new_src, ed->parent, length_parent); 1484 memcpy(new_src, ed->parent, length_parent);
1485 if (ed->parent && length_index)
1486 {
1487 new_src[length_parent++] = EDJE_PART_PATH_SEPARATOR_INDEXL;
1488 if (length_index == 12)
1489 length_parent += eina_convert_itoa(i, new_src + length_parent);
1490 else
1491 {
1492 memcpy(new_src + length_parent, pack_it->name, length_index);
1493 length_parent += length_index - 2;
1494 }
1495 new_src[length_parent++] = EDJE_PART_PATH_SEPARATOR_INDEXR;
1496 }
1497
1444 new_src[length_parent] = EDJE_PART_PATH_SEPARATOR; 1498 new_src[length_parent] = EDJE_PART_PATH_SEPARATOR;
1445 memcpy(new_src + length_parent + 1, source, length_source + 1); 1499 memcpy(new_src + length_parent + 1, source, length_source + 1);
1446 1500
diff --git a/legacy/edje/src/lib/edje_private.h b/legacy/edje/src/lib/edje_private.h
index 528f3fd7dd..184958da2f 100644
--- a/legacy/edje/src/lib/edje_private.h
+++ b/legacy/edje/src/lib/edje_private.h
@@ -291,6 +291,30 @@ typedef struct _Edje_Part_Description_Spec_Table Edje_Part_Description_Spec_
291typedef struct _Edje_Patterns Edje_Patterns; 291typedef struct _Edje_Patterns Edje_Patterns;
292typedef struct _Edje_Part_Box_Animation Edje_Part_Box_Animation; 292typedef struct _Edje_Part_Box_Animation Edje_Part_Box_Animation;
293 293
294typedef struct _Edje Edje;
295typedef struct _Edje_Real_Part_State Edje_Real_Part_State;
296typedef struct _Edje_Real_Part_Drag Edje_Real_Part_Drag;
297typedef struct _Edje_Real_Part_Set Edje_Real_Part_Set;
298typedef struct _Edje_Real_Part Edje_Real_Part;
299typedef struct _Edje_Running_Program Edje_Running_Program;
300typedef struct _Edje_Signal_Callback Edje_Signal_Callback;
301typedef struct _Edje_Calc_Params Edje_Calc_Params;
302typedef struct _Edje_Pending_Program Edje_Pending_Program;
303typedef struct _Edje_Text_Style Edje_Text_Style;
304typedef struct _Edje_Color_Class Edje_Color_Class;
305typedef struct _Edje_Text_Class Edje_Text_Class;
306typedef struct _Edje_Var Edje_Var;
307typedef struct _Edje_Var_Int Edje_Var_Int;
308typedef struct _Edje_Var_Float Edje_Var_Float;
309typedef struct _Edje_Var_String Edje_Var_String;
310typedef struct _Edje_Var_List Edje_Var_List;
311typedef struct _Edje_Var_Hash Edje_Var_Hash;
312typedef struct _Edje_Var_Animator Edje_Var_Animator;
313typedef struct _Edje_Var_Timer Edje_Var_Timer;
314typedef struct _Edje_Var_Pool Edje_Var_Pool;
315typedef struct _Edje_Signal_Source_Char Edje_Signal_Source_Char;
316typedef struct _Edje_Text_Insert_Filter_Callback Edje_Text_Insert_Filter_Callback;
317
294#define EDJE_INF_MAX_W 100000 318#define EDJE_INF_MAX_W 100000
295#define EDJE_INF_MAX_H 100000 319#define EDJE_INF_MAX_H 100000
296 320
@@ -590,6 +614,7 @@ struct _Edje_Part_Collection_Directory_Entry
590struct _Edje_Pack_Element 614struct _Edje_Pack_Element
591{ 615{
592 unsigned char type; /* only GROUP supported for now */ 616 unsigned char type; /* only GROUP supported for now */
617 Edje_Real_Part *parent; /* pointer to the table/box that hold it, set at runtime */
593 const char *name; /* if != NULL, will be set with evas_object_name_set */ 618 const char *name; /* if != NULL, will be set with evas_object_name_set */
594 const char *source; /* group name to use as source for this element */ 619 const char *source; /* group name to use as source for this element */
595 Edje_Size min, prefer, max; 620 Edje_Size min, prefer, max;
@@ -892,31 +917,6 @@ struct _Edje_Part_Description_External
892 917
893/*----------*/ 918/*----------*/
894 919
895
896typedef struct _Edje Edje;
897typedef struct _Edje_Real_Part_State Edje_Real_Part_State;
898typedef struct _Edje_Real_Part_Drag Edje_Real_Part_Drag;
899typedef struct _Edje_Real_Part_Set Edje_Real_Part_Set;
900typedef struct _Edje_Real_Part Edje_Real_Part;
901typedef struct _Edje_Running_Program Edje_Running_Program;
902typedef struct _Edje_Signal_Callback Edje_Signal_Callback;
903typedef struct _Edje_Calc_Params Edje_Calc_Params;
904typedef struct _Edje_Pending_Program Edje_Pending_Program;
905typedef struct _Edje_Text_Style Edje_Text_Style;
906typedef struct _Edje_Color_Class Edje_Color_Class;
907typedef struct _Edje_Text_Class Edje_Text_Class;
908typedef struct _Edje_Var Edje_Var;
909typedef struct _Edje_Var_Int Edje_Var_Int;
910typedef struct _Edje_Var_Float Edje_Var_Float;
911typedef struct _Edje_Var_String Edje_Var_String;
912typedef struct _Edje_Var_List Edje_Var_List;
913typedef struct _Edje_Var_Hash Edje_Var_Hash;
914typedef struct _Edje_Var_Animator Edje_Var_Animator;
915typedef struct _Edje_Var_Timer Edje_Var_Timer;
916typedef struct _Edje_Var_Pool Edje_Var_Pool;
917typedef struct _Edje_Signal_Source_Char Edje_Signal_Source_Char;
918typedef struct _Edje_Text_Insert_Filter_Callback Edje_Text_Insert_Filter_Callback;
919
920struct _Edje_Signal_Source_Char 920struct _Edje_Signal_Source_Char
921{ 921{
922 EINA_RBTREE; 922 EINA_RBTREE;