ekiga r5924 - in trunk: . lib/engine/display/common lib/engine/display/skel lib/engine/display/x src/gui



Author: mschneid
Date: Sun Jan 20 09:58:10 2008
New Revision: 5924
URL: http://svn.gnome.org/viewvc/ekiga?rev=5924&view=rev

Log:
Some more cosmetics on the display-core and display-manager.
Add signal for acceleration status updates.



Modified:
   trunk/ChangeLog
   trunk/lib/engine/display/common/display-manager-common.cpp
   trunk/lib/engine/display/skel/display-core.cpp
   trunk/lib/engine/display/skel/display-core.h
   trunk/lib/engine/display/skel/display-info.h
   trunk/lib/engine/display/skel/display-manager.h
   trunk/lib/engine/display/x/display-manager-x.cpp
   trunk/src/gui/main.cpp

Modified: trunk/lib/engine/display/common/display-manager-common.cpp
==============================================================================
--- trunk/lib/engine/display/common/display-manager-common.cpp	(original)
+++ trunk/lib/engine/display/common/display-manager-common.cpp	Sun Jan 20 09:58:10 2008
@@ -182,7 +182,7 @@
 
   var_mutex.Signal();
 
-  if ((local_display_info.display == UNSET) || (local_display_info.zoom == 0) || (!local_display_info.gconfInfoSet)) {
+  if ((local_display_info.display == UNSET) || (local_display_info.zoom == 0) || (!local_display_info.config_info_set)) {
     runtime.run_in_main (display_info_update_required.make_slot ());
     PTRACE(4, "GMDisplayManager\tDisplay and zoom variable not set yet, not opening display");
      return;
@@ -205,7 +205,7 @@
 
   get_display_info(local_display_info);
 
-  if ((!local_display_info.widgetInfoSet) || (!local_display_info.gconfInfoSet) ||
+  if ((!local_display_info.widget_info_set) || (!local_display_info.config_info_set) ||
       (local_display_info.display == UNSET) || (local_display_info.zoom == 0)) {
     PTRACE(4, "GMDisplayManager\tWidget not yet realized or gconf info not yet set, not opening display");
     return false;

Modified: trunk/lib/engine/display/skel/display-core.cpp
==============================================================================
--- trunk/lib/engine/display/skel/display-core.cpp	(original)
+++ trunk/lib/engine/display/skel/display-core.cpp	Sun Jan 20 09:58:10 2008
@@ -62,6 +62,7 @@
   manager.display_mode_changed.connect (sigc::bind (sigc::mem_fun (this, &DisplayCore::on_display_mode_changed), &manager));
   manager.fullscreen_mode_changed.connect (sigc::bind (sigc::mem_fun (this, &DisplayCore::on_fullscreen_mode_changed), &manager));
   manager.display_size_changed.connect (sigc::bind (sigc::mem_fun (this, &DisplayCore::on_display_size_changed), &manager));
+  manager.hw_accel_status_changed.connect (sigc::bind (sigc::mem_fun (this, &DisplayCore::on_hw_accel_status_changed), &manager));
   manager.logo_update_required.connect (sigc::bind (sigc::mem_fun (this, &DisplayCore::on_logo_update_required), &manager));
   manager.display_info_update_required.connect (sigc::bind (sigc::mem_fun (this, &DisplayCore::on_display_info_update_required), &manager));
 }
@@ -163,6 +164,11 @@
   display_size_changed.emit (*manager, width, height);
 }
 
+void DisplayCore::on_hw_accel_status_changed (HwAccelStatus hw_accel_status, DisplayManager *manager)
+{
+  hw_accel_status_changed.emit (*manager, hw_accel_status);
+}
+
 void DisplayCore::on_logo_update_required (DisplayManager *manager)
 {
   logo_update_required.emit (*manager);

Modified: trunk/lib/engine/display/skel/display-core.h
==============================================================================
--- trunk/lib/engine/display/skel/display-core.h	(original)
+++ trunk/lib/engine/display/skel/display-core.h	Sun Jan 20 09:58:10 2008
@@ -127,9 +127,9 @@
       sigc::signal<void, DisplayManager &, DisplayMode> display_mode_changed;
       sigc::signal<void, DisplayManager &, FSToggle> fullscreen_mode_changed;
       sigc::signal<void, DisplayManager &, unsigned, unsigned> display_size_changed;
+      sigc::signal<void, DisplayManager &, HwAccelStatus> hw_accel_status_changed;
       sigc::signal<void, DisplayManager &> logo_update_required;
       sigc::signal<void, DisplayManager &> display_info_update_required;
-//      sigc::signal<void, DisplayManager &, VideoAccelStatus> update_video_accel_status; /* gm_main_window_update_video_accel_status */
 
       /*** Statistics ***/
       void get_display_stats (DisplayStats & _display_stats) {
@@ -139,6 +139,7 @@
       void on_display_mode_changed (DisplayMode display, DisplayManager *manager);
       void on_fullscreen_mode_changed (FSToggle toggle, DisplayManager *manager);
       void on_display_size_changed ( unsigned width, unsigned height, DisplayManager *manager);
+      void on_hw_accel_status_changed (HwAccelStatus hw_accel_status, DisplayManager *manager);
       void on_logo_update_required (DisplayManager *manager);
       void on_display_info_update_required (DisplayManager *manager);
 

Modified: trunk/lib/engine/display/skel/display-info.h
==============================================================================
--- trunk/lib/engine/display/skel/display-info.h	(original)
+++ trunk/lib/engine/display/skel/display-info.h	Sun Jan 20 09:58:10 2008
@@ -75,7 +75,7 @@
     REMOTE_ONLY,
     ALL,
     NO_VIDEO
-  } DisplayAccelStatus;  //FIXME
+  } HwAccelStatus;
 
 
   typedef struct {
@@ -93,7 +93,7 @@
   {
   public:
     DisplayInfo() {
-      widgetInfoSet = false;
+      widget_info_set = false;
       x = 0;
       y = 0;
   #ifdef WIN32
@@ -104,11 +104,11 @@
       xdisplay = NULL;
   #endif
   
-      gconfInfoSet = false;
-      onTop = false;
-      disableHwAccel = false;
-      allowPipSwScaling = true;
-      swScalingAlgorithm = 0;
+      config_info_set = false;
+      on_top = false;
+      disable_hw_accel = false;
+      allow_pip_sw_scaling = true;
+      sw_scaling_algorithm = 0;
   
       display = UNSET;
       zoom = 0;
@@ -116,8 +116,8 @@
     
     void operator= ( const DisplayInfo& rhs) {
   
-    if (rhs.widgetInfoSet) {
-        widgetInfoSet = rhs.widgetInfoSet;
+    if (rhs.widget_info_set) {
+        widget_info_set = rhs.widget_info_set;
         x = rhs.x;
         y = rhs.y;
   #ifdef WIN32
@@ -129,18 +129,18 @@
   #endif
       }
   
-      if (rhs.gconfInfoSet) {
-        gconfInfoSet = rhs.gconfInfoSet;
-        onTop = rhs.onTop;
-        disableHwAccel = rhs.disableHwAccel;
-        allowPipSwScaling = rhs.allowPipSwScaling;
-        swScalingAlgorithm =  rhs.swScalingAlgorithm;
+      if (rhs.config_info_set) {
+        config_info_set = rhs.config_info_set;
+        on_top = rhs.on_top;
+        disable_hw_accel = rhs.disable_hw_accel;
+        allow_pip_sw_scaling = rhs.allow_pip_sw_scaling;
+        sw_scaling_algorithm =  rhs.sw_scaling_algorithm;
       }
       if (rhs.display != UNSET) display = rhs.display;
       if (rhs.zoom != 0) zoom = rhs.zoom;
     };
   
-    bool widgetInfoSet;
+    bool widget_info_set;
     int x;
     int y;
               
@@ -152,11 +152,11 @@
     Display* xdisplay;
   #endif
   
-    bool gconfInfoSet;
-    bool onTop;
-    bool disableHwAccel;
-    bool allowPipSwScaling;
-    unsigned int swScalingAlgorithm;
+    bool config_info_set;
+    bool on_top;
+    bool disable_hw_accel;
+    bool allow_pip_sw_scaling;
+    unsigned int sw_scaling_algorithm;
   
     DisplayMode display;
     unsigned int zoom;

Modified: trunk/lib/engine/display/skel/display-manager.h
==============================================================================
--- trunk/lib/engine/display/skel/display-manager.h	(original)
+++ trunk/lib/engine/display/skel/display-manager.h	Sun Jan 20 09:58:10 2008
@@ -82,12 +82,12 @@
 
       virtual void set_display_info (const DisplayInfo &) { };
 
-      sigc::signal<void, DisplayMode> display_mode_changed;       /* gm_main_window_set_display_type */
-      sigc::signal<void, FSToggle> fullscreen_mode_changed;   /* gm_main_window_toggle_fullscreen */
-      sigc::signal<void, unsigned, unsigned> display_size_changed;        /* gm_main_window_set_resized_video_widget */
-      sigc::signal<void> logo_update_required;                    /* gm_main_window_update_logo  */
-      sigc::signal<void> display_info_update_required;            /* gm_main_window_update_zoom_display */
-//      sigc::signal<void, DisplayManager &, VideoAccelStatus> update_video_accel_status; /* gm_main_window_update_video_accel_status */
+      sigc::signal<void, DisplayMode> display_mode_changed;
+      sigc::signal<void, FSToggle> fullscreen_mode_changed;
+      sigc::signal<void, unsigned, unsigned> display_size_changed;
+      sigc::signal<void, HwAccelStatus> hw_accel_status_changed;
+      sigc::signal<void> logo_update_required;
+      sigc::signal<void> display_info_update_required;
 
   protected:  
       virtual void get_display_info (DisplayInfo &) { };

Modified: trunk/lib/engine/display/x/display-manager-x.cpp
==============================================================================
--- trunk/lib/engine/display/x/display-manager-x.cpp	(original)
+++ trunk/lib/engine/display/x/display-manager-x.cpp	Sun Jan 20 09:58:10 2008
@@ -122,7 +122,7 @@
     break;
   }
 
-  if ((!local_display_info.widgetInfoSet) || (!local_display_info.gconfInfoSet) ||
+  if ((!local_display_info.widget_info_set) || (!local_display_info.config_info_set) ||
       (local_display_info.display == UNSET) || (local_display_info.zoom == 0) || (current_frame.zoom == 0)) {
     PTRACE(4, "GMDisplayManager_X\tWidget not yet realized or gconf info not yet set, not opening display");
     return;
@@ -134,14 +134,14 @@
 
   pip_window_available = false;
 
-  DisplayAccelStatus display_accel_status = NONE;
+  HwAccelStatus hw_accel_status = NONE;
 
   switch (current_frame.display) {
 // LOCAL_VIDEO ------------------------------------------------------------------
   case LOCAL_VIDEO:
     PTRACE(4, "GMDisplayManager_X\tOpening LOCAL_VIDEO display with image of " << current_frame.local_width << "x" << current_frame.local_height);
 #ifdef HAVE_XV
-    if (!local_display_info.disableHwAccel) {
+    if (!local_display_info.disable_hw_accel) {
       lxWindow = new XVWindow ();
       if (lxWindow->Init (local_display_info.xdisplay, 
                             local_display_info.window, 
@@ -152,19 +152,19 @@
                             (int) (current_frame.local_height * current_frame.zoom / 100),
                             current_frame.local_width, 
                             current_frame.local_height)) {
-	display_accel_status = ALL;
+	hw_accel_status = ALL;
         PTRACE(4, "GMDisplayManager_X\tLOCAL_VIDEO: Successfully opened XV Window");
       }
       else {
 	delete lxWindow;
 	lxWindow = NULL;
-	display_accel_status = NONE;
+	hw_accel_status = NONE;
         PTRACE(4, "GMDisplayManager_X\tLOCAL_VIDEO: Could not open XV Window");
       }
     }
 #endif			   
-    if (display_accel_status == NONE) {
-      PTRACE(3, "GMDisplayManager_X\tFalling back to SW" << ((local_display_info.disableHwAccel) 
+    if (hw_accel_status == NONE) {
+      PTRACE(3, "GMDisplayManager_X\tFalling back to SW" << ((local_display_info.disable_hw_accel) 
                                       ? " since HW acceleration was deactivated by configuration" 
                                       : " since HW acceleration failed to initalize"));
       lxWindow = new XWindow ();
@@ -177,14 +177,14 @@
                            (int) (current_frame.local_height * current_frame.zoom / 100),
                            current_frame.local_width, 
                            current_frame.local_height)) {
-       lxWindow->SetSwScalingAlgo(local_display_info.swScalingAlgorithm);
+       lxWindow->SetSwScalingAlgo(local_display_info.sw_scaling_algorithm);
        PTRACE(4, "GMDisplayManager_X\tLOCAL_VIDEO: Successfully opened X Window");
       }
       else {
         delete lxWindow;
         lxWindow = NULL;
         video_disabled = true;
-        display_accel_status = NO_VIDEO;
+        hw_accel_status = NO_VIDEO;
         PTRACE(1, "GMDisplayManager_X\tLOCAL_VIDEO: Could not open X Window - no video");
       }
     }
@@ -202,7 +202,7 @@
   case REMOTE_VIDEO:
     PTRACE(4, "GMDisplayManager_X\tOpening REMOTE_VIDEO display with image of " << current_frame.remote_width << "x" << current_frame.remote_height);
 #ifdef HAVE_XV
-    if (!local_display_info.disableHwAccel) {
+    if (!local_display_info.disable_hw_accel) {
       rxWindow = new XVWindow ();
       if (rxWindow->Init (local_display_info.xdisplay, 
                           local_display_info.window, 
@@ -213,20 +213,20 @@
                           (int) (current_frame.remote_height * current_frame.zoom / 100),
                           current_frame.remote_width, 
                           current_frame.remote_height)) {
-       display_accel_status = ALL;
+       hw_accel_status = ALL;
        PTRACE(4, "GMDisplayManager_X\tREMOTE_VIDEO: Successfully opened XV Window");
      }
      else {
        delete rxWindow;
        rxWindow = NULL;
-       display_accel_status = NONE;
+       hw_accel_status = NONE;
        PTRACE(1, "GMDisplayManager_X\tLOCAL_VIDEO: Could not open XV Window");
 
      }
     }
 #endif			   
-    if (display_accel_status == NONE) {
-      PTRACE(3, "GMDisplayManager_X\tFalling back to SW" << ((local_display_info.disableHwAccel) 
+    if (hw_accel_status == NONE) {
+      PTRACE(3, "GMDisplayManager_X\tFalling back to SW" << ((local_display_info.disable_hw_accel) 
                                       ? " since HW acceleration was deactivated by configuration" 
                                       : " since HW acceleration failed to initalize"));
       rxWindow = new XWindow ();
@@ -239,14 +239,14 @@
                              (int) (current_frame.remote_height * current_frame.zoom / 100),
                              current_frame.remote_width, 
                              current_frame.remote_height)) {
-        rxWindow->SetSwScalingAlgo(local_display_info.swScalingAlgorithm);
+        rxWindow->SetSwScalingAlgo(local_display_info.sw_scaling_algorithm);
         PTRACE(4, "GMDisplayManager_X\tREMOTE_VIDEO: Successfully opened X Window");
       }
       else {
         delete rxWindow;
         rxWindow = NULL;
         video_disabled = true;
-        display_accel_status = NO_VIDEO;
+        hw_accel_status = NO_VIDEO;
         PTRACE(1, "GMDisplayManager_X\tREMOTE_VIDEO: Could not open X Window - no video");
       }
     }
@@ -268,7 +268,7 @@
             << current_frame.local_width << "x" << current_frame.local_height << "(local) and " 
 	    << current_frame.remote_width << "x" << current_frame.remote_height << "(remote)");
 #ifdef HAVE_XV
-    if (!local_display_info.disableHwAccel) {
+    if (!local_display_info.disable_hw_accel) {
       rxWindow = new XVWindow ();
       if (rxWindow->Init ((current_frame.display == PIP) ? local_display_info.xdisplay : rDisplay, 
                              (current_frame.display == PIP) ? local_display_info.window : DefaultRootWindow (rDisplay), 
@@ -279,20 +279,20 @@
                              (int) (current_frame.remote_height * current_frame.zoom / 100),
                              current_frame.remote_width, 
                              current_frame.remote_height)) {
-        display_accel_status = REMOTE_ONLY;
+        hw_accel_status = REMOTE_ONLY;
         PTRACE(4, "GMDisplayManager_X\tPIP: Successfully opened remote XV Window");
       }
       else 
       {
         delete rxWindow;
 	rxWindow = NULL;
-	display_accel_status = NONE;
+	hw_accel_status = NONE;
         PTRACE(1, "GMDisplayManager_X\tPIP: Could not open remote XV Window");
       }
     }
 #endif			   
-    if (display_accel_status == NONE) {
-      PTRACE(3, "GMDisplayManager_X\tFalling back to SW" << ((local_display_info.disableHwAccel) 
+    if (hw_accel_status == NONE) {
+      PTRACE(3, "GMDisplayManager_X\tFalling back to SW" << ((local_display_info.disable_hw_accel) 
                                       ? " since HW acceleration was deactivated by configuration" 
                                       : " since HW acceleration failed to initalize"));
       rxWindow = new XWindow ();
@@ -305,21 +305,21 @@
                              (int) (current_frame.remote_height * current_frame.zoom / 100),
                              current_frame.remote_width, 
                              current_frame.remote_height)) {
-        rxWindow->SetSwScalingAlgo(local_display_info.swScalingAlgorithm);
+        rxWindow->SetSwScalingAlgo(local_display_info.sw_scaling_algorithm);
         PTRACE(4, "GMDisplayManager_X\tPIP: Successfully opened remote X Window");
       }
       else {
         delete rxWindow;
         rxWindow = NULL;
         video_disabled = true;
-        display_accel_status = NO_VIDEO;
+        hw_accel_status = NO_VIDEO;
         PTRACE(1, "GMDisplayManager_X\tPIP: Could not open remote X Window - no video");
       }
     }
 
 
 #ifdef HAVE_XV
-    if (display_accel_status == REMOTE_ONLY) {
+    if (hw_accel_status == REMOTE_ONLY) {
       lxWindow = new XVWindow();
       if (lxWindow->Init (   rxWindow->GetDisplay (), 
                              rxWindow->GetWindowHandle (),
@@ -330,7 +330,7 @@
                              (int) (current_frame.remote_height * current_frame.zoom  / 100 / 3),
                              current_frame.local_width, 
                              current_frame.local_height)) {
-        display_accel_status = ALL;
+        hw_accel_status = ALL;
         pip_window_available = true;
         PTRACE(4, "GMDisplayManager_X\tPIP: Successfully opened local XV Window");
       }
@@ -342,8 +342,8 @@
       }
     }
 #endif
-    if ((display_accel_status != ALL) && (local_display_info.allowPipSwScaling)) {
-      PTRACE(3, "GMDisplayManager_X\tFalling back to SW" << ((local_display_info.disableHwAccel) 
+    if ((hw_accel_status != ALL) && (local_display_info.allow_pip_sw_scaling)) {
+      PTRACE(3, "GMDisplayManager_X\tFalling back to SW" << ((local_display_info.disable_hw_accel) 
                                       ? " since HW acceleration was deactivated by configuration" 
                                       : " since HW acceleration failed to initalize"));
       lxWindow = new XWindow ();
@@ -356,7 +356,7 @@
                              (int) (current_frame.remote_height * current_frame.zoom  / 100 / 3),
                              current_frame.local_width, 
                              current_frame.local_height)) {
-       lxWindow->SetSwScalingAlgo(local_display_info.swScalingAlgorithm);
+       lxWindow->SetSwScalingAlgo(local_display_info.sw_scaling_algorithm);
        pip_window_available = true;
        PTRACE(4, "GMDisplayManager_X\tPIP: Successfully opened local X Window");
      }
@@ -368,9 +368,9 @@
       }
     }
 
-    if ((display_accel_status != ALL) && (!local_display_info.allowPipSwScaling)) {
+    if ((hw_accel_status != ALL) && (!local_display_info.allow_pip_sw_scaling)) {
       PTRACE(3, "GMDisplayManager_X\tNot opening PIP window since HW acceleration is not available and SW fallback is disabled by configuration");
-      display_accel_status = ALL;
+      hw_accel_status = ALL;
     }
 
     if (rxWindow && lxWindow) {
@@ -401,7 +401,7 @@
     break;
   }
 
-  if (local_display_info.onTop) {
+  if (local_display_info.on_top) {
 
     if (lxWindow)
       lxWindow->ToggleOntop ();
@@ -409,16 +409,13 @@
       rxWindow->ToggleOntop ();
   }
 
-//  runtime.run_in_main (sigc::bind (update_display_accel_status.make_slot (), display_accel_status));
+  runtime.run_in_main (sigc::bind (hw_accel_status_changed.make_slot (), hw_accel_status));
 }
 
 void
 GMDisplayManager_x::close_frame_display ()
 {
-//   if (runtime) { //FIXME
-//     display_accel_status = NO_VIDEO;
-//     runtime.run_in_main (sigc::bind (update_display_accel_status.make_slot (), display_accel_status));
-//   }
+  runtime.run_in_main (sigc::bind (hw_accel_status_changed.make_slot (), NO_VIDEO));
 
   if (rxWindow) 
     rxWindow->RegisterSlave (NULL);

Modified: trunk/src/gui/main.cpp
==============================================================================
--- trunk/src/gui/main.cpp	(original)
+++ trunk/src/gui/main.cpp	Sun Jan 20 09:58:10 2008
@@ -855,6 +855,85 @@
 }
 
 
+/* 
+ * Display Engine Callbacks 
+ */
+
+void 
+on_display_mode_changed_cb (Ekiga::DisplayManager & /* manager */, DisplayMode display,  gpointer self)
+{
+  GmMainWindow *mw = gm_mw_get_mw (GTK_WIDGET (self));
+
+  gtk_radio_menu_select_with_id (mw->main_menu, "local_video", display);
+}
+
+void 
+on_fullscreen_mode_changed_cb (Ekiga::DisplayManager & /* manager */, FSToggle toggle,  gpointer self)
+{
+  gm_main_window_toggle_fullscreen (toggle, GTK_WIDGET (self));
+}
+
+void 
+on_display_size_changed_cb (Ekiga::DisplayManager & /* manager */, unsigned width, unsigned height,  gpointer self)
+{
+  GmMainWindow *mw = gm_mw_get_mw (GTK_WIDGET (self));
+
+  gtk_widget_set_size_request (mw->main_video_image, width, height);
+
+  GdkRectangle rect;
+  rect.x = mw->main_video_image->allocation.x;
+  rect.y = mw->main_video_image->allocation.y;
+  rect.width = mw->main_video_image->allocation.width;
+  rect.height = mw->main_video_image->allocation.height;
+
+  gdk_window_invalidate_rect (GDK_WINDOW (GTK_WIDGET (self)->window), &rect , TRUE);
+}
+
+void 
+on_hw_accel_status_changed_cb (Ekiga::DisplayManager & /* manager */, HwAccelStatus /* hw_accel_status */, gpointer /*self*/)
+{
+}
+
+void
+on_logo_update_required_cb (Ekiga::DisplayManager & /* manager */, gpointer self)
+{
+  gm_main_window_update_logo_have_window (GTK_WIDGET (self));
+}
+
+void 
+on_display_info_update_required_cb(Ekiga::DisplayManager & /* manager */, gpointer self)
+{
+  GmMainWindow *mw = gm_mw_get_mw (GTK_WIDGET (self));
+
+  DisplayInfo display_info;
+
+  if (( gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view") < 0) || ( gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view") > 4))
+    gm_conf_set_int (VIDEO_DISPLAY_KEY "video_view", 0);
+
+  display_info.display = (DisplayMode) gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view");
+
+  display_info.zoom = gm_conf_get_int (VIDEO_DISPLAY_KEY "zoom");
+  if ((display_info.zoom != 100) && (display_info.zoom != 50) && (display_info.zoom != 200)) {
+    display_info.zoom = 100;
+    gm_conf_set_int (VIDEO_DISPLAY_KEY "zoom", 100);
+  }
+
+  display_info.on_top = gm_conf_get_bool (VIDEO_DISPLAY_KEY "stay_on_top");
+  display_info.disable_hw_accel = gm_conf_get_bool (VIDEO_DISPLAY_KEY "disable_hw_accel");
+  display_info.allow_pip_sw_scaling = gm_conf_get_bool (VIDEO_DISPLAY_KEY "allow_pip_sw_scaling");
+  display_info.sw_scaling_algorithm = gm_conf_get_int (VIDEO_DISPLAY_KEY "sw_scaling_algorithm");
+  if (display_info.sw_scaling_algorithm > 3) {
+    display_info.sw_scaling_algorithm = 0;
+    gm_conf_set_int (VIDEO_DISPLAY_KEY "sw_scaling_algorithm", 0);
+  }
+  display_info.config_info_set = TRUE;
+
+  Ekiga::DisplayCore *display_core = dynamic_cast<Ekiga::DisplayCore *> (mw->core.get ("display-core"));
+  display_core->set_display_info(display_info);
+
+//   gm_main_window_set_resized_video_widget (176,144); //FIXME: is this necessary (call on_display_size_changed_cb)
+}
+
 
 /* Implementation */
 static void
@@ -2229,7 +2308,7 @@
     return FALSE;
   display_info.xdisplay = GDK_DISPLAY ();
 #endif
-  display_info.widgetInfoSet = TRUE;
+  display_info.widget_info_set = TRUE;
 
   Ekiga::DisplayCore *display_core = dynamic_cast<Ekiga::DisplayCore *> (mw->core.get ("display-core"));
   display_core->set_display_info(display_info);
@@ -2666,27 +2745,6 @@
   return mw->main_video_image;
 }
 
-void 
-on_display_size_changed_cb (Ekiga::DisplayManager & /* manager */, unsigned width, unsigned height,  gpointer self)  // FIXME new
-{
-  GmMainWindow *mw = gm_mw_get_mw (GTK_WIDGET (self));
-
-  gtk_widget_set_size_request (mw->main_video_image, width, height);
-
-  GdkRectangle rect;
-  rect.x = mw->main_video_image->allocation.x;
-  rect.y = mw->main_video_image->allocation.y;
-  rect.width = mw->main_video_image->allocation.width;
-  rect.height = mw->main_video_image->allocation.height;
-
-  gdk_window_invalidate_rect (GDK_WINDOW (GTK_WIDGET (self)->window), &rect , TRUE); //FIXME check
-}
-
-void
-on_logo_update_required_cb (Ekiga::DisplayManager & /* manager */, gpointer self)  //FIXME new
-{
-  gm_main_window_update_logo_have_window (GTK_WIDGET (self));
-}
 
 void 
 gm_main_window_update_logo_have_window (GtkWidget *main_window)
@@ -2715,44 +2773,6 @@
   gdk_window_invalidate_rect (GDK_WINDOW (main_window->window), &rect , TRUE);
 }
 
-void 
-on_display_info_update_required_cb(Ekiga::DisplayManager & /* manager */, gpointer self)  // FIXME new
-{
-  GmMainWindow *mw = gm_mw_get_mw (GTK_WIDGET (self));
-
-  DisplayInfo display_info;
-
-  if (( gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view") < 0) || ( gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view") > 4))
-    gm_conf_set_int (VIDEO_DISPLAY_KEY "video_view", 0);
-
-  display_info.display = (DisplayMode) gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view");
-
-  display_info.zoom = gm_conf_get_int (VIDEO_DISPLAY_KEY "zoom");
-  if ((display_info.zoom != 100) && (display_info.zoom != 50) && (display_info.zoom != 200)) {
-    display_info.zoom = 100;
-    gm_conf_set_int (VIDEO_DISPLAY_KEY "zoom", 100);
-  }
-  
-  display_info.onTop = gm_conf_get_bool (VIDEO_DISPLAY_KEY "stay_on_top");
-  display_info.disableHwAccel = gm_conf_get_bool (VIDEO_DISPLAY_KEY "disable_hw_accel");
-  display_info.allowPipSwScaling = gm_conf_get_bool (VIDEO_DISPLAY_KEY "allow_pip_sw_scaling");
-  display_info.swScalingAlgorithm = gm_conf_get_int (VIDEO_DISPLAY_KEY "sw_scaling_algorithm");
-  if (display_info.swScalingAlgorithm > 3) {
-    display_info.swScalingAlgorithm = 0;
-    gm_conf_set_int (VIDEO_DISPLAY_KEY "sw_scaling_algorithm", 0);
-  }
-  display_info.gconfInfoSet = TRUE;
-
-  Ekiga::DisplayCore *display_core = dynamic_cast<Ekiga::DisplayCore *> (mw->core.get ("display-core"));
-  display_core->set_display_info(display_info);
-
-//   gm_main_window_set_resized_video_widget (176,144); //FIXME: is this necessary (call on_display_size_changed_cb)
-}
-
-// void 
-// gm_main_window_update_video_accel_status (VideoAccelStatus status) {
-//   PTRACE(4, "MAIN: Update Accel status to " << status);
-// }
 
 void 
 gm_main_window_set_call_hold (GtkWidget *main_window,
@@ -3075,11 +3095,6 @@
   gtk_menu_section_set_sensitive (mw->main_menu, "fullscreen", FSMenu);
 }
 
-void 
-on_fullscreen_mode_changed_cb (Ekiga::DisplayManager & /* manager */, FSToggle toggle,  gpointer self)  // FIXME new
-{
-  gm_main_window_toggle_fullscreen (toggle, GTK_WIDGET (self)); // FIXME new
-}
 
 void
 gm_main_window_toggle_fullscreen (FSToggle toggle,
@@ -3316,13 +3331,6 @@
   gtk_combo_box_set_active (GTK_COMBO_BOX (mw->status_option_menu), status);
 }
 
-void 
-on_display_mode_changed_cb (Ekiga::DisplayManager & /* manager */, DisplayMode display,  gpointer self) //FIXME new
-{
-  GmMainWindow *mw = gm_mw_get_mw (GTK_WIDGET (self));
-
-  gtk_radio_menu_select_with_id (mw->main_menu, "local_video", display);
-}
 
 void 
 gm_main_window_set_call_info (GtkWidget *main_window,
@@ -3754,6 +3762,9 @@
   conn = display_core->display_info_update_required.connect (sigc::bind (sigc::ptr_fun (on_display_info_update_required_cb), (gpointer) window));
   mw->connections.push_back (conn);
 
+  conn = display_core->logo_update_required.connect (sigc::bind (sigc::ptr_fun (on_logo_update_required_cb), (gpointer) window));
+  mw->connections.push_back (conn);
+
   conn = display_core->display_size_changed.connect (sigc::bind (sigc::ptr_fun (on_display_size_changed_cb), (gpointer) window));
   mw->connections.push_back (conn);
 
@@ -3763,6 +3774,9 @@
   conn = display_core->fullscreen_mode_changed.connect (sigc::bind (sigc::ptr_fun (on_fullscreen_mode_changed_cb), (gpointer) window));
   mw->connections.push_back (conn);
 
+  conn = display_core->hw_accel_status_changed.connect (sigc::bind (sigc::ptr_fun (on_hw_accel_status_changed_cb), (gpointer) window));
+  mw->connections.push_back (conn);
+
   /* New Call Engine signals */
   Ekiga::CallCore *call_core = dynamic_cast<Ekiga::CallCore *> (mw->core.get ("call-core"));
 



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