2013-04-25 22:13:00 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "elementary_config.h"
|
|
|
|
#endif
|
|
|
|
|
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
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
EAPI Eo_Op ELM_OBJ_CTXPOPUP_BASE_ID = EO_NOOP;
|
|
|
|
|
|
|
|
#define MY_CLASS ELM_OBJ_CTXPOPUP_CLASS
|
|
|
|
|
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
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
EAPI const char ELM_CTXPOPUP_SMART_NAME[] = "elm_ctxpopup";
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2013-09-02 16:39:02 -07:00
|
|
|
#define ELM_PRIV_CTXPOPUP_SIGNALS(cmd) \
|
|
|
|
cmd(SIG_DISMISSED, "dismissed", "") \
|
|
|
|
cmd(SIG_LANG_CHANGED, "language,changed", "")
|
|
|
|
|
|
|
|
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)
|
elm: do not declare SIG_FUCSED/SIG_UNFOCUSED if the const char is not used more than once.
ctxpopup, fileselector_button, naviframe, player, popup, bubble, button, calendar, check, clock, colorselector, datetime, diskselector, flipselector, gengrid.
2013-06-09 22:05:33 -07:00
|
|
|
{"focused", ""}, /**< handled by elm_widget */
|
|
|
|
{"unfocused", ""}, /**< handled by elm_widget */
|
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
|
|
|
|
2013-02-11 22:58:05 -08:00
|
|
|
static void
|
2013-04-23 04:30:15 -07:00
|
|
|
_elm_ctxpopup_smart_translate(Eo *obj, void *_pd, va_list *list)
|
2013-02-11 22:58:05 -08:00
|
|
|
{
|
|
|
|
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
2013-04-23 04:30:15 -07:00
|
|
|
Elm_Ctxpopup_Smart_Data *sd = _pd;
|
|
|
|
Eina_List *l;
|
|
|
|
Elm_Ctxpopup_Item *it;
|
|
|
|
|
2013-02-11 22:58:05 -08:00
|
|
|
evas_object_hide(obj);
|
|
|
|
|
2013-04-23 04:30:15 -07:00
|
|
|
EINA_LIST_FOREACH(sd->items, l, it)
|
|
|
|
elm_widget_item_translate(it);
|
|
|
|
|
2013-02-11 22:58:05 -08:00
|
|
|
if (ret) *ret = EINA_TRUE;
|
|
|
|
}
|
2012-11-25 22:32:53 -08:00
|
|
|
|
|
|
|
static void
|
|
|
|
_elm_ctxpopup_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
|
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-11-25 22:32:53 -08:00
|
|
|
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
|
|
|
*ret = EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_elm_ctxpopup_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
|
|
|
|
{
|
|
|
|
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
2013-04-09 06:24:53 -07:00
|
|
|
*ret = EINA_TRUE;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_elm_ctxpopup_smart_focus_next(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
Elm_Ctxpopup_Smart_Data *sd = _pd;
|
|
|
|
|
|
|
|
Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
|
2013-04-09 06:24:53 -07:00
|
|
|
Evas_Object **next = va_arg(*list, Evas_Object **);
|
2012-11-25 22:32:53 -08:00
|
|
|
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
|
|
|
if (ret) *ret = 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
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (!sd)
|
2012-11-25 22:32:53 -08:00
|
|
|
return;
|
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
|
|
|
if (!elm_widget_focus_next_get(sd->box, dir, next))
|
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);
|
|
|
|
elm_widget_focus_next_get(sd->box, dir, next);
|
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-11-25 22:32:53 -08:00
|
|
|
if (ret) *ret = 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
|
|
|
}
|
|
|
|
|
2013-04-09 06:24:53 -07:00
|
|
|
static void
|
|
|
|
_elm_ctxpopup_smart_focus_direction(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
|
|
|
|
{
|
|
|
|
Elm_Ctxpopup_Smart_Data *sd = _pd;
|
|
|
|
|
|
|
|
Evas_Object *base = va_arg(*list, Evas_Object *);
|
|
|
|
double degree = va_arg(*list, double);
|
|
|
|
Evas_Object **direction = va_arg(*list, Evas_Object **);
|
|
|
|
double *weight = va_arg(*list, double *);
|
|
|
|
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
|
|
|
if (ret) *ret = EINA_FALSE;
|
|
|
|
Eina_Bool int_ret;
|
|
|
|
|
|
|
|
Eina_List *l = NULL;
|
|
|
|
void *(*list_data_get)(const Eina_List *list);
|
|
|
|
|
|
|
|
if (!sd)
|
|
|
|
return;
|
|
|
|
|
|
|
|
list_data_get = eina_list_data_get;
|
|
|
|
|
|
|
|
l = eina_list_append(l, sd->box);
|
|
|
|
|
|
|
|
int_ret = elm_widget_focus_list_direction_get
|
|
|
|
(obj, base, l, list_data_get, degree, direction, weight);
|
|
|
|
if (ret) *ret = int_ret;
|
|
|
|
eina_list_free(l);
|
|
|
|
}
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
static void
|
|
|
|
_elm_ctxpopup_smart_event(Eo *obj, void *_pd, va_list *list)
|
2011-08-27 19:38:48 -07:00
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
Evas_Object *src = va_arg(*list, Evas_Object *);
|
|
|
|
Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
|
2013-10-28 07:06:14 -07:00
|
|
|
Evas_Event_Key_Down *ev = va_arg(*list, void *);
|
2012-11-25 22:32:53 -08:00
|
|
|
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
|
|
|
Elm_Ctxpopup_Smart_Data *sd = _pd;
|
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
|
|
|
|
2013-10-28 07:06:14 -07:00
|
|
|
if (ret) *ret = EINA_FALSE;
|
|
|
|
(void)src;
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
if (elm_widget_disabled_get(obj)) return;
|
|
|
|
if (type != EVAS_CALLBACK_KEY_DOWN) return;
|
|
|
|
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
|
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
|
|
|
|
2013-07-30 23:14:09 -07:00
|
|
|
if (!strcmp(ev->key, "Tab"))
|
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
|
|
|
{
|
|
|
|
if (evas_key_modifier_is_set(ev->modifiers, "Shift"))
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_widget_focus_cycle(sd->box, ELM_FOCUS_PREVIOUS);
|
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
|
|
|
else
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_widget_focus_cycle(sd->box, ELM_FOCUS_NEXT);
|
2012-11-25 22:32:53 -08:00
|
|
|
if (ret) *ret = EINA_TRUE;
|
|
|
|
return;
|
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
|
|
|
}
|
|
|
|
|
2013-11-12 17:29:30 -08:00
|
|
|
if (sd->box)
|
2013-05-29 23:24:32 -07:00
|
|
|
{
|
2013-11-12 17:29:30 -08:00
|
|
|
if ((!strcmp(ev->key, "Left")) ||
|
|
|
|
((!strcmp(ev->key, "KP_Left")) && (!ev->string)))
|
|
|
|
elm_widget_focus_cycle(sd->box, ELM_FOCUS_LEFT);
|
|
|
|
else if ((!strcmp(ev->key, "Right")) ||
|
|
|
|
((!strcmp(ev->key, "KP_Right")) && (!ev->string)))
|
|
|
|
elm_widget_focus_cycle(sd->box, ELM_FOCUS_RIGHT);
|
|
|
|
else if ((!strcmp(ev->key, "Up")) ||
|
|
|
|
((!strcmp(ev->key, "KP_Up")) && (!ev->string)))
|
|
|
|
elm_widget_focus_cycle(sd->box, ELM_FOCUS_UP);
|
|
|
|
else if ((!strcmp(ev->key, "Down")) ||
|
|
|
|
((!strcmp(ev->key, "KP_Down")) && (!ev->string)))
|
|
|
|
elm_widget_focus_cycle(sd->box, ELM_FOCUS_DOWN);
|
|
|
|
|
|
|
|
goto success;
|
2013-05-29 23:24:32 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 17:29:30 -08:00
|
|
|
if (!strcmp(ev->key, "Escape"))
|
|
|
|
evas_object_hide(obj);
|
|
|
|
else
|
|
|
|
return;
|
2011-08-27 19:38:48 -07:00
|
|
|
|
2013-11-12 17:29:30 -08:00
|
|
|
success:
|
2011-08-27 19:38:48 -07:00
|
|
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
2012-11-25 22:32:53 -08:00
|
|
|
if (ret) *ret = EINA_TRUE;
|
2011-08-27 19:38:48 -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
|
|
|
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
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
edje_object_part_geometry_get
|
|
|
|
(sd->arrow, "ctxpopup_arrow", NULL, NULL, &arrow_size.x, &arrow_size.y);
|
|
|
|
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);
|
2014-01-13 06:14:44 -08:00
|
|
|
if (sd->parent && eo_isa(sd->parent, ELM_OBJ_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
|
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_size_hint_min_get(obj, &min_size.x, &min_size.y);
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
//Check the Which direction is available.
|
2011-03-23 19:17:34 -07:00
|
|
|
//If find a avaialble direction, it adjusts 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];
|
|
|
|
|
2012-08-30 09:45:51 -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");
|
|
|
|
edje_object_part_swallow
|
2012-11-25 22:32:53 -08:00
|
|
|
(wd->resize_obj,
|
2012-09-19 06:00:00 -07:00
|
|
|
(elm_widget_mirrored_get(obj) ? "elm.swallow.arrow_right" :
|
|
|
|
"elm.swallow.arrow_left"), sd->arrow);
|
|
|
|
|
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,
|
2012-09-19 06:00:00 -07:00
|
|
|
(elm_widget_mirrored_get(obj) ? "elm.swallow.arrow_right" :
|
|
|
|
"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");
|
|
|
|
edje_object_part_swallow
|
2012-11-25 22:32:53 -08:00
|
|
|
(wd->resize_obj,
|
2012-09-19 06:00:00 -07:00
|
|
|
(elm_widget_mirrored_get(obj) ? "elm.swallow.arrow_left" :
|
|
|
|
"elm.swallow.arrow_right"), sd->arrow);
|
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,
|
2012-09-19 06:00:00 -07:00
|
|
|
(elm_widget_mirrored_get(obj) ? "elm.swallow.arrow_left" :
|
|
|
|
"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");
|
|
|
|
edje_object_part_swallow
|
2012-11-25 22:32:53 -08:00
|
|
|
(wd->resize_obj, "elm.swallow.arrow_up",
|
2012-08-30 09:45:51 -07:00
|
|
|
sd->arrow);
|
|
|
|
|
|
|
|
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");
|
|
|
|
edje_object_part_swallow
|
2012-11-25 22:32:53 -08:00
|
|
|
(wd->resize_obj, "elm.swallow.arrow_down",
|
2012-08-30 09:45:51 -07:00
|
|
|
sd->arrow);
|
|
|
|
|
|
|
|
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,
|
|
|
|
(elm_widget_mirrored_get(obj) ? "elm,state,show,right" :
|
|
|
|
"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,
|
|
|
|
(elm_widget_mirrored_get(obj) ? "elm,state,show,left" :
|
|
|
|
"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,
|
|
|
|
(elm_widget_mirrored_get(obj) ? "elm,state,hide,right" :
|
|
|
|
"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,
|
|
|
|
(elm_widget_mirrored_get(obj) ? "elm,state,hide,left" :
|
|
|
|
"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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
static void
|
|
|
|
_elm_ctxpopup_smart_layout_sub_object_add_enable(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
|
2012-08-30 09:45:51 -07:00
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
Eina_Bool *enable = va_arg(*list, Eina_Bool *);
|
|
|
|
*enable = EINA_FALSE;
|
|
|
|
}
|
2012-08-30 09:45:51 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
static void
|
|
|
|
_elm_ctxpopup_smart_sub_object_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
|
|
|
|
{
|
|
|
|
Evas_Object *sobj = va_arg(*list, Evas_Object *);
|
|
|
|
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
|
|
|
Eina_Bool int_ret;
|
2012-08-30 09:45:51 -07:00
|
|
|
|
2013-03-18 09:07:38 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, elm_wdg_sub_object_add(sobj, &int_ret));
|
2012-08-30 09:45:51 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
if (ret) *ret = int_ret;
|
2012-08-30 09:45:51 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-11-25 22:32:53 -08:00
|
|
|
_elm_ctxpopup_smart_sizing_eval(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
|
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 };
|
2012-03-22 03:14:58 -07:00
|
|
|
Evas_Coord_Point list_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
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
Elm_Ctxpopup_Smart_Data *sd = _pd;
|
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);
|
|
|
|
evas_object_size_hint_min_set(sd->box, rect.w, rect.h);
|
2012-03-22 03:14:58 -07:00
|
|
|
evas_object_size_hint_min_set(obj, rect.w, rect.h);
|
|
|
|
}
|
2012-08-30 09:45:51 -07:00
|
|
|
}
|
|
|
|
|
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);
|
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
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
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
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
evas_object_hide(data);
|
2013-01-16 20:44:05 -08:00
|
|
|
evas_object_smart_callback_call(data, SIG_DISMISSED, NULL);
|
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.
|
2012-11-25 22:32:53 -08:00
|
|
|
static void
|
|
|
|
_elm_ctxpopup_smart_theme(Eo *obj, void *_pd, va_list *list)
|
2012-08-30 09:45:51 -07:00
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
Elm_Ctxpopup_Smart_Data *sd = _pd;
|
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-11-25 22:32:53 -08:00
|
|
|
Eina_Bool int_ret;
|
|
|
|
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
|
|
|
if (ret) *ret = EINA_FALSE;
|
|
|
|
|
2014-01-21 00:44:45 -08:00
|
|
|
eo_do_super(obj, MY_CLASS, elm_wdg_theme_apply(&int_ret));
|
2012-11-25 22:32:53 -08:00
|
|
|
if (!int_ret) return;
|
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);
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
if (ret) *ret = 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
|
|
|
/* 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 */
|
2012-11-25 22:32:53 -08:00
|
|
|
static void
|
|
|
|
_elm_ctxpopup_smart_content_set(Eo *obj, void *_pd, va_list *list)
|
2011-08-02 21:38:44 -07:00
|
|
|
{
|
2011-12-15 21:27:11 -08:00
|
|
|
Evas_Coord min_w = -1, min_h = -1;
|
2012-08-30 09:45:51 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
Elm_Ctxpopup_Smart_Data *sd = _pd;
|
|
|
|
const char *part = va_arg(*list, const char *);
|
|
|
|
Evas_Object *content = va_arg(*list, Evas_Object *);
|
|
|
|
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
|
|
|
Eina_Bool int_ret = EINA_TRUE;
|
2012-08-30 09:45:51 -07:00
|
|
|
|
|
|
|
if ((part) && (strcmp(part, "default")))
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2013-03-18 09:07:38 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, elm_obj_container_content_set(part, content, &int_ret));
|
2012-11-25 22:32:53 -08:00
|
|
|
goto end;
|
|
|
|
}
|
2012-08-30 09:45:51 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
if (!content)
|
|
|
|
{
|
|
|
|
int_ret = EINA_FALSE;
|
|
|
|
goto end;
|
|
|
|
}
|
2012-08-30 09:45:51 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
if (content == sd->content) goto end;
|
2012-08-30 09:45:51 -07:00
|
|
|
|
|
|
|
if (sd->content) evas_object_del(sd->content);
|
|
|
|
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);
|
|
|
|
|
|
|
|
/* since it's going to be a box content, not a layout's... */
|
2011-12-15 21:27:11 -08:00
|
|
|
evas_object_show(content);
|
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
evas_object_size_hint_min_get(content, &min_w, &min_h);
|
|
|
|
evas_object_size_hint_min_set(sd->box, min_w, min_h);
|
|
|
|
elm_box_pack_end(sd->box, 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
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
end:
|
|
|
|
if (ret) *ret = int_ret;
|
2011-08-02 21:38:44 -07:00
|
|
|
}
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
static void
|
|
|
|
_elm_ctxpopup_smart_content_get(Eo *obj, void *_pd, va_list *list)
|
2011-08-02 21:38:44 -07:00
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
const char *part = va_arg(*list, const char *);
|
|
|
|
Evas_Object **ret = va_arg(*list, Evas_Object **);
|
|
|
|
*ret = NULL;
|
2011-08-02 21:38:44 -07:00
|
|
|
|
2012-09-04 07:10:00 -07:00
|
|
|
if ((part) && (strcmp(part, "default")))
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2013-03-18 09:07:38 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, elm_obj_container_content_get(part, ret));
|
2012-11-25 22:32:53 -08:00
|
|
|
return;
|
|
|
|
}
|
2012-09-04 07:10:00 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
Elm_Ctxpopup_Smart_Data *sd = _pd;
|
|
|
|
|
|
|
|
*ret = sd->content;
|
2011-08-02 21:38:44 -07:00
|
|
|
}
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
static void
|
|
|
|
_elm_ctxpopup_smart_content_unset(Eo *obj, void *_pd, va_list *list)
|
2011-08-02 21:38:44 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
Evas_Object *content;
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
const char *part = va_arg(*list, const char *);
|
|
|
|
Evas_Object **ret = va_arg(*list, Evas_Object **);
|
2012-08-30 09:45:51 -07:00
|
|
|
|
2012-09-04 07:10:00 -07:00
|
|
|
if ((part) && (strcmp(part, "default")))
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2013-03-18 09:07:38 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, elm_obj_container_content_unset(part, &content));
|
2012-11-25 22:32:53 -08:00
|
|
|
goto end;
|
|
|
|
}
|
2012-09-04 07:10:00 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
Elm_Ctxpopup_Smart_Data *sd = _pd;
|
2012-08-30 09:45:51 -07:00
|
|
|
content = sd->content;
|
2012-11-25 22:32:53 -08:00
|
|
|
if (!content) goto end;
|
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);
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
end:
|
|
|
|
if (ret) *ret = content;
|
2011-08-02 21:38:44 -07:00
|
|
|
}
|
|
|
|
|
2011-11-16 18:16:38 -08:00
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_item_text_set_hook(Elm_Object_Item *it,
|
|
|
|
const char *part,
|
|
|
|
const char *label)
|
2011-11-16 18:16:38 -08:00
|
|
|
{
|
|
|
|
Elm_Ctxpopup_Item *ctxpopup_it;
|
|
|
|
|
2012-03-22 03:14:58 -07:00
|
|
|
if ((part) && (strcmp(part, "default"))) return;
|
2011-11-16 18:16:38 -08:00
|
|
|
|
2012-03-06 03:51:42 -08:00
|
|
|
ctxpopup_it = (Elm_Ctxpopup_Item *)it;
|
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
|
|
|
}
|
|
|
|
|
|
|
|
static const char *
|
2012-08-30 09:45:51 -07:00
|
|
|
_item_text_get_hook(const Elm_Object_Item *it,
|
|
|
|
const char *part)
|
2011-11-16 18:16:38 -08:00
|
|
|
{
|
|
|
|
Elm_Ctxpopup_Item *ctxpopup_it;
|
2012-08-30 09:45:51 -07:00
|
|
|
|
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-06 03:51:42 -08:00
|
|
|
ctxpopup_it = (Elm_Ctxpopup_Item *)it;
|
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
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_content_set_hook(Elm_Object_Item *it,
|
|
|
|
const char *part,
|
|
|
|
Evas_Object *content)
|
|
|
|
{
|
|
|
|
Elm_Ctxpopup_Item *ctxpopup_it;
|
|
|
|
|
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-03-06 03:51:42 -08:00
|
|
|
ctxpopup_it = (Elm_Ctxpopup_Item *)it;
|
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
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object *
|
2012-08-30 09:45:51 -07:00
|
|
|
_item_content_get_hook(const Elm_Object_Item *it,
|
|
|
|
const char *part)
|
2011-11-16 18:16:38 -08:00
|
|
|
{
|
|
|
|
Elm_Ctxpopup_Item *ctxpopup_it;
|
2012-03-22 03:14:58 -07:00
|
|
|
|
|
|
|
if (part && strcmp(part, "icon") && strcmp(part, "start")
|
|
|
|
&& strcmp(part, "end")) return NULL;
|
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
ctxpopup_it = (Elm_Ctxpopup_Item *)it;
|
2012-03-22 03:14:58 -07:00
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-01-09 17:00:23 -08:00
|
|
|
_item_disable_hook(Elm_Object_Item *it)
|
2011-11-16 18:16:38 -08:00
|
|
|
{
|
2012-03-06 03:51:42 -08:00
|
|
|
Elm_Ctxpopup_Item *ctxpopup_it = (Elm_Ctxpopup_Item *)it;
|
2011-11-16 18:16:38 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_object_item_disabled_set
|
|
|
|
(ctxpopup_it->list_item, elm_widget_item_disabled_get(ctxpopup_it));
|
2011-11-16 18:16:38 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_item_signal_emit_hook(Elm_Object_Item *it,
|
|
|
|
const char *emission,
|
2011-11-16 18:16:38 -08:00
|
|
|
const char *source)
|
|
|
|
{
|
2012-03-06 03:51:42 -08:00
|
|
|
Elm_Ctxpopup_Item *ctxpopup_it = (Elm_Ctxpopup_Item *)it;
|
2012-08-30 09:45:51 -07: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
|
|
|
}
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
_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;
|
2013-04-09 06:24:53 -07:00
|
|
|
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);
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2011-08-27 19:38:48 -07:00
|
|
|
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);
|
|
|
|
evas_object_smart_callback_call(data, SIG_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
|
2012-08-30 09:45:51 -07:00
|
|
|
_list_del(Elm_Ctxpopup_Smart_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->list) return;
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
evas_object_del(sd->list);
|
|
|
|
sd->list = 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
|
|
|
}
|
|
|
|
|
2012-01-27 03:56:14 -08:00
|
|
|
static Eina_Bool
|
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
|
|
|
_item_del_pre_hook(Elm_Object_Item *it)
|
|
|
|
{
|
2012-03-22 03:14:58 -07:00
|
|
|
Evas_Object *list;
|
2012-03-06 03:51:42 -08:00
|
|
|
Elm_Ctxpopup_Item *ctxpopup_it = (Elm_Ctxpopup_Item *)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-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);
|
|
|
|
|
|
|
|
if (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
|
|
|
{
|
2012-03-22 03:14:58 -07:00
|
|
|
elm_object_item_del(ctxpopup_it->list_item);
|
2013-01-18 01:07:03 -08:00
|
|
|
sd->items = eina_list_remove(sd->items, 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
|
|
|
evas_object_hide(WIDGET(ctxpopup_it));
|
2012-08-30 09:45:51 -07:00
|
|
|
|
2012-01-27 03:56:14 -08: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
|
|
|
}
|
|
|
|
|
2012-03-22 03:14:58 -07:00
|
|
|
elm_object_item_del(ctxpopup_it->list_item);
|
2013-01-18 01:07:03 -08:00
|
|
|
sd->items = eina_list_remove(sd->items, ctxpopup_it);
|
2012-08-30 09:45:51 -07:00
|
|
|
if (sd->list_visible) elm_layout_sizing_eval(WIDGET(ctxpopup_it));
|
|
|
|
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
static void
|
|
|
|
_elm_ctxpopup_smart_disable(Eo *obj, void *_pd, va_list *list)
|
2012-08-30 09:45:51 -07:00
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
Elm_Ctxpopup_Smart_Data *sd = _pd;
|
2012-08-30 09:45:51 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
|
|
|
if (ret) *ret = EINA_FALSE;
|
|
|
|
Eina_Bool int_ret;
|
|
|
|
|
2013-03-18 09:07:38 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, elm_wdg_disable(&int_ret));
|
2012-11-25 22:32:53 -08:00
|
|
|
if (!int_ret) return;
|
2013-12-12 18:21:08 -08:00
|
|
|
if (sd->list)
|
|
|
|
elm_object_disabled_set(sd->list, elm_widget_disabled_get(obj));
|
|
|
|
else if (sd->content)
|
2013-12-14 10:47:43 -08:00
|
|
|
elm_object_disabled_set(sd->content, elm_widget_disabled_get(obj));
|
2012-01-27 03:56:14 -08:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
if (ret) *ret = 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
|
|
|
}
|
|
|
|
|
2012-03-14 06:03:38 -07:00
|
|
|
static void
|
2012-11-25 22:32:53 -08:00
|
|
|
_elm_ctxpopup_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
|
2012-03-14 06:03:38 -07:00
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
Elm_Ctxpopup_Smart_Data *priv = _pd;
|
2014-01-14 21:42:13 -08:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
2012-08-30 09:45:51 -07:00
|
|
|
|
2013-03-18 09:07:38 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
|
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;
|
|
|
|
|
|
|
|
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 */
|
2012-11-25 22:32:53 -08:00
|
|
|
Eina_Bool ret;
|
2013-03-18 09:07:38 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, elm_obj_container_content_set("elm.swallow.content", priv->box, &ret));
|
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
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-11-25 22:32:53 -08:00
|
|
|
_elm_ctxpopup_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
|
2012-03-14 06:03:38 -07:00
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
Elm_Ctxpopup_Smart_Data *sd = _pd;
|
2013-01-18 01:07:03 -08:00
|
|
|
Elm_Ctxpopup_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);
|
|
|
|
evas_object_del(sd->arrow);
|
|
|
|
sd->arrow = NULL; /* stops _sizing_eval() from going on on deletion */
|
|
|
|
|
|
|
|
evas_object_del(sd->bg);
|
|
|
|
sd->bg = NULL;
|
|
|
|
|
2013-03-08 20:23:42 -08:00
|
|
|
EINA_LIST_FREE(sd->items, it)
|
2013-01-18 01:07:03 -08:00
|
|
|
elm_widget_item_free(it);
|
|
|
|
|
2013-03-18 09:07:38 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, evas_obj_smart_del());
|
2012-03-14 06:03:38 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-11-25 22:32:53 -08:00
|
|
|
_elm_ctxpopup_smart_parent_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
|
2012-03-14 06:03:38 -07:00
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
Evas_Object *parent = va_arg(*list, Evas_Object *);
|
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);
|
2012-11-25 22:32:53 -08:00
|
|
|
Evas_Object *obj = eo_add(MY_CLASS, parent);
|
|
|
|
eo_unref(obj);
|
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
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
static void
|
|
|
|
_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
|
|
|
|
{
|
2013-03-18 09:07:38 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, eo_constructor());
|
2012-11-25 22:32:53 -08:00
|
|
|
eo_do(obj,
|
2013-11-07 03:44:22 -08:00
|
|
|
evas_obj_type_set(MY_CLASS_NAME_LEGACY),
|
2012-11-25 22:32:53 -08:00
|
|
|
evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
|
2010-10-19 13:21:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_ctxpopup_hover_parent_set(Evas_Object *obj,
|
|
|
|
Evas_Object *parent)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
|
|
|
ELM_CTXPOPUP_CHECK(obj);
|
|
|
|
eo_do(obj, elm_obj_ctxpopup_hover_parent_set(parent));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_hover_parent_set(Eo *obj, void *_pd, va_list *list)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
2011-08-29 08:59:56 -07:00
|
|
|
Evas_Coord x, y, w, h;
|
2012-11-25 22:32:53 -08:00
|
|
|
Evas_Object *parent = va_arg(*list, Evas_Object *);
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
Elm_Ctxpopup_Smart_Data *sd = _pd;
|
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);
|
2014-01-13 06:14:44 -08:00
|
|
|
if (parent && eo_isa(parent, ELM_OBJ_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
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Evas_Object *
|
2010-11-30 22:52:46 -08:00
|
|
|
elm_ctxpopup_hover_parent_get(const Evas_Object *obj)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_CHECK(obj) NULL;
|
2012-11-25 22:32:53 -08:00
|
|
|
Evas_Object *ret = NULL;
|
|
|
|
eo_do((Eo *) obj, elm_obj_ctxpopup_hover_parent_get(&ret));
|
|
|
|
return ret;
|
|
|
|
}
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
static void
|
|
|
|
_hover_parent_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
Evas_Object **ret = va_arg(*list, Evas_Object **);
|
|
|
|
Elm_Ctxpopup_Smart_Data *sd = _pd;
|
|
|
|
*ret = sd->parent;
|
2010-10-19 13:21:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_ctxpopup_clear(Evas_Object *obj)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_CHECK(obj);
|
2012-11-25 22:32:53 -08:00
|
|
|
eo_do(obj, elm_obj_ctxpopup_clear());
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_clear(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Elm_Ctxpopup_Smart_Data *sd = _pd;
|
2010-10-19 13:21:53 -07: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
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_ctxpopup_horizontal_set(Evas_Object *obj,
|
|
|
|
Eina_Bool horizontal)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_CHECK(obj);
|
2012-11-25 22:32:53 -08:00
|
|
|
eo_do(obj, elm_obj_ctxpopup_horizontal_set(horizontal));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_horizontal_set(Eo *obj, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
Eina_Bool horizontal = va_arg(*list, int);
|
|
|
|
Elm_Ctxpopup_Smart_Data *sd = _pd;
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
sd->horizontal = !!horizontal;
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (!sd->list) return;
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_list_horizontal_set(sd->list, sd->horizontal);
|
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;
|
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);
|
2010-10-19 13:21:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
2010-11-30 22:52:46 -08:00
|
|
|
elm_ctxpopup_horizontal_get(const Evas_Object *obj)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_CHECK(obj) EINA_FALSE;
|
2012-11-25 22:32:53 -08:00
|
|
|
Eina_Bool ret = EINA_FALSE;
|
|
|
|
eo_do((Eo *) obj, elm_obj_ctxpopup_horizontal_get(&ret));
|
|
|
|
return ret;
|
|
|
|
}
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
static void
|
|
|
|
_horizontal_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
|
|
|
Elm_Ctxpopup_Smart_Data *sd = _pd;
|
|
|
|
|
|
|
|
*ret = sd->horizontal;
|
2010-10-19 13:21:53 -07:00
|
|
|
}
|
|
|
|
|
2011-08-13 20:36:56 -07:00
|
|
|
EAPI Elm_Object_Item *
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_ctxpopup_item_append(Evas_Object *obj,
|
|
|
|
const char *label,
|
|
|
|
Evas_Object *icon,
|
|
|
|
Evas_Smart_Cb func,
|
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
|
|
|
const void *data)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_CHECK(obj) NULL;
|
2012-11-25 22:32:53 -08:00
|
|
|
Elm_Object_Item *ret = NULL;
|
|
|
|
eo_do(obj, elm_obj_ctxpopup_item_append(label, icon, func, data, &ret));
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
{
|
|
|
|
Elm_Ctxpopup_Item *item = data;
|
2013-05-02 04:25:42 -07:00
|
|
|
if (!item->wcb.org_func_cb) return;
|
2013-01-18 01:07:03 -08:00
|
|
|
item->wcb.org_func_cb((void *)item->wcb.org_data, item->wcb.cobj, item);
|
|
|
|
}
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
static void
|
|
|
|
_item_append(Eo *obj, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
const char *label = va_arg(*list, const char *);
|
|
|
|
Evas_Object *icon = va_arg(*list, Evas_Object *);
|
|
|
|
Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
|
|
|
|
const void *data = va_arg(*list, const void *);
|
|
|
|
Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
|
|
|
|
*ret = NULL;
|
|
|
|
|
|
|
|
Elm_Ctxpopup_Item *item;
|
|
|
|
|
|
|
|
Elm_Ctxpopup_Smart_Data *sd = _pd;
|
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
|
|
|
item = elm_widget_item_new(obj, Elm_Ctxpopup_Item);
|
2012-11-25 22:32:53 -08:00
|
|
|
if (!item) 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
|
|
|
|
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
|
|
|
elm_widget_item_del_pre_hook_set(item, _item_del_pre_hook);
|
2012-01-09 17:00:23 -08:00
|
|
|
elm_widget_item_disable_hook_set(item, _item_disable_hook);
|
2011-11-16 18:16:38 -08:00
|
|
|
elm_widget_item_text_set_hook_set(item, _item_text_set_hook);
|
|
|
|
elm_widget_item_text_get_hook_set(item, _item_text_get_hook);
|
|
|
|
elm_widget_item_content_set_hook_set(item, _item_content_set_hook);
|
|
|
|
elm_widget_item_content_get_hook_set(item, _item_content_get_hook);
|
|
|
|
elm_widget_item_signal_emit_hook_set(item, _item_signal_emit_hook);
|
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (!sd->list)
|
2012-03-22 03:14:58 -07:00
|
|
|
{
|
|
|
|
//The first item is appended.
|
2012-08-30 09:45:51 -07:00
|
|
|
sd->list = elm_list_add(obj);
|
2013-06-23 17:54:16 -07:00
|
|
|
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));
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_list_mode_set(sd->list, ELM_LIST_EXPAND);
|
|
|
|
elm_list_horizontal_set(sd->list, sd->horizontal);
|
|
|
|
evas_object_event_callback_add
|
|
|
|
(sd->list, EVAS_CALLBACK_RESIZE, _list_resize_cb, obj);
|
|
|
|
elm_layout_content_set(obj, "default", sd->list);
|
2012-03-22 03:14:58 -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
|
|
|
|
2013-01-18 01:07:03 -08:00
|
|
|
item->wcb.org_func_cb = func;
|
|
|
|
item->wcb.org_data = data;
|
|
|
|
item->wcb.cobj = obj;
|
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);
|
|
|
|
sd->items = eina_list_append(sd->items, 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
|
|
|
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
|
|
|
|
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
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
*ret = (Elm_Object_Item *)item;
|
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
|
|
|
EAPI void
|
|
|
|
elm_ctxpopup_direction_priority_set(Evas_Object *obj,
|
|
|
|
Elm_Ctxpopup_Direction first,
|
|
|
|
Elm_Ctxpopup_Direction second,
|
|
|
|
Elm_Ctxpopup_Direction third,
|
|
|
|
Elm_Ctxpopup_Direction fourth)
|
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_CHECK(obj);
|
2012-11-25 22:32:53 -08:00
|
|
|
eo_do(obj, elm_obj_ctxpopup_direction_priority_set(first, second, third, fourth));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_direction_priority_set(Eo *obj, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
Elm_Ctxpopup_Direction first = va_arg(*list, Elm_Ctxpopup_Direction);
|
|
|
|
Elm_Ctxpopup_Direction second = va_arg(*list, Elm_Ctxpopup_Direction);
|
|
|
|
Elm_Ctxpopup_Direction third = va_arg(*list, Elm_Ctxpopup_Direction);
|
|
|
|
Elm_Ctxpopup_Direction fourth = va_arg(*list, Elm_Ctxpopup_Direction);
|
|
|
|
|
|
|
|
Elm_Ctxpopup_Smart_Data *sd = _pd;
|
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
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_ctxpopup_direction_priority_get(Evas_Object *obj,
|
|
|
|
Elm_Ctxpopup_Direction *first,
|
|
|
|
Elm_Ctxpopup_Direction *second,
|
|
|
|
Elm_Ctxpopup_Direction *third,
|
|
|
|
Elm_Ctxpopup_Direction *fourth)
|
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_CHECK(obj);
|
2012-11-25 22:32:53 -08:00
|
|
|
eo_do(obj, elm_obj_ctxpopup_direction_priority_get(first, second, third, fourth));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_direction_priority_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
Elm_Ctxpopup_Direction *first = va_arg(*list, Elm_Ctxpopup_Direction *);
|
|
|
|
Elm_Ctxpopup_Direction *second = va_arg(*list, Elm_Ctxpopup_Direction *);
|
|
|
|
Elm_Ctxpopup_Direction *third = va_arg(*list, Elm_Ctxpopup_Direction *);
|
|
|
|
Elm_Ctxpopup_Direction *fourth = va_arg(*list, Elm_Ctxpopup_Direction *);
|
|
|
|
|
|
|
|
Elm_Ctxpopup_Smart_Data *sd = _pd;
|
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 (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
|
|
|
|
|
|
|
EAPI Elm_Ctxpopup_Direction
|
|
|
|
elm_ctxpopup_direction_get(const Evas_Object *obj)
|
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_CHECK(obj) ELM_CTXPOPUP_DIRECTION_UNKNOWN;
|
2012-11-25 22:32:53 -08:00
|
|
|
Elm_Ctxpopup_Direction ret = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
|
|
|
|
eo_do((Eo *) obj, elm_obj_ctxpopup_direction_get(&ret));
|
|
|
|
return ret;
|
|
|
|
}
|
2011-08-28 00:12:16 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
static void
|
|
|
|
_direction_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
Elm_Ctxpopup_Direction *ret = va_arg(*list, Elm_Ctxpopup_Direction *);
|
|
|
|
Elm_Ctxpopup_Smart_Data *sd = _pd;
|
|
|
|
|
|
|
|
*ret = sd->dir;
|
2011-08-28 00:12:16 -07:00
|
|
|
}
|
2012-03-06 21:58:38 -08:00
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_ctxpopup_dismiss(Evas_Object *obj)
|
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_CHECK(obj);
|
2012-11-25 22:32:53 -08:00
|
|
|
eo_do(obj, elm_obj_ctxpopup_dismiss());
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_dismiss(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Elm_Ctxpopup_Smart_Data *sd = _pd;
|
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
|
|
|
|
|
|
|
static void
|
|
|
|
_class_constructor(Eo_Class *klass)
|
|
|
|
{
|
|
|
|
const Eo_Op_Func_Description func_desc[] = {
|
|
|
|
EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor),
|
|
|
|
|
|
|
|
EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_ADD), _elm_ctxpopup_smart_add),
|
|
|
|
EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_ctxpopup_smart_del),
|
|
|
|
|
|
|
|
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_PARENT_SET), _elm_ctxpopup_smart_parent_set),
|
|
|
|
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DISABLE), _elm_ctxpopup_smart_disable),
|
|
|
|
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_ctxpopup_smart_event),
|
2014-01-21 00:44:45 -08:00
|
|
|
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME_APPLY), _elm_ctxpopup_smart_theme),
|
2012-11-25 22:32:53 -08:00
|
|
|
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SUB_OBJECT_ADD), _elm_ctxpopup_smart_sub_object_add),
|
|
|
|
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_ctxpopup_smart_focus_next_manager_is),
|
|
|
|
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_ctxpopup_smart_focus_next),
|
|
|
|
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_ctxpopup_smart_focus_direction_manager_is),
|
2013-04-09 06:24:53 -07:00
|
|
|
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION), _elm_ctxpopup_smart_focus_direction),
|
2013-02-11 22:58:05 -08:00
|
|
|
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TRANSLATE), _elm_ctxpopup_smart_translate),
|
2012-11-25 22:32:53 -08:00
|
|
|
|
|
|
|
EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_SET), _elm_ctxpopup_smart_content_set),
|
|
|
|
EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_GET), _elm_ctxpopup_smart_content_get),
|
|
|
|
EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_UNSET), _elm_ctxpopup_smart_content_unset),
|
|
|
|
|
|
|
|
EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_ctxpopup_smart_sizing_eval),
|
|
|
|
EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SUB_OBJECT_ADD_ENABLE), _elm_ctxpopup_smart_layout_sub_object_add_enable),
|
|
|
|
|
|
|
|
EO_OP_FUNC(ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_HOVER_PARENT_SET), _hover_parent_set),
|
|
|
|
EO_OP_FUNC(ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_HOVER_PARENT_GET), _hover_parent_get),
|
|
|
|
EO_OP_FUNC(ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_CLEAR), _clear),
|
|
|
|
EO_OP_FUNC(ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_HORIZONTAL_SET), _horizontal_set),
|
|
|
|
EO_OP_FUNC(ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_HORIZONTAL_GET), _horizontal_get),
|
|
|
|
EO_OP_FUNC(ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_ITEM_APPEND), _item_append),
|
|
|
|
EO_OP_FUNC(ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_DIRECTION_PRIORITY_SET), _direction_priority_set),
|
|
|
|
EO_OP_FUNC(ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_DIRECTION_PRIORITY_GET), _direction_priority_get),
|
|
|
|
EO_OP_FUNC(ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_DIRECTION_GET), _direction_get),
|
|
|
|
EO_OP_FUNC(ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_DISMISS), _dismiss),
|
|
|
|
EO_OP_FUNC_SENTINEL
|
|
|
|
};
|
|
|
|
eo_class_funcs_set(klass, func_desc);
|
2013-02-09 23:52:31 -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
|
|
|
}
|
|
|
|
static const Eo_Op_Description op_desc[] = {
|
|
|
|
EO_OP_DESCRIPTION(ELM_OBJ_CTXPOPUP_SUB_ID_HOVER_PARENT_SET, "Set the Ctxpopup's parent."),
|
|
|
|
EO_OP_DESCRIPTION(ELM_OBJ_CTXPOPUP_SUB_ID_HOVER_PARENT_GET, "Get the Ctxpopup's parent."),
|
|
|
|
EO_OP_DESCRIPTION(ELM_OBJ_CTXPOPUP_SUB_ID_CLEAR, "Clear all items in the given ctxpopup object."),
|
|
|
|
EO_OP_DESCRIPTION(ELM_OBJ_CTXPOPUP_SUB_ID_HORIZONTAL_SET, "Change the ctxpopup's orientation to horizontal or vertical."),
|
|
|
|
EO_OP_DESCRIPTION(ELM_OBJ_CTXPOPUP_SUB_ID_HORIZONTAL_GET, "Get the value of current ctxpopup object's orientation."),
|
|
|
|
EO_OP_DESCRIPTION(ELM_OBJ_CTXPOPUP_SUB_ID_ITEM_APPEND, "Add a new item to a ctxpopup object."),
|
|
|
|
EO_OP_DESCRIPTION(ELM_OBJ_CTXPOPUP_SUB_ID_DIRECTION_PRIORITY_SET, "Set the direction priority of a ctxpopup."),
|
|
|
|
EO_OP_DESCRIPTION(ELM_OBJ_CTXPOPUP_SUB_ID_DIRECTION_PRIORITY_GET, "Get the direction priority of a ctxpopup."),
|
|
|
|
EO_OP_DESCRIPTION(ELM_OBJ_CTXPOPUP_SUB_ID_DIRECTION_GET, "Get the current direction of a ctxpopup."),
|
|
|
|
EO_OP_DESCRIPTION(ELM_OBJ_CTXPOPUP_SUB_ID_DISMISS, "Dismiss a ctxpopup object."),
|
|
|
|
EO_OP_DESCRIPTION_SENTINEL
|
|
|
|
};
|
|
|
|
static const Eo_Class_Description class_desc = {
|
|
|
|
EO_VERSION,
|
|
|
|
MY_CLASS_NAME,
|
|
|
|
EO_CLASS_TYPE_REGULAR,
|
|
|
|
EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_CTXPOPUP_BASE_ID, op_desc, ELM_OBJ_CTXPOPUP_SUB_ID_LAST),
|
|
|
|
NULL,
|
|
|
|
sizeof(Elm_Ctxpopup_Smart_Data),
|
|
|
|
_class_constructor,
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
EO_DEFINE_CLASS(elm_obj_ctxpopup_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
|