--- /dev/null
+#include "private.h"
+
+typedef struct _Elm_Params_Anchorview
+{
+ const char *text;
+} Elm_Params_Anchorview;
+
+static void
+external_anchorview_state_set(void *data __UNUSED__, Evas_Object *obj, const void *from_params, const void *to_params, float pos __UNUSED__)
+{
+ const Elm_Params_Anchorview *p;
+
+ if (to_params) p = to_params;
+ else if (from_params) p = from_params;
+ else return;
+
+ if (p->text)
+ {
+ elm_anchorview_text_set(obj, p->text);
+ }
+}
+
+static Eina_Bool
+external_anchorview_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_External_Param *param)
+{
+ if (!strcmp(param->name, "text"))
+ {
+ if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
+ {
+ elm_anchorview_text_set(obj, param->s);
+ return EINA_TRUE;
+ }
+ }
+
+ ERR("unknown parameter '%s' of type '%s'",
+ param->name, edje_external_param_type_str(param->type));
+
+ return EINA_FALSE;
+}
+
+static Eina_Bool
+external_anchorview_param_get(void *data __UNUSED__, const Evas_Object *obj, Edje_External_Param *param)
+{
+ if (!strcmp(param->name, "text"))
+ {
+ if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
+ {
+ param->s = elm_anchorview_text_get(obj);
+ return EINA_TRUE;
+ }
+ }
+
+ ERR("unknown parameter '%s' of type '%s'",
+ param->name, edje_external_param_type_str(param->type));
+
+ return EINA_FALSE;
+}
+
+static void *
+external_anchorview_params_parse(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const Eina_List *params)
+{
+ Elm_Params_Anchorview *mem;
+ Edje_External_Param *param;
+ const Eina_List *l;
+
+ mem = calloc(1, sizeof(Elm_Params_Anchorview));
+ if (!mem)
+ return NULL;
+
+ EINA_LIST_FOREACH(params, l, param)
+ {
+ if (!strcmp(param->name, "text"))
+ mem->text = eina_stringshare_add(param->s);
+ }
+
+ return mem;
+}
+
+static void
+external_anchorview_params_free(void *params)
+{
+ Elm_Params_Anchorview *mem = params;
+
+ if (mem->text)
+ eina_stringshare_del(mem->text);
+ free(mem);
+}
+
+static Edje_External_Param_Info external_anchorview_params[] = {
+ EDJE_EXTERNAL_PARAM_INFO_STRING_DEFAULT("text", "some text"),
+ EDJE_EXTERNAL_PARAM_INFO_SENTINEL
+};
+
+DEFINE_EXTERNAL_ICON_ADD(anchorview, "anchorview")
+DEFINE_EXTERNAL_TYPE_SIMPLE(anchorview, "Anchorview");
};
static const char *widtype = NULL;
+
+static const char SIG_ANCHOR_CLICKED[] = "anchor,clicked";
+static const Evas_Smart_Cb_Description _signals[] = {
+ {SIG_ANCHOR_CLICKED, ""}, /* TODO: declare the type properly, as data is
+ * being passed
+ */
+ {NULL, NULL}
+};
+
static void _del_pre_hook(Evas_Object *obj);
static void _del_hook(Evas_Object *obj);
static void _sizing_eval(Evas_Object *obj);
if (py < (y + (h / 3))) ei.hover_top = 0;
ei.hover_bottom = 1;
if (py > (y + ((h * 2) / 3))) ei.hover_bottom = 0;
- evas_object_smart_callback_call(data, "anchor,clicked", &ei);
+ evas_object_smart_callback_call(data, SIG_ANCHOR_CLICKED, &ei);
evas_object_smart_callback_add(wd->hover, "clicked", _hover_clicked, data);
evas_object_show(wd->hover);
}
}
/**
+ * Get the markup text set for the anchorview
+ *
+ * This retrieves back the string set by @c elm_anchorview_text_set().
+ *
+ * @param obj The anchorview object
+ * @return text The markup text set or @c NULL, either if it was not set
+ * or an error ocurred
+ *
+ * @ingroup Anchorview
+ */
+EAPI const char*
+elm_anchorview_text_get(Evas_Object *obj)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return NULL;
+ return elm_entry_entry_get(wd->entry);
+}
+
+/**
* Set the parent of the hover popup
*
* This sets the parent of the hover that anchorview will create. See hover