aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-call-window.c
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-08-10 17:13:13 +0800
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-08-15 19:14:54 +0800
commit2848d12da55d0c4c9016d8f355ed9d1343e0f2e7 (patch)
tree081a4a1447efc913897e9dd9e74dc74c76dff80e /src/empathy-call-window.c
parent47f4a650200c9692f4b5e480b60f28ab309aecb4 (diff)
downloadgsoc2013-empathy-2848d12da55d0c4c9016d8f355ed9d1343e0f2e7.tar
gsoc2013-empathy-2848d12da55d0c4c9016d8f355ed9d1343e0f2e7.tar.gz
gsoc2013-empathy-2848d12da55d0c4c9016d8f355ed9d1343e0f2e7.tar.bz2
gsoc2013-empathy-2848d12da55d0c4c9016d8f355ed9d1343e0f2e7.tar.lz
gsoc2013-empathy-2848d12da55d0c4c9016d8f355ed9d1343e0f2e7.tar.xz
gsoc2013-empathy-2848d12da55d0c4c9016d8f355ed9d1343e0f2e7.tar.zst
gsoc2013-empathy-2848d12da55d0c4c9016d8f355ed9d1343e0f2e7.zip
Move empathy_call_window_get_preview_position around
https://bugzilla.gnome.org/show_bug.cgi?id=656268
Diffstat (limited to 'src/empathy-call-window.c')
-rw-r--r--src/empathy-call-window.c84
1 files changed, 42 insertions, 42 deletions
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 5cffde99d..ecdd22ad9 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -604,6 +604,48 @@ empathy_call_window_show_preview_rectangles (EmpathyCallWindow *self,
g_object_set (self->priv->preview_rectangle4, "visible", show, NULL);
}
+static PreviewPosition
+empathy_call_window_get_preview_position (EmpathyCallWindow *self,
+ gfloat event_x,
+ gfloat event_y)
+{
+ ClutterGeometry box;
+ PreviewPosition pos = PREVIEW_POS_NONE;
+
+ clutter_actor_get_geometry (self->priv->video_box, &box);
+
+ if (0 + SELF_VIDEO_MARGIN <= event_x &&
+ event_x <= (0 + SELF_VIDEO_MARGIN + (gint) SELF_VIDEO_SECTION_WIDTH) &&
+ 0 + SELF_VIDEO_MARGIN <= event_y &&
+ event_y <= (0 + SELF_VIDEO_MARGIN + (gint) SELF_VIDEO_SECTION_HEIGTH))
+ {
+ pos = PREVIEW_POS_TOP_LEFT;
+ }
+ else if (box.width - SELF_VIDEO_MARGIN >= event_x &&
+ event_x >= (box.width - SELF_VIDEO_MARGIN - (gint) SELF_VIDEO_SECTION_WIDTH) &&
+ 0 + SELF_VIDEO_MARGIN <= event_y &&
+ event_y <= (0 + SELF_VIDEO_MARGIN + (gint) SELF_VIDEO_SECTION_HEIGTH))
+ {
+ pos = PREVIEW_POS_TOP_RIGHT;
+ }
+ else if (0 + SELF_VIDEO_MARGIN <= event_x &&
+ event_x <= (0 + SELF_VIDEO_MARGIN + (gint) SELF_VIDEO_SECTION_WIDTH) &&
+ box.height - SELF_VIDEO_MARGIN >= event_y &&
+ event_y >= (box.height - SELF_VIDEO_MARGIN - (gint) SELF_VIDEO_SECTION_HEIGTH))
+ {
+ pos = PREVIEW_POS_BOTTOM_LEFT;
+ }
+ else if (box.width - SELF_VIDEO_MARGIN >= event_x &&
+ event_x >= (box.width - SELF_VIDEO_MARGIN - (gint) SELF_VIDEO_SECTION_WIDTH) &&
+ box.height - SELF_VIDEO_MARGIN >= event_y &&
+ event_y >= (box.height - SELF_VIDEO_MARGIN - (gint) SELF_VIDEO_SECTION_HEIGTH))
+ {
+ pos = PREVIEW_POS_BOTTOM_RIGHT;
+ }
+
+ return pos;
+}
+
static void
empathy_call_window_move_video_preview (EmpathyCallWindow *self,
PreviewPosition pos)
@@ -715,48 +757,6 @@ empathy_call_window_preview_on_drag_begin_cb (ClutterDragAction *action,
self->priv->event_y = event_y;
}
-static PreviewPosition
-empathy_call_window_get_preview_position (EmpathyCallWindow *self,
- gfloat event_x,
- gfloat event_y)
-{
- ClutterGeometry box;
- PreviewPosition pos = PREVIEW_POS_NONE;
-
- clutter_actor_get_geometry (self->priv->video_box, &box);
-
- if (0 + SELF_VIDEO_MARGIN <= event_x &&
- event_x <= (0 + SELF_VIDEO_MARGIN + (gint) SELF_VIDEO_SECTION_WIDTH) &&
- 0 + SELF_VIDEO_MARGIN <= event_y &&
- event_y <= (0 + SELF_VIDEO_MARGIN + (gint) SELF_VIDEO_SECTION_HEIGTH))
- {
- pos = PREVIEW_POS_TOP_LEFT;
- }
- else if (box.width - SELF_VIDEO_MARGIN >= event_x &&
- event_x >= (box.width - SELF_VIDEO_MARGIN - (gint) SELF_VIDEO_SECTION_WIDTH) &&
- 0 + SELF_VIDEO_MARGIN <= event_y &&
- event_y <= (0 + SELF_VIDEO_MARGIN + (gint) SELF_VIDEO_SECTION_HEIGTH))
- {
- pos = PREVIEW_POS_TOP_RIGHT;
- }
- else if (0 + SELF_VIDEO_MARGIN <= event_x &&
- event_x <= (0 + SELF_VIDEO_MARGIN + (gint) SELF_VIDEO_SECTION_WIDTH) &&
- box.height - SELF_VIDEO_MARGIN >= event_y &&
- event_y >= (box.height - SELF_VIDEO_MARGIN - (gint) SELF_VIDEO_SECTION_HEIGTH))
- {
- pos = PREVIEW_POS_BOTTOM_LEFT;
- }
- else if (box.width - SELF_VIDEO_MARGIN >= event_x &&
- event_x >= (box.width - SELF_VIDEO_MARGIN - (gint) SELF_VIDEO_SECTION_WIDTH) &&
- box.height - SELF_VIDEO_MARGIN >= event_y &&
- event_y >= (box.height - SELF_VIDEO_MARGIN - (gint) SELF_VIDEO_SECTION_HEIGTH))
- {
- pos = PREVIEW_POS_BOTTOM_RIGHT;
- }
-
- return pos;
-}
-
static void
empathy_call_window_preview_on_drag_end_cb (ClutterDragAction *action,
ClutterActor *actor,