[ekiga/ds-gtk3] Started porting to GTK3 and recent OPAL.



commit 34b74adb08487284017431131c3267aa1ccfd37f
Author: Damien Sandras <dsandras beip be>
Date:   Sun May 15 15:01:10 2011 +0200

    Started porting to GTK3 and recent OPAL.
    
    - Several code simplifications: Ekiga must be simple and work in all cases
    - Various GTK3 changes
    
    It does not compile yet.

 configure.ac                                       |    2 +-
 lib/Makefile.am                                    |    2 -
 .../null-audioinput/audioinput-manager-null.cpp    |    2 +-
 lib/engine/components/opal/opal-account.cpp        |    5 +-
 lib/engine/components/opal/opal-call-manager.cpp   |   11 +-
 lib/engine/components/opal/opal-call.cpp           |   91 +---
 lib/engine/components/opal/opal-call.h             |    2 -
 lib/engine/gui/gtk-core/form-dialog-gtk.cpp        |    2 +-
 lib/engine/gui/gtk-frontend/book-view-gtk.cpp      |   11 +-
 lib/engine/gui/gtk-frontend/chat-area.cpp          |    3 +-
 lib/engine/gui/gtk-frontend/chat-window.cpp        |    2 +-
 lib/engine/gui/gtk-frontend/roster-view-gtk.cpp    |    2 +-
 lib/gui/dialpad.c                                  |   24 +-
 lib/gui/gm-cell-renderer-bitext.c                  |   32 +-
 lib/gui/gm-smiley-chooser-button.c                 |    2 +-
 lib/gui/gmcellrendererexpander.c                   |  101 ++--
 lib/gui/gmlevelmeter.c                             |  649 --------------------
 lib/gui/gmlevelmeter.h                             |  121 ----
 lib/gui/gmmenuaddon.c                              |   16 +-
 lib/gui/gmpreferences.c                            |   20 +-
 lib/gui/gmwindow.c                                 |    6 +-
 src/gui/accounts.cpp                               |    6 +-
 src/gui/assistant.cpp                              |    2 +-
 src/gui/main_window.cpp                            |   40 --
 24 files changed, 112 insertions(+), 1042 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 1a5eacd..a726bd9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -147,7 +147,7 @@ IT_PROG_INTLTOOL([0.35.0])
 dnl ###############################
 dnl   Mandatory GTK+ support
 dnl ###############################
-PKG_CHECK_MODULES([GTK], [gtk+-2.0 >= 2.20.0])
+PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= 3.0.0])
 PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.24.0 gmodule-2.0 gobject-2.0 gthread-2.0])
 AC_ARG_ENABLE([gtk-debug],
               [AS_HELP_STRING([--enable-gtk-debug],[enable GTK+ debug flags (default is disabled)])],
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 7f3e00a..0876325 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -164,8 +164,6 @@ libekiga_la_SOURCES += \
 	$(top_srcdir)/lib/gui/gmdialog.h \
 	$(top_srcdir)/lib/gui/gmentrydialog.c \
 	$(top_srcdir)/lib/gui/gmentrydialog.h \
-	$(top_srcdir)/lib/gui/gmlevelmeter.c \
-	$(top_srcdir)/lib/gui/gmlevelmeter.h \
 	$(top_srcdir)/lib/gui/gmmenuaddon.c \
 	$(top_srcdir)/lib/gui/gmmenuaddon.h \
 	$(top_srcdir)/lib/gui/gmpreferences.c \
diff --git a/lib/engine/components/null-audioinput/audioinput-manager-null.cpp b/lib/engine/components/null-audioinput/audioinput-manager-null.cpp
index 4ef2662..2fd99bd 100644
--- a/lib/engine/components/null-audioinput/audioinput-manager-null.cpp
+++ b/lib/engine/components/null-audioinput/audioinput-manager-null.cpp
@@ -49,7 +49,7 @@ GMAudioInputManager_null::~GMAudioInputManager_null ()
 {
 }
 
-void GMAudioInputManager_null::get_devices(std::vector <Ekiga::AudioInputDevice> & devices)
+void GMAudioInputManager_null::get_devices(std::vector <Ekiga::AudioInputDevice> & /*devices*/)
 {
 #if DEBUG
   Ekiga::AudioInputDevice device;
diff --git a/lib/engine/components/opal/opal-account.cpp b/lib/engine/components/opal/opal-account.cpp
index b3214c7..1f4a2c3 100644
--- a/lib/engine/components/opal/opal-account.cpp
+++ b/lib/engine/components/opal/opal-account.cpp
@@ -629,9 +629,8 @@ Opal::Account::setup_presentity ()
   if (presentity) {
 
     presentity->SetPresenceChangeNotifier (PCREATE_PresenceChangeNotifier (OnPresenceChange));
-    presentity->GetAttributes().Set(SIP_Presentity::AuthNameKey, username);
-    presentity->GetAttributes().Set(SIP_Presentity::AuthPasswordKey, password);
-    presentity->GetAttributes().Set(SIP_Presentity::SubProtocolKey, "Agent");
+    presentity->GetAttributes().Set(OpalPresentity::AuthNameKey, username);
+    presentity->GetAttributes().Set(OpalPresentity::AuthPasswordKey, password);
   }
 }
 
diff --git a/lib/engine/components/opal/opal-call-manager.cpp b/lib/engine/components/opal/opal-call-manager.cpp
index 762fd6c..a5afd70 100644
--- a/lib/engine/components/opal/opal-call-manager.cpp
+++ b/lib/engine/components/opal/opal-call-manager.cpp
@@ -237,15 +237,8 @@ void CallManager::set_maximum_jitter (unsigned max_val)
       if (connection) {
 
         OpalMediaStreamPtr stream = connection->GetMediaStream (OpalMediaType::Audio (), false);
-        if (stream != NULL) {
-
-          RTP_Session *session = connection->GetSession (stream->GetSessionID ());
-          if (session != NULL) {
-
-            unsigned units = session->GetJitterTimeUnits ();
-            session->SetJitterBufferSize (20 * units, max_val * units, units);
-          }
-        }
+        if (stream != NULL)
+          stream->EnableJitterBuffer (true);
       }
     }
   }
