make scale set apply immediately on objects that do scaling...

SVN revision: 37656
This commit is contained in:
Carsten Haitzler 2008-11-15 10:39:46 +00:00
parent fec072d883
commit 7e6fb27b4c
11 changed files with 62 additions and 19 deletions

View File

@ -60,6 +60,7 @@ static const Evas_Object_Func object_func =
evas_object_gradient2_linear_was_opaque,
NULL,
NULL,
NULL,
NULL
};

View File

@ -60,6 +60,7 @@ static const Evas_Object_Func rg_object_func =
evas_object_gradient2_radial_was_opaque,
NULL,
NULL,
NULL,
NULL
};

View File

@ -86,22 +86,23 @@ static const Evas_Object_Func object_func =
{
/* methods (compulsory) */
evas_object_image_free,
evas_object_image_render,
evas_object_image_render_pre,
evas_object_image_render_post,
evas_object_image_id_get,
evas_object_image_visual_id_get,
evas_object_image_engine_data_get,
/* these are optional. NULL = nothing */
NULL,
NULL,
NULL,
NULL,
evas_object_image_is_opaque,
evas_object_image_was_opaque,
evas_object_image_is_inside,
NULL,
NULL
evas_object_image_render,
evas_object_image_render_pre,
evas_object_image_render_post,
evas_object_image_id_get,
evas_object_image_visual_id_get,
evas_object_image_engine_data_get,
/* these are optional. NULL = nothing */
NULL,
NULL,
NULL,
NULL,
evas_object_image_is_opaque,
evas_object_image_was_opaque,
evas_object_image_is_inside,
NULL,
NULL,
NULL
};
/**

View File

@ -62,7 +62,8 @@ static const Evas_Object_Func object_func =
evas_object_line_was_opaque,
evas_object_line_is_inside,
evas_object_line_was_inside,
evas_object_line_coords_recalc
evas_object_line_coords_recalc,
NULL
};
/* the actual api call to add a rect */

View File

@ -1263,6 +1263,7 @@ evas_object_scale_set(Evas_Object *obj, double scale)
return;
obj->cur.scale = scale;
evas_object_change(obj);
if (obj->func->scale_update) obj->func->scale_update(obj);
}

View File

@ -59,6 +59,7 @@ static const Evas_Object_Func object_func =
evas_object_polygon_was_opaque,
evas_object_polygon_is_inside,
evas_object_polygon_was_inside,
NULL,
NULL
};

View File

@ -56,6 +56,7 @@ static const Evas_Object_Func object_func =
evas_object_rectangle_was_opaque,
NULL,
NULL,
NULL,
NULL
};

View File

@ -56,6 +56,7 @@ static const Evas_Object_Func object_func =
NULL,
NULL,
NULL,
NULL,
NULL
};

View File

@ -50,6 +50,8 @@ static void *evas_object_text_engine_data_get(Evas_Object *obj);
static int evas_object_text_is_opaque(Evas_Object *obj);
static int evas_object_text_was_opaque(Evas_Object *obj);
static void evas_object_text_scale_update(Evas_Object *obj);
static const Evas_Object_Func object_func =
{
/* methods (compulsory) */
@ -69,7 +71,8 @@ static const Evas_Object_Func object_func =
evas_object_text_was_opaque,
NULL,
NULL,
NULL
NULL,
evas_object_text_scale_update
};
/* the actual api call to add a rect */
@ -1730,6 +1733,24 @@ evas_object_text_was_opaque(Evas_Object *obj)
return 0;
}
static void
evas_object_text_scale_update(Evas_Object *obj)
{
Evas_Object_Text *o;
int size;
const char *font;
o = (Evas_Object_Text *)(obj->object_data);
font = eina_stringshare_add(o->cur.font);
size = o->cur.size;
if (o->cur.font) eina_stringshare_del(o->cur.font);
o->cur.font = NULL;
o->prev.font = NULL;
o->cur.size = 0;
o->prev.size = 0;
evas_object_text_font_set(obj, font, size);
}
void
_evas_object_text_rehint(Evas_Object *obj)
{

View File

@ -153,6 +153,8 @@ static int evas_object_textblock_was_opaque(Evas_Object *obj);
static void evas_object_textblock_coords_recalc(Evas_Object *obj);
static void evas_object_textblock_scale_update(Evas_Object *obj);
static const Evas_Object_Func object_func =
{
/* methods (compulsory) */
@ -172,7 +174,8 @@ static const Evas_Object_Func object_func =
evas_object_textblock_was_opaque,
NULL,
NULL,
evas_object_textblock_coords_recalc
evas_object_textblock_coords_recalc,
evas_object_textblock_scale_update
};
/* the actual api call to add a textblock */
@ -5609,6 +5612,15 @@ evas_object_textblock_coords_recalc(Evas_Object *obj)
}
}
static void
evas_object_textblock_scale_update(Evas_Object *obj)
{
Evas_Object_Textblock *o;
o = (Evas_Object_Textblock *)(obj->object_data);
_relayout(obj);
}
void
_evas_object_textblock_rehint(Evas_Object *obj)
{

View File

@ -529,6 +529,8 @@ struct _Evas_Object_Func
int (*was_inside) (Evas_Object *obj, Evas_Coord x, Evas_Coord y);
void (*coords_recalc) (Evas_Object *obj);
void (*scale_update) (Evas_Object *obj);
};
struct _Evas_Func