2010-03-30 10:21:47 -07:00
|
|
|
#include "private.h"
|
|
|
|
|
|
|
|
typedef struct _Elm_Params_Anchorview
|
|
|
|
{
|
2010-10-21 15:03:43 -07:00
|
|
|
Elm_Params base;
|
2010-03-30 10:21:47 -07:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2010-08-01 10:29:20 -07:00
|
|
|
static Evas_Object *external_anchorview_content_get(void *data __UNUSED__,
|
2010-10-19 11:25:57 -07:00
|
|
|
const Evas_Object *obj __UNUSED__, const char *content __UNUSED__)
|
2010-08-01 10:29:20 -07:00
|
|
|
{
|
2010-10-20 05:40:36 -07:00
|
|
|
ERR("No content.");
|
2010-08-01 10:29:20 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2010-03-30 10:21:47 -07:00
|
|
|
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[] = {
|
2010-10-21 15:03:43 -07:00
|
|
|
DEFINE_EXTERNAL_COMMON_PARAMS,
|
2010-03-30 10:21:47 -07:00
|
|
|
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");
|