diff --git a/lib/engine/components/opal/opal-call.cpp b/lib/engine/components/opal/opal-call.cpp
index 479509d..eacff41 100644
--- a/lib/engine/components/opal/opal-call.cpp
+++ b/lib/engine/components/opal/opal-call.cpp
@@ -313,7 +313,7 @@ Opal::Call::parse_info (OpalConnection & connection)
       remote_party_name = r_party_name;
     if (!app.empty ())
       remote_application = app;
-    
+
     strip_special_chars (remote_party_name, end_special_chars, false);
     strip_special_chars (remote_application, end_special_chars, false);
     strip_special_chars (remote_uri, end_special_chars, false);
@@ -327,7 +327,6 @@ Opal::Call::parse_info (OpalConnection & connection)
 PBoolean
 Opal::Call::OnEstablished (OpalConnection & connection)
 {
-  RTP_Session *session = NULL; 
   OpalMediaStreamPtr stream;
 
   NoAnswerTimer.Stop (false);
@@ -338,38 +337,11 @@ Opal::Call::OnEstablished (OpalConnection & connection)
     Ekiga::Runtime::run_in_main (boost::bind (&Opal::Call::emit_established_in_main, this));
   }
 
-  if (PIsDescendant(&connection, OpalRTPConnection)) {
-
-    stream = connection.GetMediaStream (OpalMediaType::Audio (), false);
-    if (stream != NULL) {
-
-      session = PDownCast (OpalRTPConnection, &connection)->GetSession (stream->GetSessionID ());
-      if (session) {
-      
-        session->SetIgnorePayloadTypeChanges (TRUE);
-        session->SetRxStatisticsInterval(50);
-        session->SetTxStatisticsInterval(50);
-      }
-    }
-
-    stream = connection.GetMediaStream (OpalMediaType::Video (), false);
-    if (stream != NULL) { 
-
-      session = PDownCast (OpalRTPConnection, &connection)->GetSession (stream->GetSessionID ());
-      if (session) {
-
-        session->SetIgnorePayloadTypeChanges (TRUE);
-        session->SetRxStatisticsInterval(50);
-        session->SetTxStatisticsInterval(50);
-      }
-    }
-  }
-  
   return OpalCall::OnEstablished (connection);
 }
 
 
-void 
+void
 Opal::Call::OnReleased (OpalConnection & connection)
 {
   parse_info (connection);
@@ -563,65 +535,6 @@ Opal::Call::OnClosedMediaStream (OpalMediaStream & stream)
 
 
 void
-Opal::Call::OnRTPStatistics (const OpalConnection & /* connection */,
-			     const RTP_Session & session)
-{
-  PWaitAndSignal m(stats_mutex); // The stats are computed from two different threads
-
-  if (session.IsAudio ()) {
-
-    PTimeInterval t = PTime () - last_a_tick;
-    if (t.GetMilliSeconds () < 500)
-      return;
-
-    unsigned elapsed_seconds = max ((unsigned long) t.GetMilliSeconds (), (unsigned long) 1);
-    double octets_received = session.GetOctetsReceived ();
-    double octets_sent = session.GetOctetsSent ();
-
-    re_a_bw = max ((octets_received - re_a_bytes) / elapsed_seconds, 0.0);
-    tr_a_bw = max ((octets_sent - tr_a_bytes) / elapsed_seconds, 0.0);
-
-    re_a_bytes = octets_received;
-    tr_a_bytes = octets_sent;
-    last_a_tick = PTime ();
-
-    total_a = session.GetPacketsReceived ();
-    lost_a = session.GetPacketsLost ();
-    too_late_a = session.GetPacketsTooLate ();
-    out_of_order_a = session.GetPacketsOutOfOrder ();
-
-    jitter = session.GetJitterBufferSize () / max ((unsigned) session.GetJitterTimeUnits (), (unsigned) 8);
-  }
-  else {
-
-    PTimeInterval t = PTime () - last_v_tick;
-    if (t.GetMilliSeconds () < 500)
-      return;
-
-    unsigned elapsed_seconds = max ((unsigned long) t.GetMilliSeconds (), (unsigned long) 1);
-    double octets_received = session.GetOctetsReceived ();
-    double octets_sent = session.GetOctetsSent ();
-
-    re_v_bw = max ((octets_received - re_v_bytes) / elapsed_seconds, 0.0);
-    tr_v_bw = max ((octets_sent - tr_v_bytes) / elapsed_seconds, 0.0);
-
-    re_v_bytes = octets_received;
-    tr_v_bytes = octets_sent;
-    last_v_tick = PTime ();
-
-    total_v = session.GetPacketsReceived ();
-    lost_v = session.GetPacketsLost ();
-    too_late_v = session.GetPacketsTooLate ();
-    out_of_order_v = session.GetPacketsOutOfOrder ();
-  }
-
-  lost_packets = (lost_a + lost_v) / max ((unsigned long)(total_a + total_v), (unsigned long) 1);
-  late_packets = (too_late_a + too_late_v) / max ((unsigned long)(total_a + total_v), (unsigned long) 1);
-  out_of_order_packets = (out_of_order_a + out_of_order_v) / max ((unsigned long)(total_a + total_v), (unsigned long) 1);
-}
-
-
-void
 Opal::Call::DoSetUp (OpalConnection & connection)
 {
   OpalCall::OnSetUp (connection);
diff --git a/lib/engine/components/opal/opal-call.h b/lib/engine/components/opal/opal-call.h
index b7c9f44..d5ea816 100644
--- a/lib/engine/components/opal/opal-call.h
+++ b/lib/engine/components/opal/opal-call.h
@@ -172,8 +172,6 @@ public:
 
     void OnClosedMediaStream (OpalMediaStream & stream);
 
-    void OnRTPStatistics (const OpalConnection & connection, const RTP_Session & session);
-
     void DoSetUp (OpalConnection & connection);
 
 private:
diff --git a/lib/engine/gui/gtk-core/form-dialog-gtk.cpp b/lib/engine/gui/gtk-core/form-dialog-gtk.cpp
index 3f925c9..3c0b1e7 100644
--- a/lib/engine/gui/gtk-core/form-dialog-gtk.cpp
+++ b/lib/engine/gui/gtk-core/form-dialog-gtk.cpp
@@ -647,7 +647,7 @@ FormDialog::FormDialog (Ekiga::FormRequestPtr _request,
 
   vbox = gtk_vbox_new (FALSE, 0);
   gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
-  gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, FALSE, FALSE, 0);
+  gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (window))), vbox, FALSE, FALSE, 0);
   gtk_widget_show (vbox);
 
   preamble = gtk_vbox_new (FALSE, 0);
