edje: add part_text_min_policy property for internal usage
authorYoungbok Shin <youngb.shin@samsung.com>
Wed, 30 Nov 2016 12:03:37 +0000 (21:03 +0900)
committerWonki Kim <wonki_.kim@samsung.com>
Mon, 2 Jan 2017 07:23:56 +0000 (16:23 +0900)
It is made for internal usages.

@tizen_feature

Change-Id: I1956c269af213ab3287a7d120a1de92e4a0052d4

src/lib/edje/edje_object.eo
src/lib/edje/edje_util.c

index 72e3caa..0c0a1fe 100644 (file)
@@ -2984,6 +2984,42 @@ class Edje.Object (Evas.Smart_Clipped, Efl.File)
         }
          return: bool; [[$true if the visible character is hidden. $false if there is no visible character or the object is not set for password mode.]]
       }
+      /* TIZEN_ONLY(20161130): add part_text_min_policy property for internal usage */
+      @property part_text_min_policy @internal {
+         set {
+            [[Sets the object text min calculation policy.
+
+              Do not use this API without understanding whats going on.
+              It is made for internal usage.
+
+              \@if MOBILE \@since_tizen 3.0
+              \@elseif WEARABLE \@since_tizen 3.0
+              \@endif
+            ]]
+            return: bool; [[$true, on success or $false, on error]]
+         }
+         get {
+            [[Gets the object text min calculation policy.
+
+              Do not use this API without understanding whats going on.
+              It is made for internal usage.
+
+              \@if MOBILE \@since_tizen 3.0
+              \@elseif WEARABLE \@since_tizen 3.0
+              \@endif
+            ]]
+            return: bool; [[$true, on success or $false, on error]]
+         }
+         keys {
+            part: const(char)*; [[The part name]]
+            state_name: const(char)*; [[The state name]]
+         }
+         values {
+            min_x: bool; [[The min width policy]]
+            min_y: bool; [[The min height policy]]
+         }
+      }
+      /* END */
    }
    implements {
       Eo.Base.constructor;
index 18c6541..7da4571 100644 (file)
@@ -6835,4 +6835,54 @@ EAPI void edje_object_part_text_thaw(Evas_Object *obj, const char *part)
 }
 /////////////////////////////////////////////////////////////////////////////////////////////////////
 
+/* TIZEN_ONLY(20161130): add part_text_min_policy property for internal usage */
+EOLIAN Eina_Bool
+_edje_object_part_text_min_policy_set(Eo *eo_obj EINA_UNUSED, Edje *ed, const char *part, const char *state_name, Eina_Bool min_x, Eina_Bool min_y)
+{
+   Edje_Real_Part *rp;
+   Edje_Part_Description_Text *desc;
+
+   if ((!part) || (!state_name)) return EINA_FALSE;
+   rp = _edje_real_part_recursive_get(&ed, part);
+   if (!rp) return EINA_FALSE;
+   if ((rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) &&
+       (rp->part->type != EDJE_PART_TYPE_TEXT))
+     return EINA_FALSE;
+
+   desc = (Edje_Part_Description_Text *)_edje_part_description_find(ed, rp, state_name, 0.0, EINA_FALSE);
+
+   if (desc)
+     {
+        desc->text.min_x = (unsigned char)min_x;
+        desc->text.min_y = (unsigned char)min_y;
+     }
+
+   return EINA_TRUE;
+}
+
+EOLIAN Eina_Bool
+_edje_object_part_text_min_policy_get(Eo *eo_obj EINA_UNUSED, Edje *ed, const char *part, const char *state_name, Eina_Bool *min_x, Eina_Bool *min_y)
+{
+   Edje_Real_Part *rp;
+   Edje_Part_Description_Text *desc;
+
+   if ((!part) || (!state_name) || (!min_x && !min_y)) return EINA_FALSE;
+   rp = _edje_real_part_recursive_get(&ed, part);
+   if (!rp) return EINA_FALSE;
+   if ((rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) &&
+       (rp->part->type != EDJE_PART_TYPE_TEXT))
+     return EINA_FALSE;
+
+   desc = (Edje_Part_Description_Text *)_edje_part_description_find(ed, rp, state_name, 0.0, EINA_FALSE);
+
+   if (desc)
+     {
+        if (min_x) *min_x = (Eina_Bool)desc->text.min_x;
+        if (min_y) *min_y = (Eina_Bool)desc->text.min_y;
+     }
+
+   return EINA_TRUE;
+}
+/* END */
+
 /* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/