Merge remote-tracking branch 'remotes/origin/upstream'
[framework/uifw/elementary.git] / src / examples / genlist_example_02.c
index 43059ca..6899962 100644 (file)
 
 #define N_ITEMS 300
 
+<<<<<<< HEAD
 static Elm_Genlist_Item_Class _itc;
 
 static char *
 _item_text_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__)
+=======
+static Elm_Genlist_Item_Class *_itc = NULL;
+
+static char *
+_item_label_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__)
+>>>>>>> remotes/origin/upstream
 {
    time_t t = (time_t)ecore_time_unix_get();
    char buf[256];
@@ -55,6 +62,7 @@ _show_status_cb(void *data, Evas_Object *o __UNUSED__, void *event_info __UNUSED
 {
    Evas_Object *list = data;
    Evas_Coord x, y, w, h, mx, my;
+<<<<<<< HEAD
    Elm_Object_Item *it = elm_genlist_selected_item_get(list);
 
    const Eina_List *selected, *l, *realized;
@@ -64,21 +72,45 @@ _show_status_cb(void *data, Evas_Object *o __UNUSED__, void *event_info __UNUSED
    printf("all selected items (%d): ", eina_list_count(selected));
    EINA_LIST_FOREACH(selected, l, it)
      printf("%p ", it);
+=======
+   Elm_Object_Item *glit = elm_genlist_selected_item_get(list);
+
+   const Eina_List *selected, *l, *realized;
+   printf("\nfirst selected item: %p\n", glit);
+
+   selected = elm_genlist_selected_items_get(list);
+   printf("all selected items (%d): ", eina_list_count(selected));
+   EINA_LIST_FOREACH(selected, l, glit)
+     printf("%p ", glit);
+>>>>>>> remotes/origin/upstream
    printf("\n");
 
    realized = elm_genlist_realized_items_get(list);
    printf("realized items (%d): ", eina_list_count(realized));
+<<<<<<< HEAD
    EINA_LIST_FOREACH(realized, l, it)
       printf("%p  ", it);
    printf("\n");
    printf("genlist mode: %s\n", elm_genlist_mode_get(list));
    printf("mode item: %p\n", elm_genlist_mode_item_get(list));
+=======
+   EINA_LIST_FOREACH(realized, l, glit)
+     printf("%p  ", glit);
+   printf("\n");
+   printf("genlist mode: %s\n", elm_genlist_decorate_mode_get(list));
+   printf("mode item: %p\n", elm_genlist_decorated_item_get(list));
+>>>>>>> remotes/origin/upstream
 
    evas_object_geometry_get(list, &x, &y, &w, &h);
    mx = w / 2 + x;
    my = h / 2 + y;
+<<<<<<< HEAD
    it = elm_genlist_at_xy_item_get(list, mx, my, NULL);
    printf("item in the middle of the screen: %p\n", it);
+=======
+   glit = elm_genlist_at_xy_item_get(list, mx, my, NULL);
+   printf("item in the middle of the screen: %p\n", glit);
+>>>>>>> remotes/origin/upstream
 }
 
 static void
@@ -114,6 +146,7 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__)
 
    list = elm_genlist_add(win);
 
+<<<<<<< HEAD
    _itc.item_style = "default";
    _itc.func.text_get = _item_text_get;
    _itc.func.content_get = _item_content_get;
@@ -136,11 +169,45 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__)
    printf("no selection mode: %d\n", elm_genlist_no_select_mode_get(list));
    printf("height for width enabled: %d\n",
          elm_genlist_height_for_width_mode_get(list));
+=======
+   if (!_itc)
+     {
+        _itc = elm_genlist_item_class_new();
+        _itc->item_style = "default";
+        _itc->func.text_get = _item_label_get;
+        _itc->func.content_get = _item_content_get;
+        _itc->func.state_get = NULL;
+        _itc->func.del = NULL;
+     }
+
+   Eina_Bool hbounce, vbounce, always, no_sel;
+   Elm_Scroller_Policy hp, vp;
+   Elm_Object_Select_Mode sel_mode;
+
+   always = no_sel = EINA_FALSE;
+   sel_mode = elm_genlist_select_mode_get(list);
+   if (sel_mode = ELM_OBJECT_SELECT_MODE_ALWAYS)
+     always = EINA_TRUE;
+   else if (sel_mode = ELM_OBJECT_SELECT_MODE_NONE)
+     no_sel = EINA_TRUE;
+
+   printf("default values:\n");
+   printf("always select: %d\n", always);
+   elm_genlist_bounce_get(list, &hbounce, &vbounce);
+   printf("bounce - horizontal: %d, vertical: %d\n", hbounce, vbounce);
+   printf("homogeneous: %d\n", elm_genlist_homogeneous_get(list));
+   printf("horizontal mode: %d\n", elm_genlist_mode_get(list));
+   printf("longpress timeout: %0.3f\n",
+         elm_genlist_longpress_timeout_get(list));
+   printf("multi selection: %d\n", elm_genlist_multi_select_get(list));
+   printf("no selection mode: %d\n", no_sel);
+>>>>>>> remotes/origin/upstream
    elm_genlist_scroller_policy_get(list, &hp, &vp);
    printf("scroller policy - horizontal: %d, vertical: %d\n", hp, vp);
    printf("block count: %d\n", elm_genlist_block_count_get(list));
    printf("\n");
 
+<<<<<<< HEAD
    elm_genlist_always_select_mode_set(list, EINA_FALSE);
    elm_genlist_bounce_set(list, EINA_FALSE, EINA_FALSE);
    elm_genlist_compress_mode_set(list, EINA_TRUE);
@@ -149,13 +216,24 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__)
    elm_genlist_multi_select_set(list, EINA_TRUE);
    elm_genlist_no_select_mode_set(list, EINA_FALSE);
    elm_genlist_height_for_width_mode_set(list, EINA_FALSE);
+=======
+   elm_genlist_bounce_set(list, EINA_FALSE, EINA_FALSE);
+   elm_genlist_homogeneous_set(list, EINA_FALSE);
+   elm_genlist_mode_set(list, ELM_LIST_LIMIT);
+   elm_genlist_multi_select_set(list, EINA_TRUE);
+   elm_genlist_select_mode_set(list, ELM_OBJECT_SELECT_MODE_DEFAULT);
+>>>>>>> remotes/origin/upstream
    elm_genlist_scroller_policy_set(list, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_ON);
    elm_genlist_longpress_timeout_set(list, 0.5);
    elm_genlist_block_count_set(list, 16);
 
    for (i = 0; i < N_ITEMS; i++)
      {
+<<<<<<< HEAD
        elm_genlist_item_append(list, &_itc,
+=======
+       elm_genlist_item_append(list, _itc,
+>>>>>>> remotes/origin/upstream
                                (void *)(long)i, NULL,
                                ELM_GENLIST_ITEM_NONE,
                                _item_sel_cb, NULL);