[empathy: 7/18] Move empathy_call_window_get_preview_position around



commit 2848d12da55d0c4c9016d8f355ed9d1343e0f2e7
Author: Emilio Pozuelo Monfort <emilio pozuelo collabora co uk>
Date:   Wed Aug 10 10:13:13 2011 +0100

    Move empathy_call_window_get_preview_position around
    
    https://bugzilla.gnome.org/show_bug.cgi?id=656268

 src/empathy-call-window.c |   84 ++++++++++++++++++++++----------------------
 1 files changed, 42 insertions(+), 42 deletions(-)
---
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 5cffde9..ecdd22a 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,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]