summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2011-10-21 23:53:41 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2011-10-21 23:53:41 +0000
commit9987b1034f3867b118ce3efc5509b27750ebefba (patch)
treeecf10fa575e08a2faaa43e55818842350c9bc986 /legacy
parent9cffa1a766a2053ed60675ca5200622e144aee44 (diff)
implement the following:
EAPI void elm_gen_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select); EAPI Eina_Bool elm_gen_always_select_mode_get(const Evas_Object *obj); EAPI void elm_gen_no_select_mode_set(Evas_Object *obj, Eina_Bool no_select); EAPI Eina_Bool elm_gen_no_select_mode_get(const Evas_Object *obj); EAPI void elm_gen_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce); EAPI void elm_gen_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce); EAPI void elm_gen_page_relative_set(Evas_Object *obj, double h_pagerel, double v_pagerel); EAPI void elm_gen_page_relative_get(const Evas_Object *obj, double *h_pagerel, double *v_pagerel); EAPI void elm_gen_page_size_set(Evas_Object *obj, Evas_Coord h_pagesize, Evas_Coord v_pagesize); EAPI void elm_gen_current_page_get(const Evas_Object *obj, int *h_pagenumber, int *v_pagenumber); EAPI void elm_gen_last_page_get(const Evas_Object *obj, int *h_pagenumber, int *v_pagenumber); EAPI void elm_gen_page_show(const Evas_Object *obj, int h_pagenumber, int v_pagenumber); EAPI void elm_gen_page_bring_in(const Evas_Object *obj, int h_pagenumber, int v_pagenumber); EAPI Elm_Gen_Item *elm_gen_first_item_get(const Evas_Object *obj); EAPI Elm_Gen_Item *elm_gen_last_item_get(const Evas_Object *obj); EAPI Elm_Gen_Item *elm_gen_item_next_get(const Elm_Gen_Item *it); EAPI Elm_Gen_Item *elm_gen_item_prev_get(const Elm_Gen_Item *it); EAPI Evas_Object *elm_gen_item_gen_get(const Elm_Gen_Item *it); SVN revision: 64281
Diffstat (limited to 'legacy')
-rw-r--r--legacy/elementary/src/lib/Elementary.h.in18
-rw-r--r--legacy/elementary/src/lib/elm_gen.c205
2 files changed, 223 insertions, 0 deletions
diff --git a/legacy/elementary/src/lib/Elementary.h.in b/legacy/elementary/src/lib/Elementary.h.in
index 97fe4d69bd..fc80c3cde5 100644
--- a/legacy/elementary/src/lib/Elementary.h.in
+++ b/legacy/elementary/src/lib/Elementary.h.in
@@ -7923,6 +7923,24 @@ extern "C" {
7923 EAPI void elm_gen_clear(Evas_Object *obj); 7923 EAPI void elm_gen_clear(Evas_Object *obj);
7924 EAPI void elm_gen_item_selected_set(Elm_Gen_Item *it, Eina_Bool selected); 7924 EAPI void elm_gen_item_selected_set(Elm_Gen_Item *it, Eina_Bool selected);
7925 EAPI Eina_Bool elm_gen_item_selected_get(const Elm_Gen_Item *it); 7925 EAPI Eina_Bool elm_gen_item_selected_get(const Elm_Gen_Item *it);
7926 EAPI void elm_gen_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select);
7927 EAPI Eina_Bool elm_gen_always_select_mode_get(const Evas_Object *obj);
7928 EAPI void elm_gen_no_select_mode_set(Evas_Object *obj, Eina_Bool no_select);
7929 EAPI Eina_Bool elm_gen_no_select_mode_get(const Evas_Object *obj);
7930 EAPI void elm_gen_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce);
7931 EAPI void elm_gen_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce);
7932 EAPI void elm_gen_page_relative_set(Evas_Object *obj, double h_pagerel, double v_pagerel);
7933 EAPI void elm_gen_page_relative_get(const Evas_Object *obj, double *h_pagerel, double *v_pagerel);
7934 EAPI void elm_gen_page_size_set(Evas_Object *obj, Evas_Coord h_pagesize, Evas_Coord v_pagesize);
7935 EAPI void elm_gen_current_page_get(const Evas_Object *obj, int *h_pagenumber, int *v_pagenumber);
7936 EAPI void elm_gen_last_page_get(const Evas_Object *obj, int *h_pagenumber, int *v_pagenumber);
7937 EAPI void elm_gen_page_show(const Evas_Object *obj, int h_pagenumber, int v_pagenumber);
7938 EAPI void elm_gen_page_bring_in(const Evas_Object *obj, int h_pagenumber, int v_pagenumber);
7939 EAPI Elm_Gen_Item *elm_gen_first_item_get(const Evas_Object *obj);
7940 EAPI Elm_Gen_Item *elm_gen_last_item_get(const Evas_Object *obj);
7941 EAPI Elm_Gen_Item *elm_gen_item_next_get(const Elm_Gen_Item *it);
7942 EAPI Elm_Gen_Item *elm_gen_item_prev_get(const Elm_Gen_Item *it);
7943 EAPI Evas_Object *elm_gen_item_gen_get(const Elm_Gen_Item *it);
7926 7944
7927 /** 7945 /**
7928 * @defgroup Gengrid Gengrid (Generic grid) 7946 * @defgroup Gengrid Gengrid (Generic grid)
diff --git a/legacy/elementary/src/lib/elm_gen.c b/legacy/elementary/src/lib/elm_gen.c
index c6ff7f5315..e5858184f5 100644
--- a/legacy/elementary/src/lib/elm_gen.c
+++ b/legacy/elementary/src/lib/elm_gen.c
@@ -42,6 +42,8 @@ struct _Widget_Data
42 Eina_Bool wasselected : 1; 42 Eina_Bool wasselected : 1;
43 Eina_Bool always_select : 1; 43 Eina_Bool always_select : 1;
44 Eina_Bool clear_me : 1; 44 Eina_Bool clear_me : 1;
45 Eina_Bool h_bounce : 1;
46 Eina_Bool v_bounce : 1;
45 Ecore_Cb del_cb, calc_cb, sizing_cb; 47 Ecore_Cb del_cb, calc_cb, sizing_cb;
46 Ecore_Cb clear_cb; 48 Ecore_Cb clear_cb;
47}; 49};
@@ -524,3 +526,206 @@ elm_gen_item_selected_get(const Elm_Gen_Item *it)
524 ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, EINA_FALSE); 526 ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, EINA_FALSE);
525 return it->selected; 527 return it->selected;
526} 528}
529
530EAPI void
531elm_gen_always_select_mode_set(Evas_Object *obj,
532 Eina_Bool always_select)
533{
534 ELM_CHECK_WIDTYPE(obj, widtype);
535 Widget_Data *wd = elm_widget_data_get(obj);
536 if (!wd) return;
537 wd->always_select = always_select;
538}
539
540EAPI Eina_Bool
541elm_gen_always_select_mode_get(const Evas_Object *obj)
542{
543 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
544 Widget_Data *wd = elm_widget_data_get(obj);
545 if (!wd) return EINA_FALSE;
546 return wd->always_select;
547}
548
549EAPI void
550elm_gen_no_select_mode_set(Evas_Object *obj,
551 Eina_Bool no_select)
552{
553 ELM_CHECK_WIDTYPE(obj, widtype);
554 Widget_Data *wd = elm_widget_data_get(obj);
555 if (!wd) return;
556 wd->no_select = no_select;
557}
558
559EAPI Eina_Bool
560elm_gen_no_select_mode_get(const Evas_Object *obj)
561{
562 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
563 Widget_Data *wd = elm_widget_data_get(obj);
564 if (!wd) return EINA_FALSE;
565 return wd->no_select;
566}
567
568EAPI void
569elm_gen_bounce_set(Evas_Object *obj,
570 Eina_Bool h_bounce,
571 Eina_Bool v_bounce)
572{
573 ELM_CHECK_WIDTYPE(obj, widtype);
574 Widget_Data *wd = elm_widget_data_get(obj);
575 if (!wd) return;
576 elm_smart_scroller_bounce_allow_set(wd->scr, h_bounce, v_bounce);
577 wd->h_bounce = h_bounce;
578 wd->v_bounce = v_bounce;
579}
580
581EAPI void
582elm_gen_bounce_get(const Evas_Object *obj,
583 Eina_Bool *h_bounce,
584 Eina_Bool *v_bounce)
585{
586 ELM_CHECK_WIDTYPE(obj, widtype);
587 Widget_Data *wd = elm_widget_data_get(obj);
588 if (!wd) return;
589 if (h_bounce) *h_bounce = wd->h_bounce;
590 if (v_bounce) *v_bounce = wd->v_bounce;
591}
592
593EAPI void
594elm_gen_page_relative_set(Evas_Object *obj,
595 double h_pagerel,
596 double v_pagerel)
597{
598 Evas_Coord pagesize_h;
599 Evas_Coord pagesize_v;
600
601 ELM_CHECK_WIDTYPE(obj, widtype);
602 Widget_Data *wd = elm_widget_data_get(obj);
603 if (!wd) return;
604
605 elm_smart_scroller_paging_get(wd->scr, NULL, NULL, &pagesize_h, &pagesize_v);
606 elm_smart_scroller_paging_set(wd->scr, h_pagerel, v_pagerel, pagesize_h,
607 pagesize_v);
608}
609
610EAPI void
611elm_gen_page_relative_get(const Evas_Object *obj, double *h_pagerel, double *v_pagerel)
612{
613 ELM_CHECK_WIDTYPE(obj, widtype);
614 Widget_Data *wd = elm_widget_data_get(obj);
615 if (!wd) return;
616
617 elm_smart_scroller_paging_get(wd->scr, h_pagerel, v_pagerel, NULL, NULL);
618}
619
620EAPI void
621elm_gen_page_size_set(Evas_Object *obj,
622 Evas_Coord h_pagesize,
623 Evas_Coord v_pagesize)
624{
625 double pagerel_h;
626 double pagerel_v;
627
628 ELM_CHECK_WIDTYPE(obj, widtype);
629 Widget_Data *wd = elm_widget_data_get(obj);
630 if (!wd) return;
631 elm_smart_scroller_paging_get(wd->scr, &pagerel_h, &pagerel_v, NULL, NULL);
632 elm_smart_scroller_paging_set(wd->scr, pagerel_h, pagerel_v, h_pagesize,
633 v_pagesize);
634}
635
636EAPI void
637elm_gen_current_page_get(const Evas_Object *obj, int *h_pagenumber, int *v_pagenumber)
638{
639 ELM_CHECK_WIDTYPE(obj, widtype);
640 Widget_Data *wd = elm_widget_data_get(obj);
641 if (!wd) return;
642 if (wd->scr)
643 elm_smart_scroller_current_page_get(wd->scr, h_pagenumber, v_pagenumber);
644}
645
646EAPI void
647elm_gen_last_page_get(const Evas_Object *obj, int *h_pagenumber, int *v_pagenumber)
648{
649 ELM_CHECK_WIDTYPE(obj, widtype);
650 Widget_Data *wd = elm_widget_data_get(obj);
651 if (!wd) return;
652 if (wd->scr)
653 elm_smart_scroller_last_page_get(wd->scr, h_pagenumber, v_pagenumber);
654}
655
656EAPI void
657elm_gen_page_show(const Evas_Object *obj, int h_pagenumber, int v_pagenumber)
658{
659 ELM_CHECK_WIDTYPE(obj, widtype);
660 Widget_Data *wd = elm_widget_data_get(obj);
661 if (!wd) return;
662 if (wd->scr)
663 elm_smart_scroller_page_show(wd->scr, h_pagenumber, v_pagenumber);
664}
665
666EAPI void
667elm_gen_page_bring_in(const Evas_Object *obj, int h_pagenumber, int v_pagenumber)
668{
669 ELM_CHECK_WIDTYPE(obj, widtype);
670 Widget_Data *wd = elm_widget_data_get(obj);
671 if (!wd) return;
672 if (wd->scr)
673 elm_smart_scroller_page_bring_in(wd->scr, h_pagenumber, v_pagenumber);
674}
675
676EAPI Elm_Gen_Item *
677elm_gen_first_item_get(const Evas_Object *obj)
678{
679 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
680 Widget_Data *wd = elm_widget_data_get(obj);
681 if (!wd) return NULL;
682 if (!wd->items) return NULL;
683 Elm_Gen_Item *it = ELM_GEN_ITEM_FROM_INLIST(wd->items);
684 while ((it) && (it->delete_me))
685 it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
686 return it;
687}
688
689EAPI Elm_Gen_Item *
690elm_gen_last_item_get(const Evas_Object *obj)
691{
692 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
693 Widget_Data *wd = elm_widget_data_get(obj);
694 if (!wd) return NULL;
695 if (!wd->items) return NULL;
696 Elm_Gen_Item *it = ELM_GEN_ITEM_FROM_INLIST(wd->items->last);
697 while ((it) && (it->delete_me))
698 it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
699 return it;
700}
701
702EAPI Elm_Gen_Item *
703elm_gen_item_next_get(const Elm_Gen_Item *it)
704{
705 ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, NULL);
706 while (it)
707 {
708 it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
709 if ((it) && (!it->delete_me)) break;
710 }
711 return (Elm_Gen_Item *)it;
712}
713
714EAPI Elm_Gen_Item *
715elm_gen_item_prev_get(const Elm_Gen_Item *it)
716{
717 ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, NULL);
718 while (it)
719 {
720 it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
721 if ((it) && (!it->delete_me)) break;
722 }
723 return (Elm_Gen_Item *)it;
724}
725
726EAPI Evas_Object *
727elm_gen_item_gen_get(const Elm_Gen_Item *it)
728{
729 ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, NULL);
730 return WIDGET(it);
731}