elm_smart_scroller_object_theme_set(obj, wd->scr, "gengrid", "base",
"default");
elm_smart_scroller_bounce_allow_set(wd->scr, bounce,
- _elm_config->thumbscroll_bounce_enable);
+ _elm_config->thumbscroll_bounce_enable);
elm_widget_resize_object_set(obj, wd->scr);
evas_object_smart_callback_add(wd->scr, "animate,start", _scr_anim_start, obj);
EAPI void
elm_gengrid_horizontal_set(Evas_Object *obj,
- Eina_Bool setting)
+ Eina_Bool horizontal)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- if (setting == wd->horizontal) return;
- wd->horizontal = setting;
+ horizontal = !!horizontal;
+ if (horizontal == wd->horizontal) return;
+ wd->horizontal = horizontal;
/* Update the items to conform to the new layout */
if (wd->calc_job) ecore_job_del(wd->calc_job);
EAPI const Elm_Gengrid_Item_Class *
elm_gengrid_item_item_class_get(const Elm_Object_Item *it)
{
- ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
- Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
- if (_it->generation < _it->wd->generation) return NULL;
- return _it->itc;
+ return (Elm_Gengrid_Item_Class *) elm_genlist_item_item_class_get(it);
}
EAPI void
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- wd->multi = multi;
+ wd->multi = !!multi;
}
EAPI Eina_Bool
EAPI const Eina_List *
elm_gengrid_selected_items_get(const Evas_Object *obj)
{
- ELM_CHECK_WIDTYPE(obj, widtype) NULL;
- Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd) return NULL;
- return wd->selected;
+ return elm_gengrid_selected_items_get(obj);
}
EAPI void
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- wd->reorder_mode = reorder_mode;
+ wd->reorder_mode = !!reorder_mode;
}
EAPI Eina_Bool
return itc;
}
+//XXX: notify class version to user if it is mismatched
EAPI void
elm_gengrid_item_class_free(Elm_Gengrid_Item_Class *itc)
{
}
}
+//XXX: notify class version to user if it is mismatched
EAPI void
elm_gengrid_item_class_ref(Elm_Gengrid_Item_Class *itc)
{
}
}
+//XXX: notify class version to user if it is mismatched
EAPI void
elm_gengrid_item_class_unref(Elm_Gengrid_Item_Class *itc)
{
*
* @ingroup Gengrid
*/
+//XXX: should be removed.
EAPI Elm_Object_Item *elm_gengrid_item_direct_sorted_insert(Evas_Object *obj, const Elm_Gengrid_Item_Class *gic, const void *data, Eina_Compare_Cb comp, Evas_Smart_Cb func, const void *func_data);
/**
*
* @ingroup Gengrid
*/
+//XXX: How about elm_gengrid_select_mode_set() ?
EAPI void elm_gengrid_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select);
/**
*
* @ingroup Gengrid
*/
+//XXX: How about elm_gengrid_select_mode_get() ?
EAPI Eina_Bool elm_gengrid_always_select_mode_get(const Evas_Object *obj);
/**
*
* @ingroup Gengrid
*/
+//XXX: elm_gengrid_always_select_mode_set and elm_gengrid_no_select_mode_set API could be merged to elm_genlist_select_mode_set()
EAPI void elm_gengrid_no_select_mode_set(Evas_Object *obj, Eina_Bool no_select);
/**
*
* @ingroup Gengrid
*/
+//XXX: elm_gengrid_always_select_mode_get and elm_gengrid_no_select_mode_get API could be merged to elm_genlist_select_mode_get()
EAPI Eina_Bool elm_gengrid_no_select_mode_get(const Evas_Object *obj);
/**
EAPI void elm_gengrid_current_page_get(const Evas_Object *obj, int *h_pagenumber, int *v_pagenumber);
/**
- * @brief Get scroll last page number.
+ * @brief Get gengrid last page number.
*
* @param obj The gengrid object
* @param h_pagenumber The horizontal page number
* placing its items.
*
* @param obj The gengrid object.
- * @param setting @c EINA_TRUE to make the gengrid expand
+ * @param horizontal @c EINA_TRUE to make the gengrid expand
* horizontally, @c EINA_FALSE to expand vertically.
*
* When in "horizontal mode" (@c EINA_TRUE), items will be placed
*
* @ingroup Gengrid
*/
-EAPI void elm_gengrid_horizontal_set(Evas_Object *obj, Eina_Bool setting);
+//XXX: elm_gengrid_mode_set()
+EAPI void elm_gengrid_horizontal_set(Evas_Object *obj, Eina_Bool horizontal);
/**
* Get for what direction a given gengrid widget will expand while
EAPI void elm_gengrid_item_selected_set(Elm_Object_Item *it, Eina_Bool selected);
/**
+ * Get the selected item in a given gengrid widget
+ *
+ * @param obj The gengrid object.
+ * @return The selected item's handle or @c NULL, if none is
+ * selected at the moment (and on errors)
+ *
+ * This returns the selected item in @p obj. If multi selection is
+ * enabled on @p obj (@see elm_gengrid_multi_select_set()), only
+ * the first item in the list is selected, which might not be very
+ * useful. For that case, see elm_gengrid_selected_items_get().
+ *
+ * @ingroup Gengrid
+ */
+EAPI Elm_Object_Item *elm_gengrid_selected_item_get(const Evas_Object *obj);
+
+/**
+ * Get <b>a list</b> of selected items in a given gengrid
+ *
+ * @param obj The gengrid object.
+ * @return The list of selected items or @c NULL, if none is
+ * selected at the moment (and on errors)
+ *
+ * This returns a list of the selected items, in the order that
+ * they appear in the grid. This list is only valid as long as no
+ * more items are selected or unselected (or unselected implicitly
+ * by deletion). The list contains #Gengrid item pointers as
+ * data, naturally.
+ *
+ * @see elm_gengrid_selected_item_get()
+ *
+ * @ingroup Gengrid
+ */
+EAPI const Eina_List *elm_gengrid_selected_items_get(const Evas_Object *obj);
+
+/**
* Get whether a given gengrid item is selected or not
*
* @param it The gengrid item
*
* @ingroup Gengrid
*/
+//XXX: Should be dead.
EAPI const Evas_Object *elm_gengrid_item_object_get(const Elm_Object_Item *it);
/**
*/
EAPI void elm_gengrid_item_bring_in(Elm_Object_Item *it);
+//XXX: Need to review tooltip & cursor APIs
+
/**
* Set the text to be shown in a given gengrid item's tooltips.
*
EAPI void elm_gengrid_clear(Evas_Object *obj);
/**
- * Get the selected item in a given gengrid widget
- *
- * @param obj The gengrid object.
- * @return The selected item's handle or @c NULL, if none is
- * selected at the moment (and on errors)
- *
- * This returns the selected item in @p obj. If multi selection is
- * enabled on @p obj (@see elm_gengrid_multi_select_set()), only
- * the first item in the list is selected, which might not be very
- * useful. For that case, see elm_gengrid_selected_items_get().
- *
- * @ingroup Gengrid
- */
-EAPI Elm_Object_Item *elm_gengrid_selected_item_get(const Evas_Object *obj);
-
-/**
- * Get <b>a list</b> of selected items in a given gengrid
- *
- * @param obj The gengrid object.
- * @return The list of selected items or @c NULL, if none is
- * selected at the moment (and on errors)
- *
- * This returns a list of the selected items, in the order that
- * they appear in the grid. This list is only valid as long as no
- * more items are selected or unselected (or unselected implicitly
- * by deletion). The list contains #Gengrid item pointers as
- * data, naturally.
- *
- * @see elm_gengrid_selected_item_get()
- *
- * @ingroup Gengrid
- */
-EAPI const Eina_List *elm_gengrid_selected_items_get(const Evas_Object *obj);
-
-/**
* Set how the items grid's filled within a given gengrid widget
*
* @param obj The gengrid object.
* @param fill Filled if True
*
* This sets the fill state of the whole grid of items of a gengrid
- * within its given viewport. By default, this value is False, meaning
- * that if the first line of items grid's aren't filled
- *
- * Set how the items grid's filled within a given gengrid widget.
- * This sets the fill state of the whole grid of items of a gengrid
* within its given viewport. By default, this value is false, meaning
* that if the first line of items grid's isn't filled, the items are
* centered with the alignment
* @see elm_gengrid_filled_get()
*
* @ingroup Gengrid
+ *
*/
+//XXX: Does this API working well?
EAPI void elm_gengrid_filled_set(Evas_Object *obj, Eina_Bool fill);
-
/**
* Get how the items grid's filled within a given gengrid widget
*
*
* @ingroup Gengrid
*/
+//XXX: Does this API working well?
EAPI Eina_Bool elm_gengrid_filled_get(const Evas_Object *obj);
#define ELM_GENGRID_ITEM_CLASS_VERSION 2 /* current version number */
return itc;
}
+//XXX: notify the class version if it is mismatched
EAPI void
elm_genlist_item_class_free(Elm_Genlist_Item_Class *itc)
{
}
}
+//XXX: notify the class version if it is mismatched
EAPI void
elm_genlist_item_class_ref(Elm_Genlist_Item_Class *itc)
{
}
}
+//XXX: notify the class version if it is mismatched
EAPI void
elm_genlist_item_class_unref(Elm_Genlist_Item_Class *itc)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- if (wd->scr)
- elm_smart_scroller_current_page_get(wd->scr, h_pagenumber, v_pagenumber);
+ elm_smart_scroller_current_page_get(wd->scr, h_pagenumber, v_pagenumber);
}
/* for gengrid as of now */
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- if (wd->scr)
- elm_smart_scroller_last_page_get(wd->scr, h_pagenumber, v_pagenumber);
+ elm_smart_scroller_last_page_get(wd->scr, h_pagenumber, v_pagenumber);
}
/* for gengrid as of now */
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- if (wd->scr)
- elm_smart_scroller_page_show(wd->scr, h_pagenumber, v_pagenumber);
+ elm_smart_scroller_page_show(wd->scr, h_pagenumber, v_pagenumber);
}
/* for gengrid as of now */
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- if (wd->scr)
- elm_smart_scroller_page_bring_in(wd->scr, h_pagenumber, v_pagenumber);
+ elm_smart_scroller_page_bring_in(wd->scr, h_pagenumber, v_pagenumber);
}
void