aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/elementary/src/lib/elm_win.c
diff options
context:
space:
mode:
authorChristopher Michael <cpmichael1@comcast.net>2012-01-03 20:41:49 +0000
committerChristopher Michael <cpmichael1@comcast.net>2012-01-03 20:41:49 +0000
commit26127e35b996837aa88443e75c3db8825c98c40f (patch)
treee5a13929c329931e2eaee4deaf2420366cc19696 /legacy/elementary/src/lib/elm_win.c
parentadd elm_hover_dismiss() (diff)
downloadefl-26127e35b996837aa88443e75c3db8825c98c40f.tar.gz
Elm (wayland): Add ability to actually move windows around in wayland.
Remove __UNUSED__ on a variable that is actually used (in callback_show). SVN revision: 66809
Diffstat (limited to 'legacy/elementary/src/lib/elm_win.c')
-rw-r--r--legacy/elementary/src/lib/elm_win.c66
1 files changed, 64 insertions, 2 deletions
diff --git a/legacy/elementary/src/lib/elm_win.c b/legacy/elementary/src/lib/elm_win.c
index 354c7b6735..09f4af99d2 100644
--- a/legacy/elementary/src/lib/elm_win.c
+++ b/legacy/elementary/src/lib/elm_win.c
@@ -26,6 +26,7 @@ struct _Elm_Win
} shot;
Eina_Bool autodel : 1;
Eina_Bool constrain : 1;
+ Eina_Bool moving : 1;
int *autodel_clear, rot;
int show_count;
struct {
@@ -75,6 +76,10 @@ static void _elm_win_focus_highlight_reconfigure_job_stop(Elm_Win *win);
static void _elm_win_focus_highlight_anim_end(void *data, Evas_Object *obj, const char *emission, const char *source);
static void _elm_win_focus_highlight_reconfigure(Elm_Win *win);
+static void _elm_win_frame_callback_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info);
+static void _elm_win_frame_callback_mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info);
+static void _elm_win_frame_callback_mouse_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info);
+
static const char SIG_DELETE_REQUEST[] = "delete,request";
static const char SIG_FOCUS_OUT[] = "focus,out";
static const char SIG_FOCUS_IN[] = "focus,in";
@@ -445,7 +450,7 @@ _deferred_ecore_evas_free(void *data)
}
static void
-_elm_win_obj_callback_show(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+_elm_win_obj_callback_show(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
Elm_Win *win = data;
@@ -1296,6 +1301,51 @@ the_end:
win->focus_highlight.prev = win->focus_highlight.cur;
}
+static void
+_elm_win_frame_callback_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
+{
+ Elm_Win *win;
+ Evas_Event_Mouse_Down *ev;
+
+ if (!(win = data)) return;
+ ev = event_info;
+ if (ev->button == 1)
+ {
+ win->moving = EINA_TRUE;
+ /* FIXME: Change Mouse Pointer */
+ }
+}
+
+static void
+_elm_win_frame_callback_mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
+{
+ Elm_Win *win;
+ Evas_Event_Mouse_Move *ev;
+
+ if (!(win = data)) return;
+ ev = event_info;
+ if (win->moving)
+ {
+ /* NB: 0, 0 are bogus values and not used */
+ ecore_evas_move(win->ee, 0, 0);
+ }
+}
+
+static void
+_elm_win_frame_callback_mouse_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
+{
+ Elm_Win *win;
+ Evas_Event_Mouse_Up *ev;
+
+ if (!(win = data)) return;
+ ev = event_info;
+ if (ev->button == 1)
+ {
+ win->moving = EINA_FALSE;
+ /* FIXME: Change Mouse Pointer */
+ }
+}
+
#ifdef ELM_DEBUG
static void
_debug_key_down(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info)
@@ -1305,7 +1355,6 @@ _debug_key_down(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, voi
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
return;
-
if ((strcmp(ev->keyname, "F12")) ||
(!evas_key_modifier_is_set(ev->modifiers, "Control")))
return;
@@ -1555,6 +1604,19 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
evas_object_is_frame_object_set(win->frame_obj, EINA_TRUE);
evas_object_move(win->frame_obj, 0, 0);
evas_object_resize(win->frame_obj, 1, 1);
+
+ evas_object_event_callback_add(win->frame_obj,
+ EVAS_CALLBACK_MOUSE_DOWN,
+ _elm_win_frame_callback_mouse_down,
+ win);
+ evas_object_event_callback_add(win->frame_obj,
+ EVAS_CALLBACK_MOUSE_MOVE,
+ _elm_win_frame_callback_mouse_move,
+ win);
+ evas_object_event_callback_add(win->frame_obj,
+ EVAS_CALLBACK_MOUSE_UP,
+ _elm_win_frame_callback_mouse_up,
+ win);
}
else if (!strncmp(_elm_config->engine, "shot:", 5))
{