*
* Functions that deals with hints about object size.
*/
+static void
+_evas_object_size_hint_alloc(Evas_Object *obj)
+{
+ if (obj->size_hints) return;
+
+ obj->size_hints = calloc(1, sizeof(Evas_Size_Hints));
+ obj->size_hints->max.w = -1;
+ obj->size_hints->max.h = -1;
+ obj->size_hints->align.x = 0.5;
+ obj->size_hints->align.y = 0.5;
+}
/**
* Retrieves the size hint for the minimum size.
MAGIC_CHECK_END();
if (obj->delete_me)
return;
- if (!obj->size_hints)
- obj->size_hints = calloc(1, sizeof(Evas_Size_Hints));
+ _evas_object_size_hint_alloc(obj);
obj->size_hints->min.w = w;
obj->size_hints->min.h = h;
MAGIC_CHECK_END();
if (obj->delete_me)
return;
- if (!obj->size_hints)
- obj->size_hints = calloc(1, sizeof(Evas_Size_Hints));
+ _evas_object_size_hint_alloc(obj);
obj->size_hints->max.w = w;
obj->size_hints->max.h = h;
MAGIC_CHECK_END();
if (obj->delete_me)
return;
- if (!obj->size_hints)
- obj->size_hints = calloc(1, sizeof(Evas_Size_Hints));
+ _evas_object_size_hint_alloc(obj);
obj->size_hints->request.w = w;
obj->size_hints->request.h = h;
MAGIC_CHECK_END();
if (obj->delete_me)
return;
- if (!obj->size_hints)
- obj->size_hints = calloc(1, sizeof(Evas_Size_Hints));
+ _evas_object_size_hint_alloc(obj);
obj->size_hints->aspect.mode = aspect;
obj->size_hints->aspect.size.w = w;
MAGIC_CHECK_END();
if (obj->delete_me)
return;
- if (!obj->size_hints)
- obj->size_hints = calloc(1, sizeof(Evas_Size_Hints));
+ _evas_object_size_hint_alloc(obj);
obj->size_hints->align.x = x;
obj->size_hints->align.x = y;
MAGIC_CHECK_END();
if (obj->delete_me)
return;
- if (!obj->size_hints)
- obj->size_hints = calloc(1, sizeof(Evas_Size_Hints));
+ _evas_object_size_hint_alloc(obj);
obj->size_hints->weight.x = x;
obj->size_hints->weight.x = y;
MAGIC_CHECK_END();
if (obj->delete_me)
return;
- if (!obj->size_hints)
- obj->size_hints = calloc(1, sizeof(Evas_Size_Hints));
+ _evas_object_size_hint_alloc(obj);
obj->size_hints->padding.l = l;
obj->size_hints->padding.r = r;