summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2011-10-21 16:53:01 +0000
committerDaniel Juyung Seo <seojuyung2@gmail.com>2011-10-21 16:53:01 +0000
commitc0001ca74167dced7c47ec26722230be5d180f44 (patch)
tree4287efa3a0f4f844a401be23f406d64bcc7dc68a /legacy
parentda56018192b60a72224ccf607ffec900d91d4368 (diff)
elm gengrid: Changed widget data member 'self' to 'obj'. Sync with genlist.
SVN revision: 64262
Diffstat (limited to 'legacy')
-rw-r--r--legacy/elementary/src/lib/elm_gengrid.c84
1 files changed, 42 insertions, 42 deletions
diff --git a/legacy/elementary/src/lib/elm_gengrid.c b/legacy/elementary/src/lib/elm_gengrid.c
index 89f9669347..7dd20ac0ce 100644
--- a/legacy/elementary/src/lib/elm_gengrid.c
+++ b/legacy/elementary/src/lib/elm_gengrid.c
@@ -29,7 +29,7 @@ struct Elm_Gen_Item_Type
29struct _Widget_Data 29struct _Widget_Data
30{ 30{
31 Eina_Inlist_Sorted_State *state; 31 Eina_Inlist_Sorted_State *state;
32 Evas_Object *self; 32 Evas_Object *obj; /* the gengrid object */
33 Eina_List *selected; 33 Eina_List *selected;
34 Eina_List *group_items; /* list of groups index items */ 34 Eina_List *group_items; /* list of groups index items */
35 Eina_Inlist *items; /* inlist of all items */ 35 Eina_Inlist *items; /* inlist of all items */
@@ -51,7 +51,7 @@ struct _Widget_Data
51 unsigned int nmax; 51 unsigned int nmax;
52 long count; 52 long count;
53 long items_lost; 53 long items_lost;
54 54
55 Eina_Bool horizontal : 1; 55 Eina_Bool horizontal : 1;
56 Eina_Bool on_hold : 1; 56 Eina_Bool on_hold : 1;
57 Eina_Bool longpressed : 1; 57 Eina_Bool longpressed : 1;
@@ -337,7 +337,7 @@ _event_hook(Evas_Object *obj,
337 (!strcmp(ev->keyname, "space"))) 337 (!strcmp(ev->keyname, "space")))
338 { 338 {
339 it = elm_gengrid_selected_item_get(obj); 339 it = elm_gengrid_selected_item_get(obj);
340 evas_object_smart_callback_call(it->wd->self, SIG_ACTIVATED, it); 340 evas_object_smart_callback_call(WIDGET(it), SIG_ACTIVATED, it);
341 } 341 }
342 else return EINA_FALSE; 342 else return EINA_FALSE;
343 343
@@ -546,15 +546,15 @@ _on_focus_hook(void *data __UNUSED__,
546 if (!wd) return; 546 if (!wd) return;
547 if (elm_widget_focus_get(obj)) 547 if (elm_widget_focus_get(obj))
548 { 548 {
549 edje_object_signal_emit(wd->self, "elm,action,focus", "elm"); 549 edje_object_signal_emit(wd->obj, "elm,action,focus", "elm");
550 evas_object_focus_set(wd->self, EINA_TRUE); 550 evas_object_focus_set(wd->obj, EINA_TRUE);
551 if ((wd->selected) && (!wd->last_selected_item)) 551 if ((wd->selected) && (!wd->last_selected_item))
552 wd->last_selected_item = eina_list_data_get(wd->selected); 552 wd->last_selected_item = eina_list_data_get(wd->selected);
553 } 553 }
554 else 554 else
555 { 555 {
556 edje_object_signal_emit(wd->self, "elm,action,unfocus", "elm"); 556 edje_object_signal_emit(wd->obj, "elm,action,unfocus", "elm");
557 evas_object_focus_set(wd->self, EINA_FALSE); 557 evas_object_focus_set(wd->obj, EINA_FALSE);
558 } 558 }
559} 559}
560 560
@@ -669,7 +669,7 @@ _mouse_move(void *data,
669 ecore_timer_del(it->long_timer); 669 ecore_timer_del(it->long_timer);
670 it->long_timer = NULL; 670 it->long_timer = NULL;
671 } 671 }
672 evas_object_smart_callback_call(it->wd->self, SIG_DRAG, it); 672 evas_object_smart_callback_call(WIDGET(it), SIG_DRAG, it);
673 return; 673 return;
674 } 674 }
675 if ((!it->down) || (it->wd->longpressed)) 675 if ((!it->down) || (it->wd->longpressed))
@@ -717,7 +717,7 @@ _mouse_move(void *data,
717 if ((adx > minw) || (ady > minh)) 717 if ((adx > minw) || (ady > minh))
718 { 718 {
719 const char *left_drag, *right_drag; 719 const char *left_drag, *right_drag;
720 if (!elm_widget_mirrored_get(it->wd->self)) 720 if (!elm_widget_mirrored_get(WIDGET(it)))
721 { 721 {
722 left_drag = SIG_DRAG_START_LEFT; 722 left_drag = SIG_DRAG_START_LEFT;
723 right_drag = SIG_DRAG_START_RIGHT; 723 right_drag = SIG_DRAG_START_RIGHT;
@@ -739,27 +739,27 @@ _mouse_move(void *data,
739 if (dy < 0) 739 if (dy < 0)
740 { 740 {
741 if (ady > adx) 741 if (ady > adx)
742 evas_object_smart_callback_call(it->wd->self, SIG_DRAG_START_UP, 742 evas_object_smart_callback_call(WIDGET(it), SIG_DRAG_START_UP,
743 it); 743 it);
744 else 744 else
745 { 745 {
746 if (dx < 0) 746 if (dx < 0)
747 evas_object_smart_callback_call(it->wd->self, 747 evas_object_smart_callback_call(WIDGET(it),
748 left_drag, it); 748 left_drag, it);
749 } 749 }
750 } 750 }
751 else 751 else
752 { 752 {
753 if (ady > adx) 753 if (ady > adx)
754 evas_object_smart_callback_call(it->wd->self, 754 evas_object_smart_callback_call(WIDGET(it),
755 SIG_DRAG_START_DOWN, it); 755 SIG_DRAG_START_DOWN, it);
756 else 756 else
757 { 757 {
758 if (dx < 0) 758 if (dx < 0)
759 evas_object_smart_callback_call(it->wd->self, 759 evas_object_smart_callback_call(WIDGET(it),
760 left_drag, it); 760 left_drag, it);
761 else 761 else
762 evas_object_smart_callback_call(it->wd->self, 762 evas_object_smart_callback_call(WIDGET(it),
763 right_drag, it); 763 right_drag, it);
764 } 764 }
765 } 765 }
@@ -774,7 +774,7 @@ _long_press(void *data)
774 it->long_timer = NULL; 774 it->long_timer = NULL;
775 if ((it->disabled) || (it->dragging)) return ECORE_CALLBACK_CANCEL; 775 if ((it->disabled) || (it->dragging)) return ECORE_CALLBACK_CANCEL;
776 it->wd->longpressed = EINA_TRUE; 776 it->wd->longpressed = EINA_TRUE;
777 evas_object_smart_callback_call(it->wd->self, SIG_LONGPRESSED, it); 777 evas_object_smart_callback_call(WIDGET(it), SIG_LONGPRESSED, it);
778 if (it->wd->reorder_mode) 778 if (it->wd->reorder_mode)
779 { 779 {
780 it->wd->reorder_it = it; 780 it->wd->reorder_it = it;
@@ -809,8 +809,8 @@ _mouse_down(void *data,
809 _item_highlight(it); 809 _item_highlight(it);
810 if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK) 810 if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
811 { 811 {
812 evas_object_smart_callback_call(it->wd->self, SIG_CLICKED_DOUBLE, it); 812 evas_object_smart_callback_call(WIDGET(it), SIG_CLICKED_DOUBLE, it);
813 evas_object_smart_callback_call(it->wd->self, SIG_ACTIVATED, it); 813 evas_object_smart_callback_call(WIDGET(it), SIG_ACTIVATED, it);
814 } 814 }
815 if (it->long_timer) ecore_timer_del(it->long_timer); 815 if (it->long_timer) ecore_timer_del(it->long_timer);
816 if (it->realized) 816 if (it->realized)
@@ -842,7 +842,7 @@ _mouse_up(void *data,
842 if (it->dragging) 842 if (it->dragging)
843 { 843 {
844 it->dragging = EINA_FALSE; 844 it->dragging = EINA_FALSE;
845 evas_object_smart_callback_call(it->wd->self, SIG_DRAG_STOP, it); 845 evas_object_smart_callback_call(WIDGET(it), SIG_DRAG_STOP, it);
846 dragged = EINA_TRUE; 846 dragged = EINA_TRUE;
847 } 847 }
848 if (it->wd->on_hold) 848 if (it->wd->on_hold)
@@ -853,7 +853,7 @@ _mouse_up(void *data,
853 } 853 }
854 if ((it->wd->reorder_mode) && (it->wd->reorder_it)) 854 if ((it->wd->reorder_mode) && (it->wd->reorder_it))
855 { 855 {
856 evas_object_smart_callback_call(it->wd->self, SIG_MOVED, it->wd->reorder_it); 856 evas_object_smart_callback_call(WIDGET(it), SIG_MOVED, it->wd->reorder_it);
857 it->wd->reorder_it = NULL; 857 it->wd->reorder_it = NULL;
858 it->wd->move_effect_enabled = EINA_FALSE; 858 it->wd->move_effect_enabled = EINA_FALSE;
859 if (it->wd->calc_job) ecore_job_del(it->wd->calc_job); 859 if (it->wd->calc_job) ecore_job_del(it->wd->calc_job);
@@ -920,20 +920,20 @@ _item_realize(Elm_Gen_Item *it)
920 char style[1024]; 920 char style[1024];
921 921
922 if ((it->realized) || (it->delete_me)) return; 922 if ((it->realized) || (it->delete_me)) return;
923 VIEW(it) = edje_object_add(evas_object_evas_get(it->wd->self)); 923 VIEW(it) = edje_object_add(evas_object_evas_get(WIDGET(it)));
924 edje_object_scale_set(VIEW(it), elm_widget_scale_get(it->wd->self) * 924 edje_object_scale_set(VIEW(it), elm_widget_scale_get(WIDGET(it)) *
925 _elm_config->scale); 925 _elm_config->scale);
926 edje_object_mirrored_set(VIEW(it), elm_widget_mirrored_get(WIDGET(it))); 926 edje_object_mirrored_set(VIEW(it), elm_widget_mirrored_get(WIDGET(it)));
927 evas_object_smart_member_add(VIEW(it), it->wd->pan_smart); 927 evas_object_smart_member_add(VIEW(it), it->wd->pan_smart);
928 elm_widget_sub_object_add(it->wd->self, VIEW(it)); 928 elm_widget_sub_object_add(WIDGET(it), VIEW(it));
929 snprintf(style, sizeof(style), "item/%s", 929 snprintf(style, sizeof(style), "item/%s",
930 it->itc->item_style ? it->itc->item_style : "default"); 930 it->itc->item_style ? it->itc->item_style : "default");
931 _elm_theme_object_set(it->wd->self, VIEW(it), "gengrid", style, 931 _elm_theme_object_set(WIDGET(it), VIEW(it), "gengrid", style,
932 elm_widget_style_get(it->wd->self)); 932 elm_widget_style_get(WIDGET(it)));
933 it->spacer = 933 it->spacer =
934 evas_object_rectangle_add(evas_object_evas_get(it->wd->self)); 934 evas_object_rectangle_add(evas_object_evas_get(WIDGET(it)));
935 evas_object_color_set(it->spacer, 0, 0, 0, 0); 935 evas_object_color_set(it->spacer, 0, 0, 0, 0);
936 elm_widget_sub_object_add(it->wd->self, it->spacer); 936 elm_widget_sub_object_add(WIDGET(it), it->spacer);
937 evas_object_size_hint_min_set(it->spacer, 2 * _elm_config->scale, 1); 937 evas_object_size_hint_min_set(it->spacer, 2 * _elm_config->scale, 1);
938 edje_object_part_swallow(VIEW(it), "elm.swallow.pad", it->spacer); 938 edje_object_part_swallow(VIEW(it), "elm.swallow.pad", it->spacer);
939 939
@@ -948,7 +948,7 @@ _item_realize(Elm_Gen_Item *it)
948 EINA_LIST_FOREACH(it->labels, l, key) 948 EINA_LIST_FOREACH(it->labels, l, key)
949 { 949 {
950 char *s = it->itc->func.label_get 950 char *s = it->itc->func.label_get
951 ((void *)it->base.data, it->wd->self, l->data); 951 ((void *)it->base.data, WIDGET(it), l->data);
952 if (s) 952 if (s)
953 { 953 {
954 edje_object_part_text_set(VIEW(it), l->data, s); 954 edje_object_part_text_set(VIEW(it), l->data, s);
@@ -968,13 +968,13 @@ _item_realize(Elm_Gen_Item *it)
968 EINA_LIST_FOREACH(it->icons, l, key) 968 EINA_LIST_FOREACH(it->icons, l, key)
969 { 969 {
970 Evas_Object *ic = it->itc->func.icon_get 970 Evas_Object *ic = it->itc->func.icon_get
971 ((void *)it->base.data, it->wd->self, l->data); 971 ((void *)it->base.data, WIDGET(it), l->data);
972 if (ic) 972 if (ic)
973 { 973 {
974 it->icon_objs = eina_list_append(it->icon_objs, ic); 974 it->icon_objs = eina_list_append(it->icon_objs, ic);
975 edje_object_part_swallow(VIEW(it), key, ic); 975 edje_object_part_swallow(VIEW(it), key, ic);
976 evas_object_show(ic); 976 evas_object_show(ic);
977 elm_widget_sub_object_add(it->wd->self, ic); 977 elm_widget_sub_object_add(WIDGET(it), ic);
978 } 978 }
979 } 979 }
980 } 980 }
@@ -990,7 +990,7 @@ _item_realize(Elm_Gen_Item *it)
990 EINA_LIST_FOREACH(it->states, l, key) 990 EINA_LIST_FOREACH(it->states, l, key)
991 { 991 {
992 Eina_Bool on = it->itc->func.state_get 992 Eina_Bool on = it->itc->func.state_get
993 ((void *)it->base.data, it->wd->self, l->data); 993 ((void *)it->base.data, WIDGET(it), l->data);
994 if (on) 994 if (on)
995 { 995 {
996 snprintf(buf, sizeof(buf), "elm,state,%s,active", key); 996 snprintf(buf, sizeof(buf), "elm,state,%s,active", key);
@@ -1146,7 +1146,7 @@ _group_item_place(Pan *sd)
1146 { 1146 {
1147 _item_realize(it); 1147 _item_realize(it);
1148 if (!was_realized) 1148 if (!was_realized)
1149 evas_object_smart_callback_call(it->wd->self, SIG_REALIZED, it); 1149 evas_object_smart_callback_call(WIDGET(it), SIG_REALIZED, it);
1150 evas_object_move(VIEW(it), it->item->gx, it->item->gy); 1150 evas_object_move(VIEW(it), it->item->gx, it->item->gy);
1151 evas_object_resize(VIEW(it), iw, ih); 1151 evas_object_resize(VIEW(it), iw, ih);
1152 evas_object_raise(VIEW(it)); 1152 evas_object_raise(VIEW(it));
@@ -1256,9 +1256,9 @@ _item_place(Elm_Gen_Item *it,
1256 x = (cx * it->wd->item_width) - it->wd->pan_x + ox + alignw; 1256 x = (cx * it->wd->item_width) - it->wd->pan_x + ox + alignw;
1257 y = (((cy - it->item->prev_group) * it->wd->item_height) + (it->item->prev_group * it->wd->group_item_height)) - it->wd->pan_y + oy + alignh; 1257 y = (((cy - it->item->prev_group) * it->wd->item_height) + (it->item->prev_group * it->wd->group_item_height)) - it->wd->pan_y + oy + alignh;
1258 } 1258 }
1259 if (elm_widget_mirrored_get(it->wd->self)) 1259 if (elm_widget_mirrored_get(WIDGET(it)))
1260 { /* Switch items side and componsate for pan_x when in RTL mode */ 1260 { /* Switch items side and componsate for pan_x when in RTL mode */
1261 evas_object_geometry_get(it->wd->self, NULL, NULL, &ww, NULL); 1261 evas_object_geometry_get(WIDGET(it), NULL, NULL, &ww, NULL);
1262 x = ww - x - it->wd->item_width - it->wd->pan_x - it->wd->pan_x; 1262 x = ww - x - it->wd->item_width - it->wd->pan_x - it->wd->pan_x;
1263 } 1263 }
1264 iw = it->wd->item_width; 1264 iw = it->wd->item_width;
@@ -1270,7 +1270,7 @@ _item_place(Elm_Gen_Item *it,
1270 { 1270 {
1271 _item_realize(it); 1271 _item_realize(it);
1272 if (!was_realized) 1272 if (!was_realized)
1273 evas_object_smart_callback_call(it->wd->self, SIG_REALIZED, it); 1273 evas_object_smart_callback_call(WIDGET(it), SIG_REALIZED, it);
1274 if (it->parent) 1274 if (it->parent)
1275 { 1275 {
1276 if (it->wd->horizontal) 1276 if (it->wd->horizontal)
@@ -1468,9 +1468,9 @@ call:
1468 it->walking++; 1468 it->walking++;
1469 it->wd->walking++; 1469 it->wd->walking++;
1470 if (it->func.func) 1470 if (it->func.func)
1471 it->func.func((void *)it->func.data, it->wd->self, it); 1471 it->func.func((void *)it->func.data, WIDGET(it), it);
1472 if (!it->delete_me) 1472 if (!it->delete_me)
1473 evas_object_smart_callback_call(it->wd->self, SIG_SELECTED, it); 1473 evas_object_smart_callback_call(WIDGET(it), SIG_SELECTED, it);
1474 it->walking--; 1474 it->walking--;
1475 it->wd->walking--; 1475 it->wd->walking--;
1476 it->wd->last_selected_item = it; 1476 it->wd->last_selected_item = it;
@@ -1493,7 +1493,7 @@ _item_unselect(Elm_Gen_Item *it)
1493 { 1493 {
1494 it->selected = EINA_FALSE; 1494 it->selected = EINA_FALSE;
1495 it->wd->selected = eina_list_remove(it->wd->selected, it); 1495 it->wd->selected = eina_list_remove(it->wd->selected, it);
1496 evas_object_smart_callback_call(it->wd->self, SIG_UNSELECTED, it); 1496 evas_object_smart_callback_call(WIDGET(it), SIG_UNSELECTED, it);
1497 } 1497 }
1498} 1498}
1499 1499
@@ -1740,7 +1740,7 @@ _pan_calculate(Evas_Object *obj)
1740 } 1740 }
1741 sd->wd->move_effect_enabled = EINA_FALSE; 1741 sd->wd->move_effect_enabled = EINA_FALSE;
1742 } 1742 }
1743 evas_object_smart_callback_call(sd->wd->self, SIG_CHANGED, NULL); 1743 evas_object_smart_callback_call(sd->wd->obj, SIG_CHANGED, NULL);
1744} 1744}
1745 1745
1746static void 1746static void
@@ -1947,7 +1947,7 @@ elm_gengrid_add(Evas_Object *parent)
1947 obj); 1947 obj);
1948 evas_object_smart_callback_add(wd->scr, "scroll", _scr_scroll, obj); 1948 evas_object_smart_callback_add(wd->scr, "scroll", _scr_scroll, obj);
1949 1949
1950 wd->self = obj; 1950 wd->obj = obj;
1951 wd->align_x = 0.5; 1951 wd->align_x = 0.5;
1952 wd->align_y = 0.5; 1952 wd->align_y = 0.5;
1953 wd->h_bounce = bounce; 1953 wd->h_bounce = bounce;
@@ -2279,7 +2279,7 @@ elm_gengrid_clear(Evas_Object *obj)
2279 elm_widget_item_pre_notify_del(it); 2279 elm_widget_item_pre_notify_del(it);
2280 if (it->realized) elm_gen_item_unrealize(it, EINA_FALSE, (Ecore_Cb)_item_unrealize_cb); 2280 if (it->realized) elm_gen_item_unrealize(it, EINA_FALSE, (Ecore_Cb)_item_unrealize_cb);
2281 if (it->itc->func.del) 2281 if (it->itc->func.del)
2282 it->itc->func.del((void *)it->base.data, wd->self); 2282 it->itc->func.del((void *)it->base.data, wd->obj);
2283 if (it->long_timer) ecore_timer_del(it->long_timer); 2283 if (it->long_timer) ecore_timer_del(it->long_timer);
2284 free(it->item); 2284 free(it->item);
2285 elm_widget_item_del(it); 2285 elm_widget_item_del(it);
@@ -2857,7 +2857,7 @@ EAPI void
2857elm_gengrid_item_show(Elm_Gen_Item *it) 2857elm_gengrid_item_show(Elm_Gen_Item *it)
2858{ 2858{
2859 ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it); 2859 ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
2860 Widget_Data *wd = elm_widget_data_get(it->wd->self); 2860 Widget_Data *wd = elm_widget_data_get(WIDGET(it));
2861 Evas_Coord minx = 0, miny = 0; 2861 Evas_Coord minx = 0, miny = 0;
2862 2862
2863 if (!wd) return; 2863 if (!wd) return;
@@ -2885,7 +2885,7 @@ elm_gengrid_item_bring_in(Elm_Gen_Item *it)
2885 if (it->delete_me) return; 2885 if (it->delete_me) return;
2886 2886
2887 Evas_Coord minx = 0, miny = 0; 2887 Evas_Coord minx = 0, miny = 0;
2888 Widget_Data *wd = elm_widget_data_get(it->wd->self); 2888 Widget_Data *wd = elm_widget_data_get(WIDGET(it));
2889 if (!wd) return; 2889 if (!wd) return;
2890 _pan_min_get(wd->pan_smart, &minx, &miny); 2890 _pan_min_get(wd->pan_smart, &minx, &miny);
2891 2891