[ekiga] videooutput: new parameter size_changed() signal



commit 8153187bd7b581e725a43b71224b97f20a2cb7eb
Author: VÃctor Manuel JÃquez Leal <vjaquez igalia com>
Date:   Thu Sep 6 18:25:42 2012 -0500

    videooutput: new parameter size_changed() signal
    
    This patch is traversal to all the videooutput subsystem.
    
    It adds a new parameter to the size_changed() signal. This new parameter
    indicates the video output mode of the current frame that changed its size.
    
    With this new parameter the UI can know which window resize in case the
    output is other window.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=687775

 .../dx-videooutput/videooutput-manager-dx.cpp      |   31 +++++++++++++++----
 .../dx-videooutput/videooutput-manager-dx.h        |    3 +-
 .../x-videooutput/videooutput-manager-x.cpp        |   31 +++++++++++++++----
 .../x-videooutput/videooutput-manager-x.h          |    3 +-
 lib/engine/gui/gtk-frontend/call-window.cpp        |    4 ++-
 lib/engine/videooutput/videooutput-core.cpp        |    9 ++++--
 lib/engine/videooutput/videooutput-core.h          |    7 +++-
 lib/engine/videooutput/videooutput-manager.h       |    3 +-
 8 files changed, 68 insertions(+), 23 deletions(-)
---
diff --git a/lib/engine/components/dx-videooutput/videooutput-manager-dx.cpp b/lib/engine/components/dx-videooutput/videooutput-manager-dx.cpp
index 89399d9..c61e8f2 100644
--- a/lib/engine/components/dx-videooutput/videooutput-manager-dx.cpp
+++ b/lib/engine/components/dx-videooutput/videooutput-manager-dx.cpp
@@ -78,20 +78,36 @@ GMVideoOutputManager_dx::setup_frame_display ()
 
   switch (current_frame.mode) {
   case Ekiga::VO_MODE_LOCAL:
-    Ekiga::Runtime::run_in_main (boost::bind (&GMVideoOutputManager_dx::size_changed_in_main, this, (unsigned) (current_frame.local_width * current_frame.zoom / 100), (unsigned) (current_frame.local_height * current_frame.zoom / 100)));
+    Ekiga::Runtime::run_in_main
+      (boost::bind (&GMVideoOutputManager_dx::size_changed_in_main, this,
+                    (unsigned) (current_frame.local_width * current_frame.zoom / 100),
+                    (unsigned) (current_frame.local_height * current_frame.zoom / 100),
+                    current_frame.mode));
     break;
   case Ekiga::VO_MODE_REMOTE:
   case Ekiga::VO_MODE_PIP:
-    Ekiga::Runtime::run_in_main (boost::bind (&GMVideoOutputManager_dx::size_changed_in_main, this, (unsigned) (current_frame.remote_width * current_frame.zoom / 100), (unsigned) (current_frame.remote_height * current_frame.zoom / 100)));
+    Ekiga::Runtime::run_in_main
+      (boost::bind (&GMVideoOutputManager_dx::size_changed_in_main, this,
+                    (unsigned) (current_frame.remote_width * current_frame.zoom / 100),
+                    (unsigned) (current_frame.remote_height * current_frame.zoom / 100),
+                    current_frame.mode));
     break;
   case Ekiga::VO_MODE_FULLSCREEN:
-    Ekiga::Runtime::run_in_main (boost::bind (&GMVideoOutputManager_dx::size_changed_in_main, this, 176, 144));
+    Ekiga::Runtime::run_in_main
+      (boost::bind (&GMVideoOutputManager_dx::size_changed_in_main, this,
+                    176, 144, current_frame.mode));
     break;
   case Ekiga::VO_MODE_PIP_WINDOW:
-    Ekiga::Runtime::run_in_main (boost::bind (&GMVideoOutputManager_dx::size_changed_in_main, this, 176, 144));
+    Ekiga::Runtime::run_in_main
+      (boost::bind (&GMVideoOutputManager_dx::size_changed_in_main, this,
+                    176, 144, current_frame.mode));
     break;
   case Ekiga::VO_MODE_REMOTE_EXT:
-    Ekiga::Runtime::run_in_main (boost::bind (&GMVideoOutputManager_dx::size_changed_in_main, this, (unsigned) (current_frame.ext_width * current_frame.zoom / 100), (unsigned) (current_frame.ext_height * current_frame.zoom / 100)));
+    Ekiga::Runtime::run_in_main
+      (boost::bind (&GMVideoOutputManager_dx::size_changed_in_main, this,
+                    (unsigned) (current_frame.ext_width * current_frame.zoom / 100),
+                    (unsigned) (current_frame.ext_height * current_frame.zoom / 100),
+                    current_frame.mode));
     break;
   case Ekiga::VO_MODE_UNSET:
   default:
@@ -289,9 +305,10 @@ GMVideoOutputManager_dx::sync (UpdateRequired sync_required)
 
 void
 GMVideoOutputManager_dx::size_changed_in_main (unsigned width,
-		      unsigned height)
+					       unsigned height,
+					       Ekiga::VideoOutputMode mode)
 {
-  size_changed (width, height);
+  size_changed (width, height, mode);
 }
 
 void