diff --git a/lib/engine/gui/gtk-frontend/book-view-gtk.cpp b/lib/engine/gui/gtk-frontend/book-view-gtk.cpp
index e40b89c..1b4d0e7 100644
--- a/lib/engine/gui/gtk-frontend/book-view-gtk.cpp
+++ b/lib/engine/gui/gtk-frontend/book-view-gtk.cpp
@@ -241,8 +241,7 @@ on_updated (gpointer data)
   gtk_statusbar_pop (GTK_STATUSBAR (view->priv->statusbar), 0);
   gtk_statusbar_push (GTK_STATUSBAR (view->priv->statusbar), 0, status.c_str ());
 
-  if (GDK_IS_WINDOW (GTK_WIDGET (view)->window))
-    gdk_window_set_cursor (GTK_WIDGET (view)->window, NULL);
+  gdk_window_set_cursor (GDK_WINDOW (gtk_widget_get_parent_window (GTK_WIDGET (view))), NULL);
 
   boost::shared_ptr<Ekiga::Filterable> filtered = boost::dynamic_pointer_cast<Ekiga::Filterable>(view->priv->book);
   if (filtered) {
@@ -281,7 +280,7 @@ on_entry_activated_cb (GtkWidget *entry,
   const char *entry_text = gtk_entry_get_text (GTK_ENTRY (entry));
 
   cursor = gdk_cursor_new (GDK_WATCH);
-  gdk_window_set_cursor (GTK_WIDGET (data)->window, cursor);
+  gdk_window_set_cursor (GDK_WINDOW (gtk_widget_get_parent_window (GTK_WIDGET (data))), cursor);
   gdk_cursor_unref (cursor);
 
   boost::shared_ptr<Ekiga::Filterable> filtered = boost::dynamic_pointer_cast<Ekiga::Filterable>(BOOK_VIEW_GTK (data)->priv->book);
@@ -400,8 +399,7 @@ book_view_gtk_update_contact (BookViewGtk *self,
 		      -1);
   g_object_unref (icon);
 
-  if (GDK_IS_WINDOW (GTK_WIDGET (self)->window))
-    gdk_window_set_cursor (GTK_WIDGET (self)->window, NULL);
+  gdk_window_set_cursor (GDK_WINDOW (gtk_widget_get_parent_window (GTK_WIDGET (self))), NULL);
 }
 
 
@@ -419,8 +417,7 @@ book_view_gtk_remove_contact (BookViewGtk *self,
   while (book_view_gtk_find_iter_for_contact (self, contact, &iter))
     gtk_list_store_remove (store, &iter);
 
-  if (GDK_IS_WINDOW (GTK_WIDGET (self)->window))
-    gdk_window_set_cursor (GTK_WIDGET (self)->window, NULL);
+  gdk_window_set_cursor (GDK_WINDOW (gtk_widget_get_parent_window (GTK_WIDGET (self))), NULL);
 }
 
 
diff --git a/lib/engine/gui/gtk-frontend/chat-area.cpp b/lib/engine/gui/gtk-frontend/chat-area.cpp
index 5fe747d..45a8802 100644
--- a/lib/engine/gui/gtk-frontend/chat-area.cpp
+++ b/lib/engine/gui/gtk-frontend/chat-area.cpp
@@ -419,7 +419,6 @@ on_extlink_tag_event (GtkTextTag* tag,
   case GDK_SELECTION_CLEAR:
   case GDK_PROXIMITY_IN:
   case GDK_PROXIMITY_OUT:
-  case GDK_NO_EXPOSE:
   case GDK_VISIBILITY_NOTIFY:
   case GDK_CLIENT_EVENT:
   case GDK_DROP_FINISHED:
@@ -555,7 +554,7 @@ message_activated_cb (G_GNUC_UNUSED GtkWidget *w,
 
   g_return_val_if_fail (data != NULL, false);
 
-  if (key->keyval == GDK_Return) {
+  if (key->keyval == GDK_KEY_Return) {
 
     buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (self->priv->message));
     gtk_text_buffer_get_start_iter (GTK_TEXT_BUFFER (buffer), &start_iter);
diff --git a/lib/engine/gui/gtk-frontend/chat-window.cpp b/lib/engine/gui/gtk-frontend/chat-window.cpp
index 8077bb8..db95ef4 100644
--- a/lib/engine/gui/gtk-frontend/chat-window.cpp
+++ b/lib/engine/gui/gtk-frontend/chat-window.cpp
@@ -431,7 +431,7 @@ chat_window_new (Ekiga::ChatCore& core,
 
   accel = gtk_accel_group_new ();
   gtk_window_add_accel_group (GTK_WINDOW (result), accel);
-  gtk_accel_group_connect (accel, GDK_Escape, (GdkModifierType) 0, GTK_ACCEL_LOCKED,
+  gtk_accel_group_connect (accel, GDK_KEY_Escape, (GdkModifierType) 0, GTK_ACCEL_LOCKED,
                            g_cclosure_new_swap (G_CALLBACK (on_escaped), (gpointer) result, NULL));
   g_object_unref (accel);
 
diff --git a/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp b/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp
index 380957d..cf0d6b5 100644
--- a/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp
+++ b/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp
@@ -845,7 +845,7 @@ expand_cell_data_func (GtkTreeViewColumn *column,
   gboolean row_expanded = FALSE;
 
   path = gtk_tree_model_get_path (model, iter);
-  row_expanded = gtk_tree_view_row_expanded (GTK_TREE_VIEW (column->tree_view), path);
+  row_expanded = gtk_tree_view_row_expanded (GTK_TREE_VIEW (gtk_tree_view_column_get_tree_view (column)), path);
   gtk_tree_path_free (path);
 
   gtk_tree_model_get (model, iter, COLUMN_TYPE, &column_type, -1);
diff --git a/lib/gui/dialpad.c b/lib/gui/dialpad.c
index 0232758..7acd9ca 100644
--- a/lib/gui/dialpad.c
+++ b/lib/gui/dialpad.c
@@ -48,18 +48,18 @@ struct const_key_info
  * keys.
  */
 static const struct const_key_info keys_info[] = {
-  { "1", "", GDK_KP_1 },
-  { "2", N_("abc"), GDK_KP_2 },
-  { "3", N_("def"), GDK_KP_3 },
-  { "4", N_("ghi"), GDK_KP_4 },
-  { "5", N_("jkl"), GDK_KP_5 },
-  { "6", N_("mno"), GDK_KP_6 },
-  { "7", N_("pqrs"), GDK_KP_7 },
-  { "8", N_("tuv"), GDK_KP_8 },
-  { "9", N_("wxyz"), GDK_KP_9 },
-  { "*", "", GDK_KP_Multiply },
-  { "0", "", GDK_KP_0 },
-  { "#", "", GDK_numbersign }
+  { "1", "", GDK_KEY_KP_1 },
+  { "2", N_("abc"), GDK_KEY_KP_2 },
+  { "3", N_("def"), GDK_KEY_KP_3 },
+  { "4", N_("ghi"), GDK_KEY_KP_4 },
+  { "5", N_("jkl"), GDK_KEY_KP_5 },
+  { "6", N_("mno"), GDK_KEY_KP_6 },
+  { "7", N_("pqrs"), GDK_KEY_KP_7 },
+  { "8", N_("tuv"), GDK_KEY_KP_8 },
+  { "9", N_("wxyz"), GDK_KEY_KP_9 },
+  { "*", "", GDK_KEY_KP_Multiply },
+  { "0", "", GDK_KEY_KP_0 },
+  { "#", "", GDK_KEY_numbersign }
 };
 
 struct _EkigaDialpadPrivate
diff --git a/lib/gui/gm-cell-renderer-bitext.c b/lib/gui/gm-cell-renderer-bitext.c
index 96aac5f..c5df114 100644
--- a/lib/gui/gm-cell-renderer-bitext.c
+++ b/lib/gui/gm-cell-renderer-bitext.c
@@ -130,7 +130,7 @@ gm_cell_renderer_bitext_update_text (GmCellRendererBitext *renderer,
 static void
 gm_cell_renderer_bitext_get_size (GtkCellRenderer *cell,
 				  GtkWidget *widget,
-				  GdkRectangle *cell_area,
+				  const GdkRectangle *cell_area,
 				  gint *x_offset,
 				  gint *y_offset,
 				  gint *width,
@@ -152,24 +152,24 @@ gm_cell_renderer_bitext_get_size (GtkCellRenderer *cell,
 
 static void
 gm_cell_renderer_bitext_render (GtkCellRenderer *cell,
-				GdkWindow *window,
+                                cairo_t *cr,
 				GtkWidget *widget,
-				GdkRectangle *background_area,
-				GdkRectangle *cell_area,
-				GdkRectangle *expose_area,
+				const GdkRectangle *background_area,
+				const GdkRectangle *cell_area,
 				GtkCellRendererState flags)
 {
-  GmCellRendererBitext *renderer = NULL;
-  GtkCellRendererClass* parent_class = NULL;
-
-  renderer = (GmCellRendererBitext *)cell;
-  parent_class = GTK_CELL_RENDERER_CLASS (gm_cell_renderer_bitext_parent_class);
-
-  gm_cell_renderer_bitext_update_text (renderer, widget,
-				       (flags & GTK_CELL_RENDERER_SELECTED));
-  parent_class->render (cell, window, widget,
-			background_area, cell_area,
-			expose_area, flags);
+  GmCellRendererBitext *celltext = NULL;
+  celltext = GM_CELL_RENDERER_BITEXT (cell);
+
+  gm_cell_renderer_bitext_update_text (celltext,
+                                       widget,
+                                       (flags & GTK_CELL_RENDERER_SELECTED));
+
+  (GTK_CELL_RENDERER_CLASS (gm_cell_renderer_bitext_parent_class)->render) (cell, cr,
+                                                                            widget,
+                                                                            background_area,
+                                                                            cell_area,
+                                                                            flags);
 }
 
 /* GObject code */
diff --git a/lib/gui/gm-smiley-chooser-button.c b/lib/gui/gm-smiley-chooser-button.c
index 1cce78d..a15cc35 100644
--- a/lib/gui/gm-smiley-chooser-button.c
+++ b/lib/gui/gm-smiley-chooser-button.c
@@ -500,7 +500,7 @@ gm_smiley_chooser_button_popdown (GmSmileyChooserButton* self)
 {
   g_return_if_fail (GM_IS_SMILEY_CHOOSER_BUTTON (self));
 
-  gtk_widget_hide_all (GTK_WIDGET (self->priv->popup_window));
+  gtk_widget_hide (GTK_WIDGET (self->priv->popup_window));
 
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (self), FALSE);
 
diff --git a/lib/gui/gmcellrendererexpander.c b/lib/gui/gmcellrendererexpander.c
index f69bd9c..e7a9828 100644
--- a/lib/gui/gmcellrendererexpander.c
+++ b/lib/gui/gmcellrendererexpander.c
@@ -47,24 +47,23 @@ static void     gm_cell_renderer_expander_set_property (GObject
 static void     gm_cell_renderer_expander_finalize     (GObject                         *object);
 static void     gm_cell_renderer_expander_get_size     (GtkCellRenderer                 *cell,
                                                         GtkWidget                       *widget,
-                                                        GdkRectangle                    *cell_area,
+                                                        const GdkRectangle              *cell_area,
                                                         gint                            *x_offset,
                                                         gint                            *y_offset,
                                                         gint                            *width,
                                                         gint                            *height);
 static void     gm_cell_renderer_expander_render       (GtkCellRenderer                 *cell,
-                                                        GdkWindow                       *window,
+                                                        cairo_t                         *cr,
                                                         GtkWidget                       *widget,
-                                                        GdkRectangle                    *background_area,
-                                                        GdkRectangle                    *cell_area,
-                                                        GdkRectangle                    *expose_area,
+                                                        const GdkRectangle              *background_area,
+                                                        const GdkRectangle              *cell_area,
                                                         GtkCellRendererState             flags);
 static gboolean gm_cell_renderer_expander_activate     (GtkCellRenderer                 *cell,
                                                         GdkEvent                        *event,
                                                         GtkWidget                       *widget,
                                                         const gchar                     *path,
-                                                        GdkRectangle                    *background_area,
-                                                        GdkRectangle                    *cell_area,
+                                                        const GdkRectangle              *background_area,
+                                                        const GdkRectangle              *cell_area,
                                                         GtkCellRendererState             flags);
 
 enum {
@@ -249,7 +248,7 @@ gm_cell_renderer_expander_new (void)
 static void
 gm_cell_renderer_expander_get_size (GtkCellRenderer *cell,
                                     G_GNUC_UNUSED GtkWidget       *widget,
-                                    GdkRectangle    *cell_area,
+                                    const GdkRectangle    *cell_area,
                                     gint            *x_offset,
                                     gint            *y_offset,
                                     gint            *width,
@@ -296,60 +295,48 @@ gm_cell_renderer_expander_get_size (GtkCellRenderer *cell,
 
 static void
 gm_cell_renderer_expander_render (GtkCellRenderer      *cell,
-                                  GdkWindow            *window,
+                                  cairo_t              *cr,
                                   GtkWidget            *widget,
-                                  GdkRectangle         *background_area,
-                                  GdkRectangle         *cell_area,
-                                  GdkRectangle         *expose_area,
+                                  G_GNUC_UNUSED const GdkRectangle   *background_area,
+                                  const GdkRectangle   *cell_area,
                                   G_GNUC_UNUSED GtkCellRendererState  flags)
 {
   GmCellRendererExpander     *expander;
   GmCellRendererExpanderPriv *priv;
-  GtkExpanderStyle                expander_style;
-  gint                            x_offset, y_offset;
-  guint xpad, ypad;
-  GtkAllocation allocation;
+  gint                       x_offset, y_offset;
+  guint                      xpad, ypad;
+  GtkStyleContext            *style;
 
-  expander = (GmCellRendererExpander*) cell;
+  expander = (GmCellRendererExpander *) cell;
   priv = GET_PRIV (expander);
-  g_object_get (G_OBJECT (cell),
-		"xpad", &xpad,
-		"ypad", &ypad,
-		NULL);
-  gtk_widget_get_allocation (widget, &allocation);
 
-  if (priv->animation_node) {
-    GtkTreePath *path;
-    GdkRectangle rect;
+  gm_cell_renderer_expander_get_size (cell, widget,
+                                      (GdkRectangle *) cell_area,
+                                      &x_offset, &y_offset,
+                                      NULL, NULL);
 
-    /* Not sure if I like this ... */
-    path = gtk_tree_row_reference_get_path (priv->animation_node);
-    gtk_tree_view_get_background_area (priv->animation_view, path,
-                                       NULL, &rect);
-    gtk_tree_path_free (path);
+  g_object_get (cell,
+                "xpad", &xpad,
+                "ypad", &ypad,
+                NULL);
 
-    if (background_area->y == rect.y)
-      expander_style = priv->animation_style;
-    else
-      expander_style = priv->expander_style;
-  } else
-    expander_style = priv->expander_style;
+  style = gtk_widget_get_style_context (widget);
 
-  gm_cell_renderer_expander_get_size (cell, widget, cell_area,
-                                      &x_offset, &y_offset,
-                                      NULL, NULL);
+  gtk_style_context_save (style);
+
+  if (priv->expander_style == GTK_EXPANDER_COLLAPSED)
+    gtk_style_context_set_state (style, GTK_STATE_NORMAL);
+  else
+    gtk_style_context_set_state (style, GTK_STATE_ACTIVE);
+
+  gtk_render_expander (style,
+                       cr,
+                       cell_area->x + x_offset + xpad,
+                       cell_area->y + y_offset + ypad,
+                       priv->expander_size,
+                       priv->expander_size);
 
-  gtk_paint_expander (gtk_widget_get_style (widget),
-                      window,
-                      GTK_STATE_NORMAL,
-                      expose_area,
-                      widget,
-                      "treeview",
-                      cell_area->x + x_offset + xpad + priv->expander_size / 2,
-                      cell_area->y + y_offset + ypad + priv->expander_size / 2,
-                      expander_style);
-  gtk_paint_hline (gtk_widget_get_style (widget), window, GTK_STATE_NORMAL, NULL, widget, NULL, 0,
-                   allocation.width, cell_area->y + cell_area->height);
+  gtk_style_context_restore (style);
 }
 
 static void
@@ -428,7 +415,7 @@ gm_cell_renderer_expander_start_animation (GmCellRendererExpander *expander,
                                            GtkTreeView                *tree_view,
                                            GtkTreePath                *path,
                                            gboolean                    expanding,
-                                           G_GNUC_UNUSED GdkRectangle               *background_area)
+                                           G_GNUC_UNUSED const GdkRectangle  *background_area)
 {
   GmCellRendererExpanderPriv *priv;
 
@@ -449,12 +436,12 @@ gm_cell_renderer_expander_start_animation (GmCellRendererExpander *expander,
 }
 
 static gboolean
-gm_cell_renderer_expander_activate (GtkCellRenderer      *cell,
+gm_cell_renderer_expander_activate (GtkCellRenderer                    *cell,
                                     G_GNUC_UNUSED GdkEvent             *event,
-                                    GtkWidget            *widget,
-                                    const gchar          *path_string,
-                                    GdkRectangle         *background_area,
-                                    G_GNUC_UNUSED GdkRectangle         *cell_area,
+                                    GtkWidget                          *widget,
+                                    const gchar                        *path_string,
+                                    const GdkRectangle                 *background_area,
+                                    G_GNUC_UNUSED const GdkRectangle   *cell_area,
                                     G_GNUC_UNUSED GtkCellRendererState  flags)
 {
   GmCellRendererExpander     *expander;
diff --git a/lib/gui/gmmenuaddon.c b/lib/gui/gmmenuaddon.c
index 23e3349..2dfa0ac 100644
--- a/lib/gui/gmmenuaddon.c
+++ b/lib/gui/gmmenuaddon.c
@@ -123,8 +123,6 @@ menu_item_selected (GtkWidget *w,
   GtkWidget *statusbar = NULL;
 
   gint id = 0;
-  int len = 0;
-  int i = 0;
 
   statusbar = (GtkWidget *) g_object_get_data (G_OBJECT (w), "statusbar");
 
@@ -291,13 +289,13 @@ gtk_build_menu (GtkWidget *menubar,
       if (menu [i].accel && accel)
 	{
 	  switch (menu [i].accel) {
-		case GDK_F1:
-		case GDK_F11:
-		case GDK_Escape:
-		case GDK_h:
-		case GDK_t:
-		case GDK_m:
-		case GDK_p:
+		case GDK_KEY_F1:
+		case GDK_KEY_F11:
+		case GDK_KEY_Escape:
+		case GDK_KEY_h:
+		case GDK_KEY_t:
+		case GDK_KEY_m:
+		case GDK_KEY_p:
           gtk_widget_add_accelerator (menu [i].widget, "activate",
                                       accel, menu [i].accel,
                                       0, GTK_ACCEL_VISIBLE);
diff --git a/lib/gui/gmpreferences.c b/lib/gui/gmpreferences.c
index 3e31b24..7f52d48 100644
--- a/lib/gui/gmpreferences.c
+++ b/lib/gui/gmpreferences.c
@@ -272,11 +272,11 @@ gnome_prefs_scale_new (GtkWidget *table,
 
   gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE,
 		      1 * 2);
-  
+
   gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
   gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
 
-  adj = (GtkAdjustment *) 
+  adj = (GtkAdjustment *)
     gtk_adjustment_new (gm_conf_get_int (conf_key),
 			min, max, step,
 			2.0, 1.0);
@@ -284,8 +284,6 @@ gnome_prefs_scale_new (GtkWidget *table,
   hscale = gtk_hscale_new (adj);
   gtk_scale_set_draw_value (GTK_SCALE (hscale), FALSE);
   gtk_widget_set_size_request (GTK_WIDGET (hscale), 150, -1);
-  gtk_range_set_update_policy (GTK_RANGE (hscale),
-			       GTK_UPDATE_DELAYED);
   if (!writable)
     gtk_widget_set_sensitive (GTK_WIDGET (hscale), FALSE);
 
@@ -951,7 +949,7 @@ gnome_prefs_window_new (const gchar *logo_name)
   GtkWidget *pixmap = NULL;
   GtkWidget *hsep = NULL;
 
-  GdkColor cwhite;
+  GdkRGBA cwhite;
 
   PangoAttrList *attrs = NULL; 
   PangoAttribute *attr = NULL; 
@@ -981,12 +979,12 @@ gnome_prefs_window_new (const gchar *logo_name)
   gtk_container_add (GTK_CONTAINER (event_box),
 		     GTK_WIDGET (pixmap));
 
-  cwhite.red   = 0xff * 0x100;
-  cwhite.green = 0xff * 0x100;
-  cwhite.blue  = 0xff * 0x100;
-  gdk_colormap_alloc_color(gdk_colormap_get_system (), &cwhite, FALSE, TRUE);
-  gtk_widget_modify_bg (GTK_WIDGET (event_box),
-			GTK_STATE_NORMAL, &cwhite);
+  cwhite.red   = 1.0;
+  cwhite.green = 1.0;
+  cwhite.blue  = 1.0; 
+  cwhite.alpha = 0.0;
+  gtk_widget_override_background_color (GTK_WIDGET (event_box),
+                                        GTK_STATE_FLAG_NORMAL, &cwhite);
 
   gtk_notebook_prepend_page (GTK_NOTEBOOK (gpw->notebook), event_box, NULL);
 
diff --git a/lib/gui/gmwindow.c b/lib/gui/gmwindow.c
index 236abc1..6ff5515 100644
--- a/lib/gui/gmwindow.c
+++ b/lib/gui/gmwindow.c
@@ -167,9 +167,9 @@ gm_window_set_property (GObject *obj,
   case GM_HIDE_ON_ESC:
     self->priv->hide_on_esc = g_value_get_boolean (value);
     if (!self->priv->hide_on_esc)
-      gtk_accel_group_disconnect_key (self->priv->accel, GDK_Escape, (GdkModifierType) 0);
+      gtk_accel_group_disconnect_key (self->priv->accel, GDK_KEY_Escape, (GdkModifierType) 0);
     else
-      gtk_accel_group_connect (self->priv->accel, GDK_Escape, (GdkModifierType) 0, GTK_ACCEL_LOCKED,
+      gtk_accel_group_connect (self->priv->accel, GDK_KEY_Escape, (GdkModifierType) 0, GTK_ACCEL_LOCKED,
                                g_cclosure_new_swap (G_CALLBACK (gtk_widget_hide), (gpointer) self, NULL));
     break;
 
@@ -220,7 +220,7 @@ gm_window_init (GmWindow* self)
 
   self->priv->accel = gtk_accel_group_new ();
   gtk_window_add_accel_group (GTK_WINDOW (self), self->priv->accel);
-  gtk_accel_group_connect (self->priv->accel, GDK_Escape, (GdkModifierType) 0, GTK_ACCEL_LOCKED,
+  gtk_accel_group_connect (self->priv->accel, GDK_KEY_Escape, (GdkModifierType) 0, GTK_ACCEL_LOCKED,
                            g_cclosure_new_swap (G_CALLBACK (gtk_widget_hide), (gpointer) self, NULL));
 
   g_signal_connect (self, "delete_event",
diff --git a/src/gui/accounts.cpp b/src/gui/accounts.cpp
index acc96fb..723c859 100644
--- a/src/gui/accounts.cpp
+++ b/src/gui/accounts.cpp
@@ -695,8 +695,8 @@ gm_accounts_window_new (Ekiga::ServiceCore &core)
   gtk_box_pack_start (GTK_BOX (hbox), button_box, FALSE, FALSE, 10);
 
   populate_menu (window); // This will add static and dynamic actions
-  gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), menu_bar, FALSE, FALSE, 0);
-  gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), event_box, TRUE, TRUE, 0);
+  gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (window))), menu_bar, FALSE, FALSE, 0);
+  gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (window))), event_box, TRUE, TRUE, 0);
 
   /* Generic signals */
   g_signal_connect_swapped (window, "response",
@@ -705,7 +705,7 @@ gm_accounts_window_new (Ekiga::ServiceCore &core)
 
   gm_window_hide_on_delete (window);
 
-  gtk_widget_show_all (GTK_WIDGET (GTK_DIALOG (window)->vbox));
+  gtk_widget_show_all (GTK_WIDGET (gtk_dialog_get_content_area (GTK_DIALOG (window))));
 
 
   /* Engine Signals callbacks */
diff --git a/src/gui/assistant.cpp b/src/gui/assistant.cpp
index 9d9dfb1..3d2459f 100644
--- a/src/gui/assistant.cpp
+++ b/src/gui/assistant.cpp
@@ -1599,7 +1599,7 @@ ekiga_assistant_key_press_cb (GtkWidget *widget,
 			      GdkEventKey *event,
 			      G_GNUC_UNUSED gpointer user_data)
 {
-  if (event->keyval == GDK_Escape) {
+  if (event->keyval == GDK_KEY_Escape) {
 
     gtk_widget_hide (widget);
     return TRUE;  /* do not propagate the key to parent */
diff --git a/src/gui/main_window.cpp b/src/gui/main_window.cpp
index d147dea..08ef0cb 100644
--- a/src/gui/main_window.cpp
+++ b/src/gui/main_window.cpp
@@ -54,7 +54,6 @@
 #include "gmconf.h"
 #include <boost/smart_ptr.hpp>
 #include "gmmenuaddon.h"
-#include "gmlevelmeter.h"
 #include "gmpowermeter.h"
 #include "trigger.h"
 #include "menu-builder-tools.h"
@@ -185,8 +184,6 @@ struct _EkigaMainWindowPrivate
   GtkWidget *audio_settings_window;
   GtkWidget *audio_input_volume_frame;
   GtkWidget *audio_output_volume_frame;
-  GtkWidget *input_signal;
-  GtkWidget *output_signal;
 #if GTK_CHECK_VERSION (3, 0, 0)
   GtkAdjustment *adj_input_volume;
   GtkAdjustment *adj_output_volume;
@@ -194,7 +191,6 @@ struct _EkigaMainWindowPrivate
   GtkObject *adj_input_volume;
   GtkObject *adj_output_volume;
 #endif
-  unsigned int levelmeter_timeout_id;
 
   /* Video Settings Window */
   GtkWidget *video_settings_window;
@@ -323,8 +319,6 @@ static void ekiga_main_window_show_call_panel (EkigaMainWindow *mw);
 
 static void ekiga_main_window_hide_call_panel (EkigaMainWindow *mw);
 
-void ekiga_main_window_clear_signal_levels (EkigaMainWindow *mw);
-
 static void ekiga_main_window_incoming_call_dialog_show (EkigaMainWindow *mw,
                                                       boost::shared_ptr<Ekiga::Call>  call);
 
@@ -1025,18 +1019,6 @@ static gboolean on_stats_refresh_cb (gpointer self)
   return true;
 }
 
-static gboolean on_signal_level_refresh_cb (gpointer self) 
-{
-  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (self);
-
-  boost::shared_ptr<Ekiga::AudioInputCore> audioinput_core = mw->priv->core->get<Ekiga::AudioInputCore> ("audioinput-core");
-  boost::shared_ptr<Ekiga::AudioOutputCore> audiooutput_core = mw->priv->core->get<Ekiga::AudioOutputCore> ("audiooutput-core");
-
-  gm_level_meter_set_level (GM_LEVEL_METER (mw->priv->output_signal), audiooutput_core->get_average_level());
-  gm_level_meter_set_level (GM_LEVEL_METER (mw->priv->input_signal), audioinput_core->get_average_level());
-  return true;
-}
-
 static void on_established_call_cb (boost::shared_ptr<Ekiga::CallManager>  /*manager*/,
                                     boost::shared_ptr<Ekiga::Call>  call,
                                     gpointer self)
@@ -1101,9 +1083,6 @@ static void on_cleared_call_cb (boost::shared_ptr<Ekiga::CallManager>  /*manager
 
   audiooutput_core->stop_play_event("incoming_call_sound");
   audiooutput_core->stop_play_event("ring_tone_sound");
-
-  ekiga_main_window_clear_signal_levels (mw);
-
 }
 
 
@@ -2131,11 +2110,6 @@ gm_mw_audio_settings_window_new (EkigaMainWindow *mw)
   gtk_scale_set_draw_value (GTK_SCALE (hscale_play), FALSE);
   gtk_box_pack_start (GTK_BOX (small_vbox), hscale_play, TRUE, TRUE, 0);
 
-  mw->priv->output_signal = gm_level_meter_new ();
-  gtk_box_pack_start (GTK_BOX (small_vbox), mw->priv->output_signal, TRUE, TRUE, 0);
-  gtk_box_pack_start (GTK_BOX (hbox), small_vbox, TRUE, TRUE, 2);
-  gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 3);
-
   gtk_container_add (GTK_CONTAINER (GTK_DIALOG (window)->vbox), 
                      mw->priv->audio_output_volume_frame);
   gtk_widget_show_all (mw->priv->audio_output_volume_frame);
@@ -2165,11 +2139,6 @@ gm_mw_audio_settings_window_new (EkigaMainWindow *mw)
   gtk_scale_set_draw_value (GTK_SCALE (hscale_rec), FALSE);
   gtk_box_pack_start (GTK_BOX (small_vbox), hscale_rec, TRUE, TRUE, 0);
 
-  mw->priv->input_signal = gm_level_meter_new ();
-  gtk_box_pack_start (GTK_BOX (small_vbox), mw->priv->input_signal, TRUE, TRUE, 0);
-  gtk_box_pack_start (GTK_BOX (hbox), small_vbox, TRUE, TRUE, 2);
-  gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 3);
-
   gtk_container_add (GTK_CONTAINER (GTK_DIALOG (window)->vbox), 
                      mw->priv->audio_input_volume_frame);
   gtk_widget_show_all (mw->priv->audio_input_volume_frame);
@@ -3021,15 +2990,6 @@ ekiga_main_window_hide_call_panel (EkigaMainWindow *mw)
   }
 }
 
-void
-ekiga_main_window_clear_signal_levels (EkigaMainWindow *mw)
-{
-  g_return_if_fail (EKIGA_IS_MAIN_WINDOW (mw));
-
-  gm_level_meter_clear (GM_LEVEL_METER (mw->priv->output_signal));
-  gm_level_meter_clear (GM_LEVEL_METER (mw->priv->input_signal));
-}
-
 
 static void
 ekiga_main_window_incoming_call_dialog_show (EkigaMainWindow *mw,



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