princeamd pushed a commit to branch enlightenment-0.17.
commit f7fa56bdcc1c338908c3dad9c663150b4c41797f
Author: Christopher Michael <[email protected]>
Date: Tue Feb 19 10:57:38 2013 +0000
Backport: fd0889b :: Add missing LOGFN's where needed. Add mouse_move
callback on frame. Delete mouse_move callback when we delete the frame. Add
code in frame moouse_move function to call appropriate event based on current
action. Start of actual resize event code.
Signed-off-by: Christopher Michael <[email protected]>
SVN revision: 84168
Signed-off-by: Deon Thomas <[email protected]>
---
src/modules/conf_randr/e_smart_monitor.c | 81 ++++++++++++++++++++++++++++++++
1 file changed, 81 insertions(+)
diff --git a/src/modules/conf_randr/e_smart_monitor.c
b/src/modules/conf_randr/e_smart_monitor.c
index a9d97f0..fc16230 100644
--- a/src/modules/conf_randr/e_smart_monitor.c
+++ b/src/modules/conf_randr/e_smart_monitor.c
@@ -91,6 +91,7 @@ static void _e_smart_monitor_thumb_cb_mouse_out(void *data
EINA_UNUSED, Evas *ev
static void _e_smart_monitor_thumb_cb_mouse_up(void *data EINA_UNUSED, Evas
*evas EINA_UNUSED, Evas_Object *obj, void *event);
static void _e_smart_monitor_thumb_cb_mouse_down(void *data EINA_UNUSED, Evas
*evas EINA_UNUSED, Evas_Object *obj, void *event);
+static void _e_smart_monitor_frame_cb_mouse_move(void *data, Evas *evas
EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event);
static void _e_smart_monitor_frame_cb_resize_in(void *data EINA_UNUSED,
Evas_Object *obj, const char *emission EINA_UNUSED, const char *source
EINA_UNUSED);
static void _e_smart_monitor_frame_cb_resize_out(void *data EINA_UNUSED,
Evas_Object *obj, const char *emission EINA_UNUSED, const char *source
EINA_UNUSED);
static void _e_smart_monitor_frame_cb_rotate_in(void *data EINA_UNUSED,
Evas_Object *obj, const char *emission EINA_UNUSED, const char *source
EINA_UNUSED);
@@ -101,6 +102,8 @@ static void _e_smart_monitor_frame_cb_indicator_out(void
*data EINA_UNUSED, Evas
static void _e_smart_monitor_frame_cb_resize_start(void *data, Evas_Object
*obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source
EINA_UNUSED);
static void _e_smart_monitor_frame_cb_resize_stop(void *data, Evas_Object *obj
EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED);
+static void _e_smart_monitor_resize_event(E_Smart_Data *sd, Evas_Object *mon,
void *event);
+
/* external functions exposed by this widget */
Evas_Object *
e_smart_monitor_add(Evas *evas)
@@ -261,6 +264,8 @@ e_smart_monitor_grid_set(Evas_Object *obj, Evas_Object
*grid)
{
E_Smart_Data *sd;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
/* try to get the objects smart data */
if (!(sd = evas_object_smart_data_get(obj))) return;
@@ -276,6 +281,8 @@ e_smart_monitor_background_set(Evas_Object *obj, Evas_Coord
dx, Evas_Coord dy)
E_Zone *zone;
E_Desk *desk;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
/* try to get the objects smart data */
if (!(sd = evas_object_smart_data_get(obj))) return;
@@ -331,6 +338,9 @@ _e_smart_add(Evas_Object *obj)
edje_object_part_swallow(sd->o_base, "e.swallow.frame", sd->o_frame);
/* add callbacks for frame events */
+ evas_object_event_callback_add(sd->o_frame, EVAS_CALLBACK_MOUSE_MOVE,
+ _e_smart_monitor_frame_cb_mouse_move, obj);
+
edje_object_signal_callback_add(sd->o_frame, "e,action,resize,in", "e",
_e_smart_monitor_frame_cb_resize_in, NULL);
edje_object_signal_callback_add(sd->o_frame, "e,action,resize,out", "e",
@@ -413,6 +423,9 @@ _e_smart_del(Evas_Object *obj)
if (sd->o_frame)
{
/* delete the event callbacks */
+ evas_object_event_callback_del(sd->o_frame, EVAS_CALLBACK_MOUSE_MOVE,
+ _e_smart_monitor_frame_cb_mouse_move);
+
edje_object_signal_callback_del(sd->o_frame, "e,action,resize,in",
"e",
_e_smart_monitor_frame_cb_resize_in);
edje_object_signal_callback_del(sd->o_frame, "e,action,resize,out",
"e",
@@ -540,6 +553,8 @@ _e_smart_clip_set(Evas_Object *obj, Evas_Object *clip)
{
E_Smart_Data *sd;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
/* try to get the objects smart data */
if (!(sd = evas_object_smart_data_get(obj))) return;
@@ -552,6 +567,8 @@ _e_smart_clip_unset(Evas_Object *obj)
{
E_Smart_Data *sd;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
/* try to get the objects smart data */
if (!(sd = evas_object_smart_data_get(obj))) return;
@@ -605,6 +622,8 @@ _e_smart_monitor_modes_sort(const void *data1, const void
*data2)
{
const Ecore_X_Randr_Mode_Info *m1, *m2 = NULL;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
if (!(m1 = data1)) return 1;
if (!(m2 = data2)) return -1;
@@ -627,6 +646,8 @@ _e_smart_monitor_background_set(E_Smart_Data *sd, int dx,
int dy)
{
const char *bg = NULL;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
/* check for valid smart data */
if (!sd) return;
@@ -653,6 +674,8 @@ _e_smart_monitor_background_update(void *data, int type
EINA_UNUSED, void *event
E_Smart_Data *sd;
E_Event_Bg_Update *ev;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
/* try to get the smart data */
if (!(sd = data)) return ECORE_CALLBACK_PASS_ON;
@@ -679,6 +702,8 @@ _e_smart_monitor_position_set(E_Smart_Data *sd, Evas_Coord
x, Evas_Coord y)
{
char buff[1024];
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
snprintf(buff, sizeof(buff), "%d + %d", x, y);
edje_object_part_text_set(sd->o_frame, "e.text.position", buff);
}
@@ -688,6 +713,8 @@ _e_smart_monitor_resolution_set(E_Smart_Data *sd,
Evas_Coord w, Evas_Coord h)
{
char buff[1024];
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
snprintf(buff, sizeof(buff), "%d x %d", w, h);
edje_object_part_text_set(sd->o_frame, "e.text.resolution", buff);
}
@@ -698,6 +725,8 @@ _e_smart_monitor_pointer_push(Evas_Object *obj, const char
*ptr)
Evas_Object *ow;
E_Win *win;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
/* try to find the E_Win for this object */
if (!(ow = evas_object_name_find(evas_object_evas_get(obj), "E_Win")))
return;
@@ -713,6 +742,8 @@ _e_smart_monitor_pointer_pop(Evas_Object *obj, const char
*ptr)
Evas_Object *ow;
E_Win *win;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
/* try to find the E_Win for this object */
if (!(ow = evas_object_name_find(evas_object_evas_get(obj), "E_Win")))
return;
@@ -725,6 +756,8 @@ _e_smart_monitor_pointer_pop(Evas_Object *obj, const char
*ptr)
static void
_e_smart_monitor_thumb_cb_mouse_in(void *data EINA_UNUSED, Evas *evas
EINA_UNUSED, Evas_Object *obj, void *event EINA_UNUSED)
{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
/* set the mouse pointer to indicate we can be clicked */
_e_smart_monitor_pointer_push(obj, "hand");
}
@@ -732,6 +765,8 @@ _e_smart_monitor_thumb_cb_mouse_in(void *data EINA_UNUSED,
Evas *evas EINA_UNUSE
static void
_e_smart_monitor_thumb_cb_mouse_out(void *data EINA_UNUSED, Evas *evas
EINA_UNUSED, Evas_Object *obj, void *event EINA_UNUSED)
{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
/* set the mouse pointer back to default */
_e_smart_monitor_pointer_pop(obj, "hand");
}
@@ -741,6 +776,8 @@ _e_smart_monitor_thumb_cb_mouse_up(void *data EINA_UNUSED,
Evas *evas EINA_UNUSE
{
Evas_Event_Mouse_Up *ev;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
ev = event;
if (ev->button != 1) return;
@@ -753,6 +790,8 @@ _e_smart_monitor_thumb_cb_mouse_down(void *data
EINA_UNUSED, Evas *evas EINA_UNU
{
Evas_Event_Mouse_Down *ev;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
ev = event;
if (ev->button != 1) return;
@@ -761,8 +800,26 @@ _e_smart_monitor_thumb_cb_mouse_down(void *data
EINA_UNUSED, Evas *evas EINA_UNU
}
static void
+_e_smart_monitor_frame_cb_mouse_move(void *data, Evas *evas EINA_UNUSED,
Evas_Object *obj EINA_UNUSED, void *event)
+{
+ Evas_Object *mon;
+ E_Smart_Data *sd;
+
+ /* try to get the monitor object */
+ if (!(mon = data)) return;
+
+ /* try to get the monitor smart data */
+ if (!(sd = evas_object_smart_data_get(mon))) return;
+
+ /* call appropriate function based on current action */
+ if (sd->resizing) _e_smart_monitor_resize_event(sd, mon, event);
+}
+
+static void
_e_smart_monitor_frame_cb_resize_in(void *data EINA_UNUSED, Evas_Object *obj,
const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
/* set the mouse pointer to indicate we can be resized */
_e_smart_monitor_pointer_push(obj, "resize_br");
}
@@ -770,6 +827,8 @@ _e_smart_monitor_frame_cb_resize_in(void *data EINA_UNUSED,
Evas_Object *obj, co
static void
_e_smart_monitor_frame_cb_resize_out(void *data EINA_UNUSED, Evas_Object *obj,
const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
/* set the mouse pointer back to default */
_e_smart_monitor_pointer_pop(obj, "resize_br");
}
@@ -777,6 +836,8 @@ _e_smart_monitor_frame_cb_resize_out(void *data
EINA_UNUSED, Evas_Object *obj, c
static void
_e_smart_monitor_frame_cb_rotate_in(void *data EINA_UNUSED, Evas_Object *obj,
const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
/* set the mouse pointer to indicate we can be rotated */
_e_smart_monitor_pointer_push(obj, "rotate");
}
@@ -784,6 +845,8 @@ _e_smart_monitor_frame_cb_rotate_in(void *data EINA_UNUSED,
Evas_Object *obj, co
static void
_e_smart_monitor_frame_cb_rotate_out(void *data EINA_UNUSED, Evas_Object *obj,
const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
/* set the mouse pointer back to default */
_e_smart_monitor_pointer_pop(obj, "rotate");
}
@@ -791,6 +854,8 @@ _e_smart_monitor_frame_cb_rotate_out(void *data
EINA_UNUSED, Evas_Object *obj, c
static void
_e_smart_monitor_frame_cb_indicator_in(void *data EINA_UNUSED, Evas_Object
*obj, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
/* set the mouse pointer to indicate we can be toggled */
_e_smart_monitor_pointer_push(obj, "plus");
}
@@ -798,6 +863,8 @@ _e_smart_monitor_frame_cb_indicator_in(void *data
EINA_UNUSED, Evas_Object *obj,
static void
_e_smart_monitor_frame_cb_indicator_out(void *data EINA_UNUSED, Evas_Object
*obj, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
/* set the mouse pointer back to default */
_e_smart_monitor_pointer_pop(obj, "plus");
}
@@ -808,6 +875,8 @@ _e_smart_monitor_frame_cb_resize_start(void *data,
Evas_Object *obj EINA_UNUSED,
Evas_Object *mon;
E_Smart_Data *sd;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
/* try to get the monitor object */
if (!(mon = data)) return;
@@ -830,6 +899,8 @@ _e_smart_monitor_frame_cb_resize_stop(void *data,
Evas_Object *obj EINA_UNUSED,
Evas_Object *mon;
E_Smart_Data *sd;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
/* try to get the monitor object */
if (!(mon = data)) return;
@@ -839,3 +910,13 @@ _e_smart_monitor_frame_cb_resize_stop(void *data,
Evas_Object *obj EINA_UNUSED,
/* set resizing flag */
sd->resizing = EINA_FALSE;
}
+
+static void
+_e_smart_monitor_resize_event(E_Smart_Data *sd, Evas_Object *mon, void *event)
+{
+ Evas_Event_Mouse_Move *ev;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ ev = event;
+}
--
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev