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
|
|
|
|
#define ELM_INTERFACE_ATSPI_WIDGET_ACTION_PROTECTED
|
|
|
|
|
2016-04-11 09:51:15 -07:00
|
|
|
#define ELM_WIDGET_PROTECTED
|
2014-09-27 22:14:47 -07:00
|
|
|
#define ELM_WIDGET_ITEM_PROTECTED
|
2016-04-11 09:51:15 -07:00
|
|
|
|
2010-10-19 13:21:53 -07:00
|
|
|
#include <Elementary.h>
|
2013-04-25 22:13:00 -07:00
|
|
|
|
2010-10-19 13:21:53 -07:00
|
|
|
#include "elm_priv.h"
|
2012-08-30 09:45:51 -07:00
|
|
|
#include "elm_widget_ctxpopup.h"
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2016-05-24 04:40:18 -07:00
|
|
|
#include "elm_ctxpopup_internal_part.eo.h"
|
|
|
|
#include "elm_part_helper.h"
|
|
|
|
|
2014-06-03 03:35:28 -07:00
|
|
|
#define MY_CLASS ELM_CTXPOPUP_CLASS
|
2012-11-25 22:32:53 -08:00
|
|
|
|
2013-11-07 03:44:22 -08:00
|
|
|
#define MY_CLASS_NAME "Elm_Ctxpopup"
|
|
|
|
#define MY_CLASS_NAME_LEGACY "elm_ctxpopup"
|
2012-11-25 22:32:53 -08:00
|
|
|
|
2013-09-02 16:39:02 -07:00
|
|
|
#define ELM_PRIV_CTXPOPUP_SIGNALS(cmd) \
|
|
|
|
cmd(SIG_DISMISSED, "dismissed", "") \
|
2016-01-07 22:11:11 -08:00
|
|
|
cmd(SIG_GEOMETRY_UPDATE, "geometry,update", "") \
|
|
|
|
|
2013-09-02 16:39:02 -07:00
|
|
|
|
|
|
|
ELM_PRIV_CTXPOPUP_SIGNALS(ELM_PRIV_STATIC_VARIABLE_DECLARE);
|
2013-02-11 22:58:05 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
|
2013-09-02 16:39:02 -07:00
|
|
|
ELM_PRIV_CTXPOPUP_SIGNALS(ELM_PRIV_SMART_CALLBACKS_DESC)
|
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 */
|
2014-02-05 23:18:57 -08:00
|
|
|
{SIG_LAYOUT_FOCUSED, ""}, /**< handled by elm_layout */
|
|
|
|
{SIG_LAYOUT_UNFOCUSED, ""}, /**< handled by elm_layout */
|
2010-12-08 08:18:30 -08:00
|
|
|
{NULL, NULL}
|
2010-10-19 13:21:53 -07:00
|
|
|
};
|
2013-10-18 10:20:34 -07:00
|
|
|
#undef ELM_PRIV_CTXPOPUP_SIGNALS
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2014-04-16 23:41:50 -07:00
|
|
|
static Eina_Bool _key_action_move(Evas_Object *obj, const char *params);
|
|
|
|
static Eina_Bool _key_action_escape(Evas_Object *obj, const char *params);
|
|
|
|
|
|
|
|
static const Elm_Action key_actions[] = {
|
|
|
|
{"move", _key_action_move},
|
|
|
|
{"escape", _key_action_escape},
|
|
|
|
{NULL, NULL}
|
|
|
|
};
|
|
|
|
|
2014-03-20 06:06:33 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2014-04-22 05:51:46 -07:00
|
|
|
_elm_ctxpopup_elm_widget_translate(Eo *obj, Elm_Ctxpopup_Data *sd)
|
2013-02-11 22:58:05 -08:00
|
|
|
{
|
2013-04-23 04:30:15 -07:00
|
|
|
Eina_List *l;
|
2014-09-27 22:14:47 -07:00
|
|
|
Elm_Object_Item *it;
|
2013-04-23 04:30:15 -07:00
|
|
|
|
2014-02-09 01:11:47 -08:00
|
|
|
if (sd->auto_hide) evas_object_hide(obj);
|
2013-02-11 22:58:05 -08:00
|
|
|
|
2013-04-23 04:30:15 -07:00
|
|
|
EINA_LIST_FOREACH(sd->items, l, it)
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_wdg_item_translate(it);
|
2013-04-23 04:30:15 -07:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
elm_obj_widget_translate(efl_super(obj, MY_CLASS));
|
2014-01-23 03:20:43 -08:00
|
|
|
|
2014-03-20 06:06:33 -07:00
|
|
|
return EINA_TRUE;
|
2013-02-11 22:58:05 -08:00
|
|
|
}
|
2012-11-25 22:32:53 -08:00
|
|
|
|
2014-03-20 06:06:33 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2014-04-22 05:51:46 -07:00
|
|
|
_elm_ctxpopup_elm_widget_focus_next_manager_is(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *_pd EINA_UNUSED)
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] ctxpopup, focus-chain
i'd like to raise an issue about focus chain on the ctxpopup. the focus
would go around only in the ctxpopup. (IMHO, raster keep the previous
popup
patch. so definitely!!)
but.. first of all, current ctxpopup does not have focus_next(). even
though there is focus_next(), it is not work properly,
because the parent of ctxpopup would be a widget which does not take
care
of sub objects in the focus_next(); such as elm_list.
(every widget can be a parent of ctxpopup, if the widget is enough
size to
display ctxpopup. thus the elm_list can be a parent of ctxpopup also).
anyhow, to resolve this issue, the patch uses event() of
elm_widget_event_hook_set().
the ctxpopup item is equal to the elm_list item. but the focus chain of
elm_list does not work properly.
generally, we use 'Tab' key to move focus, but elm_list uses the
(up,down)
arrow key moreover it is not a focus.
if you want to check this patch, it would be better to use
ELM_ACCESS_MODE=1.
SVN revision: 74650
2012-07-31 05:30:48 -07:00
|
|
|
{
|
2014-03-20 06:06:33 -07:00
|
|
|
return EINA_TRUE;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-20 06:06:33 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2014-04-22 05:51:46 -07:00
|
|
|
_elm_ctxpopup_elm_widget_focus_direction_manager_is(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *_pd EINA_UNUSED)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-03-20 06:06:33 -07:00
|
|
|
return EINA_TRUE;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-20 06:06:33 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2015-09-15 03:41:51 -07:00
|
|
|
_elm_ctxpopup_elm_widget_focus_next(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd, Elm_Focus_Direction dir, Evas_Object **next, Elm_Object_Item **next_item)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
if (!sd)
|
2014-03-20 06:06:33 -07:00
|
|
|
return EINA_FALSE;
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] ctxpopup, focus-chain
i'd like to raise an issue about focus chain on the ctxpopup. the focus
would go around only in the ctxpopup. (IMHO, raster keep the previous
popup
patch. so definitely!!)
but.. first of all, current ctxpopup does not have focus_next(). even
though there is focus_next(), it is not work properly,
because the parent of ctxpopup would be a widget which does not take
care
of sub objects in the focus_next(); such as elm_list.
(every widget can be a parent of ctxpopup, if the widget is enough
size to
display ctxpopup. thus the elm_list can be a parent of ctxpopup also).
anyhow, to resolve this issue, the patch uses event() of
elm_widget_event_hook_set().
the ctxpopup item is equal to the elm_list item. but the focus chain of
elm_list does not work properly.
generally, we use 'Tab' key to move focus, but elm_list uses the
(up,down)
arrow key moreover it is not a focus.
if you want to check this patch, it would be better to use
ELM_ACCESS_MODE=1.
SVN revision: 74650
2012-07-31 05:30:48 -07:00
|
|
|
|
2015-09-15 03:41:51 -07:00
|
|
|
if (!elm_widget_focus_next_get(sd->box, dir, next, next_item))
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] ctxpopup, focus-chain
i'd like to raise an issue about focus chain on the ctxpopup. the focus
would go around only in the ctxpopup. (IMHO, raster keep the previous
popup
patch. so definitely!!)
but.. first of all, current ctxpopup does not have focus_next(). even
though there is focus_next(), it is not work properly,
because the parent of ctxpopup would be a widget which does not take
care
of sub objects in the focus_next(); such as elm_list.
(every widget can be a parent of ctxpopup, if the widget is enough
size to
display ctxpopup. thus the elm_list can be a parent of ctxpopup also).
anyhow, to resolve this issue, the patch uses event() of
elm_widget_event_hook_set().
the ctxpopup item is equal to the elm_list item. but the focus chain of
elm_list does not work properly.
generally, we use 'Tab' key to move focus, but elm_list uses the
(up,down)
arrow key moreover it is not a focus.
if you want to check this patch, it would be better to use
ELM_ACCESS_MODE=1.
SVN revision: 74650
2012-07-31 05:30:48 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_widget_focused_object_clear(sd->box);
|
2015-09-15 03:41:51 -07:00
|
|
|
elm_widget_focus_next_get(sd->box, dir, next, next_item);
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] ctxpopup, focus-chain
i'd like to raise an issue about focus chain on the ctxpopup. the focus
would go around only in the ctxpopup. (IMHO, raster keep the previous
popup
patch. so definitely!!)
but.. first of all, current ctxpopup does not have focus_next(). even
though there is focus_next(), it is not work properly,
because the parent of ctxpopup would be a widget which does not take
care
of sub objects in the focus_next(); such as elm_list.
(every widget can be a parent of ctxpopup, if the widget is enough
size to
display ctxpopup. thus the elm_list can be a parent of ctxpopup also).
anyhow, to resolve this issue, the patch uses event() of
elm_widget_event_hook_set().
the ctxpopup item is equal to the elm_list item. but the focus chain of
elm_list does not work properly.
generally, we use 'Tab' key to move focus, but elm_list uses the
(up,down)
arrow key moreover it is not a focus.
if you want to check this patch, it would be better to use
ELM_ACCESS_MODE=1.
SVN revision: 74650
2012-07-31 05:30:48 -07:00
|
|
|
}
|
|
|
|
|
2014-03-20 06:06:33 -07:00
|
|
|
return EINA_TRUE;
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] ctxpopup, focus-chain
i'd like to raise an issue about focus chain on the ctxpopup. the focus
would go around only in the ctxpopup. (IMHO, raster keep the previous
popup
patch. so definitely!!)
but.. first of all, current ctxpopup does not have focus_next(). even
though there is focus_next(), it is not work properly,
because the parent of ctxpopup would be a widget which does not take
care
of sub objects in the focus_next(); such as elm_list.
(every widget can be a parent of ctxpopup, if the widget is enough
size to
display ctxpopup. thus the elm_list can be a parent of ctxpopup also).
anyhow, to resolve this issue, the patch uses event() of
elm_widget_event_hook_set().
the ctxpopup item is equal to the elm_list item. but the focus chain of
elm_list does not work properly.
generally, we use 'Tab' key to move focus, but elm_list uses the
(up,down)
arrow key moreover it is not a focus.
if you want to check this patch, it would be better to use
ELM_ACCESS_MODE=1.
SVN revision: 74650
2012-07-31 05:30:48 -07:00
|
|
|
}
|
|
|
|
|
2014-03-20 06:06:33 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2015-09-24 23:24:53 -07:00
|
|
|
_elm_ctxpopup_elm_widget_focus_direction(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd, const Evas_Object *base, double degree, Evas_Object **direction, Elm_Object_Item **direction_item, double *weight)
|
2013-04-09 06:24:53 -07:00
|
|
|
{
|
|
|
|
Eina_Bool int_ret;
|
|
|
|
|
|
|
|
Eina_List *l = NULL;
|
|
|
|
void *(*list_data_get)(const Eina_List *list);
|
|
|
|
|
|
|
|
if (!sd)
|
2014-03-20 06:06:33 -07:00
|
|
|
return EINA_FALSE;
|
2013-04-09 06:24:53 -07:00
|
|
|
|
|
|
|
list_data_get = eina_list_data_get;
|
|
|
|
|
|
|
|
l = eina_list_append(l, sd->box);
|
|
|
|
|
|
|
|
int_ret = elm_widget_focus_list_direction_get
|
2015-09-24 23:24:53 -07:00
|
|
|
(obj, base, l, list_data_get, degree, direction, direction_item, weight);
|
2013-04-09 06:24:53 -07:00
|
|
|
eina_list_free(l);
|
2014-03-20 06:06:33 -07:00
|
|
|
|
|
|
|
return int_ret;
|
2013-04-09 06:24:53 -07:00
|
|
|
}
|
|
|
|
|
2014-04-16 23:41:50 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_key_action_move(Evas_Object *obj, const char *params)
|
|
|
|
{
|
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
|
|
|
const char *dir = params;
|
|
|
|
|
|
|
|
if (!sd->box) return EINA_FALSE;
|
|
|
|
|
2015-09-10 02:29:24 -07:00
|
|
|
_elm_widget_focus_auto_show(obj);
|
2014-04-16 23:41:50 -07:00
|
|
|
if (!strcmp(dir, "previous"))
|
|
|
|
elm_widget_focus_cycle(sd->box, ELM_FOCUS_PREVIOUS);
|
|
|
|
else if (!strcmp(dir, "next"))
|
|
|
|
elm_widget_focus_cycle(sd->box, ELM_FOCUS_NEXT);
|
|
|
|
else if (!strcmp(dir, "left"))
|
|
|
|
elm_widget_focus_cycle(sd->box, ELM_FOCUS_LEFT);
|
|
|
|
else if (!strcmp(dir, "right"))
|
|
|
|
elm_widget_focus_cycle(sd->box, ELM_FOCUS_RIGHT);
|
|
|
|
else if (!strcmp(dir, "up"))
|
|
|
|
elm_widget_focus_cycle(sd->box, ELM_FOCUS_UP);
|
|
|
|
else if (!strcmp(dir, "down"))
|
|
|
|
elm_widget_focus_cycle(sd->box, ELM_FOCUS_DOWN);
|
|
|
|
else return EINA_FALSE;
|
|
|
|
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_key_action_escape(Evas_Object *obj, const char *params EINA_UNUSED)
|
|
|
|
{
|
2014-04-16 23:51:37 -07:00
|
|
|
elm_ctxpopup_dismiss(obj);
|
2014-04-16 23:41:50 -07:00
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_x_pos_adjust(Evas_Coord_Point *pos,
|
|
|
|
Evas_Coord_Point *base_size,
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
Evas_Coord_Rectangle *hover_area)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
pos->x -= (base_size->x / 2);
|
|
|
|
|
|
|
|
if (pos->x < hover_area->x)
|
2011-08-13 20:47:51 -07:00
|
|
|
pos->x = hover_area->x;
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
else if ((pos->x + base_size->x) > (hover_area->x + hover_area->w))
|
2011-08-13 20:47:51 -07:00
|
|
|
pos->x = (hover_area->x + hover_area->w) - base_size->x;
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
|
|
|
if (base_size->x > hover_area->w)
|
2011-08-13 20:47:51 -07:00
|
|
|
base_size->x -= (base_size->x - hover_area->w);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
|
|
|
if (pos->x < hover_area->x)
|
2011-08-13 20:47:51 -07:00
|
|
|
pos->x = hover_area->x;
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_y_pos_adjust(Evas_Coord_Point *pos,
|
|
|
|
Evas_Coord_Point *base_size,
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
Evas_Coord_Rectangle *hover_area)
|
|
|
|
{
|
|
|
|
pos->y -= (base_size->y / 2);
|
|
|
|
|
|
|
|
if (pos->y < hover_area->y)
|
2011-08-13 20:47:51 -07:00
|
|
|
pos->y = hover_area->y;
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
else if ((pos->y + base_size->y) > (hover_area->y + hover_area->h))
|
2011-08-13 20:47:51 -07:00
|
|
|
pos->y = hover_area->y + hover_area->h - base_size->y;
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
|
|
|
if (base_size->y > hover_area->h)
|
2011-08-13 20:47:51 -07:00
|
|
|
base_size->y -= (base_size->y - hover_area->h);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
|
|
|
if (pos->y < hover_area->y)
|
2011-08-13 20:47:51 -07:00
|
|
|
pos->y = hover_area->y;
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static Elm_Ctxpopup_Direction
|
2012-08-30 09:45:51 -07:00
|
|
|
_base_geometry_calc(Evas_Object *obj,
|
|
|
|
Evas_Coord_Rectangle *rect)
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
Elm_Ctxpopup_Direction dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
|
|
|
|
Evas_Coord_Rectangle hover_area;
|
2011-01-11 01:54:41 -08:00
|
|
|
Evas_Coord_Point pos = {0, 0};
|
2012-08-30 09:45:51 -07:00
|
|
|
Evas_Coord_Point arrow_size;
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
Evas_Coord_Point base_size;
|
|
|
|
Evas_Coord_Point max_size;
|
|
|
|
Evas_Coord_Point min_size;
|
|
|
|
Evas_Coord_Point temp;
|
|
|
|
int idx;
|
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
2013-10-05 01:11:57 -07:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, ELM_CTXPOPUP_DIRECTION_DOWN);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2013-04-08 03:28:01 -07:00
|
|
|
if (!rect || !sd->parent) return ELM_CTXPOPUP_DIRECTION_DOWN;
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2014-08-04 02:27:27 -07:00
|
|
|
edje_object_part_geometry_get(sd->arrow, "base", NULL, NULL,
|
|
|
|
&arrow_size.x, &arrow_size.y);
|
2012-08-30 09:45:51 -07:00
|
|
|
evas_object_resize(sd->arrow, arrow_size.x, arrow_size.y);
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2011-03-23 19:17:34 -07:00
|
|
|
//Initialize Area Rectangle.
|
2012-08-30 09:45:51 -07:00
|
|
|
evas_object_geometry_get
|
|
|
|
(sd->parent, &hover_area.x, &hover_area.y, &hover_area.w,
|
|
|
|
&hover_area.h);
|
2016-08-15 06:44:41 -07:00
|
|
|
if (sd->parent && efl_isa(sd->parent, EFL_UI_WIN_CLASS))
|
2013-03-29 05:29:24 -07:00
|
|
|
hover_area.x = hover_area.y = 0;
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
|
|
|
evas_object_geometry_get(obj, &pos.x, &pos.y, NULL, NULL);
|
|
|
|
|
2011-03-23 19:17:34 -07:00
|
|
|
//recalc the edje
|
2012-08-30 09:45:51 -07:00
|
|
|
edje_object_size_min_calc
|
2012-11-25 22:32:53 -08:00
|
|
|
(wd->resize_obj, &base_size.x, &base_size.y);
|
|
|
|
evas_object_smart_calculate(wd->resize_obj);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
|
|
|
//Limit to Max Size
|
|
|
|
evas_object_size_hint_max_get(obj, &max_size.x, &max_size.y);
|
|
|
|
|
|
|
|
if ((max_size.y > 0) && (base_size.y > max_size.y))
|
2011-08-13 20:47:51 -07:00
|
|
|
base_size.y = max_size.y;
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
|
|
|
if ((max_size.x > 0) && (base_size.x > max_size.x))
|
2011-08-13 20:47:51 -07:00
|
|
|
base_size.x = max_size.x;
|
2011-03-23 19:17:34 -07:00
|
|
|
//Limit to Min Size
|
2016-06-09 00:29:40 -07:00
|
|
|
efl_gfx_size_hint_combined_min_get(obj, &min_size.x, &min_size.y);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
|
|
|
if ((min_size.y > 0) && (base_size.y < min_size.y))
|
2011-08-13 20:47:51 -07:00
|
|
|
base_size.y = min_size.y;
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
|
|
|
if ((min_size.x > 0) && (base_size.x < min_size.x))
|
2011-08-13 20:47:51 -07:00
|
|
|
base_size.x = min_size.x;
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2014-01-21 22:17:45 -08:00
|
|
|
//Check available directions. If there is one, it adjusts ctxpopup's position
|
|
|
|
// and size.
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
for (idx = 0; idx < 4; idx++)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
switch (sd->dir_priority[idx])
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
{
|
|
|
|
case ELM_CTXPOPUP_DIRECTION_UP:
|
2012-08-30 09:45:51 -07:00
|
|
|
temp.y = (pos.y - base_size.y);
|
|
|
|
if ((temp.y - arrow_size.y) < hover_area.y)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
_x_pos_adjust(&pos, &base_size, &hover_area);
|
|
|
|
pos.y -= base_size.y;
|
|
|
|
dir = ELM_CTXPOPUP_DIRECTION_UP;
|
|
|
|
break;
|
|
|
|
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
case ELM_CTXPOPUP_DIRECTION_LEFT:
|
2012-08-30 09:45:51 -07:00
|
|
|
temp.x = (pos.x - base_size.x);
|
|
|
|
if ((temp.x - arrow_size.x) < hover_area.x)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
_y_pos_adjust(&pos, &base_size, &hover_area);
|
|
|
|
pos.x -= base_size.x;
|
|
|
|
dir = ELM_CTXPOPUP_DIRECTION_LEFT;
|
|
|
|
break;
|
|
|
|
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
case ELM_CTXPOPUP_DIRECTION_RIGHT:
|
2012-08-30 09:45:51 -07:00
|
|
|
temp.x = (pos.x + base_size.x);
|
|
|
|
if ((temp.x + arrow_size.x) >
|
|
|
|
(hover_area.x + hover_area.w))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
_y_pos_adjust(&pos, &base_size, &hover_area);
|
|
|
|
dir = ELM_CTXPOPUP_DIRECTION_RIGHT;
|
|
|
|
break;
|
|
|
|
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
case ELM_CTXPOPUP_DIRECTION_DOWN:
|
2012-08-30 09:45:51 -07:00
|
|
|
temp.y = (pos.y + base_size.y);
|
|
|
|
if ((temp.y + arrow_size.y) >
|
|
|
|
(hover_area.y + hover_area.h))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
_x_pos_adjust(&pos, &base_size, &hover_area);
|
|
|
|
dir = ELM_CTXPOPUP_DIRECTION_DOWN;
|
|
|
|
break;
|
|
|
|
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
default:
|
2012-09-12 01:35:42 -07:00
|
|
|
continue;
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
}
|
|
|
|
break;
|
2010-10-19 13:21:53 -07:00
|
|
|
}
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
|
|
|
//In this case, all directions are invalid because of lack of space.
|
|
|
|
if (idx == 4)
|
|
|
|
{
|
|
|
|
Evas_Coord length[2];
|
|
|
|
|
2017-08-09 22:55:30 -07:00
|
|
|
if (!sd->horizontal)
|
2011-08-12 22:40:16 -07:00
|
|
|
{
|
|
|
|
length[0] = pos.y - hover_area.y;
|
|
|
|
length[1] = (hover_area.y + hover_area.h) - pos.y;
|
|
|
|
|
2011-08-12 23:05:19 -07:00
|
|
|
// ELM_CTXPOPUP_DIRECTION_UP
|
2011-08-12 22:40:16 -07:00
|
|
|
if (length[0] > length[1])
|
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
_x_pos_adjust(&pos, &base_size, &hover_area);
|
2011-08-12 22:40:16 -07:00
|
|
|
pos.y -= base_size.y;
|
2011-08-12 23:05:19 -07:00
|
|
|
dir = ELM_CTXPOPUP_DIRECTION_UP;
|
|
|
|
if (pos.y < (hover_area.y + arrow_size.y))
|
2011-08-12 22:40:16 -07:00
|
|
|
{
|
2011-08-13 20:47:51 -07:00
|
|
|
base_size.y -= ((hover_area.y + arrow_size.y) - pos.y);
|
|
|
|
pos.y = hover_area.y + arrow_size.y;
|
2011-08-12 22:40:16 -07:00
|
|
|
}
|
|
|
|
}
|
2011-08-12 23:05:19 -07:00
|
|
|
//ELM_CTXPOPUP_DIRECTION_DOWN
|
2011-08-12 22:40:16 -07:00
|
|
|
else
|
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
_x_pos_adjust(&pos, &base_size, &hover_area);
|
2011-08-12 23:05:19 -07:00
|
|
|
dir = ELM_CTXPOPUP_DIRECTION_DOWN;
|
|
|
|
if ((pos.y + arrow_size.y + base_size.y) >
|
|
|
|
(hover_area.y + hover_area.h))
|
2012-08-30 09:45:51 -07:00
|
|
|
base_size.y -=
|
|
|
|
((pos.y + arrow_size.y + base_size.y) -
|
|
|
|
(hover_area.y + hover_area.h));
|
2011-08-12 22:40:16 -07:00
|
|
|
}
|
|
|
|
}
|
2011-04-25 21:31:23 -07:00
|
|
|
else
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
{
|
2011-08-12 22:40:16 -07:00
|
|
|
length[0] = pos.x - hover_area.x;
|
|
|
|
length[1] = (hover_area.x + hover_area.w) - pos.x;
|
2011-08-12 23:05:19 -07:00
|
|
|
|
|
|
|
//ELM_CTXPOPUP_DIRECTION_LEFT
|
2011-08-12 22:40:16 -07:00
|
|
|
if (length[0] > length[1])
|
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
_y_pos_adjust(&pos, &base_size, &hover_area);
|
2011-08-12 22:40:16 -07:00
|
|
|
pos.x -= base_size.x;
|
2011-08-12 23:05:19 -07:00
|
|
|
dir = ELM_CTXPOPUP_DIRECTION_LEFT;
|
|
|
|
if (pos.x < (hover_area.x + arrow_size.x))
|
2011-08-12 22:40:16 -07:00
|
|
|
{
|
|
|
|
base_size.x -= ((hover_area.x + arrow_size.x) - pos.x);
|
|
|
|
pos.x = hover_area.x + arrow_size.x;
|
|
|
|
}
|
|
|
|
}
|
2011-08-12 23:05:19 -07:00
|
|
|
//ELM_CTXPOPUP_DIRECTION_RIGHT
|
2011-08-12 22:40:16 -07:00
|
|
|
else
|
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
_y_pos_adjust(&pos, &base_size, &hover_area);
|
2011-08-12 23:05:19 -07:00
|
|
|
dir = ELM_CTXPOPUP_DIRECTION_RIGHT;
|
|
|
|
if (pos.x + (arrow_size.x + base_size.x) >
|
2011-08-12 22:40:16 -07:00
|
|
|
hover_area.x + hover_area.w)
|
2012-08-30 09:45:51 -07:00
|
|
|
base_size.x -=
|
|
|
|
((pos.x + arrow_size.x + base_size.x) -
|
|
|
|
(hover_area.x + hover_area.w));
|
2011-08-12 22:40:16 -07:00
|
|
|
}
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-03-23 19:17:34 -07:00
|
|
|
//Final position and size.
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
rect->x = pos.x;
|
|
|
|
rect->y = pos.y;
|
|
|
|
rect->w = base_size.x;
|
|
|
|
rect->h = base_size.y;
|
|
|
|
|
2011-08-12 23:05:19 -07:00
|
|
|
return dir;
|
2010-10-19 13:21:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_arrow_update(Evas_Object *obj,
|
|
|
|
Elm_Ctxpopup_Direction dir,
|
2011-12-15 21:31:47 -08:00
|
|
|
Evas_Coord_Rectangle base_size)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
Evas_Coord_Rectangle arrow_size;
|
2012-08-30 09:45:51 -07:00
|
|
|
Evas_Coord x, y;
|
2011-10-24 17:27:18 -07:00
|
|
|
double drag;
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
2013-10-05 01:11:57 -07:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
2010-10-19 13:21:53 -07:00
|
|
|
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
evas_object_geometry_get(obj, &x, &y, NULL, NULL);
|
2012-08-30 09:45:51 -07:00
|
|
|
evas_object_geometry_get
|
|
|
|
(sd->arrow, NULL, NULL, &arrow_size.w, &arrow_size.h);
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
/* arrow is not being kept as sub-object on purpose, here. the
|
|
|
|
* design of the widget does not help with the contrary */
|
2011-10-13 19:22:59 -07:00
|
|
|
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
switch (dir)
|
|
|
|
{
|
2011-08-12 23:05:19 -07:00
|
|
|
case ELM_CTXPOPUP_DIRECTION_RIGHT:
|
2012-08-30 09:45:51 -07:00
|
|
|
edje_object_signal_emit(sd->arrow, "elm,state,left", "elm");
|
2014-04-28 08:00:54 -07:00
|
|
|
if (!edje_object_part_swallow(wd->resize_obj,
|
2017-06-13 03:41:15 -07:00
|
|
|
(efl_ui_mirrored_get(obj) ? "elm.swallow.arrow_right" :
|
2014-04-28 08:00:54 -07:00
|
|
|
"elm.swallow.arrow_left"), sd->arrow))
|
|
|
|
{
|
|
|
|
evas_object_hide(sd->arrow);
|
|
|
|
break;
|
|
|
|
}
|
2012-09-19 06:00:00 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (base_size.h > 0)
|
|
|
|
{
|
|
|
|
if (y < ((arrow_size.h * 0.5) + base_size.y))
|
|
|
|
y = 0;
|
|
|
|
else if (y > base_size.y + base_size.h - (arrow_size.h * 0.5))
|
|
|
|
y = base_size.h - arrow_size.h;
|
|
|
|
else
|
|
|
|
y = y - base_size.y - (arrow_size.h * 0.5);
|
|
|
|
drag = (double)(y) / (double)(base_size.h - arrow_size.h);
|
|
|
|
edje_object_part_drag_value_set
|
2012-11-25 22:32:53 -08:00
|
|
|
(wd->resize_obj,
|
2017-06-13 03:41:15 -07:00
|
|
|
(efl_ui_mirrored_get(obj) ? "elm.swallow.arrow_right" :
|
2012-09-19 06:00:00 -07:00
|
|
|
"elm.swallow.arrow_left"), 1, drag);
|
2012-08-30 09:45:51 -07:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2011-08-12 23:05:19 -07:00
|
|
|
case ELM_CTXPOPUP_DIRECTION_LEFT:
|
2012-08-30 09:45:51 -07:00
|
|
|
edje_object_signal_emit(sd->arrow, "elm,state,right", "elm");
|
2014-04-28 08:00:54 -07:00
|
|
|
if (!edje_object_part_swallow(wd->resize_obj,
|
2017-06-13 03:41:15 -07:00
|
|
|
(efl_ui_mirrored_get(obj) ? "elm.swallow.arrow_left" :
|
2014-04-28 08:00:54 -07:00
|
|
|
"elm.swallow.arrow_right"), sd->arrow))
|
|
|
|
{
|
|
|
|
evas_object_hide(sd->arrow);
|
|
|
|
break;
|
|
|
|
}
|
2012-08-30 09:45:51 -07:00
|
|
|
|
|
|
|
if (base_size.h > 0)
|
|
|
|
{
|
|
|
|
if (y < ((arrow_size.h * 0.5) + base_size.y))
|
|
|
|
y = 0;
|
|
|
|
else if (y > (base_size.y + base_size.h - (arrow_size.h * 0.5)))
|
|
|
|
y = base_size.h - arrow_size.h;
|
|
|
|
else
|
|
|
|
y = y - base_size.y - (arrow_size.h * 0.5);
|
|
|
|
drag = (double)(y) / (double)(base_size.h - arrow_size.h);
|
|
|
|
edje_object_part_drag_value_set
|
2012-11-25 22:32:53 -08:00
|
|
|
(wd->resize_obj,
|
2017-06-13 03:41:15 -07:00
|
|
|
(efl_ui_mirrored_get(obj) ? "elm.swallow.arrow_left" :
|
2012-09-19 06:00:00 -07:00
|
|
|
"elm.swallow.arrow_right"), 0, drag);
|
2012-08-30 09:45:51 -07:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2011-08-12 23:05:19 -07:00
|
|
|
case ELM_CTXPOPUP_DIRECTION_DOWN:
|
2012-08-30 09:45:51 -07:00
|
|
|
edje_object_signal_emit(sd->arrow, "elm,state,top", "elm");
|
2014-04-28 08:00:54 -07:00
|
|
|
if (!edje_object_part_swallow(wd->resize_obj, "elm.swallow.arrow_up", sd->arrow))
|
|
|
|
{
|
|
|
|
evas_object_hide(sd->arrow);
|
|
|
|
break;
|
|
|
|
}
|
2012-08-30 09:45:51 -07:00
|
|
|
|
|
|
|
if (base_size.w > 0)
|
|
|
|
{
|
|
|
|
if (x < ((arrow_size.w * 0.5) + base_size.x))
|
|
|
|
x = 0;
|
|
|
|
else if (x > (base_size.x + base_size.w - (arrow_size.w * 0.5)))
|
|
|
|
x = base_size.w - arrow_size.w;
|
|
|
|
else
|
|
|
|
x = x - base_size.x - (arrow_size.w * 0.5);
|
|
|
|
drag = (double)(x) / (double)(base_size.w - arrow_size.w);
|
|
|
|
edje_object_part_drag_value_set
|
2012-11-25 22:32:53 -08:00
|
|
|
(wd->resize_obj, "elm.swallow.arrow_up", drag,
|
2012-08-30 09:45:51 -07:00
|
|
|
1);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2011-08-12 23:05:19 -07:00
|
|
|
case ELM_CTXPOPUP_DIRECTION_UP:
|
2012-08-30 09:45:51 -07:00
|
|
|
edje_object_signal_emit(sd->arrow, "elm,state,bottom", "elm");
|
2014-04-28 08:00:54 -07:00
|
|
|
if (!edje_object_part_swallow(wd->resize_obj, "elm.swallow.arrow_down", sd->arrow))
|
|
|
|
{
|
|
|
|
evas_object_hide(sd->arrow);
|
|
|
|
break;
|
|
|
|
}
|
2012-08-30 09:45:51 -07:00
|
|
|
|
|
|
|
if (base_size.w > 0)
|
|
|
|
{
|
|
|
|
if (x < ((arrow_size.w * 0.5) + base_size.x))
|
|
|
|
x = 0;
|
|
|
|
else if (x > (base_size.x + base_size.w - (arrow_size.w * 0.5)))
|
|
|
|
x = base_size.w - arrow_size.w;
|
|
|
|
else x = x - base_size.x - (arrow_size.w * 0.5);
|
|
|
|
drag = (double)(x) / (double)(base_size.w - arrow_size.w);
|
|
|
|
edje_object_part_drag_value_set
|
2012-11-25 22:32:53 -08:00
|
|
|
(wd->resize_obj, "elm.swallow.arrow_down",
|
2012-08-30 09:45:51 -07:00
|
|
|
drag, 0);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
default:
|
2012-08-30 09:45:51 -07:00
|
|
|
break;
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
}
|
2012-03-22 03:14:58 -07:00
|
|
|
|
|
|
|
//should be here for getting accurate geometry value
|
2012-11-25 22:32:53 -08:00
|
|
|
evas_object_smart_calculate(wd->resize_obj);
|
2010-10-19 13:21:53 -07:00
|
|
|
}
|
|
|
|
|
2012-02-01 03:26:25 -08:00
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_show_signals_emit(Evas_Object *obj,
|
|
|
|
Elm_Ctxpopup_Direction dir)
|
2012-02-01 03:26:25 -08:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
2012-02-01 03:26:25 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (!sd->visible) return;
|
|
|
|
if ((sd->list) && (!sd->list_visible)) return;
|
2013-10-16 04:17:57 -07:00
|
|
|
if (sd->emitted) return;
|
2012-02-01 03:26:25 -08:00
|
|
|
|
2013-10-16 04:17:57 -07:00
|
|
|
sd->emitted = EINA_TRUE;
|
2012-02-01 03:26:25 -08:00
|
|
|
switch (dir)
|
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
case ELM_CTXPOPUP_DIRECTION_UP:
|
|
|
|
elm_layout_signal_emit(obj, "elm,state,show,up", "elm");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ELM_CTXPOPUP_DIRECTION_LEFT:
|
2012-09-20 01:13:28 -07:00
|
|
|
elm_layout_signal_emit(obj,
|
2017-06-13 03:41:15 -07:00
|
|
|
(efl_ui_mirrored_get(obj) ? "elm,state,show,right" :
|
2012-09-20 01:13:28 -07:00
|
|
|
"elm,state,show,left"), "elm");
|
2012-08-30 09:45:51 -07:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ELM_CTXPOPUP_DIRECTION_RIGHT:
|
2012-09-20 01:13:28 -07:00
|
|
|
elm_layout_signal_emit(obj,
|
2017-06-13 03:41:15 -07:00
|
|
|
(efl_ui_mirrored_get(obj) ? "elm,state,show,left" :
|
2012-09-20 01:13:28 -07:00
|
|
|
"elm,state,show,right"), "elm");
|
2012-08-30 09:45:51 -07:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ELM_CTXPOPUP_DIRECTION_DOWN:
|
|
|
|
elm_layout_signal_emit(obj, "elm,state,show,down", "elm");
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
2012-02-01 03:26:25 -08:00
|
|
|
}
|
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
edje_object_signal_emit(sd->bg, "elm,state,show", "elm");
|
|
|
|
elm_layout_signal_emit(obj, "elm,state,show", "elm");
|
2012-02-01 03:26:25 -08:00
|
|
|
}
|
|
|
|
|
2011-08-24 00:02:26 -07:00
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_hide_signals_emit(Evas_Object *obj,
|
|
|
|
Elm_Ctxpopup_Direction dir)
|
2011-08-24 00:02:26 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
2011-08-24 00:02:26 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (!sd->visible) return;
|
2011-08-24 00:02:26 -07:00
|
|
|
|
|
|
|
switch (dir)
|
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
case ELM_CTXPOPUP_DIRECTION_UP:
|
|
|
|
elm_layout_signal_emit(obj, "elm,state,hide,up", "elm");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ELM_CTXPOPUP_DIRECTION_LEFT:
|
2012-09-20 01:13:28 -07:00
|
|
|
elm_layout_signal_emit(obj,
|
2017-06-13 03:41:15 -07:00
|
|
|
(efl_ui_mirrored_get(obj) ? "elm,state,hide,right" :
|
2012-09-20 01:13:28 -07:00
|
|
|
"elm,state,hide,left"), "elm");
|
2012-08-30 09:45:51 -07:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ELM_CTXPOPUP_DIRECTION_RIGHT:
|
2012-09-20 01:13:28 -07:00
|
|
|
elm_layout_signal_emit(obj,
|
2017-06-13 03:41:15 -07:00
|
|
|
(efl_ui_mirrored_get(obj) ? "elm,state,hide,left" :
|
2012-09-20 01:13:28 -07:00
|
|
|
"elm,state,hide,right"), "elm");
|
2012-08-30 09:45:51 -07:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ELM_CTXPOPUP_DIRECTION_DOWN:
|
|
|
|
elm_layout_signal_emit(obj, "elm,state,hide,down", "elm");
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
2011-08-24 00:02:26 -07:00
|
|
|
}
|
2012-08-30 09:45:51 -07:00
|
|
|
edje_object_signal_emit(sd->bg, "elm,state,hide", "elm");
|
2013-06-21 23:21:00 -07:00
|
|
|
elm_layout_signal_emit(obj, "elm,state,hide", "elm");
|
2011-08-24 00:02:26 -07:00
|
|
|
}
|
|
|
|
|
2010-11-18 04:55:28 -08:00
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_base_shift_by_arrow(Evas_Object *arrow,
|
|
|
|
Elm_Ctxpopup_Direction dir,
|
|
|
|
Evas_Coord_Rectangle *rect)
|
|
|
|
{
|
|
|
|
Evas_Coord arrow_w, arrow_h;
|
|
|
|
|
|
|
|
evas_object_geometry_get(arrow, NULL, NULL, &arrow_w, &arrow_h);
|
|
|
|
switch (dir)
|
|
|
|
{
|
|
|
|
case ELM_CTXPOPUP_DIRECTION_RIGHT:
|
|
|
|
rect->x += arrow_w;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ELM_CTXPOPUP_DIRECTION_LEFT:
|
|
|
|
rect->x -= arrow_w;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ELM_CTXPOPUP_DIRECTION_DOWN:
|
|
|
|
rect->y += arrow_h;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ELM_CTXPOPUP_DIRECTION_UP:
|
|
|
|
rect->y -= arrow_h;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-20 06:06:33 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2017-08-23 04:41:37 -07:00
|
|
|
_elm_ctxpopup_elm_widget_widget_sub_object_add(Eo *obj, Elm_Ctxpopup_Data *_pd EINA_UNUSED, Evas_Object *sobj)
|
2012-08-30 09:45:51 -07:00
|
|
|
{
|
2017-08-23 04:41:37 -07:00
|
|
|
/* Skipping elm_layout widget_sub_object_add in order to ignore size hint changes.
|
2017-08-02 05:39:25 -07:00
|
|
|
* Note: It is not clear WHY we are doing this. Same reason as genlist?
|
|
|
|
*/
|
2017-08-23 04:41:37 -07:00
|
|
|
return elm_widget_sub_object_add(efl_cast(obj, ELM_WIDGET_CLASS), sobj);
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2012-08-30 09:45:51 -07:00
|
|
|
|
2014-03-20 06:06:33 -07:00
|
|
|
EOLIAN static void
|
2014-04-22 05:51:46 -07:00
|
|
|
_elm_ctxpopup_elm_layout_sizing_eval(Eo *obj, Elm_Ctxpopup_Data *sd)
|
2010-11-18 04:55:28 -08:00
|
|
|
{
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
Evas_Coord_Rectangle rect = { 0, 0, 1, 1 };
|
2014-02-09 01:11:47 -08:00
|
|
|
Evas_Coord_Point list_size = { 0, 0 }, parent_size = {0, 0};
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2013-10-05 01:11:57 -07:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
2012-08-30 09:45:51 -07:00
|
|
|
|
|
|
|
if (!sd->arrow) return; /* simple way to flag "under deletion" */
|
2013-04-08 03:28:01 -07:00
|
|
|
if (!sd->parent) return; /* do not calculate sizes unless parent is set */
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
|
|
|
//Base
|
2012-08-30 09:45:51 -07:00
|
|
|
sd->dir = _base_geometry_calc(obj, &rect);
|
|
|
|
|
|
|
|
_arrow_update(obj, sd->dir, rect);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
_base_shift_by_arrow(sd->arrow, sd->dir, &rect);
|
|
|
|
|
|
|
|
if ((sd->list) && (sd->list_visible))
|
2012-03-22 03:14:58 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
evas_object_geometry_get(sd->list, 0, 0, &list_size.x, &list_size.y);
|
2012-03-22 03:14:58 -07:00
|
|
|
if ((list_size.x >= rect.w) || (list_size.y >= rect.h))
|
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_list_mode_set(sd->list, ELM_LIST_COMPRESS);
|
2014-08-04 03:46:03 -07:00
|
|
|
evas_object_size_hint_min_set(obj, list_size.x, list_size.y);
|
2012-03-22 03:14:58 -07:00
|
|
|
}
|
2014-08-04 03:46:03 -07:00
|
|
|
/*
|
|
|
|
Decrease height of main object initiate recalc of size (sizing_eval).
|
|
|
|
At each iteration of calculating size height of the object
|
|
|
|
will be closer to the height of the list.
|
|
|
|
*/
|
|
|
|
if (list_size.y < rect.h) rect.h--;
|
|
|
|
}
|
|
|
|
else if (sd->content)
|
|
|
|
{
|
|
|
|
evas_object_geometry_get(sd->content, 0, 0, &list_size.x, &list_size.y);
|
|
|
|
if ((list_size.x >= rect.w) || (list_size.y >= rect.h))
|
|
|
|
evas_object_size_hint_min_set(obj, list_size.x, list_size.y);
|
2012-08-30 09:45:51 -07:00
|
|
|
}
|
|
|
|
|
2014-02-09 01:11:47 -08:00
|
|
|
evas_object_geometry_get(sd->parent, NULL, NULL, &parent_size.x, &parent_size.y);
|
|
|
|
evas_object_resize(sd->bg, parent_size.x, parent_size.y);
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
evas_object_move(wd->resize_obj, rect.x, rect.y);
|
|
|
|
evas_object_resize(wd->resize_obj, rect.w, rect.h);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
_show_signals_emit(obj, sd->dir);
|
2016-01-07 22:11:11 -08:00
|
|
|
|
2016-08-22 15:40:39 -07:00
|
|
|
efl_event_callback_legacy_call(obj, ELM_CTXPOPUP_EVENT_GEOMETRY_UPDATE, &rect);
|
2010-11-18 04:55:28 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_on_parent_del(void *data,
|
2014-01-06 06:30:02 -08:00
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2010-11-18 04:55:28 -08:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
evas_object_del(data);
|
|
|
|
}
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
static void
|
|
|
|
_on_parent_move(void *data,
|
2014-01-06 06:30:02 -08:00
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2012-08-30 09:45:51 -07:00
|
|
|
{
|
|
|
|
ELM_CTXPOPUP_DATA_GET(data, sd);
|
|
|
|
|
|
|
|
sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
|
|
|
|
|
|
|
|
if (sd->visible) elm_layout_sizing_eval(data);
|
2010-11-18 04:55:28 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_on_parent_resize(void *data,
|
2014-01-06 06:30:02 -08:00
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2010-11-18 04:55:28 -08:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(data, sd);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2014-02-09 01:11:47 -08:00
|
|
|
if (sd->auto_hide)
|
|
|
|
{
|
|
|
|
sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2014-02-09 01:11:47 -08:00
|
|
|
evas_object_hide(data);
|
2016-08-22 15:40:39 -07:00
|
|
|
efl_event_callback_legacy_call(data, ELM_CTXPOPUP_EVENT_DISMISSED, NULL);
|
2014-02-09 01:11:47 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (sd->visible)
|
|
|
|
elm_layout_sizing_eval(data);
|
|
|
|
}
|
2010-11-18 04:55:28 -08:00
|
|
|
}
|
|
|
|
|
2010-10-19 13:21:53 -07:00
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_parent_detach(Evas_Object *obj)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (!sd->parent) return;
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
evas_object_event_callback_del_full
|
|
|
|
(sd->parent, EVAS_CALLBACK_DEL, _on_parent_del, obj);
|
|
|
|
evas_object_event_callback_del_full
|
|
|
|
(sd->parent, EVAS_CALLBACK_MOVE, _on_parent_move, obj);
|
|
|
|
evas_object_event_callback_del_full
|
|
|
|
(sd->parent, EVAS_CALLBACK_RESIZE, _on_parent_resize, obj);
|
2010-10-19 13:21:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_on_content_resized(void *data,
|
2014-01-06 06:30:02 -08:00
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(data, sd);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_box_recalculate(sd->box);
|
|
|
|
elm_layout_sizing_eval(data);
|
|
|
|
}
|
|
|
|
|
|
|
|
//FIXME: lost the content size when theme hook is called.
|
2017-08-09 00:13:06 -07:00
|
|
|
EOLIAN static Efl_Ui_Theme_Apply
|
2014-04-22 05:51:46 -07:00
|
|
|
_elm_ctxpopup_elm_widget_theme_apply(Eo *obj, Elm_Ctxpopup_Data *sd)
|
2012-08-30 09:45:51 -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
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
int_ret = elm_obj_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;
|
2011-10-23 23:49:08 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_widget_theme_object_set
|
|
|
|
(obj, sd->bg, "ctxpopup", "bg", elm_widget_style_get(obj));
|
|
|
|
elm_widget_theme_object_set
|
|
|
|
(obj, sd->arrow, "ctxpopup", "arrow", elm_widget_style_get(obj));
|
2011-10-24 17:27:18 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (sd->list)
|
2011-01-31 00:47:19 -08:00
|
|
|
{
|
2011-10-24 17:27:18 -07:00
|
|
|
if (!strncmp(elm_object_style_get(obj), "default", strlen("default")))
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_object_style_set(sd->list, "ctxpopup");
|
2011-03-23 19:17:34 -07:00
|
|
|
else
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_object_style_set(sd->list, elm_object_style_get(obj));
|
2011-01-31 00:47:19 -08:00
|
|
|
}
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
|
2011-08-28 00:12:16 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (sd->visible) 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;
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
}
|
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
/* kind of a big and tricky override here: an internal box will hold
|
|
|
|
* the actual content. content aliases won't be of much help here */
|
2016-05-24 04:40:18 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_elm_ctxpopup_content_set(Eo *obj, Elm_Ctxpopup_Data *sd, const char *part, Evas_Object *content)
|
2011-08-02 21:38:44 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
if ((part) && (strcmp(part, "default")))
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
return efl_content_set(efl_part(efl_super(obj, MY_CLASS), part), content);
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2012-08-30 09:45:51 -07:00
|
|
|
|
2014-03-20 06:06:33 -07:00
|
|
|
if (!content) return EINA_FALSE;
|
2012-08-30 09:45:51 -07:00
|
|
|
|
2014-03-20 06:06:33 -07:00
|
|
|
if (content == sd->content) return EINA_TRUE;
|
2012-08-30 09:45:51 -07:00
|
|
|
|
2014-01-21 17:38:55 -08:00
|
|
|
evas_object_del(sd->content);
|
2012-08-30 09:45:51 -07:00
|
|
|
if (sd->content == sd->list) sd->list = NULL;
|
|
|
|
|
|
|
|
evas_object_size_hint_weight_set
|
|
|
|
(content, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_fill_set
|
|
|
|
(content, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
|
|
|
|
elm_box_pack_end(sd->box, content);
|
2014-03-06 01:53:57 -08:00
|
|
|
evas_object_show(content);
|
2011-12-15 21:27:11 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
sd->content = content;
|
|
|
|
sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
|
2011-08-02 21:38:44 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (sd->visible) elm_layout_sizing_eval(obj);
|
2011-08-28 00:12:16 -07:00
|
|
|
|
2014-03-20 06:06:33 -07:00
|
|
|
return EINA_TRUE;
|
2011-08-02 21:38:44 -07:00
|
|
|
}
|
|
|
|
|
2016-05-24 04:40:18 -07:00
|
|
|
static Evas_Object*
|
|
|
|
_elm_ctxpopup_content_get(Eo *obj, Elm_Ctxpopup_Data *sd, const char *part)
|
2011-08-02 21:38:44 -07:00
|
|
|
{
|
2012-09-04 07:10:00 -07:00
|
|
|
if ((part) && (strcmp(part, "default")))
|
2016-08-15 06:44:41 -07:00
|
|
|
return efl_content_get(efl_part(efl_super(obj, MY_CLASS), part));
|
2012-09-04 07:10:00 -07:00
|
|
|
|
2014-03-20 06:06:33 -07:00
|
|
|
return sd->content;
|
2011-08-02 21:38:44 -07:00
|
|
|
}
|
|
|
|
|
2016-05-24 04:40:18 -07:00
|
|
|
static Evas_Object*
|
|
|
|
_elm_ctxpopup_content_unset(Eo *obj, Elm_Ctxpopup_Data *sd, const char *part)
|
2011-08-02 21:38:44 -07:00
|
|
|
{
|
2014-04-03 05:46:17 -07:00
|
|
|
Evas_Object *content = NULL;
|
2012-08-30 09:45:51 -07:00
|
|
|
|
2012-09-04 07:10:00 -07:00
|
|
|
if ((part) && (strcmp(part, "default")))
|
2016-08-15 06:44:41 -07:00
|
|
|
return efl_content_unset(efl_part(efl_super(obj, MY_CLASS), part));
|
2012-09-04 07:10:00 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
content = sd->content;
|
2014-03-20 06:06:33 -07:00
|
|
|
if (!content) return content;
|
2012-08-30 09:45:51 -07:00
|
|
|
|
2013-10-07 23:41:06 -07:00
|
|
|
elm_box_unpack(sd->box, content);
|
2012-08-30 09:45:51 -07:00
|
|
|
sd->content = NULL;
|
|
|
|
sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
|
|
|
|
|
|
|
|
if (sd->visible) elm_layout_sizing_eval(obj);
|
|
|
|
|
2014-05-06 20:51:51 -07:00
|
|
|
return content;
|
2011-08-02 21:38:44 -07:00
|
|
|
}
|
|
|
|
|
2014-09-27 22:14:47 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_ctxpopup_item_elm_widget_item_part_text_set(Eo *eo_ctxpopup_it EINA_UNUSED,
|
|
|
|
Elm_Ctxpopup_Item_Data *ctxpopup_it,
|
|
|
|
const char *part,
|
|
|
|
const char *label)
|
2011-11-16 18:16:38 -08:00
|
|
|
{
|
2012-03-22 03:14:58 -07:00
|
|
|
if ((part) && (strcmp(part, "default"))) return;
|
2011-11-16 18:16:38 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(WIDGET(ctxpopup_it), sd);
|
2011-11-16 18:16:38 -08:00
|
|
|
|
2012-03-22 03:14:58 -07:00
|
|
|
elm_object_item_part_text_set(ctxpopup_it->list_item, "default", label);
|
2012-08-30 09:45:51 -07:00
|
|
|
sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
|
2011-11-16 18:16:38 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (sd->visible) elm_layout_sizing_eval(WIDGET(ctxpopup_it));
|
2011-11-16 18:16:38 -08:00
|
|
|
}
|
|
|
|
|
2014-09-27 22:14:47 -07:00
|
|
|
EOLIAN static const char *
|
|
|
|
_elm_ctxpopup_item_elm_widget_item_part_text_get(Eo *eo_ctxpopup_it EINA_UNUSED,
|
|
|
|
Elm_Ctxpopup_Item_Data *ctxpopup_it,
|
|
|
|
const char *part)
|
2011-11-16 18:16:38 -08:00
|
|
|
{
|
|
|
|
if (part && strcmp(part, "default")) return NULL;
|
2012-08-30 09:45:51 -07:00
|
|
|
|
2012-03-22 03:14:58 -07:00
|
|
|
return elm_object_item_part_text_get(ctxpopup_it->list_item, "default");
|
2011-11-16 18:16:38 -08:00
|
|
|
}
|
|
|
|
|
2014-09-27 22:14:47 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_ctxpopup_item_elm_widget_item_part_content_set(Eo *eo_ctxpopup_it EINA_UNUSED,
|
|
|
|
Elm_Ctxpopup_Item_Data *ctxpopup_it,
|
|
|
|
const char *part,
|
|
|
|
Evas_Object *content)
|
2011-11-16 18:16:38 -08:00
|
|
|
{
|
2012-03-22 03:14:58 -07:00
|
|
|
if ((part) && (strcmp(part, "icon"))
|
|
|
|
&& (strcmp(part, "start"))
|
|
|
|
&& (strcmp(part, "end"))) return;
|
2011-11-16 18:16:38 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(WIDGET(ctxpopup_it), sd);
|
2011-11-16 18:16:38 -08:00
|
|
|
|
2012-03-22 03:14:58 -07:00
|
|
|
if ((part) && (!strcmp(part, "end")))
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_object_item_part_content_set(ctxpopup_it->list_item, "end", content);
|
2012-03-22 03:14:58 -07:00
|
|
|
else
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_object_item_part_content_set
|
|
|
|
(ctxpopup_it->list_item, "start", content);
|
2012-03-22 03:14:58 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
|
2011-11-16 18:16:38 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (sd->visible) elm_layout_sizing_eval(WIDGET(ctxpopup_it));
|
2011-11-16 18:16:38 -08:00
|
|
|
}
|
|
|
|
|
2014-09-27 22:14:47 -07:00
|
|
|
EOLIAN static Evas_Object *
|
|
|
|
_elm_ctxpopup_item_elm_widget_item_part_content_get(Eo *eo_ctxpopup_it EINA_UNUSED,
|
|
|
|
Elm_Ctxpopup_Item_Data *ctxpopup_it,
|
|
|
|
const char *part)
|
2011-11-16 18:16:38 -08:00
|
|
|
{
|
2012-03-22 03:14:58 -07:00
|
|
|
if (part && strcmp(part, "icon") && strcmp(part, "start")
|
|
|
|
&& strcmp(part, "end")) return NULL;
|
|
|
|
|
|
|
|
if (part && !strcmp(part, "end"))
|
2012-08-30 09:45:51 -07:00
|
|
|
return elm_object_item_part_content_get(ctxpopup_it->list_item, "end");
|
2012-03-22 03:14:58 -07:00
|
|
|
else
|
2012-08-30 09:45:51 -07:00
|
|
|
return elm_object_item_part_content_get(ctxpopup_it->list_item, "start");
|
2011-11-16 18:16:38 -08:00
|
|
|
}
|
|
|
|
|
2017-08-09 22:13:51 -07:00
|
|
|
EOLIAN static Evas_Object *
|
|
|
|
_elm_ctxpopup_item_elm_widget_item_part_content_unset(Eo *eo_ctxpopup_it EINA_UNUSED,
|
|
|
|
Elm_Ctxpopup_Item_Data *ctxpopup_it,
|
|
|
|
const char *part)
|
|
|
|
{
|
|
|
|
Evas_Object *content = NULL;
|
|
|
|
|
|
|
|
if ((part) && (strcmp(part, "icon"))
|
|
|
|
&& (strcmp(part, "start"))
|
|
|
|
&& (strcmp(part, "end"))) return NULL;
|
|
|
|
|
|
|
|
ELM_CTXPOPUP_DATA_GET(WIDGET(ctxpopup_it), sd);
|
|
|
|
|
|
|
|
if ((part) && (!strcmp(part, "end")))
|
|
|
|
content = elm_object_item_part_content_unset(ctxpopup_it->list_item, "end");
|
|
|
|
else
|
|
|
|
content = elm_object_item_part_content_unset(ctxpopup_it->list_item, "start");
|
|
|
|
|
|
|
|
sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
|
|
|
|
|
|
|
|
if (sd->visible) elm_layout_sizing_eval(WIDGET(ctxpopup_it));
|
|
|
|
|
|
|
|
return content;
|
|
|
|
}
|
|
|
|
|
2014-09-27 22:14:47 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_ctxpopup_item_elm_widget_item_disable(Eo *eo_ctxpopup_it,
|
|
|
|
Elm_Ctxpopup_Item_Data *ctxpopup_it)
|
2011-11-16 18:16:38 -08:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_object_item_disabled_set
|
2016-03-02 04:10:48 -08:00
|
|
|
(ctxpopup_it->list_item, elm_wdg_item_disabled_get(eo_ctxpopup_it));
|
2011-11-16 18:16:38 -08:00
|
|
|
}
|
|
|
|
|
2017-08-09 22:02:06 -07:00
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elm_ctxpopup_item_elm_widget_item_del_pre(Eo *eo_ctxpopup_it EINA_UNUSED,
|
|
|
|
Elm_Ctxpopup_Item_Data *ctxpopup_it)
|
|
|
|
{
|
|
|
|
ELM_CTXPOPUP_DATA_GET(WIDGET(ctxpopup_it), sd);
|
|
|
|
if (!sd) return EINA_FALSE;
|
|
|
|
|
|
|
|
if (ctxpopup_it->list_item)
|
|
|
|
{
|
|
|
|
efl_unref(ctxpopup_it->list_item);
|
|
|
|
elm_wdg_item_del(ctxpopup_it->list_item);
|
|
|
|
ctxpopup_it->list_item = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2014-09-27 22:14:47 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_ctxpopup_item_elm_widget_item_signal_emit(Eo *eo_ctxpopup_it EINA_UNUSED,
|
|
|
|
Elm_Ctxpopup_Item_Data *ctxpopup_it,
|
|
|
|
const char *emission,
|
|
|
|
const char *source)
|
2011-11-16 18:16:38 -08:00
|
|
|
{
|
2012-03-22 03:14:58 -07:00
|
|
|
elm_object_item_signal_emit(ctxpopup_it->list_item, emission, source);
|
2011-11-16 18:16:38 -08:00
|
|
|
}
|
|
|
|
|
2015-05-19 05:21:06 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_ctxpopup_item_elm_widget_item_focus_set(Eo *eo_ctxpopup_it EINA_UNUSED,
|
|
|
|
Elm_Ctxpopup_Item_Data *ctxpopup_it,
|
|
|
|
Eina_Bool focused)
|
|
|
|
{
|
|
|
|
elm_object_item_focus_set(ctxpopup_it->list_item, focused);
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elm_ctxpopup_item_elm_widget_item_focus_get(Eo *eo_ctxpopup_it EINA_UNUSED,
|
|
|
|
Elm_Ctxpopup_Item_Data *ctxpopup_it)
|
|
|
|
{
|
|
|
|
return elm_object_item_focus_get(ctxpopup_it->list_item);
|
|
|
|
}
|
|
|
|
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_bg_clicked_cb(void *data,
|
2014-01-06 06:30:02 -08:00
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
const char *emission EINA_UNUSED,
|
|
|
|
const char *source EINA_UNUSED)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(data, sd);
|
|
|
|
|
2016-06-07 03:50:50 -07:00
|
|
|
if (sd->auto_hide)
|
|
|
|
_hide_signals_emit(data, sd->dir);
|
2010-10-19 13:21:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-01-06 06:30:02 -08:00
|
|
|
_on_show(void *data EINA_UNUSED,
|
|
|
|
Evas *e EINA_UNUSED,
|
2012-08-30 09:45:51 -07:00
|
|
|
Evas_Object *obj,
|
2014-01-06 06:30:02 -08:00
|
|
|
void *event_info EINA_UNUSED)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
2012-03-22 03:14:58 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (sd->list)
|
2012-03-22 03:14:58 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_list_go(sd->list);
|
|
|
|
sd->visible = EINA_TRUE;
|
2014-03-31 10:50:53 -07:00
|
|
|
/*
|
|
|
|
* XXX: Giving focus to the list when it has nothing selected makes
|
|
|
|
* it select the first of its items, which makes the popup in
|
|
|
|
* Terminology never open and instead just trigger the first option.
|
2015-10-28 10:06:29 -07:00
|
|
|
* I'll let as an exercise to the reader to figure out why that
|
2014-03-31 10:50:53 -07:00
|
|
|
* is so fucking annoying. Extra points for noting why this is my
|
|
|
|
* choice of a "fix" instead of fixing the actual focus/select issue
|
|
|
|
* that seems to be spread all over Elementary.
|
|
|
|
*/
|
|
|
|
//elm_object_focus_set(sd->list, EINA_TRUE);
|
2012-03-22 03:14:58 -07:00
|
|
|
return;
|
|
|
|
}
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (!sd->content) return;
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2013-10-16 04:17:57 -07:00
|
|
|
sd->emitted = EINA_FALSE;
|
2012-08-30 09:45:51 -07:00
|
|
|
sd->visible = EINA_TRUE;
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2013-10-16 04:17:57 -07:00
|
|
|
_show_signals_emit(obj, sd->dir);
|
2012-08-30 09:45:51 -07:00
|
|
|
|
|
|
|
elm_layout_sizing_eval(obj);
|
2016-02-17 12:56:50 -08:00
|
|
|
/*
|
|
|
|
* XXX: see above comment, but for any swallowed list-type object
|
|
|
|
*/
|
|
|
|
//elm_object_focus_set(obj, EINA_TRUE);
|
2010-10-19 13:21:53 -07:00
|
|
|
}
|
|
|
|
|
2012-02-01 03:26:25 -08:00
|
|
|
static void
|
2014-01-06 06:30:02 -08:00
|
|
|
_on_hide(void *data EINA_UNUSED,
|
|
|
|
Evas *e EINA_UNUSED,
|
2012-08-30 09:45:51 -07:00
|
|
|
Evas_Object *obj,
|
2014-01-06 06:30:02 -08:00
|
|
|
void *event_info EINA_UNUSED)
|
2012-02-01 03:26:25 -08:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (!sd->visible) return;
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
sd->visible = EINA_FALSE;
|
|
|
|
sd->list_visible = EINA_FALSE;
|
2010-10-19 13:21:53 -07:00
|
|
|
}
|
|
|
|
|
2011-12-15 21:27:11 -08:00
|
|
|
static void
|
2014-01-06 06:30:02 -08:00
|
|
|
_on_move(void *data EINA_UNUSED,
|
|
|
|
Evas *e EINA_UNUSED,
|
2012-08-30 09:45:51 -07:00
|
|
|
Evas_Object *obj,
|
2014-01-06 06:30:02 -08:00
|
|
|
void *event_info EINA_UNUSED)
|
2011-12-15 21:27:11 -08:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_layout_sizing_eval(obj);
|
2011-12-15 21:27:11 -08:00
|
|
|
}
|
|
|
|
|
2010-10-19 13:21:53 -07:00
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_hide_finished_cb(void *data,
|
2014-01-06 06:30:02 -08:00
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
const char *emission EINA_UNUSED,
|
|
|
|
const char *source EINA_UNUSED)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
evas_object_hide(data);
|
2016-08-22 15:40:39 -07:00
|
|
|
efl_event_callback_legacy_call(data, ELM_CTXPOPUP_EVENT_DISMISSED, NULL);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_list_resize_cb(void *data,
|
2014-01-06 06:30:02 -08:00
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(data, sd);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (!sd->visible) return;
|
|
|
|
if (sd->list_visible) return;
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
sd->list_visible = EINA_TRUE;
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_layout_sizing_eval(data);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-04-22 05:51:46 -07:00
|
|
|
_list_del(Elm_Ctxpopup_Data *sd)
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
{
|
2014-01-21 17:38:55 -08:00
|
|
|
ELM_SAFE_FREE(sd->list, evas_object_del);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
}
|
|
|
|
|
2014-09-17 06:44:05 -07:00
|
|
|
EOLIAN static void
|
2016-08-10 07:23:04 -07:00
|
|
|
_elm_ctxpopup_item_efl_object_destructor(Eo *eo_ctxpopup_it,
|
2014-09-17 06:44:05 -07:00
|
|
|
Elm_Ctxpopup_Item_Data *ctxpopup_it)
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
{
|
2012-03-22 03:14:58 -07:00
|
|
|
Evas_Object *list;
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(WIDGET(ctxpopup_it), sd);
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
|
2012-03-22 03:14:58 -07:00
|
|
|
list = elm_object_item_widget_get(ctxpopup_it->list_item);
|
|
|
|
|
2014-09-17 06:44:05 -07:00
|
|
|
if (ctxpopup_it->list_item)
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_unref(ctxpopup_it->list_item);
|
2014-09-17 06:44:05 -07:00
|
|
|
sd->items = eina_list_remove(sd->items, eo_ctxpopup_it);
|
|
|
|
if (list && eina_list_count(elm_list_items_get(list)) < 2)
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
{
|
|
|
|
evas_object_hide(WIDGET(ctxpopup_it));
|
2014-09-17 06:44:05 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (sd->list_visible) elm_layout_sizing_eval(WIDGET(ctxpopup_it));
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
}
|
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_destructor(efl_super(eo_ctxpopup_it, ELM_CTXPOPUP_ITEM_CLASS));
|
2012-08-30 09:45:51 -07:00
|
|
|
}
|
|
|
|
|
2014-03-20 06:06:33 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2017-08-23 22:06:32 -07:00
|
|
|
_elm_ctxpopup_elm_widget_on_disabled_update(Eo *obj, Elm_Ctxpopup_Data *sd, Eina_Bool disabled)
|
2012-08-30 09:45:51 -07:00
|
|
|
{
|
2017-08-23 22:06:32 -07:00
|
|
|
if (!elm_obj_widget_on_disabled_update(efl_super(obj, MY_CLASS), disabled))
|
|
|
|
return EINA_FALSE;
|
2012-11-25 22:32:53 -08:00
|
|
|
|
2017-08-23 22:06:32 -07:00
|
|
|
elm_object_disabled_set(sd->list ?: sd->content, disabled);
|
2012-01-27 03:56:14 -08:00
|
|
|
|
2014-03-20 06:06:33 -07:00
|
|
|
return EINA_TRUE;
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
}
|
|
|
|
|
2014-03-20 06:06:33 -07:00
|
|
|
EOLIAN static void
|
2016-06-17 01:26:08 -07:00
|
|
|
_elm_ctxpopup_efl_canvas_group_group_add(Eo *obj, Elm_Ctxpopup_Data *priv)
|
2012-03-14 06:03:38 -07:00
|
|
|
{
|
2014-01-14 21:42:13 -08:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
2012-08-30 09:45:51 -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);
|
2013-08-26 08:29:45 -07:00
|
|
|
|
2013-03-01 18:04:31 -08:00
|
|
|
if (!elm_layout_theme_set
|
|
|
|
(obj, "ctxpopup", "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
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_layout_signal_callback_add
|
2013-10-05 05:35:27 -07:00
|
|
|
(obj, "elm,action,hide,finished", "*", _hide_finished_cb, obj);
|
2012-08-30 09:45:51 -07:00
|
|
|
|
|
|
|
//Background
|
|
|
|
priv->bg = edje_object_add(evas_object_evas_get(obj));
|
|
|
|
elm_widget_theme_object_set(obj, priv->bg, "ctxpopup", "bg", "default");
|
|
|
|
edje_object_signal_callback_add
|
2013-10-05 05:35:27 -07:00
|
|
|
(priv->bg, "elm,action,click", "*", _bg_clicked_cb, obj);
|
2014-01-14 21:42:13 -08:00
|
|
|
evas_object_smart_member_add(priv->bg, obj);
|
|
|
|
evas_object_stack_below(priv->bg, wd->resize_obj);
|
2012-03-14 06:03:38 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
//Arrow
|
|
|
|
priv->arrow = edje_object_add(evas_object_evas_get(obj));
|
|
|
|
elm_widget_theme_object_set
|
|
|
|
(obj, priv->arrow, "ctxpopup", "arrow", "default");
|
2014-01-14 21:42:13 -08:00
|
|
|
evas_object_smart_member_add(priv->arrow, obj);
|
2012-08-30 09:45:51 -07:00
|
|
|
|
|
|
|
priv->dir_priority[0] = ELM_CTXPOPUP_DIRECTION_UP;
|
|
|
|
priv->dir_priority[1] = ELM_CTXPOPUP_DIRECTION_LEFT;
|
|
|
|
priv->dir_priority[2] = ELM_CTXPOPUP_DIRECTION_RIGHT;
|
|
|
|
priv->dir_priority[3] = ELM_CTXPOPUP_DIRECTION_DOWN;
|
|
|
|
priv->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
|
2014-02-09 01:11:47 -08:00
|
|
|
priv->auto_hide = EINA_TRUE;
|
2012-08-30 09:45:51 -07:00
|
|
|
|
|
|
|
priv->box = elm_box_add(obj);
|
|
|
|
evas_object_size_hint_weight_set
|
|
|
|
(priv->box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
|
|
|
|
evas_object_event_callback_add
|
|
|
|
(priv->box, EVAS_CALLBACK_RESIZE, _on_content_resized, obj);
|
|
|
|
|
|
|
|
/* box will be our content placeholder, thus the parent's version call */
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_content_set(efl_part(efl_super(obj, MY_CLASS), "elm.swallow.content"), priv->box);
|
2012-08-30 09:45:51 -07:00
|
|
|
|
|
|
|
evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _on_show, NULL);
|
|
|
|
evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _on_hide, NULL);
|
|
|
|
evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, _on_move, NULL);
|
|
|
|
|
|
|
|
elm_widget_can_focus_set(obj, EINA_TRUE);
|
2012-03-14 06:03:38 -07:00
|
|
|
}
|
|
|
|
|
2014-03-20 06:06:33 -07:00
|
|
|
EOLIAN static void
|
2016-06-17 01:26:08 -07:00
|
|
|
_elm_ctxpopup_efl_canvas_group_group_del(Eo *obj, Elm_Ctxpopup_Data *sd)
|
2012-03-14 06:03:38 -07:00
|
|
|
{
|
2014-09-27 22:14:47 -07:00
|
|
|
Elm_Object_Item *it;
|
2012-08-30 09:45:51 -07:00
|
|
|
|
|
|
|
evas_object_event_callback_del_full
|
|
|
|
(sd->box, EVAS_CALLBACK_RESIZE, _on_content_resized, obj);
|
|
|
|
_parent_detach(obj);
|
|
|
|
|
|
|
|
elm_ctxpopup_clear(obj);
|
2014-01-21 17:38:55 -08:00
|
|
|
ELM_SAFE_FREE(sd->arrow, evas_object_del); /* stops _sizing_eval() from going on on deletion */
|
|
|
|
ELM_SAFE_FREE(sd->bg, evas_object_del);
|
2012-08-30 09:45:51 -07:00
|
|
|
|
2013-03-08 20:23:42 -08:00
|
|
|
EINA_LIST_FREE(sd->items, it)
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_del(it);
|
2013-01-18 01:07:03 -08:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_canvas_group_del(efl_super(obj, MY_CLASS));
|
2012-03-14 06:03:38 -07:00
|
|
|
}
|
|
|
|
|
2014-03-20 06:06:33 -07:00
|
|
|
EOLIAN static void
|
2016-04-11 09:51:15 -07:00
|
|
|
_elm_ctxpopup_elm_widget_widget_parent_set(Eo *obj, Elm_Ctxpopup_Data *_pd EINA_UNUSED, Evas_Object *parent)
|
2012-03-14 06:03:38 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
//default parent is to be hover parent
|
|
|
|
elm_ctxpopup_hover_parent_set(obj, parent);
|
2012-03-14 06:03:38 -07:00
|
|
|
}
|
|
|
|
|
2010-12-08 08:18:30 -08:00
|
|
|
EAPI Evas_Object *
|
|
|
|
elm_ctxpopup_add(Evas_Object *parent)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
2017-07-06 00:47:41 -07:00
|
|
|
Evas_Object *obj = efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
|
2013-02-14 01:20:54 -08:00
|
|
|
|
|
|
|
/* access: parent could be any object such as elm_list which does
|
|
|
|
not know elc_ctxpopup as its child object in the focus_next(); */
|
2013-10-05 01:11:57 -07:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
|
2013-02-14 01:20:54 -08:00
|
|
|
wd->highlight_root = EINA_TRUE;
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
return obj;
|
|
|
|
}
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2015-05-19 05:34:07 -07:00
|
|
|
EOLIAN static Eo *
|
2016-08-10 07:23:04 -07:00
|
|
|
_elm_ctxpopup_efl_object_constructor(Eo *obj, Elm_Ctxpopup_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_POPUP_MENU);
|
2015-05-19 05:34:07 -07:00
|
|
|
|
|
|
|
return obj;
|
2010-10-19 13:21:53 -07:00
|
|
|
}
|
|
|
|
|
2014-03-20 06:06:33 -07:00
|
|
|
EOLIAN static void
|
2014-04-22 05:51:46 -07:00
|
|
|
_elm_ctxpopup_hover_parent_set(Eo *obj, Elm_Ctxpopup_Data *sd, Evas_Object *parent)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
2011-08-29 08:59:56 -07:00
|
|
|
Evas_Coord x, y, w, h;
|
2010-12-03 06:08:33 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (!parent) return;
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
_parent_detach(obj);
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
evas_object_event_callback_add
|
|
|
|
(parent, EVAS_CALLBACK_DEL, _on_parent_del, obj);
|
|
|
|
evas_object_event_callback_add
|
|
|
|
(parent, EVAS_CALLBACK_MOVE, _on_parent_move, obj);
|
|
|
|
evas_object_event_callback_add
|
|
|
|
(parent, EVAS_CALLBACK_RESIZE, _on_parent_resize, obj);
|
|
|
|
|
|
|
|
sd->parent = parent;
|
2011-08-29 08:28:05 -07:00
|
|
|
|
2011-09-01 21:09:17 -07:00
|
|
|
//Update Background
|
2011-08-29 09:05:24 -07:00
|
|
|
evas_object_geometry_get(parent, &x, &y, &w, &h);
|
2016-08-15 06:44:41 -07:00
|
|
|
if (parent && efl_isa(parent, EFL_UI_WIN_CLASS))
|
2013-03-29 05:29:24 -07:00
|
|
|
x = y = 0;
|
2012-08-30 09:45:51 -07:00
|
|
|
evas_object_move(sd->bg, x, y);
|
|
|
|
evas_object_resize(sd->bg, w, h);
|
2011-08-29 08:59:56 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (sd->visible) elm_layout_sizing_eval(obj);
|
2010-10-19 13:21:53 -07:00
|
|
|
}
|
|
|
|
|
2014-03-20 06:06:33 -07:00
|
|
|
EOLIAN static Evas_Object*
|
2014-04-22 05:51:46 -07:00
|
|
|
_elm_ctxpopup_hover_parent_get(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
2014-03-20 06:06:33 -07:00
|
|
|
return sd->parent;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2014-03-20 06:06:33 -07:00
|
|
|
EOLIAN static void
|
2014-04-22 05:51:46 -07:00
|
|
|
_elm_ctxpopup_clear(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
_list_del(sd);
|
|
|
|
sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
|
2010-10-19 13:21:53 -07:00
|
|
|
}
|
|
|
|
|
2017-08-09 22:55:30 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_ctxpopup_horizontal_set(Eo *obj, Elm_Ctxpopup_Data *sd, Eina_Bool horizontal)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
2017-08-09 22:55:30 -07:00
|
|
|
sd->horizontal = !!horizontal;
|
|
|
|
|
|
|
|
if (!sd->list) return;
|
|
|
|
|
|
|
|
elm_list_horizontal_set(sd->list, sd->horizontal);
|
|
|
|
|
|
|
|
sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
|
|
|
|
|
|
|
|
if (sd->visible) elm_layout_sizing_eval(obj);
|
2010-10-19 13:21:53 -07:00
|
|
|
}
|
|
|
|
|
2017-08-09 22:55:30 -07:00
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elm_ctxpopup_horizontal_get(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2017-08-09 22:55:30 -07:00
|
|
|
return sd->horizontal;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2016-11-29 23:18:46 -08:00
|
|
|
EAPI const Eina_List *
|
|
|
|
elm_ctxpopup_items_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Eina_List *lst = NULL;
|
|
|
|
Eina_Iterator *it;
|
|
|
|
void *item_data;
|
|
|
|
|
|
|
|
it = efl_ui_menu_items_get(obj);
|
|
|
|
EINA_ITERATOR_FOREACH(it, item_data)
|
|
|
|
{
|
|
|
|
lst = eina_list_append(lst, item_data);
|
|
|
|
}
|
|
|
|
eina_iterator_free(it);
|
|
|
|
return lst;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Elm_Widget_Item *
|
|
|
|
elm_ctxpopup_first_item_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
return efl_ui_menu_first_item_get(obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Elm_Widget_Item *
|
|
|
|
elm_ctxpopup_last_item_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
return efl_ui_menu_last_item_get(obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Elm_Widget_Item *
|
|
|
|
elm_ctxpopup_item_prev_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
return efl_ui_item_prev_get(obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Elm_Widget_Item *
|
|
|
|
elm_ctxpopup_item_next_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
return efl_ui_item_next_get(obj);
|
|
|
|
}
|
|
|
|
|
2013-01-18 01:07:03 -08:00
|
|
|
static void
|
2014-01-06 06:30:02 -08:00
|
|
|
_item_wrap_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
2013-01-18 01:07:03 -08:00
|
|
|
{
|
2014-09-27 22:14:47 -07:00
|
|
|
Elm_Ctxpopup_Item_Data *item = data;
|
2016-11-30 18:28:04 -08:00
|
|
|
Elm_Object_Item *eo_item2;
|
2016-11-29 23:18:46 -08:00
|
|
|
Eina_List *l;
|
|
|
|
|
|
|
|
ELM_CTXPOPUP_DATA_GET_OR_RETURN(item->wcb.cobj, sd);
|
2016-11-30 18:28:04 -08:00
|
|
|
EINA_LIST_FOREACH(sd->items, l, eo_item2)
|
2016-11-29 23:18:46 -08:00
|
|
|
{
|
2016-11-30 18:28:04 -08:00
|
|
|
ELM_CTXPOPUP_ITEM_DATA_GET(eo_item2, item2);
|
|
|
|
item2->selected = EINA_FALSE;
|
2016-11-29 23:18:46 -08:00
|
|
|
}
|
|
|
|
item->selected = EINA_TRUE;
|
|
|
|
|
2013-05-02 04:25:42 -07:00
|
|
|
if (!item->wcb.org_func_cb) return;
|
2014-09-27 22:14:47 -07:00
|
|
|
item->wcb.org_func_cb((void *)item->wcb.org_data, item->wcb.cobj, EO_OBJ(item));
|
|
|
|
}
|
|
|
|
|
2015-05-19 05:34:07 -07:00
|
|
|
EOLIAN static Eo *
|
2016-08-10 07:23:04 -07:00
|
|
|
_elm_ctxpopup_item_efl_object_constructor(Eo *obj, Elm_Ctxpopup_Item_Data *it)
|
2014-09-27 22:14:47 -07:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
obj = efl_constructor(efl_super(obj, ELM_CTXPOPUP_ITEM_CLASS));
|
|
|
|
it->base = efl_data_scope_get(obj, ELM_WIDGET_ITEM_CLASS);
|
2015-05-19 05:34:07 -07:00
|
|
|
|
|
|
|
return obj;
|
2013-01-18 01:07:03 -08:00
|
|
|
}
|
|
|
|
|
2017-08-09 22:12:08 -07:00
|
|
|
EOLIAN static Elm_Object_Item*
|
|
|
|
_elm_ctxpopup_item_insert_before(Eo *obj, Elm_Ctxpopup_Data *sd, Elm_Object_Item *eo_before, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data)
|
|
|
|
{
|
|
|
|
Eo *eo_item;
|
|
|
|
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(eo_before, NULL);
|
|
|
|
ELM_CTXPOPUP_ITEM_DATA_GET(eo_before, before_it);
|
|
|
|
ELM_CTXPOPUP_ITEM_CHECK_OR_RETURN(before_it, NULL);
|
|
|
|
|
|
|
|
if (!before_it->list_item) return NULL;
|
|
|
|
|
|
|
|
eo_item = efl_add(ELM_CTXPOPUP_ITEM_CLASS, obj, elm_obj_ctxpopup_item_init(efl_added, func, data));
|
|
|
|
if (!eo_item) return NULL;
|
|
|
|
|
|
|
|
ELM_CTXPOPUP_ITEM_DATA_GET(eo_item, item);
|
|
|
|
|
|
|
|
item->list_item =
|
|
|
|
elm_list_item_insert_before(sd->list, before_it->list_item, label, icon, NULL, _item_wrap_cb, item);
|
|
|
|
efl_ref(item->list_item);
|
|
|
|
sd->items = eina_list_prepend_relative(sd->items, eo_item, eo_before);
|
|
|
|
|
|
|
|
if (sd->visible) elm_layout_sizing_eval(obj);
|
|
|
|
|
|
|
|
return eo_item;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Elm_Object_Item*
|
|
|
|
_elm_ctxpopup_item_insert_after(Eo *obj, Elm_Ctxpopup_Data *sd, Elm_Object_Item *eo_after, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data)
|
|
|
|
{
|
|
|
|
Eo *eo_item;
|
|
|
|
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(eo_after, NULL);
|
|
|
|
ELM_CTXPOPUP_ITEM_DATA_GET(eo_after, after_it);
|
|
|
|
ELM_CTXPOPUP_ITEM_CHECK_OR_RETURN(after_it, NULL);
|
|
|
|
|
|
|
|
if (!after_it->list_item) return NULL;
|
|
|
|
|
|
|
|
eo_item = efl_add(ELM_CTXPOPUP_ITEM_CLASS, obj, elm_obj_ctxpopup_item_init(efl_added, func, data));
|
|
|
|
if (!eo_item) return NULL;
|
|
|
|
|
|
|
|
ELM_CTXPOPUP_ITEM_DATA_GET(eo_item, item);
|
|
|
|
|
|
|
|
item->list_item =
|
|
|
|
elm_list_item_insert_after(sd->list, after_it->list_item, label, icon, NULL, _item_wrap_cb, item);
|
|
|
|
efl_ref(item->list_item);
|
|
|
|
sd->items = eina_list_append_relative(sd->items, eo_item, eo_after);
|
|
|
|
|
|
|
|
if (sd->visible) elm_layout_sizing_eval(obj);
|
|
|
|
|
|
|
|
return eo_item;
|
|
|
|
}
|
|
|
|
|
2014-03-20 06:06:33 -07:00
|
|
|
EOLIAN static Elm_Object_Item*
|
2014-04-22 05:51:46 -07:00
|
|
|
_elm_ctxpopup_item_append(Eo *obj, Elm_Ctxpopup_Data *sd, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-09-27 22:14:47 -07:00
|
|
|
Eo *eo_item;
|
|
|
|
|
2016-09-05 08:57:35 -07:00
|
|
|
eo_item = efl_add(ELM_CTXPOPUP_ITEM_CLASS, obj, elm_obj_ctxpopup_item_init(efl_added, func, data));
|
2014-09-27 22:14:47 -07:00
|
|
|
if (!eo_item) return NULL;
|
2012-11-25 22:32:53 -08:00
|
|
|
|
2014-09-27 22:14:47 -07:00
|
|
|
ELM_CTXPOPUP_ITEM_DATA_GET(eo_item, item);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
item->list_item =
|
2013-01-18 01:07:03 -08:00
|
|
|
elm_list_item_append(sd->list, label, icon, NULL, _item_wrap_cb, item);
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_ref(item->list_item);
|
2014-09-27 22:14:47 -07:00
|
|
|
sd->items = eina_list_append(sd->items, eo_item);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (sd->visible) elm_layout_sizing_eval(obj);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2014-08-19 00:52:24 -07:00
|
|
|
return eo_item;
|
2010-10-19 13:21:53 -07:00
|
|
|
}
|
|
|
|
|
2014-03-20 06:06:33 -07:00
|
|
|
EOLIAN static void
|
2014-04-22 05:51:46 -07:00
|
|
|
_elm_ctxpopup_direction_priority_set(Eo *obj, Elm_Ctxpopup_Data *sd, Elm_Ctxpopup_Direction first, Elm_Ctxpopup_Direction second, Elm_Ctxpopup_Direction third, Elm_Ctxpopup_Direction fourth)
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
sd->dir_priority[0] = first;
|
|
|
|
sd->dir_priority[1] = second;
|
|
|
|
sd->dir_priority[2] = third;
|
|
|
|
sd->dir_priority[3] = fourth;
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (sd->visible) elm_layout_sizing_eval(obj);
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
}
|
|
|
|
|
2014-03-20 06:06:33 -07:00
|
|
|
EOLIAN static void
|
2014-04-22 05:51:46 -07:00
|
|
|
_elm_ctxpopup_direction_priority_get(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd, Elm_Ctxpopup_Direction *first, Elm_Ctxpopup_Direction *second, Elm_Ctxpopup_Direction *third, Elm_Ctxpopup_Direction *fourth)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
if (first) *first = sd->dir_priority[0];
|
|
|
|
if (second) *second = sd->dir_priority[1];
|
|
|
|
if (third) *third = sd->dir_priority[2];
|
|
|
|
if (fourth) *fourth = sd->dir_priority[3];
|
From: ChunEon Park <chuneon.park@samsung.com>
Subject: [PATCH] elc_ctxpopup
Here code is for the ctxpopup.
Since the functionalities of ctxpopup are somewhat different,
I'm trying to overwrite the ctxpopup code entirely first.
The main reason is,
Original ctxpopup could determine it's size and position by itself.
Of course, upstreamed version supports this. But it can not be reduced
it's
size
And it supposes the arrow position to center of box edje.
Basically,
This version calculates it's box size first then find available space
from
the it's position.
The origin position of the box is not expected, it finds the available
positions.
But if there is not enough space to be shown, then it finds a best
direction
to be shown again.
In this case, it reduces it's size also as to be shown entirely.
Since the ctxpopup supports scroller, the reduced box could show the all
items also.
(The point is ctxpopup should know the size of total items...)
I'm not sure the upstreamed version could cover the above scenario,
If then, I need to modify it first.
(fixed some minor formatting issue too)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
}
|
2011-08-28 00:12:16 -07:00
|
|
|
|
2014-03-20 06:06:33 -07:00
|
|
|
EOLIAN static Elm_Ctxpopup_Direction
|
2014-04-22 05:51:46 -07:00
|
|
|
_elm_ctxpopup_direction_get(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd)
|
2012-03-06 21:58:38 -08:00
|
|
|
{
|
2014-03-20 06:06:33 -07:00
|
|
|
return sd->dir;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-20 06:06:33 -07:00
|
|
|
EOLIAN static void
|
2014-04-22 05:51:46 -07:00
|
|
|
_elm_ctxpopup_dismiss(Eo *obj, Elm_Ctxpopup_Data *sd)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
_hide_signals_emit(obj, sd->dir);
|
2012-03-06 21:58:38 -08:00
|
|
|
}
|
2012-11-25 22:32:53 -08:00
|
|
|
|
2014-03-20 06:06:33 -07:00
|
|
|
EOLIAN static void
|
2014-04-22 05:51:46 -07:00
|
|
|
_elm_ctxpopup_auto_hide_disabled_set(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd, Eina_Bool disabled)
|
2014-02-09 01:11:47 -08:00
|
|
|
{
|
|
|
|
if (sd->auto_hide == !disabled) return;
|
|
|
|
sd->auto_hide = !disabled;
|
|
|
|
}
|
|
|
|
|
2014-03-20 06:06:33 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2014-04-22 05:51:46 -07:00
|
|
|
_elm_ctxpopup_auto_hide_disabled_get(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd)
|
2014-02-09 01:11:47 -08:00
|
|
|
{
|
2016-04-10 04:55:05 -07:00
|
|
|
return !sd->auto_hide;
|
2014-02-09 01:11:47 -08:00
|
|
|
}
|
|
|
|
|
2014-03-20 06:06:33 -07:00
|
|
|
EOLIAN static void
|
2016-08-10 07:23:04 -07:00
|
|
|
_elm_ctxpopup_class_constructor(Efl_Class *klass)
|
2014-02-09 01:11:47 -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-20 06:06:33 -07:00
|
|
|
|
2016-11-29 23:18:46 -08:00
|
|
|
EOLIAN static Eina_Iterator*
|
|
|
|
_elm_ctxpopup_efl_ui_menu_items_get(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd)
|
2014-07-03 04:05:28 -07:00
|
|
|
{
|
2016-11-29 23:18:46 -08:00
|
|
|
return eina_list_iterator_new(sd->items);
|
2014-07-03 04:05:28 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Elm_Object_Item*
|
2016-11-29 23:18:46 -08:00
|
|
|
_elm_ctxpopup_efl_ui_menu_first_item_get(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd)
|
2014-07-03 04:05:28 -07:00
|
|
|
{
|
|
|
|
if (!sd->items) return NULL;
|
|
|
|
|
|
|
|
return eina_list_data_get(sd->items);
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Elm_Object_Item*
|
2016-11-29 23:18:46 -08:00
|
|
|
_elm_ctxpopup_efl_ui_menu_last_item_get(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd)
|
2014-07-03 04:05:28 -07:00
|
|
|
{
|
|
|
|
if (!sd->items) return NULL;
|
|
|
|
|
|
|
|
return eina_list_data_get(eina_list_last(sd->items));
|
|
|
|
}
|
|
|
|
|
2016-11-29 23:18:46 -08:00
|
|
|
EOLIAN static Elm_Object_Item*
|
|
|
|
_elm_ctxpopup_efl_ui_menu_selected_item_get(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd)
|
|
|
|
{
|
|
|
|
Eina_List *l;
|
|
|
|
Elm_Object_Item *eo_item;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(sd->items, l, eo_item)
|
|
|
|
{
|
|
|
|
ELM_CTXPOPUP_ITEM_DATA_GET(eo_item, item);
|
|
|
|
if (item->selected) return eo_item;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2014-07-03 04:05:28 -07:00
|
|
|
EOLIAN static Elm_Object_Item*
|
|
|
|
_elm_ctxpopup_item_prepend(Eo *obj, Elm_Ctxpopup_Data *sd, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data)
|
|
|
|
{
|
2014-09-27 22:14:47 -07:00
|
|
|
Eo *eo_item;
|
2014-07-03 04:05:28 -07:00
|
|
|
|
2016-09-05 08:57:35 -07:00
|
|
|
eo_item = efl_add(ELM_CTXPOPUP_ITEM_CLASS, obj, elm_obj_ctxpopup_item_init(efl_added, func, data));
|
2014-09-27 22:14:47 -07:00
|
|
|
if (!eo_item) return NULL;
|
|
|
|
|
|
|
|
ELM_CTXPOPUP_ITEM_DATA_GET(eo_item, item);
|
2014-07-03 04:05:28 -07:00
|
|
|
|
|
|
|
item->list_item =
|
|
|
|
elm_list_item_prepend(sd->list, label, icon, NULL, _item_wrap_cb, item);
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_ref(item->list_item);
|
2014-09-27 22:14:47 -07:00
|
|
|
sd->items = eina_list_prepend(sd->items, eo_item);
|
2014-07-03 04:05:28 -07:00
|
|
|
|
|
|
|
if (sd->visible) elm_layout_sizing_eval(obj);
|
|
|
|
|
2014-08-19 00:52:24 -07:00
|
|
|
return eo_item;
|
2014-07-03 04:05:28 -07:00
|
|
|
}
|
|
|
|
|
2014-09-27 22:14:47 -07:00
|
|
|
EOLIAN static Elm_Object_Item *
|
2016-11-29 23:18:46 -08:00
|
|
|
_elm_ctxpopup_item_efl_ui_item_prev_get(Eo *eo_item EINA_UNUSED, Elm_Ctxpopup_Item_Data *item)
|
2014-07-03 04:05:28 -07:00
|
|
|
{
|
|
|
|
Eina_List *l;
|
|
|
|
|
|
|
|
ELM_CTXPOPUP_DATA_GET(WIDGET(item), sd);
|
|
|
|
|
|
|
|
if (!sd->items) return NULL;
|
|
|
|
|
2014-09-27 22:14:47 -07:00
|
|
|
l = eina_list_data_find_list(sd->items, eo_item);
|
2014-07-03 04:05:28 -07:00
|
|
|
if (l && l->prev) return eina_list_data_get(l->prev);
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2014-09-27 22:14:47 -07:00
|
|
|
EOLIAN static Elm_Object_Item *
|
2016-11-29 23:18:46 -08:00
|
|
|
_elm_ctxpopup_item_efl_ui_item_next_get(Eo *eo_item EINA_UNUSED, Elm_Ctxpopup_Item_Data *item)
|
2014-07-03 04:05:28 -07:00
|
|
|
{
|
|
|
|
Eina_List *l;
|
|
|
|
|
|
|
|
ELM_CTXPOPUP_DATA_GET(WIDGET(item), sd);
|
|
|
|
|
|
|
|
if (!sd->items) return NULL;
|
|
|
|
|
2014-09-27 22:14:47 -07:00
|
|
|
l = eina_list_data_find_list(sd->items, eo_item);
|
2014-07-03 04:05:28 -07:00
|
|
|
if (l && l->next) return eina_list_data_get(l->next);
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2016-11-29 23:18:46 -08:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_ctxpopup_item_efl_ui_item_selected_set(Eo *eo_item EINA_UNUSED,
|
2016-11-30 18:28:04 -08:00
|
|
|
Elm_Ctxpopup_Item_Data *item,
|
|
|
|
Eina_Bool selected)
|
2016-11-29 23:18:46 -08:00
|
|
|
{
|
2016-11-30 18:28:04 -08:00
|
|
|
Elm_Object_Item *eo_item2;
|
2016-11-29 23:18:46 -08:00
|
|
|
Eina_List *l;
|
|
|
|
|
|
|
|
if (selected == item->selected) return;
|
|
|
|
|
|
|
|
if (selected)
|
|
|
|
{
|
|
|
|
ELM_CTXPOPUP_DATA_GET_OR_RETURN(item->wcb.cobj, sd);
|
2016-11-30 18:28:04 -08:00
|
|
|
EINA_LIST_FOREACH(sd->items, l, eo_item2)
|
2016-11-29 23:18:46 -08:00
|
|
|
{
|
2016-11-30 18:28:04 -08:00
|
|
|
ELM_CTXPOPUP_ITEM_DATA_GET(eo_item2, item2);
|
|
|
|
item2->selected = EINA_FALSE;
|
2016-11-29 23:18:46 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
elm_list_item_selected_set(item->list_item, selected);
|
|
|
|
item->selected = selected;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elm_ctxpopup_item_efl_ui_item_selected_get(Eo *eo_item EINA_UNUSED, Elm_Ctxpopup_Item_Data *item)
|
|
|
|
{
|
|
|
|
return item->selected;
|
|
|
|
}
|
|
|
|
|
2014-09-27 22:14:47 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_ctxpopup_item_init(Eo *eo_item,
|
|
|
|
Elm_Ctxpopup_Item_Data *item,
|
2014-07-03 04:05:28 -07:00
|
|
|
Evas_Smart_Cb func,
|
|
|
|
const void *data)
|
|
|
|
{
|
2015-02-23 09:12:35 -08:00
|
|
|
Eo *obj;
|
2016-08-10 07:23:04 -07:00
|
|
|
obj = efl_parent_get(eo_item);
|
2016-08-15 06:44:41 -07:00
|
|
|
Elm_Ctxpopup_Data *sd = efl_data_scope_get(obj, ELM_CTXPOPUP_CLASS);
|
2014-07-03 04:05:28 -07:00
|
|
|
if (!sd->list)
|
|
|
|
{
|
|
|
|
sd->list = elm_list_add(obj);
|
|
|
|
if (!strncmp(elm_object_style_get(obj), "default", strlen("default")))
|
|
|
|
elm_object_style_set(sd->list, "ctxpopup");
|
|
|
|
else elm_object_style_set(sd->list, elm_object_style_get(obj));
|
|
|
|
elm_list_mode_set(sd->list, ELM_LIST_EXPAND);
|
2017-08-09 22:55:30 -07:00
|
|
|
elm_list_horizontal_set(sd->list, sd->horizontal);
|
2014-07-03 04:05:28 -07:00
|
|
|
evas_object_event_callback_add
|
|
|
|
(sd->list, EVAS_CALLBACK_RESIZE, _list_resize_cb, obj);
|
|
|
|
elm_layout_content_set(obj, "default", sd->list);
|
|
|
|
}
|
|
|
|
|
|
|
|
item->wcb.org_func_cb = func;
|
|
|
|
item->wcb.org_data = data;
|
|
|
|
item->wcb.cobj = obj;
|
|
|
|
|
|
|
|
sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
|
|
|
|
}
|
|
|
|
|
2014-07-25 01:33:19 -07:00
|
|
|
EOLIAN static const Elm_Atspi_Action*
|
|
|
|
_elm_ctxpopup_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd EINA_UNUSED)
|
|
|
|
{
|
|
|
|
static Elm_Atspi_Action atspi_actions[] = {
|
2015-07-02 03:36:05 -07:00
|
|
|
{ "escape", "escape", NULL, _key_action_escape},
|
2014-07-25 01:33:19 -07:00
|
|
|
{ "move,previous", "move", "previous", _key_action_move},
|
|
|
|
{ "move,next", "move", "next", _key_action_move},
|
|
|
|
{ "move,left", "move", "left", _key_action_move},
|
|
|
|
{ "move,right", "move", "right", _key_action_move},
|
|
|
|
{ "move,up", "move", "up", _key_action_move},
|
|
|
|
{ "move,down", "move", "down", _key_action_move},
|
|
|
|
{ NULL, NULL, NULL, NULL }
|
|
|
|
};
|
|
|
|
return &atspi_actions[0];
|
|
|
|
}
|
|
|
|
|
2015-07-02 03:36:05 -07:00
|
|
|
EOLIAN static Elm_Atspi_State_Set
|
|
|
|
_elm_ctxpopup_elm_interface_atspi_accessible_state_set_get(Eo *obj, Elm_Ctxpopup_Data *sd EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Elm_Atspi_State_Set ret;
|
2016-08-15 06:44:41 -07:00
|
|
|
ret = elm_interface_atspi_accessible_state_set_get(efl_super(obj, MY_CLASS));
|
2015-07-02 03:36:05 -07:00
|
|
|
|
|
|
|
STATE_TYPE_SET(ret, ELM_ATSPI_STATE_MODAL);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2017-08-16 23:08:00 -07:00
|
|
|
/* Internal EO APIs and hidden overrides */
|
|
|
|
|
|
|
|
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_ctxpopup, Elm_Ctxpopup_Data)
|
|
|
|
|
2016-05-24 04:40:18 -07:00
|
|
|
/* Efl.Part begin */
|
|
|
|
|
2017-08-07 19:48:31 -07:00
|
|
|
ELM_PART_OVERRIDE(elm_ctxpopup, ELM_CTXPOPUP, EFL_UI_LAYOUT, Elm_Ctxpopup_Data, Elm_Part_Data)
|
|
|
|
ELM_PART_OVERRIDE_CONTENT_SET(elm_ctxpopup, ELM_CTXPOPUP, EFL_UI_LAYOUT, Elm_Ctxpopup_Data, Elm_Part_Data)
|
|
|
|
ELM_PART_OVERRIDE_CONTENT_GET(elm_ctxpopup, ELM_CTXPOPUP, EFL_UI_LAYOUT, Elm_Ctxpopup_Data, Elm_Part_Data)
|
|
|
|
ELM_PART_OVERRIDE_CONTENT_UNSET(elm_ctxpopup, ELM_CTXPOPUP, EFL_UI_LAYOUT, Elm_Ctxpopup_Data, Elm_Part_Data)
|
2017-06-29 04:02:59 -07:00
|
|
|
ELM_PART_CONTENT_DEFAULT_SET(elm_ctxpopup, "default")
|
2016-05-24 04:40:18 -07:00
|
|
|
#include "elm_ctxpopup_internal_part.eo.c"
|
|
|
|
|
|
|
|
/* Efl.Part end */
|
|
|
|
|
2017-06-29 04:02:59 -07:00
|
|
|
/* Internal EO APIs and hidden overrides */
|
|
|
|
|
|
|
|
#define ELM_CTXPOPUP_EXTRA_OPS \
|
2017-08-07 00:13:38 -07:00
|
|
|
ELM_LAYOUT_SIZING_EVAL_OPS(elm_ctxpopup), \
|
2017-06-29 04:02:59 -07:00
|
|
|
ELM_PART_CONTENT_DEFAULT_OPS(elm_ctxpopup), \
|
|
|
|
EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_ctxpopup)
|
|
|
|
|
2014-09-27 22:14:47 -07:00
|
|
|
#include "elm_ctxpopup_item.eo.c"
|
2014-08-11 07:46:11 -07:00
|
|
|
#include "elm_ctxpopup.eo.c"
|