* @}
*/
- typedef struct _Elm_Ctxpopup_Item Elm_Ctxpopup_Item;
-
/**
* @defgroup Ctxpopup Ctxpopup
*
area */
ELM_CTXPOPUP_DIRECTION_UNKNOWN, /**< ctxpopup does not determine it's direction yet*/
} Elm_Ctxpopup_Direction;
+#define Elm_Ctxpopup_Item Elm_Object_Item
/**
* @brief Add a new Ctxpopup object to the parent.
*
* @see elm_ctxpopup_content_set()
*/
- Elm_Ctxpopup_Item *elm_ctxpopup_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data) EINA_ARG_NONNULL(1);
+ Elm_Object_Item *elm_ctxpopup_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data) EINA_ARG_NONNULL(1);
/**
* @brief Delete the given item in a ctxpopup object.
*
*
* @see elm_ctxpopup_item_append()
*/
- EAPI void elm_ctxpopup_item_del(Elm_Ctxpopup_Item *item) EINA_ARG_NONNULL(1);
+ EAPI void elm_ctxpopup_item_del(Elm_Object_Item *it) EINA_ARG_NONNULL(1);
/**
* @brief Set the ctxpopup item's state as disabled or enabled.
*
*
* When disabled the item is greyed out to indicate it's state.
*/
- EAPI void elm_ctxpopup_item_disabled_set(Elm_Ctxpopup_Item *item, Eina_Bool disabled) EINA_ARG_NONNULL(1);
+ EAPI void elm_ctxpopup_item_disabled_set(Elm_Object_Item *it, Eina_Bool disabled) EINA_ARG_NONNULL(1);
/**
* @brief Get the ctxpopup item's disabled/enabled state.
*
*
* @see elm_ctxpopup_item_disabled_set()
*/
- EAPI Eina_Bool elm_ctxpopup_item_disabled_get(const Elm_Ctxpopup_Item *item) EINA_ARG_NONNULL(1);
+ EAPI Eina_Bool elm_ctxpopup_item_disabled_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
/**
* @brief Get the icon object for the given ctxpopup item.
*
* @see elm_ctxpopup_item_append()
* @see elm_ctxpopup_item_icon_set()
*/
- EAPI Evas_Object *elm_ctxpopup_item_icon_get(const Elm_Ctxpopup_Item *item) EINA_ARG_NONNULL(1);
+ EAPI Evas_Object *elm_ctxpopup_item_icon_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
/**
* @brief Sets the side icon associated with the ctxpopup item
*
*
* @see elm_ctxpopup_item_append()
*/
- EAPI void elm_ctxpopup_item_icon_set(Elm_Ctxpopup_Item *item, Evas_Object *icon) EINA_ARG_NONNULL(1);
+ EAPI void elm_ctxpopup_item_icon_set(Elm_Object_Item *it, Evas_Object *icon) EINA_ARG_NONNULL(1);
/**
* @brief Get the label for the given ctxpopup item.
*
* @see elm_ctxpopup_item_append()
* @see elm_ctxpopup_item_label_set()
*/
- EAPI const char *elm_ctxpopup_item_label_get(const Elm_Ctxpopup_Item *item) EINA_ARG_NONNULL(1);
+ EAPI const char *elm_ctxpopup_item_label_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
/**
* @brief (Re)set the label on the given ctxpopup item.
*
* @param it Ctxpopup item
* @param label String to set as label
*/
- EAPI void elm_ctxpopup_item_label_set(Elm_Ctxpopup_Item *item, const char *label) EINA_ARG_NONNULL(1);
+ EAPI void elm_ctxpopup_item_label_set(Elm_Object_Item *it, const char *label) EINA_ARG_NONNULL(1);
/**
* @brief Set an elm widget as the content of the ctxpopup.
*
#include <Elementary.h>
#include "elm_priv.h"
-/**
- * @defgroup Ctxpopup
- *
- * A ctxpopup is a widget that, when shown, pops up a list of items.
- * It automatically chooses an area inside its parent object's view
- * (set via elm_ctxpopup_add() and elm_ctxpopup_hover_parent_set()) to
- * optimally fit into it. In the default theme, it will also point an
- * arrow to the cursor position at the time one shows it. Ctxpopup
- * items have a label and/or an icon. It is intended for a small
- * number of items (hence the use of list, not genlist).
- *
- * Signals that you can add callbacks for are:
- *
- * "dismissed" - the ctxpopup was dismissed
- */
+#undef Elm_Ctxpopup_Item
typedef struct _Widget_Data Widget_Data;
+typedef struct _Elm_Ctxpopup_Item Elm_Ctxpopup_Item;
struct _Elm_Ctxpopup_Item
{
* @ingroup Ctxpopup
*/
EAPI Evas_Object *
-elm_ctxpopup_item_icon_get(const Elm_Ctxpopup_Item *item)
+elm_ctxpopup_item_icon_get(const Elm_Object_Item *it)
{
- ELM_CTXPOPUP_ITEM_CHECK_RETURN(item, NULL);
+ ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
+ Elm_Ctxpopup_Item *item = (Elm_Ctxpopup_Item *) it;
return item->icon;
}
* @ingroup Ctxpopup
*/
EAPI void
-elm_ctxpopup_item_icon_set(Elm_Ctxpopup_Item *item, Evas_Object *icon)
+elm_ctxpopup_item_icon_set(Elm_Object_Item *it, Evas_Object *icon)
{
- ELM_CTXPOPUP_ITEM_CHECK_RETURN(item);
+ ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
Widget_Data *wd;
+ Elm_Ctxpopup_Item *item = (Elm_Ctxpopup_Item *) it;
wd = elm_widget_data_get(item->base.widget);
if (!wd) return;
*
*/
EAPI const char *
-elm_ctxpopup_item_label_get(const Elm_Ctxpopup_Item *item)
+elm_ctxpopup_item_label_get(const Elm_Object_Item *it)
{
- ELM_CTXPOPUP_ITEM_CHECK_RETURN(item, NULL);
+ ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
+ Elm_Ctxpopup_Item *item = (Elm_Ctxpopup_Item *) it;
return item->label;
}
* @ingroup Ctxpopup
*/
EAPI void
-elm_ctxpopup_item_label_set(Elm_Ctxpopup_Item *item, const char *label)
+elm_ctxpopup_item_label_set(Elm_Object_Item *it, const char *label)
{
- ELM_CTXPOPUP_ITEM_CHECK_RETURN(item);
+ ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
Widget_Data *wd;
+ Elm_Ctxpopup_Item *item = (Elm_Ctxpopup_Item *) it;
wd = elm_widget_data_get(item->base.widget);
if (!wd) return;
*
* @ingroup Ctxpopup
*/
-EAPI Elm_Ctxpopup_Item *
+EAPI Elm_Object_Item *
elm_ctxpopup_item_append(Evas_Object *obj, const char *label,
Evas_Object *icon, Evas_Smart_Cb func,
const void *data)
_sizing_eval(obj);
}
- return item;
+ return (Elm_Object_Item*) item;
}
/**
* @ingroup Ctxpopup
*/
EAPI void
-elm_ctxpopup_item_del(Elm_Ctxpopup_Item *item)
+elm_ctxpopup_item_del(Elm_Object_Item *it)
{
- ELM_CTXPOPUP_ITEM_CHECK_RETURN(item);
+ ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
Widget_Data *wd;
+ Elm_Ctxpopup_Item *item = (Elm_Ctxpopup_Item *) it;
wd = elm_widget_data_get(item->base.widget);
if (!wd) return;
* @ingroup Ctxpopup
*/
EAPI void
-elm_ctxpopup_item_disabled_set(Elm_Ctxpopup_Item *item, Eina_Bool disabled)
+elm_ctxpopup_item_disabled_set(Elm_Object_Item *it, Eina_Bool disabled)
{
- ELM_CTXPOPUP_ITEM_CHECK_RETURN(item);
+ ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
Widget_Data *wd;
+ Elm_Ctxpopup_Item *item = (Elm_Ctxpopup_Item *) it;
wd = elm_widget_data_get(item->base.widget);
if (!wd) return;
* @ingroup Ctxpopup
*/
EAPI Eina_Bool
-elm_ctxpopup_item_disabled_get(const Elm_Ctxpopup_Item *item)
+elm_ctxpopup_item_disabled_get(const Elm_Object_Item *it)
{
- ELM_CTXPOPUP_ITEM_CHECK_RETURN(item, EINA_FALSE);
+ ELM_OBJ_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
+ Elm_Ctxpopup_Item *item = (Elm_Ctxpopup_Item *) it;
return item->disabled;
}