diff --git a/lib/engine/components/dx-videooutput/videooutput-manager-dx.h b/lib/engine/components/dx-videooutput/videooutput-manager-dx.h
index d7e2e9c..0c6778d 100644
--- a/lib/engine/components/dx-videooutput/videooutput-manager-dx.h
+++ b/lib/engine/components/dx-videooutput/videooutput-manager-dx.h
@@ -83,7 +83,8 @@
   private:
 
   void size_changed_in_main (unsigned width,
-			     unsigned height);
+			     unsigned height,
+			     Ekiga::VideoOutputMode mode);
 
   void device_opened_in_main (Ekiga::VideoOutputAccel accel,
 			      Ekiga::VideoOutputMode mode,
diff --git a/lib/engine/components/x-videooutput/videooutput-manager-x.cpp b/lib/engine/components/x-videooutput/videooutput-manager-x.cpp
index 92ddd97..13d61b4 100644
--- a/lib/engine/components/x-videooutput/videooutput-manager-x.cpp
+++ b/lib/engine/components/x-videooutput/videooutput-manager-x.cpp
@@ -209,20 +209,36 @@ GMVideoOutputManager_x::setup_frame_display ()
 
   switch (current_frame.mode) {
   case Ekiga::VO_MODE_LOCAL:
-    Ekiga::Runtime::run_in_main (boost::bind (&GMVideoOutputManager_x::size_changed_in_main, this, (unsigned) (current_frame.local_width * current_frame.zoom / 100), (unsigned) (current_frame.local_height * current_frame.zoom / 100)));
+    Ekiga::Runtime::run_in_main
+      (boost::bind (&GMVideoOutputManager_x::size_changed_in_main, this,
+                    (unsigned) (current_frame.local_width * current_frame.zoom / 100),
+                    (unsigned) (current_frame.local_height * current_frame.zoom / 100),
+                    current_frame.mode));
     break;
   case Ekiga::VO_MODE_REMOTE:
   case Ekiga::VO_MODE_PIP:
-    Ekiga::Runtime::run_in_main (boost::bind (&GMVideoOutputManager_x::size_changed_in_main, this, (unsigned) (current_frame.remote_width * current_frame.zoom / 100), (unsigned) (current_frame.remote_height * current_frame.zoom / 100)));
+    Ekiga::Runtime::run_in_main
+      (boost::bind (&GMVideoOutputManager_x::size_changed_in_main, this,
+                    (unsigned) (current_frame.remote_width * current_frame.zoom / 100),
+                    (unsigned) (current_frame.remote_height * current_frame.zoom / 100),
+                    current_frame.mode));
     break;
   case Ekiga::VO_MODE_FULLSCREEN:
-    Ekiga::Runtime::run_in_main (boost::bind (&GMVideoOutputManager_x::size_changed_in_main, this, 176, 144));
+    Ekiga::Runtime::run_in_main
+      (boost::bind (&GMVideoOutputManager_x::size_changed_in_main, this,
+                    176, 144, current_frame.mode));
     break;
   case Ekiga::VO_MODE_PIP_WINDOW:
-    Ekiga::Runtime::run_in_main (boost::bind (&GMVideoOutputManager_x::size_changed_in_main, this, 176, 144));
+    Ekiga::Runtime::run_in_main
+      (boost::bind (&GMVideoOutputManager_x::size_changed_in_main, this,
+                    176, 144, current_frame.mode));
     break;
   case Ekiga::VO_MODE_REMOTE_EXT:
-    Ekiga::Runtime::run_in_main (boost::bind (&GMVideoOutputManager_x::size_changed_in_main, this, (unsigned) (current_frame.ext_width * current_frame.zoom / 100), (unsigned) (current_frame.ext_height * current_frame.zoom / 100)));
+    Ekiga::Runtime::run_in_main
+      (boost::bind (&GMVideoOutputManager_x::size_changed_in_main, this,
+                    (unsigned) (current_frame.ext_width * current_frame.zoom / 100),
+                    (unsigned) (current_frame.ext_height * current_frame.zoom / 100),
+                    current_frame.mode));
     break;
   case Ekiga::VO_MODE_UNSET:
   default:
@@ -535,9 +551,10 @@ GMVideoOutputManager_x::sync (UpdateRequired sync_required)
 
 void
 GMVideoOutputManager_x::size_changed_in_main (unsigned width,
-					      unsigned height)
+					      unsigned height,
+					      Ekiga::VideoOutputMode mode)
 {
-  size_changed (width, height);
+  size_changed (width, height, mode);
 }
 
 void
diff --git a/lib/engine/components/x-videooutput/videooutput-manager-x.h b/lib/engine/components/x-videooutput/videooutput-manager-x.h
index a5f20a7..1ee956c 100644
--- a/lib/engine/components/x-videooutput/videooutput-manager-x.h
+++ b/lib/engine/components/x-videooutput/videooutput-manager-x.h
@@ -95,7 +95,8 @@ protected:
 private:
 
   void size_changed_in_main (unsigned width,
-			     unsigned height);
+			     unsigned height,
+			     Ekiga::VideoOutputMode mode);
 
   void device_opened_in_main (Ekiga::VideoOutputAccel accel,
 			      Ekiga::VideoOutputMode mode,
diff --git a/lib/engine/gui/gtk-frontend/call-window.cpp b/lib/engine/gui/gtk-frontend/call-window.cpp
index ae23e85..c906819 100644
--- a/lib/engine/gui/gtk-frontend/call-window.cpp
+++ b/lib/engine/gui/gtk-frontend/call-window.cpp
@@ -279,6 +279,7 @@ static void ekiga_call_window_set_video_size (EkigaCallWindow *cw,
 static void on_size_changed_cb (Ekiga::VideoOutputManager & /* manager */,
                                 unsigned width,
                                 unsigned height,
+                                G_GNUC_UNUSED Ekiga::VideoOutputMode mode,
                                 gpointer self);
 
 static void on_videoinput_device_opened_cb (Ekiga::VideoInputManager & /* manager */,
@@ -850,6 +851,7 @@ static void
 on_size_changed_cb (Ekiga::VideoOutputManager & /* manager */,
                     unsigned width,
                     unsigned height,
+                    G_GNUC_UNUSED Ekiga::VideoOutputMode mode,
                     gpointer self)
 {
   EkigaCallWindow *cw = EKIGA_CALL_WINDOW (self);
@@ -2218,7 +2220,7 @@ ekiga_call_window_connect_engine_signals (EkigaCallWindow *cw)
   conn = videooutput_core->device_error.connect (boost::bind (&on_videooutput_device_error_cb, _1, _2, (gpointer) cw));
   cw->priv->connections.push_back (conn);
 
-  conn = videooutput_core->size_changed.connect (boost::bind (&on_size_changed_cb, _1, _2, _3, (gpointer) cw));
+  conn = videooutput_core->size_changed.connect (boost::bind (&on_size_changed_cb, _1, _2, _3, _4, (gpointer) cw));
   cw->priv->connections.push_back (conn);
 
   conn = videooutput_core->fullscreen_mode_changed.connect (boost::bind (&on_fullscreen_mode_changed_cb, _1, _2, (gpointer) cw));
diff --git a/lib/engine/videooutput/videooutput-core.cpp b/lib/engine/videooutput/videooutput-core.cpp
index 497c136..2fb2faf 100644
--- a/lib/engine/videooutput/videooutput-core.cpp
+++ b/lib/engine/videooutput/videooutput-core.cpp
@@ -91,7 +91,7 @@ void VideoOutputCore::add_manager (VideoOutputManager &manager)
   manager.device_closed.connect (boost::bind (&VideoOutputCore::on_device_closed, this, &manager));
   manager.device_error.connect (boost::bind (&VideoOutputCore::on_device_error, this, _1, &manager));
   manager.fullscreen_mode_changed.connect (boost::bind (&VideoOutputCore::on_fullscreen_mode_changed, this, _1, &manager));
-  manager.size_changed.connect (boost::bind (&VideoOutputCore::on_size_changed, this, _1, _2, &manager));
+  manager.size_changed.connect (boost::bind (&VideoOutputCore::on_size_changed, this, _1, _2, _3, &manager));
 }
 
 
@@ -227,8 +227,11 @@ void VideoOutputCore::on_fullscreen_mode_changed ( VideoOutputFSToggle toggle, V
   fullscreen_mode_changed (*manager, toggle);
 }
 
-void VideoOutputCore::on_size_changed ( unsigned width, unsigned height, VideoOutputManager *manager)
+void VideoOutputCore::on_size_changed (unsigned width,
+                                       unsigned height,
+                                       VideoOutputMode mode,
+                                       VideoOutputManager *manager)
 {
-  size_changed (*manager, width, height);
+  size_changed (*manager, width, height, mode);
 }
 
diff --git a/lib/engine/videooutput/videooutput-core.h b/lib/engine/videooutput/videooutput-core.h
index b8968da..231d46e 100644
--- a/lib/engine/videooutput/videooutput-core.h
+++ b/lib/engine/videooutput/videooutput-core.h
@@ -169,7 +169,7 @@ namespace Ekiga
       boost::signal1<void, VideoOutputManager &> device_closed;
       boost::signal2<void, VideoOutputManager &, VideoOutputErrorCodes> device_error;
       boost::signal2<void, VideoOutputManager &, VideoOutputFSToggle> fullscreen_mode_changed;
-      boost::signal3<void, VideoOutputManager &, unsigned, unsigned> size_changed;
+      boost::signal4<void, VideoOutputManager &, unsigned, unsigned, VideoOutputMode> size_changed;
 
 
   private:
@@ -181,7 +181,10 @@ namespace Ekiga
                              VideoOutputManager *manager);
       void on_device_closed (VideoOutputManager *manager);
       void on_device_error (VideoOutputErrorCodes error_code, VideoOutputManager *manager);
-      void on_size_changed ( unsigned width, unsigned height, VideoOutputManager *manager);
+      void on_size_changed (unsigned width,
+                            unsigned height,
+                            VideoOutputMode mode,
+                            VideoOutputManager *manager);
       void on_fullscreen_mode_changed (VideoOutputFSToggle toggle, VideoOutputManager *manager);
 
       std::set<VideoOutputManager *> managers;
diff --git a/lib/engine/videooutput/videooutput-manager.h b/lib/engine/videooutput/videooutput-manager.h
index c9e22b5..cf94510 100644
--- a/lib/engine/videooutput/videooutput-manager.h
+++ b/lib/engine/videooutput/videooutput-manager.h
@@ -134,8 +134,9 @@ namespace Ekiga
        * or when it is being zoomed in or out.
        * @param width the new width of the widget.
        * @param height the new height of the widget.
+       * @param mode the current frame mode.
        */
-      boost::signal2<void, unsigned, unsigned> size_changed;
+      boost::signal3<void, unsigned, unsigned, VideoOutputMode> size_changed;
 
   protected:  
       virtual void get_display_info (DisplayInfo &) { };



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