2012-08-01 14:03:51 -07:00
|
|
|
#ifndef ELM_WIDGET_LABEL_H
|
|
|
|
#define ELM_WIDGET_LABEL_H
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
#include "Elementary.h"
|
2012-08-01 14:03:51 -07:00
|
|
|
|
2013-11-12 05:56:05 -08:00
|
|
|
#include <Eio.h>
|
2012-08-01 14:03:51 -07:00
|
|
|
|
2014-08-07 09:26:47 -07:00
|
|
|
/* DO NOT USE THIS HEADER UNLESS YOU ARE PREPARED FOR BREAKING OF YOUR
|
|
|
|
* CODE. THIS IS ELEMENTARY'S INTERNAL WIDGET API (for now) AND IS NOT
|
|
|
|
* FINAL. CALL elm_widget_api_check(ELM_INTERNAL_API_VERSION) TO CHECK
|
|
|
|
* IT AT RUNTIME.
|
|
|
|
*/
|
|
|
|
|
2012-08-01 14:03:51 -07:00
|
|
|
/**
|
|
|
|
* Base layout smart data extended with label instance data.
|
|
|
|
*/
|
2014-03-23 05:42:31 -07:00
|
|
|
typedef struct _Elm_Label_Data Elm_Label_Data;
|
|
|
|
struct _Elm_Label_Data
|
2012-08-01 14:03:51 -07:00
|
|
|
{
|
|
|
|
const char *format;
|
|
|
|
double slide_duration;
|
2014-02-09 15:13:03 -08:00
|
|
|
double slide_speed;
|
2014-11-12 16:45:45 -08:00
|
|
|
Evas_Coord lastw; /*<< lastly calculated resize object width.This is used to force the calculation on width changes. */
|
|
|
|
Evas_Coord wrap_w; /*<< wrap width by pixel for the line wrap support **/
|
2012-08-01 14:03:51 -07:00
|
|
|
Elm_Wrap_Type linewrap;
|
2013-01-04 02:47:51 -08:00
|
|
|
Elm_Label_Slide_Mode slide_mode;
|
2012-08-01 14:03:51 -07:00
|
|
|
|
|
|
|
Eina_Bool ellipsis : 1;
|
2013-01-03 23:32:10 -08:00
|
|
|
Eina_Bool slide_ellipsis : 1;
|
2014-02-09 15:13:03 -08:00
|
|
|
Eina_Bool use_slide_speed : 1;
|
2015-02-04 02:26:06 -08:00
|
|
|
Eina_Bool slide_state : 1; /**< This will be marked as EINA_TRUE after elm_label_slide_go() is called. */
|
2012-08-01 14:03:51 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#define ELM_LABEL_DATA_GET(o, sd) \
|
2016-08-15 06:44:41 -07:00
|
|
|
Elm_Label_Data * sd = efl_data_scope_get(o, ELM_LABEL_CLASS)
|
2012-08-01 14:03:51 -07:00
|
|
|
|
|
|
|
#define ELM_LABEL_DATA_GET_OR_RETURN(o, ptr) \
|
|
|
|
ELM_LABEL_DATA_GET(o, ptr); \
|
2014-01-15 10:33:40 -08:00
|
|
|
if (EINA_UNLIKELY(!ptr)) \
|
2012-08-01 14:03:51 -07:00
|
|
|
{ \
|
2014-01-15 10:33:40 -08:00
|
|
|
CRI("No widget data for object %p (%s)", \
|
|
|
|
o, evas_object_type_get(o)); \
|
2012-08-01 14:03:51 -07:00
|
|
|
return; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define ELM_LABEL_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
|
|
|
|
ELM_LABEL_DATA_GET(o, ptr); \
|
2014-01-15 10:33:40 -08:00
|
|
|
if (EINA_UNLIKELY(!ptr)) \
|
2012-08-01 14:03:51 -07:00
|
|
|
{ \
|
2014-01-15 10:33:40 -08:00
|
|
|
CRI("No widget data for object %p (%s)", \
|
|
|
|
o, evas_object_type_get(o)); \
|
2012-08-01 14:03:51 -07:00
|
|
|
return val; \
|
|
|
|
}
|
|
|
|
|
2014-01-15 10:33:40 -08:00
|
|
|
#define ELM_LABEL_CHECK(obj) \
|
2016-08-15 06:44:41 -07:00
|
|
|
if (EINA_UNLIKELY(!efl_isa((obj), ELM_LABEL_CLASS))) \
|
2012-08-01 14:03:51 -07:00
|
|
|
return
|
|
|
|
|
|
|
|
#endif
|