2013-04-25 22:13:00 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "elementary_config.h"
|
|
|
|
#endif
|
|
|
|
|
2017-10-18 18:13:54 -07:00
|
|
|
#define EFL_ACCESS_PROTECTED
|
2014-10-17 08:56:11 -07:00
|
|
|
#define ELM_INTERFACE_ATSPI_WIDGET_ACTION_PROTECTED
|
2017-10-02 13:52:48 -07:00
|
|
|
#define EFL_UI_FOCUS_LAYER_PROTECTED
|
2014-10-17 08:56:11 -07:00
|
|
|
|
2009-10-15 13:34:42 -07:00
|
|
|
#include <Elementary.h>
|
2013-04-25 22:13:00 -07:00
|
|
|
|
2009-10-15 13:34:42 -07:00
|
|
|
#include "elm_priv.h"
|
2012-08-30 09:46:40 -07:00
|
|
|
#include "elm_widget_panel.h"
|
2009-10-15 13:34:42 -07:00
|
|
|
|
2014-03-12 07:17:26 -07:00
|
|
|
#include "els_box.h"
|
|
|
|
|
edje/elm: Rename _internal_ to _part_ (EO)
In Edje and Elementary, we have part objects, which are what is returned
by the interface efl_part(). Those objects can't be of an opaque type as
this doesn't work nicely with strongly typed languages such as C++ or
C#. In JS, Lua, C the types are weak and mostly runtime-based so it
doesn't matter much.
As a consequence, the documentation and the types need to look nice in
this EO API. Thus, we remove the abusive term "internal" and explicitly
call all those classes "part" something.
Eventually we want the types to be declared in the EO file so bindings
(C#, C++, ...) can generate the proper access methods, returning the
best possible types.
Note that right now a few of those part types are used in the legacy API
but don't actually need to be exposed externally.
This is kind of a mega commit that does all the renaming at once, but
it's really just a big sed operation. The power of good IDEs :)
Ref T5315
Ref T5306
2017-09-12 21:29:25 -07:00
|
|
|
#include "elm_panel_part.eo.h"
|
2016-05-24 04:40:18 -07:00
|
|
|
#include "elm_part_helper.h"
|
|
|
|
|
2014-06-03 03:35:28 -07:00
|
|
|
#define MY_CLASS ELM_PANEL_CLASS
|
2012-11-25 22:32:53 -08:00
|
|
|
|
2013-11-07 03:44:22 -08:00
|
|
|
#define MY_CLASS_NAME "Elm_Panel"
|
|
|
|
#define MY_CLASS_NAME_LEGACY "elm_panel"
|
2009-10-15 13:34:42 -07:00
|
|
|
|
2014-07-06 23:08:45 -07:00
|
|
|
static const char ACCESS_OUTLINE_PART[] = "access.outline";
|
|
|
|
|
2016-07-31 23:38:50 -07:00
|
|
|
static const char SIG_TOGGLED[] = "toggled";
|
2014-07-06 23:08:45 -07:00
|
|
|
static const char SIG_SCROLL[] = "scroll";
|
|
|
|
|
2013-06-09 22:37:47 -07:00
|
|
|
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
|
2016-07-31 23:38:50 -07:00
|
|
|
{SIG_TOGGLED, ""},
|
2014-07-06 23:08:45 -07:00
|
|
|
{SIG_SCROLL, ""},
|
2014-02-05 23:18:57 -08:00
|
|
|
{SIG_LAYOUT_FOCUSED, ""}, /**< handled by elm_layout */
|
|
|
|
{SIG_LAYOUT_UNFOCUSED, ""}, /**< handled by elm_layout */
|
2013-06-09 22:37:47 -07:00
|
|
|
{NULL, NULL}
|
|
|
|
};
|
2015-04-09 22:37:10 -07:00
|
|
|
static void _panel_toggle(void *, Evas_Object *, const char *,const char *);
|
2014-03-31 05:28:05 -07:00
|
|
|
static Eina_Bool _key_action_toggle(Evas_Object *obj, const char *params);
|
2015-04-09 22:37:10 -07:00
|
|
|
static void _drawer_open(Evas_Object *, Evas_Coord , Evas_Coord , Eina_Bool );
|
|
|
|
static void _drawer_close(Evas_Object *, Evas_Coord , Evas_Coord , Eina_Bool);
|
2014-02-27 17:36:15 -08:00
|
|
|
|
|
|
|
static const Elm_Action key_actions[] = {
|
|
|
|
{"toggle", _key_action_toggle},
|
|
|
|
{NULL, NULL}
|
|
|
|
};
|
|
|
|
|
2011-04-01 04:26:58 -07:00
|
|
|
static void
|
2012-08-30 09:46:40 -07:00
|
|
|
_mirrored_set(Evas_Object *obj,
|
|
|
|
Eina_Bool rtl)
|
2009-10-15 13:34:42 -07:00
|
|
|
{
|
2012-08-30 09:46:40 -07:00
|
|
|
ELM_PANEL_DATA_GET(obj, sd);
|
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
if ((sd->content) && (efl_isa(sd->content, ELM_WIDGET_CLASS)))
|
2017-06-13 03:41:15 -07:00
|
|
|
efl_ui_mirrored_set(sd->content, rtl);
|
2012-08-30 09:46:40 -07:00
|
|
|
elm_panel_orient_set(obj, elm_panel_orient_get(obj));
|
2009-10-15 13:34:42 -07:00
|
|
|
}
|
|
|
|
|
2014-03-24 01:38:01 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_panel_elm_layout_sizing_eval(Eo *obj, Elm_Panel_Data *sd)
|
2011-02-08 04:08:28 -08:00
|
|
|
{
|
2015-12-23 20:46:17 -08:00
|
|
|
Evas_Coord mw = 0, mh = 0;
|
2011-02-08 04:08:28 -08:00
|
|
|
|
2013-10-05 01:15:00 -07:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
2012-08-30 09:46:40 -07:00
|
|
|
|
2012-12-08 10:17:04 -08:00
|
|
|
if (sd->delete_me) return;
|
2012-08-30 09:46:40 -07:00
|
|
|
|
2016-09-27 01:11:03 -07:00
|
|
|
if (sd->scrollable)
|
|
|
|
{
|
2017-05-22 21:11:59 -07:00
|
|
|
if (sd->hidden) _drawer_close(obj, wd->w, wd->h, EINA_FALSE);
|
|
|
|
else _drawer_open(obj, wd->w, wd->h, EINA_FALSE);
|
2016-09-27 01:11:03 -07:00
|
|
|
}
|
|
|
|
|
2012-08-30 09:46:40 -07:00
|
|
|
evas_object_smart_calculate(sd->bx);
|
2012-11-25 22:32:53 -08:00
|
|
|
edje_object_size_min_calc(wd->resize_obj, &mw, &mh);
|
2012-08-30 09:46:40 -07:00
|
|
|
evas_object_size_hint_min_set(obj, mw, mh);
|
|
|
|
evas_object_size_hint_max_set(obj, -1, -1);
|
2011-02-08 04:08:28 -08:00
|
|
|
}
|
|
|
|
|
2012-10-25 02:07:21 -07:00
|
|
|
static char *
|
2014-01-06 06:30:02 -08:00
|
|
|
_access_state_cb(void *data, Evas_Object *obj EINA_UNUSED)
|
2012-10-25 02:07:21 -07:00
|
|
|
{
|
|
|
|
ELM_PANEL_DATA_GET(data, sd);
|
|
|
|
|
|
|
|
if (!sd->hidden) return strdup(E_("state: opened"));
|
|
|
|
else return strdup(E_("state: closed"));
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2014-07-06 23:08:45 -07:00
|
|
|
static Evas_Object *
|
|
|
|
_access_object_get(const Evas_Object *obj, const char *part)
|
|
|
|
{
|
|
|
|
Evas_Object *po, *ao;
|
|
|
|
ELM_PANEL_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
po = (Evas_Object *)edje_object_part_object_get
|
|
|
|
(elm_layout_edje_get(sd->scr_ly), part);
|
|
|
|
ao = evas_object_data_get(po, "_part_access_obj");
|
|
|
|
|
|
|
|
return ao;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_access_activate_cb(void *data,
|
|
|
|
Evas_Object *part_obj EINA_UNUSED,
|
|
|
|
Elm_Object_Item *item EINA_UNUSED)
|
|
|
|
{
|
|
|
|
elm_panel_hidden_set(data, EINA_TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_access_obj_process(Evas_Object *obj, Eina_Bool is_access)
|
|
|
|
{
|
|
|
|
Evas_Object *ao;
|
|
|
|
ELM_PANEL_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
if (is_access)
|
|
|
|
{
|
|
|
|
ao = _access_object_get(obj, ACCESS_OUTLINE_PART);
|
|
|
|
if (!ao)
|
|
|
|
{
|
|
|
|
ao = _elm_access_edje_object_part_object_register
|
|
|
|
(obj, elm_layout_edje_get(sd->scr_ly), ACCESS_OUTLINE_PART);
|
|
|
|
_elm_access_text_set(_elm_access_info_get(ao),
|
2014-08-13 08:32:31 -07:00
|
|
|
ELM_ACCESS_TYPE, E_("A panel is open"));
|
2014-07-06 23:08:45 -07:00
|
|
|
_elm_access_text_set(_elm_access_info_get(ao),
|
2014-08-13 08:32:31 -07:00
|
|
|
ELM_ACCESS_CONTEXT_INFO, E_("Double tap to close panel menu"));
|
2014-07-06 23:08:45 -07:00
|
|
|
_elm_access_activate_callback_set
|
|
|
|
(_elm_access_info_get(ao), _access_activate_cb, obj);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
_elm_access_edje_object_part_object_unregister
|
|
|
|
(obj, elm_layout_edje_get(sd->scr_ly), ACCESS_OUTLINE_PART);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-04-01 04:26:58 -07:00
|
|
|
static void
|
2012-08-30 09:46:40 -07:00
|
|
|
_orient_set_do(Evas_Object *obj)
|
2009-10-15 13:34:42 -07:00
|
|
|
{
|
2012-08-30 09:46:40 -07:00
|
|
|
ELM_PANEL_DATA_GET(obj, sd);
|
2013-10-05 01:15:00 -07:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
2012-08-30 09:46:40 -07:00
|
|
|
|
|
|
|
switch (sd->orient)
|
2010-09-27 14:13:32 -07:00
|
|
|
{
|
2012-08-30 09:46:40 -07:00
|
|
|
case ELM_PANEL_ORIENT_TOP:
|
2013-03-01 18:04:31 -08:00
|
|
|
if (!elm_layout_theme_set
|
|
|
|
(obj, "panel", "top", elm_widget_style_get(obj)))
|
2013-12-25 20:03:55 -08:00
|
|
|
CRI("Failed to set layout!");
|
2012-08-30 09:46:40 -07:00
|
|
|
break;
|
2010-09-27 14:13:32 -07:00
|
|
|
|
2012-08-30 09:46:40 -07:00
|
|
|
case ELM_PANEL_ORIENT_BOTTOM:
|
2013-03-01 18:04:31 -08:00
|
|
|
if (!elm_layout_theme_set
|
|
|
|
(obj, "panel", "bottom", elm_widget_style_get(obj)))
|
2013-12-25 20:03:55 -08:00
|
|
|
CRI("Failed to set layout!");
|
2012-08-30 09:46:40 -07:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ELM_PANEL_ORIENT_LEFT:
|
2015-04-09 22:37:10 -07:00
|
|
|
if (!elm_layout_theme_set(obj, "panel", "left",
|
|
|
|
elm_widget_style_get(obj)))
|
|
|
|
CRI("Failed to set layout!");
|
2012-08-30 09:46:40 -07:00
|
|
|
break;
|
2011-02-08 04:08:28 -08:00
|
|
|
|
2012-08-30 09:46:40 -07:00
|
|
|
case ELM_PANEL_ORIENT_RIGHT:
|
2015-04-09 22:37:10 -07:00
|
|
|
if (!elm_layout_theme_set(obj, "panel", "right",
|
|
|
|
elm_widget_style_get(obj)))
|
|
|
|
CRI("Failed to set layout!");
|
2012-08-30 09:46:40 -07:00
|
|
|
break;
|
|
|
|
}
|
2012-10-25 02:07:21 -07:00
|
|
|
|
|
|
|
/* access */
|
|
|
|
if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
|
|
|
|
{
|
|
|
|
Evas_Object *ao;
|
|
|
|
ao = _elm_access_edje_object_part_object_register
|
2013-03-01 18:04:31 -08:00
|
|
|
(obj, wd->resize_obj, "btn_icon");
|
2013-07-30 20:53:04 -07:00
|
|
|
_elm_access_text_set(_elm_access_info_get(ao),
|
2012-10-25 02:07:21 -07:00
|
|
|
ELM_ACCESS_TYPE, E_("panel button"));
|
|
|
|
_elm_access_callback_set
|
2013-07-30 20:53:04 -07:00
|
|
|
(_elm_access_info_get(ao), ELM_ACCESS_STATE, _access_state_cb, obj);
|
2012-10-25 02:07:21 -07:00
|
|
|
}
|
2009-10-15 13:34:42 -07:00
|
|
|
}
|
|
|
|
|
2014-07-06 23:08:45 -07:00
|
|
|
static void
|
|
|
|
_scrollable_layout_theme_set(Eo *obj, Elm_Panel_Data *sd)
|
|
|
|
{
|
|
|
|
switch (sd->orient)
|
|
|
|
{
|
|
|
|
case ELM_PANEL_ORIENT_TOP:
|
|
|
|
if (!elm_layout_theme_set(sd->scr_ly, "scroller", "panel/top",
|
|
|
|
elm_widget_style_get(obj)))
|
|
|
|
CRI("Failed to set layout!");
|
|
|
|
break;
|
|
|
|
case ELM_PANEL_ORIENT_BOTTOM:
|
|
|
|
if (!elm_layout_theme_set(sd->scr_ly, "scroller", "panel/bottom",
|
|
|
|
elm_widget_style_get(obj)))
|
|
|
|
CRI("Failed to set layout!");
|
|
|
|
break;
|
|
|
|
case ELM_PANEL_ORIENT_LEFT:
|
|
|
|
if (!elm_layout_theme_set(sd->scr_ly, "scroller", "panel/left",
|
|
|
|
elm_widget_style_get(obj)))
|
|
|
|
CRI("Failed to set layout!");
|
|
|
|
break;
|
|
|
|
case ELM_PANEL_ORIENT_RIGHT:
|
|
|
|
if (!elm_layout_theme_set(sd->scr_ly, "scroller", "panel/right",
|
|
|
|
elm_widget_style_get(obj)))
|
|
|
|
CRI("Failed to set layout!");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* access */
|
|
|
|
if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
|
|
|
|
_access_obj_process(obj, EINA_TRUE);
|
|
|
|
}
|
|
|
|
|
2017-08-09 00:13:06 -07:00
|
|
|
EOLIAN static Efl_Ui_Theme_Apply
|
2014-03-24 01:38:01 -07:00
|
|
|
_elm_panel_elm_widget_theme_apply(Eo *obj, Elm_Panel_Data *sd)
|
2010-09-27 14:13:32 -07:00
|
|
|
{
|
2012-08-30 09:46:40 -07:00
|
|
|
const char *str;
|
2013-09-10 02:48:32 -07:00
|
|
|
Evas_Coord minw = 0, minh = 0;
|
2013-09-30 03:21:31 -07:00
|
|
|
|
2017-08-09 00:13:06 -07:00
|
|
|
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
|
2012-11-25 22:32:53 -08:00
|
|
|
|
2017-08-09 00:13:06 -07:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
|
2012-08-30 09:46:40 -07:00
|
|
|
|
2017-10-23 22:03:46 -07:00
|
|
|
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
|
2017-08-09 00:13:06 -07:00
|
|
|
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
|
2012-08-30 09:46:40 -07:00
|
|
|
|
2017-06-13 03:41:15 -07:00
|
|
|
_mirrored_set(obj, efl_ui_mirrored_get(obj));
|
2012-08-30 09:46:40 -07:00
|
|
|
|
2014-07-06 23:08:45 -07:00
|
|
|
if (sd->scrollable)
|
|
|
|
{
|
|
|
|
const char *handler_size;
|
|
|
|
elm_widget_theme_object_set(obj, sd->scr_edje, "scroller", "panel",
|
|
|
|
elm_widget_style_get(obj));
|
|
|
|
_scrollable_layout_theme_set(obj, sd);
|
|
|
|
handler_size = edje_object_data_get(sd->scr_edje, "handler_size");
|
|
|
|
if (handler_size)
|
|
|
|
sd->handler_size = (int) (elm_object_scale_get(obj)) * (atoi(handler_size));
|
|
|
|
}
|
2010-09-27 14:13:32 -07:00
|
|
|
else
|
2014-07-06 23:08:45 -07:00
|
|
|
{
|
|
|
|
str = edje_object_data_get
|
|
|
|
(wd->resize_obj, "focus_highlight");
|
|
|
|
if ((str) && (!strcmp(str, "on")))
|
|
|
|
elm_widget_highlight_in_theme_set(obj, EINA_TRUE);
|
|
|
|
else
|
|
|
|
elm_widget_highlight_in_theme_set(obj, EINA_FALSE);
|
2012-08-30 09:46:40 -07:00
|
|
|
|
2014-07-06 23:08:45 -07:00
|
|
|
_orient_set_do(obj);
|
2013-09-30 03:21:31 -07:00
|
|
|
|
2014-07-06 23:08:45 -07:00
|
|
|
evas_object_hide(sd->event);
|
|
|
|
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
|
|
|
|
evas_object_size_hint_min_set(sd->event, minw, minh);
|
2013-09-30 03:21:31 -07:00
|
|
|
|
2016-05-24 04:40:18 -07:00
|
|
|
if (edje_object_part_exists(wd->resize_obj, "elm.swallow.event"))
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_content_set(efl_part(efl_super(obj, MY_CLASS), "elm.swallow.event"), sd->event);
|
2014-07-06 23:08:45 -07:00
|
|
|
}
|
2013-09-30 03:21:31 -07:00
|
|
|
|
2012-08-30 09:46:40 -07:00
|
|
|
elm_layout_sizing_eval(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
|
|
|
return int_ret;
|
2010-09-27 14:13:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-08-30 09:46:40 -07:00
|
|
|
_box_layout_cb(Evas_Object *o,
|
|
|
|
Evas_Object_Box_Data *priv,
|
2014-01-06 06:30:02 -08:00
|
|
|
void *data EINA_UNUSED)
|
2009-11-15 08:14:51 -08:00
|
|
|
{
|
2011-02-08 04:08:28 -08:00
|
|
|
_els_box_layout(o, priv, EINA_TRUE, EINA_FALSE, EINA_FALSE);
|
2009-10-15 13:34:42 -07:00
|
|
|
}
|
|
|
|
|
2014-07-06 23:08:45 -07:00
|
|
|
static void
|
|
|
|
_handler_open(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
|
|
|
|
{
|
|
|
|
ELM_PANEL_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
if (sd->handler_size == 0) return;
|
|
|
|
|
|
|
|
switch (sd->orient)
|
|
|
|
{
|
|
|
|
case ELM_PANEL_ORIENT_TOP:
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_interface_scrollable_region_bring_in
|
|
|
|
(obj, 0, (h * sd->content_size_ratio) - sd->handler_size, w, h);
|
2014-07-06 23:08:45 -07:00
|
|
|
break;
|
|
|
|
case ELM_PANEL_ORIENT_BOTTOM:
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_interface_scrollable_region_bring_in
|
|
|
|
(obj, 0, sd->handler_size, w, h);
|
2014-07-06 23:08:45 -07:00
|
|
|
break;
|
|
|
|
case ELM_PANEL_ORIENT_LEFT:
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_interface_scrollable_region_bring_in
|
|
|
|
(obj, (w * sd->content_size_ratio) - sd->handler_size, 0, w, h);
|
2014-07-06 23:08:45 -07:00
|
|
|
break;
|
|
|
|
case ELM_PANEL_ORIENT_RIGHT:
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_interface_scrollable_region_bring_in
|
|
|
|
(obj, sd->handler_size, 0, w, h);
|
2014-07-06 23:08:45 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_drawer_open(Evas_Object *obj, Evas_Coord w, Evas_Coord h, Eina_Bool anim)
|
|
|
|
{
|
|
|
|
ELM_PANEL_DATA_GET(obj, sd);
|
|
|
|
int x = 0, y = 0;
|
|
|
|
|
|
|
|
if (sd->freeze)
|
|
|
|
{
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_interface_scrollable_movement_block_set
|
2017-08-29 01:49:38 -07:00
|
|
|
(obj, EFL_UI_SCROLL_BLOCK_NONE);
|
2014-07-06 23:08:45 -07:00
|
|
|
sd->freeze = EINA_FALSE;
|
|
|
|
elm_layout_signal_emit(sd->scr_ly, "elm,state,content,visible", "elm");
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (sd->orient)
|
|
|
|
{
|
|
|
|
case ELM_PANEL_ORIENT_TOP:
|
2015-04-09 22:37:10 -07:00
|
|
|
break;
|
2014-07-06 23:08:45 -07:00
|
|
|
case ELM_PANEL_ORIENT_LEFT:
|
2017-06-13 03:41:15 -07:00
|
|
|
if (efl_ui_mirrored_get(obj))
|
2015-04-09 22:37:10 -07:00
|
|
|
x = w * sd->content_size_ratio;
|
2014-07-06 23:08:45 -07:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ELM_PANEL_ORIENT_BOTTOM:
|
|
|
|
y = h * sd->content_size_ratio;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ELM_PANEL_ORIENT_RIGHT:
|
2017-06-13 03:41:15 -07:00
|
|
|
if (!efl_ui_mirrored_get(obj))
|
2015-04-09 22:37:10 -07:00
|
|
|
x = w * sd->content_size_ratio;
|
2014-07-06 23:08:45 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (anim)
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_interface_scrollable_region_bring_in
|
|
|
|
(obj, x, y, w, h);
|
2014-07-06 23:08:45 -07:00
|
|
|
else
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_interface_scrollable_content_region_show
|
|
|
|
(obj, x, y, w, h);
|
2014-07-06 23:08:45 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_drawer_close(Evas_Object *obj, Evas_Coord w, Evas_Coord h, Eina_Bool anim)
|
|
|
|
{
|
|
|
|
ELM_PANEL_DATA_GET(obj, sd);
|
|
|
|
int x = 0, y = 0;
|
|
|
|
Eina_Bool horizontal = EINA_FALSE;
|
|
|
|
|
2017-02-07 13:31:03 -08:00
|
|
|
elm_widget_tree_unfocusable_set(obj, EINA_TRUE);
|
2014-07-06 23:08:45 -07:00
|
|
|
switch (sd->orient)
|
|
|
|
{
|
|
|
|
case ELM_PANEL_ORIENT_TOP:
|
|
|
|
y = h * sd->content_size_ratio;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ELM_PANEL_ORIENT_LEFT:
|
2017-06-13 03:41:15 -07:00
|
|
|
if (!efl_ui_mirrored_get(obj))
|
2015-04-09 22:37:10 -07:00
|
|
|
x = w * sd->content_size_ratio;
|
2014-07-06 23:08:45 -07:00
|
|
|
horizontal = EINA_TRUE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ELM_PANEL_ORIENT_BOTTOM:
|
|
|
|
break;
|
2015-04-09 22:37:10 -07:00
|
|
|
|
2014-07-06 23:08:45 -07:00
|
|
|
case ELM_PANEL_ORIENT_RIGHT:
|
2017-06-13 03:41:15 -07:00
|
|
|
if (efl_ui_mirrored_get(obj))
|
2015-04-09 22:37:10 -07:00
|
|
|
x = w * sd->content_size_ratio;
|
2014-07-06 23:08:45 -07:00
|
|
|
horizontal = EINA_TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (anim)
|
|
|
|
{
|
|
|
|
if (sd->freeze)
|
|
|
|
{
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_interface_scrollable_movement_block_set
|
2017-08-29 01:49:38 -07:00
|
|
|
(obj, EFL_UI_SCROLL_BLOCK_NONE);
|
2014-07-06 23:08:45 -07:00
|
|
|
sd->freeze = EINA_FALSE;
|
|
|
|
elm_layout_signal_emit(sd->scr_ly, "elm,state,content,visible", "elm");
|
|
|
|
}
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_interface_scrollable_region_bring_in(obj, x, y, w, h);
|
2014-07-06 23:08:45 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_interface_scrollable_content_region_show(obj, x, y, w, h);
|
2014-07-06 23:08:45 -07:00
|
|
|
if (!sd->freeze)
|
|
|
|
{
|
|
|
|
if (horizontal)
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_interface_scrollable_movement_block_set
|
2017-08-29 01:49:38 -07:00
|
|
|
(obj, EFL_UI_SCROLL_BLOCK_HORIZONTAL);
|
2014-07-06 23:08:45 -07:00
|
|
|
else
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_interface_scrollable_movement_block_set
|
2017-08-29 01:49:38 -07:00
|
|
|
(obj, EFL_UI_SCROLL_BLOCK_VERTICAL);
|
2014-07-06 23:08:45 -07:00
|
|
|
sd->freeze = EINA_TRUE;
|
|
|
|
elm_layout_signal_emit(sd->scr_ly, "elm,state,content,hidden", "elm");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-04-01 04:26:58 -07:00
|
|
|
static void
|
2014-01-06 06:30:02 -08:00
|
|
|
_panel_toggle(void *data EINA_UNUSED,
|
2012-08-30 09:46:40 -07:00
|
|
|
Evas_Object *obj,
|
2014-01-06 06:30:02 -08:00
|
|
|
const char *emission EINA_UNUSED,
|
|
|
|
const char *source EINA_UNUSED)
|
2009-10-15 13:34:42 -07:00
|
|
|
{
|
2012-08-30 09:46:40 -07:00
|
|
|
ELM_PANEL_DATA_GET(obj, sd);
|
2013-10-05 01:15:00 -07:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
2014-07-06 23:08:45 -07:00
|
|
|
int w, h;
|
|
|
|
|
|
|
|
if (sd->scrollable)
|
|
|
|
{
|
|
|
|
if (elm_widget_disabled_get(obj)) return;
|
|
|
|
|
|
|
|
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
|
|
|
|
if (sd->hidden)
|
|
|
|
{
|
|
|
|
sd->hidden = EINA_FALSE;
|
|
|
|
_drawer_open(obj, w, h, EINA_TRUE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sd->hidden = EINA_TRUE;
|
|
|
|
_drawer_close(obj, w, h, EINA_TRUE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (sd->hidden)
|
|
|
|
{
|
|
|
|
elm_layout_signal_emit(obj, "elm,action,show", "elm");
|
|
|
|
sd->hidden = EINA_FALSE;
|
|
|
|
evas_object_repeat_events_set(obj, EINA_FALSE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
elm_layout_signal_emit(obj, "elm,action,hide", "elm");
|
|
|
|
sd->hidden = EINA_TRUE;
|
|
|
|
evas_object_repeat_events_set(obj, EINA_TRUE);
|
|
|
|
}
|
|
|
|
|
2017-10-02 13:52:48 -07:00
|
|
|
//if the panel is hidden, make this thing unfocusable
|
|
|
|
elm_widget_tree_unfocusable_set(obj, sd->hidden);
|
2014-07-06 23:08:45 -07:00
|
|
|
edje_object_message_signal_process(wd->resize_obj);
|
|
|
|
}
|
2016-07-31 23:38:50 -07:00
|
|
|
|
2017-10-02 13:52:48 -07:00
|
|
|
efl_ui_focus_layer_enable_set(obj, !sd->hidden);
|
2016-08-22 15:40:39 -07:00
|
|
|
efl_event_callback_legacy_call(obj, ELM_PANEL_EVENT_TOGGLED, NULL);
|
2014-07-06 23:08:45 -07:00
|
|
|
}
|
2012-08-30 09:46:40 -07:00
|
|
|
|
2014-07-06 23:08:45 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_state_sync(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_PANEL_DATA_GET(obj, sd);
|
2017-06-08 00:00:20 -07:00
|
|
|
Evas_Coord pos, panel_size, w, h, threshold;
|
|
|
|
Eina_Bool horizontal = EINA_FALSE, reverse = EINA_FALSE;
|
|
|
|
|
2014-07-06 23:08:45 -07:00
|
|
|
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
|
|
|
|
|
2016-12-29 23:30:34 -08:00
|
|
|
if (!evas_object_visible_get(sd->bx)) return EINA_TRUE;
|
|
|
|
|
2014-07-06 23:08:45 -07:00
|
|
|
switch (sd->orient)
|
2009-11-15 08:14:51 -08:00
|
|
|
{
|
2014-07-06 23:08:45 -07:00
|
|
|
case ELM_PANEL_ORIENT_BOTTOM:
|
2017-06-08 00:00:20 -07:00
|
|
|
reverse = EINA_TRUE;
|
|
|
|
case ELM_PANEL_ORIENT_TOP:
|
2014-07-06 23:08:45 -07:00
|
|
|
break;
|
|
|
|
|
2017-06-08 00:00:20 -07:00
|
|
|
case ELM_PANEL_ORIENT_RIGHT:
|
|
|
|
reverse = EINA_TRUE;
|
2017-06-12 10:04:27 -07:00
|
|
|
EINA_FALLTHROUGH;
|
2014-07-06 23:08:45 -07:00
|
|
|
case ELM_PANEL_ORIENT_LEFT:
|
|
|
|
horizontal = EINA_TRUE;
|
|
|
|
break;
|
2017-06-08 00:00:20 -07:00
|
|
|
}
|
2014-07-06 23:08:45 -07:00
|
|
|
|
2017-06-08 00:00:20 -07:00
|
|
|
if (horizontal)
|
|
|
|
{
|
2016-12-29 23:30:34 -08:00
|
|
|
if (w <= 0) return EINA_TRUE;
|
|
|
|
|
2014-07-06 23:08:45 -07:00
|
|
|
panel_size = w * sd->content_size_ratio;
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_interface_scrollable_content_pos_get(obj, &pos, NULL);
|
2017-06-13 03:41:15 -07:00
|
|
|
reverse ^= efl_ui_mirrored_get(obj);
|
2017-06-08 00:00:20 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (h <= 0) return EINA_TRUE;
|
2014-07-06 23:08:45 -07:00
|
|
|
|
2017-06-08 00:00:20 -07:00
|
|
|
panel_size = h * sd->content_size_ratio;
|
|
|
|
elm_interface_scrollable_content_pos_get(obj, NULL, &pos);
|
2014-07-06 23:08:45 -07:00
|
|
|
}
|
2017-06-08 00:00:20 -07:00
|
|
|
threshold = (sd->hidden) ? panel_size - (panel_size / 4) : (panel_size / 4);
|
2014-07-06 23:08:45 -07:00
|
|
|
|
2017-06-08 00:00:20 -07:00
|
|
|
if (reverse)
|
2014-07-06 23:08:45 -07:00
|
|
|
{
|
2017-06-08 00:00:20 -07:00
|
|
|
if (pos > panel_size - threshold) sd->hidden = EINA_FALSE;
|
|
|
|
else sd->hidden = EINA_TRUE;
|
2009-11-15 08:14:51 -08:00
|
|
|
}
|
2009-11-15 09:29:22 -08:00
|
|
|
else
|
2009-11-15 08:14:51 -08:00
|
|
|
{
|
2017-06-08 00:00:20 -07:00
|
|
|
if (pos < threshold) sd->hidden = EINA_FALSE;
|
|
|
|
else sd->hidden = EINA_TRUE;
|
2009-11-15 08:14:51 -08:00
|
|
|
}
|
2012-08-30 09:46:40 -07:00
|
|
|
|
2017-06-08 00:00:20 -07:00
|
|
|
return EINA_FALSE;
|
2014-07-06 23:08:45 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_timer_cb(void *data)
|
|
|
|
{
|
|
|
|
ELM_PANEL_DATA_GET(data, sd);
|
|
|
|
Evas_Object *obj = data;
|
|
|
|
Evas_Coord w, h;
|
|
|
|
|
|
|
|
sd->timer = NULL;
|
|
|
|
|
|
|
|
if (sd->freeze)
|
|
|
|
{
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_interface_scrollable_movement_block_set
|
2017-08-29 01:49:38 -07:00
|
|
|
(obj, EFL_UI_SCROLL_BLOCK_NONE);
|
2014-07-06 23:08:45 -07:00
|
|
|
sd->freeze = EINA_FALSE;
|
|
|
|
elm_layout_signal_emit(sd->scr_ly, "elm,state,content,visible", "elm");
|
|
|
|
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
|
|
|
|
_handler_open(obj, w, h);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ECORE_CALLBACK_CANCEL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_event_mouse_up(void *data,
|
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info)
|
|
|
|
{
|
|
|
|
ELM_PANEL_DATA_GET(data, sd);
|
|
|
|
Evas_Event_Mouse_Up *ev = event_info;
|
|
|
|
Evas_Coord x, y, up_x, up_y, minw = 0, minh = 0;
|
|
|
|
evas_object_geometry_get(data, &x, &y, NULL, NULL);
|
|
|
|
|
2014-11-13 22:19:21 -08:00
|
|
|
up_x = ev->canvas.x - x;
|
|
|
|
up_y = ev->canvas.y - y;
|
2014-07-06 23:08:45 -07:00
|
|
|
|
|
|
|
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
|
|
|
|
|
|
|
|
if ((!sd->hidden) && (up_x == sd->down_x) && (up_y == sd->down_y))
|
|
|
|
elm_panel_hidden_set(data, EINA_TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_on_mouse_down(void *data,
|
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info)
|
|
|
|
{
|
|
|
|
Elm_Panel_Data *sd = data;
|
|
|
|
Evas_Event_Mouse_Down *ev = event_info;
|
|
|
|
Evas_Coord finger_size = elm_config_finger_size_get();
|
|
|
|
Evas_Coord x, y, w, h;
|
|
|
|
evas_object_geometry_get(obj, &x, &y, &w, &h);
|
2017-06-13 03:41:15 -07:00
|
|
|
Eina_Bool is_mirrored = efl_ui_mirrored_get(obj);
|
2014-07-06 23:08:45 -07:00
|
|
|
|
2014-11-13 22:19:21 -08:00
|
|
|
sd->down_x = ev->canvas.x - x;
|
|
|
|
sd->down_y = ev->canvas.y - y;
|
2014-07-06 23:08:45 -07:00
|
|
|
|
|
|
|
// if freeze state & mouse down on the edge
|
|
|
|
// then set timer for un-freeze
|
|
|
|
switch (sd->orient)
|
|
|
|
{
|
|
|
|
case ELM_PANEL_ORIENT_TOP:
|
|
|
|
if ((sd->freeze) && (sd->down_y >= 0) && (sd->down_y < finger_size))
|
|
|
|
{
|
|
|
|
ecore_timer_del(sd->timer);
|
|
|
|
sd->timer = ecore_timer_add(0.2, _timer_cb, obj);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ELM_PANEL_ORIENT_BOTTOM:
|
|
|
|
if ((sd->freeze) && (sd->down_y <= h) && (sd->down_y > (h - finger_size)))
|
|
|
|
{
|
|
|
|
ecore_timer_del(sd->timer);
|
|
|
|
sd->timer = ecore_timer_add(0.2, _timer_cb, obj);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ELM_PANEL_ORIENT_LEFT:
|
2015-04-09 22:37:10 -07:00
|
|
|
if ((!is_mirrored && (sd->freeze) && (sd->down_x >= 0) && (sd->down_x < finger_size)) ||
|
|
|
|
((is_mirrored && (sd->freeze) && (sd->down_x <= w) && (sd->down_x > (w - finger_size)))))
|
2014-07-06 23:08:45 -07:00
|
|
|
{
|
|
|
|
ecore_timer_del(sd->timer);
|
|
|
|
sd->timer = ecore_timer_add(0.2, _timer_cb, obj);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ELM_PANEL_ORIENT_RIGHT:
|
2015-04-09 22:37:10 -07:00
|
|
|
if ((is_mirrored && (sd->freeze) && (sd->down_x >= 0) && (sd->down_x < finger_size)) ||
|
|
|
|
(!is_mirrored && (sd->freeze) && (sd->down_x <= w) && (sd->down_x > (w - finger_size))))
|
2014-07-06 23:08:45 -07:00
|
|
|
{
|
|
|
|
ecore_timer_del(sd->timer);
|
|
|
|
sd->timer = ecore_timer_add(0.2, _timer_cb, obj);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_on_mouse_move(void *data,
|
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info)
|
|
|
|
{
|
|
|
|
Elm_Panel_Data *sd = data;
|
|
|
|
Evas_Event_Mouse_Move *ev = event_info;
|
|
|
|
Evas_Coord x, y, w, h, cur_x, cur_y, finger_size;
|
|
|
|
evas_object_geometry_get(obj, &x, &y, &w, &h);
|
|
|
|
finger_size = elm_config_finger_size_get();
|
2017-06-13 03:41:15 -07:00
|
|
|
Eina_Bool is_mirrored = efl_ui_mirrored_get(obj);
|
2014-07-06 23:08:45 -07:00
|
|
|
|
|
|
|
cur_x = ev->cur.canvas.x - x;
|
|
|
|
cur_y = ev->cur.canvas.y - y;
|
|
|
|
|
|
|
|
// if mouse down on the edge (it means sd->timer is not null)
|
|
|
|
// and move more than finger size
|
|
|
|
// then un-freeze
|
|
|
|
switch (sd->orient)
|
|
|
|
{
|
|
|
|
case ELM_PANEL_ORIENT_TOP:
|
|
|
|
if (sd->timer && ((cur_y - sd->down_y) > finger_size))
|
|
|
|
{
|
2016-12-05 18:31:06 -08:00
|
|
|
elm_interface_scrollable_movement_block_set
|
2017-08-29 01:49:38 -07:00
|
|
|
(obj, EFL_UI_SCROLL_BLOCK_NONE);
|
2014-07-06 23:08:45 -07:00
|
|
|
sd->freeze = EINA_FALSE;
|
|
|
|
elm_layout_signal_emit(sd->scr_ly, "elm,state,content,visible", "elm");
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ELM_PANEL_ORIENT_BOTTOM:
|
|
|
|
if (sd->timer && ((sd->down_y - cur_y) > finger_size))
|
|
|
|
{
|
2016-12-05 18:31:06 -08:00
|
|
|
elm_interface_scrollable_movement_block_set
|
2017-08-29 01:49:38 -07:00
|
|
|
(obj, EFL_UI_SCROLL_BLOCK_NONE);
|
2014-07-06 23:08:45 -07:00
|
|
|
sd->freeze = EINA_FALSE;
|
|
|
|
elm_layout_signal_emit(sd->scr_ly, "elm,state,content,visible", "elm");
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ELM_PANEL_ORIENT_LEFT:
|
2015-04-09 22:37:10 -07:00
|
|
|
if ((!is_mirrored && (sd->timer) && ((cur_x - sd->down_x) > finger_size)) ||
|
|
|
|
((is_mirrored) && (sd->timer) && ((sd->down_x - cur_x) > finger_size)))
|
2014-07-06 23:08:45 -07:00
|
|
|
{
|
2016-12-05 18:31:06 -08:00
|
|
|
elm_interface_scrollable_movement_block_set
|
2017-08-29 01:49:38 -07:00
|
|
|
(obj, EFL_UI_SCROLL_BLOCK_NONE);
|
2014-07-06 23:08:45 -07:00
|
|
|
sd->freeze = EINA_FALSE;
|
|
|
|
elm_layout_signal_emit(sd->scr_ly, "elm,state,content,visible", "elm");
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ELM_PANEL_ORIENT_RIGHT:
|
2015-04-09 22:37:10 -07:00
|
|
|
if ((is_mirrored && (sd->timer) && ((cur_x - sd->down_x) > finger_size)) ||
|
|
|
|
(!is_mirrored && (sd->timer) && ((sd->down_x - cur_x) > finger_size)))
|
2014-07-06 23:08:45 -07:00
|
|
|
{
|
2016-12-05 18:31:06 -08:00
|
|
|
elm_interface_scrollable_movement_block_set
|
2017-08-29 01:49:38 -07:00
|
|
|
(obj, EFL_UI_SCROLL_BLOCK_NONE);
|
2014-07-06 23:08:45 -07:00
|
|
|
sd->freeze = EINA_FALSE;
|
|
|
|
elm_layout_signal_emit(sd->scr_ly, "elm,state,content,visible", "elm");
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!sd->freeze && sd->hidden)
|
|
|
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_on_mouse_up(void *data,
|
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info)
|
|
|
|
{
|
|
|
|
Elm_Panel_Data *sd = data;
|
|
|
|
Evas_Event_Mouse_Up *ev = event_info;
|
2017-06-08 00:00:20 -07:00
|
|
|
Evas_Coord w, h;
|
|
|
|
Eina_Bool hidden;
|
2014-07-06 23:08:45 -07:00
|
|
|
|
2017-06-08 00:00:20 -07:00
|
|
|
hidden = sd->hidden;
|
2014-07-06 23:08:45 -07:00
|
|
|
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
|
|
|
|
|
|
|
|
ELM_SAFE_FREE(sd->timer, ecore_timer_del);
|
|
|
|
|
|
|
|
if (_state_sync(obj)) return;
|
|
|
|
|
2017-06-08 00:00:20 -07:00
|
|
|
if (sd->hidden) _drawer_close(obj, w, h, EINA_TRUE);
|
|
|
|
else _drawer_open(obj, w, h, EINA_TRUE);
|
2014-07-06 23:08:45 -07:00
|
|
|
|
2017-06-08 00:00:20 -07:00
|
|
|
if (sd->hidden != hidden)
|
|
|
|
efl_event_callback_legacy_call(obj, ELM_PANEL_EVENT_TOGGLED, NULL);
|
2014-07-06 23:08:45 -07:00
|
|
|
|
|
|
|
if (!sd->freeze && sd->hidden)
|
|
|
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
2009-11-15 08:14:51 -08:00
|
|
|
}
|
|
|
|
|
2014-03-31 05:28:05 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_key_action_toggle(Evas_Object *obj, const char *params EINA_UNUSED)
|
2014-02-27 17:36:15 -08:00
|
|
|
{
|
|
|
|
_panel_toggle(NULL, obj, NULL, NULL);
|
2014-03-31 05:28:05 -07:00
|
|
|
return EINA_TRUE;
|
2014-02-27 17:36:15 -08:00
|
|
|
}
|
|
|
|
|
2017-08-16 23:08:00 -07:00
|
|
|
// _panel_elm_widget_widget_event
|
|
|
|
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(panel, Elm_Panel_Data)
|
|
|
|
|
2014-03-24 01:38:01 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2017-08-17 02:14:52 -07:00
|
|
|
_elm_panel_elm_widget_widget_event(Eo *obj, Elm_Panel_Data *pd, const Efl_Event *eo_event, Evas_Object *src)
|
2010-09-27 14:13:32 -07:00
|
|
|
{
|
2014-03-24 01:38:01 -07:00
|
|
|
if (src != obj) return EINA_FALSE;
|
2017-08-17 02:14:52 -07:00
|
|
|
return _panel_elm_widget_widget_event(obj, pd, eo_event, src);
|
2010-09-27 14:13:32 -07:00
|
|
|
}
|
|
|
|
|
2016-05-24 04:40:18 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_elm_panel_content_set(Eo *obj, Elm_Panel_Data *sd, const char *part, Evas_Object *content)
|
2011-10-28 21:32:24 -07:00
|
|
|
{
|
2014-10-30 23:16:09 -07:00
|
|
|
if (part)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-10-30 23:16:09 -07:00
|
|
|
// "elm.swallow.event" part is used for internal needs and should not be changed.
|
2014-10-30 23:19:35 -07:00
|
|
|
if (!strcmp(part, "elm.swallow.event"))
|
|
|
|
{
|
|
|
|
ERR("elm.swallow.event is being used for panel internally. Don't touch this part!");
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
2014-10-30 23:16:09 -07:00
|
|
|
if (strcmp(part, "default"))
|
|
|
|
{
|
|
|
|
Eina_Bool int_ret = EINA_TRUE;
|
2016-08-15 06:44:41 -07:00
|
|
|
int_ret = efl_content_set(efl_part(efl_super(obj, MY_CLASS), part), content);
|
2014-10-30 23:16:09 -07:00
|
|
|
return int_ret;
|
|
|
|
}
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2012-08-30 09:46:40 -07:00
|
|
|
|
2014-03-24 01:38:01 -07:00
|
|
|
if (sd->content == content) return EINA_TRUE;
|
2012-08-30 09:46:40 -07:00
|
|
|
if (sd->content)
|
|
|
|
evas_object_box_remove_all(sd->bx, EINA_TRUE);
|
|
|
|
sd->content = content;
|
2011-10-28 21:32:24 -07:00
|
|
|
if (content)
|
|
|
|
{
|
2012-08-30 09:46:40 -07:00
|
|
|
evas_object_box_append(sd->bx, sd->content);
|
|
|
|
evas_object_show(sd->content);
|
2015-03-13 01:27:03 -07:00
|
|
|
if (sd->scrollable)
|
|
|
|
elm_widget_sub_object_add(sd->scr_ly, sd->content);
|
2017-09-05 01:09:37 -07:00
|
|
|
else
|
|
|
|
elm_widget_sub_object_add(obj, sd->content);
|
2011-10-28 21:32:24 -07:00
|
|
|
}
|
2012-08-30 09:46:40 -07:00
|
|
|
|
|
|
|
elm_layout_sizing_eval(obj);
|
|
|
|
|
2014-03-24 01:38:01 -07:00
|
|
|
return EINA_TRUE;
|
2011-10-28 21:32:24 -07:00
|
|
|
}
|
|
|
|
|
2016-05-24 04:40:18 -07:00
|
|
|
static Evas_Object*
|
|
|
|
_elm_panel_content_get(Eo *obj, Elm_Panel_Data *sd, const char *part)
|
2011-10-28 21:32:24 -07:00
|
|
|
{
|
2014-10-30 23:16:09 -07:00
|
|
|
if (part)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-10-30 23:16:09 -07:00
|
|
|
// "elm.swallow.event" part is used for internal needs and should not be changed.
|
2014-10-30 23:19:35 -07:00
|
|
|
if (!strcmp(part, "elm.swallow.event"))
|
|
|
|
{
|
|
|
|
ERR("elm.swallow.event is being used for panel internally. Don't touch this part!");
|
|
|
|
return NULL;
|
|
|
|
}
|
2014-10-30 23:16:09 -07:00
|
|
|
if (strcmp(part, "default"))
|
|
|
|
{
|
|
|
|
Evas_Object *ret = NULL;
|
2016-08-15 06:44:41 -07:00
|
|
|
ret = efl_content_get(efl_part(efl_super(obj, MY_CLASS), part));
|
2014-10-30 23:16:09 -07:00
|
|
|
return ret;
|
|
|
|
}
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2012-08-30 09:46:40 -07:00
|
|
|
|
2014-03-24 01:38:01 -07:00
|
|
|
return sd->content;
|
2011-10-28 21:32:24 -07:00
|
|
|
}
|
|
|
|
|
2016-05-24 04:40:18 -07:00
|
|
|
static Evas_Object*
|
|
|
|
_elm_panel_content_unset(Eo *obj, Elm_Panel_Data *sd, const char *part)
|
2011-10-28 21:32:24 -07:00
|
|
|
{
|
2014-05-09 22:07:14 -07:00
|
|
|
Evas_Object *ret = NULL;
|
2012-08-30 09:46:40 -07:00
|
|
|
|
2014-10-30 23:16:09 -07:00
|
|
|
if (part)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-10-30 23:16:09 -07:00
|
|
|
// "elm.swallow.event" part is used for internal needs and should not be changed.
|
2014-10-30 23:19:35 -07:00
|
|
|
if (!strcmp(part, "elm.swallow.event"))
|
|
|
|
{
|
|
|
|
ERR("elm.swallow.event is being used for panel internally. Don't touch this part!");
|
|
|
|
return NULL;
|
|
|
|
}
|
2014-10-30 23:16:09 -07:00
|
|
|
if (strcmp(part, "default"))
|
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
ret = efl_content_unset(efl_part(efl_super(obj, MY_CLASS), part));
|
2014-10-30 23:16:09 -07:00
|
|
|
return ret;
|
|
|
|
}
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2012-08-30 09:46:40 -07:00
|
|
|
|
2014-03-24 01:38:01 -07:00
|
|
|
if (!sd->content) return NULL;
|
2014-05-09 22:07:14 -07:00
|
|
|
ret = sd->content;
|
2012-08-30 09:46:40 -07:00
|
|
|
|
|
|
|
evas_object_box_remove_all(sd->bx, EINA_FALSE);
|
2015-03-13 01:27:03 -07:00
|
|
|
if (sd->scrollable)
|
2016-05-29 19:36:49 -07:00
|
|
|
_elm_widget_sub_object_redirect_to_top(sd->scr_ly, sd->content);
|
2012-08-30 09:46:40 -07:00
|
|
|
sd->content = NULL;
|
|
|
|
|
2014-05-09 22:07:14 -07:00
|
|
|
return ret;
|
2011-10-28 21:32:24 -07:00
|
|
|
}
|
|
|
|
|
2014-03-24 01:38:01 -07:00
|
|
|
EOLIAN static void
|
2016-06-17 01:26:08 -07:00
|
|
|
_elm_panel_efl_canvas_group_group_add(Eo *obj, Elm_Panel_Data *priv)
|
2012-08-30 09:46:40 -07:00
|
|
|
{
|
2013-10-05 01:15:00 -07:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
2013-08-26 22:19:19 -07:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_canvas_group_add(efl_super(obj, MY_CLASS));
|
2013-09-24 21:33:39 -07:00
|
|
|
elm_widget_sub_object_parent_add(obj);
|
2012-08-30 09:46:40 -07:00
|
|
|
elm_widget_can_focus_set(obj, EINA_TRUE);
|
|
|
|
|
2014-07-06 23:08:45 -07:00
|
|
|
priv->panel_edje = wd->resize_obj;
|
|
|
|
|
2017-10-23 22:03:46 -07:00
|
|
|
efl_ui_widget_theme_apply(obj);
|
2012-08-30 09:46:40 -07:00
|
|
|
|
|
|
|
priv->bx = evas_object_box_add(evas_object_evas_get(obj));
|
|
|
|
evas_object_box_layout_set(priv->bx, _box_layout_cb, priv, NULL);
|
|
|
|
evas_object_show(priv->bx);
|
|
|
|
|
|
|
|
elm_layout_signal_callback_add
|
|
|
|
(obj, "elm,action,panel,toggle", "*", _panel_toggle, obj);
|
|
|
|
|
2017-06-13 03:41:15 -07:00
|
|
|
_mirrored_set(obj, efl_ui_mirrored_get(obj));
|
2012-08-30 09:46:40 -07:00
|
|
|
|
2013-09-10 02:48:32 -07:00
|
|
|
priv->event = evas_object_rectangle_add(evas_object_evas_get(obj));
|
|
|
|
evas_object_color_set(priv->event, 0, 0, 0, 0);
|
|
|
|
evas_object_pass_events_set(priv->event, EINA_TRUE);
|
2014-01-15 11:02:11 -08:00
|
|
|
elm_widget_sub_object_add(obj, priv->event);
|
|
|
|
|
|
|
|
/* just to bootstrap and have theme hook to work */
|
|
|
|
if (!elm_layout_theme_set(obj, "panel", "top", elm_widget_style_get(obj)))
|
|
|
|
CRI("Failed to set layout!");
|
|
|
|
else
|
2013-09-10 02:48:32 -07:00
|
|
|
{
|
2014-01-15 11:02:11 -08:00
|
|
|
elm_layout_content_set(obj, "elm.swallow.content", priv->bx);
|
2013-09-30 03:21:31 -07:00
|
|
|
|
2014-01-15 11:02:11 -08:00
|
|
|
if (edje_object_part_exists
|
|
|
|
(wd->resize_obj, "elm.swallow.event"))
|
|
|
|
{
|
|
|
|
Evas_Coord minw = 0, minh = 0;
|
|
|
|
|
|
|
|
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
|
|
|
|
evas_object_size_hint_min_set(priv->event, minw, minh);
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_content_set(efl_part(efl_super(obj, MY_CLASS), "elm.swallow.event"), priv->event);
|
2014-01-15 11:02:11 -08:00
|
|
|
}
|
2013-09-10 02:48:32 -07:00
|
|
|
}
|
2013-09-30 03:21:31 -07:00
|
|
|
|
2012-08-30 09:46:40 -07:00
|
|
|
elm_layout_sizing_eval(obj);
|
|
|
|
}
|
|
|
|
|
2014-03-24 01:38:01 -07:00
|
|
|
EOLIAN static void
|
2016-06-17 01:26:08 -07:00
|
|
|
_elm_panel_efl_canvas_group_group_del(Eo *obj, Elm_Panel_Data *sd)
|
2012-08-30 09:46:40 -07:00
|
|
|
{
|
|
|
|
Evas_Object *child;
|
|
|
|
Eina_List *l;
|
|
|
|
|
2013-10-05 01:15:00 -07:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
2012-08-30 09:46:40 -07:00
|
|
|
|
2012-12-08 10:17:04 -08:00
|
|
|
sd->delete_me = EINA_TRUE;
|
2012-08-30 09:46:40 -07:00
|
|
|
|
2014-07-06 23:08:45 -07:00
|
|
|
ELM_SAFE_FREE(sd->timer, ecore_timer_del);
|
|
|
|
|
2014-11-29 20:17:24 -08:00
|
|
|
/* let's make our panel object the *last* to be processed, since it
|
2012-08-30 09:46:40 -07:00
|
|
|
* may (smart) parent other sub objects here */
|
2012-11-25 22:32:53 -08:00
|
|
|
EINA_LIST_FOREACH(wd->subobjs, l, child)
|
2012-08-30 09:46:40 -07:00
|
|
|
{
|
|
|
|
if (child == sd->bx)
|
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
wd->subobjs =
|
|
|
|
eina_list_demote_list(wd->subobjs, l);
|
2012-08-30 09:46:40 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_canvas_group_del(efl_super(obj, MY_CLASS));
|
2012-08-30 09:46:40 -07:00
|
|
|
}
|
|
|
|
|
2014-03-24 01:38:01 -07:00
|
|
|
EOLIAN static void
|
2017-09-14 20:14:32 -07:00
|
|
|
_elm_panel_efl_gfx_position_set(Eo *obj, Elm_Panel_Data *sd, Eina_Position2D pos)
|
2014-07-06 23:08:45 -07:00
|
|
|
{
|
2017-09-14 20:14:32 -07:00
|
|
|
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
|
2016-10-10 20:39:05 -07:00
|
|
|
return;
|
|
|
|
|
2017-09-14 20:14:32 -07:00
|
|
|
efl_gfx_position_set(efl_super(obj, MY_CLASS), pos);
|
|
|
|
efl_gfx_position_set(sd->hit_rect, pos);
|
2014-07-06 23:08:45 -07:00
|
|
|
}
|
|
|
|
|
2017-01-05 00:26:32 -08:00
|
|
|
static void
|
|
|
|
_scrollable_layout_resize(Eo *obj, Elm_Panel_Data *sd, Evas_Coord w, Evas_Coord h)
|
2014-07-06 23:08:45 -07:00
|
|
|
{
|
|
|
|
switch (sd->orient)
|
|
|
|
{
|
|
|
|
case ELM_PANEL_ORIENT_TOP:
|
|
|
|
case ELM_PANEL_ORIENT_BOTTOM:
|
|
|
|
// vertical
|
|
|
|
evas_object_resize(sd->scr_ly, w, (1 + sd->content_size_ratio) * h);
|
|
|
|
evas_object_size_hint_min_set(sd->scr_panel, w, (sd->content_size_ratio * h));
|
|
|
|
evas_object_size_hint_min_set(sd->scr_event, w, h);
|
|
|
|
break;
|
|
|
|
case ELM_PANEL_ORIENT_LEFT:
|
|
|
|
case ELM_PANEL_ORIENT_RIGHT:
|
|
|
|
// horizontal
|
|
|
|
evas_object_resize(sd->scr_ly, (1 + sd->content_size_ratio) * w, h);
|
|
|
|
evas_object_size_hint_min_set(sd->scr_panel, (sd->content_size_ratio * w), h);
|
|
|
|
evas_object_size_hint_min_set(sd->scr_event, w, h);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2016-09-27 01:11:03 -07:00
|
|
|
elm_layout_sizing_eval(obj);
|
2014-07-06 23:08:45 -07:00
|
|
|
}
|
|
|
|
|
2017-01-05 00:26:32 -08:00
|
|
|
EOLIAN static void
|
2017-09-15 02:37:25 -07:00
|
|
|
_elm_panel_efl_gfx_size_set(Eo *obj, Elm_Panel_Data *sd, Eina_Size2D sz)
|
2017-01-05 00:26:32 -08:00
|
|
|
{
|
2017-09-15 02:37:25 -07:00
|
|
|
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
|
2017-01-05 00:26:32 -08:00
|
|
|
return;
|
|
|
|
|
2017-09-15 02:37:25 -07:00
|
|
|
efl_gfx_size_set(efl_super(obj, MY_CLASS), sz);
|
2017-01-05 00:26:32 -08:00
|
|
|
|
|
|
|
if (!sd->scrollable) return;
|
|
|
|
|
2017-09-15 02:37:25 -07:00
|
|
|
efl_gfx_size_set(sd->hit_rect, sz);
|
|
|
|
_scrollable_layout_resize(obj, sd, sz.w, sz.h);
|
2017-01-05 00:26:32 -08:00
|
|
|
}
|
|
|
|
|
2014-07-06 23:08:45 -07:00
|
|
|
EOLIAN static void
|
2016-06-17 01:26:08 -07:00
|
|
|
_elm_panel_efl_canvas_group_group_member_add(Eo *obj, Elm_Panel_Data *sd, Evas_Object *member)
|
2014-07-06 23:08:45 -07:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_canvas_group_member_add(efl_super(obj, MY_CLASS), member);
|
2014-07-06 23:08:45 -07:00
|
|
|
|
|
|
|
if (sd->hit_rect) evas_object_raise(sd->hit_rect);
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
2017-08-23 23:31:05 -07:00
|
|
|
_elm_panel_elm_widget_on_access_update(Eo *obj, Elm_Panel_Data *_pd, Eina_Bool is_access)
|
2012-10-25 02:07:21 -07:00
|
|
|
{
|
2013-10-05 01:15:00 -07:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
2014-07-06 23:08:45 -07:00
|
|
|
Elm_Panel_Data *sd = _pd;
|
|
|
|
|
|
|
|
if (sd->scrollable)
|
|
|
|
{
|
|
|
|
_access_obj_process(obj, is_access);
|
|
|
|
return;
|
|
|
|
}
|
2012-10-25 02:07:21 -07:00
|
|
|
|
|
|
|
if (is_access)
|
|
|
|
_elm_access_edje_object_part_object_register
|
2012-11-25 22:32:53 -08:00
|
|
|
(obj, wd->resize_obj, "btn_icon");
|
2012-10-25 02:07:21 -07:00
|
|
|
else
|
|
|
|
_elm_access_edje_object_part_object_unregister
|
2012-11-25 22:32:53 -08:00
|
|
|
(obj, wd->resize_obj, "btn_icon");
|
2012-08-30 09:46:40 -07:00
|
|
|
}
|
|
|
|
|
2009-11-15 08:14:51 -08:00
|
|
|
EAPI Evas_Object *
|
2011-04-01 04:26:58 -07:00
|
|
|
elm_panel_add(Evas_Object *parent)
|
2009-10-20 15:23:23 -07:00
|
|
|
{
|
2012-08-30 09:46:40 -07:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
2017-11-06 21:00:43 -08:00
|
|
|
Evas_Object *obj = elm_legacy_add(MY_CLASS, parent);
|
2014-07-06 23:08:45 -07:00
|
|
|
|
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
|
|
|
|
wd->highlight_root = EINA_TRUE;
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
return obj;
|
|
|
|
}
|
2012-08-30 09:46:40 -07:00
|
|
|
|
2015-05-19 05:34:07 -07:00
|
|
|
EOLIAN static Eo *
|
2016-08-10 07:23:04 -07:00
|
|
|
_elm_panel_efl_object_constructor(Eo *obj, Elm_Panel_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);
|
2017-10-18 18:13:54 -07:00
|
|
|
efl_access_role_set(obj, EFL_ACCESS_ROLE_PANEL);
|
2015-05-19 05:34:07 -07:00
|
|
|
|
2017-10-02 13:52:48 -07:00
|
|
|
efl_ui_focus_layer_behaviour_set(obj, EINA_FALSE, EINA_FALSE);
|
|
|
|
|
2015-05-19 05:34:07 -07:00
|
|
|
return obj;
|
2009-11-15 08:14:51 -08:00
|
|
|
}
|
|
|
|
|
2014-03-24 01:38:01 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_panel_orient_set(Eo *obj, Elm_Panel_Data *sd, Elm_Panel_Orient orient)
|
2009-11-15 08:14:51 -08:00
|
|
|
{
|
2012-08-30 09:46:40 -07:00
|
|
|
if (sd->orient == orient) return;
|
|
|
|
sd->orient = orient;
|
2011-02-08 04:08:28 -08:00
|
|
|
|
2016-09-27 01:11:03 -07:00
|
|
|
if (sd->scrollable)
|
|
|
|
{
|
|
|
|
_scrollable_layout_theme_set(obj, sd);
|
|
|
|
|
|
|
|
if (!sd->freeze)
|
|
|
|
{
|
|
|
|
switch (sd->orient)
|
|
|
|
{
|
|
|
|
case ELM_PANEL_ORIENT_TOP:
|
|
|
|
case ELM_PANEL_ORIENT_BOTTOM:
|
|
|
|
elm_interface_scrollable_movement_block_set
|
2017-08-29 01:49:38 -07:00
|
|
|
(obj, EFL_UI_SCROLL_BLOCK_VERTICAL);
|
2016-09-27 01:11:03 -07:00
|
|
|
break;
|
|
|
|
case ELM_PANEL_ORIENT_LEFT:
|
|
|
|
case ELM_PANEL_ORIENT_RIGHT:
|
|
|
|
elm_interface_scrollable_movement_block_set
|
2017-08-29 01:49:38 -07:00
|
|
|
(obj, EFL_UI_SCROLL_BLOCK_HORIZONTAL);
|
2016-09-27 01:11:03 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
sd->freeze = EINA_TRUE;
|
|
|
|
elm_layout_signal_emit(sd->scr_ly, "elm,state,content,hidden", "elm");
|
|
|
|
}
|
|
|
|
|
|
|
|
elm_panel_scrollable_content_size_set(obj, sd->content_size_ratio);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
_orient_set_do(obj);
|
2012-08-30 09:46:40 -07:00
|
|
|
|
|
|
|
elm_layout_sizing_eval(obj);
|
2009-11-15 08:14:51 -08:00
|
|
|
}
|
|
|
|
|
2014-03-24 01:38:01 -07:00
|
|
|
EOLIAN static Elm_Panel_Orient
|
|
|
|
_elm_panel_orient_get(Eo *obj EINA_UNUSED, Elm_Panel_Data *sd)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-03-24 01:38:01 -07:00
|
|
|
return sd->orient;
|
2010-04-26 22:43:54 -07:00
|
|
|
}
|
2010-04-12 01:12:02 -07:00
|
|
|
|
2014-03-24 01:38:01 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_panel_hidden_set(Eo *obj, Elm_Panel_Data *sd, Eina_Bool hidden)
|
2010-04-26 22:43:54 -07:00
|
|
|
{
|
2014-07-06 23:08:45 -07:00
|
|
|
if (sd->hidden == !!hidden)
|
|
|
|
{
|
|
|
|
if (sd->scrollable && sd->hidden && !sd->freeze)
|
|
|
|
{
|
|
|
|
Evas_Coord w, h;
|
|
|
|
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
|
|
|
|
_drawer_close(obj, w, h, EINA_TRUE);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
2012-08-30 09:46:40 -07:00
|
|
|
|
|
|
|
_panel_toggle(NULL, obj, NULL, NULL);
|
2010-04-26 22:43:54 -07:00
|
|
|
}
|
|
|
|
|
2014-03-24 01:38:01 -07:00
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elm_panel_hidden_get(Eo *obj EINA_UNUSED, Elm_Panel_Data *sd)
|
2010-04-26 22:43:54 -07:00
|
|
|
{
|
2014-03-24 01:38:01 -07:00
|
|
|
return sd->hidden;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2012-08-30 09:46:40 -07:00
|
|
|
|
2014-03-24 01:38:01 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_panel_toggle(Eo *obj, Elm_Panel_Data *_pd EINA_UNUSED)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2012-08-30 09:46:40 -07:00
|
|
|
_panel_toggle(NULL, obj, NULL, NULL);
|
2010-04-26 22:43:54 -07:00
|
|
|
}
|
2012-11-25 22:32:53 -08:00
|
|
|
|
2017-09-13 19:59:44 -07:00
|
|
|
EOLIAN static Eina_Rect
|
2017-10-12 02:16:42 -07:00
|
|
|
_elm_panel_elm_widget_interest_region_get(Eo *obj, Elm_Panel_Data *sd)
|
2014-07-06 23:08:45 -07:00
|
|
|
{
|
2017-09-13 19:59:44 -07:00
|
|
|
Eina_Rect r = {};
|
2017-08-29 19:29:08 -07:00
|
|
|
|
|
|
|
elm_interface_scrollable_content_pos_get(obj, &r.x, &r.y);
|
|
|
|
evas_object_geometry_get(obj, NULL, NULL, &r.w, &r.h);
|
2014-07-06 23:08:45 -07:00
|
|
|
switch (sd->orient)
|
|
|
|
{
|
|
|
|
case ELM_PANEL_ORIENT_TOP:
|
|
|
|
case ELM_PANEL_ORIENT_BOTTOM:
|
2017-08-29 19:29:08 -07:00
|
|
|
r.h *= sd->content_size_ratio;
|
2014-07-06 23:08:45 -07:00
|
|
|
break;
|
|
|
|
case ELM_PANEL_ORIENT_LEFT:
|
|
|
|
case ELM_PANEL_ORIENT_RIGHT:
|
2017-08-29 19:29:08 -07:00
|
|
|
r.w *= sd->content_size_ratio;
|
2014-07-06 23:08:45 -07:00
|
|
|
break;
|
|
|
|
}
|
2017-08-29 19:29:08 -07:00
|
|
|
if (r.w < 1) r.w = 1;
|
|
|
|
if (r.h < 1) r.h = 1;
|
|
|
|
|
|
|
|
return r;
|
2014-07-06 23:08:45 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_anim_stop_cb(Evas_Object *obj, void *data EINA_UNUSED)
|
|
|
|
{
|
2017-06-08 00:00:20 -07:00
|
|
|
ELM_PANEL_DATA_GET(obj, sd);
|
|
|
|
Evas_Object *ao;
|
|
|
|
Evas_Coord pos, w, h, panel_size = 0;
|
|
|
|
Eina_Bool open = EINA_FALSE, horizontal = EINA_FALSE, reverse = EINA_FALSE;
|
|
|
|
|
2014-07-06 23:08:45 -07:00
|
|
|
if (elm_widget_disabled_get(obj)) return;
|
2017-06-08 00:00:20 -07:00
|
|
|
|
|
|
|
switch (sd->orient)
|
|
|
|
{
|
|
|
|
case ELM_PANEL_ORIENT_BOTTOM:
|
|
|
|
reverse = EINA_TRUE;
|
|
|
|
case ELM_PANEL_ORIENT_TOP:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ELM_PANEL_ORIENT_RIGHT:
|
|
|
|
reverse = EINA_TRUE;
|
2017-06-12 10:04:27 -07:00
|
|
|
EINA_FALLTHROUGH;
|
2017-06-08 00:00:20 -07:00
|
|
|
case ELM_PANEL_ORIENT_LEFT:
|
|
|
|
horizontal = EINA_TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
|
|
|
|
if (horizontal)
|
|
|
|
{
|
|
|
|
if (w <= 0) return;
|
|
|
|
|
|
|
|
panel_size = w * sd->content_size_ratio;
|
|
|
|
elm_interface_scrollable_content_pos_get(obj, &pos, NULL);
|
2017-06-13 03:41:15 -07:00
|
|
|
reverse ^= efl_ui_mirrored_get(obj);
|
2017-06-08 00:00:20 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (h <= 0) return;
|
|
|
|
|
|
|
|
panel_size = h * sd->content_size_ratio;
|
|
|
|
elm_interface_scrollable_content_pos_get(obj, NULL, &pos);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pos == 0) open = !reverse;
|
|
|
|
else if (pos == panel_size) open = reverse;
|
|
|
|
else return;
|
|
|
|
|
|
|
|
if (open)
|
|
|
|
{
|
|
|
|
elm_interface_scrollable_single_direction_set
|
|
|
|
(obj, ELM_SCROLLER_SINGLE_DIRECTION_HARD);
|
|
|
|
|
|
|
|
//focus & access
|
|
|
|
elm_object_tree_focus_allow_set(obj, EINA_TRUE);
|
|
|
|
if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
|
|
|
|
{
|
|
|
|
ao = _access_object_get(obj, ACCESS_OUTLINE_PART);
|
|
|
|
evas_object_show(ao);
|
|
|
|
_elm_access_highlight_set(ao);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
elm_object_focus_set(obj, EINA_TRUE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (horizontal)
|
|
|
|
elm_interface_scrollable_movement_block_set
|
2017-08-29 01:49:38 -07:00
|
|
|
(obj, EFL_UI_SCROLL_BLOCK_HORIZONTAL);
|
2017-06-08 00:00:20 -07:00
|
|
|
else
|
|
|
|
elm_interface_scrollable_movement_block_set
|
2017-08-29 01:49:38 -07:00
|
|
|
(obj, EFL_UI_SCROLL_BLOCK_VERTICAL);
|
2017-06-08 00:00:20 -07:00
|
|
|
sd->freeze = EINA_TRUE;
|
|
|
|
elm_layout_signal_emit(sd->scr_ly, "elm,state,content,hidden", "elm");
|
|
|
|
|
|
|
|
elm_interface_scrollable_single_direction_set
|
|
|
|
(obj, ELM_SCROLLER_SINGLE_DIRECTION_NONE);
|
|
|
|
|
|
|
|
//focus & access
|
|
|
|
elm_object_tree_focus_allow_set(obj, EINA_FALSE);
|
|
|
|
if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
|
|
|
|
{
|
|
|
|
ao = _access_object_get(obj, ACCESS_OUTLINE_PART);
|
|
|
|
evas_object_hide(ao);
|
|
|
|
}
|
|
|
|
}
|
2014-07-06 23:08:45 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_scroll_cb(Evas_Object *obj, void *data EINA_UNUSED)
|
|
|
|
{
|
|
|
|
ELM_PANEL_DATA_GET(obj, sd);
|
|
|
|
Elm_Panel_Scroll_Info event;
|
|
|
|
Evas_Coord x, y, w, h;
|
|
|
|
|
|
|
|
if (elm_widget_disabled_get(obj)) return;
|
|
|
|
// in the case of
|
|
|
|
// freeze_set(FALSE) -> mouse_up -> freeze_set(TRUE) -> scroll
|
|
|
|
if (sd->freeze)
|
|
|
|
{
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_interface_scrollable_movement_block_set
|
2017-08-29 01:49:38 -07:00
|
|
|
(obj, EFL_UI_SCROLL_BLOCK_NONE);
|
2014-07-06 23:08:45 -07:00
|
|
|
sd->freeze = EINA_FALSE;
|
|
|
|
elm_layout_signal_emit(sd->scr_ly, "elm,state,content,visible", "elm");
|
|
|
|
}
|
|
|
|
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_interface_scrollable_content_pos_get(obj, &x, &y);
|
2014-07-06 23:08:45 -07:00
|
|
|
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
|
|
|
|
|
|
|
|
switch (sd->orient)
|
|
|
|
{
|
|
|
|
case ELM_PANEL_ORIENT_TOP:
|
|
|
|
event.rel_x = 1;
|
|
|
|
event.rel_y = 1 - ((double) y / (double) ((sd->content_size_ratio) * h));
|
|
|
|
break;
|
|
|
|
case ELM_PANEL_ORIENT_BOTTOM:
|
|
|
|
event.rel_x = 1;
|
|
|
|
event.rel_y = (double) y / (double) ((sd->content_size_ratio) * h);
|
|
|
|
break;
|
|
|
|
case ELM_PANEL_ORIENT_LEFT:
|
2017-06-13 03:41:15 -07:00
|
|
|
if (!efl_ui_mirrored_get(obj))
|
2015-04-09 22:37:10 -07:00
|
|
|
{
|
|
|
|
event.rel_x = 1 - ((double) x / (double) ((sd->content_size_ratio) * w));
|
|
|
|
event.rel_y = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
event.rel_x = (double) x / (double) ((sd->content_size_ratio) * w);
|
|
|
|
event.rel_y = 1;
|
|
|
|
}
|
2014-07-06 23:08:45 -07:00
|
|
|
break;
|
|
|
|
case ELM_PANEL_ORIENT_RIGHT:
|
2017-06-13 03:41:15 -07:00
|
|
|
if (efl_ui_mirrored_get(obj))
|
2015-04-09 22:37:10 -07:00
|
|
|
{
|
|
|
|
event.rel_x = 1 - ((double) x / (double) ((sd->content_size_ratio) * w));
|
|
|
|
event.rel_y = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
event.rel_x = (double) x / (double) ((sd->content_size_ratio) * w);
|
|
|
|
event.rel_y = 1;
|
|
|
|
}
|
2014-07-06 23:08:45 -07:00
|
|
|
break;
|
|
|
|
}
|
2016-08-22 15:40:39 -07:00
|
|
|
efl_event_callback_legacy_call
|
2016-06-10 01:51:20 -07:00
|
|
|
(obj, EFL_UI_EVENT_SCROLL, (void *) &event);
|
2014-07-06 23:08:45 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
2017-08-23 22:06:32 -07:00
|
|
|
_elm_panel_elm_widget_on_disabled_update(Eo *obj, Elm_Panel_Data *sd, Eina_Bool disabled)
|
2014-07-06 23:08:45 -07:00
|
|
|
{
|
2017-10-23 22:03:46 -07:00
|
|
|
if (!efl_ui_widget_on_disabled_update(efl_super(obj, MY_CLASS), disabled))
|
2017-08-23 22:06:32 -07:00
|
|
|
return EINA_FALSE;
|
2014-07-06 23:08:45 -07:00
|
|
|
|
|
|
|
if (sd->scrollable)
|
|
|
|
{
|
2017-08-23 22:06:32 -07:00
|
|
|
if (disabled)
|
2014-07-06 23:08:45 -07:00
|
|
|
{
|
|
|
|
evas_object_event_callback_del(obj, EVAS_CALLBACK_MOUSE_DOWN,
|
|
|
|
_on_mouse_down);
|
|
|
|
evas_object_event_callback_del(obj, EVAS_CALLBACK_MOUSE_MOVE,
|
|
|
|
_on_mouse_move);
|
|
|
|
evas_object_event_callback_del(obj, EVAS_CALLBACK_MOUSE_UP,
|
|
|
|
_on_mouse_up);
|
|
|
|
evas_object_event_callback_del(sd->scr_event, EVAS_CALLBACK_MOUSE_UP,
|
|
|
|
_event_mouse_up);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_DOWN,
|
|
|
|
_on_mouse_down, sd);
|
|
|
|
evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_MOVE,
|
|
|
|
_on_mouse_move, sd);
|
|
|
|
evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_UP,
|
|
|
|
_on_mouse_up, sd);
|
|
|
|
evas_object_event_callback_add(sd->scr_event, EVAS_CALLBACK_MOUSE_UP,
|
|
|
|
_event_mouse_up, obj);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2017-01-04 17:26:29 -08:00
|
|
|
EOLIAN static double
|
|
|
|
_elm_panel_scrollable_content_size_get(Eo *obj EINA_UNUSED, Elm_Panel_Data *sd)
|
|
|
|
{
|
|
|
|
return sd->content_size_ratio;
|
|
|
|
}
|
|
|
|
|
2014-07-06 23:08:45 -07:00
|
|
|
EOLIAN static void
|
2014-09-02 00:06:08 -07:00
|
|
|
_elm_panel_scrollable_content_size_set(Eo *obj, Elm_Panel_Data *sd, double ratio)
|
2014-07-06 23:08:45 -07:00
|
|
|
{
|
2017-01-04 17:26:29 -08:00
|
|
|
if (ratio < 0) ratio = 0;
|
|
|
|
else if (ratio > 1.0) ratio = 1.0;
|
2014-09-02 00:06:08 -07:00
|
|
|
|
2017-01-04 17:26:29 -08:00
|
|
|
sd->content_size_ratio = ratio;
|
2014-09-02 00:06:08 -07:00
|
|
|
|
2017-01-04 17:26:29 -08:00
|
|
|
if (sd->scrollable)
|
2017-01-05 00:26:32 -08:00
|
|
|
{
|
|
|
|
Evas_Coord w, h;
|
|
|
|
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
|
|
|
|
|
|
|
|
_scrollable_layout_resize(obj, sd, w, h);
|
|
|
|
}
|
2014-07-06 23:08:45 -07:00
|
|
|
}
|
|
|
|
|
2014-10-05 20:11:05 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2014-10-05 22:30:19 -07:00
|
|
|
_elm_panel_scrollable_get(Eo *obj EINA_UNUSED, Elm_Panel_Data *sd)
|
2014-10-05 20:11:05 -07:00
|
|
|
{
|
|
|
|
return sd->scrollable;
|
|
|
|
}
|
|
|
|
|
2014-07-06 23:08:45 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_panel_scrollable_set(Eo *obj, Elm_Panel_Data *sd, Eina_Bool scrollable)
|
|
|
|
{
|
|
|
|
scrollable = !!scrollable;
|
|
|
|
if (sd->scrollable == scrollable) return;
|
|
|
|
sd->scrollable = scrollable;
|
|
|
|
|
|
|
|
if (scrollable)
|
|
|
|
{
|
|
|
|
elm_layout_content_unset(obj, "elm.swallow.content");
|
|
|
|
|
2017-08-08 05:06:43 -07:00
|
|
|
elm_widget_resize_object_set(obj, NULL);
|
2014-07-06 23:08:45 -07:00
|
|
|
elm_widget_sub_object_add(obj, sd->panel_edje);
|
|
|
|
|
|
|
|
if (!sd->scr_edje)
|
|
|
|
{
|
|
|
|
const char *handler_size;
|
|
|
|
|
|
|
|
sd->scr_edje = edje_object_add(evas_object_evas_get(obj));
|
|
|
|
elm_widget_theme_object_set(obj, sd->scr_edje, "scroller", "panel",
|
|
|
|
elm_widget_style_get(obj));
|
|
|
|
evas_object_size_hint_weight_set
|
|
|
|
(sd->scr_edje, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_align_set
|
|
|
|
(sd->scr_edje, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
|
|
|
|
handler_size = edje_object_data_get(sd->scr_edje, "handler_size");
|
|
|
|
if (handler_size)
|
|
|
|
sd->handler_size = (int) (elm_object_scale_get(obj)) * (atoi(handler_size));
|
|
|
|
}
|
|
|
|
|
2017-08-08 05:06:43 -07:00
|
|
|
elm_widget_resize_object_set(obj, sd->scr_edje);
|
2014-07-06 23:08:45 -07:00
|
|
|
|
|
|
|
if (!sd->hit_rect)
|
|
|
|
{
|
|
|
|
sd->hit_rect = evas_object_rectangle_add(evas_object_evas_get(obj));
|
|
|
|
evas_object_smart_member_add(sd->hit_rect, obj);
|
|
|
|
elm_widget_sub_object_add(obj, sd->hit_rect);
|
|
|
|
evas_object_color_set(sd->hit_rect, 0, 0, 0, 0);
|
|
|
|
evas_object_show(sd->hit_rect);
|
|
|
|
evas_object_repeat_events_set(sd->hit_rect, EINA_TRUE);
|
|
|
|
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_interface_scrollable_objects_set(obj, sd->scr_edje, sd->hit_rect);
|
|
|
|
elm_interface_scrollable_animate_stop_cb_set(obj, _anim_stop_cb);
|
|
|
|
elm_interface_scrollable_scroll_cb_set(obj, _scroll_cb);
|
2014-07-06 23:08:45 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!sd->scr_ly)
|
|
|
|
{
|
|
|
|
sd->scr_ly = elm_layout_add(obj);
|
|
|
|
evas_object_smart_member_add(sd->scr_ly, obj);
|
|
|
|
elm_widget_sub_object_add(obj, sd->scr_ly);
|
|
|
|
_scrollable_layout_theme_set(obj, sd);
|
|
|
|
|
|
|
|
sd->scr_panel = evas_object_rectangle_add(evas_object_evas_get(obj));
|
|
|
|
evas_object_color_set(sd->scr_panel, 0, 0, 0, 0);
|
|
|
|
elm_widget_sub_object_add(obj, sd->scr_panel);
|
|
|
|
elm_layout_content_set(sd->scr_ly, "panel_area", sd->scr_panel);
|
|
|
|
|
|
|
|
sd->scr_event = evas_object_rectangle_add(evas_object_evas_get(obj));
|
|
|
|
evas_object_color_set(sd->scr_event, 0, 0, 0, 0);
|
|
|
|
elm_widget_sub_object_add(obj, sd->scr_event);
|
|
|
|
elm_layout_content_set(sd->scr_ly, "event_area", sd->scr_event);
|
|
|
|
}
|
|
|
|
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_interface_scrollable_content_set(obj, sd->scr_ly);
|
2014-07-06 23:08:45 -07:00
|
|
|
sd->freeze = EINA_TRUE;
|
|
|
|
elm_layout_content_set(sd->scr_ly, "elm.swallow.content", sd->bx);
|
2015-03-13 01:27:03 -07:00
|
|
|
if (sd->content) elm_widget_sub_object_add(sd->scr_ly, sd->content);
|
2014-07-06 23:08:45 -07:00
|
|
|
|
|
|
|
switch (sd->orient)
|
|
|
|
{
|
|
|
|
case ELM_PANEL_ORIENT_TOP:
|
|
|
|
case ELM_PANEL_ORIENT_BOTTOM:
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_interface_scrollable_movement_block_set
|
2017-08-29 01:49:38 -07:00
|
|
|
(obj, EFL_UI_SCROLL_BLOCK_VERTICAL);
|
2014-07-06 23:08:45 -07:00
|
|
|
break;
|
|
|
|
case ELM_PANEL_ORIENT_LEFT:
|
|
|
|
case ELM_PANEL_ORIENT_RIGHT:
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_interface_scrollable_movement_block_set
|
2017-08-29 01:49:38 -07:00
|
|
|
(obj, EFL_UI_SCROLL_BLOCK_HORIZONTAL);
|
2014-07-06 23:08:45 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_interface_scrollable_single_direction_set
|
|
|
|
(obj, ELM_SCROLLER_SINGLE_DIRECTION_NONE);
|
2014-07-06 23:08:45 -07:00
|
|
|
|
|
|
|
if (!elm_widget_disabled_get(obj))
|
|
|
|
{
|
|
|
|
evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_DOWN,
|
|
|
|
_on_mouse_down, sd);
|
|
|
|
evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_MOVE,
|
|
|
|
_on_mouse_move, sd);
|
|
|
|
evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_UP,
|
|
|
|
_on_mouse_up, sd);
|
|
|
|
evas_object_event_callback_add(sd->scr_event, EVAS_CALLBACK_MOUSE_UP,
|
|
|
|
_event_mouse_up, obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_interface_scrollable_content_set(obj, NULL);
|
2014-07-06 23:08:45 -07:00
|
|
|
|
|
|
|
evas_object_event_callback_del(obj, EVAS_CALLBACK_MOUSE_DOWN, _on_mouse_down);
|
|
|
|
evas_object_event_callback_del(obj, EVAS_CALLBACK_MOUSE_MOVE, _on_mouse_move);
|
|
|
|
evas_object_event_callback_del(obj, EVAS_CALLBACK_MOUSE_UP, _on_mouse_up);
|
|
|
|
evas_object_event_callback_del(sd->scr_event, EVAS_CALLBACK_MOUSE_UP,
|
|
|
|
_event_mouse_up);
|
|
|
|
|
2017-08-08 05:06:43 -07:00
|
|
|
elm_widget_resize_object_set(obj, NULL);
|
2014-07-06 23:08:45 -07:00
|
|
|
elm_widget_sub_object_add(obj, sd->scr_edje);
|
|
|
|
|
2017-08-08 05:06:43 -07:00
|
|
|
elm_widget_resize_object_set(obj, sd->panel_edje);
|
2014-07-06 23:08:45 -07:00
|
|
|
|
|
|
|
elm_layout_content_unset(sd->scr_ly, "elm.swallow.content");
|
|
|
|
elm_layout_content_set(obj, "elm.swallow.content", sd->bx);
|
2017-09-05 01:09:37 -07:00
|
|
|
if (sd->content) elm_widget_sub_object_add(obj, sd->content);
|
2014-07-06 23:08:45 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
static void
|
2016-08-10 07:23:04 -07:00
|
|
|
_elm_panel_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
|
|
|
}
|
2014-03-24 01:38:01 -07:00
|
|
|
|
2014-07-25 01:33:19 -07:00
|
|
|
EOLIAN const Elm_Atspi_Action *
|
|
|
|
_elm_panel_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Panel_Data *pd EINA_UNUSED)
|
|
|
|
{
|
|
|
|
static Elm_Atspi_Action atspi_actions[] = {
|
|
|
|
{ "toggle", "toggle", NULL, _key_action_toggle},
|
|
|
|
{ NULL, NULL, NULL, NULL }
|
|
|
|
};
|
|
|
|
return &atspi_actions[0];
|
|
|
|
}
|
|
|
|
|
2016-05-24 04:40:18 -07:00
|
|
|
/* Efl.Part begin */
|
|
|
|
|
2017-09-19 04:02:26 -07:00
|
|
|
ELM_PART_OVERRIDE(elm_panel, ELM_PANEL, Elm_Panel_Data)
|
|
|
|
ELM_PART_OVERRIDE_CONTENT_SET(elm_panel, ELM_PANEL, Elm_Panel_Data)
|
|
|
|
ELM_PART_OVERRIDE_CONTENT_GET(elm_panel, ELM_PANEL, Elm_Panel_Data)
|
|
|
|
ELM_PART_OVERRIDE_CONTENT_UNSET(elm_panel, ELM_PANEL, Elm_Panel_Data)
|
edje/elm: Rename _internal_ to _part_ (EO)
In Edje and Elementary, we have part objects, which are what is returned
by the interface efl_part(). Those objects can't be of an opaque type as
this doesn't work nicely with strongly typed languages such as C++ or
C#. In JS, Lua, C the types are weak and mostly runtime-based so it
doesn't matter much.
As a consequence, the documentation and the types need to look nice in
this EO API. Thus, we remove the abusive term "internal" and explicitly
call all those classes "part" something.
Eventually we want the types to be declared in the EO file so bindings
(C#, C++, ...) can generate the proper access methods, returning the
best possible types.
Note that right now a few of those part types are used in the legacy API
but don't actually need to be exposed externally.
This is kind of a mega commit that does all the renaming at once, but
it's really just a big sed operation. The power of good IDEs :)
Ref T5315
Ref T5306
2017-09-12 21:29:25 -07:00
|
|
|
#include "elm_panel_part.eo.c"
|
2016-05-24 04:40:18 -07:00
|
|
|
|
|
|
|
/* Efl.Part end */
|
|
|
|
|
2017-05-18 01:52:17 -07:00
|
|
|
/* Internal EO APIs and hidden overrides */
|
|
|
|
|
|
|
|
#define ELM_PANEL_EXTRA_OPS \
|
2017-08-07 00:13:38 -07:00
|
|
|
ELM_LAYOUT_SIZING_EVAL_OPS(elm_panel), \
|
2017-05-18 01:52:17 -07:00
|
|
|
EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_panel)
|
|
|
|
|
2014-03-24 01:38:01 -07:00
|
|
|
#include "elm_panel.eo.c"
|