It also add some missing comments for changes of ellipsize features.
@tizen_feature
Change-Id: I8e2df138833dbfb4d1b110325eb7c089f1105140
* 20170322: fix crash issue when Edje tries to clean up fade object
* 20170427: fix clipper loop issue caused by clipper object for fade
* 20170703: Add ellipsize feature and refactory fade_ellipsis, marquee features.
+ * 20170725: fix wrong speed calculation for text marquee's duration.
+ * 20170725: fix to apply loop_delay even if there is no loop limit.
+ * 20170725: restore ellipsis state of TEXT part when marquee mode is NONE.
+ * 20170801: add text marquee duration set/get APIs for internal usages.
*
**********************************************************************************/
#define EDJE_DEFAULT_FADE_IMAGE "edje_default_fade_image.png"
if (is_marquee)
{
+ double duration = chosen_desc->text.ellipsize.marquee.duration;
+ double speed = chosen_desc->text.ellipsize.marquee.speed;
Eina_Bool text_marquee_vertical;
if (valign != -1.0)
else
text_marquee_vertical = EINA_FALSE;
- if (chosen_desc->text.ellipsize.marquee.speed > 0.0)
+ if (ep->typedata.text->ellipsize.marquee.duration > 0.0)
+ duration = ep->typedata.text->ellipsize.marquee.duration;
+
+ if (speed > 0.0)
{
/* Convert px_per_sec (speed) to sec_per_pixel */
FLOAT_T sc = 1.0;
if (sc == 0.0) sc = 1.0;
}
- ep->typedata.text->ellipsize.marquee.sec_per_pixel = 1.0 / (chosen_desc->text.ellipsize.marquee.speed * TO_DOUBLE(sc));
+ ep->typedata.text->ellipsize.marquee.sec_per_pixel = 1.0 / (speed * TO_DOUBLE(sc));
}
- else if (chosen_desc->text.ellipsize.marquee.duration > 0.0)
+ else if (duration > 0.0)
{
/* Convert sec_per_loop (duration) to sec_per_pixel */
int distance_per_loop = 0.0;
distance_per_loop = tw + pf->final.w;
}
- ep->typedata.text->ellipsize.marquee.sec_per_pixel =
- chosen_desc->text.ellipsize.marquee.duration / (double)distance_per_loop;
+ ep->typedata.text->ellipsize.marquee.sec_per_pixel = duration / (double)distance_per_loop;
}
else
{
}
}
/* END */
+ /* TIZEN_ONLY(20170801): add text marquee duration set/get APIs for internal usages */
+ @property part_text_marquee_duration @internal {
+ set {
+ [[Sets the duration for text's marquee.
+
+ Do not use this API without understanding whats going on.
+ It is made for internal usage.
+ ]]
+ return: bool; [[$true, on success or $false, on error]]
+ }
+ get {
+ [[Gets the duration for text's marquee.
+
+ Do not use this API without understanding whats going on.
+ It is made for internal usage.
+ ]]
+ }
+ keys {
+ part: const(char)*; [[The part name]]
+ }
+ values {
+ duration: double; [[The duration. 0.0 for respect EDC's duration value.]]
+ }
+ }
+ /* END */
}
implements {
Eo.Base.constructor;
/* TIZEN_ONLY(20170217): add part_text_valign property for internal usage */
FLOAT_T valign; // 4
/* END */
+ /* TIZEN_ONLY(20170801): add text marquee duration set/get APIs for internal usages */
+ struct {
+ double duration; // 8
+ } marquee;
+ /* END */
/* TIZEN_ONLY(20160920): Add fade_ellipsis feature to TEXTBLOCK, TEXT part. */
struct {
Evas_Object *clipper_obj; // 4
int orig_x, orig_y;
int loop_count;
int distance;
+
+ double duration;
} marquee;
} ellipsize;
/* END */
}
/* END */
+/* TIZEN_ONLY(20170801): add text marquee duration set/get APIs for internal usages */
+EOLIAN Eina_Bool
+_edje_object_part_text_marquee_duration_set(Eo *eo_obj EINA_UNUSED, Edje *ed, const char *part, double duration)
+{
+ Edje_Real_Part *rp;
+ Edje_Part_Description_Text *desc;
+
+ if (!part) 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;
+
+ if (rp->typedata.text)
+ {
+ rp->typedata.text->ellipsize.marquee.duration = duration;
+
+ return EINA_TRUE;
+ }
+
+ return EINA_FALSE;
+}
+
+EOLIAN double
+_edje_object_part_text_marquee_duration_get(Eo *eo_obj EINA_UNUSED, Edje *ed, const char *part)
+{
+ Edje_Real_Part *rp;
+ Edje_Part_Description_Text *desc;
+
+ if (!part) return -1.0;
+ rp = _edje_real_part_recursive_get(&ed, part);
+ if (!rp) return -1.0;
+ if ((rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) &&
+ (rp->part->type != EDJE_PART_TYPE_TEXT))
+ return -1.0;
+
+ if (rp->typedata.text)
+ {
+ if (rp->typedata.text->ellipsize.marquee.duration <= 0.0)
+ {
+ desc = (Edje_Part_Description_Text *)rp->chosen_description;
+ return desc->text.ellipsize.marquee.duration;
+ }
+ else
+ {
+ return rp->typedata.text->ellipsize.marquee.duration;
+ }
+ }
+
+ return -1.0;
+}
+/* END */
+
/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/