forked from enlightenment/efl
move a chunk of stuff to use evas_smart_class_new() - evas_smart_new() will
probably die as it's already got legacy funcion methods for layer etc. stuff. SVN revision: 31161
This commit is contained in:
parent
6437f4ed23
commit
4b435be1ed
|
@ -749,18 +749,23 @@ static void
|
|||
_smart_init(void)
|
||||
{
|
||||
if (smart) return;
|
||||
smart = evas_smart_new(E_OBJ_NAME,
|
||||
_smart_add,
|
||||
_smart_del,
|
||||
NULL, NULL, NULL, NULL, NULL,
|
||||
_smart_move,
|
||||
_smart_resize,
|
||||
_smart_show,
|
||||
_smart_hide,
|
||||
_smart_color_set,
|
||||
_smart_clip_set,
|
||||
_smart_clip_unset,
|
||||
NULL);
|
||||
{
|
||||
static const Evas_Smart_Class sc =
|
||||
{
|
||||
E_OBJ_NAME,
|
||||
_smart_add,
|
||||
_smart_del,
|
||||
_smart_move,
|
||||
_smart_resize,
|
||||
_smart_show,
|
||||
_smart_hide,
|
||||
_smart_color_set,
|
||||
_smart_clip_set,
|
||||
_smart_clip_unset,
|
||||
NULL
|
||||
};
|
||||
smart = evas_smart_class_new(&sc);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -29,18 +29,22 @@ edje_object_add(Evas *evas)
|
|||
{
|
||||
if (!_edje_smart)
|
||||
{
|
||||
_edje_smart = evas_smart_new("edje",
|
||||
_edje_smart_add,
|
||||
_edje_smart_del,
|
||||
NULL, NULL, NULL, NULL, NULL,
|
||||
_edje_smart_move,
|
||||
_edje_smart_resize,
|
||||
_edje_smart_show,
|
||||
_edje_smart_hide,
|
||||
_edje_smart_color_set,
|
||||
_edje_smart_clip_set,
|
||||
_edje_smart_clip_unset,
|
||||
NULL);
|
||||
static const Evas_Smart_Class sc =
|
||||
{
|
||||
"edje",
|
||||
EVAS_SMART_CLASS_VERSION,
|
||||
_edje_smart_add,
|
||||
_edje_smart_del,
|
||||
_edje_smart_move,
|
||||
_edje_smart_resize,
|
||||
_edje_smart_show,
|
||||
_edje_smart_hide,
|
||||
_edje_smart_color_set,
|
||||
_edje_smart_clip_set,
|
||||
_edje_smart_clip_unset,
|
||||
NULL
|
||||
};
|
||||
_edje_smart = evas_smart_class_new(&sc);
|
||||
}
|
||||
return evas_object_smart_add(evas, _edje_smart);
|
||||
}
|
||||
|
|
|
@ -74,11 +74,6 @@ static void _pixels_get(void *data, Evas_Object *obj);
|
|||
static void _smart_init(void);
|
||||
static void _smart_add(Evas_Object * obj);
|
||||
static void _smart_del(Evas_Object * obj);
|
||||
static void _smart_layer_set(Evas_Object * obj, int layer);
|
||||
static void _smart_raise(Evas_Object * obj);
|
||||
static void _smart_lower(Evas_Object * obj);
|
||||
static void _smart_stack_above(Evas_Object * obj, Evas_Object * above);
|
||||
static void _smart_stack_below(Evas_Object * obj, Evas_Object * below);
|
||||
static void _smart_move(Evas_Object * obj, Evas_Coord x, Evas_Coord y);
|
||||
static void _smart_resize(Evas_Object * obj, Evas_Coord w, Evas_Coord h);
|
||||
static void _smart_show(Evas_Object * obj);
|
||||
|
@ -239,7 +234,6 @@ emotion_object_file_set(Evas_Object *obj, const char *file)
|
|||
{
|
||||
sd->module->file_close(sd->video);
|
||||
sd->video = NULL;
|
||||
printf("VIDEO -> NULL\n");
|
||||
evas_object_image_size_set(sd->obj, 0, 0);
|
||||
}
|
||||
}
|
||||
|
@ -1130,22 +1124,24 @@ static void
|
|||
_smart_init(void)
|
||||
{
|
||||
if (smart) return;
|
||||
smart = evas_smart_new(E_OBJ_NAME,
|
||||
_smart_add,
|
||||
_smart_del,
|
||||
_smart_layer_set,
|
||||
_smart_raise,
|
||||
_smart_lower,
|
||||
_smart_stack_above,
|
||||
_smart_stack_below,
|
||||
_smart_move,
|
||||
_smart_resize,
|
||||
_smart_show,
|
||||
_smart_hide,
|
||||
_smart_color_set,
|
||||
_smart_clip_set,
|
||||
_smart_clip_unset,
|
||||
NULL);
|
||||
{
|
||||
static const Evas_Smart_Class sc =
|
||||
{
|
||||
E_OBJ_NAME,
|
||||
EVAS_SMART_CLASS_VERSION,
|
||||
_smart_add,
|
||||
_smart_del,
|
||||
_smart_move,
|
||||
_smart_resize,
|
||||
_smart_show,
|
||||
_smart_hide,
|
||||
_smart_color_set,
|
||||
_smart_clip_set,
|
||||
_smart_clip_unset,
|
||||
NULL
|
||||
};
|
||||
smart = evas_smart_class_new(&sc);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1179,11 +1175,8 @@ _smart_del(Evas_Object * obj)
|
|||
Smart_Data *sd;
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return;
|
||||
printf("DEL: sd->video = %p\n", sd->video);
|
||||
if (sd->video) sd->module->file_close(sd->video);
|
||||
printf("MOD CLOSE: sd->video = %p\n", sd->video);
|
||||
_emotion_module_close(sd->module, sd->video);
|
||||
printf("DEL SD: sd = %p\n", sd);
|
||||
evas_object_del(sd->obj);
|
||||
if (sd->file) free(sd->file);
|
||||
if (sd->job) ecore_job_del(sd->job);
|
||||
|
@ -1191,56 +1184,6 @@ _smart_del(Evas_Object * obj)
|
|||
if (sd->ref.file) free(sd->ref.file);
|
||||
free(sd);
|
||||
}
|
||||
|
||||
static void
|
||||
_smart_layer_set(Evas_Object * obj, int layer)
|
||||
{
|
||||
Smart_Data *sd;
|
||||
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return;
|
||||
evas_object_layer_set(sd->obj, layer);
|
||||
}
|
||||
|
||||
static void
|
||||
_smart_raise(Evas_Object * obj)
|
||||
{
|
||||
Smart_Data *sd;
|
||||
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return;
|
||||
evas_object_raise(sd->obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_smart_lower(Evas_Object * obj)
|
||||
{
|
||||
Smart_Data *sd;
|
||||
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return;
|
||||
evas_object_lower(sd->obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_smart_stack_above(Evas_Object * obj, Evas_Object * above)
|
||||
{
|
||||
Smart_Data *sd;
|
||||
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return;
|
||||
evas_object_stack_above(sd->obj, above);
|
||||
}
|
||||
|
||||
static void
|
||||
_smart_stack_below(Evas_Object * obj, Evas_Object * below)
|
||||
{
|
||||
Smart_Data *sd;
|
||||
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return;
|
||||
evas_object_stack_below(sd->obj, below);
|
||||
}
|
||||
|
||||
static void
|
||||
_smart_move(Evas_Object * obj, Evas_Coord x, Evas_Coord y)
|
||||
|
|
|
@ -710,8 +710,8 @@ extern "C" {
|
|||
/* smart objects */
|
||||
EAPI Evas_Smart *evas_smart_new (const char *name, void (*func_add) (Evas_Object *obj), void (*func_del) (Evas_Object *obj), void (*func_layer_set) (Evas_Object *obj, int l), void (*func_raise) (Evas_Object *obj), void (*func_lower) (Evas_Object *obj), void (*func_stack_above) (Evas_Object *obj, Evas_Object *above), void (*func_stack_below) (Evas_Object *obj, Evas_Object *below), void (*func_move) (Evas_Object *obj, Evas_Coord x, Evas_Coord y), void (*func_resize) (Evas_Object *obj, Evas_Coord w, Evas_Coord h), void (*func_show) (Evas_Object *obj), void (*func_hide) (Evas_Object *obj), void (*func_color_set) (Evas_Object *obj, int r, int g, int b, int a), void (*func_clip_set) (Evas_Object *obj, Evas_Object *clip), void (*func_clip_unset) (Evas_Object *obj), const void *data);
|
||||
EAPI void evas_smart_free (Evas_Smart *s);
|
||||
EAPI Evas_Smart *evas_smart_class_new (Evas_Smart_Class *sc);
|
||||
EAPI Evas_Smart_Class *evas_smart_class_get (Evas_Smart *s);
|
||||
EAPI Evas_Smart *evas_smart_class_new (const Evas_Smart_Class *sc);
|
||||
EAPI const Evas_Smart_Class *evas_smart_class_get (Evas_Smart *s);
|
||||
|
||||
EAPI void *evas_smart_data_get (Evas_Smart *s);
|
||||
|
||||
|
|
|
@ -59,6 +59,9 @@ evas_smart_new(const char *name,
|
|||
{
|
||||
Evas_Smart *s;
|
||||
|
||||
printf("----- WARNING. evas_smart_new() will be deprecated and removed soon\n",
|
||||
"----- Please use evas_smart_class_new() instead\n");
|
||||
|
||||
if (!name) return NULL;
|
||||
|
||||
s = evas_mem_calloc(sizeof(Evas_Smart));
|
||||
|
@ -117,7 +120,7 @@ evas_smart_free(Evas_Smart *s)
|
|||
* @return an Evas_Smart
|
||||
*/
|
||||
EAPI Evas_Smart *
|
||||
evas_smart_class_new(Evas_Smart_Class *sc)
|
||||
evas_smart_class_new(const Evas_Smart_Class *sc)
|
||||
{
|
||||
Evas_Smart *s;
|
||||
|
||||
|
@ -142,7 +145,7 @@ evas_smart_class_new(Evas_Smart_Class *sc)
|
|||
* @param s the Evas_Smart
|
||||
* @return the Evas_Smart_Class
|
||||
*/
|
||||
EAPI Evas_Smart_Class *
|
||||
EAPI const Evas_Smart_Class *
|
||||
evas_smart_class_get(Evas_Smart *s)
|
||||
{
|
||||
MAGIC_CHECK(s, Evas_Smart, MAGIC_SMART);
|
||||
|
|
Loading…
Reference in New Issue