2013-04-25 22:13:00 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "elementary_config.h"
|
|
|
|
#endif
|
|
|
|
|
2018-04-03 04:27:30 -07:00
|
|
|
#define EFL_ACCESS_OBJECT_PROTECTED
|
2014-10-17 08:56:11 -07:00
|
|
|
|
2009-08-21 05:25:50 -07:00
|
|
|
#include <Elementary.h>
|
2013-04-25 22:13:00 -07:00
|
|
|
|
2009-08-21 05:25:50 -07:00
|
|
|
#include "elm_priv.h"
|
2019-03-05 14:00:37 -08:00
|
|
|
#include "elm_separator_eo.h"
|
2012-07-31 15:06:47 -07:00
|
|
|
#include "elm_widget_separator.h"
|
2012-11-25 22:32:53 -08:00
|
|
|
#include "elm_widget_layout.h"
|
2009-08-21 05:25:50 -07:00
|
|
|
|
2014-06-03 03:35:28 -07:00
|
|
|
#define MY_CLASS ELM_SEPARATOR_CLASS
|
2012-11-25 22:32:53 -08:00
|
|
|
|
2013-11-07 03:44:22 -08:00
|
|
|
#define MY_CLASS_NAME "Elm_Separator"
|
|
|
|
#define MY_CLASS_NAME_LEGACY "elm_separator"
|
2012-11-25 22:32:53 -08:00
|
|
|
|
2019-03-04 10:37:07 -08:00
|
|
|
EOLIAN static Eina_Error
|
2018-01-07 20:55:35 -08:00
|
|
|
_elm_separator_efl_ui_widget_theme_apply(Eo *obj, Elm_Separator_Data *sd EINA_UNUSED)
|
2009-08-21 05:25:50 -07:00
|
|
|
{
|
2019-03-04 10:37:07 -08:00
|
|
|
Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC;
|
2012-05-03 15:43:21 -07:00
|
|
|
|
2017-08-09 21:38:50 -07:00
|
|
|
if (sd->horizontal)
|
2017-11-14 01:42:48 -08:00
|
|
|
elm_widget_theme_element_set(obj, "horizontal");
|
2012-05-03 15:43:21 -07:00
|
|
|
else
|
2017-11-14 01:42:48 -08:00
|
|
|
elm_widget_theme_element_set(obj, "vertical");
|
2012-05-03 15:43:21 -07:00
|
|
|
|
2017-10-23 22:03:46 -07:00
|
|
|
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
|
2019-03-04 10:36:41 -08:00
|
|
|
if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret;
|
2012-05-03 15:43:21 -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
|
|
|
return int_ret;
|
2009-08-21 05:25:50 -07:00
|
|
|
}
|
|
|
|
|
2014-03-26 02:30:53 -07:00
|
|
|
EOLIAN static void
|
2016-06-17 01:26:08 -07:00
|
|
|
_elm_separator_efl_canvas_group_group_add(Eo *obj, Elm_Separator_Data *sd EINA_UNUSED)
|
2009-08-21 05:25:50 -07:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_canvas_group_add(efl_super(obj, MY_CLASS));
|
2012-05-03 15:43:21 -07:00
|
|
|
elm_widget_can_focus_set(obj, EINA_FALSE);
|
|
|
|
|
2013-03-01 18:04:31 -08:00
|
|
|
if (!elm_layout_theme_set
|
|
|
|
(obj, "separator", "vertical", elm_widget_style_get(obj)))
|
2013-12-25 20:03:55 -08:00
|
|
|
CRI("Failed to set layout!");
|
2012-05-03 15:43:21 -07:00
|
|
|
|
|
|
|
elm_layout_sizing_eval(obj);
|
2009-08-21 05:25:50 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Evas_Object *
|
|
|
|
elm_separator_add(Evas_Object *parent)
|
|
|
|
{
|
2012-05-03 15:43:21 -07:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
2017-11-06 21:00:43 -08:00
|
|
|
return elm_legacy_add(MY_CLASS, parent);
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2012-05-02 10:00:00 -07:00
|
|
|
|
2015-05-19 05:34:07 -07:00
|
|
|
EOLIAN static Eo *
|
2016-08-10 07:23:04 -07:00
|
|
|
_elm_separator_efl_object_constructor(Eo *obj, Elm_Separator_Data *sd 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);
|
2018-04-03 04:27:30 -07:00
|
|
|
efl_access_object_role_set(obj, EFL_ACCESS_ROLE_SEPARATOR);
|
2019-07-30 10:11:48 -07:00
|
|
|
efl_ui_layout_finger_size_multiplier_set(obj, 0, 0);
|
|
|
|
evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
2015-05-19 05:34:07 -07:00
|
|
|
|
|
|
|
return obj;
|
2009-08-21 05:25:50 -07:00
|
|
|
}
|
|
|
|
|
2014-03-26 02:30:53 -07:00
|
|
|
EOLIAN static void
|
2017-08-09 21:38:50 -07:00
|
|
|
_elm_separator_horizontal_set(Eo *obj, Elm_Separator_Data *sd, Eina_Bool horizontal)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2017-08-09 21:38:50 -07:00
|
|
|
horizontal = !!horizontal;
|
|
|
|
if (sd->horizontal == horizontal) return;
|
2012-05-03 15:43:21 -07:00
|
|
|
|
2017-08-09 21:38:50 -07:00
|
|
|
sd->horizontal = horizontal;
|
2012-05-03 15:43:21 -07:00
|
|
|
|
2017-10-23 22:03:46 -07:00
|
|
|
efl_ui_widget_theme_apply(obj);
|
2009-08-21 05:25:50 -07:00
|
|
|
}
|
2009-08-21 06:07:15 -07:00
|
|
|
|
2017-08-09 21:38:50 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2018-04-17 11:09:44 -07:00
|
|
|
_elm_separator_horizontal_get(const Eo *obj EINA_UNUSED, Elm_Separator_Data *sd)
|
2009-08-21 06:07:15 -07:00
|
|
|
{
|
2017-08-09 21:38:50 -07:00
|
|
|
return sd->horizontal;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-26 02:30:53 -07:00
|
|
|
EOLIAN static void
|
2016-08-10 07:23:04 -07:00
|
|
|
_elm_separator_class_constructor(Efl_Class *klass)
|
2012-11-25 22:32:53 -08: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
|
|
|
}
|
|
|
|
|
2017-05-18 01:52:17 -07:00
|
|
|
/* Internal EO APIs and hidden overrides */
|
|
|
|
|
|
|
|
#define ELM_SEPARATOR_EXTRA_OPS \
|
|
|
|
EFL_CANVAS_GROUP_ADD_OPS(elm_separator)
|
|
|
|
|
2019-03-05 14:00:37 -08:00
|
|
|
#include "elm_separator_eo.c"
|