2013-04-25 22:13:00 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "elementary_config.h"
|
|
|
|
#endif
|
|
|
|
|
2014-10-17 08:56:11 -07:00
|
|
|
#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
|
2016-04-20 05:07:38 -07:00
|
|
|
#define ELM_LAYOUT_PROTECTED
|
2014-10-17 08:56:11 -07:00
|
|
|
|
2008-09-29 23:58:56 -07:00
|
|
|
#include <Elementary.h>
|
2013-04-25 22:13:00 -07:00
|
|
|
|
2008-09-29 23:58:56 -07:00
|
|
|
#include "elm_priv.h"
|
2012-11-25 22:32:53 -08:00
|
|
|
#include "elm_widget_layout.h"
|
2012-08-01 14:03:51 -07:00
|
|
|
#include "elm_widget_label.h"
|
2008-09-29 23:58:56 -07:00
|
|
|
|
2014-06-03 03:35:28 -07:00
|
|
|
#define MY_CLASS ELM_LABEL_CLASS
|
2012-11-25 22:32:53 -08:00
|
|
|
|
2013-11-07 03:44:22 -08:00
|
|
|
#define MY_CLASS_NAME "Elm_Label"
|
|
|
|
#define MY_CLASS_NAME_LEGACY "elm_label"
|
2012-05-03 15:42:38 -07:00
|
|
|
|
2013-01-04 20:56:06 -08:00
|
|
|
static const char SIG_SLIDE_END[] = "slide,end";
|
|
|
|
|
|
|
|
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
|
2014-01-23 02:30:34 -08:00
|
|
|
{SIG_WIDGET_LANG_CHANGED, ""}, /**< handled by elm_widget */
|
2014-02-07 21:05:06 -08:00
|
|
|
{SIG_WIDGET_ACCESS_CHANGED, ""}, /**< handled by elm_widget */
|
2013-01-04 20:56:06 -08:00
|
|
|
{SIG_SLIDE_END, ""},
|
|
|
|
{NULL, NULL}
|
|
|
|
};
|
|
|
|
|
2012-05-03 15:42:38 -07:00
|
|
|
static const Elm_Layout_Part_Alias_Description _text_aliases[] =
|
2008-09-29 23:58:56 -07:00
|
|
|
{
|
2012-05-03 15:42:38 -07:00
|
|
|
{"default", "elm.text"},
|
|
|
|
{NULL, NULL}
|
2008-09-29 23:58:56 -07:00
|
|
|
};
|
|
|
|
|
2010-01-07 18:33:03 -08:00
|
|
|
static void
|
2012-05-03 15:42:38 -07:00
|
|
|
_recalc(void *data)
|
2010-01-07 18:33:03 -08:00
|
|
|
{
|
2012-05-03 15:42:38 -07:00
|
|
|
ELM_LABEL_DATA_GET(data, sd);
|
2013-10-05 01:14:43 -07:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(data, wd);
|
2012-05-03 15:42:38 -07:00
|
|
|
|
2011-06-12 05:02:57 -07:00
|
|
|
Evas_Coord minw = -1, minh = -1;
|
2014-09-01 07:05:30 -07:00
|
|
|
Evas_Coord resw, w;
|
2012-05-03 15:42:38 -07:00
|
|
|
|
2011-09-30 01:03:56 -07:00
|
|
|
evas_event_freeze(evas_object_evas_get(data));
|
2014-09-01 07:05:30 -07:00
|
|
|
edje_object_size_min_calc(wd->resize_obj, &minw, NULL);
|
|
|
|
evas_object_geometry_get(wd->resize_obj, NULL, NULL, &w, NULL);
|
2012-05-03 15:42:38 -07:00
|
|
|
|
2014-09-01 07:05:30 -07:00
|
|
|
if (sd->wrap_w > minw)
|
|
|
|
resw = sd->wrap_w;
|
|
|
|
else if ((sd->wrap_w > 0) && (minw > sd->wrap_w))
|
|
|
|
resw = minw;
|
|
|
|
else
|
|
|
|
resw = w;
|
2014-02-10 13:31:58 -08:00
|
|
|
edje_object_size_min_restricted_calc(wd->resize_obj, &minw, &minh, resw, 0);
|
2011-06-12 05:02:57 -07:00
|
|
|
|
Edje calc: Fix textblock size calculation logic
Summary:
In singleline textblock, using "text.min: 1 0" and min, max width,
Edje allows to use expandable text with ellipsis. It shows ellipsis
when only text's width reach the max width.
But, Edje couldn't support same feature on multiline textblock.
Edje dose not use max height or text.max properly if ellipsis is enabled.
This feature is very useful to make a layout with dynamically aligned text.
@fix
Reviewers: cedric, tasn, woohyun, raster, herdsman
Subscribers: z-wony, eagleeye, jpeg
Differential Revision: https://phab.enlightenment.org/D3595
2017-02-13 23:16:45 -08:00
|
|
|
/* If wrap_w is not set, label's width has to be controlled
|
|
|
|
by outside of label. So, we don't need to set minimum width. */
|
|
|
|
if (sd->wrap_w == -1)
|
|
|
|
evas_object_size_hint_min_set(data, 0, minh);
|
|
|
|
else
|
|
|
|
evas_object_size_hint_min_set(data, minw, minh);
|
2012-05-03 15:42:38 -07:00
|
|
|
|
2011-09-30 01:03:56 -07:00
|
|
|
evas_event_thaw(evas_object_evas_get(data));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(data));
|
2010-01-07 18:33:03 -08:00
|
|
|
}
|
|
|
|
|
2008-09-29 23:58:56 -07:00
|
|
|
static void
|
2014-02-10 13:31:58 -08:00
|
|
|
_label_format_set(Evas_Object *obj, const char *format)
|
2008-09-29 23:58:56 -07:00
|
|
|
{
|
2012-05-03 15:42:38 -07:00
|
|
|
if (format)
|
|
|
|
edje_object_part_text_style_user_push(obj, "elm.text", format);
|
|
|
|
else
|
|
|
|
edje_object_part_text_style_user_pop(obj, "elm.text");
|
2008-09-29 23:58:56 -07:00
|
|
|
}
|
|
|
|
|
2008-11-15 05:58:50 -08:00
|
|
|
static void
|
2013-01-03 23:39:14 -08:00
|
|
|
_label_slide_change(Evas_Object *obj)
|
2008-11-15 05:58:50 -08:00
|
|
|
{
|
2014-02-09 15:13:03 -08:00
|
|
|
const Evas_Object *tb;
|
2012-05-03 15:42:38 -07:00
|
|
|
char *plaintxt;
|
|
|
|
int plainlen = 0;
|
2012-05-02 09:59:20 -07:00
|
|
|
|
2012-05-03 15:42:38 -07:00
|
|
|
ELM_LABEL_DATA_GET(obj, sd);
|
2013-10-05 01:14:43 -07:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
2011-02-08 04:08:28 -08:00
|
|
|
|
2015-02-04 02:26:06 -08:00
|
|
|
if (!sd->slide_state) return;
|
|
|
|
|
2013-01-04 20:10:33 -08:00
|
|
|
edje_object_signal_emit(wd->resize_obj, "elm,state,slide,stop", "elm");
|
|
|
|
|
|
|
|
//doesn't support multiline slide effect
|
2012-05-03 15:42:38 -07:00
|
|
|
if (sd->linewrap)
|
|
|
|
{
|
2013-01-04 00:00:56 -08:00
|
|
|
WRN("Doesn't support slide effect for multiline! : label=%p", obj);
|
2012-05-03 15:42:38 -07:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-01-04 20:10:33 -08:00
|
|
|
//stop if the text is none.
|
2012-05-03 15:42:38 -07:00
|
|
|
plaintxt = _elm_util_mkup_to_text
|
2013-01-04 20:10:33 -08:00
|
|
|
(edje_object_part_text_get(wd->resize_obj, "elm.text"));
|
|
|
|
if (plaintxt)
|
2012-05-03 15:42:38 -07:00
|
|
|
{
|
|
|
|
plainlen = strlen(plaintxt);
|
|
|
|
free(plaintxt);
|
|
|
|
}
|
2013-01-06 20:33:29 -08:00
|
|
|
if (plainlen < 1) return;
|
2012-05-03 15:42:38 -07:00
|
|
|
|
2013-01-04 20:10:33 -08:00
|
|
|
//has slide effect.
|
2013-01-04 02:47:51 -08:00
|
|
|
if (sd->slide_mode != ELM_LABEL_SLIDE_MODE_NONE)
|
2012-05-03 15:42:38 -07:00
|
|
|
{
|
2014-02-09 15:13:03 -08:00
|
|
|
Evas_Coord w, tb_w;
|
|
|
|
|
|
|
|
tb = edje_object_part_object_get(wd->resize_obj, "elm.text");
|
|
|
|
evas_object_textblock_size_native_get(tb, &tb_w, NULL);
|
|
|
|
evas_object_geometry_get(wd->resize_obj, NULL, NULL, &w, NULL);
|
2016-06-27 11:12:16 -07:00
|
|
|
if (w <= 0) return;
|
2014-02-09 15:13:03 -08:00
|
|
|
|
2013-01-06 22:06:16 -08:00
|
|
|
if (sd->ellipsis)
|
|
|
|
{
|
|
|
|
sd->slide_ellipsis = EINA_TRUE;
|
|
|
|
elm_label_ellipsis_set(obj, EINA_FALSE);
|
|
|
|
}
|
|
|
|
|
2013-01-04 02:47:51 -08:00
|
|
|
//slide only if the slide area is smaller than text width size.
|
|
|
|
if (sd->slide_mode == ELM_LABEL_SLIDE_MODE_AUTO)
|
|
|
|
{
|
2014-02-09 15:13:03 -08:00
|
|
|
if ((tb_w > 0) && (tb_w < w))
|
|
|
|
{
|
|
|
|
if (sd->slide_ellipsis)
|
|
|
|
{
|
|
|
|
sd->slide_ellipsis = EINA_FALSE;
|
|
|
|
elm_label_ellipsis_set(obj, EINA_TRUE);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// calculate speed or duration
|
2014-02-10 13:53:26 -08:00
|
|
|
if (!strcmp(elm_object_style_get(obj), "slide_long"))
|
|
|
|
w = tb_w + w;
|
2016-09-06 15:00:53 -07:00
|
|
|
else if (!strcmp(elm_object_style_get(obj), "slide_short") ||
|
|
|
|
!strcmp(elm_object_style_get(obj), "slide_bounce")) // slide_short or slide_bounce
|
2014-02-10 13:53:26 -08:00
|
|
|
w = tb_w - w;
|
2016-09-06 15:00:53 -07:00
|
|
|
else
|
|
|
|
w = tb_w;
|
|
|
|
|
2014-02-09 15:13:03 -08:00
|
|
|
if (sd->use_slide_speed)
|
|
|
|
{
|
|
|
|
if (sd->slide_speed <= 0) sd->slide_speed = 1;
|
2014-02-10 13:53:26 -08:00
|
|
|
sd->slide_duration = w / sd->slide_speed;
|
2014-02-09 15:13:03 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (sd->slide_duration <= 0) sd->slide_duration = 1;
|
2014-02-10 13:53:26 -08:00
|
|
|
sd->slide_speed = w / sd->slide_duration;
|
2013-01-04 02:47:51 -08:00
|
|
|
}
|
2014-02-09 15:13:03 -08:00
|
|
|
|
2012-05-03 15:42:38 -07:00
|
|
|
Edje_Message_Float_Set *msg =
|
2016-06-10 01:06:57 -07:00
|
|
|
alloca(sizeof(Edje_Message_Float_Set));
|
2012-05-03 15:42:38 -07:00
|
|
|
|
|
|
|
msg->count = 1;
|
|
|
|
msg->val[0] = sd->slide_duration;
|
|
|
|
|
2014-02-10 13:31:58 -08:00
|
|
|
edje_object_message_send(wd->resize_obj, EDJE_MESSAGE_FLOAT_SET, 0, msg);
|
2013-01-04 20:10:33 -08:00
|
|
|
edje_object_signal_emit(wd->resize_obj, "elm,state,slide,start", "elm");
|
2012-05-03 15:42:38 -07:00
|
|
|
}
|
2013-01-04 20:10:33 -08:00
|
|
|
//no slide effect.
|
2012-05-03 15:42:38 -07:00
|
|
|
else
|
|
|
|
{
|
2013-01-03 23:32:10 -08:00
|
|
|
if (sd->slide_ellipsis)
|
2012-05-03 15:42:38 -07:00
|
|
|
{
|
2013-01-03 23:32:10 -08:00
|
|
|
sd->slide_ellipsis = EINA_FALSE;
|
2012-05-03 15:42:38 -07:00
|
|
|
elm_label_ellipsis_set(obj, EINA_TRUE);
|
|
|
|
}
|
|
|
|
}
|
2012-05-02 18:19:05 -07:00
|
|
|
}
|
2012-05-02 09:59:20 -07:00
|
|
|
|
Edje calc: Fix textblock size calculation logic
Summary:
In singleline textblock, using "text.min: 1 0" and min, max width,
Edje allows to use expandable text with ellipsis. It shows ellipsis
when only text's width reach the max width.
But, Edje couldn't support same feature on multiline textblock.
Edje dose not use max height or text.max properly if ellipsis is enabled.
This feature is very useful to make a layout with dynamically aligned text.
@fix
Reviewers: cedric, tasn, woohyun, raster, herdsman
Subscribers: z-wony, eagleeye, jpeg
Differential Revision: https://phab.enlightenment.org/D3595
2017-02-13 23:16:45 -08:00
|
|
|
static void
|
|
|
|
_elm_label_horizontal_size_policy_update(Eo *obj, Elm_Label_Data *sd)
|
|
|
|
{
|
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
|
|
|
|
|
|
|
if (!sd->ellipsis && (sd->linewrap == ELM_WRAP_NONE))
|
|
|
|
edje_object_signal_emit(wd->resize_obj, "elm,state,horizontal,expandable", "elm");
|
|
|
|
else
|
|
|
|
edje_object_signal_emit(wd->resize_obj, "elm,state,horizontal,fixed", "elm");
|
|
|
|
edje_object_message_signal_process(wd->resize_obj);
|
|
|
|
}
|
|
|
|
|
theme: return enum from elm_widget_style_set instead of bool
Summary:
if trying to apply incorrect theme, widget apply default theme and return TRUE.
so there is no way to check it really apply correct theme.
To resolve this problem, _elm_theme_set return three type enum
* related history : 4ca3ef45146e05908a13d1010909abeba9693ad6
* elm_object_style_set is public api, so I didn't change it.
* typedef name [ Theme_Apply ] is temporarily, please suggest better one.
@fix
Reviewers: singh.amitesh, herb, Hermet, cedric, jpeg, raster
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D4073
2016-06-30 23:09:42 -07:00
|
|
|
EOLIAN static Elm_Theme_Apply
|
2014-03-23 05:42:31 -07:00
|
|
|
_elm_label_elm_widget_theme_apply(Eo *obj, Elm_Label_Data *sd)
|
2012-05-02 18:19:05 -07:00
|
|
|
{
|
theme: return enum from elm_widget_style_set instead of bool
Summary:
if trying to apply incorrect theme, widget apply default theme and return TRUE.
so there is no way to check it really apply correct theme.
To resolve this problem, _elm_theme_set return three type enum
* related history : 4ca3ef45146e05908a13d1010909abeba9693ad6
* elm_object_style_set is public api, so I didn't change it.
* typedef name [ Theme_Apply ] is temporarily, please suggest better one.
@fix
Reviewers: singh.amitesh, herb, Hermet, cedric, jpeg, raster
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D4073
2016-06-30 23:09:42 -07:00
|
|
|
Elm_Theme_Apply int_ret = ELM_THEME_APPLY_FAILED;
|
2012-05-03 15:42:38 -07:00
|
|
|
|
theme: return enum from elm_widget_style_set instead of bool
Summary:
if trying to apply incorrect theme, widget apply default theme and return TRUE.
so there is no way to check it really apply correct theme.
To resolve this problem, _elm_theme_set return three type enum
* related history : 4ca3ef45146e05908a13d1010909abeba9693ad6
* elm_object_style_set is public api, so I didn't change it.
* typedef name [ Theme_Apply ] is temporarily, please suggest better one.
@fix
Reviewers: singh.amitesh, herb, Hermet, cedric, jpeg, raster
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D4073
2016-06-30 23:09:42 -07:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, ELM_THEME_APPLY_FAILED);
|
2012-05-03 15:42:38 -07:00
|
|
|
|
2011-09-30 01:03:56 -07:00
|
|
|
evas_event_freeze(evas_object_evas_get(obj));
|
2012-05-03 15:42:38 -07:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
int_ret = elm_obj_widget_theme_apply(efl_super(obj, MY_CLASS));
|
theme: return enum from elm_widget_style_set instead of bool
Summary:
if trying to apply incorrect theme, widget apply default theme and return TRUE.
so there is no way to check it really apply correct theme.
To resolve this problem, _elm_theme_set return three type enum
* related history : 4ca3ef45146e05908a13d1010909abeba9693ad6
* elm_object_style_set is public api, so I didn't change it.
* typedef name [ Theme_Apply ] is temporarily, please suggest better one.
@fix
Reviewers: singh.amitesh, herb, Hermet, cedric, jpeg, raster
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D4073
2016-06-30 23:09:42 -07:00
|
|
|
if (!int_ret) return ELM_THEME_APPLY_FAILED;
|
2012-05-03 15:42:38 -07:00
|
|
|
|
Edje calc: Fix textblock size calculation logic
Summary:
In singleline textblock, using "text.min: 1 0" and min, max width,
Edje allows to use expandable text with ellipsis. It shows ellipsis
when only text's width reach the max width.
But, Edje couldn't support same feature on multiline textblock.
Edje dose not use max height or text.max properly if ellipsis is enabled.
This feature is very useful to make a layout with dynamically aligned text.
@fix
Reviewers: cedric, tasn, woohyun, raster, herdsman
Subscribers: z-wony, eagleeye, jpeg
Differential Revision: https://phab.enlightenment.org/D3595
2017-02-13 23:16:45 -08:00
|
|
|
_elm_label_horizontal_size_policy_update(obj, sd);
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
_label_format_set(wd->resize_obj, sd->format);
|
2013-01-03 23:39:14 -08:00
|
|
|
_label_slide_change(obj);
|
2012-05-03 15:42:38 -07:00
|
|
|
|
2011-09-30 01:03:56 -07:00
|
|
|
evas_event_thaw(evas_object_evas_get(obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(obj));
|
2012-05-03 15:42:38 -07:00
|
|
|
|
2015-02-05 03:41:16 -08:00
|
|
|
elm_layout_sizing_eval(obj);
|
|
|
|
|
2014-03-23 05:42:31 -07:00
|
|
|
return int_ret;
|
2008-11-15 05:58:50 -08:00
|
|
|
}
|
|
|
|
|
2014-03-23 05:42:31 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_label_elm_layout_sizing_eval(Eo *obj, Elm_Label_Data *_pd EINA_UNUSED)
|
2008-09-29 23:58:56 -07:00
|
|
|
{
|
2011-06-12 05:02:57 -07:00
|
|
|
Evas_Coord minw = -1, minh = -1;
|
2010-03-08 23:30:48 -08:00
|
|
|
Evas_Coord resw, resh;
|
2011-06-09 06:56:09 -07:00
|
|
|
|
2012-05-03 15:42:38 -07:00
|
|
|
ELM_LABEL_DATA_GET(obj, sd);
|
2013-10-05 01:14:43 -07:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
2012-05-03 15:42:38 -07:00
|
|
|
|
|
|
|
if (sd->linewrap)
|
2010-01-07 18:33:03 -08:00
|
|
|
{
|
2014-02-10 13:31:58 -08:00
|
|
|
evas_object_geometry_get(wd->resize_obj, NULL, NULL, &resw, &resh);
|
2012-05-03 15:42:38 -07:00
|
|
|
if (resw == sd->lastw) return;
|
|
|
|
sd->lastw = resw;
|
|
|
|
_recalc(obj);
|
2010-01-07 18:33:03 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-09-30 01:03:56 -07:00
|
|
|
evas_event_freeze(evas_object_evas_get(obj));
|
2013-01-04 21:50:13 -08:00
|
|
|
edje_object_size_min_calc(wd->resize_obj, &minw, &minh);
|
2012-05-03 15:42:38 -07:00
|
|
|
if (sd->wrap_w > 0 && minw > sd->wrap_w) minw = sd->wrap_w;
|
2010-01-07 18:33:03 -08:00
|
|
|
evas_object_size_hint_min_set(obj, minw, minh);
|
2011-09-30 01:03:56 -07:00
|
|
|
evas_event_thaw(evas_object_evas_get(obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(obj));
|
2010-01-07 18:33:03 -08:00
|
|
|
}
|
2008-09-29 23:58:56 -07:00
|
|
|
}
|
|
|
|
|
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
|
|
|
static void
|
2014-02-10 13:31:58 -08:00
|
|
|
_on_label_resize(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
2010-01-07 18:33:03 -08:00
|
|
|
{
|
2014-02-09 11:21:21 -08:00
|
|
|
ELM_LABEL_DATA_GET(data, sd);
|
2010-07-15 22:50:45 -07:00
|
|
|
|
2014-02-09 15:13:03 -08:00
|
|
|
if (sd->slide_mode != ELM_LABEL_SLIDE_MODE_NONE) _label_slide_change(data);
|
2014-02-09 11:21:21 -08:00
|
|
|
if (sd->linewrap) elm_layout_sizing_eval(data);
|
2012-03-07 06:02:42 -08:00
|
|
|
}
|
|
|
|
|
2010-07-15 22:50:45 -07:00
|
|
|
static int
|
2014-02-10 13:31:58 -08:00
|
|
|
_get_value_in_key_string(const char *oldstring, const char *key, char **value)
|
2010-07-15 22:50:45 -07:00
|
|
|
{
|
2012-01-23 08:10:53 -08:00
|
|
|
char *curlocater, *endtag;
|
2010-07-15 22:50:45 -07:00
|
|
|
int firstindex = 0, foundflag = -1;
|
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
|
|
|
|
2010-07-15 22:50:45 -07:00
|
|
|
curlocater = strstr(oldstring, key);
|
|
|
|
if (curlocater)
|
|
|
|
{
|
2010-10-18 19:17:37 -07:00
|
|
|
int key_len = strlen(key);
|
|
|
|
endtag = curlocater + key_len;
|
2010-08-21 06:52:25 -07:00
|
|
|
if ((!endtag) || (*endtag != '='))
|
2010-12-19 23:18:23 -08:00
|
|
|
return -1;
|
2014-03-28 07:46:12 -07:00
|
|
|
|
2015-07-29 07:33:33 -07:00
|
|
|
firstindex = abs((int)(oldstring - curlocater));
|
2010-10-18 19:17:37 -07:00
|
|
|
firstindex += key_len + 1; // strlen("key") + strlen("=")
|
2010-07-15 23:21:25 -07:00
|
|
|
*value = (char *)oldstring + firstindex;
|
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
|
|
|
|
2012-01-23 08:10:53 -08:00
|
|
|
foundflag = 1;
|
2010-07-15 22:50:45 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-07-15 23:21:25 -07:00
|
|
|
foundflag = 0;
|
2010-07-15 22:50:45 -07:00
|
|
|
}
|
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
|
|
|
|
2010-07-15 22:50:45 -07:00
|
|
|
if (foundflag == 1) return 0;
|
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
|
|
|
|
2010-07-15 22:50:45 -07:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2014-02-10 13:31:58 -08:00
|
|
|
_strbuf_key_value_replace(Eina_Strbuf *srcbuf, const char *key, const char *value, int deleteflag)
|
2010-07-15 22:50:45 -07:00
|
|
|
{
|
2012-01-23 08:10:53 -08:00
|
|
|
char *kvalue;
|
2010-07-15 22:50:45 -07:00
|
|
|
const char *srcstring = NULL;
|
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
|
|
|
|
2010-07-15 22:50:45 -07:00
|
|
|
srcstring = eina_strbuf_string_get(srcbuf);
|
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
|
|
|
|
2012-01-23 08:10:53 -08:00
|
|
|
if (_get_value_in_key_string(srcstring, key, &kvalue) == 0)
|
2010-07-15 22:50:45 -07:00
|
|
|
{
|
2012-01-23 08:10:53 -08:00
|
|
|
const char *val_end;
|
|
|
|
int val_end_idx = 0;
|
|
|
|
int key_start_idx = 0;
|
|
|
|
val_end = strchr(kvalue, ' ');
|
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
|
|
|
|
2012-01-23 08:10:53 -08:00
|
|
|
if (val_end)
|
2012-05-03 15:42:38 -07:00
|
|
|
val_end_idx = val_end - srcstring;
|
2012-01-23 08:10:53 -08:00
|
|
|
else
|
2012-05-03 15:42:38 -07:00
|
|
|
val_end_idx = kvalue - srcstring + strlen(kvalue) - 1;
|
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
|
|
|
|
2012-01-23 08:10:53 -08:00
|
|
|
/* -1 is because of the '=' */
|
|
|
|
key_start_idx = kvalue - srcstring - 1 - strlen(key);
|
|
|
|
eina_strbuf_remove(srcbuf, key_start_idx, val_end_idx);
|
|
|
|
if (!deleteflag)
|
|
|
|
{
|
|
|
|
eina_strbuf_insert_printf(srcbuf, "%s=%s", key_start_idx, key,
|
2012-05-03 15:42:38 -07:00
|
|
|
value);
|
2012-01-23 08:10:53 -08:00
|
|
|
}
|
2010-07-15 22:50:45 -07:00
|
|
|
}
|
2012-01-23 08:10:53 -08:00
|
|
|
else if (!deleteflag)
|
2010-07-15 22:50:45 -07:00
|
|
|
{
|
2012-01-23 08:10:53 -08:00
|
|
|
if (*srcstring)
|
2010-07-15 22:50:45 -07:00
|
|
|
{
|
2012-01-23 08:10:53 -08:00
|
|
|
/* -1 because we want it before the ' */
|
2014-02-10 13:31:58 -08:00
|
|
|
eina_strbuf_insert_printf (srcbuf, " %s=%s",
|
|
|
|
eina_strbuf_length_get(srcbuf) - 1, key, value);
|
2010-07-15 22:50:45 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-01-23 08:10:53 -08:00
|
|
|
eina_strbuf_append_printf(srcbuf, "DEFAULT='%s=%s'", key, value);
|
2010-07-15 22:50:45 -07:00
|
|
|
}
|
|
|
|
}
|
2012-05-03 15:42:38 -07:00
|
|
|
|
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
|
|
|
return 0;
|
2010-07-15 22:50:45 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2014-02-10 13:31:58 -08:00
|
|
|
_stringshare_key_value_replace(const char **srcstring, const char *key, const char *value, int deleteflag)
|
2010-07-15 22:50:45 -07:00
|
|
|
{
|
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
|
|
|
Eina_Strbuf *sharebuf = NULL;
|
|
|
|
|
2010-07-15 22:50:45 -07:00
|
|
|
sharebuf = eina_strbuf_new();
|
|
|
|
eina_strbuf_append(sharebuf, *srcstring);
|
|
|
|
_strbuf_key_value_replace(sharebuf, key, value, deleteflag);
|
|
|
|
eina_stringshare_del(*srcstring);
|
|
|
|
*srcstring = eina_stringshare_add(eina_strbuf_string_get(sharebuf));
|
|
|
|
eina_strbuf_free(sharebuf);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-03-23 05:42:31 -07:00
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elm_label_elm_layout_text_set(Eo *obj, Elm_Label_Data *sd, const char *part, const char *label)
|
2011-06-28 23:41:20 -07:00
|
|
|
{
|
2014-03-23 05:42:31 -07:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
|
2012-11-25 22:32:53 -08:00
|
|
|
Eina_Bool int_ret = EINA_FALSE;
|
2011-06-28 23:41:20 -07:00
|
|
|
|
2012-05-03 15:42:38 -07:00
|
|
|
if (!label) label = "";
|
2012-11-25 22:32:53 -08:00
|
|
|
_label_format_set(wd->resize_obj, sd->format);
|
2012-05-02 09:59:20 -07:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
int_ret = elm_obj_layout_text_set(efl_super(obj, MY_CLASS), part, label);
|
2012-11-25 22:32:53 -08:00
|
|
|
if (int_ret)
|
2012-11-21 09:09:44 -08:00
|
|
|
{
|
2014-11-09 21:06:32 -08:00
|
|
|
sd->lastw = -1;
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_obj_layout_sizing_eval(obj);
|
2016-03-21 22:45:49 -07:00
|
|
|
_label_slide_change(obj);
|
2012-11-21 09:09:44 -08:00
|
|
|
}
|
2014-03-23 05:42:31 -07:00
|
|
|
return int_ret;
|
2012-05-03 15:42:38 -07:00
|
|
|
}
|
2012-05-02 09:59:20 -07:00
|
|
|
|
2012-08-18 06:52:03 -07:00
|
|
|
static char *
|
2014-01-06 06:30:02 -08:00
|
|
|
_access_info_cb(void *data EINA_UNUSED, Evas_Object *obj)
|
2012-08-18 06:52:03 -07:00
|
|
|
{
|
|
|
|
const char *txt = elm_widget_access_info_get(obj);
|
|
|
|
|
2015-05-17 22:25:12 -07:00
|
|
|
if (!txt)
|
|
|
|
return _elm_util_mkup_to_text(elm_layout_text_get(obj, NULL));
|
|
|
|
else return strdup(txt);
|
2012-08-18 06:52:03 -07:00
|
|
|
}
|
|
|
|
|
2013-01-04 20:56:06 -08:00
|
|
|
static void
|
2014-01-06 06:30:02 -08:00
|
|
|
_on_slide_end(void *data, Evas_Object *obj EINA_UNUSED,
|
|
|
|
const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
|
2013-01-04 20:56:06 -08:00
|
|
|
{
|
2013-01-06 20:33:29 -08:00
|
|
|
ELM_LABEL_DATA_GET(data, sd);
|
|
|
|
|
|
|
|
if (sd->slide_ellipsis)
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_obj_label_ellipsis_set(data, EINA_TRUE);
|
2013-01-06 20:33:29 -08:00
|
|
|
|
2016-08-22 15:40:39 -07:00
|
|
|
efl_event_callback_legacy_call(data, ELM_LABEL_EVENT_SLIDE_END, NULL);
|
2013-01-04 20:56:06 -08:00
|
|
|
}
|
|
|
|
|
2014-03-23 05:42:31 -07:00
|
|
|
EOLIAN static void
|
2016-06-17 01:26:08 -07:00
|
|
|
_elm_label_efl_canvas_group_group_add(Eo *obj, Elm_Label_Data *priv)
|
2011-10-19 07:17:14 -07:00
|
|
|
{
|
2013-10-05 01:14:43 -07:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
2012-05-02 09:59:20 -07:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_canvas_group_add(efl_super(obj, MY_CLASS));
|
2012-05-03 15:42:38 -07:00
|
|
|
|
2013-09-24 21:33:39 -07:00
|
|
|
elm_widget_sub_object_parent_add(obj);
|
2013-02-20 21:57:05 -08:00
|
|
|
|
2012-05-03 15:42:38 -07:00
|
|
|
priv->linewrap = ELM_WRAP_NONE;
|
|
|
|
priv->wrap_w = -1;
|
|
|
|
priv->slide_duration = 10;
|
|
|
|
|
|
|
|
priv->format = eina_stringshare_add("");
|
2012-11-25 22:32:53 -08:00
|
|
|
_label_format_set(wd->resize_obj, priv->format);
|
2012-05-03 15:42:38 -07:00
|
|
|
|
2014-02-10 13:31:58 -08:00
|
|
|
evas_object_event_callback_add(wd->resize_obj, EVAS_CALLBACK_RESIZE,
|
|
|
|
_on_label_resize, obj);
|
2012-05-03 15:42:38 -07:00
|
|
|
|
2014-12-17 21:24:12 -08:00
|
|
|
edje_object_signal_callback_add(wd->resize_obj, "elm,state,slide,end", "elm",
|
2013-01-04 20:56:06 -08:00
|
|
|
_on_slide_end, obj);
|
|
|
|
|
2013-02-07 22:16:03 -08:00
|
|
|
/* access */
|
|
|
|
elm_widget_can_focus_set(obj, _elm_config->access_mode);
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
_elm_access_object_register(obj, wd->resize_obj);
|
2014-02-10 13:31:58 -08:00
|
|
|
_elm_access_text_set(_elm_access_info_get(obj), ELM_ACCESS_TYPE,
|
|
|
|
E_("Label"));
|
|
|
|
_elm_access_callback_set(_elm_access_info_get(obj), ELM_ACCESS_INFO,
|
|
|
|
_access_info_cb, NULL);
|
2013-02-20 21:57:05 -08:00
|
|
|
|
2013-03-01 18:04:31 -08:00
|
|
|
if (!elm_layout_theme_set(obj, "label", "base", elm_widget_style_get(obj)))
|
2013-12-25 20:03:55 -08:00
|
|
|
CRI("Failed to set layout!");
|
2013-03-01 18:04:31 -08:00
|
|
|
|
2013-02-20 21:57:05 -08:00
|
|
|
elm_layout_text_set(obj, NULL, "<br>");
|
|
|
|
elm_layout_sizing_eval(obj);
|
2012-05-02 18:19:05 -07:00
|
|
|
}
|
2012-05-02 09:59:20 -07:00
|
|
|
|
2008-10-06 18:23:49 -07:00
|
|
|
EAPI Evas_Object *
|
|
|
|
elm_label_add(Evas_Object *parent)
|
2008-09-29 23:58:56 -07:00
|
|
|
{
|
2012-05-03 15:42:38 -07:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Object *obj = efl_add(MY_CLASS, parent);
|
2012-11-25 22:32:53 -08:00
|
|
|
return obj;
|
|
|
|
}
|
2012-05-03 15:42:38 -07:00
|
|
|
|
2015-05-19 05:34:07 -07:00
|
|
|
EOLIAN static Eo *
|
2016-08-10 07:23:04 -07:00
|
|
|
_elm_label_efl_object_constructor(Eo *obj, Elm_Label_Data *_pd EINA_UNUSED)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
obj = efl_constructor(efl_super(obj, MY_CLASS));
|
2016-06-20 21:26:15 -07:00
|
|
|
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
|
2016-06-16 22:12:02 -07:00
|
|
|
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_interface_atspi_accessible_role_set(obj, ELM_ATSPI_ROLE_LABEL);
|
2015-05-19 05:34:07 -07:00
|
|
|
|
|
|
|
return obj;
|
2008-10-06 18:23:49 -07:00
|
|
|
}
|
2008-09-29 23:58:56 -07:00
|
|
|
|
2014-03-23 05:42:31 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_label_line_wrap_set(Eo *obj, Elm_Label_Data *sd, Elm_Wrap_Type wrap)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2012-05-03 15:42:38 -07:00
|
|
|
const char *wrap_str, *text;
|
2011-06-09 06:56:09 -07:00
|
|
|
int len;
|
|
|
|
|
2013-10-05 01:14:43 -07:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
2012-05-03 15:42:38 -07:00
|
|
|
|
|
|
|
if (sd->linewrap == wrap) return;
|
|
|
|
|
|
|
|
sd->linewrap = wrap;
|
Edje calc: Fix textblock size calculation logic
Summary:
In singleline textblock, using "text.min: 1 0" and min, max width,
Edje allows to use expandable text with ellipsis. It shows ellipsis
when only text's width reach the max width.
But, Edje couldn't support same feature on multiline textblock.
Edje dose not use max height or text.max properly if ellipsis is enabled.
This feature is very useful to make a layout with dynamically aligned text.
@fix
Reviewers: cedric, tasn, woohyun, raster, herdsman
Subscribers: z-wony, eagleeye, jpeg
Differential Revision: https://phab.enlightenment.org/D3595
2017-02-13 23:16:45 -08:00
|
|
|
sd->lastw = -1;
|
|
|
|
|
|
|
|
_elm_label_horizontal_size_policy_update(obj, sd);
|
|
|
|
|
2012-05-03 15:42:38 -07:00
|
|
|
text = elm_layout_text_get(obj, NULL);
|
|
|
|
if (!text) return;
|
|
|
|
|
|
|
|
len = strlen(text);
|
2011-06-09 06:56:09 -07:00
|
|
|
if (len <= 0) return;
|
|
|
|
|
|
|
|
switch (wrap)
|
|
|
|
{
|
|
|
|
case ELM_WRAP_CHAR:
|
2012-05-03 15:42:38 -07:00
|
|
|
wrap_str = "char";
|
|
|
|
break;
|
|
|
|
|
2011-06-09 06:56:09 -07:00
|
|
|
case ELM_WRAP_WORD:
|
2012-05-03 15:42:38 -07:00
|
|
|
wrap_str = "word";
|
|
|
|
break;
|
|
|
|
|
2011-06-09 06:56:09 -07:00
|
|
|
case ELM_WRAP_MIXED:
|
2012-05-03 15:42:38 -07:00
|
|
|
wrap_str = "mixed";
|
|
|
|
break;
|
|
|
|
|
2011-06-09 06:56:09 -07:00
|
|
|
default:
|
2012-05-03 15:42:38 -07:00
|
|
|
wrap_str = "none";
|
|
|
|
break;
|
2011-06-09 06:56:09 -07:00
|
|
|
}
|
|
|
|
|
2012-05-03 15:42:38 -07:00
|
|
|
if (_stringshare_key_value_replace(&sd->format, "wrap", wrap_str, 0) == 0)
|
2011-06-09 06:56:09 -07:00
|
|
|
{
|
2014-11-09 21:06:32 -08:00
|
|
|
sd->lastw = -1;
|
2012-11-25 22:32:53 -08:00
|
|
|
_label_format_set(wd->resize_obj, sd->format);
|
2012-05-03 15:42:38 -07:00
|
|
|
elm_layout_sizing_eval(obj);
|
2011-06-09 06:56:09 -07:00
|
|
|
}
|
2009-10-10 22:57:05 -07:00
|
|
|
}
|
2010-01-26 00:42:37 -08:00
|
|
|
|
2014-03-23 05:42:31 -07:00
|
|
|
EOLIAN static Elm_Wrap_Type
|
|
|
|
_elm_label_line_wrap_get(Eo *obj EINA_UNUSED, Elm_Label_Data *sd)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-03-23 05:42:31 -07:00
|
|
|
return sd->linewrap;
|
2010-01-26 00:42:37 -08:00
|
|
|
}
|
|
|
|
|
2014-03-23 05:42:31 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_label_wrap_width_set(Eo *obj, Elm_Label_Data *sd, Evas_Coord w)
|
2010-01-26 00:42:37 -08:00
|
|
|
{
|
2013-10-05 01:14:43 -07:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
2012-05-03 15:42:38 -07:00
|
|
|
|
2010-12-19 23:18:23 -08:00
|
|
|
if (w < 0) w = 0;
|
2012-05-03 15:42:38 -07:00
|
|
|
|
|
|
|
if (sd->wrap_w == w) return;
|
|
|
|
|
|
|
|
if (sd->ellipsis)
|
2012-11-25 22:32:53 -08:00
|
|
|
_label_format_set(wd->resize_obj, sd->format);
|
2012-05-03 15:42:38 -07:00
|
|
|
sd->wrap_w = w;
|
2014-11-09 21:06:32 -08:00
|
|
|
sd->lastw = -1;
|
2012-05-03 15:42:38 -07:00
|
|
|
|
|
|
|
elm_layout_sizing_eval(obj);
|
2010-01-26 00:42:37 -08:00
|
|
|
}
|
|
|
|
|
2014-03-23 05:42:31 -07:00
|
|
|
EOLIAN static Evas_Coord
|
|
|
|
_elm_label_wrap_width_get(Eo *obj EINA_UNUSED, Elm_Label_Data *sd)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-03-23 05:42:31 -07:00
|
|
|
return sd->wrap_w;
|
2010-01-26 00:42:37 -08:00
|
|
|
}
|
2010-07-15 22:50:45 -07:00
|
|
|
|
2014-03-23 05:42:31 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_label_ellipsis_set(Eo *obj, Elm_Label_Data *sd, Eina_Bool ellipsis)
|
2010-07-15 22:50:45 -07:00
|
|
|
{
|
2011-06-09 06:56:09 -07:00
|
|
|
Eina_Strbuf *fontbuf = NULL;
|
|
|
|
int len, removeflag = 0;
|
2012-05-03 15:42:38 -07:00
|
|
|
const char *text;
|
|
|
|
|
2013-10-05 01:14:43 -07:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
2011-06-09 06:56:09 -07:00
|
|
|
|
2012-05-03 15:42:38 -07:00
|
|
|
if (sd->ellipsis == ellipsis) return;
|
|
|
|
sd->ellipsis = ellipsis;
|
Edje calc: Fix textblock size calculation logic
Summary:
In singleline textblock, using "text.min: 1 0" and min, max width,
Edje allows to use expandable text with ellipsis. It shows ellipsis
when only text's width reach the max width.
But, Edje couldn't support same feature on multiline textblock.
Edje dose not use max height or text.max properly if ellipsis is enabled.
This feature is very useful to make a layout with dynamically aligned text.
@fix
Reviewers: cedric, tasn, woohyun, raster, herdsman
Subscribers: z-wony, eagleeye, jpeg
Differential Revision: https://phab.enlightenment.org/D3595
2017-02-13 23:16:45 -08:00
|
|
|
sd->lastw = -1;
|
|
|
|
|
|
|
|
_elm_label_horizontal_size_policy_update(obj, sd);
|
2012-05-03 15:42:38 -07:00
|
|
|
|
|
|
|
text = elm_layout_text_get(obj, NULL);
|
|
|
|
if (!text) return;
|
|
|
|
|
|
|
|
len = strlen(text);
|
2011-06-09 06:56:09 -07:00
|
|
|
if (len <= 0) return;
|
|
|
|
|
|
|
|
if (ellipsis == EINA_FALSE) removeflag = 1; // remove fontsize tag
|
|
|
|
|
|
|
|
fontbuf = eina_strbuf_new();
|
|
|
|
eina_strbuf_append_printf(fontbuf, "%f", 1.0);
|
|
|
|
|
2012-05-03 15:42:38 -07:00
|
|
|
if (_stringshare_key_value_replace
|
|
|
|
(&sd->format, "ellipsis", eina_strbuf_string_get
|
|
|
|
(fontbuf), removeflag) == 0)
|
2011-06-09 06:56:09 -07:00
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
_label_format_set(wd->resize_obj, sd->format);
|
2012-05-03 15:42:38 -07:00
|
|
|
elm_layout_sizing_eval(obj);
|
2011-06-09 06:56:09 -07:00
|
|
|
}
|
|
|
|
eina_strbuf_free(fontbuf);
|
2010-07-15 22:50:45 -07:00
|
|
|
}
|
2010-12-20 00:55:06 -08:00
|
|
|
|
2014-03-23 05:42:31 -07:00
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elm_label_ellipsis_get(Eo *obj EINA_UNUSED, Elm_Label_Data *sd)
|
2012-02-16 03:39:07 -08:00
|
|
|
{
|
2014-03-23 05:42:31 -07:00
|
|
|
return sd->ellipsis;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2012-05-03 15:42:38 -07:00
|
|
|
|
2014-03-23 05:42:31 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_label_slide_mode_set(Eo *obj EINA_UNUSED, Elm_Label_Data *sd, Elm_Label_Slide_Mode mode)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2013-01-04 02:47:51 -08:00
|
|
|
sd->slide_mode = mode;
|
2010-12-20 00:55:06 -08:00
|
|
|
}
|
|
|
|
|
2014-03-23 05:42:31 -07:00
|
|
|
EOLIAN static Elm_Label_Slide_Mode
|
|
|
|
_elm_label_slide_mode_get(Eo *obj EINA_UNUSED, Elm_Label_Data *sd)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-03-23 05:42:31 -07:00
|
|
|
return sd->slide_mode;
|
2013-01-04 02:47:51 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
EINA_DEPRECATED EAPI void
|
2014-02-10 13:31:58 -08:00
|
|
|
elm_label_slide_set(Evas_Object *obj, Eina_Bool slide)
|
2013-01-04 02:47:51 -08:00
|
|
|
{
|
|
|
|
if (slide)
|
|
|
|
elm_label_slide_mode_set(obj, ELM_LABEL_SLIDE_MODE_ALWAYS);
|
|
|
|
else
|
|
|
|
elm_label_slide_mode_set(obj, ELM_LABEL_SLIDE_MODE_NONE);
|
|
|
|
}
|
|
|
|
|
|
|
|
EINA_DEPRECATED EAPI Eina_Bool
|
|
|
|
elm_label_slide_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Eina_Bool ret = EINA_FALSE;
|
|
|
|
if (elm_label_slide_mode_get(obj) == ELM_LABEL_SLIDE_MODE_ALWAYS)
|
|
|
|
ret = EINA_TRUE;
|
|
|
|
return ret;
|
2010-12-20 00:55:06 -08:00
|
|
|
}
|
|
|
|
|
2014-03-23 05:42:31 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_label_slide_duration_set(Eo *obj EINA_UNUSED, Elm_Label_Data *sd, double duration)
|
2010-12-20 00:55:06 -08:00
|
|
|
{
|
2012-05-03 15:42:38 -07:00
|
|
|
sd->slide_duration = duration;
|
2014-02-09 15:13:03 -08:00
|
|
|
sd->use_slide_speed = EINA_FALSE;
|
2010-12-20 00:55:06 -08:00
|
|
|
}
|
|
|
|
|
2014-03-23 05:42:31 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_label_slide_speed_set(Eo *obj EINA_UNUSED, Elm_Label_Data *sd, double speed)
|
2014-02-09 15:13:03 -08:00
|
|
|
{
|
|
|
|
sd->slide_speed = speed;
|
|
|
|
sd->use_slide_speed = EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2014-03-23 05:42:31 -07:00
|
|
|
EOLIAN static double
|
|
|
|
_elm_label_slide_speed_get(Eo *obj EINA_UNUSED, Elm_Label_Data *sd)
|
2014-02-09 15:13:03 -08:00
|
|
|
{
|
2014-03-23 05:42:31 -07:00
|
|
|
return sd->slide_speed;
|
2014-02-09 15:13:03 -08:00
|
|
|
}
|
|
|
|
|
2014-03-23 05:42:31 -07:00
|
|
|
EOLIAN static void
|
2015-02-04 02:26:06 -08:00
|
|
|
_elm_label_slide_go(Eo *obj, Elm_Label_Data *sd)
|
2013-01-04 05:24:37 -08:00
|
|
|
{
|
2015-02-04 02:26:06 -08:00
|
|
|
if (!sd->slide_state) sd->slide_state = EINA_TRUE;
|
|
|
|
|
2013-01-04 05:24:37 -08:00
|
|
|
_label_slide_change(obj);
|
|
|
|
elm_layout_sizing_eval(obj);
|
|
|
|
}
|
|
|
|
|
2014-03-23 05:42:31 -07:00
|
|
|
EOLIAN static double
|
|
|
|
_elm_label_slide_duration_get(Eo *obj EINA_UNUSED, Elm_Label_Data *sd)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-03-23 05:42:31 -07:00
|
|
|
return sd->slide_duration;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-23 05:42:31 -07:00
|
|
|
EOLIAN static const Elm_Layout_Part_Alias_Description*
|
|
|
|
_elm_label_elm_layout_text_aliases_get(Eo *obj EINA_UNUSED, Elm_Label_Data *_pd EINA_UNUSED)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-03-23 05:42:31 -07:00
|
|
|
return _text_aliases;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2012-05-02 18:19:05 -07:00
|
|
|
|
2014-03-23 05:42:31 -07:00
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elm_label_elm_widget_focus_next_manager_is(Eo *obj EINA_UNUSED, Elm_Label_Data *_pd EINA_UNUSED)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-03-23 05:42:31 -07:00
|
|
|
return EINA_FALSE;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-23 05:42:31 -07:00
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elm_label_elm_widget_focus_direction_manager_is(Eo *obj EINA_UNUSED, Elm_Label_Data *_pd EINA_UNUSED)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-03-23 05:42:31 -07:00
|
|
|
return EINA_FALSE;
|
2012-05-03 15:42:38 -07:00
|
|
|
}
|
2012-11-25 22:32:53 -08:00
|
|
|
|
2014-03-23 05:42:31 -07:00
|
|
|
EOLIAN static void
|
2016-08-10 07:23:04 -07:00
|
|
|
_elm_label_class_constructor(Efl_Class *klass)
|
2014-03-23 05:42:31 -07:00
|
|
|
{
|
2013-11-07 03:44:22 -08:00
|
|
|
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2014-03-23 05:42:31 -07:00
|
|
|
|
2017-05-18 01:52:17 -07:00
|
|
|
/* Internal EO APIs and hidden overrides */
|
|
|
|
|
|
|
|
#define ELM_LABEL_EXTRA_OPS \
|
|
|
|
EFL_CANVAS_GROUP_ADD_OPS(elm_label)
|
|
|
|
|
2014-03-23 05:42:31 -07:00
|
|
|
#include "elm_label.eo.c"
|