summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2010-12-20 17:03:12 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2010-12-20 17:03:12 +0000
commitbdc6a18f50280eb77493757064a8d1a5ddabff8f (patch)
tree2377259c033cea0f2ccd5a107cb0a1c99680afa7 /src
parent2395bc6fda7c912217007571513382998eab0dc1 (diff)
Hello,
here is a patch for elm_genlist. Fixing Eina_Bool in elm_genlist. 0 -> EINA_FALSE 1 -> EINA_TRUE And fixed return value of _item_block_recalc from int to Eina_Bool. Anybody can review this and apply it to upstream? Thanks. Daniel Juyung Seo (SeoZ) SVN revision: 55673
Diffstat (limited to 'src')
-rw-r--r--src/lib/elm_genlist.c63
1 files changed, 32 insertions, 31 deletions
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index 684b1fa42..b46d6614c 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -1015,7 +1015,7 @@ _mouse_move(void *data,
1015 minh /= 2; 1015 minh /= 2;
1016 if ((adx > minw) || (ady > minh)) 1016 if ((adx > minw) || (ady > minh))
1017 { 1017 {
1018 it->dragging = 1; 1018 it->dragging = EINA_TRUE;
1019 if (it->long_timer) 1019 if (it->long_timer)
1020 { 1020 {
1021 ecore_timer_del(it->long_timer); 1021 ecore_timer_del(it->long_timer);
@@ -1114,8 +1114,8 @@ _mouse_down(void *data,
1114 it->wd->on_hold = EINA_TRUE; 1114 it->wd->on_hold = EINA_TRUE;
1115 } 1115 }
1116 1116
1117 it->down = 1; 1117 it->down = EINA_TRUE;
1118 it->dragging = 0; 1118 it->dragging = EINA_FALSE;
1119 evas_object_geometry_get(obj, &x, &y, NULL, NULL); 1119 evas_object_geometry_get(obj, &x, &y, NULL, NULL);
1120 it->dx = ev->canvas.x - x; 1120 it->dx = ev->canvas.x - x;
1121 it->dy = ev->canvas.y - y; 1121 it->dy = ev->canvas.y - y;
@@ -1150,7 +1150,7 @@ _mouse_up(void *data,
1150 Eina_Bool dragged = EINA_FALSE; 1150 Eina_Bool dragged = EINA_FALSE;
1151 1151
1152 if (ev->button != 1) return; 1152 if (ev->button != 1) return;
1153 it->down = 0; 1153 it->down = EINA_FALSE;
1154 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) it->wd->on_hold = EINA_TRUE; 1154 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) it->wd->on_hold = EINA_TRUE;
1155 else it->wd->on_hold = EINA_FALSE; 1155 else it->wd->on_hold = EINA_FALSE;
1156 if (it->long_timer) 1156 if (it->long_timer)
@@ -1160,7 +1160,7 @@ _mouse_up(void *data,
1160 } 1160 }
1161 if (it->dragging) 1161 if (it->dragging)
1162 { 1162 {
1163 it->dragging = 0; 1163 it->dragging = EINA_FALSE;
1164 evas_object_smart_callback_call(it->base.widget, "drag,stop", it); 1164 evas_object_smart_callback_call(it->base.widget, "drag,stop", it);
1165 dragged = 1; 1165 dragged = 1;
1166 } 1166 }
@@ -1181,7 +1181,7 @@ _mouse_up(void *data,
1181 it->wd->longpressed = EINA_FALSE; 1181 it->wd->longpressed = EINA_FALSE;
1182 if (!it->wd->wasselected) 1182 if (!it->wd->wasselected)
1183 _item_unselect(it); 1183 _item_unselect(it);
1184 it->wd->wasselected = 0; 1184 it->wd->wasselected = EINA_FALSE;
1185 return; 1185 return;
1186 } 1186 }
1187 if (dragged) 1187 if (dragged)
@@ -1653,7 +1653,7 @@ _item_unrealize(Elm_Genlist_Item *it)
1653 it->want_unrealize = EINA_FALSE; 1653 it->want_unrealize = EINA_FALSE;
1654} 1654}
1655 1655
1656static int 1656static Eina_Bool
1657_item_block_recalc(Item_Block *itb, 1657_item_block_recalc(Item_Block *itb,
1658 int in, 1658 int in,
1659 int qadd, 1659 int qadd,
@@ -1662,7 +1662,7 @@ _item_block_recalc(Item_Block *itb,
1662 const Eina_List *l; 1662 const Eina_List *l;
1663 Elm_Genlist_Item *it; 1663 Elm_Genlist_Item *it;
1664 Evas_Coord minw = 0, minh = 0; 1664 Evas_Coord minw = 0, minh = 0;
1665 int showme = 0, changed = 0; 1665 Eina_Bool showme = EINA_FALSE, changed = EINA_FALSE;
1666 Evas_Coord y = 0; 1666 Evas_Coord y = 0;
1667 1667
1668 itb->num = in; 1668 itb->num = in;
@@ -1674,7 +1674,7 @@ _item_block_recalc(Item_Block *itb,
1674 { 1674 {
1675 if (qadd) 1675 if (qadd)
1676 { 1676 {
1677 if (!it->mincalcd) changed = 1; 1677 if (!it->mincalcd) changed = EINA_TRUE;
1678 if (changed) 1678 if (changed)
1679 { 1679 {
1680 _item_realize(it, in, 1); 1680 _item_realize(it, in, 1);
@@ -1728,14 +1728,14 @@ _item_block_unrealize(Item_Block *itb)
1728{ 1728{
1729 const Eina_List *l; 1729 const Eina_List *l;
1730 Elm_Genlist_Item *it; 1730 Elm_Genlist_Item *it;
1731 int dragging = 0; 1731 Eina_Bool dragging = EINA_FALSE;
1732 1732
1733 if (!itb->realized) return; 1733 if (!itb->realized) return;
1734 EINA_LIST_FOREACH(itb->items, l, it) 1734 EINA_LIST_FOREACH(itb->items, l, it)
1735 { 1735 {
1736 if (it->dragging) 1736 if (it->dragging)
1737 { 1737 {
1738 dragging = 1; 1738 dragging = EINA_TRUE;
1739 it->want_unrealize = EINA_TRUE; 1739 it->want_unrealize = EINA_TRUE;
1740 } 1740 }
1741 else 1741 else
@@ -1829,11 +1829,11 @@ _calc_job(void *data)
1829 1829
1830 EINA_INLIST_FOREACH(wd->blocks, itb) 1830 EINA_INLIST_FOREACH(wd->blocks, itb)
1831 { 1831 {
1832 int showme = 0; 1832 Eina_Bool showme = EINA_FALSE;
1833 1833
1834 itb->num = in; 1834 itb->num = in;
1835 showme = itb->showme; 1835 showme = itb->showme;
1836 itb->showme = 0; 1836 itb->showme = EINA_FALSE;
1837 if (chb) 1837 if (chb)
1838 { 1838 {
1839 if (itb->realized) _item_block_unrealize(itb); 1839 if (itb->realized) _item_block_unrealize(itb);
@@ -1870,7 +1870,7 @@ _calc_job(void *data)
1870 in += itb->count; 1870 in += itb->count;
1871 if ((showme) && (wd->show_item)) 1871 if ((showme) && (wd->show_item))
1872 { 1872 {
1873 wd->show_item->showme = 0; 1873 wd->show_item->showme = EINA_FALSE;
1874 if (wd->bring_in) 1874 if (wd->bring_in)
1875 elm_smart_scroller_region_bring_in(wd->scr, 1875 elm_smart_scroller_region_bring_in(wd->scr,
1876 wd->show_item->x + 1876 wd->show_item->x +
@@ -1967,7 +1967,7 @@ _update_job(void *data)
1967 itminw = it->w; 1967 itminw = it->w;
1968 itminh = it->h; 1968 itminh = it->h;
1969 1969
1970 it->updateme = 0; 1970 it->updateme = EINA_FALSE;
1971 if (it->realized) 1971 if (it->realized)
1972 { 1972 {
1973 _item_unrealize(it); 1973 _item_unrealize(it);
@@ -1984,7 +1984,7 @@ _update_job(void *data)
1984 } 1984 }
1985 num++; 1985 num++;
1986 } 1986 }
1987 itb->updateme = 0; 1987 itb->updateme = EINA_FALSE;
1988 if (recalc) 1988 if (recalc)
1989 { 1989 {
1990 position = 1; 1990 position = 1;
@@ -2530,7 +2530,8 @@ static int
2530_queue_proecess(Widget_Data *wd, 2530_queue_proecess(Widget_Data *wd,
2531 int norender) 2531 int norender)
2532{ 2532{
2533 int n, showme = 0; 2533 int n;
2534 Eina_Bool showme = EINA_FALSE;
2534 double t0, t; 2535 double t0, t;
2535 2536
2536 t0 = ecore_time_get(); 2537 t0 = ecore_time_get();
@@ -2549,7 +2550,7 @@ _queue_proecess(Widget_Data *wd,
2549 norender); 2550 norender);
2550 it->block->changed = 0; 2551 it->block->changed = 0;
2551 } 2552 }
2552 if (showme) it->block->showme = 1; 2553 if (showme) it->block->showme = EINA_TRUE;
2553 if (eina_inlist_count(wd->blocks) > 1) 2554 if (eina_inlist_count(wd->blocks) > 1)
2554 { 2555 {
2555 if ((t - t0) > (ecore_animator_frametime_get())) break; 2556 if ((t - t0) > (ecore_animator_frametime_get())) break;
@@ -2653,7 +2654,7 @@ elm_genlist_item_append(Evas_Object *obj,
2653 it->rel = it2; 2654 it->rel = it2;
2654 it->rel->relcount++; 2655 it->rel->relcount++;
2655 } 2656 }
2656 it->before = 0; 2657 it->before = EINA_FALSE;
2657 _item_queue(wd, it); 2658 _item_queue(wd, it);
2658 return it; 2659 return it;
2659} 2660}
@@ -2697,7 +2698,7 @@ elm_genlist_item_prepend(Evas_Object *obj,
2697 printf("FIXME: 12 tree not handled yet\n"); 2698 printf("FIXME: 12 tree not handled yet\n");
2698 } 2699 }
2699 it->rel = NULL; 2700 it->rel = NULL;
2700 it->before = 1; 2701 it->before = EINA_TRUE;
2701 _item_queue(wd, it); 2702 _item_queue(wd, it);
2702 return it; 2703 return it;
2703} 2704}
@@ -2744,7 +2745,7 @@ elm_genlist_item_insert_before(Evas_Object *obj,
2744 } 2745 }
2745 it->rel = before; 2746 it->rel = before;
2746 it->rel->relcount++; 2747 it->rel->relcount++;
2747 it->before = 1; 2748 it->before = EINA_TRUE;
2748 _item_queue(wd, it); 2749 _item_queue(wd, it);
2749 return it; 2750 return it;
2750} 2751}
@@ -2791,7 +2792,7 @@ elm_genlist_item_insert_after(Evas_Object *obj,
2791 } 2792 }
2792 it->rel = after; 2793 it->rel = after;
2793 it->rel->relcount++; 2794 it->rel->relcount++;
2794 it->before = 0; 2795 it->before = EINA_FALSE;
2795 _item_queue(wd, it); 2796 _item_queue(wd, it);
2796 return it; 2797 return it;
2797} 2798}
@@ -2815,14 +2816,14 @@ elm_genlist_clear(Evas_Object *obj)
2815 { 2816 {
2816 Elm_Genlist_Item *it; 2817 Elm_Genlist_Item *it;
2817 2818
2818 wd->clear_me = 1; 2819 wd->clear_me = EINA_TRUE;
2819 EINA_INLIST_FOREACH(wd->items, it) 2820 EINA_INLIST_FOREACH(wd->items, it)
2820 { 2821 {
2821 it->delete_me = 1; 2822 it->delete_me = EINA_TRUE;
2822 } 2823 }
2823 return; 2824 return;
2824 } 2825 }
2825 wd->clear_me = 0; 2826 wd->clear_me = EINA_FALSE;
2826 while (wd->items) 2827 while (wd->items)
2827 { 2828 {
2828 Elm_Genlist_Item *it = ELM_GENLIST_ITEM_FROM_INLIST(wd->items); 2829 Elm_Genlist_Item *it = ELM_GENLIST_ITEM_FROM_INLIST(wd->items);
@@ -3467,7 +3468,7 @@ elm_genlist_item_show(Elm_Genlist_Item *it)
3467 if ((it->queued) || (!it->mincalcd)) 3468 if ((it->queued) || (!it->mincalcd))
3468 { 3469 {
3469 it->wd->show_item = it; 3470 it->wd->show_item = it;
3470 it->wd->bring_in = 1; 3471 it->wd->bring_in = EINA_TRUE;
3471 it->showme = EINA_TRUE; 3472 it->showme = EINA_TRUE;
3472 return; 3473 return;
3473 } 3474 }
@@ -3501,7 +3502,7 @@ elm_genlist_item_bring_in(Elm_Genlist_Item *it)
3501 if ((it->queued) || (!it->mincalcd)) 3502 if ((it->queued) || (!it->mincalcd))
3502 { 3503 {
3503 it->wd->show_item = it; 3504 it->wd->show_item = it;
3504 it->wd->bring_in = 1; 3505 it->wd->bring_in = EINA_TRUE;
3505 it->showme = EINA_TRUE; 3506 it->showme = EINA_TRUE;
3506 return; 3507 return;
3507 } 3508 }
@@ -3536,7 +3537,7 @@ elm_genlist_item_top_show(Elm_Genlist_Item *it)
3536 if ((it->queued) || (!it->mincalcd)) 3537 if ((it->queued) || (!it->mincalcd))
3537 { 3538 {
3538 it->wd->show_item = it; 3539 it->wd->show_item = it;
3539 it->wd->bring_in = 1; 3540 it->wd->bring_in = EINA_TRUE;
3540 it->showme = EINA_TRUE; 3541 it->showme = EINA_TRUE;
3541 return; 3542 return;
3542 } 3543 }
@@ -3573,7 +3574,7 @@ elm_genlist_item_top_bring_in(Elm_Genlist_Item *it)
3573 if ((it->queued) || (!it->mincalcd)) 3574 if ((it->queued) || (!it->mincalcd))
3574 { 3575 {
3575 it->wd->show_item = it; 3576 it->wd->show_item = it;
3576 it->wd->bring_in = 1; 3577 it->wd->bring_in = EINA_TRUE;
3577 it->showme = EINA_TRUE; 3578 it->showme = EINA_TRUE;
3578 return; 3579 return;
3579 } 3580 }
@@ -3609,7 +3610,7 @@ elm_genlist_item_middle_show(Elm_Genlist_Item *it)
3609 if ((it->queued) || (!it->mincalcd)) 3610 if ((it->queued) || (!it->mincalcd))
3610 { 3611 {
3611 it->wd->show_item = it; 3612 it->wd->show_item = it;
3612 it->wd->bring_in = 1; 3613 it->wd->bring_in = EINA_TRUE;
3613 it->showme = EINA_TRUE; 3614 it->showme = EINA_TRUE;
3614 return; 3615 return;
3615 } 3616 }
@@ -3646,7 +3647,7 @@ elm_genlist_item_middle_bring_in(Elm_Genlist_Item *it)
3646 if ((it->queued) || (!it->mincalcd)) 3647 if ((it->queued) || (!it->mincalcd))
3647 { 3648 {
3648 it->wd->show_item = it; 3649 it->wd->show_item = it;
3649 it->wd->bring_in = 1; 3650 it->wd->bring_in = EINA_TRUE;
3650 it->showme = EINA_TRUE; 3651 it->showme = EINA_TRUE;
3651 return; 3652 return;
3652 } 3653 }