2010-06-03 05:53:14 -07:00
|
|
|
#include <Elementary.h>
|
2010-09-27 11:18:37 -07:00
|
|
|
#include <Elementary_Cursor.h>
|
2010-06-03 05:53:14 -07:00
|
|
|
#include "elm_priv.h"
|
2011-10-06 22:56:07 -07:00
|
|
|
#include "els_scroller.h"
|
2010-06-03 05:53:14 -07:00
|
|
|
|
2011-07-25 12:51:57 -07:00
|
|
|
/* --
|
2010-06-03 05:53:14 -07:00
|
|
|
* TODO:
|
elementry / entry, menu, notify, list, gengrid, actionslider, image, icon, anchorview, fileselector_button, calendar, photocam, anchorblock,
button, map, colorselector, hover, photo, diskselector, index, bubble, pager, hoversel, check, scrolled_entry, clock, flipselector
updated signal callback list in the doxygen.
should update genlist, progressbar ...
SVN revision: 58335
2011-04-04 09:34:18 -07:00
|
|
|
* Handle non-homogeneous objects too.
|
2010-06-03 05:53:14 -07:00
|
|
|
*/
|
|
|
|
|
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
|
|
|
typedef struct _Widget_Data Widget_Data;
|
|
|
|
typedef struct _Pan Pan;
|
2010-06-03 05:53:14 -07:00
|
|
|
|
|
|
|
#define PRELOAD 1
|
2011-06-14 01:36:03 -07:00
|
|
|
#define REORDER_EFFECT_TIME 0.5
|
2010-06-03 05:53:14 -07:00
|
|
|
|
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
|
|
|
struct _Elm_Gengrid_Item
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2010-12-10 05:01:43 -08:00
|
|
|
Elm_Widget_Item base;
|
2010-10-10 16:54:11 -07:00
|
|
|
EINA_INLIST;
|
2010-12-10 05:01:43 -08:00
|
|
|
Evas_Object *spacer;
|
2010-06-03 05:53:14 -07:00
|
|
|
const Elm_Gengrid_Item_Class *gic;
|
2011-10-20 15:23:48 -07:00
|
|
|
Elm_Gengrid_Item *parent;
|
2010-12-10 05:01:43 -08:00
|
|
|
Ecore_Timer *long_timer;
|
2011-06-14 01:36:03 -07:00
|
|
|
Ecore_Animator *item_moving_effect_timer;
|
2010-12-10 05:01:43 -08:00
|
|
|
Widget_Data *wd;
|
|
|
|
Eina_List *labels, *icons, *states, *icon_objs;
|
2010-06-03 05:53:14 -07:00
|
|
|
struct
|
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
|
|
|
{
|
|
|
|
Evas_Smart_Cb func;
|
|
|
|
const void *data;
|
|
|
|
} func;
|
2010-06-03 05:53:14 -07:00
|
|
|
|
2011-09-09 05:43:34 -07:00
|
|
|
Evas_Coord x, y, gx, gy, dx, dy, ox, oy, tx, ty, rx, ry;
|
2011-06-14 01:36:03 -07:00
|
|
|
unsigned int moving_effect_start_time;
|
|
|
|
int relcount;
|
|
|
|
int walking;
|
2011-09-09 05:43:34 -07:00
|
|
|
int prev_group;
|
2010-06-03 05:53:14 -07:00
|
|
|
|
2010-09-27 11:18:37 -07:00
|
|
|
struct
|
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
|
|
|
{
|
|
|
|
const void *data;
|
|
|
|
Elm_Tooltip_Item_Content_Cb content_cb;
|
|
|
|
Evas_Smart_Cb del_cb;
|
|
|
|
const char *style;
|
2011-07-27 19:22:37 -07:00
|
|
|
Eina_Bool free_size : 1;
|
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
|
|
|
} tooltip;
|
2010-09-27 11:18:37 -07:00
|
|
|
|
|
|
|
const char *mouse_cursor;
|
|
|
|
|
2011-09-09 05:43:34 -07:00
|
|
|
Eina_Bool is_group : 1;
|
2010-12-10 05:01:43 -08:00
|
|
|
Eina_Bool want_unrealize : 1;
|
2011-09-09 05:43:34 -07:00
|
|
|
Eina_Bool group_realized : 1;
|
2010-12-10 05:01:43 -08:00
|
|
|
Eina_Bool realized : 1;
|
|
|
|
Eina_Bool dragging : 1;
|
|
|
|
Eina_Bool down : 1;
|
|
|
|
Eina_Bool delete_me : 1;
|
|
|
|
Eina_Bool display_only : 1;
|
|
|
|
Eina_Bool disabled : 1;
|
|
|
|
Eina_Bool selected : 1;
|
2011-08-25 10:19:22 -07:00
|
|
|
Eina_Bool highlighted : 1;
|
2011-06-14 01:36:03 -07:00
|
|
|
Eina_Bool moving : 1;
|
2010-06-03 05:53:14 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _Widget_Data
|
|
|
|
{
|
2011-09-05 13:31:51 -07:00
|
|
|
Eina_Inlist_Sorted_State *state;
|
2010-12-10 05:01:43 -08:00
|
|
|
Evas_Object *self, *scr;
|
|
|
|
Evas_Object *pan_smart;
|
|
|
|
Pan *pan;
|
|
|
|
Eina_Inlist *items;
|
2011-09-09 05:43:34 -07:00
|
|
|
Eina_List *group_items;
|
2010-12-10 05:01:43 -08:00
|
|
|
Ecore_Job *calc_job;
|
|
|
|
Eina_List *selected;
|
2011-06-02 00:09:17 -07:00
|
|
|
Elm_Gengrid_Item *last_selected_item, *reorder_item;
|
2010-12-10 05:01:43 -08:00
|
|
|
double align_x, align_y;
|
|
|
|
|
2011-06-14 01:36:03 -07:00
|
|
|
Evas_Coord pan_x, pan_y, old_pan_x, old_pan_y;
|
2011-10-20 14:41:24 -07:00
|
|
|
Evas_Coord item_width, item_height; /* Each it size */
|
|
|
|
Evas_Coord group_item_width, group_item_height; /* Each group it size */
|
2010-12-10 05:01:43 -08:00
|
|
|
Evas_Coord minw, minh; /* Total obj size */
|
2011-06-02 00:09:17 -07:00
|
|
|
Evas_Coord reorder_item_x, reorder_item_y;
|
2010-12-10 05:01:43 -08:00
|
|
|
unsigned int nmax;
|
|
|
|
long count;
|
2011-09-09 05:43:34 -07:00
|
|
|
long items_lost;
|
2010-12-10 05:01:43 -08:00
|
|
|
int walking;
|
|
|
|
|
|
|
|
Eina_Bool horizontal : 1;
|
|
|
|
Eina_Bool on_hold : 1;
|
|
|
|
Eina_Bool longpressed : 1;
|
|
|
|
Eina_Bool multi : 1;
|
|
|
|
Eina_Bool no_select : 1;
|
|
|
|
Eina_Bool wasselected : 1;
|
|
|
|
Eina_Bool always_select : 1;
|
|
|
|
Eina_Bool clear_me : 1;
|
2011-06-02 00:09:17 -07:00
|
|
|
Eina_Bool h_bounce : 1;
|
|
|
|
Eina_Bool v_bounce : 1;
|
|
|
|
Eina_Bool reorder_mode : 1;
|
|
|
|
Eina_Bool reorder_item_changed : 1;
|
2011-06-14 01:36:03 -07:00
|
|
|
Eina_Bool move_effect_enabled : 1;
|
2010-06-03 05:53:14 -07:00
|
|
|
};
|
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
#define ELM_GENGRID_ITEM_FROM_INLIST(it) \
|
|
|
|
((it) ? EINA_INLIST_CONTAINER_GET(it, Elm_Gengrid_Item) : NULL)
|
2010-10-10 16:54:11 -07:00
|
|
|
|
2010-06-03 05:53:14 -07:00
|
|
|
struct _Pan
|
|
|
|
{
|
|
|
|
Evas_Object_Smart_Clipped_Data __clipped_data;
|
2010-12-10 05:01:43 -08:00
|
|
|
Widget_Data *wd;
|
2010-06-03 05:53:14 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
static const char *widtype = NULL;
|
2011-10-20 14:41:24 -07:00
|
|
|
static void _item_highlight(Elm_Gengrid_Item *it);
|
|
|
|
static void _item_unrealize(Elm_Gengrid_Item *it);
|
|
|
|
static void _item_select(Elm_Gengrid_Item *it);
|
|
|
|
static void _item_unselect(Elm_Gengrid_Item *it);
|
2011-01-04 02:05:27 -08:00
|
|
|
static void _calc_job(void *data);
|
2010-12-10 05:01:43 -08:00
|
|
|
static void _on_focus_hook(void *data,
|
|
|
|
Evas_Object *obj);
|
2010-10-05 12:09:58 -07:00
|
|
|
static Eina_Bool _item_multi_select_up(Widget_Data *wd);
|
|
|
|
static Eina_Bool _item_multi_select_down(Widget_Data *wd);
|
|
|
|
static Eina_Bool _item_multi_select_left(Widget_Data *wd);
|
|
|
|
static Eina_Bool _item_multi_select_right(Widget_Data *wd);
|
|
|
|
static Eina_Bool _item_single_select_up(Widget_Data *wd);
|
|
|
|
static Eina_Bool _item_single_select_down(Widget_Data *wd);
|
|
|
|
static Eina_Bool _item_single_select_left(Widget_Data *wd);
|
|
|
|
static Eina_Bool _item_single_select_right(Widget_Data *wd);
|
2010-12-10 05:01:43 -08:00
|
|
|
static Eina_Bool _event_hook(Evas_Object *obj,
|
|
|
|
Evas_Object *src,
|
|
|
|
Evas_Callback_Type type,
|
|
|
|
void *event_info);
|
2010-10-27 07:38:54 -07:00
|
|
|
static Eina_Bool _deselect_all_items(Widget_Data *wd);
|
2010-06-03 05:53:14 -07:00
|
|
|
|
|
|
|
static Evas_Smart_Class _pan_sc = EVAS_SMART_CLASS_INIT_VERSION;
|
2011-02-08 04:08:28 -08:00
|
|
|
static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
|
2010-06-03 05:53:14 -07:00
|
|
|
|
2011-07-25 18:49:24 -07:00
|
|
|
static const char SIG_ACTIVATED[] = "activated";
|
2011-04-21 17:57:15 -07:00
|
|
|
static const char SIG_CLICKED_DOUBLE[] = "clicked,double";
|
2011-09-11 05:24:40 -07:00
|
|
|
static const char SIG_LONGPRESSED[] = "longpressed";
|
2011-04-21 17:57:15 -07:00
|
|
|
static const char SIG_SELECTED[] = "selected";
|
|
|
|
static const char SIG_UNSELECTED[] = "unselected";
|
|
|
|
static const char SIG_REALIZED[] = "realized";
|
|
|
|
static const char SIG_UNREALIZED[] = "unrealized";
|
|
|
|
static const char SIG_CHANGED[] = "changed";
|
|
|
|
static const char SIG_DRAG_START_UP[] = "drag,start,up";
|
|
|
|
static const char SIG_DRAG_START_DOWN[] = "drag,start,down";
|
|
|
|
static const char SIG_DRAG_START_LEFT[] = "drag,start,left";
|
|
|
|
static const char SIG_DRAG_START_RIGHT[] = "drag,start,right";
|
|
|
|
static const char SIG_DRAG_STOP[] = "drag,stop";
|
|
|
|
static const char SIG_DRAG[] = "drag";
|
|
|
|
static const char SIG_SCROLL[] = "scroll";
|
elm genlist: Added "scroll,anim,start", "scroll,anim,stop",
"scroll,drag,start", "scroll,drag,stop" smart callbacks to genlist.
elm gengrid: Added "scroll,anim,start", "scroll,anim,stop" smart
callbacks to genlist.
SVN revision: 62710
2011-08-22 21:02:26 -07:00
|
|
|
static const char SIG_SCROLL_ANIM_START[] = "scroll,anim,start";
|
|
|
|
static const char SIG_SCROLL_ANIM_STOP[] = "scroll,anim,stop";
|
2011-04-21 17:57:15 -07:00
|
|
|
static const char SIG_SCROLL_DRAG_START[] = "scroll,drag,start";
|
|
|
|
static const char SIG_SCROLL_DRAG_STOP[] = "scroll,drag,stop";
|
2011-10-20 09:42:42 -07:00
|
|
|
static const char SIG_SCROLL_EDGE_TOP[] = "scroll,edge,top"; // TODO : remove this
|
|
|
|
static const char SIG_SCROLL_EDGE_BOTTOM[] = "scroll,edge,bottom"; // TODO : remove this
|
|
|
|
static const char SIG_SCROLL_EDGE_LEFT[] = "scroll,edge,left"; // TODO : remove this
|
|
|
|
static const char SIG_SCROLL_EDGE_RIGHT[] = "scroll,edge,right"; // TODO : remove this
|
|
|
|
static const char SIG_EDGE_TOP[] = "edge,top";
|
|
|
|
static const char SIG_EDGE_BOTTOM[] = "edge,bottom";
|
|
|
|
static const char SIG_EDGE_LEFT[] = "edge,left";
|
|
|
|
static const char SIG_EDGE_RIGHT[] = "edge,right";
|
2011-06-06 18:01:29 -07:00
|
|
|
static const char SIG_MOVED[] = "moved";
|
2011-04-21 17:57:15 -07:00
|
|
|
|
|
|
|
static const Evas_Smart_Cb_Description _signals[] = {
|
2011-07-26 00:00:19 -07:00
|
|
|
{SIG_ACTIVATED, ""},
|
|
|
|
{SIG_CLICKED_DOUBLE, ""},
|
2011-09-11 05:24:40 -07:00
|
|
|
{SIG_LONGPRESSED, ""},
|
2011-07-26 00:00:19 -07:00
|
|
|
{SIG_SELECTED, ""},
|
|
|
|
{SIG_UNSELECTED, ""},
|
|
|
|
{SIG_REALIZED, ""},
|
|
|
|
{SIG_UNREALIZED, ""},
|
|
|
|
{SIG_CHANGED, ""},
|
|
|
|
{SIG_DRAG_START_UP, ""},
|
|
|
|
{SIG_DRAG_START_DOWN, ""},
|
|
|
|
{SIG_DRAG_START_LEFT, ""},
|
|
|
|
{SIG_DRAG_START_RIGHT, ""},
|
|
|
|
{SIG_DRAG_STOP, ""},
|
|
|
|
{SIG_DRAG, ""},
|
|
|
|
{SIG_SCROLL, ""},
|
elm genlist: Added "scroll,anim,start", "scroll,anim,stop",
"scroll,drag,start", "scroll,drag,stop" smart callbacks to genlist.
elm gengrid: Added "scroll,anim,start", "scroll,anim,stop" smart
callbacks to genlist.
SVN revision: 62710
2011-08-22 21:02:26 -07:00
|
|
|
{SIG_SCROLL_ANIM_START, ""},
|
|
|
|
{SIG_SCROLL_ANIM_STOP, ""},
|
2011-07-26 00:00:19 -07:00
|
|
|
{SIG_SCROLL_DRAG_START, ""},
|
|
|
|
{SIG_SCROLL_DRAG_STOP, ""},
|
2011-09-27 08:04:57 -07:00
|
|
|
{SIG_SCROLL_EDGE_TOP, ""},
|
|
|
|
{SIG_SCROLL_EDGE_BOTTOM, ""},
|
|
|
|
{SIG_SCROLL_EDGE_LEFT, ""},
|
|
|
|
{SIG_SCROLL_EDGE_RIGHT, ""},
|
2011-10-20 09:42:42 -07:00
|
|
|
{SIG_EDGE_TOP, ""},
|
|
|
|
{SIG_EDGE_BOTTOM, ""},
|
|
|
|
{SIG_EDGE_LEFT, ""},
|
|
|
|
{SIG_EDGE_RIGHT, ""},
|
2011-07-26 00:00:19 -07:00
|
|
|
{SIG_MOVED, ""},
|
|
|
|
{NULL, NULL}
|
2011-04-21 17:57:15 -07:00
|
|
|
};
|
|
|
|
|
2011-06-25 08:39:05 -07:00
|
|
|
static Eina_Compare_Cb _elm_gengrid_item_compare_cb;
|
2011-06-25 16:20:22 -07:00
|
|
|
static Eina_Compare_Cb _elm_gengrid_item_compare_data_cb;
|
2011-04-21 17:57:15 -07:00
|
|
|
|
2010-10-01 12:03:17 -07:00
|
|
|
static Eina_Bool
|
2010-12-10 05:01:43 -08:00
|
|
|
_event_hook(Evas_Object *obj,
|
|
|
|
Evas_Object *src __UNUSED__,
|
|
|
|
Evas_Callback_Type type,
|
|
|
|
void *event_info)
|
2010-10-01 12:03:17 -07:00
|
|
|
{
|
|
|
|
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
|
|
|
Evas_Event_Key_Down *ev = event_info;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return EINA_FALSE;
|
2010-10-27 07:38:57 -07:00
|
|
|
if (!wd->items) return EINA_FALSE;
|
2010-10-01 12:03:17 -07:00
|
|
|
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
|
|
|
|
if (elm_widget_disabled_get(obj)) return EINA_FALSE;
|
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
Elm_Gengrid_Item *it = NULL;
|
2010-10-01 12:03:17 -07:00
|
|
|
Evas_Coord x = 0;
|
|
|
|
Evas_Coord y = 0;
|
|
|
|
Evas_Coord step_x = 0;
|
|
|
|
Evas_Coord step_y = 0;
|
|
|
|
Evas_Coord v_w = 0;
|
|
|
|
Evas_Coord v_h = 0;
|
|
|
|
Evas_Coord page_x = 0;
|
|
|
|
Evas_Coord page_y = 0;
|
|
|
|
|
|
|
|
elm_smart_scroller_child_pos_get(wd->scr, &x, &y);
|
|
|
|
elm_smart_scroller_step_size_get(wd->scr, &step_x, &step_y);
|
|
|
|
elm_smart_scroller_page_size_get(wd->scr, &page_x, &page_y);
|
|
|
|
elm_smart_scroller_child_viewport_size_get(wd->scr, &v_w, &v_h);
|
|
|
|
|
2010-10-22 14:41:22 -07:00
|
|
|
if ((!strcmp(ev->keyname, "Left")) || (!strcmp(ev->keyname, "KP_Left")))
|
2010-10-01 12:03:17 -07:00
|
|
|
{
|
2010-11-10 10:04:28 -08:00
|
|
|
if ((wd->horizontal) &&
|
|
|
|
(((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
|
|
|
|
(_item_multi_select_up(wd)))
|
|
|
|
|| (_item_single_select_up(wd))))
|
|
|
|
{
|
|
|
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
else if ((!wd->horizontal) &&
|
|
|
|
(((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
|
|
|
|
(_item_multi_select_left(wd)))
|
|
|
|
|| (_item_single_select_left(wd))))
|
2010-10-05 12:09:58 -07:00
|
|
|
{
|
|
|
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
x -= step_x;
|
2010-10-01 12:03:17 -07:00
|
|
|
}
|
2010-10-22 14:41:22 -07:00
|
|
|
else if ((!strcmp(ev->keyname, "Right")) || (!strcmp(ev->keyname, "KP_Right")))
|
2010-10-01 12:03:17 -07:00
|
|
|
{
|
2010-11-10 10:04:28 -08:00
|
|
|
if ((wd->horizontal) &&
|
|
|
|
(((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
|
|
|
|
(_item_multi_select_down(wd)))
|
|
|
|
|| (_item_single_select_down(wd))))
|
|
|
|
{
|
|
|
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
else if ((!wd->horizontal) &&
|
|
|
|
(((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
|
|
|
|
(_item_multi_select_right(wd)))
|
|
|
|
|| (_item_single_select_right(wd))))
|
2010-10-05 12:09:58 -07:00
|
|
|
{
|
|
|
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
x += step_x;
|
2010-10-01 12:03:17 -07:00
|
|
|
}
|
2010-12-10 05:01:43 -08:00
|
|
|
else if ((!strcmp(ev->keyname, "Up")) || (!strcmp(ev->keyname, "KP_Up")))
|
2010-10-01 12:03:17 -07:00
|
|
|
{
|
2010-11-10 10:04:28 -08:00
|
|
|
if ((wd->horizontal) &&
|
|
|
|
(((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
|
|
|
|
(_item_multi_select_left(wd)))
|
|
|
|
|| (_item_single_select_left(wd))))
|
|
|
|
{
|
|
|
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
else if ((!wd->horizontal) &&
|
|
|
|
(((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
|
|
|
|
(_item_multi_select_up(wd)))
|
|
|
|
|| (_item_single_select_up(wd))))
|
2010-10-05 12:09:58 -07:00
|
|
|
{
|
|
|
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
y -= step_y;
|
2010-10-01 12:03:17 -07:00
|
|
|
}
|
2010-10-22 14:41:22 -07:00
|
|
|
else if ((!strcmp(ev->keyname, "Down")) || (!strcmp(ev->keyname, "KP_Down")))
|
2010-10-01 12:03:17 -07:00
|
|
|
{
|
2010-11-10 10:04:28 -08:00
|
|
|
if ((wd->horizontal) &&
|
|
|
|
(((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
|
|
|
|
(_item_multi_select_right(wd)))
|
|
|
|
|| (_item_single_select_right(wd))))
|
|
|
|
{
|
|
|
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
else if ((!wd->horizontal) &&
|
|
|
|
(((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
|
|
|
|
(_item_multi_select_down(wd)))
|
|
|
|
|| (_item_single_select_down(wd))))
|
2010-10-05 12:09:58 -07:00
|
|
|
{
|
|
|
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
y += step_y;
|
2010-10-01 12:03:17 -07:00
|
|
|
}
|
2010-11-29 05:56:33 -08:00
|
|
|
else if ((!strcmp(ev->keyname, "Home")) || (!strcmp(ev->keyname, "KP_Home")))
|
2010-10-01 12:03:17 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
it = elm_gengrid_first_item_get(obj);
|
|
|
|
elm_gengrid_item_bring_in(it);
|
2010-10-01 12:03:17 -07:00
|
|
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
2010-11-29 05:56:33 -08:00
|
|
|
else if ((!strcmp(ev->keyname, "End")) || (!strcmp(ev->keyname, "KP_End")))
|
2010-10-01 12:03:17 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
it = elm_gengrid_last_item_get(obj);
|
|
|
|
elm_gengrid_item_bring_in(it);
|
2010-10-01 12:03:17 -07:00
|
|
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
2011-10-20 14:49:54 -07:00
|
|
|
else if ((!strcmp(ev->keyname, "Prior")) || (!strcmp(ev->keyname, "KP_Prior")))
|
2010-10-01 12:03:17 -07:00
|
|
|
{
|
2010-11-10 10:04:28 -08:00
|
|
|
if (wd->horizontal)
|
|
|
|
{
|
|
|
|
if (page_x < 0)
|
|
|
|
x -= -(page_x * v_w) / 100;
|
|
|
|
else
|
|
|
|
x -= page_x;
|
|
|
|
}
|
2010-10-01 12:03:17 -07:00
|
|
|
else
|
2010-11-10 10:04:28 -08:00
|
|
|
{
|
|
|
|
if (page_y < 0)
|
|
|
|
y -= -(page_y * v_h) / 100;
|
|
|
|
else
|
|
|
|
y -= page_y;
|
|
|
|
}
|
2010-10-01 12:03:17 -07:00
|
|
|
}
|
2010-11-29 05:56:33 -08:00
|
|
|
else if ((!strcmp(ev->keyname, "Next")) || (!strcmp(ev->keyname, "KP_Next")))
|
2010-10-01 12:03:17 -07:00
|
|
|
{
|
2010-11-10 10:04:28 -08:00
|
|
|
if (wd->horizontal)
|
|
|
|
{
|
|
|
|
if (page_x < 0)
|
|
|
|
x += -(page_x * v_w) / 100;
|
|
|
|
else
|
|
|
|
x += page_x;
|
|
|
|
}
|
2010-10-01 12:03:17 -07:00
|
|
|
else
|
2010-11-10 10:04:28 -08:00
|
|
|
{
|
|
|
|
if (page_y < 0)
|
|
|
|
y += -(page_y * v_h) / 100;
|
|
|
|
else
|
|
|
|
y += page_y;
|
|
|
|
}
|
2010-10-01 12:03:17 -07:00
|
|
|
}
|
2010-10-27 07:38:54 -07:00
|
|
|
else if (!strcmp(ev->keyname, "Escape"))
|
|
|
|
{
|
2010-12-10 05:01:43 -08:00
|
|
|
if (!_deselect_all_items(wd)) return EINA_FALSE;
|
|
|
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
|
|
|
return EINA_TRUE;
|
2010-10-27 07:38:54 -07:00
|
|
|
}
|
2011-03-10 01:24:49 -08:00
|
|
|
else if ((!strcmp(ev->keyname, "Return")) ||
|
|
|
|
(!strcmp(ev->keyname, "KP_Enter")) ||
|
|
|
|
(!strcmp(ev->keyname, "space")))
|
2011-02-17 12:12:43 -08:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
it = elm_gengrid_selected_item_get(obj);
|
|
|
|
evas_object_smart_callback_call(it->wd->self, SIG_ACTIVATED, it);
|
2011-02-17 12:12:43 -08:00
|
|
|
}
|
2010-10-01 12:03:17 -07:00
|
|
|
else return EINA_FALSE;
|
|
|
|
|
|
|
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
|
|
|
elm_smart_scroller_child_pos_set(wd->scr, x, y);
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2010-10-27 07:38:54 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_deselect_all_items(Widget_Data *wd)
|
|
|
|
{
|
|
|
|
if (!wd->selected) return EINA_FALSE;
|
2011-10-20 15:23:48 -07:00
|
|
|
while (wd->selected)
|
2010-10-27 07:38:54 -07:00
|
|
|
elm_gengrid_item_selected_set(wd->selected->data, EINA_FALSE);
|
|
|
|
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2010-10-05 12:09:58 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_item_multi_select_left(Widget_Data *wd)
|
|
|
|
{
|
|
|
|
if (!wd->selected) return EINA_FALSE;
|
|
|
|
|
2010-10-10 16:54:11 -07:00
|
|
|
Elm_Gengrid_Item *prev = elm_gengrid_item_prev_get(wd->last_selected_item);
|
|
|
|
if (!prev) return EINA_TRUE;
|
2010-10-05 12:09:58 -07:00
|
|
|
if (elm_gengrid_item_selected_get(prev))
|
|
|
|
{
|
|
|
|
elm_gengrid_item_selected_set(wd->last_selected_item, EINA_FALSE);
|
|
|
|
wd->last_selected_item = prev;
|
|
|
|
elm_gengrid_item_show(wd->last_selected_item);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
elm_gengrid_item_selected_set(prev, EINA_TRUE);
|
|
|
|
elm_gengrid_item_show(prev);
|
|
|
|
}
|
|
|
|
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_item_multi_select_right(Widget_Data *wd)
|
|
|
|
{
|
|
|
|
if (!wd->selected) return EINA_FALSE;
|
|
|
|
|
2010-10-10 16:54:11 -07:00
|
|
|
Elm_Gengrid_Item *next = elm_gengrid_item_next_get(wd->last_selected_item);
|
|
|
|
if (!next) return EINA_TRUE;
|
2010-10-05 12:09:58 -07:00
|
|
|
if (elm_gengrid_item_selected_get(next))
|
|
|
|
{
|
|
|
|
elm_gengrid_item_selected_set(wd->last_selected_item, EINA_FALSE);
|
|
|
|
wd->last_selected_item = next;
|
|
|
|
elm_gengrid_item_show(wd->last_selected_item);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
elm_gengrid_item_selected_set(next, EINA_TRUE);
|
|
|
|
elm_gengrid_item_show(next);
|
|
|
|
}
|
|
|
|
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2010-10-10 16:54:11 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_item_multi_select_up(Widget_Data *wd)
|
|
|
|
{
|
|
|
|
unsigned int i;
|
|
|
|
Eina_Bool r = EINA_TRUE;
|
|
|
|
|
|
|
|
if (!wd->selected) return EINA_FALSE;
|
|
|
|
|
2010-10-22 14:41:22 -07:00
|
|
|
for (i = 0; (r) && (i < wd->nmax); i++)
|
2010-10-10 16:54:11 -07:00
|
|
|
r &= _item_multi_select_left(wd);
|
|
|
|
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_item_multi_select_down(Widget_Data *wd)
|
|
|
|
{
|
|
|
|
unsigned int i;
|
|
|
|
Eina_Bool r = EINA_TRUE;
|
|
|
|
|
|
|
|
if (!wd->selected) return EINA_FALSE;
|
|
|
|
|
2010-10-22 14:41:22 -07:00
|
|
|
for (i = 0; (r) && (i < wd->nmax); i++)
|
2010-10-10 16:54:11 -07:00
|
|
|
r &= _item_multi_select_right(wd);
|
|
|
|
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
|
2010-10-05 12:09:58 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_item_single_select_up(Widget_Data *wd)
|
|
|
|
{
|
|
|
|
unsigned int i;
|
2010-10-10 16:54:11 -07:00
|
|
|
|
2010-10-27 07:38:57 -07:00
|
|
|
Elm_Gengrid_Item *prev;
|
2010-10-05 12:09:58 -07:00
|
|
|
|
2010-10-27 07:38:57 -07:00
|
|
|
if (!wd->selected)
|
|
|
|
{
|
|
|
|
prev = ELM_GENGRID_ITEM_FROM_INLIST(wd->items->last);
|
|
|
|
while ((prev) && (prev->delete_me))
|
|
|
|
prev = ELM_GENGRID_ITEM_FROM_INLIST(EINA_INLIST_GET(prev)->prev);
|
|
|
|
elm_gengrid_item_selected_set(prev, EINA_TRUE);
|
|
|
|
elm_gengrid_item_show(prev);
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
else prev = elm_gengrid_item_prev_get(wd->last_selected_item);
|
|
|
|
|
|
|
|
if (!prev) return EINA_FALSE;
|
2010-10-05 12:09:58 -07:00
|
|
|
|
2010-10-10 16:54:11 -07:00
|
|
|
for (i = 1; i < wd->nmax; i++)
|
|
|
|
{
|
|
|
|
Elm_Gengrid_Item *tmp = elm_gengrid_item_prev_get(prev);
|
2010-10-27 07:38:57 -07:00
|
|
|
if (!tmp) return EINA_FALSE;
|
2010-10-10 16:54:11 -07:00
|
|
|
prev = tmp;
|
|
|
|
}
|
2010-10-05 12:09:58 -07:00
|
|
|
|
2010-10-27 07:38:57 -07:00
|
|
|
_deselect_all_items(wd);
|
|
|
|
|
2010-10-05 12:09:58 -07:00
|
|
|
elm_gengrid_item_selected_set(prev, EINA_TRUE);
|
|
|
|
elm_gengrid_item_show(prev);
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_item_single_select_down(Widget_Data *wd)
|
|
|
|
{
|
|
|
|
unsigned int i;
|
2010-10-10 16:54:11 -07:00
|
|
|
|
2010-10-27 07:38:57 -07:00
|
|
|
Elm_Gengrid_Item *next;
|
2010-10-05 12:09:58 -07:00
|
|
|
|
2010-10-27 07:38:57 -07:00
|
|
|
if (!wd->selected)
|
|
|
|
{
|
|
|
|
next = ELM_GENGRID_ITEM_FROM_INLIST(wd->items);
|
|
|
|
while ((next) && (next->delete_me))
|
|
|
|
next = ELM_GENGRID_ITEM_FROM_INLIST(EINA_INLIST_GET(next)->next);
|
|
|
|
elm_gengrid_item_selected_set(next, EINA_TRUE);
|
|
|
|
elm_gengrid_item_show(next);
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
else next = elm_gengrid_item_next_get(wd->last_selected_item);
|
|
|
|
|
|
|
|
if (!next) return EINA_FALSE;
|
2010-10-05 12:09:58 -07:00
|
|
|
|
2010-10-10 16:54:11 -07:00
|
|
|
for (i = 1; i < wd->nmax; i++)
|
|
|
|
{
|
|
|
|
Elm_Gengrid_Item *tmp = elm_gengrid_item_next_get(next);
|
2010-10-27 07:38:57 -07:00
|
|
|
if (!tmp) return EINA_FALSE;
|
2010-10-10 16:54:11 -07:00
|
|
|
next = tmp;
|
|
|
|
}
|
2010-10-05 12:09:58 -07:00
|
|
|
|
2010-10-27 07:38:57 -07:00
|
|
|
_deselect_all_items(wd);
|
|
|
|
|
2010-10-05 12:09:58 -07:00
|
|
|
elm_gengrid_item_selected_set(next, EINA_TRUE);
|
|
|
|
elm_gengrid_item_show(next);
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_item_single_select_left(Widget_Data *wd)
|
|
|
|
{
|
2010-10-27 07:38:57 -07:00
|
|
|
Elm_Gengrid_Item *prev;
|
|
|
|
if (!wd->selected)
|
|
|
|
{
|
|
|
|
prev = ELM_GENGRID_ITEM_FROM_INLIST(wd->items->last);
|
|
|
|
while ((prev) && (prev->delete_me))
|
|
|
|
prev = ELM_GENGRID_ITEM_FROM_INLIST(EINA_INLIST_GET(prev)->prev);
|
|
|
|
}
|
|
|
|
else prev = elm_gengrid_item_prev_get(wd->last_selected_item);
|
|
|
|
|
2010-10-10 16:54:11 -07:00
|
|
|
if (!prev) return EINA_FALSE;
|
2010-10-05 12:09:58 -07:00
|
|
|
|
2010-10-27 07:38:54 -07:00
|
|
|
_deselect_all_items(wd);
|
2010-10-05 12:09:58 -07:00
|
|
|
|
|
|
|
elm_gengrid_item_selected_set(prev, EINA_TRUE);
|
|
|
|
elm_gengrid_item_show(prev);
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_item_single_select_right(Widget_Data *wd)
|
|
|
|
{
|
2010-10-27 07:38:57 -07:00
|
|
|
Elm_Gengrid_Item *next;
|
|
|
|
if (!wd->selected)
|
|
|
|
{
|
|
|
|
next = ELM_GENGRID_ITEM_FROM_INLIST(wd->items);
|
|
|
|
while ((next) && (next->delete_me))
|
|
|
|
next = ELM_GENGRID_ITEM_FROM_INLIST(EINA_INLIST_GET(next)->next);
|
|
|
|
}
|
|
|
|
else next = elm_gengrid_item_next_get(wd->last_selected_item);
|
|
|
|
|
2010-10-10 16:54:11 -07:00
|
|
|
if (!next) return EINA_FALSE;
|
2010-10-05 12:09:58 -07:00
|
|
|
|
2010-10-27 07:38:54 -07:00
|
|
|
_deselect_all_items(wd);
|
2010-10-05 12:09:58 -07:00
|
|
|
|
|
|
|
elm_gengrid_item_selected_set(next, EINA_TRUE);
|
|
|
|
elm_gengrid_item_show(next);
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2010-10-01 12:03:17 -07:00
|
|
|
static void
|
2010-12-10 05:01:43 -08:00
|
|
|
_on_focus_hook(void *data __UNUSED__,
|
|
|
|
Evas_Object *obj)
|
2010-10-01 12:03:17 -07:00
|
|
|
{
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
if (elm_widget_focus_get(obj))
|
|
|
|
{
|
|
|
|
edje_object_signal_emit(wd->self, "elm,action,focus", "elm");
|
|
|
|
evas_object_focus_set(wd->self, EINA_TRUE);
|
2010-10-22 14:41:22 -07:00
|
|
|
if ((wd->selected) && (!wd->last_selected_item))
|
2010-10-05 12:09:58 -07:00
|
|
|
wd->last_selected_item = eina_list_data_get(wd->selected);
|
2010-10-01 12:03:17 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
edje_object_signal_emit(wd->self, "elm,action,unfocus", "elm");
|
|
|
|
evas_object_focus_set(wd->self, EINA_FALSE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-02-08 04:08:28 -08:00
|
|
|
static void
|
|
|
|
_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
|
|
|
|
{
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
2011-10-20 14:41:24 -07:00
|
|
|
Elm_Gengrid_Item *it;
|
2011-02-08 04:08:28 -08:00
|
|
|
if (!wd) return;
|
|
|
|
elm_smart_scroller_mirrored_set(wd->scr, rtl);
|
|
|
|
if (!wd->items) return;
|
2011-10-20 14:41:24 -07:00
|
|
|
it = ELM_GENGRID_ITEM_FROM_INLIST(wd->items);
|
2011-02-08 04:08:28 -08:00
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
while (it)
|
2011-02-08 04:08:28 -08:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
edje_object_mirrored_set(it->base.view, rtl);
|
|
|
|
elm_gengrid_item_update(it);
|
|
|
|
it = ELM_GENGRID_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
|
2011-02-08 04:08:28 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-06-03 05:53:14 -07:00
|
|
|
static void
|
|
|
|
_theme_hook(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
2011-02-09 08:14:02 -08:00
|
|
|
_elm_widget_mirrored_reload(obj);
|
2011-02-08 04:08:28 -08:00
|
|
|
_mirrored_set(obj, elm_widget_mirrored_get(obj));
|
2010-06-03 05:53:14 -07:00
|
|
|
elm_smart_scroller_object_theme_set(obj, wd->scr, "gengrid", "base",
|
|
|
|
elm_widget_style_get(obj));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-09-09 18:40:50 -07:00
|
|
|
_del_pre_hook(Evas_Object *obj)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
2010-07-15 15:34:55 -07:00
|
|
|
elm_gengrid_clear(obj);
|
2010-06-03 05:53:14 -07:00
|
|
|
evas_object_del(wd->pan_smart);
|
|
|
|
wd->pan_smart = NULL;
|
2010-09-09 18:40:50 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_del_hook(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
2010-06-03 05:53:14 -07:00
|
|
|
free(wd);
|
|
|
|
}
|
|
|
|
|
2010-09-09 15:01:30 -07:00
|
|
|
static void
|
2010-12-10 05:01:43 -08:00
|
|
|
_signal_emit_hook(Evas_Object *obj,
|
|
|
|
const char *emission,
|
|
|
|
const char *source)
|
2010-09-09 15:01:30 -07:00
|
|
|
{
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
edje_object_signal_emit(elm_smart_scroller_edje_object_get(wd->scr),
|
|
|
|
emission, source);
|
|
|
|
}
|
|
|
|
|
2011-10-03 18:24:08 -07:00
|
|
|
static void
|
|
|
|
_signal_callback_add_hook(Evas_Object *obj,
|
|
|
|
const char *emission,
|
|
|
|
const char *source,
|
|
|
|
Edje_Signal_Cb func_cb,
|
|
|
|
void *data)
|
|
|
|
{
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
edje_object_signal_callback_add(elm_smart_scroller_edje_object_get(wd->scr),
|
|
|
|
emission, source, func_cb, data);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_signal_callback_del_hook(Evas_Object *obj,
|
|
|
|
const char *emission,
|
|
|
|
const char *source,
|
|
|
|
Edje_Signal_Cb func_cb,
|
|
|
|
void *data)
|
|
|
|
{
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
edje_object_signal_callback_del_full(elm_smart_scroller_edje_object_get(wd->scr),
|
|
|
|
emission, source, func_cb, data);
|
|
|
|
}
|
|
|
|
|
2010-06-03 05:53:14 -07:00
|
|
|
static void
|
2010-12-10 05:01:43 -08:00
|
|
|
_mouse_move(void *data,
|
|
|
|
Evas *evas __UNUSED__,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
Elm_Gengrid_Item *it = data;
|
2010-06-03 05:53:14 -07:00
|
|
|
Evas_Event_Mouse_Move *ev = event_info;
|
|
|
|
Evas_Coord minw = 0, minh = 0, x, y, dx, dy, adx, ady;
|
2011-06-02 00:09:17 -07:00
|
|
|
Evas_Coord ox, oy, ow, oh, it_scrl_x, it_scrl_y;
|
2010-06-03 05:53:14 -07:00
|
|
|
|
|
|
|
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
|
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
if (!it->wd->on_hold)
|
2010-12-10 05:01:43 -08:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
it->wd->on_hold = EINA_TRUE;
|
|
|
|
if (!it->wd->wasselected)
|
|
|
|
_item_unselect(it);
|
2010-12-10 05:01:43 -08:00
|
|
|
}
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
2011-10-20 14:41:24 -07:00
|
|
|
if ((it->dragging) && (it->down))
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->long_timer)
|
2010-12-10 05:01:43 -08:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ecore_timer_del(it->long_timer);
|
|
|
|
it->long_timer = NULL;
|
2010-12-10 05:01:43 -08:00
|
|
|
}
|
2011-10-20 14:41:24 -07:00
|
|
|
evas_object_smart_callback_call(it->wd->self, SIG_DRAG, it);
|
2010-12-10 05:01:43 -08:00
|
|
|
return;
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
2011-10-20 14:41:24 -07:00
|
|
|
if ((!it->down) || (it->wd->longpressed))
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->long_timer)
|
2010-12-10 05:01:43 -08:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ecore_timer_del(it->long_timer);
|
|
|
|
it->long_timer = NULL;
|
2010-12-10 05:01:43 -08:00
|
|
|
}
|
2011-10-20 14:41:24 -07:00
|
|
|
if ((it->wd->reorder_mode) && (it->wd->reorder_item))
|
2011-06-02 00:09:17 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
evas_object_geometry_get(it->wd->pan_smart, &ox, &oy, &ow, &oh);
|
2011-06-02 00:09:17 -07:00
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
it_scrl_x = ev->cur.canvas.x - it->wd->reorder_item->dx;
|
|
|
|
it_scrl_y = ev->cur.canvas.y - it->wd->reorder_item->dy;
|
2011-06-02 00:09:17 -07:00
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it_scrl_x < ox) it->wd->reorder_item_x = ox;
|
|
|
|
else if (it_scrl_x + it->wd->item_width > ox + ow)
|
|
|
|
it->wd->reorder_item_x = ox + ow - it->wd->item_width;
|
|
|
|
else it->wd->reorder_item_x = it_scrl_x;
|
2011-06-02 00:09:17 -07:00
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it_scrl_y < oy) it->wd->reorder_item_y = oy;
|
|
|
|
else if (it_scrl_y + it->wd->item_height > oy + oh)
|
|
|
|
it->wd->reorder_item_y = oy + oh - it->wd->item_height;
|
|
|
|
else it->wd->reorder_item_y = it_scrl_y;
|
2011-06-02 00:09:17 -07:00
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->wd->calc_job) ecore_job_del(it->wd->calc_job);
|
|
|
|
it->wd->calc_job = ecore_job_add(_calc_job, it->wd);
|
2011-06-02 00:09:17 -07:00
|
|
|
}
|
2010-12-10 05:01:43 -08:00
|
|
|
return;
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
2011-10-20 14:41:24 -07:00
|
|
|
if (!it->display_only)
|
2010-06-03 05:53:14 -07:00
|
|
|
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
|
|
|
|
evas_object_geometry_get(obj, &x, &y, NULL, NULL);
|
|
|
|
x = ev->cur.canvas.x - x;
|
|
|
|
y = ev->cur.canvas.y - y;
|
2011-10-20 14:41:24 -07:00
|
|
|
dx = x - it->dx;
|
2010-06-03 05:53:14 -07:00
|
|
|
adx = dx;
|
|
|
|
if (adx < 0) adx = -dx;
|
2011-10-20 14:41:24 -07:00
|
|
|
dy = y - it->dy;
|
2010-06-03 05:53:14 -07:00
|
|
|
ady = dy;
|
|
|
|
if (ady < 0) ady = -dy;
|
|
|
|
minw /= 2;
|
|
|
|
minh /= 2;
|
|
|
|
if ((adx > minw) || (ady > minh))
|
|
|
|
{
|
2011-02-08 04:08:28 -08:00
|
|
|
const char *left_drag, *right_drag;
|
2011-10-20 14:41:24 -07:00
|
|
|
if (!elm_widget_mirrored_get(it->wd->self))
|
2011-02-08 04:08:28 -08:00
|
|
|
{
|
2011-04-21 17:57:15 -07:00
|
|
|
left_drag = SIG_DRAG_START_LEFT;
|
|
|
|
right_drag = SIG_DRAG_START_RIGHT;
|
2011-02-08 04:08:28 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-04-21 17:57:15 -07:00
|
|
|
left_drag = SIG_DRAG_START_RIGHT;
|
|
|
|
right_drag = SIG_DRAG_START_LEFT;
|
2011-02-08 04:08:28 -08:00
|
|
|
}
|
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
it->dragging = 1;
|
|
|
|
if (it->long_timer)
|
2010-12-10 05:01:43 -08:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ecore_timer_del(it->long_timer);
|
|
|
|
it->long_timer = NULL;
|
2010-12-10 05:01:43 -08:00
|
|
|
}
|
2011-10-20 14:41:24 -07:00
|
|
|
if (!it->wd->wasselected)
|
|
|
|
_item_unselect(it);
|
2010-12-10 05:01:43 -08:00
|
|
|
if (dy < 0)
|
|
|
|
{
|
|
|
|
if (ady > adx)
|
2011-10-20 14:41:24 -07:00
|
|
|
evas_object_smart_callback_call(it->wd->self, SIG_DRAG_START_UP,
|
|
|
|
it);
|
2010-12-10 05:01:43 -08:00
|
|
|
else
|
|
|
|
{
|
|
|
|
if (dx < 0)
|
2011-10-20 14:41:24 -07:00
|
|
|
evas_object_smart_callback_call(it->wd->self,
|
|
|
|
left_drag, it);
|
2010-12-10 05:01:43 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (ady > adx)
|
2011-10-20 14:41:24 -07:00
|
|
|
evas_object_smart_callback_call(it->wd->self,
|
|
|
|
SIG_DRAG_START_DOWN, it);
|
2010-12-10 05:01:43 -08:00
|
|
|
else
|
|
|
|
{
|
|
|
|
if (dx < 0)
|
2011-10-20 14:41:24 -07:00
|
|
|
evas_object_smart_callback_call(it->wd->self,
|
|
|
|
left_drag, it);
|
2010-12-10 05:01:43 -08:00
|
|
|
else
|
2011-10-20 14:41:24 -07:00
|
|
|
evas_object_smart_callback_call(it->wd->self,
|
|
|
|
right_drag, it);
|
2010-12-10 05:01:43 -08:00
|
|
|
}
|
|
|
|
}
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-06-25 02:58:14 -07:00
|
|
|
static Eina_Bool
|
2010-06-03 05:53:14 -07:00
|
|
|
_long_press(void *data)
|
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
Elm_Gengrid_Item *it = data;
|
2010-06-03 05:53:14 -07:00
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
it->long_timer = NULL;
|
|
|
|
if ((it->disabled) || (it->dragging)) return ECORE_CALLBACK_CANCEL;
|
|
|
|
it->wd->longpressed = EINA_TRUE;
|
|
|
|
evas_object_smart_callback_call(it->wd->self, SIG_LONGPRESSED, it);
|
|
|
|
if (it->wd->reorder_mode)
|
2011-06-02 00:09:17 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
it->wd->reorder_item = it;
|
|
|
|
evas_object_raise(it->base.view);
|
|
|
|
elm_smart_scroller_hold_set(it->wd->scr, EINA_TRUE);
|
|
|
|
elm_smart_scroller_bounce_allow_set(it->wd->scr, EINA_FALSE, EINA_FALSE);
|
|
|
|
edje_object_signal_emit(it->base.view, "elm,state,reorder,enabled", "elm");
|
2011-06-02 00:09:17 -07:00
|
|
|
}
|
2010-06-25 02:58:14 -07:00
|
|
|
return ECORE_CALLBACK_CANCEL;
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-12-10 05:01:43 -08:00
|
|
|
_mouse_down(void *data,
|
|
|
|
Evas *evas __UNUSED__,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
Elm_Gengrid_Item *it = data;
|
2010-06-03 05:53:14 -07:00
|
|
|
Evas_Event_Mouse_Down *ev = event_info;
|
|
|
|
Evas_Coord x, y;
|
|
|
|
|
|
|
|
if (ev->button != 1) return;
|
2011-10-20 14:41:24 -07:00
|
|
|
it->down = 1;
|
|
|
|
it->dragging = 0;
|
2010-06-03 05:53:14 -07:00
|
|
|
evas_object_geometry_get(obj, &x, &y, NULL, NULL);
|
2011-10-20 14:41:24 -07:00
|
|
|
it->dx = ev->canvas.x - x;
|
|
|
|
it->dy = ev->canvas.y - y;
|
|
|
|
it->wd->longpressed = EINA_FALSE;
|
|
|
|
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) it->wd->on_hold = EINA_TRUE;
|
|
|
|
else it->wd->on_hold = EINA_FALSE;
|
|
|
|
it->wd->wasselected = it->selected;
|
|
|
|
_item_highlight(it);
|
2010-06-03 05:53:14 -07:00
|
|
|
if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
|
2011-04-03 02:36:47 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
evas_object_smart_callback_call(it->wd->self, SIG_CLICKED_DOUBLE, it);
|
|
|
|
evas_object_smart_callback_call(it->wd->self, SIG_ACTIVATED, it);
|
2011-04-03 02:36:47 -07:00
|
|
|
}
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->long_timer) ecore_timer_del(it->long_timer);
|
|
|
|
if (it->realized)
|
|
|
|
it->long_timer = ecore_timer_add(_elm_config->longpress_timeout,
|
|
|
|
_long_press, it);
|
2010-06-03 05:53:14 -07:00
|
|
|
else
|
2011-10-20 14:41:24 -07:00
|
|
|
it->long_timer = NULL;
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-12-10 05:01:43 -08:00
|
|
|
_mouse_up(void *data,
|
|
|
|
Evas *evas __UNUSED__,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
Elm_Gengrid_Item *it = data;
|
2010-06-03 05:53:14 -07:00
|
|
|
Evas_Event_Mouse_Up *ev = event_info;
|
|
|
|
Eina_Bool dragged = EINA_FALSE;
|
|
|
|
|
|
|
|
if (ev->button != 1) return;
|
2011-10-20 14:41:24 -07:00
|
|
|
it->down = EINA_FALSE;
|
|
|
|
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) it->wd->on_hold = EINA_TRUE;
|
|
|
|
else it->wd->on_hold = EINA_FALSE;
|
|
|
|
if (it->long_timer)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ecore_timer_del(it->long_timer);
|
|
|
|
it->long_timer = NULL;
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->dragging)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
it->dragging = EINA_FALSE;
|
|
|
|
evas_object_smart_callback_call(it->wd->self, SIG_DRAG_STOP, it);
|
2010-12-10 05:01:43 -08:00
|
|
|
dragged = EINA_TRUE;
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->wd->on_hold)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
it->wd->longpressed = EINA_FALSE;
|
|
|
|
it->wd->on_hold = EINA_FALSE;
|
2010-12-10 05:01:43 -08:00
|
|
|
return;
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
2011-10-20 14:41:24 -07:00
|
|
|
if ((it->wd->reorder_mode) && (it->wd->reorder_item))
|
2011-06-02 00:09:17 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
evas_object_smart_callback_call(it->wd->self, SIG_MOVED, it->wd->reorder_item);
|
|
|
|
it->wd->reorder_item = NULL;
|
|
|
|
it->wd->move_effect_enabled = EINA_FALSE;
|
|
|
|
if (it->wd->calc_job) ecore_job_del(it->wd->calc_job);
|
|
|
|
it->wd->calc_job = ecore_job_add(_calc_job, it->wd);
|
2011-06-02 00:09:17 -07:00
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_smart_scroller_hold_set(it->wd->scr, EINA_FALSE);
|
|
|
|
elm_smart_scroller_bounce_allow_set(it->wd->scr, it->wd->h_bounce, it->wd->v_bounce);
|
|
|
|
edje_object_signal_emit(it->base.view, "elm,state,reorder,disabled", "elm");
|
2011-06-02 00:09:17 -07:00
|
|
|
}
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->wd->longpressed)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
it->wd->longpressed = EINA_FALSE;
|
|
|
|
if (!it->wd->wasselected) _item_unselect(it);
|
|
|
|
it->wd->wasselected = EINA_FALSE;
|
2010-12-10 05:01:43 -08:00
|
|
|
return;
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
if (dragged)
|
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->want_unrealize) _item_unrealize(it);
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
2011-10-20 14:41:24 -07:00
|
|
|
if ((it->disabled) || (dragged)) return;
|
|
|
|
if (it->wd->multi)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
if (!it->selected)
|
2010-12-10 05:01:43 -08:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
_item_highlight(it);
|
|
|
|
_item_select(it);
|
2010-12-10 05:01:43 -08:00
|
|
|
}
|
2011-10-20 14:41:24 -07:00
|
|
|
else _item_unselect(it);
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
if (!it->selected)
|
2010-12-10 05:01:43 -08:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
while (it->wd->selected)
|
|
|
|
_item_unselect(it->wd->selected->data);
|
2010-12-10 05:01:43 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
const Eina_List *l, *l_next;
|
|
|
|
Elm_Gengrid_Item *item2;
|
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
EINA_LIST_FOREACH_SAFE(it->wd->selected, l, l_next, item2)
|
|
|
|
if (item2 != it) _item_unselect(item2);
|
2010-12-10 05:01:43 -08:00
|
|
|
}
|
2011-10-20 14:41:24 -07:00
|
|
|
_item_highlight(it);
|
|
|
|
_item_select(it);
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-10-20 14:41:24 -07:00
|
|
|
_item_highlight(Elm_Gengrid_Item *it)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
if ((it->wd->no_select) || (it->delete_me) || (it->highlighted)) return;
|
|
|
|
edje_object_signal_emit(it->base.view, "elm,state,selected", "elm");
|
|
|
|
it->highlighted = EINA_TRUE;
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-10-20 14:41:24 -07:00
|
|
|
_item_realize(Elm_Gengrid_Item *it)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
|
|
|
char buf[1024];
|
2010-07-08 16:17:12 -07:00
|
|
|
char style[1024];
|
2010-06-03 05:53:14 -07:00
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
if ((it->realized) || (it->delete_me)) return;
|
|
|
|
it->base.view = edje_object_add(evas_object_evas_get(it->wd->self));
|
|
|
|
edje_object_scale_set(it->base.view, elm_widget_scale_get(it->wd->self) *
|
2010-12-10 05:01:43 -08:00
|
|
|
_elm_config->scale);
|
2011-10-20 14:41:24 -07:00
|
|
|
edje_object_mirrored_set(it->base.view, elm_widget_mirrored_get(it->base.widget));
|
|
|
|
evas_object_smart_member_add(it->base.view, it->wd->pan_smart);
|
|
|
|
elm_widget_sub_object_add(it->wd->self, it->base.view);
|
|
|
|
snprintf(style, sizeof(style), "it/%s",
|
|
|
|
it->gic->item_style ? it->gic->item_style : "default");
|
|
|
|
_elm_theme_object_set(it->wd->self, it->base.view, "gengrid", style,
|
|
|
|
elm_widget_style_get(it->wd->self));
|
|
|
|
it->spacer =
|
|
|
|
evas_object_rectangle_add(evas_object_evas_get(it->wd->self));
|
|
|
|
evas_object_color_set(it->spacer, 0, 0, 0, 0);
|
|
|
|
elm_widget_sub_object_add(it->wd->self, it->spacer);
|
|
|
|
evas_object_size_hint_min_set(it->spacer, 2 * _elm_config->scale, 1);
|
|
|
|
edje_object_part_swallow(it->base.view, "elm.swallow.pad", it->spacer);
|
|
|
|
|
|
|
|
if (it->gic->func.label_get)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2010-12-10 05:01:43 -08:00
|
|
|
const Eina_List *l;
|
|
|
|
const char *key;
|
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
it->labels =
|
|
|
|
elm_widget_stringlist_get(edje_object_data_get(it->base.view,
|
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
|
|
|
"labels"));
|
2011-10-20 14:41:24 -07:00
|
|
|
EINA_LIST_FOREACH(it->labels, l, key)
|
2010-12-10 05:01:43 -08:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
char *s = it->gic->func.label_get
|
|
|
|
((void *)it->base.data, it->wd->self, l->data);
|
2010-12-10 05:01:43 -08:00
|
|
|
if (s)
|
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
edje_object_part_text_set(it->base.view, l->data, s);
|
2010-12-10 05:01:43 -08:00
|
|
|
free(s);
|
|
|
|
}
|
|
|
|
}
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->gic->func.icon_get)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2010-12-10 05:01:43 -08:00
|
|
|
const Eina_List *l;
|
|
|
|
const char *key;
|
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
it->icons =
|
|
|
|
elm_widget_stringlist_get(edje_object_data_get(it->base.view,
|
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
|
|
|
"icons"));
|
2011-10-20 14:41:24 -07:00
|
|
|
EINA_LIST_FOREACH(it->icons, l, key)
|
2010-12-10 05:01:43 -08:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
Evas_Object *ic = it->gic->func.icon_get
|
|
|
|
((void *)it->base.data, it->wd->self, l->data);
|
2010-12-10 05:01:43 -08:00
|
|
|
if (ic)
|
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
it->icon_objs = eina_list_append(it->icon_objs, ic);
|
|
|
|
edje_object_part_swallow(it->base.view, key, ic);
|
2010-12-10 05:01:43 -08:00
|
|
|
evas_object_show(ic);
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_widget_sub_object_add(it->wd->self, ic);
|
2010-12-10 05:01:43 -08:00
|
|
|
}
|
|
|
|
}
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->gic->func.state_get)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2010-12-10 05:01:43 -08:00
|
|
|
const Eina_List *l;
|
|
|
|
const char *key;
|
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
it->states =
|
|
|
|
elm_widget_stringlist_get(edje_object_data_get(it->base.view,
|
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
|
|
|
"states"));
|
2011-10-20 14:41:24 -07:00
|
|
|
EINA_LIST_FOREACH(it->states, l, key)
|
2010-12-10 05:01:43 -08:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
Eina_Bool on = it->gic->func.state_get
|
|
|
|
((void *)it->base.data, it->wd->self, l->data);
|
2010-12-10 05:01:43 -08:00
|
|
|
if (on)
|
|
|
|
{
|
|
|
|
snprintf(buf, sizeof(buf), "elm,state,%s,active", key);
|
2011-10-20 14:41:24 -07:00
|
|
|
edje_object_signal_emit(it->base.view, buf, "elm");
|
2010-12-10 05:01:43 -08:00
|
|
|
}
|
|
|
|
}
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->is_group)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
if ((!it->wd->group_item_width) && (!it->wd->group_item_height))
|
2011-09-09 05:43:34 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
edje_object_size_min_restricted_calc(it->base.view,
|
|
|
|
&it->wd->group_item_width,
|
|
|
|
&it->wd->group_item_height,
|
|
|
|
it->wd->group_item_width,
|
|
|
|
it->wd->group_item_height);
|
2011-09-09 05:43:34 -07:00
|
|
|
}
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
2011-09-09 05:43:34 -07:00
|
|
|
else
|
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
if ((!it->wd->item_width) && (!it->wd->item_height))
|
2011-09-09 05:43:34 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
edje_object_size_min_restricted_calc(it->base.view,
|
|
|
|
&it->wd->item_width,
|
|
|
|
&it->wd->item_height,
|
|
|
|
it->wd->item_width,
|
|
|
|
it->wd->item_height);
|
|
|
|
elm_coords_finger_size_adjust(1, &it->wd->item_width,
|
|
|
|
1, &it->wd->item_height);
|
2011-09-09 05:43:34 -07:00
|
|
|
}
|
2010-06-03 05:53:14 -07:00
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_MOUSE_DOWN,
|
|
|
|
_mouse_down, it);
|
|
|
|
evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_MOUSE_UP,
|
|
|
|
_mouse_up, it);
|
|
|
|
evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_MOUSE_MOVE,
|
|
|
|
_mouse_move, it);
|
2010-06-03 05:53:14 -07:00
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->selected)
|
|
|
|
edje_object_signal_emit(it->base.view, "elm,state,selected", "elm");
|
|
|
|
if (it->disabled)
|
|
|
|
edje_object_signal_emit(it->base.view, "elm,state,disabled", "elm");
|
2011-09-09 05:43:34 -07:00
|
|
|
}
|
2011-10-20 14:41:24 -07:00
|
|
|
evas_object_show(it->base.view);
|
2010-09-27 11:18:37 -07:00
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->tooltip.content_cb)
|
2010-09-27 11:18:37 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_widget_item_tooltip_content_cb_set(it,
|
|
|
|
it->tooltip.content_cb,
|
|
|
|
it->tooltip.data, NULL);
|
|
|
|
elm_widget_item_tooltip_style_set(it, it->tooltip.style);
|
|
|
|
elm_widget_item_tooltip_size_restrict_disable(it, it->tooltip.free_size);
|
2010-09-27 11:18:37 -07:00
|
|
|
}
|
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->mouse_cursor)
|
|
|
|
elm_widget_item_cursor_set(it, it->mouse_cursor);
|
2010-09-27 11:18:37 -07:00
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
it->realized = EINA_TRUE;
|
|
|
|
it->want_unrealize = EINA_FALSE;
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-10-20 14:41:24 -07:00
|
|
|
_item_unrealize(Elm_Gengrid_Item *it)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
|
|
|
Evas_Object *icon;
|
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
if (!it->realized) return;
|
|
|
|
if (it->long_timer)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ecore_timer_del(it->long_timer);
|
|
|
|
it->long_timer = NULL;
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
2011-10-20 14:41:24 -07:00
|
|
|
evas_object_del(it->base.view);
|
|
|
|
it->base.view = NULL;
|
|
|
|
evas_object_del(it->spacer);
|
|
|
|
it->spacer = NULL;
|
|
|
|
elm_widget_stringlist_free(it->labels);
|
|
|
|
it->labels = NULL;
|
|
|
|
elm_widget_stringlist_free(it->icons);
|
|
|
|
it->icons = NULL;
|
|
|
|
elm_widget_stringlist_free(it->states);
|
|
|
|
it->states = NULL;
|
2010-06-03 05:53:14 -07:00
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
EINA_LIST_FREE(it->icon_objs, icon)
|
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
|
|
|
evas_object_del(icon);
|
2010-06-03 05:53:14 -07:00
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
it->realized = EINA_FALSE;
|
|
|
|
it->want_unrealize = EINA_FALSE;
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
2011-06-14 01:36:03 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_reorder_item_moving_effect_timer_cb(void *data)
|
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
Elm_Gengrid_Item *it = data;
|
2011-06-14 01:36:03 -07:00
|
|
|
double time, t;
|
|
|
|
Evas_Coord dx, dy;
|
|
|
|
|
|
|
|
time = REORDER_EFFECT_TIME;
|
2011-10-20 14:41:24 -07:00
|
|
|
t = ((0.0 > (t = ecore_loop_time_get()-it->moving_effect_start_time)) ? 0.0 : t);
|
|
|
|
dx = ((it->tx - it->ox) / 10) * _elm_config->scale;
|
|
|
|
dy = ((it->ty - it->oy) / 10) * _elm_config->scale;
|
2011-06-14 01:36:03 -07:00
|
|
|
|
|
|
|
if (t <= time)
|
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
it->rx += (1 * sin((t / time) * (M_PI / 2)) * dx);
|
|
|
|
it->ry += (1 * sin((t / time) * (M_PI / 2)) * dy);
|
2011-06-14 01:36:03 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
it->rx += dx;
|
|
|
|
it->ry += dy;
|
2011-06-14 01:36:03 -07:00
|
|
|
}
|
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
if ((((dx > 0) && (it->rx >= it->tx)) || ((dx <= 0) && (it->rx <= it->tx))) &&
|
|
|
|
(((dy > 0) && (it->ry >= it->ty)) || ((dy <= 0) && (it->ry <= it->ty))))
|
2011-06-14 01:36:03 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
evas_object_move(it->base.view, it->tx, it->ty);
|
|
|
|
if (it->is_group)
|
2011-09-09 05:43:34 -07:00
|
|
|
{
|
|
|
|
Evas_Coord vw, vh;
|
2011-10-20 14:41:24 -07:00
|
|
|
evas_object_geometry_get(it->wd->pan_smart, NULL, NULL, &vw, &vh);
|
|
|
|
if (it->wd->horizontal)
|
|
|
|
evas_object_resize(it->base.view, it->wd->group_item_width, vh);
|
2011-09-09 05:43:34 -07:00
|
|
|
else
|
2011-10-20 14:41:24 -07:00
|
|
|
evas_object_resize(it->base.view, vw, it->wd->group_item_height);
|
2011-09-09 05:43:34 -07:00
|
|
|
}
|
|
|
|
else
|
2011-10-20 14:41:24 -07:00
|
|
|
evas_object_resize(it->base.view, it->wd->item_width, it->wd->item_height);
|
|
|
|
it->moving = EINA_FALSE;
|
|
|
|
it->item_moving_effect_timer = NULL;
|
2011-06-14 01:36:03 -07:00
|
|
|
return ECORE_CALLBACK_CANCEL;
|
|
|
|
}
|
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
evas_object_move(it->base.view, it->rx, it->ry);
|
|
|
|
if (it->is_group)
|
2011-09-09 05:43:34 -07:00
|
|
|
{
|
|
|
|
Evas_Coord vw, vh;
|
2011-10-20 14:41:24 -07:00
|
|
|
evas_object_geometry_get(it->wd->pan_smart, NULL, NULL, &vw, &vh);
|
|
|
|
if (it->wd->horizontal)
|
|
|
|
evas_object_resize(it->base.view, it->wd->group_item_width, vh);
|
2011-09-09 05:43:34 -07:00
|
|
|
else
|
2011-10-20 14:41:24 -07:00
|
|
|
evas_object_resize(it->base.view, vw, it->wd->group_item_height);
|
2011-09-09 05:43:34 -07:00
|
|
|
}
|
|
|
|
else
|
2011-10-20 14:41:24 -07:00
|
|
|
evas_object_resize(it->base.view, it->wd->item_width, it->wd->item_height);
|
2011-06-14 01:36:03 -07:00
|
|
|
|
|
|
|
return ECORE_CALLBACK_RENEW;
|
|
|
|
}
|
|
|
|
|
2011-09-09 05:43:34 -07:00
|
|
|
static void
|
|
|
|
_group_item_place(Pan *sd)
|
|
|
|
{
|
|
|
|
Evas_Coord iw, ih, vw, vh;
|
|
|
|
Eina_List *l;
|
|
|
|
Eina_Bool was_realized;
|
|
|
|
Elm_Gengrid_Item *it;
|
|
|
|
evas_object_geometry_get(sd->wd->pan_smart, NULL, NULL, &vw, &vh);
|
|
|
|
if (sd->wd->horizontal)
|
|
|
|
{
|
|
|
|
iw = sd->wd->group_item_width;
|
|
|
|
ih = vh;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
iw = vw;
|
|
|
|
ih = sd->wd->group_item_height;
|
|
|
|
}
|
|
|
|
EINA_LIST_FOREACH(sd->wd->group_items, l, it)
|
|
|
|
{
|
|
|
|
was_realized = it->realized;
|
|
|
|
if (it->group_realized)
|
|
|
|
{
|
|
|
|
_item_realize(it);
|
|
|
|
if (!was_realized)
|
|
|
|
evas_object_smart_callback_call(it->wd->self, SIG_REALIZED, it);
|
|
|
|
evas_object_move(it->base.view, it->gx, it->gy);
|
|
|
|
evas_object_resize(it->base.view, iw, ih);
|
|
|
|
evas_object_raise(it->base.view);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
_item_unrealize(it);
|
|
|
|
if (was_realized)
|
|
|
|
evas_object_smart_callback_call(it->wd->self, SIG_UNREALIZED, it);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-06-03 05:53:14 -07:00
|
|
|
static void
|
2011-10-20 14:41:24 -07:00
|
|
|
_item_place(Elm_Gengrid_Item *it,
|
2010-12-10 05:01:43 -08:00
|
|
|
Evas_Coord cx,
|
|
|
|
Evas_Coord cy)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-09-09 05:43:34 -07:00
|
|
|
Evas_Coord x, y, ox, oy, cvx, cvy, cvw, cvh, iw, ih, ww;
|
2010-06-03 05:53:14 -07:00
|
|
|
Evas_Coord tch, tcw, alignw = 0, alignh = 0, vw, vh;
|
2011-06-02 00:09:17 -07:00
|
|
|
Eina_Bool reorder_item_move_forward = EINA_FALSE;
|
2011-09-09 05:43:34 -07:00
|
|
|
long items_count;
|
2011-10-20 14:41:24 -07:00
|
|
|
it->x = cx;
|
|
|
|
it->y = cy;
|
|
|
|
evas_object_geometry_get(it->wd->pan_smart, &ox, &oy, &vw, &vh);
|
2010-06-03 05:53:14 -07:00
|
|
|
|
|
|
|
/* Preload rows/columns at each side of the Gengrid */
|
2011-10-20 14:41:24 -07:00
|
|
|
cvx = ox - PRELOAD * it->wd->item_width;
|
|
|
|
cvy = oy - PRELOAD * it->wd->item_height;
|
|
|
|
cvw = vw + 2 * PRELOAD * it->wd->item_width;
|
|
|
|
cvh = vh + 2 * PRELOAD * it->wd->item_height;
|
2010-06-03 05:53:14 -07:00
|
|
|
|
2010-10-10 18:55:07 -07:00
|
|
|
alignh = 0;
|
|
|
|
alignw = 0;
|
2010-06-03 05:53:14 -07:00
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
items_count = it->wd->count - eina_list_count(it->wd->group_items) + it->wd->items_lost;
|
|
|
|
if (it->wd->horizontal)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2010-11-10 15:59:59 -08:00
|
|
|
int columns, items_visible = 0, items_row;
|
2010-06-03 05:53:14 -07:00
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->wd->item_height > 0)
|
|
|
|
items_visible = vh / it->wd->item_height;
|
2010-10-08 18:42:32 -07:00
|
|
|
if (items_visible < 1)
|
2010-12-10 05:01:43 -08:00
|
|
|
items_visible = 1;
|
2010-10-08 18:42:32 -07:00
|
|
|
|
2011-09-09 05:43:34 -07:00
|
|
|
columns = items_count / items_visible;
|
|
|
|
if (items_count % items_visible)
|
2010-12-10 05:01:43 -08:00
|
|
|
columns++;
|
2010-06-03 05:53:14 -07:00
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
tcw = (it->wd->item_width * columns) + (it->wd->group_item_width * eina_list_count(it->wd->group_items));
|
|
|
|
alignw = (vw - tcw) * it->wd->align_x;
|
2010-11-23 12:30:48 -08:00
|
|
|
|
2010-10-10 18:55:07 -07:00
|
|
|
items_row = items_visible;
|
2011-10-20 14:41:24 -07:00
|
|
|
if (items_row > it->wd->count)
|
|
|
|
items_row = it->wd->count;
|
|
|
|
tch = items_row * it->wd->item_height;
|
|
|
|
alignh = (vh - tch) * it->wd->align_y;
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
2010-10-10 18:55:07 -07:00
|
|
|
else
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2010-11-10 15:59:59 -08:00
|
|
|
int rows, items_visible = 0, items_col;
|
2010-10-08 18:42:32 -07:00
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->wd->item_width > 0)
|
|
|
|
items_visible = vw / it->wd->item_width;
|
2010-10-08 18:42:32 -07:00
|
|
|
if (items_visible < 1)
|
2010-12-10 05:01:43 -08:00
|
|
|
items_visible = 1;
|
2010-06-03 05:53:14 -07:00
|
|
|
|
2011-09-09 05:43:34 -07:00
|
|
|
rows = items_count / items_visible;
|
|
|
|
if (items_count % items_visible)
|
2010-12-10 05:01:43 -08:00
|
|
|
rows++;
|
2010-06-03 05:53:14 -07:00
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
tch = (it->wd->item_height * rows) + (it->wd->group_item_height * eina_list_count(it->wd->group_items));
|
|
|
|
alignh = (vh - tch) * it->wd->align_y;
|
2010-11-23 12:30:48 -08:00
|
|
|
|
2010-10-10 18:55:07 -07:00
|
|
|
items_col = items_visible;
|
2011-10-20 14:41:24 -07:00
|
|
|
if (items_col > it->wd->count)
|
|
|
|
items_col = it->wd->count;
|
|
|
|
tcw = items_col * it->wd->item_width;
|
|
|
|
alignw = (vw - tcw) * it->wd->align_x;
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
2010-10-10 18:55:07 -07:00
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->is_group)
|
2011-09-09 05:43:34 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->wd->horizontal)
|
2011-09-09 05:43:34 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
x = (((cx - it->prev_group) * it->wd->item_width) + (it->prev_group * it->wd->group_item_width)) - it->wd->pan_x + ox + alignw;
|
2011-09-09 05:43:34 -07:00
|
|
|
y = 0;
|
2011-10-20 14:41:24 -07:00
|
|
|
iw = it->wd->group_item_width;
|
2011-09-09 05:43:34 -07:00
|
|
|
ih = vh;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
x = 0;
|
2011-10-20 14:41:24 -07:00
|
|
|
y = (((cy - it->prev_group) * it->wd->item_height) + (it->prev_group * it->wd->group_item_height)) - it->wd->pan_y + oy + alignh;
|
2011-09-09 05:43:34 -07:00
|
|
|
iw = vw;
|
2011-10-20 14:41:24 -07:00
|
|
|
ih = it->wd->group_item_height;
|
2011-09-09 05:43:34 -07:00
|
|
|
}
|
2011-10-20 14:41:24 -07:00
|
|
|
it->gx = x;
|
|
|
|
it->gy = y;
|
2011-09-09 05:43:34 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->wd->horizontal)
|
2011-09-09 05:43:34 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
x = (((cx - it->prev_group) * it->wd->item_width) + (it->prev_group * it->wd->group_item_width)) - it->wd->pan_x + ox + alignw;
|
|
|
|
y = (cy * it->wd->item_height) - it->wd->pan_y + oy + alignh;
|
2011-09-09 05:43:34 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
x = (cx * it->wd->item_width) - it->wd->pan_x + ox + alignw;
|
|
|
|
y = (((cy - it->prev_group) * it->wd->item_height) + (it->prev_group * it->wd->group_item_height)) - it->wd->pan_y + oy + alignh;
|
2011-09-09 05:43:34 -07:00
|
|
|
}
|
2011-10-20 14:41:24 -07:00
|
|
|
if (elm_widget_mirrored_get(it->wd->self))
|
2011-09-09 05:43:34 -07:00
|
|
|
{ /* Switch items side and componsate for pan_x when in RTL mode */
|
2011-10-20 14:41:24 -07:00
|
|
|
evas_object_geometry_get(it->wd->self, NULL, NULL, &ww, NULL);
|
|
|
|
x = ww - x - it->wd->item_width - it->wd->pan_x - it->wd->pan_x;
|
2011-09-09 05:43:34 -07:00
|
|
|
}
|
2011-10-20 14:41:24 -07:00
|
|
|
iw = it->wd->item_width;
|
|
|
|
ih = it->wd->item_height;
|
2011-02-08 04:08:28 -08:00
|
|
|
}
|
2010-06-03 05:53:14 -07:00
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
Eina_Bool was_realized = it->realized;
|
2011-09-09 05:43:34 -07:00
|
|
|
if (ELM_RECTS_INTERSECT(x, y, iw, ih, cvx, cvy, cvw, cvh))
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
_item_realize(it);
|
2010-12-10 05:01:43 -08:00
|
|
|
if (!was_realized)
|
2011-10-20 14:41:24 -07:00
|
|
|
evas_object_smart_callback_call(it->wd->self, SIG_REALIZED, it);
|
2011-10-20 15:23:48 -07:00
|
|
|
if (it->parent)
|
2011-09-09 05:43:34 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->wd->horizontal)
|
2011-09-09 05:43:34 -07:00
|
|
|
{
|
2011-10-20 15:23:48 -07:00
|
|
|
if (it->parent->gx < 0)
|
2011-09-09 05:43:34 -07:00
|
|
|
{
|
2011-10-20 15:23:48 -07:00
|
|
|
it->parent->gx = x + it->wd->item_width - it->wd->group_item_width;
|
|
|
|
if (it->parent->gx > 0)
|
|
|
|
it->parent->gx = 0;
|
2011-09-09 05:43:34 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-10-20 15:23:48 -07:00
|
|
|
if (it->parent->gy < 0)
|
2011-09-09 05:43:34 -07:00
|
|
|
{
|
2011-10-20 15:23:48 -07:00
|
|
|
it->parent->gy = y + it->wd->item_height - it->wd->group_item_height;
|
|
|
|
if (it->parent->gy > 0)
|
|
|
|
it->parent->gy = 0;
|
2011-09-09 05:43:34 -07:00
|
|
|
}
|
2011-10-20 15:23:48 -07:00
|
|
|
it->parent->group_realized = EINA_TRUE;
|
2011-09-09 05:43:34 -07:00
|
|
|
}
|
|
|
|
}
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->wd->reorder_mode)
|
2011-06-02 00:09:17 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->wd->reorder_item)
|
2011-06-02 00:09:17 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->moving) return;
|
2011-10-03 17:59:18 -07:00
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
if (!it->wd->move_effect_enabled)
|
2011-10-03 17:59:18 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
it->ox = x;
|
|
|
|
it->oy = y;
|
2011-10-03 17:59:18 -07:00
|
|
|
}
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->wd->reorder_item == it)
|
2011-10-03 17:59:18 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
evas_object_move(it->base.view,
|
|
|
|
it->wd->reorder_item_x, it->wd->reorder_item_y);
|
|
|
|
evas_object_resize(it->base.view, iw, ih);
|
2011-10-03 17:59:18 -07:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
else
|
2011-06-14 01:36:03 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->wd->move_effect_enabled)
|
2011-06-14 01:36:03 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
if ((it->ox != x) || (it->oy != y))
|
2011-06-14 01:36:03 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
if (((it->wd->old_pan_x == it->wd->pan_x) && (it->wd->old_pan_y == it->wd->pan_y)) ||
|
|
|
|
((it->wd->old_pan_x != it->wd->pan_x) && !(it->ox - it->wd->pan_x + it->wd->old_pan_x == x)) ||
|
|
|
|
((it->wd->old_pan_y != it->wd->pan_y) && !(it->oy - it->wd->pan_y + it->wd->old_pan_y == y)))
|
2011-10-03 17:59:18 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
it->tx = x;
|
|
|
|
it->ty = y;
|
|
|
|
it->rx = it->ox;
|
|
|
|
it->ry = it->oy;
|
|
|
|
it->moving = EINA_TRUE;
|
|
|
|
it->moving_effect_start_time = ecore_loop_time_get();
|
|
|
|
it->item_moving_effect_timer = ecore_animator_add(_reorder_item_moving_effect_timer_cb, it);
|
2011-10-03 17:59:18 -07:00
|
|
|
return;
|
|
|
|
}
|
2011-06-14 01:36:03 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-10-03 17:59:18 -07:00
|
|
|
/* need fix here */
|
|
|
|
Evas_Coord nx, ny, nw, nh;
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->is_group)
|
2011-09-09 05:43:34 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->wd->horizontal)
|
2011-10-03 17:59:18 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
nx = x + (it->wd->group_item_width / 2);
|
2011-10-03 17:59:18 -07:00
|
|
|
ny = y;
|
|
|
|
nw = 1;
|
|
|
|
nh = vh;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
nx = x;
|
2011-10-20 14:41:24 -07:00
|
|
|
ny = y + (it->wd->group_item_height / 2);
|
2011-10-03 17:59:18 -07:00
|
|
|
nw = vw;
|
|
|
|
nh = 1;
|
|
|
|
}
|
2011-09-09 05:43:34 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
nx = x + (it->wd->item_width / 2);
|
|
|
|
ny = y + (it->wd->item_height / 2);
|
2011-10-03 17:59:18 -07:00
|
|
|
nw = 1;
|
2011-09-09 05:43:34 -07:00
|
|
|
nh = 1;
|
|
|
|
}
|
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
if ( ELM_RECTS_INTERSECT(it->wd->reorder_item_x, it->wd->reorder_item_y,
|
|
|
|
it->wd->item_width, it->wd->item_height,
|
2011-10-03 17:59:18 -07:00
|
|
|
nx, ny, nw, nh))
|
2011-06-02 00:09:17 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->wd->horizontal)
|
2011-10-03 17:59:18 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
if ((it->wd->nmax * it->wd->reorder_item->x + it->wd->reorder_item->y) >
|
|
|
|
(it->wd->nmax * it->x + it->y))
|
2011-10-03 17:59:18 -07:00
|
|
|
reorder_item_move_forward = EINA_TRUE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
if ((it->wd->nmax * it->wd->reorder_item->y + it->wd->reorder_item->x) >
|
|
|
|
(it->wd->nmax * it->y + it->x))
|
2011-10-03 17:59:18 -07:00
|
|
|
reorder_item_move_forward = EINA_TRUE;
|
|
|
|
}
|
2011-06-02 00:09:17 -07:00
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
it->wd->items = eina_inlist_remove(it->wd->items,
|
|
|
|
EINA_INLIST_GET(it->wd->reorder_item));
|
2011-10-03 17:59:18 -07:00
|
|
|
if (reorder_item_move_forward)
|
2011-10-20 14:41:24 -07:00
|
|
|
it->wd->items = eina_inlist_prepend_relative(it->wd->items,
|
|
|
|
EINA_INLIST_GET(it->wd->reorder_item),
|
|
|
|
EINA_INLIST_GET(it));
|
2011-10-03 17:59:18 -07:00
|
|
|
else
|
2011-10-20 14:41:24 -07:00
|
|
|
it->wd->items = eina_inlist_append_relative(it->wd->items,
|
|
|
|
EINA_INLIST_GET(it->wd->reorder_item),
|
|
|
|
EINA_INLIST_GET(it));
|
2011-10-03 17:59:18 -07:00
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
it->wd->reorder_item_changed = EINA_TRUE;
|
|
|
|
it->wd->move_effect_enabled = EINA_TRUE;
|
|
|
|
if (it->wd->calc_job) ecore_job_del(it->wd->calc_job);
|
|
|
|
it->wd->calc_job = ecore_job_add(_calc_job, it->wd);
|
2011-10-03 17:59:18 -07:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
2011-06-02 00:09:17 -07:00
|
|
|
}
|
|
|
|
}
|
2011-10-20 14:41:24 -07:00
|
|
|
else if (it->item_moving_effect_timer)
|
2011-10-03 17:59:18 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ecore_animator_del(it->item_moving_effect_timer);
|
|
|
|
it->item_moving_effect_timer = NULL;
|
|
|
|
it->moving = EINA_FALSE;
|
2011-10-03 17:59:18 -07:00
|
|
|
}
|
2011-06-02 00:09:17 -07:00
|
|
|
}
|
2011-10-20 14:41:24 -07:00
|
|
|
if (!it->is_group)
|
2011-09-09 05:43:34 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
evas_object_move(it->base.view, x, y);
|
|
|
|
evas_object_resize(it->base.view, iw, ih);
|
2011-09-09 05:43:34 -07:00
|
|
|
}
|
|
|
|
else
|
2011-10-20 14:41:24 -07:00
|
|
|
it->group_realized = EINA_TRUE;
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
else
|
2010-11-03 11:30:48 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
if (!it->is_group)
|
2011-09-09 05:43:34 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
_item_unrealize(it);
|
2011-09-09 05:43:34 -07:00
|
|
|
if (was_realized)
|
2011-10-20 14:41:24 -07:00
|
|
|
evas_object_smart_callback_call(it->wd->self, SIG_UNREALIZED, it);
|
2011-09-09 05:43:34 -07:00
|
|
|
}
|
|
|
|
else
|
2011-10-20 14:41:24 -07:00
|
|
|
it->group_realized = EINA_FALSE;
|
2010-11-03 11:30:48 -07:00
|
|
|
}
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
2011-08-10 16:51:20 -07:00
|
|
|
static const char *
|
|
|
|
_item_label_hook(Elm_Gengrid_Item *it, const char *part)
|
|
|
|
{
|
|
|
|
if (!it->gic->func.label_get) return NULL;
|
|
|
|
return edje_object_part_text_get(it->base.view, part);
|
|
|
|
}
|
|
|
|
|
2010-06-03 05:53:14 -07:00
|
|
|
static Elm_Gengrid_Item *
|
2010-12-10 05:01:43 -08:00
|
|
|
_item_create(Widget_Data *wd,
|
|
|
|
const Elm_Gengrid_Item_Class *gic,
|
|
|
|
const void *data,
|
|
|
|
Evas_Smart_Cb func,
|
|
|
|
const void *func_data)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
Elm_Gengrid_Item *it;
|
2010-06-03 05:53:14 -07:00
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
it = elm_widget_item_new(wd->self, Elm_Gengrid_Item);
|
|
|
|
if (!it) return NULL;
|
2010-10-10 16:54:11 -07:00
|
|
|
wd->count++;
|
2011-10-20 14:41:24 -07:00
|
|
|
it->wd = wd;
|
|
|
|
it->gic = gic;
|
|
|
|
it->base.data = data;
|
|
|
|
it->func.func = func;
|
|
|
|
it->func.data = func_data;
|
|
|
|
it->mouse_cursor = NULL;
|
|
|
|
it->is_group = !strcmp(it->gic->item_style, "group_index");
|
|
|
|
elm_widget_item_text_get_hook_set(it, _item_label_hook);
|
2011-09-09 05:43:34 -07:00
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
return it;
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-10-20 14:41:24 -07:00
|
|
|
_item_del(Elm_Gengrid_Item *it)
|
|
|
|
{
|
|
|
|
elm_widget_item_pre_notify_del(it);
|
|
|
|
if (it->selected)
|
|
|
|
it->wd->selected = eina_list_remove(it->wd->selected, it);
|
|
|
|
if (it->realized) _item_unrealize(it);
|
|
|
|
if ((!it->delete_me) && (it->gic->func.del))
|
|
|
|
it->gic->func.del((void *)it->base.data, it->wd->self);
|
|
|
|
it->delete_me = EINA_TRUE;
|
|
|
|
it->wd->items = eina_inlist_remove(it->wd->items, EINA_INLIST_GET(it));
|
|
|
|
if (it->long_timer) ecore_timer_del(it->long_timer);
|
|
|
|
if (it->tooltip.del_cb)
|
|
|
|
it->tooltip.del_cb((void *)it->tooltip.data, it->base.widget, it);
|
|
|
|
it->wd->walking -= it->walking;
|
|
|
|
it->wd->count--;
|
|
|
|
if (it->is_group)
|
|
|
|
it->wd->group_items = eina_list_remove(it->wd->group_items, it);
|
|
|
|
if (it->wd->calc_job) ecore_job_del(it->wd->calc_job);
|
|
|
|
it->wd->calc_job = ecore_job_add(_calc_job, it->wd);
|
|
|
|
elm_widget_item_del(it);
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-10-20 14:41:24 -07:00
|
|
|
_item_select(Elm_Gengrid_Item *it)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
if ((it->wd->no_select) || (it->delete_me)) return;
|
|
|
|
if (it->selected)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->wd->always_select) goto call;
|
2010-12-10 05:01:43 -08:00
|
|
|
return;
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
2011-10-20 14:41:24 -07:00
|
|
|
it->selected = EINA_TRUE;
|
|
|
|
it->wd->selected = eina_list_append(it->wd->selected, it);
|
2010-06-03 05:53:14 -07:00
|
|
|
call:
|
2011-10-20 14:41:24 -07:00
|
|
|
it->walking++;
|
|
|
|
it->wd->walking++;
|
|
|
|
if (it->func.func)
|
|
|
|
it->func.func((void *)it->func.data, it->wd->self, it);
|
|
|
|
if (!it->delete_me)
|
|
|
|
evas_object_smart_callback_call(it->wd->self, SIG_SELECTED, it);
|
|
|
|
it->walking--;
|
|
|
|
it->wd->walking--;
|
|
|
|
it->wd->last_selected_item = it;
|
|
|
|
if ((it->wd->clear_me) && (!it->wd->walking))
|
|
|
|
elm_gengrid_clear(it->base.widget);
|
2010-10-10 16:54:11 -07:00
|
|
|
else
|
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
if ((!it->walking) && (it->delete_me))
|
|
|
|
if (!it->relcount) _item_del(it);
|
2010-10-10 16:54:11 -07:00
|
|
|
}
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-10-20 14:41:24 -07:00
|
|
|
_item_unselect(Elm_Gengrid_Item *it)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
if ((it->delete_me) || (!it->highlighted)) return;
|
|
|
|
edje_object_signal_emit(it->base.view, "elm,state,unselected", "elm");
|
|
|
|
it->highlighted = EINA_FALSE;
|
|
|
|
if (it->selected)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
it->selected = EINA_FALSE;
|
|
|
|
it->wd->selected = eina_list_remove(it->wd->selected, it);
|
|
|
|
evas_object_smart_callback_call(it->wd->self, SIG_UNSELECTED, it);
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_calc_job(void *data)
|
|
|
|
{
|
|
|
|
Widget_Data *wd = data;
|
|
|
|
Evas_Coord minw = 0, minh = 0, nmax = 0, cvw, cvh;
|
2011-10-20 14:41:24 -07:00
|
|
|
Elm_Gengrid_Item *it, *group_item = NULL;
|
2011-09-09 05:43:34 -07:00
|
|
|
int count_group = 0;
|
|
|
|
long count = 0;
|
|
|
|
wd->items_lost = 0;
|
2010-06-03 05:53:14 -07:00
|
|
|
|
2010-07-05 18:23:54 -07:00
|
|
|
evas_object_geometry_get(wd->pan_smart, NULL, NULL, &cvw, &cvh);
|
2011-03-03 05:01:39 -08:00
|
|
|
if ((cvw != 0) || (cvh != 0))
|
|
|
|
{
|
|
|
|
if ((wd->horizontal) && (wd->item_height > 0))
|
|
|
|
nmax = cvh / wd->item_height;
|
|
|
|
else if (wd->item_width > 0)
|
|
|
|
nmax = cvw / wd->item_width;
|
2010-06-03 05:53:14 -07:00
|
|
|
|
2011-03-03 05:01:39 -08:00
|
|
|
if (nmax < 1)
|
|
|
|
nmax = 1;
|
2010-10-08 18:42:32 -07:00
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
EINA_INLIST_FOREACH(wd->items, it)
|
2011-09-09 05:43:34 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->prev_group != count_group)
|
|
|
|
it->prev_group = count_group;
|
|
|
|
if (it->is_group)
|
2011-09-09 05:43:34 -07:00
|
|
|
{
|
|
|
|
count = count % nmax;
|
|
|
|
if (count)
|
|
|
|
wd->items_lost += nmax - count;
|
|
|
|
//printf("%d items and I lost %d\n", count, wd->items_lost);
|
|
|
|
count_group++;
|
|
|
|
if (count) count = 0;
|
2011-10-20 14:41:24 -07:00
|
|
|
group_item = it;
|
2011-09-09 05:43:34 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-10-20 15:23:48 -07:00
|
|
|
if (it->parent != group_item)
|
|
|
|
it->parent = group_item;
|
2011-09-09 05:43:34 -07:00
|
|
|
count++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
count = wd->count + wd->items_lost - count_group;
|
2011-03-03 05:01:39 -08:00
|
|
|
if (wd->horizontal)
|
|
|
|
{
|
2011-10-07 01:25:18 -07:00
|
|
|
minw = (ceil(count / (float)nmax) * wd->item_width) + (count_group * wd->group_item_width);
|
2011-03-03 05:01:39 -08:00
|
|
|
minh = nmax * wd->item_height;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
minw = nmax * wd->item_width;
|
2011-09-09 05:43:34 -07:00
|
|
|
minh = (ceil(count / (float)nmax) * wd->item_height) + (count_group * wd->group_item_height);
|
2011-03-03 05:01:39 -08:00
|
|
|
}
|
2010-06-03 05:53:14 -07:00
|
|
|
|
2011-03-03 05:01:39 -08:00
|
|
|
if ((minw != wd->minw) || (minh != wd->minh))
|
|
|
|
{
|
|
|
|
wd->minh = minh;
|
|
|
|
wd->minw = minw;
|
|
|
|
evas_object_smart_callback_call(wd->pan_smart, "changed", NULL);
|
|
|
|
}
|
2010-06-03 05:53:14 -07:00
|
|
|
|
2011-03-03 05:01:39 -08:00
|
|
|
wd->nmax = nmax;
|
|
|
|
evas_object_smart_changed(wd->pan_smart);
|
|
|
|
}
|
2011-04-29 03:50:55 -07:00
|
|
|
wd->calc_job = NULL;
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_pan_add(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Pan *sd;
|
|
|
|
Evas_Object_Smart_Clipped_Data *cd;
|
|
|
|
|
|
|
|
_pan_sc.add(obj);
|
|
|
|
cd = evas_object_smart_data_get(obj);
|
|
|
|
sd = ELM_NEW(Pan);
|
|
|
|
if (!sd) return;
|
|
|
|
sd->__clipped_data = *cd;
|
|
|
|
free(cd);
|
|
|
|
evas_object_smart_data_set(obj, sd);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_pan_del(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Pan *sd = evas_object_smart_data_get(obj);
|
|
|
|
|
|
|
|
if (!sd) return;
|
|
|
|
_pan_sc.del(obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-12-10 05:01:43 -08:00
|
|
|
_pan_set(Evas_Object *obj,
|
|
|
|
Evas_Coord x,
|
|
|
|
Evas_Coord y)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
|
|
|
Pan *sd = evas_object_smart_data_get(obj);
|
|
|
|
if ((x == sd->wd->pan_x) && (y == sd->wd->pan_y)) return;
|
|
|
|
sd->wd->pan_x = x;
|
|
|
|
sd->wd->pan_y = y;
|
|
|
|
evas_object_smart_changed(obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-12-10 05:01:43 -08:00
|
|
|
_pan_get(Evas_Object *obj,
|
|
|
|
Evas_Coord *x,
|
|
|
|
Evas_Coord *y)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
|
|
|
Pan *sd = evas_object_smart_data_get(obj);
|
|
|
|
if (x) *x = sd->wd->pan_x;
|
|
|
|
if (y) *y = sd->wd->pan_y;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-12-10 05:01:43 -08:00
|
|
|
_pan_child_size_get(Evas_Object *obj,
|
|
|
|
Evas_Coord *w,
|
|
|
|
Evas_Coord *h)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
|
|
|
Pan *sd = evas_object_smart_data_get(obj);
|
|
|
|
if (w) *w = sd->wd->minw;
|
|
|
|
if (h) *h = sd->wd->minh;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-12-10 05:01:43 -08:00
|
|
|
_pan_max_get(Evas_Object *obj,
|
|
|
|
Evas_Coord *x,
|
|
|
|
Evas_Coord *y)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
|
|
|
Pan *sd = evas_object_smart_data_get(obj);
|
|
|
|
Evas_Coord ow, oh;
|
|
|
|
|
|
|
|
if (!sd) return;
|
|
|
|
evas_object_geometry_get(obj, NULL, NULL, &ow, &oh);
|
|
|
|
if (x)
|
|
|
|
*x = (ow < sd->wd->minw) ? sd->wd->minw - ow : 0;
|
|
|
|
if (y)
|
|
|
|
*y = (oh < sd->wd->minh) ? sd->wd->minh - oh : 0;
|
|
|
|
}
|
|
|
|
|
2010-11-23 12:30:48 -08:00
|
|
|
static void
|
2010-12-10 05:01:43 -08:00
|
|
|
_pan_min_get(Evas_Object *obj,
|
|
|
|
Evas_Coord *x,
|
|
|
|
Evas_Coord *y)
|
2010-11-23 12:30:48 -08:00
|
|
|
{
|
|
|
|
Pan *sd = evas_object_smart_data_get(obj);
|
|
|
|
Evas_Coord mx, my;
|
|
|
|
|
|
|
|
if (!sd) return;
|
|
|
|
_pan_max_get(obj, &mx, &my);
|
|
|
|
if (x)
|
2010-12-10 05:01:43 -08:00
|
|
|
*x = -mx * sd->wd->align_x;
|
2010-11-23 12:30:48 -08:00
|
|
|
if (y)
|
2010-12-10 05:01:43 -08:00
|
|
|
*y = -my * sd->wd->align_y;
|
2010-11-23 12:30:48 -08:00
|
|
|
}
|
|
|
|
|
2010-06-03 05:53:14 -07:00
|
|
|
static void
|
2010-12-10 05:01:43 -08:00
|
|
|
_pan_resize(Evas_Object *obj,
|
|
|
|
Evas_Coord w,
|
|
|
|
Evas_Coord h)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
|
|
|
Pan *sd = evas_object_smart_data_get(obj);
|
|
|
|
Evas_Coord ow, oh;
|
|
|
|
|
|
|
|
evas_object_geometry_get(obj, NULL, NULL, &ow, &oh);
|
|
|
|
if ((ow == w) && (oh == h)) return;
|
|
|
|
if (sd->wd->calc_job) ecore_job_del(sd->wd->calc_job);
|
|
|
|
sd->wd->calc_job = ecore_job_add(_calc_job, sd->wd);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_pan_calculate(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Pan *sd = evas_object_smart_data_get(obj);
|
|
|
|
Evas_Coord cx = 0, cy = 0;
|
2011-10-20 14:41:24 -07:00
|
|
|
Elm_Gengrid_Item *it;
|
2010-06-03 05:53:14 -07:00
|
|
|
|
|
|
|
if (!sd) return;
|
|
|
|
if (!sd->wd->nmax) return;
|
|
|
|
|
2011-06-02 00:09:17 -07:00
|
|
|
sd->wd->reorder_item_changed = EINA_FALSE;
|
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
EINA_INLIST_FOREACH(sd->wd->items, it)
|
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->is_group)
|
2011-09-09 05:43:34 -07:00
|
|
|
{
|
|
|
|
if (sd->wd->horizontal)
|
|
|
|
{
|
|
|
|
if (cy)
|
|
|
|
{
|
|
|
|
cx++;
|
|
|
|
cy = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (cx)
|
|
|
|
{
|
|
|
|
cx = 0;
|
|
|
|
cy++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2011-10-20 14:41:24 -07:00
|
|
|
_item_place(it, cx, cy);
|
2011-06-02 00:09:17 -07:00
|
|
|
if (sd->wd->reorder_item_changed) return;
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->is_group)
|
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
|
|
|
{
|
2011-09-09 05:43:34 -07:00
|
|
|
if (sd->wd->horizontal)
|
|
|
|
{
|
|
|
|
cx++;
|
|
|
|
cy = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
cx = 0;
|
|
|
|
cy++;
|
|
|
|
}
|
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-09-09 05:43:34 -07:00
|
|
|
if (sd->wd->horizontal)
|
|
|
|
{
|
|
|
|
cy = (cy + 1) % sd->wd->nmax;
|
|
|
|
if (!cy) cx++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
cx = (cx + 1) % sd->wd->nmax;
|
|
|
|
if (!cx) cy++;
|
|
|
|
}
|
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
|
|
|
}
|
|
|
|
}
|
2011-09-09 05:43:34 -07:00
|
|
|
_group_item_place(sd);
|
|
|
|
|
2011-06-14 01:36:03 -07:00
|
|
|
|
|
|
|
if ((sd->wd->reorder_mode) && (sd->wd->reorder_item))
|
|
|
|
{
|
|
|
|
if (!sd->wd->reorder_item_changed)
|
|
|
|
{
|
|
|
|
sd->wd->old_pan_x = sd->wd->pan_x;
|
|
|
|
sd->wd->old_pan_y = sd->wd->pan_y;
|
|
|
|
}
|
|
|
|
sd->wd->move_effect_enabled = EINA_FALSE;
|
|
|
|
}
|
2011-04-21 17:57:15 -07:00
|
|
|
evas_object_smart_callback_call(sd->wd->self, SIG_CHANGED, NULL);
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-12-10 05:01:43 -08:00
|
|
|
_pan_move(Evas_Object *obj,
|
|
|
|
Evas_Coord x __UNUSED__,
|
|
|
|
Evas_Coord y __UNUSED__)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
|
|
|
Pan *sd = evas_object_smart_data_get(obj);
|
|
|
|
if (!sd) return;
|
|
|
|
if (sd->wd->calc_job) ecore_job_del(sd->wd->calc_job);
|
|
|
|
sd->wd->calc_job = ecore_job_add(_calc_job, sd->wd);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-12-10 05:01:43 -08:00
|
|
|
_hold_on(void *data __UNUSED__,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info __UNUSED__)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
elm_smart_scroller_hold_set(wd->scr, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-12-10 05:01:43 -08:00
|
|
|
_hold_off(void *data __UNUSED__,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info __UNUSED__)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
elm_smart_scroller_hold_set(wd->scr, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-12-10 05:01:43 -08:00
|
|
|
_freeze_on(void *data __UNUSED__,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info __UNUSED__)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
elm_smart_scroller_freeze_set(wd->scr, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-12-10 05:01:43 -08:00
|
|
|
_freeze_off(void *data __UNUSED__,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info __UNUSED__)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
elm_smart_scroller_freeze_set(wd->scr, 0);
|
|
|
|
}
|
|
|
|
|
elm genlist: Added "scroll,anim,start", "scroll,anim,stop",
"scroll,drag,start", "scroll,drag,stop" smart callbacks to genlist.
elm gengrid: Added "scroll,anim,start", "scroll,anim,stop" smart
callbacks to genlist.
SVN revision: 62710
2011-08-22 21:02:26 -07:00
|
|
|
static void
|
|
|
|
_scr_anim_start(void *data,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info __UNUSED__)
|
|
|
|
{
|
|
|
|
evas_object_smart_callback_call(data, SIG_SCROLL_ANIM_START, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-08-22 21:04:44 -07:00
|
|
|
_scr_anim_stop(void *data,
|
elm genlist: Added "scroll,anim,start", "scroll,anim,stop",
"scroll,drag,start", "scroll,drag,stop" smart callbacks to genlist.
elm gengrid: Added "scroll,anim,start", "scroll,anim,stop" smart
callbacks to genlist.
SVN revision: 62710
2011-08-22 21:02:26 -07:00
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info __UNUSED__)
|
|
|
|
{
|
|
|
|
evas_object_smart_callback_call(data, SIG_SCROLL_ANIM_STOP, NULL);
|
|
|
|
}
|
|
|
|
|
2010-06-03 05:53:14 -07:00
|
|
|
static void
|
2010-12-10 05:01:43 -08:00
|
|
|
_scr_drag_start(void *data,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info __UNUSED__)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-04-21 17:57:15 -07:00
|
|
|
evas_object_smart_callback_call(data, SIG_SCROLL_DRAG_START, NULL);
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-12-10 05:01:43 -08:00
|
|
|
_scr_drag_stop(void *data,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info __UNUSED__)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-04-21 17:57:15 -07:00
|
|
|
evas_object_smart_callback_call(data, SIG_SCROLL_DRAG_STOP, NULL);
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
2011-09-27 08:04:57 -07:00
|
|
|
static void
|
2011-10-20 09:42:42 -07:00
|
|
|
_edge_left(void *data,
|
|
|
|
Evas_Object *scr __UNUSED__,
|
|
|
|
void *event_info __UNUSED__)
|
2011-09-27 08:04:57 -07:00
|
|
|
{
|
|
|
|
evas_object_smart_callback_call(data, SIG_SCROLL_EDGE_LEFT, NULL);
|
2011-10-20 09:42:42 -07:00
|
|
|
evas_object_smart_callback_call(data, SIG_EDGE_LEFT, NULL);
|
2011-09-27 08:04:57 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-10-20 09:42:42 -07:00
|
|
|
_edge_right(void *data,
|
|
|
|
Evas_Object *scr __UNUSED__,
|
|
|
|
void *event_info __UNUSED__)
|
2011-09-27 08:04:57 -07:00
|
|
|
{
|
|
|
|
evas_object_smart_callback_call(data, SIG_SCROLL_EDGE_RIGHT, NULL);
|
2011-10-20 09:42:42 -07:00
|
|
|
evas_object_smart_callback_call(data, SIG_EDGE_RIGHT, NULL);
|
2011-09-27 08:04:57 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-10-20 09:42:42 -07:00
|
|
|
_edge_top(void *data,
|
|
|
|
Evas_Object *scr __UNUSED__,
|
|
|
|
void *event_info __UNUSED__)
|
2011-09-27 08:04:57 -07:00
|
|
|
{
|
|
|
|
evas_object_smart_callback_call(data, SIG_SCROLL_EDGE_TOP, NULL);
|
2011-10-20 09:42:42 -07:00
|
|
|
evas_object_smart_callback_call(data, SIG_EDGE_TOP, NULL);
|
2011-09-27 08:04:57 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-10-20 09:42:42 -07:00
|
|
|
_edge_bottom(void *data,
|
|
|
|
Evas_Object *scr __UNUSED__,
|
|
|
|
void *event_info __UNUSED__)
|
2011-09-27 08:04:57 -07:00
|
|
|
{
|
|
|
|
evas_object_smart_callback_call(data, SIG_SCROLL_EDGE_BOTTOM, NULL);
|
2011-10-20 09:42:42 -07:00
|
|
|
evas_object_smart_callback_call(data, SIG_EDGE_BOTTOM, NULL);
|
2011-09-27 08:04:57 -07:00
|
|
|
}
|
|
|
|
|
2010-06-03 05:53:14 -07:00
|
|
|
static void
|
2010-12-10 05:01:43 -08:00
|
|
|
_scr_scroll(void *data,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info __UNUSED__)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-04-21 17:57:15 -07:00
|
|
|
evas_object_smart_callback_call(data, SIG_SCROLL, NULL);
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
2011-06-25 16:20:22 -07:00
|
|
|
static int
|
|
|
|
_elm_gengrid_item_compare_data(const void *data, const void *data1)
|
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
const Elm_Gengrid_Item *it = data;
|
2011-06-25 16:20:22 -07:00
|
|
|
const Elm_Gengrid_Item *item1 = data1;
|
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
return _elm_gengrid_item_compare_data_cb(it->base.data, item1->base.data);
|
2011-06-25 16:20:22 -07:00
|
|
|
}
|
|
|
|
|
2011-06-25 08:39:05 -07:00
|
|
|
static int
|
|
|
|
_elm_gengrid_item_compare(const void *data, const void *data1)
|
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
Elm_Gengrid_Item *it, *item1;
|
|
|
|
it = ELM_GENGRID_ITEM_FROM_INLIST(data);
|
2011-06-25 08:39:05 -07:00
|
|
|
item1 = ELM_GENGRID_ITEM_FROM_INLIST(data1);
|
2011-10-20 14:41:24 -07:00
|
|
|
return _elm_gengrid_item_compare_cb(it, item1);
|
2011-06-25 08:39:05 -07:00
|
|
|
}
|
|
|
|
|
2010-06-03 05:53:14 -07:00
|
|
|
EAPI Evas_Object *
|
|
|
|
elm_gengrid_add(Evas_Object *parent)
|
|
|
|
{
|
|
|
|
Evas_Object *obj;
|
|
|
|
Evas *e;
|
|
|
|
Widget_Data *wd;
|
|
|
|
static Evas_Smart *smart = NULL;
|
2010-10-21 12:57:43 -07:00
|
|
|
Eina_Bool bounce = _elm_config->thumbscroll_bounce_enable;
|
2010-06-03 05:53:14 -07:00
|
|
|
|
2011-03-31 23:08:02 -07:00
|
|
|
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
|
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
|
|
|
|
2010-06-03 05:53:14 -07:00
|
|
|
ELM_SET_WIDTYPE(widtype, "gengrid");
|
|
|
|
elm_widget_type_set(obj, "gengrid");
|
|
|
|
elm_widget_sub_object_add(parent, obj);
|
2010-10-01 12:03:17 -07:00
|
|
|
elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL);
|
2010-06-03 05:53:14 -07:00
|
|
|
elm_widget_data_set(obj, wd);
|
|
|
|
elm_widget_del_hook_set(obj, _del_hook);
|
2010-09-09 18:40:50 -07:00
|
|
|
elm_widget_del_pre_hook_set(obj, _del_pre_hook);
|
2010-06-03 05:53:14 -07:00
|
|
|
elm_widget_theme_hook_set(obj, _theme_hook);
|
2010-09-09 15:01:30 -07:00
|
|
|
elm_widget_signal_emit_hook_set(obj, _signal_emit_hook);
|
2010-09-29 05:22:30 -07:00
|
|
|
elm_widget_can_focus_set(obj, EINA_TRUE);
|
2011-10-03 18:24:08 -07:00
|
|
|
elm_widget_signal_callback_add_hook_set(obj, _signal_callback_add_hook);
|
|
|
|
elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook);
|
2010-10-01 12:03:17 -07:00
|
|
|
elm_widget_event_hook_set(obj, _event_hook);
|
2010-06-03 05:53:14 -07:00
|
|
|
|
|
|
|
wd->scr = elm_smart_scroller_add(e);
|
|
|
|
elm_smart_scroller_widget_set(wd->scr, obj);
|
2010-12-10 05:01:43 -08:00
|
|
|
elm_smart_scroller_object_theme_set(obj, wd->scr, "gengrid", "base",
|
|
|
|
"default");
|
2010-06-03 05:53:14 -07:00
|
|
|
elm_widget_resize_object_set(obj, wd->scr);
|
|
|
|
|
2011-08-22 21:04:44 -07:00
|
|
|
evas_object_smart_callback_add(wd->scr, "animate,start", _scr_anim_start, obj);
|
|
|
|
evas_object_smart_callback_add(wd->scr, "animate,stop", _scr_anim_stop, obj);
|
2010-06-03 05:53:14 -07:00
|
|
|
evas_object_smart_callback_add(wd->scr, "drag,start", _scr_drag_start, obj);
|
|
|
|
evas_object_smart_callback_add(wd->scr, "drag,stop", _scr_drag_stop, obj);
|
2011-10-20 09:42:42 -07:00
|
|
|
evas_object_smart_callback_add(wd->scr, "edge,left", _edge_left, obj);
|
|
|
|
evas_object_smart_callback_add(wd->scr, "edge,right", _edge_right, obj);
|
|
|
|
evas_object_smart_callback_add(wd->scr, "edge,top", _edge_top, obj);
|
|
|
|
evas_object_smart_callback_add(wd->scr, "edge,bottom", _edge_bottom,
|
2011-09-27 08:04:57 -07:00
|
|
|
obj);
|
2010-06-03 05:53:14 -07:00
|
|
|
evas_object_smart_callback_add(wd->scr, "scroll", _scr_scroll, obj);
|
|
|
|
|
2010-10-21 12:57:43 -07:00
|
|
|
elm_smart_scroller_bounce_allow_set(wd->scr, bounce, bounce);
|
2010-06-03 05:53:14 -07:00
|
|
|
|
|
|
|
wd->self = obj;
|
|
|
|
wd->align_x = 0.5;
|
|
|
|
wd->align_y = 0.5;
|
2011-06-02 00:09:17 -07:00
|
|
|
wd->h_bounce = bounce;
|
|
|
|
wd->v_bounce = bounce;
|
2010-10-10 13:45:30 -07:00
|
|
|
wd->no_select = EINA_FALSE;
|
2010-06-03 05:53:14 -07:00
|
|
|
|
|
|
|
evas_object_smart_callback_add(obj, "scroll-hold-on", _hold_on, obj);
|
|
|
|
evas_object_smart_callback_add(obj, "scroll-hold-off", _hold_off, obj);
|
|
|
|
evas_object_smart_callback_add(obj, "scroll-freeze-on", _freeze_on, obj);
|
|
|
|
evas_object_smart_callback_add(obj, "scroll-freeze-off", _freeze_off, obj);
|
|
|
|
|
2011-04-21 17:57:15 -07:00
|
|
|
evas_object_smart_callbacks_descriptions_set(obj, _signals);
|
|
|
|
|
2010-06-03 05:53:14 -07:00
|
|
|
if (!smart)
|
|
|
|
{
|
2010-12-10 05:01:43 -08:00
|
|
|
static Evas_Smart_Class sc;
|
|
|
|
|
|
|
|
evas_object_smart_clipped_smart_set(&_pan_sc);
|
|
|
|
sc = _pan_sc;
|
|
|
|
sc.name = "elm_gengrid_pan";
|
|
|
|
sc.version = EVAS_SMART_CLASS_VERSION;
|
|
|
|
sc.add = _pan_add;
|
|
|
|
sc.del = _pan_del;
|
|
|
|
sc.resize = _pan_resize;
|
|
|
|
sc.move = _pan_move;
|
|
|
|
sc.calculate = _pan_calculate;
|
|
|
|
smart = evas_smart_class_new(&sc);
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
if (smart)
|
|
|
|
{
|
2010-12-10 05:01:43 -08:00
|
|
|
wd->pan_smart = evas_object_smart_add(e, smart);
|
|
|
|
wd->pan = evas_object_smart_data_get(wd->pan_smart);
|
|
|
|
wd->pan->wd = wd;
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
elm_smart_scroller_extern_pan_set(wd->scr, wd->pan_smart,
|
2010-11-23 12:30:48 -08:00
|
|
|
_pan_set, _pan_get, _pan_max_get,
|
|
|
|
_pan_min_get, _pan_child_size_get);
|
2010-06-03 05:53:14 -07:00
|
|
|
|
2011-02-08 04:08:28 -08:00
|
|
|
_mirrored_set(obj, elm_widget_mirrored_get(obj));
|
2010-06-03 05:53:14 -07:00
|
|
|
return obj;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2010-12-10 05:01:43 -08:00
|
|
|
elm_gengrid_item_size_set(Evas_Object *obj,
|
|
|
|
Evas_Coord w,
|
|
|
|
Evas_Coord h)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
2010-06-09 14:08:12 -07:00
|
|
|
if ((wd->item_width == w) && (wd->item_height == h)) return;
|
2010-06-03 05:53:14 -07:00
|
|
|
wd->item_width = w;
|
|
|
|
wd->item_height = h;
|
|
|
|
if (wd->calc_job) ecore_job_del(wd->calc_job);
|
|
|
|
wd->calc_job = ecore_job_add(_calc_job, wd);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2010-12-10 05:01:43 -08:00
|
|
|
elm_gengrid_item_size_get(const Evas_Object *obj,
|
|
|
|
Evas_Coord *w,
|
|
|
|
Evas_Coord *h)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
if (w) *w = wd->item_width;
|
|
|
|
if (h) *h = wd->item_height;
|
|
|
|
}
|
|
|
|
|
2011-09-09 05:43:34 -07:00
|
|
|
EAPI void
|
|
|
|
elm_gengrid_group_item_size_set(Evas_Object *obj,
|
|
|
|
Evas_Coord w,
|
|
|
|
Evas_Coord h)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
if ((wd->group_item_width == w) && (wd->group_item_height == h)) return;
|
|
|
|
wd->group_item_width = w;
|
|
|
|
wd->group_item_height = h;
|
|
|
|
if (wd->calc_job) ecore_job_del(wd->calc_job);
|
|
|
|
wd->calc_job = ecore_job_add(_calc_job, wd);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_gengrid_group_item_size_get(const Evas_Object *obj,
|
|
|
|
Evas_Coord *w,
|
|
|
|
Evas_Coord *h)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
if (w) *w = wd->group_item_width;
|
|
|
|
if (h) *h = wd->group_item_height;
|
|
|
|
}
|
|
|
|
|
2010-06-03 05:53:14 -07:00
|
|
|
EAPI void
|
2010-12-10 05:01:43 -08:00
|
|
|
elm_gengrid_align_set(Evas_Object *obj,
|
|
|
|
double align_x,
|
|
|
|
double align_y)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
2011-07-25 12:51:40 -07:00
|
|
|
|
2010-06-03 05:53:14 -07:00
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
2011-07-25 12:51:40 -07:00
|
|
|
double old_h = wd->align_x, old_y = wd->align_y;
|
2010-06-03 05:53:14 -07:00
|
|
|
|
|
|
|
if (align_x > 1.0)
|
|
|
|
align_x = 1.0;
|
|
|
|
else if (align_x < 0.0)
|
|
|
|
align_x = 0.0;
|
|
|
|
wd->align_x = align_x;
|
|
|
|
|
|
|
|
if (align_y > 1.0)
|
|
|
|
align_y = 1.0;
|
|
|
|
else if (align_y < 0.0)
|
|
|
|
align_y = 0.0;
|
|
|
|
wd->align_y = align_y;
|
2011-07-25 12:51:40 -07:00
|
|
|
|
|
|
|
if ((old_h != wd->align_x) || (old_y != wd->align_y))
|
|
|
|
evas_object_smart_calculate(wd->pan_smart);
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2010-12-10 05:01:43 -08:00
|
|
|
elm_gengrid_align_get(const Evas_Object *obj,
|
|
|
|
double *align_x,
|
|
|
|
double *align_y)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2010-12-10 05:01:43 -08:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (align_x) *align_x = wd->align_x;
|
|
|
|
if (align_y) *align_y = wd->align_y;
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Elm_Gengrid_Item *
|
2010-12-10 05:01:43 -08:00
|
|
|
elm_gengrid_item_append(Evas_Object *obj,
|
|
|
|
const Elm_Gengrid_Item_Class *gic,
|
|
|
|
const void *data,
|
|
|
|
Evas_Smart_Cb func,
|
|
|
|
const void *func_data)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
Elm_Gengrid_Item *it;
|
2010-06-03 05:53:14 -07:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return NULL;
|
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
it = _item_create(wd, gic, data, func, func_data);
|
|
|
|
if (!it) return NULL;
|
|
|
|
wd->items = eina_inlist_append(wd->items, EINA_INLIST_GET(it));
|
2010-06-03 05:53:14 -07:00
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->is_group)
|
|
|
|
wd->group_items = eina_list_prepend(wd->group_items, it);
|
2011-09-09 05:43:34 -07:00
|
|
|
|
2010-06-03 05:53:14 -07:00
|
|
|
if (wd->calc_job) ecore_job_del(wd->calc_job);
|
2010-10-10 14:05:23 -07:00
|
|
|
wd->calc_job = ecore_job_add(_calc_job, wd);
|
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
return it;
|
2010-10-10 14:05:23 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Elm_Gengrid_Item *
|
2010-12-10 05:01:43 -08:00
|
|
|
elm_gengrid_item_prepend(Evas_Object *obj,
|
|
|
|
const Elm_Gengrid_Item_Class *gic,
|
|
|
|
const void *data,
|
|
|
|
Evas_Smart_Cb func,
|
|
|
|
const void *func_data)
|
2010-10-10 14:05:23 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
Elm_Gengrid_Item *it;
|
2010-10-10 14:05:23 -07:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return NULL;
|
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
it = _item_create(wd, gic, data, func, func_data);
|
|
|
|
if (!it) return NULL;
|
|
|
|
wd->items = eina_inlist_prepend(wd->items, EINA_INLIST_GET(it));
|
|
|
|
if (it->is_group)
|
|
|
|
wd->group_items = eina_list_append(wd->group_items, it);
|
2010-10-10 14:05:23 -07:00
|
|
|
|
|
|
|
if (wd->calc_job) ecore_job_del(wd->calc_job);
|
|
|
|
wd->calc_job = ecore_job_add(_calc_job, wd);
|
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
return it;
|
2010-10-10 14:05:23 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Elm_Gengrid_Item *
|
2010-12-10 05:01:43 -08:00
|
|
|
elm_gengrid_item_insert_before(Evas_Object *obj,
|
2010-10-10 14:05:23 -07:00
|
|
|
const Elm_Gengrid_Item_Class *gic,
|
2010-12-10 05:01:43 -08:00
|
|
|
const void *data,
|
|
|
|
Elm_Gengrid_Item *relative,
|
|
|
|
Evas_Smart_Cb func,
|
|
|
|
const void *func_data)
|
2010-10-10 14:05:23 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
Elm_Gengrid_Item *it;
|
2010-10-10 14:05:23 -07:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
2010-10-10 19:09:36 -07:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(relative, NULL);
|
2010-10-10 14:05:23 -07:00
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return NULL;
|
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
it = _item_create(wd, gic, data, func, func_data);
|
|
|
|
if (!it) return NULL;
|
2010-10-10 16:54:11 -07:00
|
|
|
wd->items = eina_inlist_prepend_relative
|
2011-10-20 14:41:24 -07:00
|
|
|
(wd->items, EINA_INLIST_GET(it), EINA_INLIST_GET(relative));
|
|
|
|
if (it->is_group)
|
2011-10-20 15:23:48 -07:00
|
|
|
wd->group_items = eina_list_append_relative(wd->group_items, it, relative->parent);
|
2010-10-10 14:05:23 -07:00
|
|
|
|
|
|
|
if (wd->calc_job) ecore_job_del(wd->calc_job);
|
|
|
|
wd->calc_job = ecore_job_add(_calc_job, wd);
|
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
return it;
|
2010-10-10 14:05:23 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Elm_Gengrid_Item *
|
2010-12-10 05:01:43 -08:00
|
|
|
elm_gengrid_item_insert_after(Evas_Object *obj,
|
2010-10-10 14:05:23 -07:00
|
|
|
const Elm_Gengrid_Item_Class *gic,
|
2010-12-10 05:01:43 -08:00
|
|
|
const void *data,
|
|
|
|
Elm_Gengrid_Item *relative,
|
|
|
|
Evas_Smart_Cb func,
|
|
|
|
const void *func_data)
|
2010-10-10 14:05:23 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
Elm_Gengrid_Item *it;
|
2010-10-10 14:05:23 -07:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
2010-10-10 19:09:36 -07:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(relative, NULL);
|
2010-10-10 14:05:23 -07:00
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return NULL;
|
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
it = _item_create(wd, gic, data, func, func_data);
|
|
|
|
if (!it) return NULL;
|
2010-10-10 16:54:11 -07:00
|
|
|
wd->items = eina_inlist_append_relative
|
2011-10-20 14:41:24 -07:00
|
|
|
(wd->items, EINA_INLIST_GET(it), EINA_INLIST_GET(relative));
|
|
|
|
if (it->is_group)
|
2011-10-20 15:23:48 -07:00
|
|
|
wd->group_items = eina_list_prepend_relative(wd->group_items, it, relative->parent);
|
2010-10-10 14:05:23 -07:00
|
|
|
|
|
|
|
if (wd->calc_job) ecore_job_del(wd->calc_job);
|
2010-06-03 05:53:14 -07:00
|
|
|
wd->calc_job = ecore_job_add(_calc_job, wd);
|
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
return it;
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
2011-06-25 08:39:05 -07:00
|
|
|
EAPI Elm_Gengrid_Item *
|
2011-06-25 16:20:22 -07:00
|
|
|
elm_gengrid_item_direct_sorted_insert(Evas_Object *obj,
|
|
|
|
const Elm_Gengrid_Item_Class *gic,
|
|
|
|
const void *data,
|
|
|
|
Eina_Compare_Cb comp,
|
|
|
|
Evas_Smart_Cb func,
|
|
|
|
const void *func_data)
|
2011-06-25 08:39:05 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
Elm_Gengrid_Item *it;
|
2011-06-25 08:39:05 -07:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return NULL;
|
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
it = _item_create(wd, gic, data, func, func_data);
|
|
|
|
if (!it) return NULL;
|
2011-06-25 08:39:05 -07:00
|
|
|
|
2011-09-05 13:31:51 -07:00
|
|
|
if (!wd->state)
|
|
|
|
wd->state = eina_inlist_sorted_state_new();
|
|
|
|
|
2011-06-25 16:20:22 -07:00
|
|
|
_elm_gengrid_item_compare_cb = comp;
|
2011-10-20 14:41:24 -07:00
|
|
|
wd->items = eina_inlist_sorted_state_insert(wd->items, EINA_INLIST_GET(it),
|
2011-09-05 13:31:51 -07:00
|
|
|
_elm_gengrid_item_compare, wd->state);
|
2011-06-25 08:39:05 -07:00
|
|
|
if (wd->calc_job) ecore_job_del(wd->calc_job);
|
|
|
|
wd->calc_job = ecore_job_add(_calc_job, wd);
|
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
return it;
|
2011-06-25 08:39:05 -07:00
|
|
|
}
|
|
|
|
|
2011-06-25 16:20:22 -07:00
|
|
|
EAPI Elm_Gengrid_Item *
|
|
|
|
elm_gengrid_item_sorted_insert(Evas_Object *obj,
|
|
|
|
const Elm_Gengrid_Item_Class *gic,
|
|
|
|
const void *data,
|
|
|
|
Eina_Compare_Cb comp,
|
|
|
|
Evas_Smart_Cb func,
|
|
|
|
const void *func_data)
|
|
|
|
{
|
|
|
|
_elm_gengrid_item_compare_data_cb = comp;
|
|
|
|
|
|
|
|
return elm_gengrid_item_direct_sorted_insert(obj, gic, data, _elm_gengrid_item_compare_data, func, func_data);
|
|
|
|
}
|
|
|
|
|
2010-06-03 05:53:14 -07:00
|
|
|
EAPI void
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_gengrid_item_del(Elm_Gengrid_Item *it)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
|
|
|
|
if ((it->relcount > 0) || (it->walking > 0))
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
it->delete_me = EINA_TRUE;
|
|
|
|
elm_widget_item_pre_notify_del(it);
|
|
|
|
if (it->selected)
|
|
|
|
it->wd->selected = eina_list_remove(it->wd->selected, it);
|
|
|
|
if (it->gic->func.del)
|
|
|
|
it->gic->func.del((void *)it->base.data, it->wd->self);
|
2010-12-10 05:01:43 -08:00
|
|
|
return;
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
_item_del(it);
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2010-12-10 05:01:43 -08:00
|
|
|
elm_gengrid_horizontal_set(Evas_Object *obj,
|
|
|
|
Eina_Bool setting)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
if (setting == wd->horizontal) return;
|
|
|
|
wd->horizontal = setting;
|
|
|
|
|
|
|
|
/* Update the items to conform to the new layout */
|
|
|
|
if (wd->calc_job) ecore_job_del(wd->calc_job);
|
|
|
|
wd->calc_job = ecore_job_add(_calc_job, wd);
|
|
|
|
}
|
|
|
|
|
2011-04-18 03:54:25 -07:00
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_gengrid_horizontal_get(const Evas_Object *obj)
|
|
|
|
{
|
2011-04-18 17:58:39 -07:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
|
2011-04-18 03:54:25 -07:00
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return EINA_FALSE;
|
|
|
|
return wd->horizontal;
|
|
|
|
}
|
|
|
|
|
2010-06-03 05:53:14 -07:00
|
|
|
EAPI void
|
|
|
|
elm_gengrid_clear(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
|
2011-09-05 13:31:51 -07:00
|
|
|
if (wd->state)
|
|
|
|
{
|
|
|
|
eina_inlist_sorted_state_free(wd->state);
|
|
|
|
wd->state = NULL;
|
|
|
|
}
|
2010-06-03 05:53:14 -07:00
|
|
|
if (wd->calc_job)
|
|
|
|
{
|
2010-10-10 16:54:11 -07:00
|
|
|
ecore_job_del(wd->calc_job);
|
|
|
|
wd->calc_job = NULL;
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
2010-10-10 16:54:11 -07:00
|
|
|
if (wd->walking > 0)
|
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
Elm_Gengrid_Item *it;
|
2010-10-10 16:54:11 -07:00
|
|
|
wd->clear_me = 1;
|
2011-10-20 14:41:24 -07:00
|
|
|
EINA_INLIST_FOREACH(wd->items, it)
|
|
|
|
it->delete_me = 1;
|
2010-10-10 16:54:11 -07:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
wd->clear_me = 0;
|
|
|
|
while (wd->items)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
Elm_Gengrid_Item *it = ELM_GENGRID_ITEM_FROM_INLIST(wd->items);
|
2010-10-10 16:54:11 -07:00
|
|
|
|
|
|
|
wd->items = eina_inlist_remove(wd->items, wd->items);
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_widget_item_pre_notify_del(it);
|
|
|
|
if (it->realized) _item_unrealize(it);
|
|
|
|
if (it->gic->func.del)
|
|
|
|
it->gic->func.del((void *)it->base.data, wd->self);
|
|
|
|
if (it->long_timer) ecore_timer_del(it->long_timer);
|
|
|
|
elm_widget_item_del(it);
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
if (wd->selected)
|
|
|
|
{
|
2010-10-10 16:54:11 -07:00
|
|
|
eina_list_free(wd->selected);
|
|
|
|
wd->selected = NULL;
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
wd->pan_x = 0;
|
|
|
|
wd->pan_y = 0;
|
|
|
|
wd->minw = 0;
|
|
|
|
wd->minh = 0;
|
2010-10-10 16:54:11 -07:00
|
|
|
wd->count = 0;
|
2010-06-03 05:53:14 -07:00
|
|
|
evas_object_size_hint_min_set(wd->pan_smart, wd->minw, wd->minh);
|
|
|
|
evas_object_smart_callback_call(wd->pan_smart, "changed", NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI const Evas_Object *
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_gengrid_item_object_get(const Elm_Gengrid_Item *it)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, NULL);
|
|
|
|
return it->base.view;
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
2010-10-09 12:07:42 -07:00
|
|
|
EAPI void
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_gengrid_item_update(Elm_Gengrid_Item *it)
|
2010-10-09 12:07:42 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
|
|
|
|
if (!it->realized) return;
|
|
|
|
if (it->want_unrealize) return;
|
|
|
|
_item_unrealize(it);
|
|
|
|
_item_realize(it);
|
|
|
|
_item_place(it, it->x, it->y);
|
2010-10-09 12:07:42 -07:00
|
|
|
}
|
|
|
|
|
2010-06-03 05:53:14 -07:00
|
|
|
EAPI void *
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_gengrid_item_data_get(const Elm_Gengrid_Item *it)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, NULL);
|
|
|
|
return elm_widget_item_data_get(it);
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
2010-10-10 16:54:11 -07:00
|
|
|
EAPI void
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_gengrid_item_data_set(Elm_Gengrid_Item *it,
|
2010-12-10 05:01:43 -08:00
|
|
|
const void *data)
|
2010-10-10 16:54:11 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
|
|
|
|
elm_widget_item_data_set(it, data);
|
2010-10-10 16:54:11 -07:00
|
|
|
}
|
|
|
|
|
2011-06-25 16:20:22 -07:00
|
|
|
EAPI const Elm_Gengrid_Item_Class *
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_gengrid_item_item_class_get(const Elm_Gengrid_Item *it)
|
2011-06-25 16:20:22 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, NULL);
|
|
|
|
if (it->delete_me) return NULL;
|
|
|
|
return it->gic;
|
2011-06-25 16:20:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_gengrid_item_item_class_set(Elm_Gengrid_Item *it,
|
2011-06-25 16:20:22 -07:00
|
|
|
const Elm_Gengrid_Item_Class *gic)
|
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
|
2011-06-25 16:20:22 -07:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN(gic);
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->delete_me) return;
|
|
|
|
it->gic = gic;
|
|
|
|
elm_gengrid_item_update(it);
|
2011-06-25 16:20:22 -07:00
|
|
|
}
|
|
|
|
|
2010-06-03 05:53:14 -07:00
|
|
|
EAPI void
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_gengrid_item_pos_get(const Elm_Gengrid_Item *it,
|
2010-12-10 05:01:43 -08:00
|
|
|
unsigned int *x,
|
|
|
|
unsigned int *y)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
|
|
|
|
if (x) *x = it->x;
|
|
|
|
if (y) *y = it->y;
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2010-12-10 05:01:43 -08:00
|
|
|
elm_gengrid_multi_select_set(Evas_Object *obj,
|
|
|
|
Eina_Bool multi)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
wd->multi = multi;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_gengrid_multi_select_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return EINA_FALSE;
|
|
|
|
return wd->multi;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Elm_Gengrid_Item *
|
|
|
|
elm_gengrid_selected_item_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return NULL;
|
|
|
|
if (wd->selected) return wd->selected->data;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI const Eina_List *
|
|
|
|
elm_gengrid_selected_items_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return NULL;
|
|
|
|
return wd->selected;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_gengrid_item_selected_set(Elm_Gengrid_Item *it,
|
2010-12-10 05:01:43 -08:00
|
|
|
Eina_Bool selected)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
|
|
|
|
Widget_Data *wd = it->wd;
|
2010-06-03 05:53:14 -07:00
|
|
|
if (!wd) return;
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->delete_me) return;
|
2010-06-03 05:53:14 -07:00
|
|
|
selected = !!selected;
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->selected == selected) return;
|
2010-06-03 05:53:14 -07:00
|
|
|
|
|
|
|
if (selected)
|
|
|
|
{
|
2010-12-10 05:01:43 -08:00
|
|
|
if (!wd->multi)
|
|
|
|
{
|
|
|
|
while (wd->selected)
|
|
|
|
_item_unselect(wd->selected->data);
|
|
|
|
}
|
2011-10-20 14:41:24 -07:00
|
|
|
_item_highlight(it);
|
|
|
|
_item_select(it);
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
else
|
2011-10-20 14:41:24 -07:00
|
|
|
_item_unselect(it);
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_gengrid_item_selected_get(const Elm_Gengrid_Item *it)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, EINA_FALSE);
|
|
|
|
return it->selected;
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_gengrid_item_disabled_set(Elm_Gengrid_Item *it,
|
2010-12-10 05:01:43 -08:00
|
|
|
Eina_Bool disabled)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
|
|
|
|
if (it->disabled == disabled) return;
|
|
|
|
if (it->delete_me) return;
|
|
|
|
it->disabled = !!disabled;
|
|
|
|
if (it->realized)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->disabled)
|
|
|
|
edje_object_signal_emit(it->base.view, "elm,state,disabled", "elm");
|
2010-12-10 05:01:43 -08:00
|
|
|
else
|
2011-10-20 14:41:24 -07:00
|
|
|
edje_object_signal_emit(it->base.view, "elm,state,enabled", "elm");
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_gengrid_item_disabled_get(const Elm_Gengrid_Item *it)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, EINA_FALSE);
|
|
|
|
if (it->delete_me) return EINA_FALSE;
|
|
|
|
return it->disabled;
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
2010-09-27 11:18:37 -07:00
|
|
|
static Evas_Object *
|
2010-12-10 05:01:43 -08:00
|
|
|
_elm_gengrid_item_label_create(void *data,
|
2011-07-26 02:38:23 -07:00
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
Evas_Object *tooltip,
|
2011-10-20 14:41:24 -07:00
|
|
|
void *it __UNUSED__)
|
2010-09-27 11:18:37 -07:00
|
|
|
{
|
2011-07-26 02:38:23 -07:00
|
|
|
Evas_Object *label = elm_label_add(tooltip);
|
2010-09-27 11:18:37 -07:00
|
|
|
if (!label)
|
|
|
|
return NULL;
|
|
|
|
elm_object_style_set(label, "tooltip");
|
2011-06-28 23:41:31 -07:00
|
|
|
elm_object_text_set(label, data);
|
2010-09-27 11:18:37 -07:00
|
|
|
return label;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-12-10 05:01:43 -08:00
|
|
|
_elm_gengrid_item_label_del_cb(void *data,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info __UNUSED__)
|
2010-09-27 11:18:37 -07:00
|
|
|
{
|
|
|
|
eina_stringshare_del(data);
|
|
|
|
}
|
|
|
|
|
Tooltips: split owner/eventarea, allow subitems to have indepentent tooltips.
Now owner widget (elm_widget) is just used to listen for theme changes
and create/destroy the tooltip data. The actual mouse events operates
on all Evas_Object and is the one where tooltip data is actually
stored.
The public API is basically the same, just the event_info is now NULL
to avoid confusion.
The internal API introduces elm_object_sub_tooltip_content_cb_set()
and as the first parameter the eventarea. While this may be confusing,
as the second parameter is the actual elementary object, it is the one
that all other calls receive, like elm_object_tooltip_hide() or
elm_object_tooltip_unset(), thus it does make sense to have such order.
Also internal API, elm_widget_item_tooltip_* functions were
added. They are a variation of the widget API to handle its items, as
such the func() gets one more parameter: item, and the del_cb() gets
the item as event_info (that's why the public widget version got
event_info always NULL, to not confuse with this one!)
Widgets with items that makes sense to have tooltips got extra API:
* toolbar
* list
* gengrid
* genlist
SVN revision: 52173
2010-09-12 14:05:13 -07:00
|
|
|
EAPI void
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_gengrid_item_tooltip_text_set(Elm_Gengrid_Item *it,
|
2010-12-10 05:01:43 -08:00
|
|
|
const char *text)
|
Tooltips: split owner/eventarea, allow subitems to have indepentent tooltips.
Now owner widget (elm_widget) is just used to listen for theme changes
and create/destroy the tooltip data. The actual mouse events operates
on all Evas_Object and is the one where tooltip data is actually
stored.
The public API is basically the same, just the event_info is now NULL
to avoid confusion.
The internal API introduces elm_object_sub_tooltip_content_cb_set()
and as the first parameter the eventarea. While this may be confusing,
as the second parameter is the actual elementary object, it is the one
that all other calls receive, like elm_object_tooltip_hide() or
elm_object_tooltip_unset(), thus it does make sense to have such order.
Also internal API, elm_widget_item_tooltip_* functions were
added. They are a variation of the widget API to handle its items, as
such the func() gets one more parameter: item, and the del_cb() gets
the item as event_info (that's why the public widget version got
event_info always NULL, to not confuse with this one!)
Widgets with items that makes sense to have tooltips got extra API:
* toolbar
* list
* gengrid
* genlist
SVN revision: 52173
2010-09-12 14:05:13 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
|
2010-09-27 11:18:37 -07:00
|
|
|
text = eina_stringshare_add(text);
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_gengrid_item_tooltip_content_cb_set(it, _elm_gengrid_item_label_create,
|
2010-12-10 05:01:43 -08:00
|
|
|
text,
|
|
|
|
_elm_gengrid_item_label_del_cb);
|
Tooltips: split owner/eventarea, allow subitems to have indepentent tooltips.
Now owner widget (elm_widget) is just used to listen for theme changes
and create/destroy the tooltip data. The actual mouse events operates
on all Evas_Object and is the one where tooltip data is actually
stored.
The public API is basically the same, just the event_info is now NULL
to avoid confusion.
The internal API introduces elm_object_sub_tooltip_content_cb_set()
and as the first parameter the eventarea. While this may be confusing,
as the second parameter is the actual elementary object, it is the one
that all other calls receive, like elm_object_tooltip_hide() or
elm_object_tooltip_unset(), thus it does make sense to have such order.
Also internal API, elm_widget_item_tooltip_* functions were
added. They are a variation of the widget API to handle its items, as
such the func() gets one more parameter: item, and the del_cb() gets
the item as event_info (that's why the public widget version got
event_info always NULL, to not confuse with this one!)
Widgets with items that makes sense to have tooltips got extra API:
* toolbar
* list
* gengrid
* genlist
SVN revision: 52173
2010-09-12 14:05:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_gengrid_item_tooltip_content_cb_set(Elm_Gengrid_Item *it,
|
2010-12-10 05:01:43 -08:00
|
|
|
Elm_Tooltip_Item_Content_Cb func,
|
|
|
|
const void *data,
|
|
|
|
Evas_Smart_Cb del_cb)
|
Tooltips: split owner/eventarea, allow subitems to have indepentent tooltips.
Now owner widget (elm_widget) is just used to listen for theme changes
and create/destroy the tooltip data. The actual mouse events operates
on all Evas_Object and is the one where tooltip data is actually
stored.
The public API is basically the same, just the event_info is now NULL
to avoid confusion.
The internal API introduces elm_object_sub_tooltip_content_cb_set()
and as the first parameter the eventarea. While this may be confusing,
as the second parameter is the actual elementary object, it is the one
that all other calls receive, like elm_object_tooltip_hide() or
elm_object_tooltip_unset(), thus it does make sense to have such order.
Also internal API, elm_widget_item_tooltip_* functions were
added. They are a variation of the widget API to handle its items, as
such the func() gets one more parameter: item, and the del_cb() gets
the item as event_info (that's why the public widget version got
event_info always NULL, to not confuse with this one!)
Widgets with items that makes sense to have tooltips got extra API:
* toolbar
* list
* gengrid
* genlist
SVN revision: 52173
2010-09-12 14:05:13 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_GOTO(it, error);
|
2010-09-27 11:18:37 -07:00
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
if ((it->tooltip.content_cb == func) && (it->tooltip.data == data))
|
2010-09-27 11:18:37 -07:00
|
|
|
return;
|
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->tooltip.del_cb)
|
|
|
|
it->tooltip.del_cb((void *)it->tooltip.data,
|
|
|
|
it->base.widget, it);
|
|
|
|
it->tooltip.content_cb = func;
|
|
|
|
it->tooltip.data = data;
|
|
|
|
it->tooltip.del_cb = del_cb;
|
|
|
|
if (it->base.view)
|
2010-09-27 11:18:37 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_widget_item_tooltip_content_cb_set(it,
|
|
|
|
it->tooltip.content_cb,
|
|
|
|
it->tooltip.data, NULL);
|
|
|
|
elm_widget_item_tooltip_style_set(it, it->tooltip.style);
|
|
|
|
elm_widget_item_tooltip_size_restrict_disable(it, it->tooltip.free_size);
|
2010-09-27 11:18:37 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
2010-11-02 04:26:47 -07:00
|
|
|
error:
|
2010-09-27 11:18:37 -07:00
|
|
|
if (del_cb) del_cb((void *)data, NULL, NULL);
|
Tooltips: split owner/eventarea, allow subitems to have indepentent tooltips.
Now owner widget (elm_widget) is just used to listen for theme changes
and create/destroy the tooltip data. The actual mouse events operates
on all Evas_Object and is the one where tooltip data is actually
stored.
The public API is basically the same, just the event_info is now NULL
to avoid confusion.
The internal API introduces elm_object_sub_tooltip_content_cb_set()
and as the first parameter the eventarea. While this may be confusing,
as the second parameter is the actual elementary object, it is the one
that all other calls receive, like elm_object_tooltip_hide() or
elm_object_tooltip_unset(), thus it does make sense to have such order.
Also internal API, elm_widget_item_tooltip_* functions were
added. They are a variation of the widget API to handle its items, as
such the func() gets one more parameter: item, and the del_cb() gets
the item as event_info (that's why the public widget version got
event_info always NULL, to not confuse with this one!)
Widgets with items that makes sense to have tooltips got extra API:
* toolbar
* list
* gengrid
* genlist
SVN revision: 52173
2010-09-12 14:05:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_gengrid_item_tooltip_unset(Elm_Gengrid_Item *it)
|
Tooltips: split owner/eventarea, allow subitems to have indepentent tooltips.
Now owner widget (elm_widget) is just used to listen for theme changes
and create/destroy the tooltip data. The actual mouse events operates
on all Evas_Object and is the one where tooltip data is actually
stored.
The public API is basically the same, just the event_info is now NULL
to avoid confusion.
The internal API introduces elm_object_sub_tooltip_content_cb_set()
and as the first parameter the eventarea. While this may be confusing,
as the second parameter is the actual elementary object, it is the one
that all other calls receive, like elm_object_tooltip_hide() or
elm_object_tooltip_unset(), thus it does make sense to have such order.
Also internal API, elm_widget_item_tooltip_* functions were
added. They are a variation of the widget API to handle its items, as
such the func() gets one more parameter: item, and the del_cb() gets
the item as event_info (that's why the public widget version got
event_info always NULL, to not confuse with this one!)
Widgets with items that makes sense to have tooltips got extra API:
* toolbar
* list
* gengrid
* genlist
SVN revision: 52173
2010-09-12 14:05:13 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
|
|
|
|
if ((it->base.view) && (it->tooltip.content_cb))
|
|
|
|
elm_widget_item_tooltip_unset(it);
|
2010-09-27 11:18:37 -07:00
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->tooltip.del_cb)
|
|
|
|
it->tooltip.del_cb((void *)it->tooltip.data, it->base.widget, it);
|
|
|
|
it->tooltip.del_cb = NULL;
|
|
|
|
it->tooltip.content_cb = NULL;
|
|
|
|
it->tooltip.data = NULL;
|
|
|
|
it->tooltip.free_size = EINA_FALSE;
|
|
|
|
if (it->tooltip.style)
|
|
|
|
elm_gengrid_item_tooltip_style_set(it, NULL);
|
Tooltips: split owner/eventarea, allow subitems to have indepentent tooltips.
Now owner widget (elm_widget) is just used to listen for theme changes
and create/destroy the tooltip data. The actual mouse events operates
on all Evas_Object and is the one where tooltip data is actually
stored.
The public API is basically the same, just the event_info is now NULL
to avoid confusion.
The internal API introduces elm_object_sub_tooltip_content_cb_set()
and as the first parameter the eventarea. While this may be confusing,
as the second parameter is the actual elementary object, it is the one
that all other calls receive, like elm_object_tooltip_hide() or
elm_object_tooltip_unset(), thus it does make sense to have such order.
Also internal API, elm_widget_item_tooltip_* functions were
added. They are a variation of the widget API to handle its items, as
such the func() gets one more parameter: item, and the del_cb() gets
the item as event_info (that's why the public widget version got
event_info always NULL, to not confuse with this one!)
Widgets with items that makes sense to have tooltips got extra API:
* toolbar
* list
* gengrid
* genlist
SVN revision: 52173
2010-09-12 14:05:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_gengrid_item_tooltip_style_set(Elm_Gengrid_Item *it,
|
2010-12-10 05:01:43 -08:00
|
|
|
const char *style)
|
Tooltips: split owner/eventarea, allow subitems to have indepentent tooltips.
Now owner widget (elm_widget) is just used to listen for theme changes
and create/destroy the tooltip data. The actual mouse events operates
on all Evas_Object and is the one where tooltip data is actually
stored.
The public API is basically the same, just the event_info is now NULL
to avoid confusion.
The internal API introduces elm_object_sub_tooltip_content_cb_set()
and as the first parameter the eventarea. While this may be confusing,
as the second parameter is the actual elementary object, it is the one
that all other calls receive, like elm_object_tooltip_hide() or
elm_object_tooltip_unset(), thus it does make sense to have such order.
Also internal API, elm_widget_item_tooltip_* functions were
added. They are a variation of the widget API to handle its items, as
such the func() gets one more parameter: item, and the del_cb() gets
the item as event_info (that's why the public widget version got
event_info always NULL, to not confuse with this one!)
Widgets with items that makes sense to have tooltips got extra API:
* toolbar
* list
* gengrid
* genlist
SVN revision: 52173
2010-09-12 14:05:13 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
|
|
|
|
eina_stringshare_replace(&it->tooltip.style, style);
|
|
|
|
if (it->base.view) elm_widget_item_tooltip_style_set(it, style);
|
Tooltips: split owner/eventarea, allow subitems to have indepentent tooltips.
Now owner widget (elm_widget) is just used to listen for theme changes
and create/destroy the tooltip data. The actual mouse events operates
on all Evas_Object and is the one where tooltip data is actually
stored.
The public API is basically the same, just the event_info is now NULL
to avoid confusion.
The internal API introduces elm_object_sub_tooltip_content_cb_set()
and as the first parameter the eventarea. While this may be confusing,
as the second parameter is the actual elementary object, it is the one
that all other calls receive, like elm_object_tooltip_hide() or
elm_object_tooltip_unset(), thus it does make sense to have such order.
Also internal API, elm_widget_item_tooltip_* functions were
added. They are a variation of the widget API to handle its items, as
such the func() gets one more parameter: item, and the del_cb() gets
the item as event_info (that's why the public widget version got
event_info always NULL, to not confuse with this one!)
Widgets with items that makes sense to have tooltips got extra API:
* toolbar
* list
* gengrid
* genlist
SVN revision: 52173
2010-09-12 14:05:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI const char *
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_gengrid_item_tooltip_style_get(const Elm_Gengrid_Item *it)
|
Tooltips: split owner/eventarea, allow subitems to have indepentent tooltips.
Now owner widget (elm_widget) is just used to listen for theme changes
and create/destroy the tooltip data. The actual mouse events operates
on all Evas_Object and is the one where tooltip data is actually
stored.
The public API is basically the same, just the event_info is now NULL
to avoid confusion.
The internal API introduces elm_object_sub_tooltip_content_cb_set()
and as the first parameter the eventarea. While this may be confusing,
as the second parameter is the actual elementary object, it is the one
that all other calls receive, like elm_object_tooltip_hide() or
elm_object_tooltip_unset(), thus it does make sense to have such order.
Also internal API, elm_widget_item_tooltip_* functions were
added. They are a variation of the widget API to handle its items, as
such the func() gets one more parameter: item, and the del_cb() gets
the item as event_info (that's why the public widget version got
event_info always NULL, to not confuse with this one!)
Widgets with items that makes sense to have tooltips got extra API:
* toolbar
* list
* gengrid
* genlist
SVN revision: 52173
2010-09-12 14:05:13 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, NULL);
|
|
|
|
return it->tooltip.style;
|
Tooltips: split owner/eventarea, allow subitems to have indepentent tooltips.
Now owner widget (elm_widget) is just used to listen for theme changes
and create/destroy the tooltip data. The actual mouse events operates
on all Evas_Object and is the one where tooltip data is actually
stored.
The public API is basically the same, just the event_info is now NULL
to avoid confusion.
The internal API introduces elm_object_sub_tooltip_content_cb_set()
and as the first parameter the eventarea. While this may be confusing,
as the second parameter is the actual elementary object, it is the one
that all other calls receive, like elm_object_tooltip_hide() or
elm_object_tooltip_unset(), thus it does make sense to have such order.
Also internal API, elm_widget_item_tooltip_* functions were
added. They are a variation of the widget API to handle its items, as
such the func() gets one more parameter: item, and the del_cb() gets
the item as event_info (that's why the public widget version got
event_info always NULL, to not confuse with this one!)
Widgets with items that makes sense to have tooltips got extra API:
* toolbar
* list
* gengrid
* genlist
SVN revision: 52173
2010-09-12 14:05:13 -07:00
|
|
|
}
|
|
|
|
|
2011-07-26 02:38:23 -07:00
|
|
|
EAPI Eina_Bool
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_gengrid_item_tooltip_size_restrict_disable(Elm_Gengrid_Item *it, Eina_Bool disable)
|
2011-07-26 02:38:23 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, EINA_FALSE);
|
|
|
|
it->tooltip.free_size = disable;
|
|
|
|
if (it->base.view) return elm_widget_item_tooltip_size_restrict_disable(it, disable);
|
2011-07-27 19:22:37 -07:00
|
|
|
return EINA_TRUE;
|
2011-07-26 02:38:23 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_gengrid_item_tooltip_size_restrict_disabled_get(const Elm_Gengrid_Item *it)
|
2011-07-26 02:38:23 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, EINA_FALSE);
|
|
|
|
return it->tooltip.free_size;
|
2011-07-26 02:38:23 -07:00
|
|
|
}
|
|
|
|
|
2010-09-17 11:24:10 -07:00
|
|
|
EAPI void
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_gengrid_item_cursor_set(Elm_Gengrid_Item *it,
|
2010-12-10 05:01:43 -08:00
|
|
|
const char *cursor)
|
2010-09-17 11:24:10 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
|
|
|
|
eina_stringshare_replace(&it->mouse_cursor, cursor);
|
|
|
|
if (it->base.view) elm_widget_item_cursor_set(it, cursor);
|
2010-09-17 11:24:10 -07:00
|
|
|
}
|
|
|
|
|
2010-11-04 17:46:54 -07:00
|
|
|
EAPI const char *
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_gengrid_item_cursor_get(const Elm_Gengrid_Item *it)
|
2010-11-04 17:46:54 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, NULL);
|
|
|
|
return elm_widget_item_cursor_get(it);
|
2010-11-04 17:46:54 -07:00
|
|
|
}
|
|
|
|
|
2010-09-17 11:24:10 -07:00
|
|
|
EAPI void
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_gengrid_item_cursor_unset(Elm_Gengrid_Item *it)
|
2010-09-17 11:24:10 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
|
|
|
|
if (!it->mouse_cursor)
|
2010-09-27 11:18:37 -07:00
|
|
|
return;
|
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
if (it->base.view)
|
|
|
|
elm_widget_item_cursor_unset(it);
|
2010-09-27 11:18:37 -07:00
|
|
|
|
2011-10-20 14:41:24 -07:00
|
|
|
eina_stringshare_del(it->mouse_cursor);
|
|
|
|
it->mouse_cursor = NULL;
|
2010-09-17 11:24:10 -07:00
|
|
|
}
|
|
|
|
|
2010-09-25 15:01:19 -07:00
|
|
|
EAPI void
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_gengrid_item_cursor_style_set(Elm_Gengrid_Item *it,
|
2010-12-10 05:01:43 -08:00
|
|
|
const char *style)
|
2010-09-25 15:01:19 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
|
|
|
|
elm_widget_item_cursor_style_set(it, style);
|
2010-09-25 15:01:19 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI const char *
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_gengrid_item_cursor_style_get(const Elm_Gengrid_Item *it)
|
2010-09-25 15:01:19 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, NULL);
|
|
|
|
return elm_widget_item_cursor_style_get(it);
|
2010-09-25 15:01:19 -07:00
|
|
|
}
|
|
|
|
|
2010-09-25 15:03:37 -07:00
|
|
|
EAPI void
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_gengrid_item_cursor_engine_only_set(Elm_Gengrid_Item *it,
|
2010-12-10 05:01:43 -08:00
|
|
|
Eina_Bool engine_only)
|
2010-09-25 15:03:37 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
|
|
|
|
elm_widget_item_cursor_engine_only_set(it, engine_only);
|
2010-09-25 15:03:37 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_gengrid_item_cursor_engine_only_get(const Elm_Gengrid_Item *it)
|
2010-09-25 15:03:37 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, EINA_FALSE);
|
|
|
|
return elm_widget_item_cursor_engine_only_get(it);
|
2010-09-25 15:03:37 -07:00
|
|
|
}
|
|
|
|
|
2011-06-02 00:09:17 -07:00
|
|
|
EAPI void
|
|
|
|
elm_gengrid_reorder_mode_set(Evas_Object *obj,
|
|
|
|
Eina_Bool reorder_mode)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
wd->reorder_mode = reorder_mode;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_gengrid_reorder_mode_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return EINA_FALSE;
|
|
|
|
return wd->reorder_mode;
|
|
|
|
}
|
|
|
|
|
2010-06-03 05:53:14 -07:00
|
|
|
EAPI void
|
2010-12-10 05:01:43 -08:00
|
|
|
elm_gengrid_always_select_mode_set(Evas_Object *obj,
|
|
|
|
Eina_Bool always_select)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
wd->always_select = always_select;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_gengrid_always_select_mode_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return EINA_FALSE;
|
|
|
|
return wd->always_select;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2010-12-10 05:01:43 -08:00
|
|
|
elm_gengrid_no_select_mode_set(Evas_Object *obj,
|
|
|
|
Eina_Bool no_select)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
wd->no_select = no_select;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_gengrid_no_select_mode_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return EINA_FALSE;
|
|
|
|
return wd->no_select;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2010-12-10 05:01:43 -08:00
|
|
|
elm_gengrid_bounce_set(Evas_Object *obj,
|
|
|
|
Eina_Bool h_bounce,
|
|
|
|
Eina_Bool v_bounce)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
elm_smart_scroller_bounce_allow_set(wd->scr, h_bounce, v_bounce);
|
2011-06-02 00:09:17 -07:00
|
|
|
wd->h_bounce = h_bounce;
|
|
|
|
wd->v_bounce = v_bounce;
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2010-12-10 05:01:43 -08:00
|
|
|
elm_gengrid_bounce_get(const Evas_Object *obj,
|
|
|
|
Eina_Bool *h_bounce,
|
|
|
|
Eina_Bool *v_bounce)
|
2010-06-03 05:53:14 -07:00
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
2011-07-25 12:51:57 -07:00
|
|
|
if (h_bounce) *h_bounce = wd->h_bounce;
|
|
|
|
if (v_bounce) *v_bounce = wd->v_bounce;
|
2010-06-03 05:53:14 -07:00
|
|
|
}
|
2010-07-06 14:14:38 -07:00
|
|
|
|
2010-09-29 09:59:35 -07:00
|
|
|
EAPI void
|
2010-12-10 05:01:43 -08:00
|
|
|
elm_gengrid_page_relative_set(Evas_Object *obj,
|
|
|
|
double h_pagerel,
|
|
|
|
double v_pagerel)
|
2010-09-29 09:59:35 -07:00
|
|
|
{
|
|
|
|
Evas_Coord pagesize_h;
|
|
|
|
Evas_Coord pagesize_v;
|
|
|
|
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
|
|
|
|
elm_smart_scroller_paging_get(wd->scr, NULL, NULL, &pagesize_h, &pagesize_v);
|
2010-12-10 05:01:43 -08:00
|
|
|
elm_smart_scroller_paging_set(wd->scr, h_pagerel, v_pagerel, pagesize_h,
|
|
|
|
pagesize_v);
|
2010-09-29 09:59:35 -07:00
|
|
|
}
|
|
|
|
|
2011-04-18 03:54:25 -07:00
|
|
|
EAPI void
|
|
|
|
elm_gengrid_page_relative_get(const Evas_Object *obj, double *h_pagerel, double *v_pagerel)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
|
|
|
|
elm_smart_scroller_paging_get(wd->scr, h_pagerel, v_pagerel, NULL, NULL);
|
|
|
|
}
|
|
|
|
|
2010-09-29 09:59:35 -07:00
|
|
|
EAPI void
|
2010-12-10 05:01:43 -08:00
|
|
|
elm_gengrid_page_size_set(Evas_Object *obj,
|
|
|
|
Evas_Coord h_pagesize,
|
|
|
|
Evas_Coord v_pagesize)
|
|
|
|
{
|
2010-09-29 09:59:35 -07:00
|
|
|
double pagerel_h;
|
|
|
|
double pagerel_v;
|
|
|
|
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
elm_smart_scroller_paging_get(wd->scr, &pagerel_h, &pagerel_v, NULL, NULL);
|
2010-12-10 05:01:43 -08:00
|
|
|
elm_smart_scroller_paging_set(wd->scr, pagerel_h, pagerel_v, h_pagesize,
|
|
|
|
v_pagesize);
|
2010-09-29 09:59:35 -07:00
|
|
|
}
|
|
|
|
|
elm gengrid: Added page feature to gengrid. Patch by Benjamin Drucker
<benjamin.t.drucker@alum.mit.edu>. Thanks a lot!
On Wed, Aug 31, 2011 at 1:52 PM, Benjamin Drucker
<benjamin.t.drucker@alum.mit.edu> wrote:
> Earlier this month, there was a svn commit
> (http://trac.enlightenment.org/e/changeset/62496) which added a few
> page-related APIs to the elm scroller. These should probably also be
> added to gengrid, genlist and maybe even grid and list. Right now,
> though, I need them for gengrid. So I propose this patch, based
> entirely on the change that went in before. I've built it and I'm
> using these new gengrid APIs in my code now.
On Fri, Sep 9, 2011 at 4:45 PM, Benjamin Drucker
<benjamin.t.drucker@alum.mit.edu> wrote:
> Slowly but surely....
>
> This version of the gengrid page APIs patch has the following changes:
> 1. fixed spacing issues
> 2. add const where needed
> 3. submitted a gengrid longpressed change in a separate patch
>
> I really want to try to squeak this in the upcoming release if at all
> possible. If I have an extra space in some file, I promise I'll not do
> it again for the next patch!
>
> Thanks!!
> Ben
SVN revision: 63403
2011-09-14 19:16:37 -07:00
|
|
|
EAPI void
|
|
|
|
elm_gengrid_current_page_get(const Evas_Object *obj, int *h_pagenumber, int *v_pagenumber)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
if (wd->scr)
|
|
|
|
elm_smart_scroller_current_page_get(wd->scr, h_pagenumber, v_pagenumber);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_gengrid_last_page_get(const Evas_Object *obj, int *h_pagenumber, int *v_pagenumber)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
if (wd->scr)
|
|
|
|
elm_smart_scroller_last_page_get(wd->scr, h_pagenumber, v_pagenumber);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_gengrid_page_show(const Evas_Object *obj, int h_pagenumber, int v_pagenumber)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
if (wd->scr)
|
|
|
|
elm_smart_scroller_page_show(wd->scr, h_pagenumber, v_pagenumber);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_gengrid_page_bring_in(const Evas_Object *obj, int h_pagenumber, int v_pagenumber)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
if (wd->scr)
|
|
|
|
elm_smart_scroller_page_bring_in(wd->scr, h_pagenumber, v_pagenumber);
|
|
|
|
}
|
|
|
|
|
2010-10-10 16:54:11 -07:00
|
|
|
EAPI Elm_Gengrid_Item *
|
|
|
|
elm_gengrid_first_item_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return NULL;
|
|
|
|
if (!wd->items) return NULL;
|
2011-10-20 14:41:24 -07:00
|
|
|
Elm_Gengrid_Item *it = ELM_GENGRID_ITEM_FROM_INLIST(wd->items);
|
|
|
|
while ((it) && (it->delete_me))
|
|
|
|
it = ELM_GENGRID_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
|
|
|
|
return it;
|
2010-10-10 16:54:11 -07:00
|
|
|
}
|
2010-09-29 09:59:35 -07:00
|
|
|
|
2010-10-10 16:54:11 -07:00
|
|
|
EAPI Elm_Gengrid_Item *
|
|
|
|
elm_gengrid_last_item_get(const Evas_Object *obj)
|
2010-07-06 14:14:38 -07:00
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
2011-02-13 05:16:59 -08:00
|
|
|
if (!wd) return NULL;
|
2010-10-10 16:54:11 -07:00
|
|
|
if (!wd->items) return NULL;
|
2011-10-20 14:41:24 -07:00
|
|
|
Elm_Gengrid_Item *it = ELM_GENGRID_ITEM_FROM_INLIST(wd->items->last);
|
|
|
|
while ((it) && (it->delete_me))
|
|
|
|
it = ELM_GENGRID_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
|
|
|
|
return it;
|
2010-10-10 16:54:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Elm_Gengrid_Item *
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_gengrid_item_next_get(const Elm_Gengrid_Item *it)
|
2010-10-10 16:54:11 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, NULL);
|
|
|
|
while (it)
|
2010-10-10 16:54:11 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
it = ELM_GENGRID_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
|
|
|
|
if ((it) && (!it->delete_me)) break;
|
2010-10-10 16:54:11 -07:00
|
|
|
}
|
2011-10-20 14:41:24 -07:00
|
|
|
return (Elm_Gengrid_Item *)it;
|
2010-10-10 16:54:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Elm_Gengrid_Item *
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_gengrid_item_prev_get(const Elm_Gengrid_Item *it)
|
2010-10-10 16:54:11 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, NULL);
|
|
|
|
while (it)
|
2010-10-10 16:54:11 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
it = ELM_GENGRID_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
|
|
|
|
if ((it) && (!it->delete_me)) break;
|
2010-10-10 16:54:11 -07:00
|
|
|
}
|
2011-10-20 14:41:24 -07:00
|
|
|
return (Elm_Gengrid_Item *)it;
|
2010-10-10 16:54:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Evas_Object *
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_gengrid_item_gengrid_get(const Elm_Gengrid_Item *it)
|
2010-10-10 16:54:11 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, NULL);
|
|
|
|
return it->base.widget;
|
2010-07-06 14:14:38 -07:00
|
|
|
}
|
2010-09-22 23:33:50 -07:00
|
|
|
|
|
|
|
EAPI void
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_gengrid_item_show(Elm_Gengrid_Item *it)
|
2010-09-22 23:33:50 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(it->wd->self);
|
2010-11-25 06:00:37 -08:00
|
|
|
Evas_Coord minx = 0, miny = 0;
|
2010-09-22 23:33:50 -07:00
|
|
|
|
|
|
|
if (!wd) return;
|
2011-10-20 14:41:24 -07:00
|
|
|
if ((!it) || (it->delete_me)) return;
|
2010-11-25 06:00:37 -08:00
|
|
|
_pan_min_get(wd->pan_smart, &minx, &miny);
|
2010-09-22 23:33:50 -07:00
|
|
|
|
2011-09-09 05:43:34 -07:00
|
|
|
if (wd->horizontal)
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_smart_scroller_region_bring_in(it->wd->scr,
|
|
|
|
((it->x - it->prev_group) * wd->item_width) + (it->prev_group * it->wd->group_item_width) + minx,
|
|
|
|
it->y * wd->item_height + miny,
|
|
|
|
it->wd->item_width,
|
|
|
|
it->wd->item_height);
|
2011-09-09 05:43:34 -07:00
|
|
|
else
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_smart_scroller_region_bring_in(it->wd->scr,
|
|
|
|
it->x * wd->item_width + minx,
|
|
|
|
((it->y - it->prev_group)* wd->item_height) + (it->prev_group * it->wd->group_item_height) + miny,
|
|
|
|
it->wd->item_width,
|
|
|
|
it->wd->item_height);
|
2010-09-22 23:33:50 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_gengrid_item_bring_in(Elm_Gengrid_Item *it)
|
2010-09-22 23:33:50 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
|
|
|
|
if (it->delete_me) return;
|
2010-09-22 23:33:50 -07:00
|
|
|
|
2010-11-25 06:00:37 -08:00
|
|
|
Evas_Coord minx = 0, miny = 0;
|
2011-10-20 14:41:24 -07:00
|
|
|
Widget_Data *wd = elm_widget_data_get(it->wd->self);
|
2010-09-22 23:33:50 -07:00
|
|
|
if (!wd) return;
|
2010-11-25 06:00:37 -08:00
|
|
|
_pan_min_get(wd->pan_smart, &minx, &miny);
|
2010-09-22 23:33:50 -07:00
|
|
|
|
2011-09-09 05:43:34 -07:00
|
|
|
if (wd->horizontal)
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_smart_scroller_region_bring_in(it->wd->scr,
|
|
|
|
((it->x - it->prev_group) * wd->item_width) + (it->prev_group * it->wd->group_item_width) + minx,
|
|
|
|
it->y * wd->item_height + miny,
|
|
|
|
it->wd->item_width,
|
|
|
|
it->wd->item_height);
|
2011-09-09 05:43:34 -07:00
|
|
|
else
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_smart_scroller_region_bring_in(it->wd->scr,
|
|
|
|
it->x * wd->item_width + minx,
|
|
|
|
((it->y - it->prev_group)* wd->item_height) + (it->prev_group * it->wd->group_item_height) + miny,
|
|
|
|
it->wd->item_width,
|
|
|
|
it->wd->item_height);
|
2010-09-22 23:33:50 -07:00
|
|
|
}
|