Add scale set/get to Edje_Edit.
authorsachiel <sachiel@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 18 Jun 2010 22:08:05 +0000 (22:08 +0000)
committersachiel <sachiel@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 18 Jun 2010 22:08:05 +0000 (22:08 +0000)
By: Iván Briano <ivan@profusion.mobi>

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@49746 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/Edje_Edit.h
src/lib/edje_edit.c

index 9e2b941..21538ab 100644 (file)
@@ -917,11 +917,31 @@ EAPI Evas_Event_Flags edje_edit_part_ignore_flags_get(Evas_Object *obj, const ch
 
 /** Set repeat_events for part.
  *
- * @param obj Object bein edited.
- * @oaram part Part to set which event flags will be ignored
+ * @param obj Object being edited.
+ * @param part Part to set which event flags will be ignored
  */
 EAPI void edje_edit_part_ignore_flags_set(Evas_Object *obj, const char *part, Evas_Event_Flags ignore_flags);
 
+/** Set scale property for the part.
+ *
+ * This property tells Edje that the given part should be scaled by the
+ * Edje scale factor.
+ *
+ * @param obj Object being edited.
+ * @param part Part to set scale for.
+ * @param scale Scale value to set.
+ */
+EAPI void edje_edit_part_scale_set(Evas_Object *obj, const char *part, Eina_Bool scale);
+
+/** Get scale for the part.
+ *
+ * @param obj Object being edited.
+ * @param part Part to get the scale value of.
+ *
+ * @return Whether scale is on (EINA_TRUE) or not.
+ */
+EAPI Eina_Bool edje_edit_part_scale_get(Evas_Object *obj, const char *part);
+
 /** Get horizontal dragable state for part.
  *
  * @param obj Object being edited.
index 413f4f6..4cea578 100644 (file)
@@ -2465,6 +2465,23 @@ edje_edit_part_ignore_flags_set(Evas_Object *obj, const char *part, Evas_Event_F
    rp->part->ignore_flags = ignore_flags;
 }
 
+EAPI void
+edje_edit_part_scale_set(Evas_Object *obj, const char *part, Eina_Bool scale)
+{
+   GET_RP_OR_RETURN();
+
+   rp->part->scale = scale;
+   edje_object_calc_force(obj);
+}
+
+EAPI Eina_Bool
+edje_edit_part_scale_get(Evas_Object *obj, const char *part)
+{
+   GET_RP_OR_RETURN(EINA_FALSE);
+
+   return rp->part->scale;
+}
+
 EAPI const char *
 edje_edit_part_source_get(Evas_Object *obj, const char *part)
 {
@@ -6659,8 +6676,9 @@ _edje_generate_source_of_part(Evas_Object *obj, const char *part, Eina_Strbuf *b
       BUF_APPEND(I4"mouse_events: 0;\n");
    if (edje_edit_part_repeat_events_get(obj, part))
       BUF_APPEND(I4"repeat_events: 1;\n");
+   if (edje_edit_part_scale_get(obj, part))
+     BUF_APPEND(I4"scale: 1;\n");
    //TODO Support ignore_flags
-   //TODO Support scale
    //TODO Support pointer_mode
    //TODO Support precise_is_inside
    //TODO Support use_alternate_font_metrics