forked from enlightenment/efl
Add the elm_scrollable_interface_content_viewport_resize_cb_set.
When the viewport is resized, the enrolled function is called.
This commit is contained in:
parent
0ccfc31ee1
commit
d418b27b96
|
@ -1468,3 +1468,8 @@
|
||||||
|
|
||||||
* Fix Segfault in elementary file_selector_example when closed.
|
* Fix Segfault in elementary file_selector_example when closed.
|
||||||
https://phab.enlightenment.org/T133
|
https://phab.enlightenment.org/T133
|
||||||
|
|
||||||
|
2013-06-30 Jaehwan Kim
|
||||||
|
|
||||||
|
* Add the elm_scrollable_interface_content_viewport_resize_cb_set.
|
||||||
|
When the viewport is resized, the enrolled function is called.
|
||||||
|
|
|
@ -76,6 +76,7 @@ Additions:
|
||||||
* Add "focused" and "unfocused" smart callback for panel, video, web, web2, genlist, hover, index, list, map, photocam, progressbar, radio, scroller, slider, slideshow, spinner, toolbar, win, calendar, check, clock, colorselector, datetime, diskselector, flipselector, gengrid, ctxpopup, fileselector_button, naviframe, player, popup, bubble, button.
|
* Add "focused" and "unfocused" smart callback for panel, video, web, web2, genlist, hover, index, list, map, photocam, progressbar, radio, scroller, slider, slideshow, spinner, toolbar, win, calendar, check, clock, colorselector, datetime, diskselector, flipselector, gengrid, ctxpopup, fileselector_button, naviframe, player, popup, bubble, button.
|
||||||
* Add elm_web_url_set(), elm_web_url_get() and "url,changed" signal for web, web2.
|
* Add elm_web_url_set(), elm_web_url_get() and "url,changed" signal for web, web2.
|
||||||
* Add elm_fileselector_mime_type_filter_append and elm_fileselector_filters_clear to support mime type filter.
|
* Add elm_fileselector_mime_type_filter_append and elm_fileselector_filters_clear to support mime type filter.
|
||||||
|
* Add the elm_scrollable_interface_content_viewport_resize_cb_set.
|
||||||
|
|
||||||
Improvements:
|
Improvements:
|
||||||
|
|
||||||
|
|
|
@ -117,7 +117,8 @@ _elm_pan_smart_resize(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
|
||||||
psd->h = h;
|
psd->h = h;
|
||||||
|
|
||||||
_elm_pan_update(psd);
|
_elm_pan_update(psd);
|
||||||
evas_object_smart_callback_call(psd->self, SIG_CHANGED, NULL);
|
evas_object_smart_callback_call(psd->self, SIG_CHANGED,
|
||||||
|
ELM_OBJ_PAN_SMART_RESIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -154,7 +155,8 @@ _elm_pan_pos_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
|
||||||
psd->py = y;
|
psd->py = y;
|
||||||
|
|
||||||
_elm_pan_update(psd);
|
_elm_pan_update(psd);
|
||||||
evas_object_smart_callback_call(psd->self, SIG_CHANGED, NULL);
|
evas_object_smart_callback_call(psd->self, SIG_CHANGED,
|
||||||
|
ELM_OBJ_PAN_POS_SET);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -264,7 +266,8 @@ _elm_pan_content_del_cb(void *data,
|
||||||
psd->content = NULL;
|
psd->content = NULL;
|
||||||
psd->content_w = psd->content_h = psd->px = psd->py =
|
psd->content_w = psd->content_h = psd->px = psd->py =
|
||||||
psd->prev_cw = psd->prev_ch = psd->delta_posx = psd->delta_posy = 0;
|
psd->prev_cw = psd->prev_ch = psd->delta_posx = psd->delta_posy = 0;
|
||||||
evas_object_smart_callback_call(psd->self, SIG_CHANGED, NULL);
|
evas_object_smart_callback_call(psd->self, SIG_CHANGED,
|
||||||
|
ELM_OBJ_PAN_CONTENT_DEL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -284,7 +287,8 @@ _elm_pan_content_resize_cb(void *data,
|
||||||
psd->content_h = h;
|
psd->content_h = h;
|
||||||
_elm_pan_update(psd);
|
_elm_pan_update(psd);
|
||||||
}
|
}
|
||||||
evas_object_smart_callback_call(psd->self, SIG_CHANGED, NULL);
|
evas_object_smart_callback_call(psd->self, SIG_CHANGED,
|
||||||
|
ELM_OBJ_PAN_CONTENT_RESIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -326,7 +330,8 @@ _elm_pan_content_set(Evas_Object *obj,
|
||||||
_elm_pan_update(psd);
|
_elm_pan_update(psd);
|
||||||
|
|
||||||
end:
|
end:
|
||||||
evas_object_smart_callback_call(psd->self, SIG_CHANGED, NULL);
|
evas_object_smart_callback_call(psd->self, SIG_CHANGED,
|
||||||
|
ELM_OBJ_PAN_CONTENT_SET);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -3619,10 +3624,11 @@ _elm_scroll_scroll_bar_reset(Elm_Scrollable_Smart_Interface_Data *sid)
|
||||||
static void
|
static void
|
||||||
_elm_scroll_pan_changed_cb(void *data,
|
_elm_scroll_pan_changed_cb(void *data,
|
||||||
Evas_Object *obj __UNUSED__,
|
Evas_Object *obj __UNUSED__,
|
||||||
void *event_info __UNUSED__)
|
void *event_info)
|
||||||
{
|
{
|
||||||
Evas_Coord w, h;
|
Evas_Coord w, h;
|
||||||
Elm_Scrollable_Smart_Interface_Data *sid = data;
|
Elm_Scrollable_Smart_Interface_Data *sid = data;
|
||||||
|
Elm_Pan_Callback_Type type = (Elm_Pan_Callback_Type) event_info;
|
||||||
|
|
||||||
if (!sid->pan_obj) return;
|
if (!sid->pan_obj) return;
|
||||||
|
|
||||||
|
@ -3638,6 +3644,14 @@ _elm_scroll_pan_changed_cb(void *data,
|
||||||
sid->content_info.resized = EINA_TRUE;
|
sid->content_info.resized = EINA_TRUE;
|
||||||
_elm_scroll_wanted_region_set(sid->obj);
|
_elm_scroll_wanted_region_set(sid->obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (type == ELM_OBJ_PAN_SMART_RESIZE)
|
||||||
|
if (sid->cb_func.content_viewport_resize)
|
||||||
|
{
|
||||||
|
eo_do(sid->obj, elm_scrollable_interface_content_viewport_size_get(&w, &h));
|
||||||
|
sid->cb_func.content_viewport_resize(obj, w, h);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -3919,6 +3933,14 @@ _elm_scroll_content_min_limit_cb_set(Eo *obj EINA_UNUSED, void *_pd, va_list *li
|
||||||
sid->cb_func.content_min_limit = min_limit_cb;
|
sid->cb_func.content_min_limit = min_limit_cb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_elm_scroll_content_viewport_resize_cb_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
|
||||||
|
{
|
||||||
|
Elm_Scrollable_Smart_Interface_Data *sid = _pd;
|
||||||
|
Elm_Interface_Scrollable_Resize_Cb viewport_resize_cb = va_arg(*list, Elm_Interface_Scrollable_Resize_Cb);
|
||||||
|
sid->cb_func.content_viewport_resize = viewport_resize_cb;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_elm_scroll_momentum_animator_disabled_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
|
_elm_scroll_momentum_animator_disabled_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
|
||||||
{
|
{
|
||||||
|
@ -4549,6 +4571,7 @@ _elm_scrollable_interface_constructor(Eo_Class *klass)
|
||||||
EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_HBAR_PRESS_CB_SET), _elm_scroll_hbar_press_cb_set),
|
EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_HBAR_PRESS_CB_SET), _elm_scroll_hbar_press_cb_set),
|
||||||
EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_HBAR_UNPRESS_CB_SET), _elm_scroll_hbar_unpress_cb_set),
|
EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_HBAR_UNPRESS_CB_SET), _elm_scroll_hbar_unpress_cb_set),
|
||||||
EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_MIN_LIMIT_CB_SET), _elm_scroll_content_min_limit_cb_set),
|
EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_MIN_LIMIT_CB_SET), _elm_scroll_content_min_limit_cb_set),
|
||||||
|
EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_VIEWPORT_RESIZE_CB_SET), _elm_scroll_content_viewport_resize_cb_set),
|
||||||
EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_POS_SET), _elm_scroll_content_pos_set),
|
EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_POS_SET), _elm_scroll_content_pos_set),
|
||||||
EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_POS_GET), _elm_scroll_content_pos_get),
|
EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_POS_GET), _elm_scroll_content_pos_get),
|
||||||
EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_REGION_SHOW), _elm_scroll_content_region_show),
|
EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_REGION_SHOW), _elm_scroll_content_region_show),
|
||||||
|
@ -4627,6 +4650,8 @@ static const Eo_Op_Description op_desc[] = {
|
||||||
EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_HBAR_PRESS_CB_SET, "description here"),
|
EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_HBAR_PRESS_CB_SET, "description here"),
|
||||||
EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_HBAR_UNPRESS_CB_SET, "description here"),
|
EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_HBAR_UNPRESS_CB_SET, "description here"),
|
||||||
EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_MIN_LIMIT_CB_SET, "description here"),
|
EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_MIN_LIMIT_CB_SET, "description here"),
|
||||||
|
EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_VIEWPORT_RESIZE_CB_SET,
|
||||||
|
"When the viewport is resized, the callback is called."),
|
||||||
EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_POS_SET, "description here"),
|
EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_POS_SET, "description here"),
|
||||||
EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_POS_GET, "description here"),
|
EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_POS_GET, "description here"),
|
||||||
EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_REGION_SHOW, "description here"),
|
EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_REGION_SHOW, "description here"),
|
||||||
|
|
|
@ -34,6 +34,16 @@
|
||||||
#define ELM_OBJ_PAN_CLASS elm_obj_pan_eo_class_get()
|
#define ELM_OBJ_PAN_CLASS elm_obj_pan_eo_class_get()
|
||||||
const Eo_Class *elm_obj_pan_eo_class_get(void) EINA_CONST;
|
const Eo_Class *elm_obj_pan_eo_class_get(void) EINA_CONST;
|
||||||
|
|
||||||
|
typedef enum _Elm_Pan_Callback_Type
|
||||||
|
{
|
||||||
|
ELM_OBJ_PAN_SMART_RESIZE,
|
||||||
|
ELM_OBJ_PAN_POS_SET,
|
||||||
|
ELM_OBJ_PAN_CONTENT_DEL,
|
||||||
|
ELM_OBJ_PAN_CONTENT_RESIZE,
|
||||||
|
ELM_OBJ_PAN_CONTENT_SET,
|
||||||
|
ELM_OBJ_PAN_LAST
|
||||||
|
} Elm_Pan_Callback_Type;
|
||||||
|
|
||||||
extern EAPI Eo_Op ELM_OBJ_PAN_BASE_ID;
|
extern EAPI Eo_Op ELM_OBJ_PAN_BASE_ID;
|
||||||
|
|
||||||
enum
|
enum
|
||||||
|
@ -172,6 +182,7 @@ enum
|
||||||
ELM_SCROLLABLE_INTERFACE_SUB_ID_HBAR_PRESS_CB_SET,
|
ELM_SCROLLABLE_INTERFACE_SUB_ID_HBAR_PRESS_CB_SET,
|
||||||
ELM_SCROLLABLE_INTERFACE_SUB_ID_HBAR_UNPRESS_CB_SET,
|
ELM_SCROLLABLE_INTERFACE_SUB_ID_HBAR_UNPRESS_CB_SET,
|
||||||
ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_MIN_LIMIT_CB_SET,
|
ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_MIN_LIMIT_CB_SET,
|
||||||
|
ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_VIEWPORT_RESIZE_CB_SET,
|
||||||
ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_POS_SET,
|
ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_POS_SET,
|
||||||
ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_POS_GET,
|
ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_POS_GET,
|
||||||
ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_REGION_SHOW,
|
ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_REGION_SHOW,
|
||||||
|
@ -478,6 +489,17 @@ enum
|
||||||
*/
|
*/
|
||||||
#define elm_scrollable_interface_content_min_limit_cb_set(min_limit_cb) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_MIN_LIMIT_CB_SET), EO_TYPECHECK(Elm_Interface_Scrollable_Min_Limit_Cb, min_limit_cb)
|
#define elm_scrollable_interface_content_min_limit_cb_set(min_limit_cb) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_MIN_LIMIT_CB_SET), EO_TYPECHECK(Elm_Interface_Scrollable_Min_Limit_Cb, min_limit_cb)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @def elm_scrollable_interface_content_viewport_resize_cb_set
|
||||||
|
* @since 1.8
|
||||||
|
*
|
||||||
|
* When the viewport is resized, the callback is called.
|
||||||
|
*
|
||||||
|
* @param[in] viewport_resize_cb
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#define elm_scrollable_interface_content_viewport_resize_cb_set(viewport_resize_cb) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_VIEWPORT_RESIZE_CB_SET), EO_TYPECHECK(Elm_Interface_Scrollable_Resize_Cb, viewport_resize_cb)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @def elm_scrollable_interface_content_pos_set
|
* @def elm_scrollable_interface_content_pos_set
|
||||||
* @since 1.8
|
* @since 1.8
|
||||||
|
@ -1050,6 +1072,7 @@ struct _Elm_Pan_Smart_Data
|
||||||
*/
|
*/
|
||||||
typedef void (*Elm_Interface_Scrollable_Cb)(Evas_Object *, void *data);
|
typedef void (*Elm_Interface_Scrollable_Cb)(Evas_Object *, void *data);
|
||||||
typedef void (*Elm_Interface_Scrollable_Min_Limit_Cb)(Evas_Object *obj, Eina_Bool w, Eina_Bool h);
|
typedef void (*Elm_Interface_Scrollable_Min_Limit_Cb)(Evas_Object *obj, Eina_Bool w, Eina_Bool h);
|
||||||
|
typedef void (*Elm_Interface_Scrollable_Resize_Cb)(Evas_Object *obj, Eina_Bool w, Eina_Bool h);
|
||||||
|
|
||||||
typedef struct _Elm_Scrollable_Smart_Interface_Data
|
typedef struct _Elm_Scrollable_Smart_Interface_Data
|
||||||
Elm_Scrollable_Smart_Interface_Data;
|
Elm_Scrollable_Smart_Interface_Data;
|
||||||
|
@ -1163,6 +1186,7 @@ struct _Elm_Scrollable_Smart_Interface_Data
|
||||||
Elm_Interface_Scrollable_Cb page_change;
|
Elm_Interface_Scrollable_Cb page_change;
|
||||||
|
|
||||||
Elm_Interface_Scrollable_Min_Limit_Cb content_min_limit;
|
Elm_Interface_Scrollable_Min_Limit_Cb content_min_limit;
|
||||||
|
Elm_Interface_Scrollable_Resize_Cb content_viewport_resize;
|
||||||
} cb_func;
|
} cb_func;
|
||||||
|
|
||||||
struct
|
struct
|
||||||
|
|
|
@ -749,6 +749,14 @@ _elm_scroller_content_min_limit_cb(Evas_Object *obj,
|
||||||
elm_layout_sizing_eval(obj);
|
elm_layout_sizing_eval(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_elm_scroller_content_viewport_resize_cb(Evas_Object *obj,
|
||||||
|
Evas_Coord w EINA_UNUSED,
|
||||||
|
Evas_Coord h EINA_UNUSED)
|
||||||
|
{
|
||||||
|
elm_layout_sizing_eval(obj);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_elm_scroller_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
|
_elm_scroller_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
|
||||||
{
|
{
|
||||||
|
@ -804,7 +812,9 @@ _elm_scroller_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
|
||||||
elm_scrollable_interface_hbar_unpress_cb_set(_hbar_unpress_cb),
|
elm_scrollable_interface_hbar_unpress_cb_set(_hbar_unpress_cb),
|
||||||
elm_scrollable_interface_page_change_cb_set(_page_change_cb),
|
elm_scrollable_interface_page_change_cb_set(_page_change_cb),
|
||||||
elm_scrollable_interface_content_min_limit_cb_set
|
elm_scrollable_interface_content_min_limit_cb_set
|
||||||
(_elm_scroller_content_min_limit_cb));
|
(_elm_scroller_content_min_limit_cb),
|
||||||
|
elm_scrollable_interface_content_viewport_resize_cb_set
|
||||||
|
(_elm_scroller_content_viewport_resize_cb));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue