ekiga r7175 - trunk/src/gui



Author: sfre
Date: Wed Oct  8 18:23:27 2008
New Revision: 7175
URL: http://svn.gnome.org/viewvc/ekiga?rev=7175&view=rev

Log:
Reimplementation of the main window as a GObject

Everything has been rewritten using the EkigaMainWindow object as a
base and store.
Note that we still use gm_main_window_new as a "proxy" for a few things
that are not directly bound to the window, but it should go.

Modified:
   trunk/src/gui/conf.cpp
   trunk/src/gui/main.cpp
   trunk/src/gui/main.h

Modified: trunk/src/gui/conf.cpp
==============================================================================
--- trunk/src/gui/conf.cpp	(original)
+++ trunk/src/gui/conf.cpp	Wed Oct  8 18:23:27 2008
@@ -144,7 +144,7 @@
 
     val = gm_conf_entry_get_bool (entry);
 
-    gm_main_window_set_stay_on_top (GTK_WIDGET (data), val);
+    ekiga_main_window_set_stay_on_top (EKIGA_MAIN_WINDOW (data), val);
 
     //gdk_threads_leave ();
   }

Modified: trunk/src/gui/main.cpp
==============================================================================
--- trunk/src/gui/main.cpp	(original)
+++ trunk/src/gui/main.cpp	Wed Oct  8 18:23:27 2008
@@ -120,67 +120,64 @@
 struct _EkigaMainWindowPrivate
 {
   Ekiga::ServiceCore *core;
-};
-
-
-/* Declarations */
-struct _GmMainWindow
-{
-  _GmMainWindow (Ekiga::ServiceCore & _core) : core (_core) { }
-
-  GtkWidget *input_signal;
-  GtkWidget *output_signal;
-  GtkObject *adj_input_volume;
-  GtkObject *adj_output_volume;
-  GtkWidget *audio_input_volume_frame;
-  GtkWidget *audio_output_volume_frame;
-  GtkWidget *audio_settings_window;
-  GtkWidget *audio_settings_button;
-
-  GtkObject *adj_whiteness;
-  GtkObject *adj_brightness;
-  GtkObject *adj_colour;
-  GtkObject *adj_contrast;
-  GtkWidget *video_settings_button;
-  GtkWidget *video_settings_frame;
-  GtkWidget *video_settings_window;
-
-  GtkListStore *completion;
 
   GtkAccelGroup *accel;
-
   GtkWidget *main_menu;
-  GtkWidget *main_toolbar;
+  GtkWidget *main_notebook;
+  GtkWidget *hpaned;
 
-  GtkWidget *window_vbox;
+  /* URI Toolbar */
+  GtkWidget *main_toolbar;
+  GtkWidget *entry;
+  GtkListStore *completion;
+  GtkWidget *connect_button;
 
-  GtkWidget *status_label_ebox;
-  GtkWidget *info_text;
-  GtkWidget *info_label;
+  /* Status Toolbar */
+  GtkWidget *status_toolbar;
+  GtkWidget *status_option_menu;
 
+  /* Statusbar */
   GtkWidget *statusbar;
   GtkWidget *statusbar_ebox;
   GtkWidget *qualitymeter;
-  GtkWidget *entry;
-  GtkWidget *main_notebook;
-  GtkWidget *hpaned;
-  GtkWidget *roster;
-  GtkWidget *main_video_image;
-  GtkWidget *local_video_image;
-  GtkWidget *remote_video_image;
+
+  /* Call panel */
   GtkWidget *video_frame;
+  GtkWidget *main_video_image;
+  GtkWidget *info_text;
   GtkWidget *preview_button;
-  GtkWidget *connect_button;
   GtkWidget *hold_button;
-  GtkWidget *transfer_call_popup;
-  GtkWidget *status_option_menu;
-  Ekiga::Presentity* presentity;
-
+  GtkWidget *audio_settings_button;
+  GtkWidget *video_settings_button;
 #ifndef WIN32
   GdkGC* video_widget_gc;
 #endif
 
-  unsigned int calling_state;
+  /* Audio Settings Window */
+  GtkWidget *audio_settings_window;
+  GtkWidget *audio_input_volume_frame;
+  GtkWidget *audio_output_volume_frame;
+  GtkWidget *input_signal;
+  GtkWidget *output_signal;
+  GtkObject *adj_input_volume;
+  GtkObject *adj_output_volume;
+  unsigned int levelmeter_timeout_id;
+
+  /* Video Settings Window */
+  GtkWidget *video_settings_window;
+  GtkWidget *video_settings_frame;
+  GtkObject *adj_whiteness;
+  GtkObject *adj_brightness;
+  GtkObject *adj_colour;
+  GtkObject *adj_contrast;
+
+  /* Misc Dialogs */
+  GtkWidget *transfer_call_popup;
+
+  /* Calls */
+  Ekiga::Call *current_call;
+  unsigned timeout_id;
+  unsigned calling_state;
   bool audio_transmission_active;
   bool audio_reception_active;
   bool video_transmission_active;
@@ -189,18 +186,18 @@
   std::string transmitted_audio_codec;
   std::string received_video_codec;
   std::string received_audio_codec;
-  unsigned int timeout_id;
-  unsigned int levelmeter_timeout_id;
-  Ekiga::Call *current_call;
-  Ekiga::ServiceCore & core;
-  std::vector<sigc::connection> connections;
-  std::list<std::string> accounts;
-};
 
-typedef struct _GmMainWindow GmMainWindow;
+  std::list<std::string> accounts;
+  Ekiga::Presentity* presentity;
 
+  std::vector<sigc::connection> *connections;
+};
 
-#define GM_MAIN_WINDOW(x) (GmMainWindow *) (x)
+/* properties */
+enum {
+  PROP_0,
+  PROP_SERVICE_CORE
+};
 
 /* channel types */
 enum {
@@ -214,86 +211,18 @@
 /* GUI Functions */
 
 
-/* DESCRIPTION  : / 
- * BEHAVIOR     : Frees a GmMainWindow and its content.
- * PRE          : A non-NULL pointer to a GmMainWindow.
- */
-static void gm_mw_destroy (gpointer);
-
-
-/* DESCRIPTION  : / 
- * BEHAVIOR     : Returns a pointer to the private GmMainWindow
- * 		  used by the main book GMObject.
- * PRE          : The given GtkWidget pointer must be the main window GMObject. 
- */
-static GmMainWindow *gm_mw_get_mw (GtkWidget *);
-
-
-/* DESCRIPTION  :  /
- * BEHAVIOR     :  Create the URI toolbar of the main window.
- *                 The toolbar is created in its initial state, with
- *                 required items being unsensitive.
- * PRE          :  The main window GMObject.
- */
-static GtkWidget *gm_mw_init_uri_toolbar (GtkWidget *);
-
-
-/* DESCRIPTION  :  /
- * BEHAVIOR     :  Create the status menu toolbar of the main window.
- * PRE          :  The main window GMObject.
- */
-static GtkWidget *gm_mw_init_status_toolbar (GtkWidget *);
-
-
-/* DESCRIPTION  :  /
- * BEHAVIOR     :  Create the menu of the main window.
- *                 The menu is created in its initial state, with
- *                 required items being unsensitive.
- * PRE          :  The main window GMObject. The statusbar must have been
- * 		   created.
- */
-static void gm_mw_init_menu (GtkWidget *);
-
-
-/* description  : /
- * behavior     : Builds the contacts list part of the main window.
- * pre          : The given GtkWidget pointer must be the main window GMObject. 
- */
-static void gm_mw_init_contacts_list (GtkWidget *);
-
-
-/* description  : /
- * behavior     : builds the dialpad part of the main window.
- * pre          : the given GtkWidget pointer must be the main window GMObject. 
- */
-static void gm_mw_init_dialpad (GtkWidget *);
-
 /* DESCRIPTION  : /
  * BEHAVIOR     : Builds the video settings popup of the main window.
  * PRE          : The given GtkWidget pointer must be the main window GMObject. 
  */
-static GtkWidget *gm_mw_video_settings_window_new (GtkWidget *);
+static GtkWidget *gm_mw_video_settings_window_new (EkigaMainWindow *);
 
 
 /* DESCRIPTION  : /
  * BEHAVIOR     : Builds the audio settings popup for the main window.
  * PRE          : The given GtkWidget pointer must be the main window GMObject. 
  */
-static GtkWidget *gm_mw_audio_settings_window_new (GtkWidget *);
-
-
-/* DESCRIPTION  : /
- * BEHAVIOR     : Builds the call part of the main window.
- * PRE          : The given GtkWidget pointer must be the main window GMObject. 
- */
-static void gm_mw_init_call (GtkWidget *);
-
-
-/* DESCRIPTION  : /
- * BEHAVIOR     : Builds the call history part of the main window.
- * PRE          : The given GtkWidget pointer must be the main window GMObject. 
- */
-static void gm_mw_init_history (GtkWidget *);
+static GtkWidget *gm_mw_audio_settings_window_new (EkigaMainWindow *);
 
 
 /* DESCRIPTION  :  /
@@ -301,25 +230,25 @@
  *                 to zoom factor
  * PRE          :  The main window GMObject.
  */
-static void gm_mw_zooms_menu_update_sensitivity (GtkWidget *,
-			      			 unsigned int);
+static void ekiga_main_window_zooms_menu_update_sensitivity (EkigaMainWindow *main_window,
+							     unsigned int zoom);
 static void gm_main_window_toggle_fullscreen (Ekiga::VideoOutputFSToggle toggle,
                                               GtkWidget   *main_window);
 
-static void gm_main_window_show_call_panel (GtkWidget *self);
+static void ekiga_main_window_show_call_panel (EkigaMainWindow *mw);
 
-static void gm_main_window_hide_call_panel (GtkWidget *self);
+static void ekiga_main_window_hide_call_panel (EkigaMainWindow *mw);
 
-void gm_main_window_clear_signal_levels (GtkWidget *main_window);
+void ekiga_main_window_clear_signal_levels (EkigaMainWindow *mw);
 
-void gm_main_window_selected_presentity_build_menu (GtkWidget *main_window);
+static void ekiga_main_window_selected_presentity_build_menu (EkigaMainWindow *mw);
 
-void gm_main_window_incoming_call_dialog_show (GtkWidget *main_window,
-                                               Ekiga::Call & call);
+static void ekiga_main_window_incoming_call_dialog_show (EkigaMainWindow *mw,
+                                                      Ekiga::Call & call);
 
 #ifdef HAVE_NOTIFY
-void gm_main_window_incoming_call_notify (GtkWidget *main_window, 
-                                          Ekiga::Call & call);
+static void ekiga_main_window_incoming_call_notify (EkigaMainWindow *mw,
+                                                    Ekiga::Call & call);
 #endif
 
 
@@ -411,14 +340,6 @@
 				      gpointer);
 
 
-/* DESCRIPTION  :  This callback is called when a video window is shown.
- * BEHAVIOR     :  Set the WM HINTS to stay-on-top if the config key is set
- *                 to true.
- * PRE          :  /
- */
-static void video_window_shown_cb (GtkWidget *,
-                                   gpointer);
-
 /* DESCRIPTION  :  This callback is called when the user changes the
  *                 audio settings sliders in the main notebook.
  * BEHAVIOR     :  Update the volume of the choosen mixers. If the update
@@ -457,7 +378,7 @@
  */
 static void dialpad_button_clicked_cb (EkigaDialpad  *dialpad,
 				       const gchar *button_text,
-				       GtkWidget   *main_window);
+				       EkigaMainWindow *main_window);
 
 
 /* DESCRIPTION  :  This callback is called when the user tries to close
@@ -547,20 +468,16 @@
 				      gpointer);
 
 
-/* DESCRIPTION  :  This callback is called if main window is focussed
- * BEHAVIOR     :  currently only: unset urgency hint
- * PRE          : /
- */
-static gboolean main_window_focus_event_cb (GtkWidget *,
-					    GdkEventFocus *,
-					    gpointer);
-
 static void audio_volume_window_shown_cb (GtkWidget *widget,
 	                                  gpointer data);
 
 static void audio_volume_window_hidden_cb (GtkWidget *widget,
 	                                   gpointer data);
 
+static void ekiga_main_window_add_device_dialog_show (EkigaMainWindow *main_window,
+                                                      const Ekiga::Device & device,
+                                                      DeviceType device_type);
+
 
 
 /* 
@@ -568,7 +485,7 @@
  */
 static void on_ready_cb (gpointer self)
 {
-  gm_main_window_set_busy (GTK_WIDGET (self), false);
+  ekiga_main_window_set_busy (EKIGA_MAIN_WINDOW (self), false);
 }
 
 
@@ -577,25 +494,25 @@
                                    std::string /*info*/,
                                    gpointer self)
 {
-  GmMainWindow *mw = NULL;
+  EkigaMainWindow *mw = NULL;
 
   gchar *msg = NULL;
   std::string aor = account.get_aor ();
 
-  g_return_if_fail (GTK_WIDGET (self) != NULL);
-  mw = gm_mw_get_mw (GTK_WIDGET (self));
+  g_return_if_fail (EKIGA_IS_MAIN_WINDOW (self));
+  mw = EKIGA_MAIN_WINDOW (self);
 
   switch (state) {
   case Ekiga::AccountCore::Registered:
     /* Translators: Is displayed once an account "%s" is registered. */
     msg = g_strdup_printf (_("Registered %s"), aor.c_str ()); 
-    mw->accounts.push_back (account.get_host ());
+    mw->priv->accounts.push_back (account.get_host ());
     break;
 
   case Ekiga::AccountCore::Unregistered:
     /* Translators: Is displayed once an account "%s" is unregistered. */
     msg = g_strdup_printf (_("Unregistered %s"), aor.c_str ());
-    mw->accounts.remove (account.get_host ());
+    mw->priv->accounts.remove (account.get_host ());
     break;
 
   case Ekiga::AccountCore::UnregistrationFailed:
@@ -612,7 +529,7 @@
   }
 
   if (msg)
-    gm_main_window_flash_message (GTK_WIDGET (self), "%s", msg);
+    ekiga_main_window_flash_message (mw, "%s", msg);
 
   g_free (msg);
 }
@@ -622,23 +539,23 @@
                               Ekiga::Call & call,
                               gpointer self)
 {
-  GmMainWindow *mw = gm_mw_get_mw (GTK_WIDGET (self));
-  Ekiga::AudioOutputCore *audiooutput_core = dynamic_cast<Ekiga::AudioOutputCore *> (mw->core.get ("audiooutput-core"));
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (self);
+  Ekiga::AudioOutputCore *audiooutput_core = dynamic_cast<Ekiga::AudioOutputCore *> (mw->priv->core->get ("audiooutput-core"));
 
   if (!call.is_outgoing ()) {
-    gm_main_window_update_calling_state (GTK_WIDGET (self), Called);
-    audiooutput_core->start_play_event("incoming_call_sound", 4000, 256);
+    ekiga_main_window_update_calling_state (mw, Called);
+    audiooutput_core->start_play_event ("incoming_call_sound", 4000, 256);
 #ifdef HAVE_NOTIFY
-    gm_main_window_incoming_call_notify (GTK_WIDGET (self), call);
+    ekiga_main_window_incoming_call_notify (mw, call);
 #else
-    gm_main_window_incoming_call_dialog_show (GTK_WIDGET (self), call);
+    ekiga_main_window_incoming_call_dialog_show (mw, call);
 #endif
   }
   else {
-    gm_main_window_update_calling_state (GTK_WIDGET (self), Calling);
+    ekiga_main_window_update_calling_state (mw, Calling);
     if (!call.get_remote_uri ().empty ())
-      gm_main_window_set_call_url (GTK_WIDGET (self), call.get_remote_uri ().c_str());
-    mw->current_call = &call;
+      ekiga_main_window_set_call_url (mw, call.get_remote_uri ().c_str());
+    mw->priv->current_call = &call;
   }
 }
 
@@ -647,8 +564,8 @@
                                 Ekiga::Call & call,
                                 gpointer self)
 {
-  GmMainWindow *mw = gm_mw_get_mw (GTK_WIDGET (self));
-  Ekiga::AudioOutputCore *audiooutput_core = dynamic_cast<Ekiga::AudioOutputCore *> (mw->core.get ("audiooutput-core"));
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (self);
+  Ekiga::AudioOutputCore *audiooutput_core = dynamic_cast<Ekiga::AudioOutputCore *> (mw->priv->core->get ("audiooutput-core"));
 
   if (call.is_outgoing ()) {
     audiooutput_core->start_play_event("ring_tone_sound", 3000, 256);
@@ -661,49 +578,48 @@
 {
   gchar *msg = NULL;
 
-  GmMainWindow *mw = gm_mw_get_mw (GTK_WIDGET (self));
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (self);
   
-  if (mw->calling_state == Connected && mw->current_call) {
+  if (mw->priv->calling_state == Connected && mw->priv->current_call) {
 
     Ekiga::VideoOutputStats videooutput_stats;
-    Ekiga::VideoOutputCore *videooutput_core = dynamic_cast<Ekiga::VideoOutputCore *> (mw->core.get ("videooutput-core"));
+    Ekiga::VideoOutputCore *videooutput_core = dynamic_cast<Ekiga::VideoOutputCore *> (mw->priv->core->get ("videooutput-core"));
     videooutput_core->get_videooutput_stats(videooutput_stats);
   
     msg = g_strdup_printf (_("A:%.1f/%.1f   V:%.1f/%.1f   FPS:%d/%d"), 
-                           mw->current_call->get_transmitted_audio_bandwidth (),
-                           mw->current_call->get_received_audio_bandwidth (),
-                           mw->current_call->get_transmitted_video_bandwidth (),
-                           mw->current_call->get_received_video_bandwidth (),
+                           mw->priv->current_call->get_transmitted_audio_bandwidth (),
+                           mw->priv->current_call->get_received_audio_bandwidth (),
+                           mw->priv->current_call->get_transmitted_video_bandwidth (),
+                           mw->priv->current_call->get_received_video_bandwidth (),
                            videooutput_stats.tx_fps,
                            videooutput_stats.rx_fps);
-    gm_main_window_flash_message (GTK_WIDGET (self), msg);
-    gm_main_window_set_call_duration (GTK_WIDGET (self), mw->current_call->get_duration ().c_str ());
+    ekiga_main_window_flash_message (mw, msg);
+    ekiga_main_window_set_call_duration (mw, mw->priv->current_call->get_duration ().c_str ());
     g_free (msg);
 
-    unsigned int jitter = mw->current_call->get_jitter_size ();
-    double lost = mw->current_call->get_lost_packets ();
-    double late = mw->current_call->get_late_packets ();
-    double out_of_order = mw->current_call->get_out_of_order_packets ();
-
-    gm_main_window_update_stats (GTK_WIDGET (self), lost, late, out_of_order, jitter, 
-                                 0, 0, 0, 0,
-                                 videooutput_stats.rx_width,
-                                 videooutput_stats.rx_height,
-                                 videooutput_stats.tx_width,
-                                 videooutput_stats.tx_height);
+    unsigned int jitter = mw->priv->current_call->get_jitter_size ();
+    double lost = mw->priv->current_call->get_lost_packets ();
+    double late = mw->priv->current_call->get_late_packets ();
+    double out_of_order = mw->priv->current_call->get_out_of_order_packets ();
+
+    ekiga_main_window_update_stats (mw, lost, late, out_of_order, jitter, 
+                                    videooutput_stats.rx_width,
+                                    videooutput_stats.rx_height,
+                                    videooutput_stats.tx_width,
+                                    videooutput_stats.tx_height);
   }
   return true;
 }
 
 static gboolean on_signal_level_refresh_cb (gpointer self) 
 {
-  GmMainWindow *mw = gm_mw_get_mw (GTK_WIDGET (self));
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (self);
 
-  Ekiga::AudioInputCore *audioinput_core = dynamic_cast<Ekiga::AudioInputCore *> (mw->core.get ("audioinput-core"));
-  Ekiga::AudioOutputCore *audiooutput_core = dynamic_cast<Ekiga::AudioOutputCore *> (mw->core.get ("audiooutput-core"));
+  Ekiga::AudioInputCore *audioinput_core = dynamic_cast<Ekiga::AudioInputCore *> (mw->priv->core->get ("audioinput-core"));
+  Ekiga::AudioOutputCore *audiooutput_core = dynamic_cast<Ekiga::AudioOutputCore *> (mw->priv->core->get ("audiooutput-core"));
 
-  gtk_levelmeter_set_level (GTK_LEVELMETER (mw->output_signal), audiooutput_core->get_average_level());
-  gtk_levelmeter_set_level (GTK_LEVELMETER (mw->input_signal), audioinput_core->get_average_level());
+  gtk_levelmeter_set_level (GTK_LEVELMETER (mw->priv->output_signal), audiooutput_core->get_average_level());
+  gtk_levelmeter_set_level (GTK_LEVELMETER (mw->priv->input_signal), audioinput_core->get_average_level());
   return true;
 }
 
@@ -711,27 +627,27 @@
                                     Ekiga::Call & call,
                                     gpointer self)
 {
-  GmMainWindow *mw = gm_mw_get_mw (GTK_WIDGET (self));
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (self);
   gchar* info = NULL;
 
   info = g_strdup_printf (_("Connected with %s"),
 			  call.get_remote_party_name ().c_str ());
 
   if (!call.get_remote_uri ().empty ())
-    gm_main_window_set_call_url (GTK_WIDGET (self), call.get_remote_uri ().c_str());
+    ekiga_main_window_set_call_url (mw, call.get_remote_uri ().c_str());
   if (gm_conf_get_bool (VIDEO_DISPLAY_KEY "stay_on_top"))
-    gm_main_window_set_stay_on_top (GTK_WIDGET (self), TRUE);
-  gm_main_window_set_status (GTK_WIDGET (self), info);
-  gm_main_window_flash_message (GTK_WIDGET (self), "%s", info);
+    ekiga_main_window_set_stay_on_top (mw, TRUE);
+  ekiga_main_window_set_status (mw, info);
+  ekiga_main_window_flash_message (mw, "%s", info);
   if (!gm_conf_get_bool (USER_INTERFACE_KEY "main_window/show_call_panel"))
-    gm_main_window_show_call_panel (GTK_WIDGET (self));
-  gm_main_window_update_calling_state (GTK_WIDGET (self), Connected);
+    ekiga_main_window_show_call_panel (mw);
+  ekiga_main_window_update_calling_state (mw, Connected);
 
-  mw->current_call = &call;
+  mw->priv->current_call = &call;
 
-  mw->timeout_id = g_timeout_add (1000, on_stats_refresh_cb, self);
+  mw->priv->timeout_id = g_timeout_add (1000, on_stats_refresh_cb, self);
 
-  Ekiga::AudioOutputCore *audiooutput_core = dynamic_cast<Ekiga::AudioOutputCore *> (mw->core.get ("audiooutput-core"));
+  Ekiga::AudioOutputCore *audiooutput_core = dynamic_cast<Ekiga::AudioOutputCore *> (mw->priv->core->get ("audiooutput-core"));
 
   audiooutput_core->stop_play_event("incoming_call_sound");
   audiooutput_core->stop_play_event("ring_tone_sound");
@@ -745,45 +661,41 @@
                                 std::string reason, 
                                 gpointer self)
 {
-  GmMainWindow *mw = gm_mw_get_mw (GTK_WIDGET (self));
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (self);
 
   if (gm_conf_get_bool (VIDEO_DISPLAY_KEY "stay_on_top"))
-    gm_main_window_set_stay_on_top (GTK_WIDGET (self), FALSE);
-  gm_main_window_update_calling_state (GTK_WIDGET (self), Standby);
-  gm_main_window_set_status (GTK_WIDGET (self), _("Standby"));
-  gm_main_window_set_call_duration (GTK_WIDGET (self), NULL);
-  gm_main_window_set_call_info (GTK_WIDGET (self), NULL, NULL, NULL, NULL);
+    ekiga_main_window_set_stay_on_top (mw, FALSE);
+  ekiga_main_window_update_calling_state (mw, Standby);
+  ekiga_main_window_set_status (mw, _("Standby"));
+  ekiga_main_window_set_call_duration (mw, NULL);
+  ekiga_main_window_set_call_info (mw, NULL, NULL, NULL, NULL);
   if (!gm_conf_get_bool (USER_INTERFACE_KEY "main_window/show_call_panel"))
-    gm_main_window_hide_call_panel (GTK_WIDGET (self));
-  gm_main_window_clear_stats (GTK_WIDGET (self));
-  gm_main_window_update_logo_have_window (GTK_WIDGET (self));
-  gm_main_window_push_message (GTK_WIDGET (self), "%s", reason.c_str ());
-
-  if (mw->current_call && mw->current_call->get_id () == call.get_id ()) {
-
-    mw->current_call = NULL;
-    g_source_remove (mw->timeout_id);
-    mw->timeout_id = -1;
+    ekiga_main_window_hide_call_panel (mw);
+  ekiga_main_window_clear_stats (mw);
+  ekiga_main_window_update_logo_have_window (mw);
+  ekiga_main_window_push_message (mw, "%s", reason.c_str ());
+
+  if (mw->priv->current_call && mw->priv->current_call->get_id () == call.get_id ()) {
+
+    mw->priv->current_call = NULL;
+    g_source_remove (mw->priv->timeout_id);
+    mw->priv->timeout_id = -1;
   }
-  Ekiga::AudioOutputCore *audiooutput_core = dynamic_cast<Ekiga::AudioOutputCore *> (mw->core.get ("audiooutput-core"));
+  Ekiga::AudioOutputCore *audiooutput_core = dynamic_cast<Ekiga::AudioOutputCore *> (mw->priv->core->get ("audiooutput-core"));
 
   audiooutput_core->stop_play_event("incoming_call_sound");
   audiooutput_core->stop_play_event("ring_tone_sound");
 
-  gm_main_window_clear_signal_levels(GTK_WIDGET (self));
+  ekiga_main_window_clear_signal_levels (mw);
 }
 
 
 static void on_cleared_incoming_call_cb (std::string /*reason*/,
                                          gpointer self)
 {
-  GmMainWindow *mw = NULL;
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (GnomeMeeting::Process ()->GetMainWindow ());
 
-  GtkWidget *main_window = NULL;
-  
-  main_window = GnomeMeeting::Process ()->GetMainWindow ();
-  mw = gm_mw_get_mw (main_window);
-  Ekiga::AudioOutputCore *audiooutput_core = dynamic_cast<Ekiga::AudioOutputCore *> (mw->core.get ("audiooutput-core"));
+  Ekiga::AudioOutputCore *audiooutput_core = dynamic_cast<Ekiga::AudioOutputCore *> (mw->priv->core->get ("audiooutput-core"));
   audiooutput_core->stop_play_event("incoming_call_sound");
   audiooutput_core->stop_play_event("ring_tone_sound");
 
@@ -805,20 +717,14 @@
 }
 
 
-void gm_main_window_add_device_dialog_show (GtkWidget *main_window,
-                                            const Ekiga::Device & device,
-                                            DeviceType deviceType);
-
 static void on_held_call_cb (Ekiga::CallManager & /*manager*/,
                              Ekiga::Call & /*call*/,
                              gpointer self)
 {
-  gchar *info_string = NULL;
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (self);
 
-  gm_main_window_set_call_hold (GTK_WIDGET (self), true);
-  info_string = g_strdup (_("Call on hold"));
-  gm_main_window_flash_message (GTK_WIDGET (self), "%s", info_string);
-  g_free (info_string);
+  ekiga_main_window_set_call_hold (mw, true);
+  ekiga_main_window_flash_message (mw, "%s", _("Call on hold"));
 }
 
 
@@ -826,12 +732,10 @@
                                   Ekiga::Call & /*call*/,
                                   gpointer self)
 {
-  gchar *info_string = NULL;
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (self);
 
-  gm_main_window_set_call_hold (GTK_WIDGET (self), false);
-  info_string = g_strdup (_("Call retrieved"));
-  gm_main_window_flash_message (GTK_WIDGET (self), "%s", info_string);
-  g_free (info_string);
+  ekiga_main_window_set_call_hold (mw, false);
+  ekiga_main_window_flash_message (mw, "%s", _("Call retrieved"));
 }
 
 
@@ -839,16 +743,16 @@
                                Ekiga::Call & call,
                                gpointer self)
 {
-  GmMainWindow *mw = gm_mw_get_mw (GTK_WIDGET (self));
-  Ekiga::AudioOutputCore *audiooutput_core = dynamic_cast<Ekiga::AudioOutputCore *> (mw->core.get ("audiooutput-core"));
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (self);
+  Ekiga::AudioOutputCore *audiooutput_core = dynamic_cast<Ekiga::AudioOutputCore *> (mw->priv->core->get ("audiooutput-core"));
 
-  audiooutput_core->stop_play_event("incoming_call_sound");
-  audiooutput_core->stop_play_event("ring_tone_sound");
+  audiooutput_core->stop_play_event ("incoming_call_sound");
+  audiooutput_core->stop_play_event ("ring_tone_sound");
 
   gchar* info = NULL;
   info = g_strdup_printf (_("Missed call from %s"),
 			  call.get_remote_party_name ().c_str ());
-  gm_main_window_push_message (GTK_WIDGET (self), "%s", info);
+  ekiga_main_window_push_message (mw, "%s", info);
   g_free (info);
 }
 
@@ -860,11 +764,7 @@
                                  bool is_transmitting,
                                  gpointer self)
 {
-  GmMainWindow *mw = NULL;
-
-  g_return_if_fail (GTK_WIDGET (self) != NULL);
-  mw = gm_mw_get_mw (GTK_WIDGET (self));
-  g_return_if_fail (mw != NULL);
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (self);
 
   bool is_closing = false;
   bool is_encoding = is_transmitting;
@@ -872,37 +772,37 @@
 
   /* FIXME: This should not be needed anymore */
   if (type == Ekiga::Call::Video) {
-    
+
     is_closing ?
-      (is_encoding ? mw->video_transmission_active = false : mw->video_reception_active = false)
-      :(is_encoding ? mw->video_transmission_active = true : mw->video_reception_active = true);
+      (is_encoding ? mw->priv->video_transmission_active = false : mw->priv->video_reception_active = false)
+      :(is_encoding ? mw->priv->video_transmission_active = true : mw->priv->video_reception_active = true);
 
     if (is_encoding)
-      is_closing ? mw->transmitted_video_codec = "" : mw->transmitted_video_codec = name;
+      is_closing ? mw->priv->transmitted_video_codec = "" : mw->priv->transmitted_video_codec = name;
     else
-      is_closing ? mw->received_video_codec = "" : mw->received_video_codec = name;
+      is_closing ? mw->priv->received_video_codec = "" : mw->priv->received_video_codec = name;
   }
   else {
     
     is_closing ?
-      (is_encoding ? mw->audio_transmission_active = false : mw->audio_reception_active = false)
-      :(is_encoding ? mw->audio_transmission_active = true : mw->audio_reception_active = true);
+      (is_encoding ? mw->priv->audio_transmission_active = false : mw->priv->audio_reception_active = false)
+      :(is_encoding ? mw->priv->audio_transmission_active = true : mw->priv->audio_reception_active = true);
 
     if (is_encoding)
-      is_closing ? mw->transmitted_audio_codec = "" : mw->transmitted_audio_codec = name;
+      is_closing ? mw->priv->transmitted_audio_codec = "" : mw->priv->transmitted_audio_codec = name;
     else
-      is_closing ? mw->received_audio_codec = "" : mw->received_audio_codec = name;
+      is_closing ? mw->priv->received_audio_codec = "" : mw->priv->received_audio_codec = name;
   }
 
-  gm_main_window_update_sensitivity (GTK_WIDGET (self),
-                                     is_video,
-                                     is_video ? mw->video_reception_active : mw->audio_reception_active,
-                                     is_video ? mw->video_transmission_active : mw->audio_transmission_active);
-  gm_main_window_set_call_info (GTK_WIDGET (self), 
-                                mw->transmitted_audio_codec.c_str (), 
-                                mw->received_audio_codec.c_str (),
-                                mw->transmitted_video_codec.c_str (), 
-                                mw->received_audio_codec.c_str ());
+  ekiga_main_window_update_sensitivity (mw,
+                                        is_video,
+                                        is_video ? mw->priv->video_reception_active : mw->priv->audio_reception_active,
+                                        is_video ? mw->priv->video_transmission_active : mw->priv->audio_transmission_active);
+  ekiga_main_window_set_call_info (mw, 
+                                   mw->priv->transmitted_audio_codec.c_str (), 
+                                   mw->priv->received_audio_codec.c_str (),
+                                   mw->priv->transmitted_video_codec.c_str (), 
+                                   mw->priv->received_audio_codec.c_str ());
 }
 
 
@@ -913,11 +813,7 @@
                                  bool is_transmitting,
                                  gpointer self)
 {
-  GmMainWindow *mw = NULL;
-
-  g_return_if_fail (GTK_WIDGET (self) != NULL);
-  mw = gm_mw_get_mw (GTK_WIDGET (self));
-  g_return_if_fail (mw != NULL);
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (self);
 
   bool is_closing = true;
   bool is_encoding = is_transmitting;
@@ -927,35 +823,35 @@
   if (type == Ekiga::Call::Video) {
     
     is_closing ?
-      (is_encoding ? mw->video_transmission_active = false : mw->video_reception_active = false)
-      :(is_encoding ? mw->video_transmission_active = true : mw->video_reception_active = true);
+      (is_encoding ? mw->priv->video_transmission_active = false : mw->priv->video_reception_active = false)
+      :(is_encoding ? mw->priv->video_transmission_active = true : mw->priv->video_reception_active = true);
 
     if (is_encoding)
-      is_closing ? mw->transmitted_video_codec = "" : mw->transmitted_video_codec = name;
+      is_closing ? mw->priv->transmitted_video_codec = "" : mw->priv->transmitted_video_codec = name;
     else
-      is_closing ? mw->received_video_codec = "" : mw->received_video_codec = name;
+      is_closing ? mw->priv->received_video_codec = "" : mw->priv->received_video_codec = name;
   }
   else {
     
     is_closing ?
-      (is_encoding ? mw->audio_transmission_active = false : mw->audio_reception_active = false)
-      :(is_encoding ? mw->audio_transmission_active = true : mw->audio_reception_active = true);
+      (is_encoding ? mw->priv->audio_transmission_active = false : mw->priv->audio_reception_active = false)
+      :(is_encoding ? mw->priv->audio_transmission_active = true : mw->priv->audio_reception_active = true);
 
     if (is_encoding)
-      is_closing ? mw->transmitted_audio_codec = "" : mw->transmitted_audio_codec = name;
+      is_closing ? mw->priv->transmitted_audio_codec = "" : mw->priv->transmitted_audio_codec = name;
     else
-      is_closing ? mw->received_audio_codec = "" : mw->received_audio_codec = name;
+      is_closing ? mw->priv->received_audio_codec = "" : mw->priv->received_audio_codec = name;
   }
 
-  gm_main_window_update_sensitivity (GTK_WIDGET (self),
-                                     is_video,
-                                     is_video ? mw->video_reception_active : mw->audio_reception_active,
-                                     is_video ? mw->video_transmission_active : mw->audio_transmission_active);
-  gm_main_window_set_call_info (GTK_WIDGET (self), 
-                                mw->transmitted_audio_codec.c_str (), 
-                                mw->received_audio_codec.c_str (),
-                                mw->transmitted_video_codec.c_str (), 
-                                mw->received_audio_codec.c_str ());
+  ekiga_main_window_update_sensitivity (mw,
+                                        is_video,
+                                        is_video ? mw->priv->video_reception_active : mw->priv->audio_reception_active,
+                                        is_video ? mw->priv->video_transmission_active : mw->priv->audio_transmission_active);
+  ekiga_main_window_set_call_info (mw, 
+                                   mw->priv->transmitted_audio_codec.c_str (), 
+                                   mw->priv->received_audio_codec.c_str (),
+                                   mw->priv->transmitted_video_codec.c_str (), 
+                                   mw->priv->received_audio_codec.c_str ());
 }
 
 
@@ -965,7 +861,7 @@
                                  Ekiga::Call::StreamType type,
                                  gpointer self)
 {
-  gm_main_window_set_channel_pause (GTK_WIDGET (self), true, (type == Ekiga::Call::Video));
+  ekiga_main_window_set_channel_pause (EKIGA_MAIN_WINDOW (self), true, (type == Ekiga::Call::Video));
 }
 
 
@@ -975,7 +871,7 @@
                                   Ekiga::Call::StreamType type,
                                   gpointer self)
 {
-  gm_main_window_set_channel_pause (GTK_WIDGET (self), false, (type == Ekiga::Call::Video));
+  ekiga_main_window_set_channel_pause (EKIGA_MAIN_WINDOW (self), false, (type == Ekiga::Call::Video));
 }
 
 
@@ -1007,7 +903,7 @@
  * Display Engine Callbacks 
  */
 
-void 
+static void 
 on_videooutput_device_opened_cb (Ekiga::VideoOutputManager & /* manager */, 
                                  Ekiga::VideoOutputAccel /* accel */, 
                                  Ekiga::VideoOutputMode mode, 
@@ -1015,38 +911,38 @@
                                  bool both_streams,
                                  gpointer self)
 {
-  GmMainWindow *mw = gm_mw_get_mw (GTK_WIDGET (self));
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (self);
 
   if (both_streams) {
-       gtk_menu_section_set_sensitive (mw->main_menu, "local_video", TRUE);
-       gtk_menu_section_set_sensitive (mw->main_menu, "fullscreen", TRUE);
+       gtk_menu_section_set_sensitive (mw->priv->main_menu, "local_video", TRUE);
+       gtk_menu_section_set_sensitive (mw->priv->main_menu, "fullscreen", TRUE);
   } 
   else {
 
     if (mode == Ekiga::VO_MODE_LOCAL)
-      gtk_menu_set_sensitive (mw->main_menu, "local_video", TRUE);
+      gtk_menu_set_sensitive (mw->priv->main_menu, "local_video", TRUE);
 
     if (mode == Ekiga::VO_MODE_REMOTE)
-       gtk_menu_set_sensitive (mw->main_menu, "remote_video", TRUE);
+       gtk_menu_set_sensitive (mw->priv->main_menu, "remote_video", TRUE);
   }
 
-  gtk_radio_menu_select_with_id (mw->main_menu, "local_video", mode);
+  gtk_radio_menu_select_with_id (mw->priv->main_menu, "local_video", mode);
 
-  gtk_menu_set_sensitive (mw->main_menu, "zoom_in", (zoom == 200) ? FALSE : TRUE);
-  gtk_menu_set_sensitive (mw->main_menu, "zoom_out", (zoom == 50) ? FALSE : TRUE);
-  gtk_menu_set_sensitive (mw->main_menu, "normal_size", (zoom == 100) ? FALSE : TRUE);
+  gtk_menu_set_sensitive (mw->priv->main_menu, "zoom_in", zoom != 200);
+  gtk_menu_set_sensitive (mw->priv->main_menu, "zoom_out", zoom != 50);
+  gtk_menu_set_sensitive (mw->priv->main_menu, "normal_size", zoom != 100);
 }
 
 void 
 on_videooutput_device_closed_cb (Ekiga::VideoOutputManager & /* manager */, gpointer self)
 {
-  GmMainWindow *mw = gm_mw_get_mw (GTK_WIDGET (self));
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (self);
 
-  gtk_menu_section_set_sensitive (mw->main_menu, "local_video", FALSE);
+  gtk_menu_section_set_sensitive (mw->priv->main_menu, "local_video", FALSE);
 
-  gtk_menu_section_set_sensitive (mw->main_menu, "fullscreen", TRUE);
+  gtk_menu_section_set_sensitive (mw->priv->main_menu, "fullscreen", TRUE);
 
-  gtk_menu_section_set_sensitive (mw->main_menu, "zoom_in", FALSE);
+  gtk_menu_section_set_sensitive (mw->priv->main_menu, "zoom_in", FALSE);
 }
 
 
@@ -1059,22 +955,22 @@
 void 
 on_size_changed_cb (Ekiga::VideoOutputManager & /* manager */, unsigned width, unsigned height,  gpointer self)
 {
-  GmMainWindow *mw = gm_mw_get_mw (GTK_WIDGET (self));
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (self);
   GtkRequisition req;
   int x, y;
 
-  gtk_widget_size_request (GTK_WIDGET (mw->main_video_image), &req);
-  gtk_window_get_size (GTK_WINDOW (self), &x, &y);
-  gtk_widget_set_size_request (GTK_WIDGET (mw->main_video_image), width, height);
-  gtk_window_resize (GTK_WINDOW (self), width, height);
+  gtk_widget_size_request (mw->priv->main_video_image, &req);
+  gtk_window_get_size (GTK_WINDOW (mw), &x, &y);
+  gtk_widget_set_size_request (mw->priv->main_video_image, width, height);
+  gtk_window_resize (GTK_WINDOW (mw), 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;
+  rect.x = mw->priv->main_video_image->allocation.x;
+  rect.y = mw->priv->main_video_image->allocation.y;
+  rect.width = mw->priv->main_video_image->allocation.width;
+  rect.height = mw->priv->main_video_image->allocation.height;
 
-  gdk_window_invalidate_rect (GDK_WINDOW (GTK_WIDGET (self)->window), &rect , TRUE);
+  gdk_window_invalidate_rect (GTK_WIDGET (mw)->window, &rect, TRUE);
 }
 
 void
@@ -1083,68 +979,53 @@
                                 Ekiga::VideoInputSettings & settings,
                                 gpointer self)
 {
-  GmMainWindow *mw = NULL;
-  g_return_if_fail (self != NULL);
-  mw = gm_mw_get_mw (GTK_WIDGET (self));
-  g_return_if_fail (mw != NULL);
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (self);
 
-  gtk_widget_set_sensitive (GTK_WIDGET (mw->video_settings_frame),  settings.modifyable ? TRUE : FALSE);
-  gtk_widget_set_sensitive (GTK_WIDGET (mw->video_settings_button),  settings.modifyable ? TRUE : FALSE);
-  GTK_ADJUSTMENT (mw->adj_whiteness)->value = settings.whiteness;
-  GTK_ADJUSTMENT (mw->adj_brightness)->value = settings.brightness;
-  GTK_ADJUSTMENT (mw->adj_colour)->value = settings.colour;
-  GTK_ADJUSTMENT (mw->adj_contrast)->value = settings.contrast;
+  gtk_widget_set_sensitive (mw->priv->video_settings_frame,  settings.modifyable ? TRUE : FALSE);
+  gtk_widget_set_sensitive (mw->priv->video_settings_button,  settings.modifyable ? TRUE : FALSE);
+  GTK_ADJUSTMENT (mw->priv->adj_whiteness)->value = settings.whiteness;
+  GTK_ADJUSTMENT (mw->priv->adj_brightness)->value = settings.brightness;
+  GTK_ADJUSTMENT (mw->priv->adj_colour)->value = settings.colour;
+  GTK_ADJUSTMENT (mw->priv->adj_contrast)->value = settings.contrast;
 
-  gtk_widget_queue_draw (GTK_WIDGET (mw->video_settings_frame));
+  gtk_widget_queue_draw (mw->priv->video_settings_frame);
 }
 
 
-
 void 
 on_videoinput_device_closed_cb (Ekiga::VideoInputManager & /* manager */, Ekiga::VideoInputDevice & /*device*/, gpointer self)
 {
-  GmMainWindow *mw = NULL;
-  g_return_if_fail (self != NULL);
-  mw = gm_mw_get_mw (GTK_WIDGET (self));
-  g_return_if_fail (mw != NULL);
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (self);
 
-  gm_main_window_update_sensitivity (GTK_WIDGET (self), TRUE, FALSE, FALSE);
-  gm_main_window_update_logo_have_window (GTK_WIDGET (self));
+  ekiga_main_window_update_sensitivity (mw, TRUE, FALSE, FALSE);
+  ekiga_main_window_update_logo_have_window (mw);
 
-  gtk_widget_set_sensitive (GTK_WIDGET (mw->video_settings_button),  FALSE);
+  gtk_widget_set_sensitive (mw->priv->video_settings_button,  FALSE);
 }
 
+
 void 
-on_videoinput_device_added_cb (const Ekiga::VideoInputDevice & device, bool isDesired, gpointer self)
+on_videoinput_device_added_cb (const Ekiga::VideoInputDevice & device, bool is_desired, gpointer self)
 {
-  GmMainWindow *mw = NULL;
-  g_return_if_fail (self != NULL);
-  mw = gm_mw_get_mw (GTK_WIDGET (self));
-  g_return_if_fail (mw != NULL);
-  gchar* message = NULL;
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (self);
+  gchar *message;
 
   /* Translators: This is a hotplug status */
   message = g_strdup_printf (_("Added video input device %s"),
 			       device.GetString().c_str ());
-  gm_main_window_flash_message (GTK_WIDGET (self), "%s", message);
+  ekiga_main_window_flash_message (mw, "%s", message);
   g_free (message);
-  if (!isDesired && mw->calling_state == Standby && !mw->current_call) 
-    gm_main_window_add_device_dialog_show (GTK_WIDGET (self), device, VideoInput);
+  if (!is_desired && mw->priv->calling_state == Standby && !mw->priv->current_call) 
+    ekiga_main_window_add_device_dialog_show (mw, device, VideoInput);
 }
 
 void 
 on_videoinput_device_removed_cb (const Ekiga::VideoInputDevice & device, bool, gpointer self)
 {
-  GmMainWindow *mw = NULL;
-  g_return_if_fail (self != NULL);
-  mw = gm_mw_get_mw (GTK_WIDGET (self));
-  g_return_if_fail (mw != NULL);
-  gchar* message = NULL;
-
   /* Translators: This is a hotplug status */
-  message = g_strdup_printf (_("Removed video input device %s"),
-			     device.GetString().c_str ());
-  gm_main_window_flash_message (GTK_WIDGET (self), "%s", message);
+  gchar *message = g_strdup_printf (_("Removed video input device %s"),
+				    device.GetString().c_str ());
+  ekiga_main_window_flash_message (EKIGA_MAIN_WINDOW (self), "%s", message);
   g_free (message);
 }
 
@@ -1210,16 +1091,13 @@
                                 Ekiga::AudioInputSettings & settings,
                                 gpointer self)
 {
-  GmMainWindow *mw = NULL;
-  g_return_if_fail (self != NULL);
-  mw = gm_mw_get_mw (GTK_WIDGET (self));
-  g_return_if_fail (mw != NULL);
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (self);
 
-  gtk_widget_set_sensitive (GTK_WIDGET (mw->audio_input_volume_frame), settings.modifyable ? TRUE : FALSE);
-  gtk_widget_set_sensitive (GTK_WIDGET (mw->audio_settings_button), settings.modifyable ? TRUE : FALSE);
-  GTK_ADJUSTMENT (mw->adj_input_volume)->value = settings.volume;
+  gtk_widget_set_sensitive (mw->priv->audio_input_volume_frame, settings.modifyable);
+  gtk_widget_set_sensitive (mw->priv->audio_settings_button, settings.modifyable);
+  GTK_ADJUSTMENT (mw->priv->adj_input_volume)->value = settings.volume;
   
-  gtk_widget_queue_draw (GTK_WIDGET (mw->audio_input_volume_frame));
+  gtk_widget_queue_draw (mw->priv->audio_input_volume_frame);
 }
 
 
@@ -1229,33 +1107,27 @@
                                 Ekiga::AudioInputDevice & /*device*/, 
                                 gpointer self)
 {
-  GmMainWindow *mw = NULL;
-  g_return_if_fail (self != NULL);
-  mw = gm_mw_get_mw (GTK_WIDGET (self));
-  g_return_if_fail (mw != NULL);
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (self);
 
-  gtk_widget_set_sensitive (GTK_WIDGET (mw->audio_settings_button), FALSE);
-  gtk_widget_set_sensitive (GTK_WIDGET (mw->audio_input_volume_frame), FALSE);
+  gtk_widget_set_sensitive (mw->priv->audio_settings_button, FALSE);
+  gtk_widget_set_sensitive (mw->priv->audio_input_volume_frame, FALSE);
 }
 
 void 
 on_audioinput_device_added_cb (const Ekiga::AudioInputDevice & device, 
-                               bool isDesired,
+                               bool is_desired,
                                gpointer self)
 {
-  GmMainWindow *mw = NULL;
-  g_return_if_fail (self != NULL);
-  mw = gm_mw_get_mw (GTK_WIDGET (self));
-  g_return_if_fail (mw != NULL);
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (self);
   gchar* message = NULL;
 
   /* Translators: This is a hotplug status */
   message = g_strdup_printf (_("Added audio input device %s"),
 			     device.GetString().c_str ());
-  gm_main_window_flash_message (GTK_WIDGET (self), "%s", message);
+  ekiga_main_window_flash_message (mw, "%s", message);
   g_free (message);
-  if (!isDesired  && mw->calling_state == Standby && !mw->current_call)
-    gm_main_window_add_device_dialog_show (GTK_WIDGET (self), device,  AudioInput);
+  if (!is_desired  && mw->priv->calling_state == Standby && !mw->priv->current_call)
+    ekiga_main_window_add_device_dialog_show (mw, device,  AudioInput);
     
 }
 
@@ -1264,16 +1136,12 @@
                                  bool,
                                  gpointer self)
 {
-  GmMainWindow *mw = NULL;
-  g_return_if_fail (self != NULL);
-  mw = gm_mw_get_mw (GTK_WIDGET (self));
-  g_return_if_fail (mw != NULL);
   gchar* message = NULL;
 
   /* Translators: This is a hotplug status */
   message = g_strdup_printf (_("Removed audio input device %s"),
 			     device.GetString().c_str ());
-  gm_main_window_flash_message (GTK_WIDGET (self), "%s", message);
+  ekiga_main_window_flash_message (EKIGA_MAIN_WINDOW (self), "%s", message);
   g_free (message);
 }
 
@@ -1310,7 +1178,7 @@
       break;
   }
 
-  gnomemeeting_warning_dialog_on_widget (GTK_WINDOW (GTK_WIDGET (self)),
+  gnomemeeting_warning_dialog_on_widget (GTK_WINDOW (self),
                                          "show_device_warnings",
                                          dialog_title,
                                          "%s", dialog_msg);
@@ -1327,19 +1195,16 @@
                                  Ekiga::AudioOutputSettings & settings,
                                  gpointer self)
 {
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (self);
+
   if (ps == Ekiga::secondary)
     return;
 
-  GmMainWindow *mw = NULL;
-  g_return_if_fail (self != NULL);
-  mw = gm_mw_get_mw (GTK_WIDGET (self));
-  g_return_if_fail (mw != NULL);
-
-  gtk_widget_set_sensitive (GTK_WIDGET (mw->audio_settings_button), settings.modifyable ? TRUE : FALSE);
-  gtk_widget_set_sensitive (GTK_WIDGET (mw->audio_output_volume_frame), settings.modifyable ? TRUE : FALSE);
-  GTK_ADJUSTMENT (mw->adj_output_volume)->value = settings.volume;
+  gtk_widget_set_sensitive (mw->priv->audio_settings_button, settings.modifyable);
+  gtk_widget_set_sensitive (mw->priv->audio_output_volume_frame, settings.modifyable);
+  GTK_ADJUSTMENT (mw->priv->adj_output_volume)->value = settings.volume;
 
-  gtk_widget_queue_draw (GTK_WIDGET (mw->audio_output_volume_frame));
+  gtk_widget_queue_draw (mw->priv->audio_output_volume_frame);
 }
 
 
@@ -1350,34 +1215,32 @@
                                  Ekiga::AudioOutputDevice & /*device*/, 
                                  gpointer self)
 {
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (self);
+
   if (ps == Ekiga::secondary)
     return;
 
-  GmMainWindow *mw = NULL;
-  g_return_if_fail (self != NULL);
-  mw = gm_mw_get_mw (GTK_WIDGET (self));
-  g_return_if_fail (mw != NULL);
-
-  gtk_widget_set_sensitive (GTK_WIDGET (mw->audio_settings_button), FALSE);
-  gtk_widget_set_sensitive (GTK_WIDGET (mw->audio_output_volume_frame), FALSE);
+  gtk_widget_set_sensitive (mw->priv->audio_settings_button, FALSE);
+  gtk_widget_set_sensitive (mw->priv->audio_output_volume_frame, FALSE);
 }
 
 void 
 on_audiooutput_device_added_cb (const Ekiga::AudioOutputDevice & device, 
-                                bool isDesired,
+                                bool is_desired,
                                 gpointer self)
 {
-  GmMainWindow *mw = NULL;
-  g_return_if_fail (self != NULL);
-  mw = gm_mw_get_mw (GTK_WIDGET (self));
-  g_return_if_fail (mw != NULL);
-  gchar* message = NULL;
+  EkigaMainWindow *mw;
+  gchar *message;
+
+  g_return_if_fail (EKIGA_IS_MAIN_WINDOW (self));
+
+  mw = EKIGA_MAIN_WINDOW (self);
 
   message = g_strdup_printf (_("Added audio output device %s"), device.GetString().c_str ());
-  gm_main_window_flash_message (GTK_WIDGET (self), "%s", message);
+  ekiga_main_window_flash_message (mw, "%s", message);
   g_free (message);
-  if (!isDesired && mw->calling_state == Standby && !mw->current_call)
-    gm_main_window_add_device_dialog_show (GTK_WIDGET (self), device, AudioOutput);
+  if (!is_desired && mw->priv->calling_state == Standby && !mw->priv->current_call)
+    ekiga_main_window_add_device_dialog_show (mw, device, AudioOutput);
 }
 
 void 
@@ -1385,15 +1248,13 @@
                                   bool,
                                   gpointer self)
 {
-  GmMainWindow *mw = NULL;
-  g_return_if_fail (self != NULL);
-  mw = gm_mw_get_mw (GTK_WIDGET (self));
-  g_return_if_fail (mw != NULL);
-  gchar* message = NULL;
+  gchar *message;
+
+  g_return_if_fail (EKIGA_IS_MAIN_WINDOW (self));
 
   message = g_strdup_printf (_("Removed audio output device %s"),
 			     device.GetString().c_str ());
-  gm_main_window_flash_message (GTK_WIDGET (self), "%s", message);
+  ekiga_main_window_flash_message (EKIGA_MAIN_WINDOW (self), "%s", message);
   g_free (message);
 }
 
@@ -1444,30 +1305,6 @@
 
 /* Implementation */
 static void
-gm_mw_destroy (gpointer m)
-{
-  GmMainWindow *mw = GM_MAIN_WINDOW (m);
-
-  g_return_if_fail (mw != NULL);
-
-  gtk_widget_destroy (mw->audio_settings_window);
-  gtk_widget_destroy (mw->video_settings_window);
-
-  delete ((GmMainWindow *) mw);
-}
-
-
-static GmMainWindow *
-gm_mw_get_mw (GtkWidget *main_window)
-{
-  g_return_val_if_fail (main_window != NULL, NULL);
-
-  return GM_MAIN_WINDOW (g_object_get_data (G_OBJECT (main_window), 
-					    "GMObject"));
-}
-
-
-static void
 incoming_call_response_cb (GtkDialog *incoming_call_popup,
                            gint response,
                            gpointer data)
@@ -1523,33 +1360,34 @@
                gpointer data)
 {
   std::string uri;
-
   Ekiga::CallCore *call_core = NULL;
-  GmMainWindow *mw = NULL;
+  EkigaMainWindow *mw = NULL;
 
-  mw = gm_mw_get_mw (GTK_WIDGET (data));
+  g_return_if_fail (EKIGA_IS_MAIN_WINDOW (data));
 
-  if (mw->calling_state == Standby && !mw->current_call) {
+  mw = EKIGA_MAIN_WINDOW (data);
+
+  if (mw->priv->calling_state == Standby && !mw->priv->current_call) {
 
     size_t pos;
 
-    gm_main_window_update_calling_state (GTK_WIDGET (data), Calling);
-    call_core = dynamic_cast<Ekiga::CallCore*> (mw->core.get ("call-core"));
-    uri = gm_main_window_get_call_url (GTK_WIDGET (data));
+    ekiga_main_window_update_calling_state (mw, Calling);
+    call_core = dynamic_cast<Ekiga::CallCore*> (mw->priv->core->get ("call-core"));
+    uri = ekiga_main_window_get_call_url (mw);
     if (call_core->dial (uri)) {
 
       pos = uri.find ("@");
       if (pos != std::string::npos) {
 
         std::string host = uri.substr (pos + 1);
-        mw->accounts.remove (host);
-        mw->accounts.push_front (host);
+        mw->priv->accounts.remove (host);
+        mw->priv->accounts.push_front (host);
       }
 
     }
     else {
-      gm_main_window_flash_message (GTK_WIDGET (data), _("Could not connect to remote host"));
-      gm_main_window_update_calling_state (GTK_WIDGET (data), Standby);
+      ekiga_main_window_flash_message (mw, _("Could not connect to remote host"));
+      ekiga_main_window_update_calling_state (mw, Standby);
     }
   }
 }
@@ -1559,14 +1397,12 @@
 hangup_call_cb (GtkWidget * /*widget*/,
                 gpointer data)
 {
-  GmMainWindow *mw = NULL;
-
-  mw = gm_mw_get_mw (GTK_WIDGET (data));
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (data);
 
-  if (mw->current_call) {
+  if (mw->priv->current_call) {
 
-    mw->current_call->hangup ();
-    mw->current_call = NULL;
+    mw->priv->current_call->hangup ();
+    mw->priv->current_call = NULL;
   }
 }
 
@@ -1575,13 +1411,12 @@
 toggle_call_cb (GtkWidget *widget,
                 gpointer data)
 {
-  GmMainWindow *mw = NULL;
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (data);
+  GmConnectButton *button = GM_CONNECT_BUTTON (mw->priv->connect_button);
 
-  mw = gm_mw_get_mw (GTK_WIDGET (data));
-
-  if (mw->current_call && gm_connect_button_get_connected (GM_CONNECT_BUTTON (mw->connect_button)))
+  if (mw->priv->current_call && gm_connect_button_get_connected (button))
     hangup_call_cb (widget, data);
-  else if (!mw->current_call && !gm_connect_button_get_connected (GM_CONNECT_BUTTON (mw->connect_button)))
+  else if (!mw->priv->current_call && !gm_connect_button_get_connected (button))
     place_call_cb (widget, data);
 }
 
@@ -1602,482 +1437,93 @@
     gtk_widget_show (main_window);
 }
 
-static GtkWidget *
-gm_mw_init_uri_toolbar (GtkWidget *main_window)
+	
+static GtkWidget * 
+gm_mw_video_settings_window_new (EkigaMainWindow *mw)
 {
-  GmMainWindow *mw = NULL;
-
-  GtkToolItem *item = NULL;
+  GtkWidget *hbox = NULL;
+  GtkWidget *vbox = NULL;
+  GtkWidget *image = NULL;
+  GtkWidget *window = NULL;
 
-  GtkWidget *toolbar = NULL;
-  GtkEntryCompletion *completion = NULL;
-  
-  g_return_val_if_fail (main_window != NULL, NULL);
-  mw = gm_mw_get_mw (main_window);
-  g_return_val_if_fail (mw != NULL, NULL);
+  GtkWidget *hscale_brightness = NULL;
+  GtkWidget *hscale_colour = NULL;
+  GtkWidget *hscale_contrast = NULL;
+  GtkWidget *hscale_whiteness = NULL;
 
-  
-  /* The main horizontal toolbar */
-  toolbar = gtk_toolbar_new ();
-  gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_ICONS);
-  gtk_toolbar_set_show_arrow (GTK_TOOLBAR (toolbar), FALSE);
+  int brightness = 0, colour = 0, contrast = 0, whiteness = 0;
 
+  /* Build the window */
+  window = gtk_dialog_new ();
+  g_object_set_data_full (G_OBJECT (window), "window_name",
+			  g_strdup ("video_settings_window"), g_free); 
+  gtk_dialog_add_button (GTK_DIALOG (window), 
+                         GTK_STOCK_CLOSE, 
+                         GTK_RESPONSE_CANCEL);
 
-  /* URL bar */
-  /* Entry */
-  item = gtk_tool_item_new ();
-  mw->entry = gtk_entry_new ();
-  mw->completion = gtk_list_store_new (1, G_TYPE_STRING);
-  completion = gtk_entry_completion_new ();
-  gtk_entry_completion_set_model (GTK_ENTRY_COMPLETION (completion), GTK_TREE_MODEL (mw->completion));
-  gtk_entry_set_completion (GTK_ENTRY (mw->entry), completion);
-  gtk_entry_completion_set_inline_completion (GTK_ENTRY_COMPLETION (completion), false);
-  gtk_entry_completion_set_popup_completion (GTK_ENTRY_COMPLETION (completion), true);
-  gtk_entry_completion_set_text_column (GTK_ENTRY_COMPLETION (completion), 0);
+  gtk_window_set_title (GTK_WINDOW (window), 
+                        _("Video Settings"));
 
-  gtk_container_add (GTK_CONTAINER (item), mw->entry);
-  gtk_container_set_border_width (GTK_CONTAINER (item), 0);
-  gtk_tool_item_set_expand (GTK_TOOL_ITEM (item), true);
+  /* Webcam Control Frame, we need it to disable controls */		
+  mw->priv->video_settings_frame = gtk_frame_new (NULL);
+  gtk_frame_set_shadow_type (GTK_FRAME (mw->priv->video_settings_frame), 
+			     GTK_SHADOW_NONE);
+  gtk_container_set_border_width (GTK_CONTAINER (mw->priv->video_settings_frame), 5);
   
-  gtk_entry_set_text (GTK_ENTRY (mw->entry), "sip:");
+  /* Category */
+  vbox = gtk_vbox_new (0, FALSE);
+  gtk_container_add (GTK_CONTAINER (mw->priv->video_settings_frame), vbox);
+  
+  /* Brightness */
+  hbox = gtk_hbox_new (0, FALSE);
+  image = gtk_image_new_from_icon_name (GM_ICON_BRIGHTNESS, GTK_ICON_SIZE_MENU);
+  gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
 
-  // activate Ctrl-L to get the entry focus
-  gtk_widget_add_accelerator (mw->entry, "grab-focus",
-			      mw->accel, GDK_L,
-			      (GdkModifierType) GDK_CONTROL_MASK,
-			      (GtkAccelFlags) 0);
+  mw->priv->adj_brightness = gtk_adjustment_new (brightness, 0.0,
+                                                 255.0, 1.0, 5.0, 1.0);
+  hscale_brightness = gtk_hscale_new (GTK_ADJUSTMENT (mw->priv->adj_brightness));
+  gtk_range_set_update_policy (GTK_RANGE (hscale_brightness),
+			       GTK_UPDATE_DELAYED);
+  gtk_scale_set_draw_value (GTK_SCALE (hscale_brightness), FALSE);
+  gtk_scale_set_value_pos (GTK_SCALE (hscale_brightness), GTK_POS_RIGHT);
+  gtk_box_pack_start (GTK_BOX (hbox), hscale_brightness, TRUE, TRUE, 2);
+  gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 3);
 
-  gtk_editable_set_position (GTK_EDITABLE (GTK_WIDGET (mw->entry)), -1);
+  gtk_widget_set_tooltip_text (hscale_brightness, _("Adjust brightness"));
 
-  g_signal_connect (G_OBJECT (mw->entry), "changed", 
-		    GTK_SIGNAL_FUNC (url_changed_cb), main_window);
-  g_signal_connect (G_OBJECT (mw->entry), "activate", 
-		    GTK_SIGNAL_FUNC (place_call_cb), main_window);
+  g_signal_connect (G_OBJECT (mw->priv->adj_brightness), "value-changed",
+		    G_CALLBACK (video_settings_changed_cb), 
+		    (gpointer) mw);
 
-  gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, 0);
+  /* Whiteness */
+  hbox = gtk_hbox_new (0, FALSE);
+  image = gtk_image_new_from_icon_name (GM_ICON_WHITENESS, GTK_ICON_SIZE_MENU);
+  gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
 
-  /* The connect button */
-  item = gtk_tool_item_new ();
-  mw->connect_button = gm_connect_button_new (GM_STOCK_PHONE_PICK_UP_24,
-					      GM_STOCK_PHONE_HANG_UP_24,
-					      GTK_ICON_SIZE_LARGE_TOOLBAR);
-  gtk_container_add (GTK_CONTAINER (item), mw->connect_button);
-  gtk_container_set_border_width (GTK_CONTAINER (mw->connect_button), 0);
-  gtk_tool_item_set_expand (GTK_TOOL_ITEM (item), FALSE);
+  mw->priv->adj_whiteness = gtk_adjustment_new (whiteness, 0.0, 
+						255.0, 1.0, 5.0, 1.0);
+  hscale_whiteness = gtk_hscale_new (GTK_ADJUSTMENT (mw->priv->adj_whiteness));
+  gtk_range_set_update_policy (GTK_RANGE (hscale_whiteness),
+			       GTK_UPDATE_DELAYED);
+  gtk_scale_set_draw_value (GTK_SCALE (hscale_whiteness), FALSE);
+  gtk_scale_set_value_pos (GTK_SCALE (hscale_whiteness), GTK_POS_RIGHT);
+  gtk_box_pack_start (GTK_BOX (hbox), hscale_whiteness, TRUE, TRUE, 2);
+  gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 3);
 
-  gtk_widget_set_tooltip_text (GTK_WIDGET (mw->connect_button),
-			       _("Enter a URI on the left, and click this button to place a call"));
-  
-  gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
+  gtk_widget_set_tooltip_text (hscale_whiteness, _("Adjust whiteness"));
 
-  g_signal_connect (G_OBJECT (mw->connect_button), "clicked",
-                    G_CALLBACK (toggle_call_cb), 
-                    main_window);
-
-  gtk_widget_show_all (GTK_WIDGET (toolbar));
-  
-  return toolbar;
-}
-
-
-static GtkWidget *
-gm_mw_init_status_toolbar (GtkWidget *main_window)
-{
-  GmMainWindow *mw = NULL;
-
-  GtkWidget *toolbar = NULL;
-  GtkToolItem *item = NULL;
-
-  g_return_val_if_fail (main_window != NULL, NULL);
-  mw = gm_mw_get_mw (main_window);
-  g_return_val_if_fail (mw != NULL, NULL);
-
-  
-  /* The main horizontal toolbar */
-  toolbar = gtk_toolbar_new ();
-  gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_ICONS);
-  gtk_toolbar_set_show_arrow (GTK_TOOLBAR (toolbar), FALSE);
-
-  item = gtk_tool_item_new ();
-  mw->status_option_menu = status_menu_new (); 
-  status_menu_set_parent_window (STATUS_MENU (mw->status_option_menu), 
-                                 GTK_WINDOW (main_window));
-  gtk_container_add (GTK_CONTAINER (item), mw->status_option_menu);
-  gtk_container_set_border_width (GTK_CONTAINER (item), 0);
-  gtk_tool_item_set_expand (GTK_TOOL_ITEM (item), TRUE);
-  
-  gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, 0);
-
-  gtk_widget_show_all (toolbar);
-  
-  return toolbar;
-}
-
-	
-static void
-gm_mw_init_menu (GtkWidget *main_window)
-{
-  GmMainWindow *mw = NULL;
-
-  Ekiga::ServiceCore *services = NULL;
-  Ekiga::Trigger *local_cluster_trigger = NULL;
-  GtkFrontend *gtk_frontend = NULL;
-  
-  GtkWidget *addressbook_window = NULL;
-  GtkWidget *accounts_window = NULL;
-
-  bool show_call_panel = false;
-  
-  PanelSection cps = DIALPAD;
-
-  g_return_if_fail (main_window != NULL);
-  mw = gm_mw_get_mw (main_window);
-
-  services = GnomeMeeting::Process ()->GetServiceCore ();
-  local_cluster_trigger = dynamic_cast<Ekiga::Trigger *>(services->get ("local-cluster"));
-  gtk_frontend = dynamic_cast<GtkFrontend *>(services->get ("gtk-frontend"));
-  addressbook_window = GTK_WIDGET (gtk_frontend->get_addressbook_window ()); 
-  accounts_window = GnomeMeeting::Process ()->GetAccountsWindow ();
-
-  mw->main_menu = gtk_menu_bar_new ();
-
-  /* Default values */
-  show_call_panel = gm_conf_get_bool (USER_INTERFACE_KEY "main_window/show_call_panel");
-  cps = (PanelSection) gm_conf_get_int (USER_INTERFACE_KEY "main_window/panel_section"); 
-  
-  static MenuEntry gnomemeeting_menu [] =
-    {
-      GTK_MENU_NEW (_("_Chat")),
-
-      GTK_MENU_ENTRY("connect", _("Ca_ll"), _("Place a new call"), 
-		     GM_STOCK_PHONE_PICK_UP_16, 'o',
-		     GTK_SIGNAL_FUNC (place_call_cb), main_window, TRUE),
-      GTK_MENU_ENTRY("disconnect", _("_Hang up"),
-		     _("Terminate the current call"), 
- 		     GM_STOCK_PHONE_HANG_UP_16, GDK_Escape,
-		     GTK_SIGNAL_FUNC (hangup_call_cb), main_window, FALSE),
-
-      GTK_MENU_SEPARATOR,
-
-      GTK_MENU_ENTRY("add_contact", _("A_dd Contact"), _("Add a contact to the roster"),
-		     GTK_STOCK_ADD, 'n', 
-		     GTK_SIGNAL_FUNC (pull_trigger_cb), local_cluster_trigger, true),
-
-      GTK_MENU_THEME_ENTRY("address_book", _("Address _Book"),
-			   _("Find contacts"),
- 			   GM_ICON_ADDRESSBOOK, 'b',
-			   GTK_SIGNAL_FUNC (show_widget_cb),
-			   (gpointer) addressbook_window, TRUE),
-
-      GTK_MENU_SEPARATOR,
-
-      GTK_MENU_ENTRY("contact", _("Co_ntact"),
-		     _("Act on selected contact"),
-		     GTK_STOCK_EXECUTE, 0,
-		     NULL, NULL, FALSE),
-
-      GTK_MENU_SEPARATOR,
-
-      GTK_MENU_ENTRY("hold_call", _("H_old Call"), _("Hold the current call"),
-		     NULL, GDK_h, 
-		     GTK_SIGNAL_FUNC (hold_current_call_cb), main_window,
-		     FALSE),
-      GTK_MENU_ENTRY("transfer_call", _("_Transfer Call"),
-		     _("Transfer the current call"),
- 		     NULL, GDK_t, 
-		     GTK_SIGNAL_FUNC (transfer_current_call_cb), main_window, 
-		     FALSE),
-
-      GTK_MENU_SEPARATOR,
-
-      GTK_MENU_ENTRY("suspend_audio", _("Suspend _Audio"),
-		     _("Suspend or resume the audio transmission"),
-		     NULL, GDK_m,
-		     GTK_SIGNAL_FUNC (toggle_audio_stream_pause_cb),
-		     main_window, FALSE),
-      GTK_MENU_ENTRY("suspend_video", _("Suspend _Video"),
-		     _("Suspend or resume the video transmission"),
-		     NULL, GDK_p, 
-		     GTK_SIGNAL_FUNC (toggle_video_stream_pause_cb),
-		     main_window, FALSE),
-
-      GTK_MENU_SEPARATOR,
-
-      GTK_MENU_ENTRY("close", NULL, _("Close the Ekiga window"),
-		     GTK_STOCK_CLOSE, 'W', 
-		     GTK_SIGNAL_FUNC (window_closed_from_menu_cb),
-		     (gpointer) main_window, TRUE),
-
-      GTK_MENU_SEPARATOR,
-      
-      GTK_MENU_ENTRY("quit", NULL, _("Quit"),
-		     GTK_STOCK_QUIT, 'Q', 
-		     GTK_SIGNAL_FUNC (quit_callback), NULL, TRUE),
-
-      GTK_MENU_NEW (_("_Edit")),
-
-      GTK_MENU_ENTRY("configuration_assistant", _("_Configuration Assistant"),
-		     _("Run the configuration assistant"),
-		     NULL, 0, 
-		     G_CALLBACK (show_assistant_window_cb),
-		     NULL, TRUE),
-
-      GTK_MENU_SEPARATOR,
-      
-      GTK_MENU_ENTRY("accounts", _("_Accounts"),
-		     _("Edit your accounts"), 
-		     NULL, 'E',
-		     GTK_SIGNAL_FUNC (show_window_cb),
-		     (gpointer) accounts_window, TRUE),
-
-      GTK_MENU_ENTRY("preferences", NULL,
-		     _("Change your preferences"), 
-		     GTK_STOCK_PREFERENCES, 0,
-		     G_CALLBACK (show_prefs_window_cb),
-		     NULL, TRUE),
-
-      GTK_MENU_NEW(_("_View")),
-
-      GTK_MENU_RADIO_ENTRY("contacts", _("Con_tacts"), _("View the contacts list"),
-			   NULL, 0,
-			   GTK_SIGNAL_FUNC (radio_menu_changed_cb),
-			   (gpointer) USER_INTERFACE_KEY "main_window/panel_section",
-			   (cps == CONTACTS), TRUE),
-      GTK_MENU_RADIO_ENTRY("dialpad", _("_Dialpad"), _("View the dialpad"),
-			   NULL, 0,
-			   GTK_SIGNAL_FUNC (radio_menu_changed_cb), 
-			   (gpointer) USER_INTERFACE_KEY "main_window/panel_section",
-			   (cps == DIALPAD), TRUE),
-      GTK_MENU_RADIO_ENTRY("callhistory", _("_Call History"), _("View the call history"),
-			   NULL, 0,
-			   GTK_SIGNAL_FUNC (radio_menu_changed_cb),
-			   (gpointer) USER_INTERFACE_KEY "main_window/panel_section",
-			   (cps == CALL), TRUE),
-
-      GTK_MENU_SEPARATOR,
-
-      GTK_MENU_TOGGLE_ENTRY("callpanel", _("_Show Call Panel"), _("Show the call panel"),
-                            NULL, 'J', 
-                            GTK_SIGNAL_FUNC (toggle_menu_changed_cb),
-                            (gpointer) USER_INTERFACE_KEY "main_window/show_call_panel", 
-                            show_call_panel, TRUE),
-
-      GTK_MENU_SEPARATOR,
-
-      GTK_MENU_RADIO_ENTRY("local_video", _("_Local Video"),
-			   _("Local video image"),
-			   NULL, '1', 
-			   GTK_SIGNAL_FUNC (display_changed_cb),
-			   (gpointer) VIDEO_DISPLAY_KEY "video_view",
-			   TRUE, FALSE),
-      GTK_MENU_RADIO_ENTRY("remote_video", _("_Remote Video"),
-			   _("Remote video image"),
-			   NULL, '2', 
-			   GTK_SIGNAL_FUNC (display_changed_cb), 
-			   (gpointer) VIDEO_DISPLAY_KEY "video_view",
-			   FALSE, FALSE),
-      GTK_MENU_RADIO_ENTRY("both_incrusted", _("_Picture-in-Picture"),
-			   _("Both video images"),
-			   NULL, '3', 
-			   GTK_SIGNAL_FUNC (display_changed_cb), 
-			   (gpointer) VIDEO_DISPLAY_KEY "video_view",
-			   FALSE, FALSE),
-      GTK_MENU_RADIO_ENTRY("both_incrusted_window", _("Picture-in-Picture in Separate _Window"),
-			   _("Both video images"),
-			   NULL, '4', 
-			   GTK_SIGNAL_FUNC (display_changed_cb), 
-			   (gpointer) VIDEO_DISPLAY_KEY "video_view",
-			   FALSE, FALSE),
-      GTK_MENU_SEPARATOR,
-
-      GTK_MENU_ENTRY("zoom_in", NULL, _("Zoom in"), 
-		     GTK_STOCK_ZOOM_IN, '+', 
-		     GTK_SIGNAL_FUNC (zoom_in_changed_cb),
-		     (gpointer) VIDEO_DISPLAY_KEY "zoom", FALSE),
-      GTK_MENU_ENTRY("zoom_out", NULL, _("Zoom out"), 
-		     GTK_STOCK_ZOOM_OUT, '-', 
-		     GTK_SIGNAL_FUNC (zoom_out_changed_cb),
-		     (gpointer) VIDEO_DISPLAY_KEY "zoom", FALSE),
-      GTK_MENU_ENTRY("normal_size", NULL, _("Normal size"), 
-		     GTK_STOCK_ZOOM_100, '0',
-		     GTK_SIGNAL_FUNC (zoom_normal_changed_cb),
-		     (gpointer) VIDEO_DISPLAY_KEY "zoom", FALSE),
-      GTK_MENU_ENTRY("fullscreen", _("_Fullscreen"), _("Switch to fullscreen"), 
-		     GTK_STOCK_ZOOM_IN, GDK_F11, 
-		     GTK_SIGNAL_FUNC (fullscreen_changed_cb),
-		     (gpointer) main_window, FALSE),
-
-      GTK_MENU_NEW(_("_Help")),
-
-      GTK_MENU_ENTRY("help", NULL, 
-                     _("Get help by reading the Ekiga manual"),
-                     GTK_STOCK_HELP, GDK_F1, 
-                     GTK_SIGNAL_FUNC (help_cb), NULL, TRUE),
-
-      GTK_MENU_ENTRY("about", NULL,
-		     _("View information about Ekiga"),
-		     GTK_STOCK_ABOUT, 0, 
-		     GTK_SIGNAL_FUNC (about_callback), (gpointer) main_window,
-		     TRUE),
-       
-      GTK_MENU_END
-    };
-
-
-  gtk_build_menu (mw->main_menu, 
-		  gnomemeeting_menu, 
-		  mw->accel, 
-		  mw->statusbar);
-
-  gtk_widget_show_all (GTK_WIDGET (mw->main_menu));
-}
-
-
-static void 
-gm_mw_init_contacts_list (GtkWidget *main_window)
-{
-  GmMainWindow *mw = NULL;
-
-  GtkWidget *label = NULL;
-
-  GtkFrontend *gtk_frontend = NULL;
-  Ekiga::ServiceCore *services = NULL;
-  GtkWidget* roster_view = NULL;
-
-  g_return_if_fail (main_window != NULL);
-  mw = gm_mw_get_mw (main_window);
-  
-  services = GnomeMeeting::Process ()->GetServiceCore ();
-  g_return_if_fail (services != NULL);
-
-  gtk_frontend = dynamic_cast<GtkFrontend *>(services->get ("gtk-frontend"));
-
-  label = gtk_label_new (_("Contacts"));
-  roster_view = GTK_WIDGET (gtk_frontend->get_roster_view ());
-  gtk_notebook_append_page (GTK_NOTEBOOK (mw->main_notebook),
-			    roster_view, label);
-  g_signal_connect (G_OBJECT (roster_view), "presentity-selected",
-		    G_CALLBACK (on_presentity_selected), main_window);
-}
-
-
-static void 
-gm_mw_init_dialpad (GtkWidget *main_window)
-{
-  GmMainWindow *mw = NULL;
-
-  GtkWidget *dialpad = NULL;
-  GtkWidget *alignment = NULL;
-  GtkWidget *label = NULL;
-
-  g_return_if_fail (main_window != NULL);
-  mw = gm_mw_get_mw (main_window);
-
-  dialpad = ekiga_dialpad_new (mw->accel);
-  g_signal_connect (dialpad, "button-clicked",
-                    G_CALLBACK (dialpad_button_clicked_cb), main_window);
-
-  alignment = gtk_alignment_new (0.5, 0.5, 0.2, 0.2);
-  gtk_container_add (GTK_CONTAINER (alignment), dialpad);
-
-  label = gtk_label_new (_("Dialpad"));
-  gtk_notebook_append_page (GTK_NOTEBOOK (mw->main_notebook),
-			    alignment, label);
-}
-
-
-static GtkWidget * 
-gm_mw_video_settings_window_new (GtkWidget *main_window)
-{
-  GmMainWindow *mw = NULL;
-  
-  GtkWidget *hbox = NULL;
-  GtkWidget *vbox = NULL;
-  GtkWidget *image = NULL;
-  GtkWidget *window = NULL;
-
-  GtkWidget *hscale_brightness = NULL;
-  GtkWidget *hscale_colour = NULL;
-  GtkWidget *hscale_contrast = NULL;
-  GtkWidget *hscale_whiteness = NULL;
-
-  int brightness = 0, colour = 0, contrast = 0, whiteness = 0;
-
-  g_return_val_if_fail (main_window != NULL, NULL);
-  mw = gm_mw_get_mw (main_window);
-
-  
-  /* Build the window */
-  window = gtk_dialog_new ();
-  g_object_set_data_full (G_OBJECT (window), "window_name",
-			  g_strdup ("video_settings_window"), g_free); 
-  gtk_dialog_add_button (GTK_DIALOG (window), 
-                         GTK_STOCK_CLOSE, 
-                         GTK_RESPONSE_CANCEL);
-
-  gtk_window_set_title (GTK_WINDOW (window), 
-                        _("Video Settings"));
-
-  /* Webcam Control Frame, we need it to disable controls */		
-  mw->video_settings_frame = gtk_frame_new (NULL);
-  gtk_frame_set_shadow_type (GTK_FRAME (mw->video_settings_frame), 
-			     GTK_SHADOW_NONE);
-  gtk_container_set_border_width (GTK_CONTAINER (mw->video_settings_frame), 5);
-  
-  /* Category */
-  vbox = gtk_vbox_new (0, FALSE);
-  gtk_container_add (GTK_CONTAINER (mw->video_settings_frame), vbox);
-  
-  /* Brightness */
-  hbox = gtk_hbox_new (0, FALSE);
-  image = gtk_image_new_from_icon_name (GM_ICON_BRIGHTNESS, GTK_ICON_SIZE_MENU);
-  gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
-
-  mw->adj_brightness = gtk_adjustment_new (brightness, 0.0, 
-					   255.0, 1.0, 5.0, 1.0);
-  hscale_brightness = gtk_hscale_new (GTK_ADJUSTMENT (mw->adj_brightness));
-  gtk_range_set_update_policy (GTK_RANGE (hscale_brightness),
-			       GTK_UPDATE_DELAYED);
-  gtk_scale_set_draw_value (GTK_SCALE (hscale_brightness), FALSE);
-  gtk_scale_set_value_pos (GTK_SCALE (hscale_brightness), GTK_POS_RIGHT);
-  gtk_box_pack_start (GTK_BOX (hbox), hscale_brightness, TRUE, TRUE, 2);
-  gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 3);
-
-  gtk_widget_set_tooltip_text (hscale_brightness, _("Adjust brightness"));
-
-  g_signal_connect (G_OBJECT (mw->adj_brightness), "value-changed",
-		    G_CALLBACK (video_settings_changed_cb), 
-		    (gpointer) main_window);
-
-  /* Whiteness */
-  hbox = gtk_hbox_new (0, FALSE);
-  image = gtk_image_new_from_icon_name (GM_ICON_WHITENESS, GTK_ICON_SIZE_MENU);
-  gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
-
-  mw->adj_whiteness = gtk_adjustment_new (whiteness, 0.0, 
-					  255.0, 1.0, 5.0, 1.0);
-  hscale_whiteness = gtk_hscale_new (GTK_ADJUSTMENT (mw->adj_whiteness));
-  gtk_range_set_update_policy (GTK_RANGE (hscale_whiteness),
-			       GTK_UPDATE_DELAYED);
-  gtk_scale_set_draw_value (GTK_SCALE (hscale_whiteness), FALSE);
-  gtk_scale_set_value_pos (GTK_SCALE (hscale_whiteness), GTK_POS_RIGHT);
-  gtk_box_pack_start (GTK_BOX (hbox), hscale_whiteness, TRUE, TRUE, 2);
-  gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 3);
-
-  gtk_widget_set_tooltip_text (hscale_whiteness, _("Adjust whiteness"));
-
-  g_signal_connect (G_OBJECT (mw->adj_whiteness), "value-changed",
-		    G_CALLBACK (video_settings_changed_cb), 
-		    (gpointer) main_window);
+  g_signal_connect (G_OBJECT (mw->priv->adj_whiteness), "value-changed",
+		    G_CALLBACK (video_settings_changed_cb), 
+		    (gpointer) mw);
 
   /* Colour */
   hbox = gtk_hbox_new (0, FALSE);
   image = gtk_image_new_from_icon_name (GM_ICON_COLOURNESS, GTK_ICON_SIZE_MENU);
   gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
 
-  mw->adj_colour = gtk_adjustment_new (colour, 0.0, 
-				       255.0, 1.0, 5.0, 1.0);
-  hscale_colour = gtk_hscale_new (GTK_ADJUSTMENT (mw->adj_colour));
+  mw->priv->adj_colour = gtk_adjustment_new (colour, 0.0, 
+					     255.0, 1.0, 5.0, 1.0);
+  hscale_colour = gtk_hscale_new (GTK_ADJUSTMENT (mw->priv->adj_colour));
   gtk_range_set_update_policy (GTK_RANGE (hscale_colour),
 			       GTK_UPDATE_DELAYED);
   gtk_scale_set_draw_value (GTK_SCALE (hscale_colour), FALSE);
@@ -2087,18 +1533,18 @@
 
   gtk_widget_set_tooltip_text (hscale_colour, _("Adjust color"));
 
-  g_signal_connect (G_OBJECT (mw->adj_colour), "value-changed",
+  g_signal_connect (G_OBJECT (mw->priv->adj_colour), "value-changed",
 		    G_CALLBACK (video_settings_changed_cb), 
-		    (gpointer) main_window);
+		    (gpointer) mw);
 
   /* Contrast */
   hbox = gtk_hbox_new (0, FALSE);
   image = gtk_image_new_from_icon_name (GM_ICON_CONTRAST, GTK_ICON_SIZE_MENU);
   gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
   
-  mw->adj_contrast = gtk_adjustment_new (contrast, 0.0, 
-					 255.0, 1.0, 5.0, 1.0);
-  hscale_contrast = gtk_hscale_new (GTK_ADJUSTMENT (mw->adj_contrast));
+  mw->priv->adj_contrast = gtk_adjustment_new (contrast, 0.0, 
+					       255.0, 1.0, 5.0, 1.0);
+  hscale_contrast = gtk_hscale_new (GTK_ADJUSTMENT (mw->priv->adj_contrast));
   gtk_range_set_update_policy (GTK_RANGE (hscale_contrast),
 			       GTK_UPDATE_DELAYED);
   gtk_scale_set_draw_value (GTK_SCALE (hscale_contrast), FALSE);
@@ -2108,15 +1554,15 @@
 
   gtk_widget_set_tooltip_text (hscale_contrast, _("Adjust contrast"));
 
-  g_signal_connect (G_OBJECT (mw->adj_contrast), "value-changed",
+  g_signal_connect (G_OBJECT (mw->priv->adj_contrast), "value-changed",
 		    G_CALLBACK (video_settings_changed_cb), 
-		    (gpointer) main_window);
+		    (gpointer) mw);
   
   gtk_container_add (GTK_CONTAINER (GTK_DIALOG (window)->vbox), 
-                     mw->video_settings_frame);
-  gtk_widget_show_all (mw->video_settings_frame);
+                     mw->priv->video_settings_frame);
+  gtk_widget_show_all (mw->priv->video_settings_frame);
 
-  gtk_widget_set_sensitive (GTK_WIDGET (mw->video_settings_frame), FALSE);
+  gtk_widget_set_sensitive (GTK_WIDGET (mw->priv->video_settings_frame), FALSE);
   
   /* That's an usual GtkWindow, connect it to the signals */
   g_signal_connect_swapped (GTK_OBJECT (window), 
@@ -2134,10 +1580,8 @@
 
 
 static GtkWidget * 
-gm_mw_audio_settings_window_new (GtkWidget *main_window)
+gm_mw_audio_settings_window_new (EkigaMainWindow *mw)
 {
-  GmMainWindow *mw = NULL;
-  
   GtkWidget *hscale_play = NULL; 
   GtkWidget *hscale_rec = NULL;
   GtkWidget *hbox = NULL;
@@ -2145,12 +1589,6 @@
   GtkWidget *small_vbox = NULL;
   GtkWidget *window = NULL;
   
-
-  /* Get the data from the GMObject */
-  g_return_val_if_fail (main_window != NULL, NULL);
-  mw = gm_mw_get_mw (main_window);
-  
-
   /* Build the window */
   window = gtk_dialog_new ();
   g_object_set_data_full (G_OBJECT (window), "window_name",
@@ -2163,15 +1601,15 @@
                         _("Audio Settings"));
 
   /* Audio control frame, we need it to disable controls */		
-  mw->audio_output_volume_frame = gtk_frame_new (NULL);
-  gtk_frame_set_shadow_type (GTK_FRAME (mw->audio_output_volume_frame), 
+  mw->priv->audio_output_volume_frame = gtk_frame_new (NULL);
+  gtk_frame_set_shadow_type (GTK_FRAME (mw->priv->audio_output_volume_frame), 
 			     GTK_SHADOW_NONE);
-  gtk_container_set_border_width (GTK_CONTAINER (mw->audio_output_volume_frame), 5);
+  gtk_container_set_border_width (GTK_CONTAINER (mw->priv->audio_output_volume_frame), 5);
 
 
   /* The vbox */
   vbox = gtk_vbox_new (0, FALSE);
-  gtk_container_add (GTK_CONTAINER (mw->audio_output_volume_frame), vbox);
+  gtk_container_add (GTK_CONTAINER (mw->priv->audio_output_volume_frame), vbox);
 
   /* Output volume */
   hbox = gtk_hbox_new (0, FALSE);
@@ -2181,325 +1619,96 @@
 		      FALSE, FALSE, 0);
   
   small_vbox = gtk_vbox_new (0, FALSE);
-  mw->adj_output_volume = gtk_adjustment_new (0, 0.0, 101.0, 1.0, 5.0, 1.0);
-  hscale_play = gtk_hscale_new (GTK_ADJUSTMENT (mw->adj_output_volume));
+  mw->priv->adj_output_volume = gtk_adjustment_new (0, 0.0, 101.0, 1.0, 5.0, 1.0);
+  hscale_play = gtk_hscale_new (GTK_ADJUSTMENT (mw->priv->adj_output_volume));
   gtk_range_set_update_policy (GTK_RANGE (hscale_play),
 			       GTK_UPDATE_DELAYED);
   gtk_scale_set_value_pos (GTK_SCALE (hscale_play), GTK_POS_RIGHT); 
   gtk_scale_set_draw_value (GTK_SCALE (hscale_play), FALSE);
   gtk_box_pack_start (GTK_BOX (small_vbox), hscale_play, TRUE, TRUE, 0);
 
-  mw->output_signal = gtk_levelmeter_new ();
-  gtk_box_pack_start (GTK_BOX (small_vbox), mw->output_signal, TRUE, TRUE, 0);
+  mw->priv->output_signal = gtk_levelmeter_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->audio_output_volume_frame);
-  gtk_widget_show_all (mw->audio_output_volume_frame);
-  gtk_widget_set_sensitive (GTK_WIDGET (mw->audio_output_volume_frame),  FALSE);
+                     mw->priv->audio_output_volume_frame);
+  gtk_widget_show_all (mw->priv->audio_output_volume_frame);
+  gtk_widget_set_sensitive (GTK_WIDGET (mw->priv->audio_output_volume_frame),  FALSE);
 
   /* Audio control frame, we need it to disable controls */		
-  mw->audio_input_volume_frame = gtk_frame_new (NULL);
-  gtk_frame_set_shadow_type (GTK_FRAME (mw->audio_input_volume_frame), 
-			     GTK_SHADOW_NONE);
-  gtk_container_set_border_width (GTK_CONTAINER (mw->audio_input_volume_frame), 5);
-
-  /* The vbox */
-  vbox = gtk_vbox_new (0, FALSE);
-  gtk_container_add (GTK_CONTAINER (mw->audio_input_volume_frame), vbox);
-
-  /* Input volume */
-  hbox = gtk_hbox_new (0, FALSE);
-  gtk_box_pack_start (GTK_BOX (hbox),
-		      gtk_image_new_from_icon_name (GM_ICON_MICROPHONE, 
-						    GTK_ICON_SIZE_SMALL_TOOLBAR),
-		      FALSE, FALSE, 0);
-
-  small_vbox = gtk_vbox_new (0, FALSE);
-  mw->adj_input_volume = gtk_adjustment_new (0, 0.0, 101.0, 1.0, 5.0, 1.0);
-  hscale_rec = gtk_hscale_new (GTK_ADJUSTMENT (mw->adj_input_volume));
-  gtk_range_set_update_policy (GTK_RANGE (hscale_rec),
-			       GTK_UPDATE_DELAYED);
-  gtk_scale_set_value_pos (GTK_SCALE (hscale_rec), GTK_POS_RIGHT); 
-  gtk_scale_set_draw_value (GTK_SCALE (hscale_rec), FALSE);
-  gtk_box_pack_start (GTK_BOX (small_vbox), hscale_rec, TRUE, TRUE, 0);
-
-  mw->input_signal = gtk_levelmeter_new ();
-  gtk_box_pack_start (GTK_BOX (small_vbox), mw->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->audio_input_volume_frame);
-  gtk_widget_show_all (mw->audio_input_volume_frame);
-  gtk_widget_set_sensitive (GTK_WIDGET (mw->audio_input_volume_frame),  FALSE);
-
-  g_signal_connect (G_OBJECT (mw->adj_output_volume), "value-changed",
-		    G_CALLBACK (audio_volume_changed_cb), main_window);
-
-  g_signal_connect (G_OBJECT (mw->adj_input_volume), "value-changed",
-		    G_CALLBACK (audio_volume_changed_cb), main_window);
-
-
-
-  
-  /* That's an usual GtkWindow, connect it to the signals */
-  g_signal_connect_swapped (GTK_OBJECT (window), 
-			    "response", 
-			    G_CALLBACK (gnomemeeting_window_hide),
-			    (gpointer) window);
-
-  g_signal_connect (GTK_OBJECT (window), 
-		    "delete-event", 
-		    G_CALLBACK (delete_window_cb), NULL);
-
-  g_signal_connect (G_OBJECT (window), "show", 
-                    GTK_SIGNAL_FUNC (audio_volume_window_shown_cb), main_window);
-
-  g_signal_connect (G_OBJECT (window), "hide", 
-                    GTK_SIGNAL_FUNC (audio_volume_window_hidden_cb), main_window);
-
-  return window;
-}
-
-
-static void 
-gm_mw_init_call (GtkWidget *main_window)
-{
-  GmMainWindow *mw = NULL;
-
-  GtkWidget *frame = NULL;
-  GtkWidget *event_box = NULL;
-  GtkWidget *table = NULL;
-
-  GtkWidget *toolbar = NULL;
-  GtkToolItem *item = NULL;
-
-  GtkWidget *image = NULL;
-  GtkWidget *alignment = NULL;
-
-  GdkColor white;
-  gdk_color_parse ("white", &white);
-
-  /* Get the data from the GMObject */
-  mw = gm_mw_get_mw (main_window);
-
-  /* The main table */
-  frame = gtk_frame_new (NULL);
-  event_box = gtk_event_box_new ();
-  gtk_widget_modify_bg (event_box, GTK_STATE_PRELIGHT, &white);
-  gtk_widget_modify_bg (event_box, GTK_STATE_NORMAL, &white);
-  table = gtk_table_new (3, 4, FALSE);
-  gtk_container_add (GTK_CONTAINER (event_box), table);
-  gtk_container_add (GTK_CONTAINER (frame), event_box);
-
-  /* The frame that contains the video */
-  mw->video_frame = gtk_frame_new (NULL);
-  gtk_frame_set_shadow_type (GTK_FRAME (mw->video_frame), 
-                             GTK_SHADOW_NONE);
-  
-  mw->main_video_image = gtk_image_new ();
-  gtk_container_set_border_width (GTK_CONTAINER (mw->video_frame), 0);
-  gtk_container_add (GTK_CONTAINER (mw->video_frame), mw->main_video_image);
-  gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (mw->video_frame),       
-                    0, 4, 0, 1,         
-                    (GtkAttachOptions) GTK_EXPAND,      
-                    (GtkAttachOptions) GTK_EXPAND,      
-                    24, 24);
-
-  /* The frame that contains information about the call */
-  /* Text buffer */
-  GtkTextBuffer *buffer = NULL;
-  
-  mw->info_text = gtk_text_view_new ();
-  gtk_widget_modify_bg (mw->info_text, GTK_STATE_PRELIGHT, &white);
-  gtk_widget_modify_bg (mw->info_text, GTK_STATE_NORMAL, &white);
-  gtk_widget_modify_bg (mw->info_text, GTK_STATE_INSENSITIVE, &white);
-
-  gtk_text_view_set_editable (GTK_TEXT_VIEW (mw->info_text), FALSE);
-  gtk_widget_set_sensitive (GTK_WIDGET (mw->info_text), FALSE);
-  gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (mw->info_text),
-			       GTK_WRAP_WORD);
-
-  buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (mw->info_text));
-  gtk_text_view_set_cursor_visible  (GTK_TEXT_VIEW (mw->info_text), FALSE);
-
-  gtk_text_buffer_create_tag (buffer, "status",
-			      "foreground", "black", 
-                              "paragraph-background", "white",
-                              "justification", GTK_JUSTIFY_CENTER,
-                              "weight", PANGO_WEIGHT_BOLD,
-                              "scale", 1.2,
-                              NULL);
-  gtk_text_buffer_create_tag (buffer, "codecs",
-                              "justification", GTK_JUSTIFY_RIGHT,
-                              "stretch", PANGO_STRETCH_CONDENSED,
-			      "foreground", "darkgray", 
-                              "paragraph-background", "white",
-			      NULL);
-  gtk_text_buffer_create_tag (buffer, "call-duration",
-			      "foreground", "black", 
-                              "paragraph-background", "white",
-			      "justification", GTK_JUSTIFY_CENTER,
-                              "weight", PANGO_WEIGHT_BOLD,
-			      NULL);
-
-  gm_main_window_set_status (main_window, _("Standby"));
-  gm_main_window_set_call_duration (main_window, NULL);
-  gm_main_window_set_call_info (main_window, NULL, NULL, NULL, NULL);
-
-  alignment = gtk_alignment_new (0.0, 0.0, 1.0, 0.0);
-  gtk_container_add (GTK_CONTAINER (alignment), mw->info_text);
-  gtk_table_attach (GTK_TABLE (table), alignment,
-                    0, 4, 1, 2,         
-                    (GtkAttachOptions) (GTK_FILL | GTK_EXPAND),
-                    (GtkAttachOptions) (GTK_FILL | GTK_EXPAND),
-                    0, 0);
-  
-  /* The toolbar */
-  toolbar = gtk_toolbar_new ();
-  gtk_widget_modify_bg (toolbar, GTK_STATE_PRELIGHT, &white);
-  gtk_widget_modify_bg (toolbar, GTK_STATE_NORMAL, &white);
-  gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_ICONS);
-  gtk_toolbar_set_show_arrow (GTK_TOOLBAR (toolbar), FALSE);
-
-  /* Audio Volume */
-  item = gtk_tool_item_new ();
-  mw->audio_settings_button = gtk_button_new ();
-  gtk_button_set_relief (GTK_BUTTON (mw->audio_settings_button), GTK_RELIEF_NONE);
-  image = gtk_image_new_from_icon_name (GM_ICON_AUDIO_VOLUME_HIGH,
-                                        GTK_ICON_SIZE_MENU);
-  gtk_container_add (GTK_CONTAINER (mw->audio_settings_button), image);
-  gtk_container_add (GTK_CONTAINER (item), mw->audio_settings_button);
-  gtk_tool_item_set_expand (GTK_TOOL_ITEM (item), FALSE);
-  
-  gtk_widget_show (mw->audio_settings_button);
-  gtk_widget_set_sensitive (mw->audio_settings_button, FALSE);
-  gtk_toolbar_insert (GTK_TOOLBAR (toolbar), 
-		      GTK_TOOL_ITEM (item), -1);
-  gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (item),
-				  _("Change the volume of your soundcard"));
-  g_signal_connect (G_OBJECT (mw->audio_settings_button), "clicked",
-		    G_CALLBACK (show_window_cb),
-		    (gpointer) mw->audio_settings_window);
-  
-  /* Video Settings */
-  item = gtk_tool_item_new ();
-  mw->video_settings_button = gtk_button_new ();
-  gtk_button_set_relief (GTK_BUTTON (mw->video_settings_button), GTK_RELIEF_NONE);
-  image = gtk_image_new_from_stock (GM_STOCK_COLOR_BRIGHTNESS_CONTRAST,
-                                    GTK_ICON_SIZE_MENU);
-  gtk_container_add (GTK_CONTAINER (mw->video_settings_button), image);
-  gtk_container_add (GTK_CONTAINER (item), mw->video_settings_button);
-  gtk_tool_item_set_expand (GTK_TOOL_ITEM (item), FALSE);
-  
-  gtk_widget_show (mw->video_settings_button);
-  gtk_widget_set_sensitive (mw->video_settings_button, FALSE);
-  gtk_toolbar_insert (GTK_TOOLBAR (toolbar), 
-		      GTK_TOOL_ITEM (item), -1);
-  gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (item),
-				   _("Change the color settings of your video device"));
+  mw->priv->audio_input_volume_frame = gtk_frame_new (NULL);
+  gtk_frame_set_shadow_type (GTK_FRAME (mw->priv->audio_input_volume_frame), 
+			     GTK_SHADOW_NONE);
+  gtk_container_set_border_width (GTK_CONTAINER (mw->priv->audio_input_volume_frame), 5);
 
-  g_signal_connect (G_OBJECT (mw->video_settings_button), "clicked",
-		    G_CALLBACK (show_window_cb),
-		    (gpointer) mw->video_settings_window);
+  /* The vbox */
+  vbox = gtk_vbox_new (0, FALSE);
+  gtk_container_add (GTK_CONTAINER (mw->priv->audio_input_volume_frame), vbox);
 
-  /* Video Preview Button */
-  item = gtk_tool_item_new ();
-  mw->preview_button = gtk_toggle_button_new ();
-  gtk_button_set_relief (GTK_BUTTON (mw->preview_button), GTK_RELIEF_NONE);
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (mw->preview_button),
-                                gm_conf_get_bool (VIDEO_DEVICES_KEY "enable_preview"));
-  image = gtk_image_new_from_icon_name (GM_ICON_CAMERA_VIDEO, 
-                                        GTK_ICON_SIZE_MENU);
-  gtk_container_add (GTK_CONTAINER (mw->preview_button), image);
-  gtk_container_add (GTK_CONTAINER (item), mw->preview_button);
-  gtk_tool_item_set_expand (GTK_TOOL_ITEM (item), FALSE);
-  
-  gtk_widget_show (mw->preview_button);
-  gtk_toolbar_insert (GTK_TOOLBAR (toolbar), 
-		      GTK_TOOL_ITEM (item), -1);
-  gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (item),
-				  _("Display images from your camera device"));
+  /* Input volume */
+  hbox = gtk_hbox_new (0, FALSE);
+  gtk_box_pack_start (GTK_BOX (hbox),
+		      gtk_image_new_from_icon_name (GM_ICON_MICROPHONE, 
+						    GTK_ICON_SIZE_SMALL_TOOLBAR),
+		      FALSE, FALSE, 0);
 
-  g_signal_connect (G_OBJECT (mw->preview_button), "toggled",
-		    G_CALLBACK (toolbar_toggle_button_changed_cb),
-		    (gpointer) VIDEO_DEVICES_KEY "enable_preview");
+  small_vbox = gtk_vbox_new (0, FALSE);
+  mw->priv->adj_input_volume = gtk_adjustment_new (0, 0.0, 101.0, 1.0, 5.0, 1.0);
+  hscale_rec = gtk_hscale_new (GTK_ADJUSTMENT (mw->priv->adj_input_volume));
+  gtk_range_set_update_policy (GTK_RANGE (hscale_rec),
+			       GTK_UPDATE_DELAYED);
+  gtk_scale_set_value_pos (GTK_SCALE (hscale_rec), GTK_POS_RIGHT); 
+  gtk_scale_set_draw_value (GTK_SCALE (hscale_rec), FALSE);
+  gtk_box_pack_start (GTK_BOX (small_vbox), hscale_rec, TRUE, TRUE, 0);
 
-  /* Call Pause */
-  item = gtk_tool_item_new ();
-  mw->hold_button = gtk_toggle_button_new ();
-  image = gtk_image_new_from_icon_name (GM_ICON_MEDIA_PLAYBACK_PAUSE,
-                                        GTK_ICON_SIZE_MENU);
-  gtk_button_set_relief (GTK_BUTTON (mw->hold_button), GTK_RELIEF_NONE);
-  gtk_container_add (GTK_CONTAINER (mw->hold_button), image);
-  gtk_container_add (GTK_CONTAINER (item), mw->hold_button);
-  gtk_tool_item_set_expand (GTK_TOOL_ITEM (item), FALSE);
-  
-  gtk_widget_show (mw->hold_button);
-  gtk_toolbar_insert (GTK_TOOLBAR (toolbar), 
-		      GTK_TOOL_ITEM (item), -1);
-  gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (item),
-				  _("Hold the current call"));
-  gtk_widget_set_sensitive (GTK_WIDGET (mw->hold_button), FALSE);
+  mw->priv->input_signal = gtk_levelmeter_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);
 
-  g_signal_connect (G_OBJECT (mw->hold_button), "clicked",
-		    G_CALLBACK (hold_current_call_cb), main_window); 
+  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);
+  gtk_widget_set_sensitive (GTK_WIDGET (mw->priv->audio_input_volume_frame),  FALSE);
 
-  alignment = gtk_alignment_new (0.0, 0.0, 1.0, 0.0);
-  gtk_container_add (GTK_CONTAINER (alignment), toolbar);
-  gtk_table_attach (GTK_TABLE (table), alignment,
-                    1, 3, 2, 3,         
-                    (GtkAttachOptions) (GTK_FILL | GTK_EXPAND),
-                    (GtkAttachOptions) (GTK_FILL | GTK_EXPAND),
-                    0, 0);
+  g_signal_connect (G_OBJECT (mw->priv->adj_output_volume), "value-changed",
+		    G_CALLBACK (audio_volume_changed_cb), mw);
 
-  gtk_paned_pack2 (GTK_PANED (mw->hpaned), frame, true, false);
-}  
+  g_signal_connect (G_OBJECT (mw->priv->adj_input_volume), "value-changed",
+		    G_CALLBACK (audio_volume_changed_cb), mw);
 
-static void
-gm_mw_init_history (GtkWidget *main_window)
-{
-  GmMainWindow *mw = NULL;
-  Ekiga::ServiceCore *services = NULL;
-  GtkWidget *label = NULL;
-  GtkFrontend *gtk_frontend = NULL;
+  /* That's an usual GtkWindow, connect it to the signals */
+  g_signal_connect_swapped (GTK_OBJECT (window), 
+			    "response", 
+			    G_CALLBACK (gnomemeeting_window_hide),
+			    (gpointer) window);
 
-  g_return_if_fail (main_window != NULL);
-  mw = gm_mw_get_mw (main_window);
+  g_signal_connect (GTK_OBJECT (window),
+		    "delete-event", 
+		    G_CALLBACK (delete_window_cb), NULL);
 
-  services = GnomeMeeting::Process ()->GetServiceCore ();
-  g_return_if_fail (services != NULL);
+  g_signal_connect (G_OBJECT (window), "show", 
+                    GTK_SIGNAL_FUNC (audio_volume_window_shown_cb), mw);
 
-  gtk_frontend = dynamic_cast<GtkFrontend *>(services->get ("gtk-frontend"));
+  g_signal_connect (G_OBJECT (window), "hide", 
+                    GTK_SIGNAL_FUNC (audio_volume_window_hidden_cb), mw);
 
-  label = gtk_label_new (_("Call history"));
-  gtk_notebook_append_page (GTK_NOTEBOOK (mw->main_notebook),
-			    GTK_WIDGET (gtk_frontend->get_call_history_view ()),
-			    label);
+  return window;
 }
 
-void
-gm_mw_zooms_menu_update_sensitivity (GtkWidget *main_window,
-                                     unsigned int zoom)
-{
-  GmMainWindow *mw = NULL;
 
-  mw = gm_mw_get_mw (main_window);
-
-  g_return_if_fail (mw != NULL);
 
+static void
+ekiga_main_window_zooms_menu_update_sensitivity (EkigaMainWindow *mw,
+                                                 unsigned int zoom)
+{
   /* between 0.5 and 2.0 zoom */
   /* like above, also update the popup menus of the separate video windows */
-  gtk_menu_set_sensitive (mw->main_menu, "zoom_in",
-                          (zoom == 200) ? FALSE : TRUE);
-
-  gtk_menu_set_sensitive (mw->main_menu, "zoom_out",
-                          (zoom == 50) ? FALSE : TRUE);
-
-  gtk_menu_set_sensitive (mw->main_menu, "normal_size",
-                          (zoom == 100) ? FALSE : TRUE);
+  gtk_menu_set_sensitive (mw->priv->main_menu, "zoom_in", zoom != 200);
+  gtk_menu_set_sensitive (mw->priv->main_menu, "zoom_out", zoom != 50);
+  gtk_menu_set_sensitive (mw->priv->main_menu, "normal_size", zoom != 100);
 }
 
 
@@ -2529,13 +1738,11 @@
 			Ekiga::Presentity* presentity,
 			gpointer self)
 {
-  GmMainWindow *mw = gm_mw_get_mw (GTK_WIDGET (self));
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (self);
 
-  g_return_if_fail (mw != NULL);
-
-  mw->presentity = presentity;
+  mw->priv->presentity = presentity;
 
-  gm_main_window_selected_presentity_build_menu (GTK_WIDGET (self));
+  ekiga_main_window_selected_presentity_build_menu (mw);
 }
 
 
@@ -2569,1456 +1776,1832 @@
 
     //gdk_threads_enter ();
     section = gm_conf_entry_get_int (entry);
-    gm_main_window_set_panel_section (GTK_WIDGET (data), 
-                                      section);
+    ekiga_main_window_set_panel_section (EKIGA_MAIN_WINDOW (data), section);
+    //gdk_threads_leave ();
+  }
+}
+
+
+static void 
+show_call_panel_changed_nt (G_GNUC_UNUSED gpointer id, 
+                            GmConfEntry *entry, 
+                            gpointer data)
+{
+  g_return_if_fail (data != NULL);
+
+  if (gm_conf_entry_get_type (entry) == GM_CONF_BOOL) {
+
+    //gdk_threads_enter ();
+    if (gm_conf_entry_get_bool (entry)) 
+      ekiga_main_window_show_call_panel (EKIGA_MAIN_WINDOW (data));
+    else 
+      ekiga_main_window_hide_call_panel (EKIGA_MAIN_WINDOW (data));
+
     //gdk_threads_leave ();
   }
 }
 
 
 static void 
-show_call_panel_changed_nt (G_GNUC_UNUSED gpointer id, 
-                            GmConfEntry *entry, 
-                            gpointer data)
+pull_trigger_cb (GtkWidget * /*widget*/,
+                 gpointer data)
+{
+  Ekiga::Trigger *trigger = (Ekiga::Trigger *) data;
+
+  g_return_if_fail (trigger != NULL);
+
+  trigger->pull ();
+}
+
+
+static void 
+show_widget_cb (GtkWidget * /*widget*/,
+                gpointer data)
+{
+  g_return_if_fail (data != NULL);
+
+  gtk_widget_show_all (GTK_WIDGET (data));
+}
+
+
+static void 
+hold_current_call_cb (G_GNUC_UNUSED GtkWidget *widget,
+		      gpointer data)
+{
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (data);
+
+  if (mw->priv->current_call)
+    mw->priv->current_call->toggle_hold ();
+}
+
+
+static void
+toggle_audio_stream_pause_cb (GtkWidget * /*widget*/,
+                              gpointer data)
+{
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (data);
+
+  if (mw->priv->current_call)
+    mw->priv->current_call->toggle_stream_pause (Ekiga::Call::Audio);
+}
+
+
+static void
+toggle_video_stream_pause_cb (GtkWidget * /*widget*/,
+                              gpointer data)
+{
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (data);
+
+  if (mw->priv->current_call)
+    mw->priv->current_call->toggle_stream_pause (Ekiga::Call::Video);
+}
+
+
+static void 
+transfer_current_call_cb (G_GNUC_UNUSED GtkWidget *widget,
+			  gpointer data)
+{
+  GtkWidget *mw = NULL;
+  
+  g_return_if_fail (data != NULL);
+  
+  mw = GnomeMeeting::Process ()->GetMainWindow ();
+
+  ekiga_main_window_transfer_dialog_run (EKIGA_MAIN_WINDOW (mw), GTK_WIDGET (data), NULL);  
+}
+
+
+static void 
+audio_volume_changed_cb (GtkAdjustment * /*adjustment*/,
+			 gpointer data)
+{
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (data);
+
+  Ekiga::AudioInputCore *audioinput_core = dynamic_cast<Ekiga::AudioInputCore *> (mw->priv->core->get ("audioinput-core"));
+  Ekiga::AudioOutputCore *audiooutput_core = dynamic_cast<Ekiga::AudioOutputCore *> (mw->priv->core->get ("audiooutput-core"));
+
+  audiooutput_core->set_volume (Ekiga::primary, (unsigned) GTK_ADJUSTMENT (mw->priv->adj_output_volume)->value);
+  audioinput_core->set_volume ((unsigned) GTK_ADJUSTMENT (mw->priv->adj_input_volume)->value);
+}
+
+static void 
+audio_volume_window_shown_cb (GtkWidget * /*widget*/,
+	                      gpointer data)
+{
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (data);
+
+  Ekiga::AudioInputCore *audioinput_core = dynamic_cast<Ekiga::AudioInputCore *> (mw->priv->core->get ("audioinput-core"));
+  Ekiga::AudioOutputCore *audiooutput_core = dynamic_cast<Ekiga::AudioOutputCore *> (mw->priv->core->get ("audiooutput-core"));
+
+  audioinput_core->set_average_collection (true);
+  audiooutput_core->set_average_collection (true);
+  mw->priv->levelmeter_timeout_id = g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE, 50, on_signal_level_refresh_cb, data, NULL);
+}
+
+
+static void 
+audio_volume_window_hidden_cb (GtkWidget * /*widget*/,
+                               gpointer data)
+{
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (data);
+
+  Ekiga::AudioInputCore *audioinput_core = dynamic_cast<Ekiga::AudioInputCore *> (mw->priv->core->get ("audioinput-core"));
+  Ekiga::AudioOutputCore *audiooutput_core = dynamic_cast<Ekiga::AudioOutputCore *> (mw->priv->core->get ("audiooutput-core"));
+
+  g_source_remove (mw->priv->levelmeter_timeout_id);
+  audioinput_core->set_average_collection (false);
+  audiooutput_core->set_average_collection (false);
+}
+
+static void 
+video_settings_changed_cb (GtkAdjustment * /*adjustment*/,
+			   gpointer data)
+{ 
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (data);
+
+  Ekiga::VideoInputCore *videoinput_core = dynamic_cast<Ekiga::VideoInputCore *> (mw->priv->core->get ("videoinput-core"));
+
+  videoinput_core->set_whiteness ((unsigned) GTK_ADJUSTMENT (mw->priv->adj_whiteness)->value);
+  videoinput_core->set_brightness ((unsigned) GTK_ADJUSTMENT (mw->priv->adj_brightness)->value);
+  videoinput_core->set_colour ((unsigned) GTK_ADJUSTMENT (mw->priv->adj_colour)->value);
+  videoinput_core->set_contrast ((unsigned) GTK_ADJUSTMENT (mw->priv->adj_contrast)->value);
+}
+
+
+static void 
+panel_section_changed_cb (G_GNUC_UNUSED GtkNotebook *notebook,
+                          G_GNUC_UNUSED GtkNotebookPage *page,
+                          G_GNUC_UNUSED gint page_num,
+                          gpointer data) 
+{
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (data);
+  gint current_page = 0;
+
+  current_page = gtk_notebook_get_current_page (GTK_NOTEBOOK (mw->priv->main_notebook));
+  gm_conf_set_int (USER_INTERFACE_KEY "main_window/panel_section", current_page);
+}
+
+
+static void
+dialpad_button_clicked_cb (EkigaDialpad  * /* dialpad */,
+			   const gchar *button_text,
+			   EkigaMainWindow *mw)
+{
+  if (mw->priv->current_call)
+    mw->priv->current_call->send_dtmf (button_text[0]);
+  else
+    ekiga_main_window_append_call_url (mw, button_text);
+}
+
+
+static gint 
+window_closed_cb (G_GNUC_UNUSED GtkWidget *widget,
+		  G_GNUC_UNUSED GdkEvent *event,
+		  gpointer data)
+{
+  GtkStatusIcon *statusicon = NULL;
+  GtkWidget *main_window = NULL;
+
+  main_window = GnomeMeeting::Process ()->GetMainWindow ();
+  statusicon = GTK_STATUS_ICON (GnomeMeeting::Process ()->GetStatusicon ());
+
+  if (!gtk_status_icon_is_embedded (GTK_STATUS_ICON (statusicon)))
+    quit_callback (NULL, data);
+  else
+    gtk_widget_hide (GTK_WIDGET (data));
+
+  return (TRUE);
+}
+
+
+static void
+window_closed_from_menu_cb (GtkWidget *widget,
+                           gpointer data)
+{
+window_closed_cb (widget, NULL, data);
+}
+
+
+static void 
+zoom_in_changed_cb (G_GNUC_UNUSED GtkWidget *widget,
+		    gpointer data)
+{
+  GtkWidget *main_window = GnomeMeeting::Process ()->GetMainWindow ();
+  g_return_if_fail (main_window != NULL);
+
+  g_return_if_fail (data != NULL);
+
+  Ekiga::DisplayInfo display_info;
+
+  display_info.zoom = gm_conf_get_int ((char *) data);
+
+  if (display_info.zoom < 200)
+    display_info.zoom = display_info.zoom * 2;
+
+  gm_conf_set_int ((char *) data, display_info.zoom);
+  ekiga_main_window_zooms_menu_update_sensitivity (EKIGA_MAIN_WINDOW (main_window), display_info.zoom);
+}
+
+
+static void 
+zoom_out_changed_cb (G_GNUC_UNUSED GtkWidget *widget,
+		     gpointer data)
 {
+  GtkWidget *main_window = GnomeMeeting::Process ()->GetMainWindow ();
+  g_return_if_fail (main_window != NULL);
+
   g_return_if_fail (data != NULL);
 
-  if (gm_conf_entry_get_type (entry) == GM_CONF_BOOL) {
+  Ekiga::DisplayInfo display_info;
 
-    //gdk_threads_enter ();
-    if (gm_conf_entry_get_bool (entry)) 
-      gm_main_window_show_call_panel (GTK_WIDGET (data));
-    else 
-      gm_main_window_hide_call_panel (GTK_WIDGET (data));
+  display_info.zoom = gm_conf_get_int ((char *) data);
 
-    //gdk_threads_leave ();
-  }
+  if (display_info.zoom  > 50)
+    display_info.zoom  = (unsigned int) (display_info.zoom  / 2);
+
+  gm_conf_set_int ((char *) data, display_info.zoom);
+  ekiga_main_window_zooms_menu_update_sensitivity (EKIGA_MAIN_WINDOW (main_window), display_info.zoom);
 }
 
 
 static void 
-pull_trigger_cb (GtkWidget * /*widget*/,
-                 gpointer data)
+zoom_normal_changed_cb (G_GNUC_UNUSED GtkWidget *widget,
+			gpointer data)
 {
-  Ekiga::Trigger *trigger = (Ekiga::Trigger *) data;
+  GtkWidget *main_window = GnomeMeeting::Process ()->GetMainWindow ();
+  g_return_if_fail (main_window != NULL);
 
-  g_return_if_fail (trigger != NULL);
+  g_return_if_fail (data != NULL);
 
-  trigger->pull ();
+  Ekiga::DisplayInfo display_info;
+
+  display_info.zoom  = 100;
+
+  gm_conf_set_int ((char *) data, display_info.zoom);
+  ekiga_main_window_zooms_menu_update_sensitivity (EKIGA_MAIN_WINDOW (main_window), display_info.zoom);
 }
 
 
-static void 
-show_widget_cb (GtkWidget * /*widget*/,
-                gpointer data)
+void 
+display_changed_cb (GtkWidget *widget,
+		       gpointer data)
 {
+  GtkWidget *main_window = GnomeMeeting::Process ()->GetMainWindow ();
+  g_return_if_fail (main_window != NULL);
+
   g_return_if_fail (data != NULL);
 
-  gtk_widget_show_all (GTK_WIDGET (data));
-}
+  GSList *group = NULL;
+  int group_last_pos = 0;
+  int active = 0;
+  Ekiga::DisplayInfo display_info;
 
+  group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (widget));
+  group_last_pos = g_slist_length (group) - 1; /* If length 1, last pos is 0 */
 
-static void 
-hold_current_call_cb (G_GNUC_UNUSED GtkWidget *widget,
-		      gpointer data)
-{
-  GmMainWindow *mw = NULL;
+  /* Only do something when a new CHECK_MENU_ITEM becomes active,
+     not when it becomes inactive */
+  if (GTK_CHECK_MENU_ITEM (widget)->active) {
 
-  mw = gm_mw_get_mw (GTK_WIDGET (data));
+    while (group) {
+
+      if (group->data == widget) 
+	break;
+      
+      active++;
+      group = g_slist_next (group);
+    }
 
-  if (mw->current_call) {
-    mw->current_call->toggle_hold ();
+    gm_conf_set_int ((gchar *) data, group_last_pos - active);
   }
 }
 
 
-static void
-toggle_audio_stream_pause_cb (GtkWidget * /*widget*/,
-                              gpointer data)
+static void 
+fullscreen_changed_cb (G_GNUC_UNUSED GtkWidget *widget,
+		       G_GNUC_UNUSED gpointer data)
 {
-  GmMainWindow *mw = NULL;
-
-  mw = gm_mw_get_mw (GTK_WIDGET (data));
-
-  if (mw->current_call)
-    mw->current_call->toggle_stream_pause (Ekiga::Call::Audio);
+  GtkWidget* main_window = GnomeMeeting::Process()->GetMainWindow ();
+  g_return_if_fail (main_window != NULL);
+  gm_main_window_toggle_fullscreen (Ekiga::VO_FS_TOGGLE, main_window);
 }
 
 
 static void
-toggle_video_stream_pause_cb (GtkWidget * /*widget*/,
-                              gpointer data)
+url_changed_cb (GtkEditable *e,
+		gpointer data)
 {
-  GmMainWindow *mw = NULL;
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (data);
+  GtkTreeIter iter;
+  const char *tip_text = NULL;
+  gchar *entry = NULL;
 
-  mw = gm_mw_get_mw (GTK_WIDGET (data));
+  tip_text = gtk_entry_get_text (GTK_ENTRY (e));
 
-  if (mw->current_call)
-    mw->current_call->toggle_stream_pause (Ekiga::Call::Video);
-}
+  if (g_strrstr (tip_text, "@") == NULL) {
+
+    gtk_list_store_clear (mw->priv->completion);
+
+    for (std::list<std::string>::iterator it = mw->priv->accounts.begin ();
+         it != mw->priv->accounts.end ();
+         it++) {
+
+      entry = g_strdup_printf ("%s %s", tip_text, it->c_str ());
+      gtk_list_store_append (mw->priv->completion, &iter);
+      gtk_list_store_set (mw->priv->completion, &iter, 0, entry, -1);
+      g_free (entry);
+    }
+  }
 
+  gtk_widget_set_tooltip_text (GTK_WIDGET (e), tip_text);
+}
 
 
 static void 
-transfer_current_call_cb (G_GNUC_UNUSED GtkWidget *widget,
-			  gpointer data)
+toolbar_toggle_button_changed_cb (G_GNUC_UNUSED GtkWidget *widget,
+				  gpointer data)
 {
-  GtkWidget *main_window = NULL;
-  
-  g_return_if_fail (data != NULL);
-  
-  main_window = GnomeMeeting::Process ()->GetMainWindow ();
+  bool shown = gm_conf_get_bool ((gchar *) data);
 
-  gm_main_window_transfer_dialog_run (main_window, GTK_WIDGET (data), NULL);  
+  gm_conf_set_bool ((gchar *) data, !shown);
 }
 
 
 static gboolean 
-video_window_expose_cb (GtkWidget *main_window,
-                	G_GNUC_UNUSED GdkEventExpose *event,
-            		G_GNUC_UNUSED gpointer data)
+statusbar_clicked_cb (G_GNUC_UNUSED GtkWidget *widget,
+		      G_GNUC_UNUSED GdkEventButton *event,
+		      gpointer data)
 {
-  GmMainWindow *mw = NULL;
+  g_return_val_if_fail (EKIGA_IS_MAIN_WINDOW (data), FALSE);
 
-  if (!main_window) 
-    return FALSE;
+  ekiga_main_window_push_message (EKIGA_MAIN_WINDOW (data), NULL);
 
-  mw = gm_mw_get_mw (main_window);
-  if (!mw)
-    return FALSE;
+  return FALSE;
+}
 
-  GtkWidget* videoWidget = mw->main_video_image;
-  if (!GTK_WIDGET_REALIZED(videoWidget))
-    return FALSE;
 
-  if (!GDK_IS_WINDOW(mw->main_video_image->window))
-    return FALSE;
+/* Public functions */
+void 
+gm_main_window_press_dialpad (GtkWidget *main_window,
+			      const char c)
+{
+  guint key = 0;
 
-  Ekiga::DisplayInfo display_info;
-  display_info.x = mw->main_video_image->allocation.x;
-  display_info.y = mw->main_video_image->allocation.y;
-#ifdef WIN32  
-  display_info.hwnd = ((HWND)GDK_WINDOW_HWND (mw->main_video_image->window));
-#else 
-  if (!mw->video_widget_gc) { 
-    mw->video_widget_gc = gdk_gc_new(mw->main_video_image->window);
-    if ( mw->video_widget_gc == NULL)
-      return FALSE;
+  if (c == '*')
+    key = GDK_KP_Multiply;
+  else if (c == '#')
+    key = GDK_numbersign;
+  else
+    key = GDK_KP_0 + atoi (&c);
+
+  gtk_accel_groups_activate (G_OBJECT (main_window), key, (GdkModifierType) 0);
+}
 
-  }
 
-  if (GDK_GC_XGC(mw->video_widget_gc) == NULL)
-    return FALSE;
+GtkWidget*
+ekiga_main_window_get_video_widget (EkigaMainWindow *mw)
+{
+  g_return_val_if_fail (EKIGA_IS_MAIN_WINDOW (mw), NULL);
+  return mw->priv->main_video_image;
+}
 
-  display_info.gc = GDK_GC_XGC(mw->video_widget_gc);
-  display_info.xdisplay = GDK_GC_XDISPLAY (mw->video_widget_gc);
 
-  display_info.window = GDK_WINDOW_XWINDOW (mw->main_video_image->window);
-  if (display_info.window == 0)  //FIXME: Should be None
-    return FALSE;
+void 
+ekiga_main_window_update_logo_have_window (EkigaMainWindow *mw)
+{
+  g_return_if_fail (EKIGA_IS_MAIN_WINDOW (mw));
 
-  gdk_flush();
-#endif
-  display_info.widget_info_set = TRUE;
+  g_object_set (G_OBJECT (mw->priv->main_video_image),
+		"icon-name", GM_ICON_LOGO,
+		"pixel-size", 72,
+		NULL);
+  
+  gtk_widget_set_size_request (GTK_WIDGET (mw->priv->main_video_image),
+                               GM_QCIF_WIDTH, GM_QCIF_HEIGHT);
 
-  Ekiga::VideoOutputCore *videooutput_core = dynamic_cast<Ekiga::VideoOutputCore *> (mw->core.get ("videooutput-core"));
-  videooutput_core->set_display_info(display_info);
+  GdkRectangle rect;
+  rect.x = mw->priv->main_video_image->allocation.x;
+  rect.y = mw->priv->main_video_image->allocation.y;
+  rect.width = mw->priv->main_video_image->allocation.width;
+  rect.height = mw->priv->main_video_image->allocation.height;
 
-  return FALSE;
+  gdk_window_invalidate_rect (GTK_WIDGET (mw)->window, &rect , TRUE);
 }
 
-static void
-video_window_shown_cb (GtkWidget *w,
-		       gpointer data)
+
+void 
+ekiga_main_window_set_call_hold (EkigaMainWindow *mw,
+                                 bool is_on_hold)
 {
-  GmMainWindow *mw = NULL;
+  GtkWidget *child = NULL;
+  
+  g_return_if_fail (EKIGA_IS_MAIN_WINDOW (mw));
 
-  mw = gm_mw_get_mw (GTK_WIDGET (data));
+  child = GTK_BIN (gtk_menu_get_widget (mw->priv->main_menu, "hold_call"))->child;
 
-  if (gm_conf_get_bool (VIDEO_DISPLAY_KEY "stay_on_top")
-      && mw->current_call)
-    gdk_window_set_always_on_top (GDK_WINDOW (w->window), TRUE);
-}
+  if (is_on_hold) {
+
+    if (GTK_IS_LABEL (child))
+      gtk_label_set_text_with_mnemonic (GTK_LABEL (child),
+					_("_Retrieve Call"));
 
+    /* Set the audio and video menu to unsensitive */
+    gtk_menu_set_sensitive (mw->priv->main_menu, "suspend_audio", FALSE);
+    gtk_menu_set_sensitive (mw->priv->main_menu, "suspend_video", FALSE);
+    
+    ekiga_main_window_set_channel_pause (mw, TRUE, FALSE);
+    ekiga_main_window_set_channel_pause (mw, TRUE, TRUE);
+  }
+  else {
 
-static void 
-audio_volume_changed_cb (GtkAdjustment * /*adjustment*/,
-			 gpointer data)
-{
-  GmMainWindow *mw = NULL;
-  g_return_if_fail (data != NULL);
-  mw = gm_mw_get_mw (GTK_WIDGET (data));
+    if (GTK_IS_LABEL (child))
+      gtk_label_set_text_with_mnemonic (GTK_LABEL (child),
+					_("_Hold Call"));
 
-  Ekiga::AudioInputCore *audioinput_core = dynamic_cast<Ekiga::AudioInputCore *> (mw->core.get ("audioinput-core"));
-  Ekiga::AudioOutputCore *audiooutput_core = dynamic_cast<Ekiga::AudioOutputCore *> (mw->core.get ("audiooutput-core"));
+    gtk_menu_set_sensitive (mw->priv->main_menu, "suspend_audio", TRUE);
+    gtk_menu_set_sensitive (mw->priv->main_menu, "suspend_video", TRUE);
 
-  audiooutput_core->set_volume(Ekiga::primary, (unsigned)GTK_ADJUSTMENT (mw->adj_output_volume)->value);
-  audioinput_core->set_volume((unsigned)GTK_ADJUSTMENT (mw->adj_input_volume)->value);
+    ekiga_main_window_set_channel_pause (mw, FALSE, FALSE);
+    ekiga_main_window_set_channel_pause (mw, FALSE, TRUE);
+  }
+  
+  g_signal_handlers_block_by_func (G_OBJECT (mw->priv->hold_button),
+                                   (gpointer) hold_current_call_cb,
+                                   mw);
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (mw->priv->hold_button), 
+                                is_on_hold);
+  g_signal_handlers_unblock_by_func (G_OBJECT (mw->priv->hold_button),
+                                     (gpointer) hold_current_call_cb,
+                                     mw);
 }
 
-static void 
-audio_volume_window_shown_cb (GtkWidget * /*widget*/,
-	                      gpointer data)
+
+void 
+ekiga_main_window_set_channel_pause (EkigaMainWindow *mw,
+				     gboolean pause,
+				     gboolean is_video)
 {
-  GmMainWindow *mw = NULL;
-  g_return_if_fail (data != NULL);
-  mw = gm_mw_get_mw (GTK_WIDGET (data));
+  GtkWidget *widget = NULL;
+  GtkWidget *child = NULL;
+  gchar *msg = NULL;
+  
+  g_return_if_fail (EKIGA_IS_MAIN_WINDOW (mw));
+
+  if (!pause && !is_video)
+    msg = _("Suspend _Audio");
+  else if (!pause && is_video)
+    msg = _("Suspend _Video");
+  else if (pause && !is_video)
+    msg = _("Resume _Audio");
+  else if (pause && is_video)
+    msg = _("Resume _Video");
 
-  Ekiga::AudioInputCore *audioinput_core = dynamic_cast<Ekiga::AudioInputCore *> (mw->core.get ("audioinput-core"));
-  Ekiga::AudioOutputCore *audiooutput_core = dynamic_cast<Ekiga::AudioOutputCore *> (mw->core.get ("audiooutput-core"));
+  widget = gtk_menu_get_widget (mw->priv->main_menu,
+			        is_video ? "suspend_video" : "suspend_audio");
+  child = GTK_BIN (widget)->child; 
 
-  audioinput_core->set_average_collection(true);
-  audiooutput_core->set_average_collection(true);
-  mw->levelmeter_timeout_id = g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE, 50, on_signal_level_refresh_cb, data, NULL);
+  if (GTK_IS_LABEL (child)) 
+    gtk_label_set_text_with_mnemonic (GTK_LABEL (child), msg);
 }
 
 
-static void 
-audio_volume_window_hidden_cb (GtkWidget * /*widget*/,
-                               gpointer data)
+void
+ekiga_main_window_update_calling_state (EkigaMainWindow *mw,
+					unsigned calling_state)
 {
-  GmMainWindow *mw = NULL;
-  g_return_if_fail (data != NULL);
-  mw = gm_mw_get_mw (GTK_WIDGET (data));
+  g_return_if_fail (mw != NULL);
 
-  Ekiga::AudioInputCore *audioinput_core = dynamic_cast<Ekiga::AudioInputCore *> (mw->core.get ("audioinput-core"));
-  Ekiga::AudioOutputCore *audiooutput_core = dynamic_cast<Ekiga::AudioOutputCore *> (mw->core.get ("audiooutput-core"));
+  ekiga_main_window_selected_presentity_build_menu (mw);
+  switch (calling_state)
+    {
+    case Standby:
+      
+      /* Update the hold state */
+      ekiga_main_window_set_call_hold (mw, FALSE);
 
-  g_source_remove (mw->levelmeter_timeout_id);
-  audioinput_core->set_average_collection(false);
-  audiooutput_core->set_average_collection(false);
-}
+      /* Update the sensitivity, all channels are closed */
+      ekiga_main_window_update_sensitivity (mw, TRUE, FALSE, FALSE);
+      ekiga_main_window_update_sensitivity (mw, FALSE, FALSE, FALSE);
+      
+      /* Update the menus and toolbar items */
+      gtk_menu_set_sensitive (mw->priv->main_menu, "connect", TRUE);
+      gtk_menu_set_sensitive (mw->priv->main_menu, "disconnect", FALSE);
+      gtk_menu_section_set_sensitive (mw->priv->main_menu, "hold_call", FALSE);
+      gtk_widget_set_sensitive (GTK_WIDGET (mw->priv->hold_button), FALSE);
+      gtk_widget_set_sensitive (GTK_WIDGET (mw->priv->preview_button), TRUE);
+      
+      /* Update the connect button */
+      gm_connect_button_set_connected (GM_CONNECT_BUTTON (mw->priv->connect_button),
+				       FALSE);
+	
+      /* Destroy the transfer call popup */
+      if (mw->priv->transfer_call_popup) 
+	gtk_dialog_response (GTK_DIALOG (mw->priv->transfer_call_popup),
+			     GTK_RESPONSE_REJECT);
+      break;
 
-static void 
-video_settings_changed_cb (GtkAdjustment * /*adjustment*/,
-			   gpointer data)
-{ 
-  GmMainWindow *mw = NULL;
-  g_return_if_fail (data != NULL);
-  mw = gm_mw_get_mw (GTK_WIDGET (data));
-  g_return_if_fail (mw != NULL);
 
-  Ekiga::VideoInputCore *videoinput_core = dynamic_cast<Ekiga::VideoInputCore *> (mw->core.get ("videoinput-core"));
+    case Calling:
 
-  videoinput_core->set_whiteness ((unsigned) GTK_ADJUSTMENT (mw->adj_whiteness)->value);
-  videoinput_core->set_brightness ((unsigned) GTK_ADJUSTMENT (mw->adj_brightness)->value);
-  videoinput_core->set_colour ((unsigned) GTK_ADJUSTMENT (mw->adj_colour)->value);
-  videoinput_core->set_contrast ((unsigned) GTK_ADJUSTMENT (mw->adj_contrast)->value);
-}
+      /* Update the menus and toolbar items */
+      gtk_menu_set_sensitive (mw->priv->main_menu, "connect", FALSE);
+      gtk_menu_set_sensitive (mw->priv->main_menu, "disconnect", TRUE);
+      gtk_widget_set_sensitive (GTK_WIDGET (mw->priv->preview_button), FALSE);
 
+      /* Update the connect button */
+      gm_connect_button_set_connected (GM_CONNECT_BUTTON (mw->priv->connect_button),
+				       TRUE);
+      
+      break;
 
-static void 
-panel_section_changed_cb (G_GNUC_UNUSED GtkNotebook *notebook,
-                          G_GNUC_UNUSED GtkNotebookPage *page,
-                          G_GNUC_UNUSED gint page_num,
-                          gpointer data) 
-{
-  GmMainWindow *mw = NULL;
 
-  gint current_page = 0;
+    case Connected:
 
-  g_return_if_fail (data != NULL);
-  mw = gm_mw_get_mw (GTK_WIDGET (data));
+      /* Update the menus and toolbar items */
+      gtk_menu_set_sensitive (mw->priv->main_menu, "connect", FALSE);
+      gtk_menu_set_sensitive (mw->priv->main_menu, "disconnect", TRUE);
+      gtk_menu_section_set_sensitive (mw->priv->main_menu, "hold_call", TRUE);
+      gtk_widget_set_sensitive (GTK_WIDGET (mw->priv->hold_button), TRUE);
+      gtk_widget_set_sensitive (GTK_WIDGET (mw->priv->preview_button), FALSE);
 
-  current_page = 
-    gtk_notebook_get_current_page (GTK_NOTEBOOK (mw->main_notebook));
-  gm_conf_set_int (USER_INTERFACE_KEY "main_window/panel_section",
-		   current_page);
-}
+      /* Update the connect button */
+      gm_connect_button_set_connected (GM_CONNECT_BUTTON (mw->priv->connect_button),
+				       TRUE);
+      break;
 
 
-static void
-dialpad_button_clicked_cb (EkigaDialpad  * /* dialpad */,
-			   const gchar *button_text,
-			   GtkWidget   *main_window)
-{
-  GmMainWindow *mw = NULL;
+    case Called:
+
+      /* Update the menus and toolbar items */
+      gtk_menu_set_sensitive (mw->priv->main_menu, "disconnect", TRUE);
+
+      /* Update the connect button */
+      gm_connect_button_set_connected (GM_CONNECT_BUTTON (mw->priv->connect_button),
+				       FALSE);
+      
+      break;
 
-  mw = gm_mw_get_mw (main_window);
+    default:
+      break;
+    }
 
-  if (mw->current_call)
-    mw->current_call->send_dtmf (button_text[0]);
-  else
-    gm_main_window_append_call_url (main_window, button_text);
+  mw->priv->calling_state = calling_state;
 }
 
 
-static gint 
-window_closed_cb (G_GNUC_UNUSED GtkWidget *widget,
-		  G_GNUC_UNUSED GdkEvent *event,
-		  gpointer data)
+void
+ekiga_main_window_update_sensitivity (EkigaMainWindow *mw,
+				      bool is_video,
+				      bool /*is_receiving*/,
+				      bool is_transmitting)
 {
-  GtkStatusIcon *statusicon = NULL;
-  GtkWidget *main_window = NULL;
-
-  GmMainWindow *mw = NULL;
-
-  main_window = GnomeMeeting::Process ()->GetMainWindow ();
-  statusicon = GTK_STATUS_ICON (GnomeMeeting::Process ()->GetStatusicon ());
-  mw = gm_mw_get_mw (GTK_WIDGET (main_window));
+  g_return_if_fail (EKIGA_IS_MAIN_WINDOW (mw));
 
-  /* Hide in any case, but quit program when we don't have a status menu */
-  gtk_widget_hide (GTK_WIDGET (data));
-  if (!gtk_status_icon_is_embedded (GTK_STATUS_ICON (statusicon)))
-    quit_callback (NULL, data);
+  if (is_transmitting) {
 
-  return (TRUE);
-}
+    if (!is_video) 
+      gtk_menu_set_sensitive (mw->priv->main_menu, "suspend_audio", TRUE);
+    else 
+      gtk_menu_set_sensitive (mw->priv->main_menu, "suspend_video", TRUE);
+  }	
+  else {
 
+    if (!is_video)
+      gtk_menu_set_sensitive (mw->priv->main_menu, "suspend_audio", FALSE);
+    else
+      gtk_menu_set_sensitive (mw->priv->main_menu, "suspend_video", FALSE);
 
-static void
-window_closed_from_menu_cb (GtkWidget *widget,
-                           gpointer data)
-{
-window_closed_cb (widget, NULL, data);
+  }
 }
 
 
-static void 
-zoom_in_changed_cb (G_GNUC_UNUSED GtkWidget *widget,
-		    gpointer data)
+void
+gm_main_window_toggle_fullscreen (Ekiga::VideoOutputFSToggle toggle,
+                                  G_GNUC_UNUSED GtkWidget   *main_window)
 {
-  GtkWidget *main_window = GnomeMeeting::Process ()->GetMainWindow ();
-  g_return_if_fail (main_window != NULL);
+  Ekiga::VideoOutputMode videooutput_mode;
 
-  GmMainWindow *mw = gm_mw_get_mw (main_window);
-  g_return_if_fail (mw != NULL);
+  switch (toggle) {
+    case Ekiga::VO_FS_OFF:
+      if (gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view") == Ekiga::VO_MODE_FULLSCREEN) {
 
-  g_return_if_fail (data != NULL);
+        videooutput_mode = (Ekiga::VideoOutputMode) gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view_before_fullscreen");
+        gm_conf_set_int (VIDEO_DISPLAY_KEY "video_view", videooutput_mode);
+      }
+      break;
+    case Ekiga::VO_FS_ON:
+      if (gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view") != Ekiga::VO_MODE_FULLSCREEN) {
 
-  Ekiga::DisplayInfo display_info;
+        videooutput_mode = (Ekiga::VideoOutputMode) gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view");
+        gm_conf_set_int (VIDEO_DISPLAY_KEY "video_view_before_fullscreen", videooutput_mode);
+        gm_conf_set_int (VIDEO_DISPLAY_KEY "video_view", Ekiga::VO_MODE_FULLSCREEN);
+      }
+      break;
 
-  display_info.zoom = gm_conf_get_int ((char *) data);
+    case Ekiga::VO_FS_TOGGLE:
+    default:
+      if (gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view") == Ekiga::VO_MODE_FULLSCREEN) {
 
-  if (display_info.zoom < 200)
-    display_info.zoom = display_info.zoom * 2;
+        videooutput_mode = (Ekiga::VideoOutputMode) gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view_before_fullscreen");
+        gm_conf_set_int (VIDEO_DISPLAY_KEY "video_view", videooutput_mode);
+      }
+      else {
 
-  gm_conf_set_int ((char *) data, display_info.zoom);
-  gm_mw_zooms_menu_update_sensitivity (main_window, display_info.zoom);
+        videooutput_mode =  (Ekiga::VideoOutputMode) gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view");
+        gm_conf_set_int (VIDEO_DISPLAY_KEY "video_view_before_fullscreen", videooutput_mode);
+        gm_conf_set_int (VIDEO_DISPLAY_KEY "video_view", Ekiga::VO_MODE_FULLSCREEN);
+      }
+      break;
+  }
 }
 
 
 static void 
-zoom_out_changed_cb (G_GNUC_UNUSED GtkWidget *widget,
-		     gpointer data)
+ekiga_main_window_show_call_panel (EkigaMainWindow *mw)
 {
-  GtkWidget *main_window = GnomeMeeting::Process ()->GetMainWindow ();
-  g_return_if_fail (main_window != NULL);
-
-  GmMainWindow *mw = gm_mw_get_mw (main_window);
-  g_return_if_fail (mw != NULL);
+  GtkWidget *call_panel = gtk_paned_get_child2 (GTK_PANED (mw->priv->hpaned));
+  if (!GTK_WIDGET_VISIBLE (call_panel))
+    gtk_widget_show_all (call_panel);
+}
 
-  g_return_if_fail (data != NULL);
 
-  Ekiga::DisplayInfo display_info;
+static void 
+ekiga_main_window_hide_call_panel (EkigaMainWindow *mw)
+{
+  GtkRequisition req;
+  int x, y = 0;
 
-  display_info.zoom = gm_conf_get_int ((char *) data);
+  GtkWidget *call_panel = gtk_paned_get_child2 (GTK_PANED (mw->priv->hpaned));
 
-  if (display_info.zoom  > 50)
-    display_info.zoom  = (unsigned int) (display_info.zoom  / 2);
+  if (GTK_WIDGET_VISIBLE (call_panel)) {
 
-  gm_conf_set_int ((char *) data, display_info.zoom);
-  gm_mw_zooms_menu_update_sensitivity (main_window, display_info.zoom);
+    gtk_widget_size_request (call_panel, &req);
+    gtk_window_get_size (GTK_WINDOW (mw), &x, &y);
+    gtk_widget_hide (call_panel);
+    x = x - req.width;
+    gtk_window_resize (GTK_WINDOW (mw), x, y);
+  }
 }
 
 
-static void 
-zoom_normal_changed_cb (G_GNUC_UNUSED GtkWidget *widget,
-			gpointer data)
+void
+ekiga_main_window_set_busy (EkigaMainWindow *mw,
+			    bool busy)
 {
-  GtkWidget *main_window = GnomeMeeting::Process ()->GetMainWindow ();
-  g_return_if_fail (main_window != NULL);
-
-  GmMainWindow *mw = gm_mw_get_mw (main_window);
-  g_return_if_fail (mw != NULL);
+  GdkCursor *cursor = NULL;
 
-  g_return_if_fail (data != NULL);
+  g_return_if_fail (EKIGA_IS_MAIN_WINDOW (mw));
 
-  Ekiga::DisplayInfo display_info;
+  gtk_widget_set_sensitive (mw->priv->main_toolbar, !busy);
+  gtk_widget_set_sensitive (mw->priv->main_menu, !busy);
 
-  display_info.zoom  = 100;
+  if (busy) {
 
-  gm_conf_set_int ((char *) data, display_info.zoom);
-  gm_mw_zooms_menu_update_sensitivity (main_window, display_info.zoom);
+    cursor = gdk_cursor_new (GDK_WATCH);
+    gdk_window_set_cursor (GTK_WIDGET (mw)->window, cursor);
+    gdk_cursor_unref (cursor);
+  }
+  else
+    gdk_window_set_cursor (GTK_WIDGET (mw)->window, NULL);
 }
 
-
-void 
-display_changed_cb (GtkWidget *widget,
-		       gpointer data)
+void
+ekiga_main_window_clear_signal_levels (EkigaMainWindow *mw)
 {
-  GtkWidget *main_window = GnomeMeeting::Process ()->GetMainWindow ();
-  g_return_if_fail (main_window != NULL);
+  g_return_if_fail (EKIGA_IS_MAIN_WINDOW (mw));
 
-  GmMainWindow *mw = gm_mw_get_mw (main_window);
-  g_return_if_fail (mw != NULL);
-
-  g_return_if_fail (data != NULL);
+  gtk_levelmeter_clear (GTK_LEVELMETER (mw->priv->output_signal));
+  gtk_levelmeter_clear (GTK_LEVELMETER (mw->priv->input_signal));
+}
 
-  GSList *group = NULL;
-  int group_last_pos = 0;
-  int active = 0;
-  Ekiga::DisplayInfo display_info;
+static void
+ekiga_main_window_selected_presentity_build_menu (EkigaMainWindow *mw)
+{
+  GtkWidget *menu = gtk_menu_get_widget (mw->priv->main_menu, "contact");
 
-  group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (widget));
-  group_last_pos = g_slist_length (group) - 1; /* If length 1, last pos is 0 */
+  if (mw->priv->presentity != NULL) {
 
-  /* Only do something when a new CHECK_MENU_ITEM becomes active,
-     not when it becomes inactive */
-  if (GTK_CHECK_MENU_ITEM (widget)->active) {
+    MenuBuilderGtk builder;
+    gtk_widget_set_sensitive (menu, TRUE);
+    if (mw->priv->presentity->populate_menu (builder)) {
 
-    while (group) {
+      gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu), builder.menu);
+      gtk_widget_show_all (builder.menu);
+    } 
+    else {
 
-      if (group->data == widget) 
-	break;
-      
-      active++;
-      group = g_slist_next (group);
+      gtk_widget_set_sensitive (menu, FALSE);
+      g_object_unref (builder.menu);
     }
+  } 
+  else {
 
-    gm_conf_set_int ((gchar *) data, group_last_pos - active);
+    gtk_widget_set_sensitive (menu, FALSE);
+    gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu), NULL);
   }
 }
 
 
-static void 
-fullscreen_changed_cb (G_GNUC_UNUSED GtkWidget *widget,
-		       G_GNUC_UNUSED gpointer data)
-{
-  GtkWidget* main_window = GnomeMeeting::Process()->GetMainWindow ();
-  g_return_if_fail (main_window != NULL);
-  gm_main_window_toggle_fullscreen (Ekiga::VO_FS_TOGGLE, main_window);
-}
-
-
 static void
-url_changed_cb (GtkEditable  *e,
-		gpointer data)
+ekiga_main_window_incoming_call_dialog_show (EkigaMainWindow *mw,
+                                             Ekiga::Call & call)
 {
-  GmMainWindow *mw = NULL;
-
-  GtkTreeIter iter;
-  const char *tip_text = NULL;
-  gchar *entry = NULL;
+  GdkPixbuf *pixbuf = NULL;
 
-  g_return_if_fail (data != NULL);
-  mw = gm_mw_get_mw (GTK_WIDGET (data));
+  GtkWidget *label = NULL;
+  GtkWidget *vbox = NULL;
+  GtkWidget *b1 = NULL;
+  GtkWidget *b2 = NULL;
+  GtkWidget *incoming_call_popup = NULL;
 
-  tip_text = gtk_entry_get_text (GTK_ENTRY (e));
+  gchar *msg = NULL;
 
-  if (g_strrstr (tip_text, "@") == NULL) {
+  // FIXME could the call become invalid ?
+  const char *utf8_name = call.get_remote_party_name ().c_str ();
+  const char *utf8_app = call.get_remote_application ().c_str ();
+  const char *utf8_url = call.get_remote_uri ().c_str ();
+  const char *utf8_local = call.get_local_party_name ().c_str ();
 
-    gtk_list_store_clear (mw->completion);
+  g_return_if_fail (EKIGA_IS_MAIN_WINDOW (mw));
 
-    for (std::list<std::string>::iterator it = mw->accounts.begin ();
-         it != mw->accounts.end ();
-         it++) {
+  incoming_call_popup = gtk_dialog_new ();
+  b2 = gtk_dialog_add_button (GTK_DIALOG (incoming_call_popup),
+			      _("Reject"), 0);
+  b1 = gtk_dialog_add_button (GTK_DIALOG (incoming_call_popup),
+			      _("Accept"), 2);
 
-      entry = g_strdup_printf ("%s %s", tip_text, it->c_str ());
-      gtk_list_store_append (mw->completion, &iter);
-      gtk_list_store_set (mw->completion, &iter, 0, entry, -1);
-      g_free (entry);
-    }
-  }
+  gtk_dialog_set_default_response (GTK_DIALOG (incoming_call_popup), 2);
 
-  gtk_widget_set_tooltip_text (GTK_WIDGET (e), tip_text);
-}
+  vbox = GTK_DIALOG (incoming_call_popup)->vbox;
 
+  msg = g_strdup_printf ("%s <i>%s</i>", _("Incoming call from"), (const char*) utf8_name);
+  label = gtk_label_new (NULL);
+  gtk_label_set_markup (GTK_LABEL (label), msg);
+  gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 10);
+  gtk_misc_set_alignment (GTK_MISC (label), 0.5, 0.0);
+  gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+  g_free (msg);
 
-static void 
-toolbar_toggle_button_changed_cb (G_GNUC_UNUSED GtkWidget *widget,
-				  gpointer data)
-{
-  bool shown = gm_conf_get_bool ((gchar *) data);
+  pixbuf = gtk_widget_render_icon (GTK_WIDGET (incoming_call_popup),
+				   GM_STOCK_PHONE_PICK_UP_16,
+				   GTK_ICON_SIZE_MENU, NULL);
+  gtk_window_set_icon (GTK_WINDOW (incoming_call_popup), pixbuf);
+  g_object_unref (pixbuf);
 
-  gm_conf_set_bool ((gchar *) data, !shown);
-}
+  if (utf8_url) {
+    
+    label = gtk_label_new (NULL);
+    msg = g_strdup_printf ("<b>%s</b> <span foreground=\"blue\"><u>%s</u></span>",
+                           _("Remote URI:"), utf8_url);
+    gtk_label_set_markup (GTK_LABEL (label), msg);
+    gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+    gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 2);
+    gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
+    g_free (msg);
+  }
 
+  if (utf8_app) {
 
-static gboolean 
-statusbar_clicked_cb (G_GNUC_UNUSED GtkWidget *widget,
-		      G_GNUC_UNUSED GdkEventButton *event,
-		      gpointer data)
-{
-  GmMainWindow *mw = NULL;
+    label = gtk_label_new (NULL);
+    msg = g_strdup_printf ("<b>%s</b> %s",
+			   _("Remote Application:"), utf8_app);
+    gtk_label_set_markup (GTK_LABEL (label), msg);
+    gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+    gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 2);
+    gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
+    g_free (msg);
+  }
 
-  g_return_val_if_fail (data != NULL, TRUE);
+  if (utf8_local) {
+    
+    label = gtk_label_new (NULL);
+    msg =
+      g_strdup_printf ("<b>%s</b> %s",
+		       _("Account ID:"), utf8_local);
+    gtk_label_set_markup (GTK_LABEL (label), msg);
+    gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+    gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 2);
+    gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
+    g_free (msg);
+  }
 
-  mw = gm_mw_get_mw (GTK_WIDGET (data));
+  msg = g_strdup_printf (_("Call from %s"), (const char*) utf8_name);
+  gtk_window_set_title (GTK_WINDOW (incoming_call_popup), msg);
+  g_free (msg);
+  gtk_window_set_modal (GTK_WINDOW (incoming_call_popup), TRUE);
+  gtk_window_set_keep_above (GTK_WINDOW (incoming_call_popup), TRUE);
+  gtk_window_set_urgency_hint (GTK_WINDOW (mw), TRUE);
+  gtk_window_set_transient_for (GTK_WINDOW (incoming_call_popup),
+				GTK_WINDOW (mw));
 
-  g_return_val_if_fail (GTK_WIDGET (data), TRUE);
+  gtk_widget_show_all (incoming_call_popup);
 
-  gm_main_window_push_message (GTK_WIDGET (data), NULL);
+  g_signal_connect (G_OBJECT (incoming_call_popup), "delete_event",
+                    G_CALLBACK (gtk_widget_hide_on_delete), NULL);
+  g_signal_connect (G_OBJECT (incoming_call_popup), "response",
+                    GTK_SIGNAL_FUNC (incoming_call_response_cb), &call);
 
-  return FALSE;
+  call.cleared.connect (sigc::bind (sigc::ptr_fun (on_cleared_incoming_call_cb),
+                                    (gpointer) incoming_call_popup));
+  call.missed.connect (sigc::bind (sigc::ptr_fun (on_missed_incoming_call_cb), 
+                                   (gpointer) incoming_call_popup));
 }
 
 
-static gboolean
-main_window_focus_event_cb (GtkWidget *main_window,
-			    G_GNUC_UNUSED GdkEventFocus *event,
-			    G_GNUC_UNUSED gpointer user_data)
+#ifdef HAVE_NOTIFY
+static void
+notify_action_cb (NotifyNotification *notification,
+                  gchar *action,
+                  gpointer data)
 {
-  if (gtk_window_get_urgency_hint (GTK_WINDOW (main_window)))
-      gtk_window_set_urgency_hint (GTK_WINDOW (main_window), FALSE);
+  Ekiga::Call *call = (Ekiga::Call *) data;
 
-  return FALSE;
+  notify_notification_close (notification, NULL);
+
+  if (call) {
+
+    if (!strcmp (action, "accept"))
+      call->answer ();
+    else
+      call->hangup ();
+  }
 }
 
 
-/* Public functions */
-void 
-gm_main_window_press_dialpad (GtkWidget *main_window,
-			      const char c)
+static void
+closed_cb (NotifyNotification* /*notify*/, 
+           gpointer main_window)
 {
-  guint key = 0;
+  EkigaMainWindow *mw;
 
-  if (c == '*')
-    key = GDK_KP_Multiply;
-  else if (c == '#')
-    key = GDK_numbersign;
-  else
-    key = GDK_KP_0 + atoi (&c);
+  g_return_if_fail (main_window != NULL);
 
-  gtk_accel_groups_activate (G_OBJECT (main_window), key, (GdkModifierType) 0);
-}
+  mw = EKIGA_MAIN_WINDOW (main_window);
 
+  Ekiga::AudioOutputCore *audiooutput_core = dynamic_cast<Ekiga::AudioOutputCore *> (mw->priv->core->get ("audiooutput-core"));
+  if (audiooutput_core) 
+    audiooutput_core->stop_play_event ("incoming_call_sound");
+}
 
-GtkWidget*
-gm_main_window_get_video_widget (GtkWidget *main_window)
+static void
+ekiga_main_window_incoming_call_notify (EkigaMainWindow *mw,
+                                        Ekiga::Call & call)
 {
-  GmMainWindow *mw = NULL;
+  NotifyNotification *notify = NULL;
   
-  g_return_val_if_fail (main_window != NULL, NULL);
-  mw = gm_mw_get_mw (main_window);
-  g_return_val_if_fail (mw != NULL, NULL);
+  GtkStatusIcon *statusicon = NULL;
 
-  return mw->main_video_image;
-}
+  gchar *uri = NULL;
+  gchar *app = NULL;
+  gchar *account = NULL;
+  gchar *body = NULL;
+  gchar *title = NULL;
 
+  statusicon = GTK_STATUS_ICON (GnomeMeeting::Process ()->GetStatusicon ());
 
-void 
-gm_main_window_update_logo_have_window (GtkWidget *main_window)
-{
-  GmMainWindow *mw = NULL;
+  // FIXME could the call become invalid ?
+  const char *utf8_name = call.get_remote_party_name ().c_str ();
+  const char *utf8_app = call.get_remote_application ().c_str ();
+  const char *utf8_url = call.get_remote_uri ().c_str ();
+  const char *utf8_local = call.get_local_party_name ().c_str ();
 
-  g_return_if_fail (main_window != NULL);
+  title = g_strdup_printf ("%s %s", _("Incoming call from"), (const char*) utf8_name);
 
-  mw = gm_mw_get_mw (main_window);
-  g_return_if_fail (mw != NULL);
+  if (utf8_url)
+    uri = g_strdup_printf ("<b>%s</b> %s", _("Remote URI:"), utf8_url);
+  if (utf8_app)
+    app = g_strdup_printf ("<b>%s</b> %s", _("Remote Application:"), utf8_app);
+  if (utf8_local)
+    account = g_strdup_printf ("<b>%s</b> %s", _("Account ID:"), utf8_local);
 
-  g_object_set (G_OBJECT (mw->main_video_image),
-		"icon-name", GM_ICON_LOGO,
-		"pixel-size", 72,
-		NULL);
+  body = g_strdup_printf ("%s\n%s\n%s", uri, app, account);
   
-  gtk_widget_set_size_request (GTK_WIDGET (mw->main_video_image),
-                               GM_QCIF_WIDTH, GM_QCIF_HEIGHT);
+  notify = notify_notification_new (title, body, GM_ICON_LOGO, NULL);
+  notify_notification_add_action (notify, "accept", _("Accept"), notify_action_cb, &call, NULL);
+  notify_notification_add_action (notify, "reject", _("Reject"), notify_action_cb, &call, NULL);
+  notify_notification_set_timeout (notify, NOTIFY_EXPIRES_NEVER);
+  notify_notification_set_urgency (notify, NOTIFY_URGENCY_CRITICAL);
+  notify_notification_attach_to_status_icon (notify, statusicon);
+  if (!notify_notification_show (notify, NULL)) {
+    ekiga_main_window_incoming_call_dialog_show (mw, call);
+  }
+  else {
+    call.cleared.connect (sigc::bind (sigc::ptr_fun (on_cleared_incoming_call_cb),
+                                      (gpointer) notify));
+    call.missed.connect (sigc::bind (sigc::ptr_fun (on_missed_incoming_call_cb), 
+                                     (gpointer) notify));
+  }
 
-  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;
+  g_signal_connect (notify, "closed", G_CALLBACK (closed_cb), mw);
 
-  gdk_window_invalidate_rect (GDK_WINDOW (main_window->window), &rect , TRUE);
+  g_free (uri);
+  g_free (app);
+  g_free (account);
+  g_free (title);
+  g_free (body);
 }
-
+#endif
 
 void 
-gm_main_window_set_call_hold (GtkWidget *main_window,
-                              bool is_on_hold)
+ekiga_main_window_set_panel_section (EkigaMainWindow *mw,
+                                     int section)
 {
-  GmMainWindow *mw = NULL;
-  
-  GtkWidget *child = NULL;
-  
-  
-  g_return_if_fail (main_window != NULL);
-  
-  mw = gm_mw_get_mw (main_window);
-  
-  g_return_if_fail (mw != NULL);
+  GtkWidget *menu = NULL;
   
+  g_return_if_fail (EKIGA_MAIN_WINDOW (mw));
   
-  child = GTK_BIN (gtk_menu_get_widget (mw->main_menu, "hold_call"))->child;
-
-  if (is_on_hold) {
-
-    if (GTK_IS_LABEL (child))
-      gtk_label_set_text_with_mnemonic (GTK_LABEL (child),
-					_("_Retrieve Call"));
-
-    /* Set the audio and video menu to unsensitive */
-    gtk_menu_set_sensitive (mw->main_menu, "suspend_audio", FALSE);
-    gtk_menu_set_sensitive (mw->main_menu, "suspend_video", FALSE);
-    
-    gm_main_window_set_channel_pause (main_window, TRUE, FALSE);
-    gm_main_window_set_channel_pause (main_window, TRUE, TRUE);
-  }
-  else {
-
-    if (GTK_IS_LABEL (child))
-      gtk_label_set_text_with_mnemonic (GTK_LABEL (child),
-					_("_Hold Call"));
-
-    gtk_menu_set_sensitive (mw->main_menu, "suspend_audio", TRUE);
-    gtk_menu_set_sensitive (mw->main_menu, "suspend_video", TRUE);
-
-    gm_main_window_set_channel_pause (main_window, FALSE, FALSE);
-    gm_main_window_set_channel_pause (main_window, FALSE, TRUE);
-  }
+  gtk_notebook_set_current_page (GTK_NOTEBOOK (mw->priv->main_notebook), section);
   
-  g_signal_handlers_block_by_func (G_OBJECT (mw->hold_button),
-                                   (gpointer) hold_current_call_cb,
-                                   main_window);
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (mw->hold_button), 
-                                is_on_hold);
-  g_signal_handlers_unblock_by_func (G_OBJECT (mw->hold_button),
-                                     (gpointer) hold_current_call_cb,
-                                     main_window);
+  menu = gtk_menu_get_widget (mw->priv->main_menu, "dialpad");
+  gtk_radio_menu_select_with_widget (GTK_WIDGET (menu), section);
 }
 
 
 void 
-gm_main_window_set_channel_pause (GtkWidget *main_window,
-				  gboolean pause,
-				  gboolean is_video)
+ekiga_main_window_set_call_info (EkigaMainWindow *mw,
+				const char *tr_audio_codec,
+				G_GNUC_UNUSED const char *re_audio_codec,
+				const char *tr_video_codec,
+				G_GNUC_UNUSED const char *re_video_codec)
 {
-  GmMainWindow *mw = NULL;
-  
-  GtkWidget *child = NULL;
-
-  gchar *msg = NULL;
-  
-  g_return_if_fail (main_window != NULL);
+  GtkTextIter iter;
+  GtkTextIter *end_iter = NULL;
+  GtkTextBuffer *buffer = NULL;
   
-  mw = gm_mw_get_mw (main_window);
+  gchar *info = NULL;
   
-  g_return_if_fail (mw != NULL);
+  g_return_if_fail (EKIGA_IS_MAIN_WINDOW (mw));
   
-
-  if (!pause && !is_video)
-    msg = g_strdup (_("Suspend _Audio"));
-  else if (!pause && is_video)
-    msg = g_strdup (_("Suspend _Video"));
-  else if (pause && !is_video)
-    msg = g_strdup (_("Resume _Audio"));
-  else if (pause && is_video)
-    msg = g_strdup (_("Resume _Video"));
-
+  if (!tr_audio_codec && !tr_video_codec)
+    info = g_strdup (" ");
+  else
+    info = g_strdup_printf ("%s - %s",
+                            tr_audio_codec?tr_audio_codec:"", 
+                            tr_video_codec?tr_video_codec:"");
   
-  if (is_video) {
-    
-    child =
-      GTK_BIN (gtk_menu_get_widget (mw->main_menu, "suspend_video"))->child;
-  }
-  else {
-    
-    child =
-      GTK_BIN (gtk_menu_get_widget (mw->main_menu, "suspend_audio"))->child;
-  }
-	
-
-  if (GTK_IS_LABEL (child)) 
-    gtk_label_set_text_with_mnemonic (GTK_LABEL (child),
-				      msg);
-
-  g_free (msg);
+  buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (mw->priv->info_text));
+  gtk_text_buffer_get_start_iter (buffer, &iter);
+  gtk_text_iter_forward_lines (&iter, 2);
+  end_iter = gtk_text_iter_copy (&iter);
+  gtk_text_iter_forward_line (end_iter);
+  gtk_text_buffer_delete (buffer, &iter, end_iter);
+  gtk_text_iter_free (end_iter);
+  gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, info, 
+                                            -1, "codecs", NULL);
+  g_free (info);
 }
 
 
-void
-gm_main_window_update_calling_state (GtkWidget *main_window,
-				     unsigned calling_state)
+void 
+ekiga_main_window_set_status (EkigaMainWindow *mw,
+			      const char *status)
 {
-  GmMainWindow *mw = NULL;
-  
-  g_return_if_fail (main_window != NULL);
-
-  mw = gm_mw_get_mw (main_window);
-
-  g_return_if_fail (mw!= NULL);
-
-  gm_main_window_selected_presentity_build_menu (main_window);
-  switch (calling_state)
-    {
-    case Standby:
-      
-      /* Update the hold state */
-      gm_main_window_set_call_hold (main_window, FALSE);
-
-      /* Update the sensitivity, all channels are closed */
-      gm_main_window_update_sensitivity (main_window, TRUE, FALSE, FALSE);
-      gm_main_window_update_sensitivity (main_window, FALSE, FALSE, FALSE);
-      
-      /* Update the menus and toolbar items */
-      gtk_menu_set_sensitive (mw->main_menu, "connect", TRUE);
-      gtk_menu_set_sensitive (mw->main_menu, "disconnect", FALSE);
-      gtk_menu_section_set_sensitive (mw->main_menu, "hold_call", FALSE);
-      gtk_widget_set_sensitive (GTK_WIDGET (mw->hold_button), FALSE);
-      gtk_widget_set_sensitive (GTK_WIDGET (mw->preview_button), TRUE);
-      
-      /* Update the connect button */
-      gm_connect_button_set_connected (GM_CONNECT_BUTTON (mw->connect_button),
-				       FALSE);
-	
-      /* Destroy the transfer call popup */
-      if (mw->transfer_call_popup) 
-	gtk_dialog_response (GTK_DIALOG (mw->transfer_call_popup),
-			     GTK_RESPONSE_REJECT);
-
-      break;
-
-
-    case Calling:
-
-      /* Update the menus and toolbar items */
-      gtk_menu_set_sensitive (mw->main_menu, "connect", FALSE);
-      gtk_menu_set_sensitive (mw->main_menu, "disconnect", TRUE);
-      gtk_widget_set_sensitive (GTK_WIDGET (mw->preview_button), FALSE);
-
-      /* Update the connect button */
-      gm_connect_button_set_connected (GM_CONNECT_BUTTON (mw->connect_button),
-				       TRUE);
-
-      break;
-
-
-    case Connected:
-
-      /* Update the menus and toolbar items */
-      gtk_menu_set_sensitive (mw->main_menu, "connect", FALSE);
-      gtk_menu_set_sensitive (mw->main_menu, "disconnect", TRUE);
-      gtk_menu_section_set_sensitive (mw->main_menu, "hold_call", TRUE);
-      gtk_widget_set_sensitive (GTK_WIDGET (mw->hold_button), TRUE);
-      gtk_widget_set_sensitive (GTK_WIDGET (mw->preview_button), FALSE);
-
-      /* Update the connect button */
-      gm_connect_button_set_connected (GM_CONNECT_BUTTON (mw->connect_button),
-				       TRUE);
-
-      break;
-
-
-    case Called:
-
-      /* Update the menus and toolbar items */
-      gtk_menu_set_sensitive (mw->main_menu, "disconnect", TRUE);
-
-      /* Update the connect button */
-      gm_connect_button_set_connected (GM_CONNECT_BUTTON (mw->connect_button),
-				       FALSE);
-
-      break;
-
-    default:
-      break;
-    }
+  GtkTextIter iter;
+  GtkTextIter* end_iter = NULL;
+  GtkTextBuffer *buffer = NULL;
 
-  mw->calling_state = calling_state;
+  gchar *info = NULL;
+  
+  g_return_if_fail (EKIGA_IS_MAIN_WINDOW (mw));
+  
+  info = g_strdup_printf ("%s\n", status);
+  
+  buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (mw->priv->info_text));
+  gtk_text_buffer_get_start_iter (buffer, &iter);
+  end_iter = gtk_text_iter_copy (&iter);
+  gtk_text_iter_forward_line (end_iter);
+  gtk_text_buffer_delete (buffer, &iter, end_iter);
+  gtk_text_iter_free (end_iter);
+  gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, info, 
+                                            -1, "status", NULL);
+  g_free (info);
 }
 
 
-void
-gm_main_window_update_sensitivity (GtkWidget *main_window,
-				   bool is_video,
-				   bool /*is_receiving*/,
-				   bool is_transmitting)
+void 
+ekiga_main_window_set_call_duration (EkigaMainWindow *mw,
+                                     const char *duration)
 {
-  GmMainWindow *mw = NULL;
-  
-  mw = gm_mw_get_mw (main_window);
-
-  g_return_if_fail (mw != NULL);
+  GtkTextIter iter;
+  GtkTextIter* end_iter = NULL;
+  GtkTextBuffer *buffer = NULL;
 
-  if (is_transmitting) {
+  gchar *info = NULL;
 
-    if (!is_video) 
-      gtk_menu_set_sensitive (mw->main_menu, "suspend_audio", TRUE);
-    else 
-      gtk_menu_set_sensitive (mw->main_menu, "suspend_video", TRUE);
-  }	
-  else {
+  g_return_if_fail (EKIGA_IS_MAIN_WINDOW (mw));
+  
+  if (duration)
+    info = g_strdup_printf (_("Call Duration: %s\n"), duration);
+  else
+    info = g_strdup ("\n");
 
-    if (!is_video)
-      gtk_menu_set_sensitive (mw->main_menu, "suspend_audio", FALSE);
-    else
-      gtk_menu_set_sensitive (mw->main_menu, "suspend_video", FALSE);
+  buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (mw->priv->info_text));
+  gtk_text_buffer_get_start_iter (buffer, &iter);
+  gtk_text_iter_forward_line (&iter);
+  end_iter = gtk_text_iter_copy (&iter);
+  gtk_text_iter_forward_line (end_iter);
+  gtk_text_buffer_delete (buffer, &iter, end_iter);
+  gtk_text_iter_free (end_iter);
+  gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, info, 
+                                            -1, "call-duration", NULL);
 
-  }
+  g_free (info);
 }
 
 
-void
-gm_main_window_toggle_fullscreen (Ekiga::VideoOutputFSToggle toggle,
-                                  GtkWidget   *main_window)
+gboolean 
+ekiga_main_window_transfer_dialog_run (EkigaMainWindow *mw,
+				       GtkWidget *parent_window,
+				       const char *u)
 {
-  GmMainWindow *mw = gm_mw_get_mw (main_window);
-  g_return_if_fail (mw != NULL);
-
-  Ekiga::VideoOutputMode videooutput_mode;
+  gint answer = 0;
+  
+  const char *forward_url = NULL;
 
-  switch (toggle) {
-    case Ekiga::VO_FS_OFF:
-      if (gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view") == Ekiga::VO_MODE_FULLSCREEN) {
+  g_return_val_if_fail (EKIGA_IS_MAIN_WINDOW (mw), FALSE);
+  g_return_val_if_fail (GTK_IS_WINDOW (parent_window), FALSE);
+  
+  mw->priv->transfer_call_popup = 
+    gm_entry_dialog_new (_("Transfer call to:"),
+			 _("Transfer"));
+  
+  gtk_window_set_transient_for (GTK_WINDOW (mw->priv->transfer_call_popup),
+				GTK_WINDOW (parent_window));
+  
+  gtk_dialog_set_default_response (GTK_DIALOG (mw->priv->transfer_call_popup),
+				   GTK_RESPONSE_ACCEPT);
+  
+  if (u && !strcmp (u, ""))
+    gm_entry_dialog_set_text (GM_ENTRY_DIALOG (mw->priv->transfer_call_popup), u);
+  else
+    gm_entry_dialog_set_text (GM_ENTRY_DIALOG (mw->priv->transfer_call_popup), "sip:");
 
-        videooutput_mode = (Ekiga::VideoOutputMode) gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view_before_fullscreen");
-        gm_conf_set_int (VIDEO_DISPLAY_KEY "video_view", videooutput_mode);
-      }
-      break;
-    case Ekiga::VO_FS_ON:
-      if (gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view") != Ekiga::VO_MODE_FULLSCREEN) {
+  gnomemeeting_threads_dialog_show (mw->priv->transfer_call_popup);
 
-        videooutput_mode = (Ekiga::VideoOutputMode) gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view");
-        gm_conf_set_int (VIDEO_DISPLAY_KEY "video_view_before_fullscreen", videooutput_mode);
-        gm_conf_set_int (VIDEO_DISPLAY_KEY "video_view", Ekiga::VO_MODE_FULLSCREEN);
-      }
-      break;
+  answer = gtk_dialog_run (GTK_DIALOG (mw->priv->transfer_call_popup));
+  switch (answer) {
 
-    case Ekiga::VO_FS_TOGGLE:
-    default:
-      if (gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view") == Ekiga::VO_MODE_FULLSCREEN) {
+  case GTK_RESPONSE_ACCEPT:
 
-        videooutput_mode = (Ekiga::VideoOutputMode) gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view_before_fullscreen");
-        gm_conf_set_int (VIDEO_DISPLAY_KEY "video_view", videooutput_mode);
-      }
-      else {
+    forward_url = gm_entry_dialog_get_text (GM_ENTRY_DIALOG (mw->priv->transfer_call_popup));
+    if (strcmp (forward_url, "") && mw->priv->current_call)
+      mw->priv->current_call->transfer (forward_url);
+    break;
 
-        videooutput_mode =  (Ekiga::VideoOutputMode) gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view");
-        gm_conf_set_int (VIDEO_DISPLAY_KEY "video_view_before_fullscreen", videooutput_mode);
-        gm_conf_set_int (VIDEO_DISPLAY_KEY "video_view", Ekiga::VO_MODE_FULLSCREEN);
-      }
-      break;
+  default:
+    break;
   }
+
+  gtk_widget_destroy (mw->priv->transfer_call_popup);
+  mw->priv->transfer_call_popup = NULL;
+
+  return (answer == GTK_RESPONSE_ACCEPT);
 }
 
 
 static void 
-gm_main_window_show_call_panel (GtkWidget *self)
+ekiga_main_window_add_device_dialog_show (EkigaMainWindow *mw,
+                                          const Ekiga::Device & device,
+                                          DeviceType device_type)
 {
-  GmMainWindow *mw = NULL;
-
-  mw = gm_mw_get_mw (GTK_WIDGET (self));
+  GtkWidget *label = NULL;
+  GtkWidget *vbox = NULL;
+  GtkWidget *b1 = NULL;
+  GtkWidget *b2 = NULL;
+  GtkWidget *add_device_popup = NULL;
 
-  if (!GTK_WIDGET_VISIBLE (gtk_paned_get_child2 (GTK_PANED (mw->hpaned)))) {
-    gtk_widget_show_all (gtk_paned_get_child2 (GTK_PANED (mw->hpaned)));
-  }
-}
+  g_return_if_fail (EKIGA_IS_MAIN_WINDOW (mw));
 
+  add_device_popup = gtk_dialog_new ();
+  b2 = gtk_dialog_add_button (GTK_DIALOG (add_device_popup),
+			      _("No"), 0);
+  b1 = gtk_dialog_add_button (GTK_DIALOG (add_device_popup),
+			      _("Yes"), 2);
 
-static void 
-gm_main_window_hide_call_panel (GtkWidget *self)
-{
-  GmMainWindow *mw = NULL;
-  GtkRequisition req;
-  int x, y = 0;
+  gtk_dialog_set_default_response (GTK_DIALOG (add_device_popup), 2);
 
-  mw = gm_mw_get_mw (GTK_WIDGET (self));
+  vbox = GTK_DIALOG (add_device_popup)->vbox;
 
-  if (GTK_WIDGET_VISIBLE (gtk_paned_get_child2 (GTK_PANED (mw->hpaned)))) {
+  std::string msg;
+  std::string title;
 
-    gtk_widget_size_request (gtk_paned_get_child2 (GTK_PANED (mw->hpaned)), &req);
-    gtk_window_get_size (GTK_WINDOW (self), &x, &y);
-    gtk_widget_hide (gtk_paned_get_child2 (GTK_PANED (mw->hpaned)));
-    x = x - req.width;
-    gtk_window_resize (GTK_WINDOW (self), x, y);
+  switch (device_type) {
+    case AudioInput:
+      msg = _("Detected new audio input device:");
+      title = _("Audio Devices");
+      break;
+    case AudioOutput:
+      msg = _("Detected new audio output device:");
+      title = _("Audio Devices");
+      break;
+    case VideoInput:
+      msg = _("Detected new video input device:");
+      title = _("Video Devices");
+      break;
+    default:
+      break;
   }
-}
+  label = gtk_label_new (NULL);
+  gtk_label_set_markup (GTK_LABEL (label), msg.c_str());
+  gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 2);
+  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
+  gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+  
+  msg  = "<b>" + device.GetString() + "</b>";
+  label = gtk_label_new (NULL);
+  gtk_label_set_markup (GTK_LABEL (label), msg.c_str());
+  gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 2);
+  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
+  gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+
+  msg  = _("Do you want to use it as default device?");
+  label = gtk_label_new (NULL);
+  gtk_label_set_markup (GTK_LABEL (label), msg.c_str());
+  gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 2);
+  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
+  gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
 
+  gtk_window_set_title (GTK_WINDOW (add_device_popup), title.c_str ());
+  gtk_window_set_modal (GTK_WINDOW (add_device_popup), TRUE);
+  gtk_window_set_keep_above (GTK_WINDOW (add_device_popup), TRUE);
+  gtk_window_set_urgency_hint (GTK_WINDOW (mw), TRUE);
+  gtk_window_set_transient_for (GTK_WINDOW (add_device_popup),
+				GTK_WINDOW (mw));
 
-void
-gm_main_window_set_busy (GtkWidget *main_window,
-			 bool busy)
-{
-  GmMainWindow *mw = NULL;
-  
-  GdkCursor *cursor = NULL;
+  gtk_widget_show_all (add_device_popup);
 
-  mw = gm_mw_get_mw (main_window);
 
-  g_return_if_fail (mw != NULL);
+//  g_signal_connect (G_OBJECT (add_device_popup), "delete_event",
+//                    G_CALLBACK (gtk_widget_hide_on_delete), NULL);
+//  g_signal_connect (G_OBJECT (add_device_popup), "response",
+//                    GTK_SIGNAL_FUNC (add_device_response_cb), &device);
 
-  gtk_widget_set_sensitive (mw->main_toolbar, !busy);
-  gtk_widget_set_sensitive (mw->main_menu, !busy);
+  deviceStruct* device_struct = g_new(deviceStruct, 1);
+  snprintf (device_struct->name, sizeof (device_struct->name), "%s", (device.GetString()).c_str());
+  device_struct->deviceType = device_type;
 
-  if (busy) {
+  g_signal_connect_data (G_OBJECT (add_device_popup), "delete_event",
+                         G_CALLBACK (gtk_widget_hide_on_delete), 
+                         (gpointer) device_struct,
+                         (GClosureNotify) g_free,
+                         (GConnectFlags) 0);
 
-    cursor = gdk_cursor_new (GDK_WATCH);
-    gdk_window_set_cursor (GTK_WIDGET (main_window)->window, cursor);
-    gdk_cursor_unref (cursor);
-  }
-  else
-    gdk_window_set_cursor (GTK_WIDGET (main_window)->window, NULL);
+  g_signal_connect_data (G_OBJECT (add_device_popup), "response",
+                         G_CALLBACK (add_device_response_cb), 
+                         (gpointer) device_struct,
+                         (GClosureNotify) g_free,
+                         (GConnectFlags) 0);
 }
 
-void
-gm_main_window_clear_signal_levels (GtkWidget *main_window)
+static void
+ekiga_main_window_init_menu (EkigaMainWindow *mw)
 {
-  GmMainWindow *mw = NULL;
+  Ekiga::ServiceCore *services = NULL;
+  Ekiga::Trigger *local_cluster_trigger = NULL;
+  GtkFrontend *gtk_frontend = NULL;
+  
+  GtkWidget *addressbook_window = NULL;
+  GtkWidget *accounts_window = NULL;
 
-  g_return_if_fail (main_window != NULL);
+  bool show_call_panel = false;
 
-  mw = gm_mw_get_mw (main_window);
+  PanelSection cps = DIALPAD;
 
   g_return_if_fail (mw != NULL);
 
-  gtk_levelmeter_clear (GTK_LEVELMETER (mw->output_signal));
-  gtk_levelmeter_clear (GTK_LEVELMETER (mw->input_signal));
-}
+  services = GnomeMeeting::Process ()->GetServiceCore ();
+  local_cluster_trigger = dynamic_cast<Ekiga::Trigger *>(services->get ("local-cluster"));
+  gtk_frontend = dynamic_cast<GtkFrontend *>(services->get ("gtk-frontend"));
+  addressbook_window = GTK_WIDGET (gtk_frontend->get_addressbook_window ()); 
+  accounts_window = GnomeMeeting::Process ()->GetAccountsWindow ();
 
-void 
-gm_main_window_selected_presentity_build_menu (GtkWidget *main_window)
-{
-  GmMainWindow *mw = NULL;
-  GtkWidget* menu = NULL;
+  mw->priv->main_menu = gtk_menu_bar_new ();
 
-  g_return_if_fail (main_window != NULL);
+  /* Default values */
+  show_call_panel = gm_conf_get_bool (USER_INTERFACE_KEY "main_window/show_call_panel");
+  cps = (PanelSection) gm_conf_get_int (USER_INTERFACE_KEY "main_window/panel_section");
 
-  mw = gm_mw_get_mw (main_window);
+  static MenuEntry gnomemeeting_menu [] =
+    {
+      GTK_MENU_NEW (_("_Chat")),
 
-  g_return_if_fail (mw != NULL);
+      GTK_MENU_ENTRY("connect", _("Ca_ll"), _("Place a new call"), 
+		     GM_STOCK_PHONE_PICK_UP_16, 'o',
+		     G_CALLBACK (place_call_cb), mw, TRUE),
+      GTK_MENU_ENTRY("disconnect", _("_Hang up"),
+		     _("Terminate the current call"), 
+ 		     GM_STOCK_PHONE_HANG_UP_16, GDK_Escape,
+		     G_CALLBACK (hangup_call_cb), mw, FALSE),
 
-  menu = gtk_menu_get_widget (mw->main_menu, "contact");
-  if (mw->presentity != NULL) {
+      GTK_MENU_SEPARATOR,
 
-    MenuBuilderGtk builder;
-    gtk_widget_set_sensitive (menu, TRUE);
-    if (mw->presentity->populate_menu (builder)) {
+      GTK_MENU_ENTRY("add_contact", _("A_dd Contact"), _("Add a contact to the roster"),
+		     GTK_STOCK_ADD, 'n', 
+		     G_CALLBACK (pull_trigger_cb), local_cluster_trigger, true),
 
-      gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu), builder.menu);
-      gtk_widget_show_all (builder.menu);
-    } 
-    else {
+      GTK_MENU_THEME_ENTRY("address_book", _("Address _Book"),
+			   _("Find contacts"),
+ 			   GM_ICON_ADDRESSBOOK, 'b',
+			   G_CALLBACK (show_widget_cb),
+			   (gpointer) addressbook_window, TRUE),
 
-      gtk_widget_set_sensitive (menu, FALSE);
-      g_object_unref (builder.menu);
-    }
-  } 
-  else {
+      GTK_MENU_SEPARATOR,
 
-    gtk_widget_set_sensitive (menu, FALSE);
-    gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu), NULL);
-  }
-}
+      GTK_MENU_ENTRY("contact", _("_Contact"),
+		     _("Act on selected contact"),
+		     GTK_STOCK_EXECUTE, 0,
+		     NULL, NULL, FALSE),
 
+      GTK_MENU_SEPARATOR,
 
-void gm_main_window_incoming_call_dialog_show (GtkWidget *main_window,
-                                               Ekiga::Call & call)
-{
-  GmMainWindow *mw = NULL;
-  
-  GdkPixbuf *pixbuf = NULL;
+      GTK_MENU_ENTRY("hold_call", _("H_old Call"), _("Hold the current call"),
+		     NULL, GDK_h, 
+		     G_CALLBACK (hold_current_call_cb), mw,
+		     FALSE),
+      GTK_MENU_ENTRY("transfer_call", _("_Transfer Call"),
+		     _("Transfer the current call"),
+ 		     NULL, GDK_t, 
+		     G_CALLBACK (transfer_current_call_cb), mw,
+		     FALSE),
 
-  GtkWidget *label = NULL;
-  GtkWidget *vbox = NULL;
-  GtkWidget *b1 = NULL;
-  GtkWidget *b2 = NULL;
-  GtkWidget *incoming_call_popup = NULL;
+      GTK_MENU_SEPARATOR,
 
-  gchar *msg = NULL;
+      GTK_MENU_ENTRY("suspend_audio", _("Suspend _Audio"),
+		     _("Suspend or resume the audio transmission"),
+		     NULL, GDK_m,
+		     G_CALLBACK (toggle_audio_stream_pause_cb),
+		     mw, FALSE),
+      GTK_MENU_ENTRY("suspend_video", _("Suspend _Video"),
+		     _("Suspend or resume the video transmission"),
+		     NULL, GDK_p, 
+		     G_CALLBACK (toggle_video_stream_pause_cb),
+		     mw, FALSE),
 
-  // FIXME could the call become invalid ?
-  const char *utf8_name = call.get_remote_party_name ().c_str ();
-  const char *utf8_app = call.get_remote_application ().c_str ();
-  const char *utf8_url = call.get_remote_uri ().c_str ();
-  const char *utf8_local = call.get_local_party_name ().c_str ();
+      GTK_MENU_SEPARATOR,
 
-  g_return_if_fail (main_window);
-  
-  mw = gm_mw_get_mw (main_window);
-  
-  g_return_if_fail (mw != NULL);
+      GTK_MENU_ENTRY("close", NULL, _("Close the Ekiga window"),
+		     GTK_STOCK_CLOSE, 'W', 
+		     G_CALLBACK (window_closed_from_menu_cb),
+		     (gpointer) mw, TRUE),
 
-  incoming_call_popup = gtk_dialog_new ();
-  b2 = gtk_dialog_add_button (GTK_DIALOG (incoming_call_popup),
-			      _("Reject"), 0);
-  b1 = gtk_dialog_add_button (GTK_DIALOG (incoming_call_popup),
-			      _("Accept"), 2);
+      GTK_MENU_SEPARATOR,
+      
+      GTK_MENU_ENTRY("quit", NULL, _("Quit"),
+		     GTK_STOCK_QUIT, 'Q', 
+		     G_CALLBACK (quit_callback), NULL, TRUE),
 
-  gtk_dialog_set_default_response (GTK_DIALOG (incoming_call_popup), 2);
+      GTK_MENU_NEW (_("_Edit")),
 
-  vbox = GTK_DIALOG (incoming_call_popup)->vbox;
+      GTK_MENU_ENTRY("configuration_assistant", _("_Configuration Assistant"),
+		     _("Run the configuration assistant"),
+		     NULL, 0, 
+		     G_CALLBACK (show_assistant_window_cb),
+		     NULL, TRUE),
 
-  msg = g_strdup_printf ("%s <i>%s</i>", _("Incoming call from"), (const char*) utf8_name);
-  label = gtk_label_new (NULL);
-  gtk_label_set_markup (GTK_LABEL (label), msg);
-  gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 10);
-  gtk_misc_set_alignment (GTK_MISC (label), 0.5, 0.0);
-  gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
-  g_free (msg);
+      GTK_MENU_SEPARATOR,
+      
+      GTK_MENU_ENTRY("accounts", _("_Accounts"),
+		     _("Edit your accounts"), 
+		     NULL, 'E',
+		     G_CALLBACK (show_window_cb),
+		     (gpointer) accounts_window, TRUE),
 
-  pixbuf = gtk_widget_render_icon (GTK_WIDGET (incoming_call_popup),
-				   GM_STOCK_PHONE_PICK_UP_16,
-				   GTK_ICON_SIZE_MENU, NULL);
-  gtk_window_set_icon (GTK_WINDOW (incoming_call_popup), pixbuf);
-  g_object_unref (pixbuf);
+      GTK_MENU_ENTRY("preferences", NULL,
+		     _("Change your preferences"), 
+		     GTK_STOCK_PREFERENCES, 0,
+		     G_CALLBACK (show_prefs_window_cb),
+		     NULL, TRUE),
 
-  if (utf8_url) {
-    
-    label = gtk_label_new (NULL);
-    msg = g_strdup_printf ("<b>%s</b> <span foreground=\"blue\"><u>%s</u></span>",
-                           _("Remote URI:"), utf8_url);
-    gtk_label_set_markup (GTK_LABEL (label), msg);
-    gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
-    gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 2);
-    gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
-    g_free (msg);
-  }
+      GTK_MENU_NEW(_("_View")),
 
-  if (utf8_app) {
+      GTK_MENU_RADIO_ENTRY("contacts", _("Con_tacts"), _("View the contacts list"),
+			   NULL, 0,
+			   G_CALLBACK (radio_menu_changed_cb),
+			   (gpointer) USER_INTERFACE_KEY "main_window/panel_section",
+			   (cps == CONTACTS), TRUE),
+      GTK_MENU_RADIO_ENTRY("dialpad", _("_Dialpad"), _("View the dialpad"),
+			   NULL, 0,
+			   G_CALLBACK (radio_menu_changed_cb), 
+			   (gpointer) USER_INTERFACE_KEY "main_window/panel_section",
+			   (cps == DIALPAD), TRUE),
+      GTK_MENU_RADIO_ENTRY("callhistory", _("_Call History"), _("View the call history"),
+			   NULL, 0,
+			   G_CALLBACK (radio_menu_changed_cb),
+			   (gpointer) USER_INTERFACE_KEY "main_window/panel_section",
+			   (cps == CALL), TRUE),
 
-    label = gtk_label_new (NULL);
-    msg = g_strdup_printf ("<b>%s</b> %s",
-			   _("Remote Application:"), utf8_app);
-    gtk_label_set_markup (GTK_LABEL (label), msg);
-    gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
-    gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 2);
-    gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
-    g_free (msg);
-  }
+      GTK_MENU_SEPARATOR,
 
-  if (utf8_local) {
-    
-    label = gtk_label_new (NULL);
-    msg =
-      g_strdup_printf ("<b>%s</b> %s",
-		       _("Account ID:"), utf8_local);
-    gtk_label_set_markup (GTK_LABEL (label), msg);
-    gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
-    gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 2);
-    gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
-    g_free (msg);
-  }
+      GTK_MENU_TOGGLE_ENTRY("callpanel", _("_Show Call Panel"), _("Show the call panel"),
+                            NULL, 'J', 
+                            G_CALLBACK (toggle_menu_changed_cb),
+                            (gpointer) USER_INTERFACE_KEY "main_window/show_call_panel", 
+                            show_call_panel, TRUE),
 
-  msg = g_strdup_printf (_("Call from %s"), (const char*) utf8_name);
-  gtk_window_set_title (GTK_WINDOW (incoming_call_popup), msg);
-  g_free (msg);
-  gtk_window_set_modal (GTK_WINDOW (incoming_call_popup), TRUE);
-  gtk_window_set_keep_above (GTK_WINDOW (incoming_call_popup), TRUE);
-  gtk_window_set_urgency_hint (GTK_WINDOW (main_window), TRUE);
-  gtk_window_set_transient_for (GTK_WINDOW (incoming_call_popup),
-				GTK_WINDOW (main_window));
+      GTK_MENU_SEPARATOR,
 
-  gtk_widget_show_all (incoming_call_popup);
+      GTK_MENU_RADIO_ENTRY("local_video", _("_Local Video"),
+			   _("Local video image"),
+			   NULL, '1', 
+			   G_CALLBACK (display_changed_cb),
+			   (gpointer) VIDEO_DISPLAY_KEY "video_view",
+			   TRUE, FALSE),
+      GTK_MENU_RADIO_ENTRY("remote_video", _("_Remote Video"),
+			   _("Remote video image"),
+			   NULL, '2', 
+			   G_CALLBACK (display_changed_cb), 
+			   (gpointer) VIDEO_DISPLAY_KEY "video_view",
+			   FALSE, FALSE),
+      GTK_MENU_RADIO_ENTRY("both_incrusted", _("_Picture-in-Picture"),
+			   _("Both video images"),
+			   NULL, '3', 
+			   G_CALLBACK (display_changed_cb), 
+			   (gpointer) VIDEO_DISPLAY_KEY "video_view",
+			   FALSE, FALSE),
+      GTK_MENU_RADIO_ENTRY("both_incrusted_window", _("Picture-in-Picture in Separate _Window"),
+			   _("Both video images"),
+			   NULL, '4', 
+			   G_CALLBACK (display_changed_cb), 
+			   (gpointer) VIDEO_DISPLAY_KEY "video_view",
+			   FALSE, FALSE),
+      GTK_MENU_SEPARATOR,
 
-  g_signal_connect (G_OBJECT (incoming_call_popup), "delete_event",
-                    G_CALLBACK (gtk_widget_hide_on_delete), NULL);
-  g_signal_connect (G_OBJECT (incoming_call_popup), "response",
-                    GTK_SIGNAL_FUNC (incoming_call_response_cb), &call);
+      GTK_MENU_ENTRY("zoom_in", NULL, _("Zoom in"), 
+		     GTK_STOCK_ZOOM_IN, '+', 
+		     G_CALLBACK (zoom_in_changed_cb),
+		     (gpointer) VIDEO_DISPLAY_KEY "zoom", FALSE),
+      GTK_MENU_ENTRY("zoom_out", NULL, _("Zoom out"), 
+		     GTK_STOCK_ZOOM_OUT, '-', 
+		     G_CALLBACK (zoom_out_changed_cb),
+		     (gpointer) VIDEO_DISPLAY_KEY "zoom", FALSE),
+      GTK_MENU_ENTRY("normal_size", NULL, _("Normal size"), 
+		     GTK_STOCK_ZOOM_100, '0',
+		     G_CALLBACK (zoom_normal_changed_cb),
+		     (gpointer) VIDEO_DISPLAY_KEY "zoom", FALSE),
+      GTK_MENU_ENTRY("fullscreen", _("_Fullscreen"), _("Switch to fullscreen"), 
+		     GTK_STOCK_ZOOM_IN, GDK_F11, 
+		     G_CALLBACK (fullscreen_changed_cb),
+		     (gpointer) mw, FALSE),
 
-  call.cleared.connect (sigc::bind (sigc::ptr_fun (on_cleared_incoming_call_cb),
-                                    (gpointer) incoming_call_popup));
-  call.missed.connect (sigc::bind (sigc::ptr_fun (on_missed_incoming_call_cb), 
-                                   (gpointer) incoming_call_popup));
-}
+      GTK_MENU_NEW(_("_Help")),
 
+      GTK_MENU_ENTRY("help", NULL, 
+                     _("Get help by reading the Ekiga manual"),
+                     GTK_STOCK_HELP, GDK_F1, 
+                     G_CALLBACK (help_cb), NULL, TRUE),
 
-#ifdef HAVE_NOTIFY
-static void
-notify_action_cb (NotifyNotification *notification,
-                  gchar *action,
-                  gpointer data)
-{
-  Ekiga::Call *call = (Ekiga::Call *) data;
+      GTK_MENU_ENTRY("about", NULL,
+		     _("View information about Ekiga"),
+		     GTK_STOCK_ABOUT, 0, 
+		     G_CALLBACK (about_callback), (gpointer) mw,
+		     TRUE),
+       
+      GTK_MENU_END
+    };
 
-  notify_notification_close (notification, NULL);
 
-  if (call) {
+  gtk_build_menu (mw->priv->main_menu, 
+		  gnomemeeting_menu, 
+		  mw->priv->accel, 
+		  mw->priv->statusbar);
 
-    if (!strcmp (action, "accept"))
-      call->answer ();
-    else
-      call->hangup ();
-  }
+  gtk_widget_show_all (GTK_WIDGET (mw->priv->main_menu));
 }
 
 
 static void
-closed_cb (NotifyNotification* /*notify*/, 
-           gpointer main_window)
+ekiga_main_window_init_uri_toolbar (EkigaMainWindow *mw)
 {
-  GmMainWindow *mw = NULL;
-
-  g_return_if_fail (main_window != NULL);
-
-  mw = gm_mw_get_mw (GTK_WIDGET (main_window));
+  GtkToolItem *item = NULL;
+  GtkEntryCompletion *completion = NULL;
 
-  g_return_if_fail (mw != NULL);
+  g_return_if_fail (EKIGA_IS_MAIN_WINDOW (mw));
 
-  Ekiga::AudioOutputCore *audiooutput_core = dynamic_cast<Ekiga::AudioOutputCore *> (mw->core.get ("audiooutput-core"));
-  if (audiooutput_core) 
-    audiooutput_core->stop_play_event ("incoming_call_sound");
-}
+  /* The main horizontal toolbar */
+  mw->priv->main_toolbar = gtk_toolbar_new ();
+  gtk_toolbar_set_style (GTK_TOOLBAR (mw->priv->main_toolbar), GTK_TOOLBAR_ICONS);
+  gtk_toolbar_set_show_arrow (GTK_TOOLBAR (mw->priv->main_toolbar), FALSE);
 
+  /* URL bar */
+  /* Entry */
+  item = gtk_tool_item_new ();
+  mw->priv->entry = gtk_entry_new ();
+  mw->priv->completion = gtk_list_store_new (1, G_TYPE_STRING);
+  completion = gtk_entry_completion_new ();
+  gtk_entry_completion_set_model (GTK_ENTRY_COMPLETION (completion), GTK_TREE_MODEL (mw->priv->completion));
+  gtk_entry_set_completion (GTK_ENTRY (mw->priv->entry), completion);
+  gtk_entry_completion_set_inline_completion (GTK_ENTRY_COMPLETION (completion), false);
+  gtk_entry_completion_set_popup_completion (GTK_ENTRY_COMPLETION (completion), true);
+  gtk_entry_completion_set_text_column (GTK_ENTRY_COMPLETION (completion), 0);
 
-void gm_main_window_incoming_call_notify (GtkWidget *main_window,
-                                          Ekiga::Call & call)
-{
-  NotifyNotification *notify = NULL;
+  gtk_container_add (GTK_CONTAINER (item), mw->priv->entry);
+  gtk_container_set_border_width (GTK_CONTAINER (item), 0);
+  gtk_tool_item_set_expand (GTK_TOOL_ITEM (item), true);
   
-  GtkStatusIcon *statusicon = NULL;
+  gtk_entry_set_text (GTK_ENTRY (mw->priv->entry), "sip:");
 
-  gchar *uri = NULL;
-  gchar *app = NULL;
-  gchar *account = NULL;
-  gchar *body = NULL;
-  gchar *title = NULL;
+  // activate Ctrl-L to get the entry focus
+  gtk_widget_add_accelerator (mw->priv->entry, "grab-focus",
+			      mw->priv->accel, GDK_L,
+			      (GdkModifierType) GDK_CONTROL_MASK,
+			      (GtkAccelFlags) 0);
 
-  statusicon = GTK_STATUS_ICON (GnomeMeeting::Process ()->GetStatusicon ());
+  gtk_editable_set_position (GTK_EDITABLE (mw->priv->entry), -1);
 
-  // FIXME could the call become invalid ?
-  const char *utf8_name = call.get_remote_party_name ().c_str ();
-  const char *utf8_app = call.get_remote_application ().c_str ();
-  const char *utf8_url = call.get_remote_uri ().c_str ();
-  const char *utf8_local = call.get_local_party_name ().c_str ();
+  g_signal_connect (G_OBJECT (mw->priv->entry), "changed", 
+		    G_CALLBACK (url_changed_cb), mw);
+  g_signal_connect (G_OBJECT (mw->priv->entry), "activate", 
+		    G_CALLBACK (place_call_cb), mw);
 
-  title = g_strdup_printf ("%s %s", _("Incoming call from"), (const char*) utf8_name);
+  gtk_toolbar_insert (GTK_TOOLBAR (mw->priv->main_toolbar), item, 0);
 
-  if (utf8_url)
-    uri = g_strdup_printf ("<b>%s</b> %s", _("Remote URI:"), utf8_url);
-  if (utf8_app)
-    app = g_strdup_printf ("<b>%s</b> %s", _("Remote Application:"), utf8_app);
-  if (utf8_local)
-    account = g_strdup_printf ("<b>%s</b> %s", _("Account ID:"), utf8_local);
+  /* The connect button */
+  item = gtk_tool_item_new ();
+  mw->priv->connect_button = gm_connect_button_new (GM_STOCK_PHONE_PICK_UP_24,
+						    GM_STOCK_PHONE_HANG_UP_24,
+						    GTK_ICON_SIZE_LARGE_TOOLBAR);
+  gtk_container_add (GTK_CONTAINER (item), mw->priv->connect_button);
+  gtk_container_set_border_width (GTK_CONTAINER (mw->priv->connect_button), 0);
+  gtk_tool_item_set_expand (GTK_TOOL_ITEM (item), FALSE);
 
-  body = g_strdup_printf ("%s\n%s\n%s", uri, app, account);
+  gtk_widget_set_tooltip_text (GTK_WIDGET (mw->priv->connect_button),
+			       _("Enter a URI on the left, and click this button to place a call"));
   
-  notify = notify_notification_new (title, body, GM_ICON_LOGO, NULL);
-  notify_notification_add_action (notify, "accept", _("Accept"), notify_action_cb, &call, NULL);
-  notify_notification_add_action (notify, "reject", _("Reject"), notify_action_cb, &call, NULL);
-  notify_notification_set_timeout (notify, NOTIFY_EXPIRES_NEVER);
-  notify_notification_set_urgency (notify, NOTIFY_URGENCY_CRITICAL);
-  notify_notification_attach_to_status_icon (notify, statusicon);
-  if (!notify_notification_show (notify, NULL))
-    gm_main_window_incoming_call_dialog_show (main_window, call);
-  else {
-    call.cleared.connect (sigc::bind (sigc::ptr_fun (on_cleared_incoming_call_cb),
-                                      (gpointer) notify));
-    call.missed.connect (sigc::bind (sigc::ptr_fun (on_missed_incoming_call_cb), 
-                                     (gpointer) notify));
-  }
+  gtk_toolbar_insert (GTK_TOOLBAR (mw->priv->main_toolbar), item, -1);
 
-  g_signal_connect (notify, "closed", G_CALLBACK (closed_cb), main_window);
+  g_signal_connect (G_OBJECT (mw->priv->connect_button), "clicked",
+                    G_CALLBACK (toggle_call_cb), 
+                    mw);
 
-  g_free (uri);
-  g_free (app);
-  g_free (account);
-  g_free (title);
-  g_free (body);
+  gtk_widget_show_all (GTK_WIDGET (mw->priv->main_toolbar));
 }
-#endif
 
-void 
-gm_main_window_set_panel_section (GtkWidget *main_window,
-                                  int section)
+
+static void
+ekiga_main_window_init_status_toolbar (EkigaMainWindow *mw)
 {
-  GmMainWindow *mw = NULL;
-  
-  GtkWidget *menu = NULL;
-  
-  g_return_if_fail (main_window != NULL);
-  
-  mw = gm_mw_get_mw (main_window);
+  GtkToolItem *item = NULL;
 
-  g_return_if_fail (mw != NULL);
+  g_return_if_fail (EKIGA_IS_MAIN_WINDOW (mw));
 
-  gtk_notebook_set_current_page (GTK_NOTEBOOK (mw->main_notebook), section);
-  
-  menu = gtk_menu_get_widget (mw->main_menu, "dialpad");
+  /* The main horizontal toolbar */
+  mw->priv->status_toolbar = gtk_toolbar_new ();
+  gtk_toolbar_set_style (GTK_TOOLBAR (mw->priv->status_toolbar), GTK_TOOLBAR_ICONS);
+  gtk_toolbar_set_show_arrow (GTK_TOOLBAR (mw->priv->status_toolbar), FALSE);
+
+  item = gtk_tool_item_new ();
+  mw->priv->status_option_menu = status_menu_new (); 
+  status_menu_set_parent_window (STATUS_MENU (mw->priv->status_option_menu), 
+                                 GTK_WINDOW (mw));
+  gtk_container_add (GTK_CONTAINER (item), mw->priv->status_option_menu);
+  gtk_container_set_border_width (GTK_CONTAINER (item), 0);
+  gtk_tool_item_set_expand (GTK_TOOL_ITEM (item), TRUE);
   
-  gtk_radio_menu_select_with_widget (GTK_WIDGET (menu), section);
+  gtk_toolbar_insert (GTK_TOOLBAR (mw->priv->status_toolbar), item, 0);
+
+  gtk_widget_show_all (mw->priv->status_toolbar);
 }
 
 
-void 
-gm_main_window_set_status (GtkWidget *main_window,
-                           std::string /*short_status*/,
-                           std::string /*long_status*/)
-{
-  GmMainWindow *mw = NULL;
-  
-  /*
-  const char * status [] = 
-    { 
-      _("Online"), 
-      _("Away"), 
-      _("Do Not Disturb"), 
-      _("Invisible"),
-      NULL, 
-      NULL 
-    };
-*/
-  g_return_if_fail (main_window != NULL);
+static void 
+ekiga_main_window_init_contact_list (EkigaMainWindow *mw)
+{
+  GtkWidget *label = NULL;
+
+  GtkFrontend *gtk_frontend = NULL;
+  Ekiga::ServiceCore *services = NULL;
+  GtkWidget* roster_view = NULL;
+
+  services = GnomeMeeting::Process ()->GetServiceCore ();
+  g_return_if_fail (services != NULL);
 
-  mw = gm_mw_get_mw (main_window);
-  g_return_if_fail (mw != NULL);
+  gtk_frontend = dynamic_cast<GtkFrontend *>(services->get ("gtk-frontend"));
+
+  label = gtk_label_new (_("Contacts"));
+  roster_view = GTK_WIDGET (gtk_frontend->get_roster_view ());
+  gtk_notebook_append_page (GTK_NOTEBOOK (mw->priv->main_notebook),
+			    roster_view, label);
+  g_signal_connect (G_OBJECT (roster_view), "presentity-selected",
+		    G_CALLBACK (on_presentity_selected), mw);
 }
 
 
-void 
-gm_main_window_set_call_info (GtkWidget *main_window,
-			      const char *tr_audio_codec,
-			      G_GNUC_UNUSED const char *re_audio_codec,
-			      const char *tr_video_codec,
-			      G_GNUC_UNUSED const char *re_video_codec)
+static void 
+ekiga_main_window_init_dialpad (EkigaMainWindow *mw)
 {
-  GmMainWindow *mw = NULL;
+  GtkWidget *dialpad = NULL;
+  GtkWidget *alignment = NULL;
+  GtkWidget *label = NULL;
 
-  GtkTextIter iter;
-  GtkTextIter *end_iter = NULL;
-  GtkTextBuffer *buffer = NULL;
-  
-  gchar *info = NULL;
-  
-  g_return_if_fail (main_window != NULL);
-  
-  mw = gm_mw_get_mw (main_window);
+  dialpad = ekiga_dialpad_new (mw->priv->accel);
+  g_signal_connect (G_OBJECT (dialpad), "button-clicked",
+                    G_CALLBACK (dialpad_button_clicked_cb), mw);
 
-  g_return_if_fail (mw != NULL);
+  alignment = gtk_alignment_new (0.5, 0.5, 0.2, 0.2);
+  gtk_container_add (GTK_CONTAINER (alignment), dialpad);
 
-  if (!tr_audio_codec && !tr_video_codec)
-    info = g_strdup (" ");
-  else
-    info = g_strdup_printf ("%s - %s",
-                            tr_audio_codec?tr_audio_codec:"", 
-                            tr_video_codec?tr_video_codec:"");
-  
-  buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (mw->info_text));
-  gtk_text_buffer_get_start_iter (buffer, &iter);
-  gtk_text_iter_forward_lines (&iter, 2);
-  end_iter = gtk_text_iter_copy (&iter);
-  gtk_text_iter_forward_line (end_iter);
-  gtk_text_buffer_delete (buffer, &iter, end_iter);
-  gtk_text_iter_free (end_iter);
-  gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, info, 
-                                            -1, "codecs", NULL);
-  g_free (info);
+  label = gtk_label_new (_("Dialpad"));
+  gtk_notebook_append_page (GTK_NOTEBOOK (mw->priv->main_notebook),
+			    alignment, label);
 }
 
 
-void 
-gm_main_window_set_status (GtkWidget *main_window,
-			   const char *status)
+static void
+ekiga_main_window_init_history (EkigaMainWindow *mw)
 {
-  GmMainWindow *mw = NULL;
+  Ekiga::ServiceCore *services = NULL;
+  GtkWidget *label = NULL;
+  GtkFrontend *gtk_frontend = NULL;
 
-  GtkTextIter iter;
-  GtkTextIter* end_iter = NULL;
-  GtkTextBuffer *buffer = NULL;
+  services = GnomeMeeting::Process ()->GetServiceCore ();
+  g_return_if_fail (services != NULL);
 
-  gchar *info = NULL;
-  
-  g_return_if_fail (main_window != NULL);
-  
-  mw = gm_mw_get_mw (main_window);
+  gtk_frontend = dynamic_cast<GtkFrontend *>(services->get ("gtk-frontend"));
 
-  g_return_if_fail (mw != NULL);
-  
-  info = g_strdup_printf ("%s\n", status);
-  
-  buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (mw->info_text));
-  gtk_text_buffer_get_start_iter (buffer, &iter);
-  end_iter = gtk_text_iter_copy (&iter);
-  gtk_text_iter_forward_line (end_iter);
-  gtk_text_buffer_delete (buffer, &iter, end_iter);
-  gtk_text_iter_free (end_iter);
-  gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, info, 
-                                            -1, "status", NULL);
-  g_free (info);
+  label = gtk_label_new (_("Call history"));
+  gtk_notebook_append_page (GTK_NOTEBOOK (mw->priv->main_notebook),
+			    GTK_WIDGET (gtk_frontend->get_call_history_view ()),
+			    label);
 }
 
 
-void 
-gm_main_window_set_call_duration (GtkWidget *main_window,
-                                  const char *duration)
+static void 
+ekiga_main_window_init_call_panel (EkigaMainWindow *mw)
 {
-  GmMainWindow *mw = NULL;
+  GtkWidget *frame = NULL;
+  GtkWidget *event_box = NULL;
+  GtkWidget *table = NULL;
 
-  GtkTextIter iter;
-  GtkTextIter* end_iter = NULL;
-  GtkTextBuffer *buffer = NULL;
+  GtkWidget *toolbar = NULL;
+  GtkToolItem *item = NULL;
 
-  gchar *info = NULL;
+  GtkWidget *image = NULL;
+  GtkWidget *alignment = NULL;
 
-  g_return_if_fail (main_window != NULL);
-  
-  mw = gm_mw_get_mw (main_window);
+  GdkColor white;
+  gdk_color_parse ("white", &white);
 
-  g_return_if_fail (mw != NULL);
+  /* The main table */
+  frame = gtk_frame_new (NULL);
+  event_box = gtk_event_box_new ();
+  gtk_widget_modify_bg (event_box, GTK_STATE_PRELIGHT, &white);
+  gtk_widget_modify_bg (event_box, GTK_STATE_NORMAL, &white);
+  table = gtk_table_new (3, 4, FALSE);
+  gtk_container_add (GTK_CONTAINER (event_box), table);
+  gtk_container_add (GTK_CONTAINER (frame), event_box);
+
+  /* The frame that contains the video */
+  mw->priv->video_frame = gtk_frame_new (NULL);
+  gtk_frame_set_shadow_type (GTK_FRAME (mw->priv->video_frame), 
+                             GTK_SHADOW_NONE);
   
-  if (duration)
-    info = g_strdup_printf (_("Call Duration: %s\n"), duration);
-  else
-    info = g_strdup ("\n");
+  mw->priv->main_video_image = gtk_image_new ();
+  gtk_container_set_border_width (GTK_CONTAINER (mw->priv->video_frame), 0);
+  gtk_container_add (GTK_CONTAINER (mw->priv->video_frame), mw->priv->main_video_image);
+  gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (mw->priv->video_frame),
+                    0, 4, 0, 1,         
+                    (GtkAttachOptions) GTK_EXPAND,      
+                    (GtkAttachOptions) GTK_EXPAND,      
+                    24, 24);
+
+  /* The frame that contains information about the call */
+  /* Text buffer */
+  GtkTextBuffer *buffer = NULL;
   
-  buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (mw->info_text));
-  gtk_text_buffer_get_start_iter (buffer, &iter);
-  gtk_text_iter_forward_line (&iter);
-  end_iter = gtk_text_iter_copy (&iter);
-  gtk_text_iter_forward_line (end_iter);
-  gtk_text_buffer_delete (buffer, &iter, end_iter);
-  gtk_text_iter_free (end_iter);
-  gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, info, 
-                                            -1, "call-duration", NULL);
+  mw->priv->info_text = gtk_text_view_new ();
+  gtk_widget_modify_bg (mw->priv->info_text, GTK_STATE_PRELIGHT, &white);
+  gtk_widget_modify_bg (mw->priv->info_text, GTK_STATE_NORMAL, &white);
+  gtk_widget_modify_bg (mw->priv->info_text, GTK_STATE_INSENSITIVE, &white);
+
+  gtk_text_view_set_editable (GTK_TEXT_VIEW (mw->priv->info_text), FALSE);
+  gtk_widget_set_sensitive (GTK_WIDGET (mw->priv->info_text), FALSE);
+  gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (mw->priv->info_text),
+			       GTK_WRAP_WORD);
 
-  g_free (info);
-}
+  buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (mw->priv->info_text));
+  gtk_text_view_set_cursor_visible  (GTK_TEXT_VIEW (mw->priv->info_text), FALSE);
 
+  gtk_text_buffer_create_tag (buffer, "status",
+			      "foreground", "black", 
+                              "paragraph-background", "white",
+                              "justification", GTK_JUSTIFY_CENTER,
+                              "weight", PANGO_WEIGHT_BOLD,
+                              "scale", 1.2,
+                              NULL);
+  gtk_text_buffer_create_tag (buffer, "codecs",
+                              "justification", GTK_JUSTIFY_RIGHT,
+                              "stretch", PANGO_STRETCH_CONDENSED,
+			      "foreground", "darkgray", 
+                              "paragraph-background", "white",
+			      NULL);
+  gtk_text_buffer_create_tag (buffer, "call-duration",
+			      "foreground", "black", 
+                              "paragraph-background", "white",
+			      "justification", GTK_JUSTIFY_CENTER,
+                              "weight", PANGO_WEIGHT_BOLD,
+			      NULL);
 
-gboolean 
-gm_main_window_transfer_dialog_run (GtkWidget *main_window,
-				    GtkWidget *parent_window,
-				    const char *u)
-{
-  GmMainWindow *mw = NULL;
-  
-  gint answer = 0;
-  
-  const char *forward_url = NULL;
+  ekiga_main_window_set_status (mw, _("Standby"));
+  ekiga_main_window_set_call_duration (mw, NULL);
+  ekiga_main_window_set_call_info (mw, NULL, NULL, NULL, NULL);
 
-  g_return_val_if_fail (main_window != NULL, FALSE);
-  g_return_val_if_fail (parent_window != NULL, FALSE);
+  alignment = gtk_alignment_new (0.0, 0.0, 1.0, 0.0);
+  gtk_container_add (GTK_CONTAINER (alignment), mw->priv->info_text);
+  gtk_table_attach (GTK_TABLE (table), alignment,
+                    0, 4, 1, 2,         
+                    (GtkAttachOptions) (GTK_FILL | GTK_EXPAND),
+                    (GtkAttachOptions) (GTK_FILL | GTK_EXPAND),
+                    0, 0);
   
-  mw = gm_mw_get_mw (main_window);
+  /* The toolbar */
+  toolbar = gtk_toolbar_new ();
+  gtk_widget_modify_bg (toolbar, GTK_STATE_PRELIGHT, &white);
+  gtk_widget_modify_bg (toolbar, GTK_STATE_NORMAL, &white);
+  gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_ICONS);
+  gtk_toolbar_set_show_arrow (GTK_TOOLBAR (toolbar), FALSE);
 
-  g_return_val_if_fail (mw != NULL, FALSE);
-  
-  mw->transfer_call_popup = 
-    gm_entry_dialog_new (_("Transfer call to:"),
-			 _("Transfer"));
+  /* Audio Volume */
+  item = gtk_tool_item_new ();
+  mw->priv->audio_settings_button = gtk_button_new ();
+  gtk_button_set_relief (GTK_BUTTON (mw->priv->audio_settings_button), GTK_RELIEF_NONE);
+  image = gtk_image_new_from_icon_name (GM_ICON_AUDIO_VOLUME_HIGH,
+                                        GTK_ICON_SIZE_MENU);
+  gtk_container_add (GTK_CONTAINER (mw->priv->audio_settings_button), image);
+  gtk_container_add (GTK_CONTAINER (item), mw->priv->audio_settings_button);
+  gtk_tool_item_set_expand (GTK_TOOL_ITEM (item), FALSE);
   
-  gtk_window_set_transient_for (GTK_WINDOW (mw->transfer_call_popup),
-				GTK_WINDOW (parent_window));
+  gtk_widget_show (mw->priv->audio_settings_button);
+  gtk_widget_set_sensitive (mw->priv->audio_settings_button, FALSE);
+  gtk_toolbar_insert (GTK_TOOLBAR (toolbar), 
+		      GTK_TOOL_ITEM (item), -1);
+  gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (item),
+				  _("Change the volume of your soundcard"));
+  g_signal_connect (G_OBJECT (mw->priv->audio_settings_button), "clicked",
+		    G_CALLBACK (show_window_cb),
+		    (gpointer) mw->priv->audio_settings_window);
   
-  gtk_dialog_set_default_response (GTK_DIALOG (mw->transfer_call_popup),
-				   GTK_RESPONSE_ACCEPT);
+  /* Video Settings */
+  item = gtk_tool_item_new ();
+  mw->priv->video_settings_button = gtk_button_new ();
+  gtk_button_set_relief (GTK_BUTTON (mw->priv->video_settings_button), GTK_RELIEF_NONE);
+  image = gtk_image_new_from_stock (GM_STOCK_COLOR_BRIGHTNESS_CONTRAST,
+                                    GTK_ICON_SIZE_MENU);
+  gtk_container_add (GTK_CONTAINER (mw->priv->video_settings_button), image);
+  gtk_container_add (GTK_CONTAINER (item), mw->priv->video_settings_button);
+  gtk_tool_item_set_expand (GTK_TOOL_ITEM (item), FALSE);
   
-  if (u && !strcmp (u, ""))
-    gm_entry_dialog_set_text (GM_ENTRY_DIALOG (mw->transfer_call_popup), u);
-  else
-    gm_entry_dialog_set_text (GM_ENTRY_DIALOG (mw->transfer_call_popup), "sip:");
-
-  gnomemeeting_threads_dialog_show (mw->transfer_call_popup);
+  gtk_widget_show (mw->priv->video_settings_button);
+  gtk_widget_set_sensitive (mw->priv->video_settings_button, FALSE);
+  gtk_toolbar_insert (GTK_TOOLBAR (toolbar), 
+		      GTK_TOOL_ITEM (item), -1);
+  gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (item),
+				   _("Change the color settings of your video device"));
 
-  answer = gtk_dialog_run (GTK_DIALOG (mw->transfer_call_popup));
-  switch (answer) {
+  g_signal_connect (G_OBJECT (mw->priv->video_settings_button), "clicked",
+		    G_CALLBACK (show_window_cb),
+		    (gpointer) mw->priv->video_settings_window);
 
-  case GTK_RESPONSE_ACCEPT:
+  /* Video Preview Button */
+  item = gtk_tool_item_new ();
+  mw->priv->preview_button = gtk_toggle_button_new ();
+  gtk_button_set_relief (GTK_BUTTON (mw->priv->preview_button), GTK_RELIEF_NONE);
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (mw->priv->preview_button),
+                                gm_conf_get_bool (VIDEO_DEVICES_KEY "enable_preview"));
+  image = gtk_image_new_from_icon_name (GM_ICON_CAMERA_VIDEO, 
+                                        GTK_ICON_SIZE_MENU);
+  gtk_container_add (GTK_CONTAINER (mw->priv->preview_button), image);
+  gtk_container_add (GTK_CONTAINER (item), mw->priv->preview_button);
+  gtk_tool_item_set_expand (GTK_TOOL_ITEM (item), FALSE);
+  
+  gtk_widget_show (mw->priv->preview_button);
+  gtk_toolbar_insert (GTK_TOOLBAR (toolbar), 
+		      GTK_TOOL_ITEM (item), -1);
+  gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (item),
+				  _("Display images from your camera device"));
 
-    forward_url = gm_entry_dialog_get_text (GM_ENTRY_DIALOG (mw->transfer_call_popup));
-    if (strcmp (forward_url, "") && mw->current_call)
-      mw->current_call->transfer (forward_url);
-    break;
+  g_signal_connect (G_OBJECT (mw->priv->preview_button), "toggled",
+		    G_CALLBACK (toolbar_toggle_button_changed_cb),
+		    (gpointer) VIDEO_DEVICES_KEY "enable_preview");
 
-  default:
-    break;
-  }
+  /* Call Pause */
+  item = gtk_tool_item_new ();
+  mw->priv->hold_button = gtk_toggle_button_new ();
+  image = gtk_image_new_from_icon_name (GM_ICON_MEDIA_PLAYBACK_PAUSE,
+                                        GTK_ICON_SIZE_MENU);
+  gtk_button_set_relief (GTK_BUTTON (mw->priv->hold_button), GTK_RELIEF_NONE);
+  gtk_container_add (GTK_CONTAINER (mw->priv->hold_button), image);
+  gtk_container_add (GTK_CONTAINER (item), mw->priv->hold_button);
+  gtk_tool_item_set_expand (GTK_TOOL_ITEM (item), FALSE);
+  
+  gtk_widget_show (mw->priv->hold_button);
+  gtk_toolbar_insert (GTK_TOOLBAR (toolbar), 
+		      GTK_TOOL_ITEM (item), -1);
+  gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (item),
+				  _("Hold the current call"));
+  gtk_widget_set_sensitive (GTK_WIDGET (mw->priv->hold_button), FALSE);
 
-  gtk_widget_destroy (mw->transfer_call_popup);
-  mw->transfer_call_popup = NULL;
+  g_signal_connect (G_OBJECT (mw->priv->hold_button), "clicked",
+		    G_CALLBACK (hold_current_call_cb), mw);
 
-  return (answer == GTK_RESPONSE_ACCEPT);
-}
+  alignment = gtk_alignment_new (0.0, 0.0, 1.0, 0.0);
+  gtk_container_add (GTK_CONTAINER (alignment), toolbar);
+  gtk_table_attach (GTK_TABLE (table), alignment,
+                    1, 3, 2, 3,         
+                    (GtkAttachOptions) (GTK_FILL | GTK_EXPAND),
+                    (GtkAttachOptions) (GTK_FILL | GTK_EXPAND),
+                    0, 0);
 
+  gtk_paned_pack2 (GTK_PANED (mw->priv->hpaned), frame, true, false);
+}  
 
-void 
-gm_main_window_add_device_dialog_show (GtkWidget *main_window,
-                                       const Ekiga::Device & device,
-                                       DeviceType deviceType)
+static void
+ekiga_main_window_init_gui (EkigaMainWindow *mw)
 {
-  GmMainWindow *mw = NULL;
-  
-  GtkWidget *label = NULL;
-  GtkWidget *vbox = NULL;
-  GtkWidget *b1 = NULL;
-  GtkWidget *b2 = NULL;
-  GtkWidget *add_device_popup = NULL;
+  GtkWidget *window_vbox;
+  GtkShadowType shadow_type;
+  GtkWidget *frame;
 
-  g_return_if_fail (main_window);
-  mw = gm_mw_get_mw (main_window);
-  g_return_if_fail (mw != NULL);
+  gtk_window_set_title (GTK_WINDOW (mw), _("Ekiga"));
 
+  window_vbox = gtk_vbox_new (0, FALSE);
+  gtk_container_add (GTK_CONTAINER (mw), window_vbox);
+  gtk_widget_show_all (window_vbox);
 
-  add_device_popup = gtk_dialog_new ();
-  b2 = gtk_dialog_add_button (GTK_DIALOG (add_device_popup),
-			      _("No"), 0);
-  b1 = gtk_dialog_add_button (GTK_DIALOG (add_device_popup),
-			      _("Yes"), 2);
+  /* The main menu */
+  mw->priv->statusbar = gm_statusbar_new ();
+
+  ekiga_main_window_init_menu (mw); 
+  gtk_box_pack_start (GTK_BOX (window_vbox), mw->priv->main_menu,
+                      FALSE, FALSE, 0);
 
-  gtk_dialog_set_default_response (GTK_DIALOG (add_device_popup), 2);
+  /* The URI toolbar */
+  ekiga_main_window_init_uri_toolbar (mw);
+  gtk_box_pack_start (GTK_BOX (window_vbox), mw->priv->main_toolbar,
+                      false, false, 0); 
 
-  vbox = GTK_DIALOG (add_device_popup)->vbox;
+  /* The Audio & Video Settings windows */
+  mw->priv->audio_settings_window = gm_mw_audio_settings_window_new (mw);
+  mw->priv->video_settings_window = gm_mw_video_settings_window_new (mw);
 
-  std::string msg;
-  std::string title;
+  /* The 2 parts of the gui */
+  mw->priv->hpaned = gtk_hpaned_new ();
+  gtk_box_pack_start (GTK_BOX (window_vbox), mw->priv->hpaned,
+                      true, true, 0);
 
-  switch (deviceType) {
-    case AudioInput:
-      msg = _("Detected new audio input device:");
-      title = _("Audio Devices");
-      break;
-    case AudioOutput:
-      msg = _("Detected new audio output device:");
-      title = _("Audio Devices");
-      break;
-    case VideoInput:
-      msg = _("Detected new video input device:");
-      title = _("Video Devices");
-      break;
-    default:
-      break;
-  }
-  label = gtk_label_new (NULL);
-  gtk_label_set_markup (GTK_LABEL (label), msg.c_str());
-  gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 2);
-  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
-  gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
-  
-  msg  = "<b>" + device.GetString() + "</b>";
-  label = gtk_label_new (NULL);
-  gtk_label_set_markup (GTK_LABEL (label), msg.c_str());
-  gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 2);
-  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
-  gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+  mw->priv->main_notebook = gtk_notebook_new ();
+  gtk_notebook_popup_enable (GTK_NOTEBOOK (mw->priv->main_notebook));
+  gtk_notebook_set_show_tabs (GTK_NOTEBOOK (mw->priv->main_notebook), true);
+  gtk_notebook_set_scrollable (GTK_NOTEBOOK (mw->priv->main_notebook), true);
+
+  ekiga_main_window_init_contact_list (mw);
+  ekiga_main_window_init_dialpad (mw);
+  ekiga_main_window_init_history (mw);
+  gtk_paned_pack1 (GTK_PANED (mw->priv->hpaned), mw->priv->main_notebook, true, false);
+
+  ekiga_main_window_init_call_panel (mw);
+
+  /* The status toolbar */
+  ekiga_main_window_init_status_toolbar (mw);
+  gtk_box_pack_start (GTK_BOX (window_vbox), mw->priv->status_toolbar,
+                      false, false, 0); 
 
-  msg  = _("Do you want to use it as default device?");
-  label = gtk_label_new (NULL);
-  gtk_label_set_markup (GTK_LABEL (label), msg.c_str());
-  gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 2);
-  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
-  gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+  /* The statusbar with qualitymeter */
+  gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (mw->priv->statusbar), TRUE);
+  gtk_widget_style_get (mw->priv->statusbar, "shadow-type", &shadow_type, NULL);
 
-  gtk_window_set_title (GTK_WINDOW (add_device_popup), title.c_str ());
-  gtk_window_set_modal (GTK_WINDOW (add_device_popup), TRUE);
-  gtk_window_set_keep_above (GTK_WINDOW (add_device_popup), TRUE);
-  gtk_window_set_urgency_hint (GTK_WINDOW (main_window), TRUE);
-  gtk_window_set_transient_for (GTK_WINDOW (add_device_popup),
-				GTK_WINDOW (main_window));
+  frame = gtk_frame_new (NULL);
+  gtk_frame_set_shadow_type (GTK_FRAME (frame), shadow_type);
+  gtk_box_pack_start (GTK_BOX (mw->priv->statusbar), frame, FALSE, TRUE, 0);
 
-  gtk_widget_show_all (add_device_popup);
+  gtk_box_reorder_child (GTK_BOX (mw->priv->statusbar), frame, 0);
 
+  mw->priv->qualitymeter = gm_powermeter_new ();
+  gtk_container_add (GTK_CONTAINER (frame), mw->priv->qualitymeter);
 
-//  g_signal_connect (G_OBJECT (add_device_popup), "delete_event",
-//                    G_CALLBACK (gtk_widget_hide_on_delete), NULL);
-//  g_signal_connect (G_OBJECT (add_device_popup), "response",
-//                    GTK_SIGNAL_FUNC (add_device_response_cb), &device);
+  mw->priv->statusbar_ebox = gtk_event_box_new ();
+  gtk_container_add (GTK_CONTAINER (mw->priv->statusbar_ebox), mw->priv->statusbar);
 
-  deviceStruct* device_struct = g_new(deviceStruct, 1);
-  snprintf (device_struct->name, sizeof (device_struct->name), "%s", (device.GetString()).c_str());
-  device_struct->deviceType = deviceType;
+  gtk_box_pack_start (GTK_BOX (window_vbox), mw->priv->statusbar_ebox,
+                      FALSE, FALSE, 0);
+  gtk_widget_show_all (mw->priv->statusbar_ebox);
 
-  g_signal_connect_data (G_OBJECT (add_device_popup), "delete_event",
-                         G_CALLBACK (gtk_widget_hide_on_delete), 
-                         (gpointer) device_struct,
-                         (GClosureNotify) g_free,
-                         (GConnectFlags) 0);
+  g_signal_connect (G_OBJECT (mw->priv->statusbar_ebox), "button-press-event",
+		    GTK_SIGNAL_FUNC (statusbar_clicked_cb), mw);
+ 
+  gtk_widget_realize (GTK_WIDGET (mw));
+  ekiga_main_window_update_logo_have_window (mw);
+  g_signal_connect_after (G_OBJECT (mw->priv->main_notebook), "switch-page",
+			  G_CALLBACK (panel_section_changed_cb), 
+			  mw);
 
-  g_signal_connect_data (G_OBJECT (add_device_popup), "response",
-                         G_CALLBACK (add_device_response_cb), 
-                         (gpointer) device_struct,
-                         (GClosureNotify) g_free,
-                         (GConnectFlags) 0);
+  /* Show the current panel section */
+  PanelSection section = (PanelSection)
+               gm_conf_get_int (USER_INTERFACE_KEY "main_window/panel_section");
+  gtk_widget_show (mw->priv->hpaned);
+  gtk_widget_show_all (gtk_paned_get_child1 (GTK_PANED (mw->priv->hpaned)));
+  if (gm_conf_get_bool (USER_INTERFACE_KEY "main_window/show_call_panel"))
+    gtk_widget_show_all (gtk_paned_get_child2 (GTK_PANED (mw->priv->hpaned)));
+  ekiga_main_window_set_panel_section (mw, section);
 }
 
 static void
@@ -4026,465 +3609,506 @@
 {
   mw->priv = G_TYPE_INSTANCE_GET_PRIVATE (mw, EKIGA_TYPE_MAIN_WINDOW,
                                           EkigaMainWindowPrivate);
+
+  /* Accelerators */
+  mw->priv->accel = gtk_accel_group_new ();
+  gtk_window_add_accel_group (GTK_WINDOW (mw), mw->priv->accel);
+  g_object_unref (mw->priv->accel);
+
+  mw->priv->presentity = NULL;
+  mw->priv->transfer_call_popup = NULL;
+  mw->priv->current_call = NULL;
+  mw->priv->timeout_id = -1;
+  mw->priv->levelmeter_timeout_id = -1;
+  mw->priv->audio_transmission_active = false;
+  mw->priv->audio_reception_active = false; 
+  mw->priv->video_transmission_active = false;
+  mw->priv->video_reception_active = false;
+#ifndef WIN32
+  mw->priv->video_widget_gc = NULL;
+#endif
 }
 
-static void
-ekiga_main_window_class_init (EkigaMainWindowClass *klass)
+static GObject *
+ekiga_main_window_constructor (GType the_type,
+                               guint n_construct_properties,
+                               GObjectConstructParam *construct_params)
 {
-  g_type_class_add_private (klass, sizeof (EkigaMainWindowPrivate));
+  GObject *object;
+
+  object = G_OBJECT_CLASS (ekiga_main_window_parent_class)->constructor
+                          (the_type, n_construct_properties, construct_params);
+
+  ekiga_main_window_init_gui (EKIGA_MAIN_WINDOW (object));
+
+  /* GConf Notifiers */
+  gm_conf_notifier_add (USER_INTERFACE_KEY "main_window/panel_section",
+                        panel_section_changed_nt, object);
+
+  gm_conf_notifier_add (USER_INTERFACE_KEY "main_window/show_call_panel",
+                        show_call_panel_changed_nt, object);
+
+  return object;
 }
 
-GtkWidget *
-ekiga_main_window_new (Ekiga::ServiceCore *core)
+static void
+ekiga_main_window_finalize (GObject *gobject)
 {
-  EkigaMainWindow *mw;
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (gobject);
 
-  mw = EKIGA_MAIN_WINDOW (g_object_new (EKIGA_TYPE_MAIN_WINDOW, NULL));
-  mw->priv->core = core;
+  gtk_widget_destroy (mw->priv->audio_settings_window);
+  gtk_widget_destroy (mw->priv->video_settings_window);
 
-  gm_window_set_key (GM_WINDOW (mw), USER_INTERFACE_KEY "main_window");
+  if (mw->priv->connections)
+    delete mw->priv->connections;
 
-  return GTK_WIDGET (mw);
+  G_OBJECT_CLASS (ekiga_main_window_parent_class)->finalize (gobject);
 }
 
-GtkWidget *
-gm_main_window_new (Ekiga::ServiceCore & core)
+static void
+ekiga_main_window_show (GtkWidget *widget)
 {
-  GmMainWindow *mw = NULL;
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (widget);
+  if (gm_conf_get_bool (VIDEO_DISPLAY_KEY "stay_on_top") && mw->priv->current_call)
+    gdk_window_set_always_on_top (widget->window, TRUE);
+  GTK_WIDGET_CLASS (ekiga_main_window_parent_class)->show (widget);
+}
 
-  GtkWidget *window = NULL;
-  
-  GtkWidget *status_toolbar = NULL;
+static gboolean
+ekiga_main_window_expose_event (GtkWidget      *widget,
+                                GdkEventExpose *event)
+{
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (widget);
+  GtkWidget* video_widget = mw->priv->main_video_image;
+  Ekiga::DisplayInfo display_info;
+  gboolean handled = FALSE;
 
-  GtkStatusIcon *status_icon = NULL;
+  handled = GTK_WIDGET_CLASS (ekiga_main_window_parent_class)->expose_event
+                                                               (widget, event);
 
-  PanelSection section = DIALPAD;
+  display_info.x = video_widget->allocation.x;
+  display_info.y = video_widget->allocation.y;
 
-  sigc::connection conn;
+#ifdef WIN32  
+  display_info.hwnd = ((HWND) GDK_WINDOW_HWND (video_widget->window));
+#else 
+  if (!mw->priv->video_widget_gc) {
+    mw->priv->video_widget_gc = gdk_gc_new (video_widget->window);
+    g_return_val_if_fail (mw->priv->video_widget_gc != NULL, handled);
+  }
 
-  Ekiga::ServiceCore *services = NULL;
-  GtkFrontend *gtk_frontend = NULL;
-  GtkWidget *chat_window = NULL;
+  display_info.gc = GDK_GC_XGC (mw->priv->video_widget_gc);
+  display_info.xdisplay = GDK_GC_XDISPLAY (mw->priv->video_widget_gc);
 
-  /* initialize the callback to play IM message sound */
-  services = GnomeMeeting::Process ()->GetServiceCore ();
-  gtk_frontend = dynamic_cast<GtkFrontend *>(services->get ("gtk-frontend"));
-  chat_window = GTK_WIDGET (gtk_frontend->get_chat_window ());
+  display_info.window = GDK_WINDOW_XWINDOW (video_widget->window);
+  g_return_val_if_fail (display_info.window != 0, handled);
 
-  g_signal_connect (chat_window, "unread-alert",
-		    G_CALLBACK (on_chat_unread_alert), NULL);
+  gdk_flush();
+#endif
 
-  /* The Top-level window */
-  window = ekiga_main_window_new (&core);
-  gm_window_set_hide_on_delete (GM_WINDOW (window), FALSE);
-  gtk_window_set_title (GTK_WINDOW (window), 
-			_("Ekiga"));
+  display_info.widget_info_set = TRUE;
 
-  g_signal_connect (G_OBJECT (window), "focus-in-event",
-		    GTK_SIGNAL_FUNC (main_window_focus_event_cb), NULL);
+  Ekiga::VideoOutputCore *videooutput_core = dynamic_cast<Ekiga::VideoOutputCore *> (mw->priv->core->get ("videooutput-core"));
+  videooutput_core->set_display_info (display_info);
 
+  return handled;
+}
 
-  /* The GMObject data */
-  mw = new GmMainWindow (core);
-  mw->presentity = NULL;
-  mw->transfer_call_popup = NULL;
-  mw->current_call = NULL;
-  mw->timeout_id = -1;
-  mw->levelmeter_timeout_id = -1;
-  mw->audio_transmission_active = mw->audio_reception_active 
-    = mw->video_transmission_active = mw->video_reception_active = false;
-  g_object_set_data_full (G_OBJECT (window), "GMObject", 
-			  mw, (GDestroyNotify) gm_mw_destroy);
+static gboolean
+ekiga_main_window_focus_in_event (GtkWidget     *widget,
+                                  GdkEventFocus *event)
+{
+  if (gtk_window_get_urgency_hint (GTK_WINDOW (widget)))
+    gtk_window_set_urgency_hint (GTK_WINDOW (widget), FALSE);
 
-#ifndef WIN32
-  mw->video_widget_gc = NULL;
-#endif
+  return GTK_WIDGET_CLASS (ekiga_main_window_parent_class)->focus_in_event (widget, event);
+}
 
-  /* Accelerators */
-  mw->accel = gtk_accel_group_new ();
-  gtk_window_add_accel_group (GTK_WINDOW (window), mw->accel);
-  g_object_unref (mw->accel);
-
-  mw->window_vbox = gtk_vbox_new (0, FALSE);
-  gtk_container_add (GTK_CONTAINER (window), mw->window_vbox);
-  gtk_widget_show_all (mw->window_vbox);
+static gboolean
+ekiga_main_window_delete_event (GtkWidget   *widget,
+				G_GNUC_UNUSED GdkEventAny *event)
+{
+  GtkStatusIcon *statusicon = NULL;
 
-  /* The main menu */
-  mw->statusbar = gm_statusbar_new ();
-  gm_mw_init_menu (window); 
-  gtk_box_pack_start (GTK_BOX (mw->window_vbox), mw->main_menu,
-                      FALSE, FALSE, 0);
+  statusicon = GTK_STATUS_ICON (GnomeMeeting::Process ()->GetStatusicon ());
 
-  /* The toolbars */
-  mw->main_toolbar = gm_mw_init_uri_toolbar (window);
-  gtk_box_pack_start (GTK_BOX (mw->window_vbox), mw->main_toolbar, false, false, 0); 
+  if (!gtk_status_icon_is_embedded (statusicon))
+    quit_callback (NULL, widget);
+  else
+    gtk_widget_hide (widget);
 
-  /* The Audio & Video Settings windows */
-  mw->audio_settings_window = gm_mw_audio_settings_window_new (window);
-  mw->video_settings_window = gm_mw_video_settings_window_new (window);
+  return TRUE;
+}
 
-  /* The 2 parts of the gui */
-  mw->hpaned = gtk_hpaned_new ();
-  gtk_box_pack_start (GTK_BOX (mw->window_vbox), mw->hpaned,
-                      true, true, 0);
+static void
+ekiga_main_window_get_property (GObject *object,
+                                guint property_id,
+                                GValue *value,
+                                GParamSpec *pspec)
+{
+  EkigaMainWindow *mw;
 
-  mw->main_notebook = gtk_notebook_new ();
+  g_return_if_fail (EKIGA_IS_MAIN_WINDOW (object));
 
-  gtk_notebook_popup_enable (GTK_NOTEBOOK (mw->main_notebook));
-  gtk_notebook_set_show_tabs (GTK_NOTEBOOK (mw->main_notebook), true);
-  gtk_notebook_set_scrollable (GTK_NOTEBOOK (mw->main_notebook), true);
-
-  gm_mw_init_contacts_list (window);
-  gm_mw_init_dialpad (window);
-  gtk_paned_pack1 (GTK_PANED (mw->hpaned), mw->main_notebook, true, false);
-
-  gm_mw_init_call (window);
-  gm_mw_init_history (window);
-
-  section = (PanelSection) 
-    gm_conf_get_int (USER_INTERFACE_KEY "main_window/panel_section");
-  gtk_widget_show (mw->hpaned);
-  gtk_widget_show_all (GTK_WIDGET (gtk_paned_get_child1 (GTK_PANED (mw->hpaned))));
-  if (gm_conf_get_bool (USER_INTERFACE_KEY "main_window/show_call_panel"))
-    gtk_widget_show_all (GTK_WIDGET (gtk_paned_get_child2 (GTK_PANED (mw->hpaned))));
-  gm_main_window_set_panel_section (window, section);
+  mw = EKIGA_MAIN_WINDOW (object);
 
-  /* Status toolbar */
-  status_toolbar = gm_mw_init_status_toolbar (window);
-  gtk_box_pack_start (GTK_BOX (mw->window_vbox), status_toolbar, false, false, 0);
+  switch (property_id) {
+    case PROP_SERVICE_CORE:
+      g_value_set_pointer (value, mw->priv->core);
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+      break;
+  }
+}
 
-  /* The statusbar with qualitymeter */
-  gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (mw->statusbar), TRUE);
-  GtkShadowType shadow_type;
-  gtk_widget_style_get (mw->statusbar, "shadow-type", &shadow_type, NULL);
 
-  GtkWidget *frame = gtk_frame_new (NULL);
-  gtk_frame_set_shadow_type (GTK_FRAME (frame), shadow_type);
-  gtk_box_pack_start (GTK_BOX (mw->statusbar), frame, FALSE, TRUE, 0);
+static void
+ekiga_main_window_set_property (GObject *object,
+                                guint property_id,
+                                const GValue *value,
+                                GParamSpec *pspec)
+{
+  EkigaMainWindow *mw;
 
-  gtk_box_reorder_child (GTK_BOX (mw->statusbar), frame, 0);
+  g_return_if_fail (EKIGA_IS_MAIN_WINDOW (object));
 
-  mw->qualitymeter = gm_powermeter_new ();
-  gtk_container_add (GTK_CONTAINER (frame), mw->qualitymeter);
+  mw = EKIGA_MAIN_WINDOW (object);
 
-  mw->statusbar_ebox = gtk_event_box_new ();
-  gtk_container_add (GTK_CONTAINER (mw->statusbar_ebox), mw->statusbar);
+  switch (property_id) {
+    case PROP_SERVICE_CORE:
+      mw->priv->core = static_cast<Ekiga::ServiceCore *>
+                                                 (g_value_get_pointer (value));
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+      break;
+  }
+}
 
-  gtk_box_pack_start (GTK_BOX (mw->window_vbox), mw->statusbar_ebox,
-                      FALSE, FALSE, 0);
-  gtk_widget_show_all (mw->statusbar_ebox);
 
-  g_signal_connect (G_OBJECT (mw->statusbar_ebox), "button-press-event",
-		    GTK_SIGNAL_FUNC (statusbar_clicked_cb), window);
- 
-  gtk_widget_realize (window);
-  gm_main_window_update_logo_have_window (window);
-  g_signal_connect_after (G_OBJECT (mw->main_notebook), "switch-page",
-			  G_CALLBACK (panel_section_changed_cb), 
-			  window);
+static void
+ekiga_main_window_class_init (EkigaMainWindowClass *klass)
+{
+  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+  object_class->constructor = ekiga_main_window_constructor;
+  object_class->finalize = ekiga_main_window_finalize;
+  object_class->get_property = ekiga_main_window_get_property;
+  object_class->set_property = ekiga_main_window_set_property;
+
+  widget_class->show = ekiga_main_window_show;
+  widget_class->expose_event = ekiga_main_window_expose_event;
+  widget_class->focus_in_event = ekiga_main_window_focus_in_event;
+  widget_class->delete_event = ekiga_main_window_delete_event;
+
+  g_object_class_install_property (object_class,
+                                   PROP_SERVICE_CORE,
+                                   g_param_spec_pointer ("service-core",
+                                                         "Service Core",
+                                                         "Service Core",
+                                                         (GParamFlags)
+                                                         (G_PARAM_READWRITE |
+                                                          G_PARAM_CONSTRUCT_ONLY)));
+
+  g_type_class_add_private (klass, sizeof (EkigaMainWindowPrivate));
+}
+
+static void
+ekiga_main_window_connect_engine_signals (EkigaMainWindow *mw)
+{
+  sigc::connection conn;
+
+  g_return_if_fail (EKIGA_IS_MAIN_WINDOW (mw));
+  g_return_if_fail (mw->priv->connections == NULL);
+
+  mw->priv->connections = new std::vector<sigc::connection>();
 
-  /* if the user tries to close the window : delete_event */
-  g_signal_connect (G_OBJECT (window), "delete_event",
-		    G_CALLBACK (window_closed_cb), 
-		    (gpointer) window);
-  g_signal_connect (G_OBJECT (window), "show", 
-		    GTK_SIGNAL_FUNC (video_window_shown_cb), window);
-  g_signal_connect (G_OBJECT (window), "expose-event", 
-		    GTK_SIGNAL_FUNC (video_window_expose_cb), NULL);
-  
   /* New Display Engine signals */
-  Ekiga::VideoOutputCore *videooutput_core = dynamic_cast<Ekiga::VideoOutputCore *> (mw->core.get ("videooutput-core"));
+  Ekiga::VideoOutputCore *videooutput_core = dynamic_cast<Ekiga::VideoOutputCore *> (mw->priv->core->get ("videooutput-core"));
 
-  conn = videooutput_core->device_opened.connect (sigc::bind (sigc::ptr_fun (on_videooutput_device_opened_cb), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = videooutput_core->device_opened.connect (sigc::bind (sigc::ptr_fun (on_videooutput_device_opened_cb), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
 
-  conn = videooutput_core->device_closed.connect (sigc::bind (sigc::ptr_fun (on_videooutput_device_closed_cb), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = videooutput_core->device_closed.connect (sigc::bind (sigc::ptr_fun (on_videooutput_device_closed_cb), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
 
-  conn = videooutput_core->size_changed.connect (sigc::bind (sigc::ptr_fun (on_size_changed_cb), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = videooutput_core->size_changed.connect (sigc::bind (sigc::ptr_fun (on_size_changed_cb), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
 
-  conn = videooutput_core->fullscreen_mode_changed.connect (sigc::bind (sigc::ptr_fun (on_fullscreen_mode_changed_cb), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = videooutput_core->fullscreen_mode_changed.connect (sigc::bind (sigc::ptr_fun (on_fullscreen_mode_changed_cb), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
 
   /* New VideoInput Engine signals */
-  Ekiga::VideoInputCore *videoinput_core = dynamic_cast<Ekiga::VideoInputCore *> (mw->core.get ("videoinput-core"));
+  Ekiga::VideoInputCore *videoinput_core = dynamic_cast<Ekiga::VideoInputCore *> (mw->priv->core->get ("videoinput-core"));
 
-  conn = videoinput_core->device_opened.connect (sigc::bind (sigc::ptr_fun (on_videoinput_device_opened_cb), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = videoinput_core->device_opened.connect (sigc::bind (sigc::ptr_fun (on_videoinput_device_opened_cb), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
 
-  conn = videoinput_core->device_closed.connect (sigc::bind (sigc::ptr_fun (on_videoinput_device_closed_cb), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = videoinput_core->device_closed.connect (sigc::bind (sigc::ptr_fun (on_videoinput_device_closed_cb), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
 
-  conn = videoinput_core->device_added.connect (sigc::bind (sigc::ptr_fun (on_videoinput_device_added_cb), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = videoinput_core->device_added.connect (sigc::bind (sigc::ptr_fun (on_videoinput_device_added_cb), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
 
-  conn = videoinput_core->device_removed.connect (sigc::bind (sigc::ptr_fun (on_videoinput_device_removed_cb), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = videoinput_core->device_removed.connect (sigc::bind (sigc::ptr_fun (on_videoinput_device_removed_cb), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
 
-  conn = videoinput_core->device_error.connect (sigc::bind (sigc::ptr_fun (on_videoinput_device_error_cb), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = videoinput_core->device_error.connect (sigc::bind (sigc::ptr_fun (on_videoinput_device_error_cb), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
 
   /* New AudioInput Engine signals */
-  Ekiga::AudioInputCore *audioinput_core = dynamic_cast<Ekiga::AudioInputCore *> (mw->core.get ("audioinput-core"));
+  Ekiga::AudioInputCore *audioinput_core = dynamic_cast<Ekiga::AudioInputCore *> (mw->priv->core->get ("audioinput-core"));
 
-  conn = audioinput_core->device_opened.connect (sigc::bind (sigc::ptr_fun (on_audioinput_device_opened_cb), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = audioinput_core->device_opened.connect (sigc::bind (sigc::ptr_fun (on_audioinput_device_opened_cb), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
 
-  conn = audioinput_core->device_closed.connect (sigc::bind (sigc::ptr_fun (on_audioinput_device_closed_cb), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = audioinput_core->device_closed.connect (sigc::bind (sigc::ptr_fun (on_audioinput_device_closed_cb), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
 
-  conn = audioinput_core->device_added.connect (sigc::bind (sigc::ptr_fun (on_audioinput_device_added_cb), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = audioinput_core->device_added.connect (sigc::bind (sigc::ptr_fun (on_audioinput_device_added_cb), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
 
-  conn = audioinput_core->device_removed.connect (sigc::bind (sigc::ptr_fun (on_audioinput_device_removed_cb), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = audioinput_core->device_removed.connect (sigc::bind (sigc::ptr_fun (on_audioinput_device_removed_cb), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
 
-  conn = audioinput_core->device_error.connect (sigc::bind (sigc::ptr_fun (on_audioinput_device_error_cb), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = audioinput_core->device_error.connect (sigc::bind (sigc::ptr_fun (on_audioinput_device_error_cb), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
 
   /* New AudioOutput Engine signals */
-  Ekiga::AudioOutputCore *audiooutput_core = dynamic_cast<Ekiga::AudioOutputCore *> (mw->core.get ("audiooutput-core"));
+  Ekiga::AudioOutputCore *audiooutput_core = dynamic_cast<Ekiga::AudioOutputCore *> (mw->priv->core->get ("audiooutput-core"));
 
-  conn = audiooutput_core->device_opened.connect (sigc::bind (sigc::ptr_fun (on_audiooutput_device_opened_cb), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = audiooutput_core->device_opened.connect (sigc::bind (sigc::ptr_fun (on_audiooutput_device_opened_cb), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
 
-  conn = audiooutput_core->device_closed.connect (sigc::bind (sigc::ptr_fun (on_audiooutput_device_closed_cb), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = audiooutput_core->device_closed.connect (sigc::bind (sigc::ptr_fun (on_audiooutput_device_closed_cb), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
 
-  conn = audiooutput_core->device_added.connect (sigc::bind (sigc::ptr_fun (on_audiooutput_device_added_cb), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = audiooutput_core->device_added.connect (sigc::bind (sigc::ptr_fun (on_audiooutput_device_added_cb), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
 
-  conn = audiooutput_core->device_removed.connect (sigc::bind (sigc::ptr_fun (on_audiooutput_device_removed_cb), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = audiooutput_core->device_removed.connect (sigc::bind (sigc::ptr_fun (on_audiooutput_device_removed_cb), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
 
-  conn = audiooutput_core->device_error.connect (sigc::bind (sigc::ptr_fun (on_audiooutput_device_error_cb), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = audiooutput_core->device_error.connect (sigc::bind (sigc::ptr_fun (on_audiooutput_device_error_cb), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
     
   /* New Call Engine signals */
-  Ekiga::CallCore *call_core = dynamic_cast<Ekiga::CallCore *> (mw->core.get ("call-core"));
-  Ekiga::AccountCore *account_core = dynamic_cast<Ekiga::AccountCore *> (mw->core.get ("account-core"));
+  Ekiga::CallCore *call_core = dynamic_cast<Ekiga::CallCore *> (mw->priv->core->get ("call-core"));
+  Ekiga::AccountCore *account_core = dynamic_cast<Ekiga::AccountCore *> (mw->priv->core->get ("account-core"));
 
   /* Engine Signals callbacks */
-  conn = account_core->registration_event.connect (sigc::bind (sigc::ptr_fun (on_registration_event), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = account_core->registration_event.connect (sigc::bind (sigc::ptr_fun (on_registration_event), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
 
-  conn = call_core->ready.connect (sigc::bind (sigc::ptr_fun (on_ready_cb), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = call_core->ready.connect (sigc::bind (sigc::ptr_fun (on_ready_cb), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
 
-  conn = call_core->setup_call.connect (sigc::bind (sigc::ptr_fun (on_setup_call_cb), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = call_core->setup_call.connect (sigc::bind (sigc::ptr_fun (on_setup_call_cb), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
 
-  conn = call_core->ringing_call.connect (sigc::bind (sigc::ptr_fun (on_ringing_call_cb), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = call_core->ringing_call.connect (sigc::bind (sigc::ptr_fun (on_ringing_call_cb), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
   
-  conn = call_core->established_call.connect (sigc::bind (sigc::ptr_fun (on_established_call_cb), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = call_core->established_call.connect (sigc::bind (sigc::ptr_fun (on_established_call_cb), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
   
-  conn = call_core->cleared_call.connect (sigc::bind (sigc::ptr_fun (on_cleared_call_cb), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = call_core->cleared_call.connect (sigc::bind (sigc::ptr_fun (on_cleared_call_cb), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
   
-  conn = call_core->held_call.connect (sigc::bind (sigc::ptr_fun (on_held_call_cb), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = call_core->held_call.connect (sigc::bind (sigc::ptr_fun (on_held_call_cb), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
   
-  conn = call_core->retrieved_call.connect (sigc::bind (sigc::ptr_fun (on_retrieved_call_cb), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = call_core->retrieved_call.connect (sigc::bind (sigc::ptr_fun (on_retrieved_call_cb), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
   
-  conn = call_core->missed_call.connect (sigc::bind (sigc::ptr_fun (on_missed_call_cb), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = call_core->missed_call.connect (sigc::bind (sigc::ptr_fun (on_missed_call_cb), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
   
-  conn = call_core->stream_opened.connect (sigc::bind (sigc::ptr_fun (on_stream_opened_cb), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = call_core->stream_opened.connect (sigc::bind (sigc::ptr_fun (on_stream_opened_cb), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
   
-  conn = call_core->stream_closed.connect (sigc::bind (sigc::ptr_fun (on_stream_closed_cb), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = call_core->stream_closed.connect (sigc::bind (sigc::ptr_fun (on_stream_closed_cb), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
 
-  conn = call_core->stream_paused.connect (sigc::bind (sigc::ptr_fun (on_stream_paused_cb), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = call_core->stream_paused.connect (sigc::bind (sigc::ptr_fun (on_stream_paused_cb), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
 
-  conn = call_core->stream_resumed.connect (sigc::bind (sigc::ptr_fun (on_stream_resumed_cb), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = call_core->stream_resumed.connect (sigc::bind (sigc::ptr_fun (on_stream_resumed_cb), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
 
-  conn = call_core->errors.add_handler (sigc::bind (sigc::ptr_fun (on_handle_errors), (gpointer) window));
-  mw->connections.push_back (conn);
+  conn = call_core->errors.add_handler (sigc::bind (sigc::ptr_fun (on_handle_errors), (gpointer) mw));
+  mw->priv->connections->push_back (conn);
+}
 
-  /* Notifiers */
-  gm_conf_notifier_add (USER_INTERFACE_KEY "main_window/panel_section",
-			panel_section_changed_nt, window);
+GtkWidget *
+ekiga_main_window_new (Ekiga::ServiceCore *core)
+{
+  EkigaMainWindow *mw;
 
-  gm_conf_notifier_add (USER_INTERFACE_KEY "main_window/show_call_panel",
-			show_call_panel_changed_nt, window);
+  mw = EKIGA_MAIN_WINDOW (g_object_new (EKIGA_TYPE_MAIN_WINDOW,
+                                        "service-core", core, NULL));
+  gm_window_set_key (GM_WINDOW (mw), USER_INTERFACE_KEY "main_window");
+  ekiga_main_window_connect_engine_signals (mw);
+
+  return GTK_WIDGET (mw);
+}
+
+GtkWidget *
+gm_main_window_new (Ekiga::ServiceCore & core)
+{
+  GtkWidget *window = NULL;
+  EkigaMainWindow *mw = NULL;
+  
+  GtkStatusIcon *status_icon = NULL;
+
+  GtkFrontend *gtk_frontend = NULL;
+  GtkWidget *chat_window = NULL;
+
+  /* initialize the callback to play IM message sound */
+  /* FIXME: move this to the chat window code */
+  gtk_frontend = dynamic_cast<GtkFrontend *>(core.get ("gtk-frontend"));
+  chat_window = GTK_WIDGET (gtk_frontend->get_chat_window ());
+
+  g_signal_connect (chat_window, "unread-alert",
+		    G_CALLBACK (on_chat_unread_alert), NULL);
+
+  /* The Top-level window */
+  window = ekiga_main_window_new (&core);
+  mw = EKIGA_MAIN_WINDOW (window);
 
   /* Track status icon embed changes */
+  /* FIXME: move this to the status icon code */
   status_icon = GTK_STATUS_ICON (GnomeMeeting::Process ()->GetStatusicon ());
   g_signal_connect (G_OBJECT (status_icon), "notify::embedded",
 		    G_CALLBACK (on_status_icon_embedding_change), NULL);
 
   /* Until we are ready, nothing possible  */
-  gm_main_window_set_busy (window, true);
+  ekiga_main_window_set_busy (mw, true);
 
   return window;
 }
 
 
 void 
-gm_main_window_flash_message (GtkWidget *main_window, 
-			      const char *msg, 
-			      ...)
+ekiga_main_window_flash_message (EkigaMainWindow *mw,
+				 const char *msg,
+				 ...)
 {
-  GmMainWindow *mw = NULL;
-
   char buffer [1025];
-
-  g_return_if_fail (main_window != NULL);
-
-  mw = gm_mw_get_mw (main_window);
-
   va_list args;
 
+  g_return_if_fail (EKIGA_IS_MAIN_WINDOW (mw));
+
   va_start (args, msg);
   vsnprintf (buffer, 1024, msg, args);
-  gm_statusbar_flash_message (GM_STATUSBAR (mw->statusbar), "%s", buffer);
+  gm_statusbar_flash_message (GM_STATUSBAR (mw->priv->statusbar), "%s", buffer);
   va_end (args);
 }
 
 
 void 
-gm_main_window_push_message (GtkWidget *main_window, 
-			     const char *msg, 
-			     ...)
+ekiga_main_window_push_message (EkigaMainWindow *mw, 
+				const char *msg, 
+				...)
 {
-  GmMainWindow *mw = NULL;
-
   char buffer [1025];
-
-  g_return_if_fail (main_window != NULL);
-
-  mw = gm_mw_get_mw (main_window);
-
   va_list args;
 
+  g_return_if_fail (EKIGA_IS_MAIN_WINDOW (mw));
+
   va_start (args, msg);
   vsnprintf (buffer, 1024, msg, args);
-  gm_statusbar_push_message (GM_STATUSBAR (mw->statusbar), "%s", buffer);
+  gm_statusbar_push_message (GM_STATUSBAR (mw->priv->statusbar), "%s", buffer);
   va_end (args);
 }
 
 
 void 
-gm_main_window_push_info_message (GtkWidget *main_window, 
-				  const char *msg, 
-				  ...)
+ekiga_main_window_push_info_message (EkigaMainWindow *mw, 
+				     const char *msg, 
+				     ...)
 {
-  GmMainWindow *mw = NULL;
   char *buffer;
-  
-  g_return_if_fail (main_window != NULL);
-
-  mw = gm_mw_get_mw (main_window);
-
   va_list args;
 
+  g_return_if_fail (EKIGA_IS_MAIN_WINDOW (mw));
+
   va_start (args, msg);
   buffer = g_strdup_vprintf (msg, args);
-  gm_statusbar_push_info_message (GM_STATUSBAR (mw->statusbar), "%s", buffer);
+  gm_statusbar_push_info_message (GM_STATUSBAR (mw->priv->statusbar), "%s", buffer);
   g_free (buffer);
   va_end (args);
 }
 
 
 void 
-gm_main_window_set_call_url (GtkWidget *main_window, 
-			     const char *url)
+ekiga_main_window_set_call_url (EkigaMainWindow *mw, 
+				const char *url)
 {
-  GmMainWindow *mw = NULL;
-
-  g_return_if_fail (main_window != NULL && url != NULL);
-
-  mw = gm_mw_get_mw (main_window);
-
-  g_return_if_fail (mw != NULL);
+  g_return_if_fail (mw != NULL && url != NULL);
 
-  gtk_entry_set_text (GTK_ENTRY (mw->entry), url);
-  gtk_editable_set_position (GTK_EDITABLE (mw->entry), -1);
-  gtk_widget_grab_focus (GTK_WIDGET (mw->entry));
-  gtk_editable_select_region (GTK_EDITABLE (mw->entry), -1, -1);
+  gtk_entry_set_text (GTK_ENTRY (mw->priv->entry), url);
+  gtk_editable_set_position (GTK_EDITABLE (mw->priv->entry), -1);
+  gtk_widget_grab_focus (GTK_WIDGET (mw->priv->entry));
+  gtk_editable_select_region (GTK_EDITABLE (mw->priv->entry), -1, -1);
 }
 
 
 void 
-gm_main_window_append_call_url (GtkWidget *main_window, 
-				const char *url)
+ekiga_main_window_append_call_url (EkigaMainWindow *mw, 
+				   const char *url)
 {
-  GmMainWindow *mw = NULL;
-  
   int pos = -1;
+  GtkEditable *entry;
 
-  g_return_if_fail (main_window != NULL && url != NULL);
+  g_return_if_fail (EKIGA_IS_MAIN_WINDOW (mw));
+  g_return_if_fail (url != NULL);
 
-  mw = gm_mw_get_mw (main_window);
+  entry = GTK_EDITABLE (mw->priv->entry);
 
-  g_return_if_fail (mw != NULL && url != NULL);
- 
-  if (gtk_editable_get_selection_bounds (GTK_EDITABLE (mw->entry), NULL, NULL)) 
-    gtk_editable_delete_selection (GTK_EDITABLE (mw->entry));
+  if (gtk_editable_get_selection_bounds (entry, NULL, NULL)) 
+    gtk_editable_delete_selection (entry);
 
-  pos = gtk_editable_get_position (GTK_EDITABLE (mw->entry));
-  gtk_editable_insert_text (GTK_EDITABLE (mw->entry), url, strlen (url), &pos);
-  gtk_editable_select_region (GTK_EDITABLE (mw->entry), -1, -1);
-  gtk_editable_set_position (GTK_EDITABLE (mw->entry), pos);
+  pos = gtk_editable_get_position (entry);
+  gtk_editable_insert_text (entry, url, strlen (url), &pos);
+  gtk_editable_select_region (entry, -1, -1);
+  gtk_editable_set_position (entry, pos);
 }
 
 
 const char *
-gm_main_window_get_call_url (GtkWidget *main_window)
+ekiga_main_window_get_call_url (EkigaMainWindow *mw)
 {
-  GmMainWindow *mw = NULL;
-
-  g_return_val_if_fail (main_window != NULL, NULL);
-
-  mw = gm_mw_get_mw (main_window);
+  g_return_val_if_fail (EKIGA_IS_MAIN_WINDOW (mw), NULL);
 
-  g_return_val_if_fail (mw != NULL, NULL);
- 
-  return gtk_entry_get_text (GTK_ENTRY (mw->entry));
+  return gtk_entry_get_text (GTK_ENTRY (mw->priv->entry));
 }
 
 
 void 
-gm_main_window_clear_stats (GtkWidget *main_window)
+ekiga_main_window_clear_stats (EkigaMainWindow *mw)
 {
-  GmMainWindow *mw = NULL;
-
-  g_return_if_fail (main_window != NULL);
-
-  mw = gm_mw_get_mw (main_window);
+  g_return_if_fail (EKIGA_IS_MAIN_WINDOW (mw));
 
-  g_return_if_fail (mw != NULL);
-
-  gm_main_window_update_stats (main_window, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
-  if (mw->qualitymeter)
-    gm_powermeter_set_level (GM_POWERMETER (mw->qualitymeter), 0.0);
+  ekiga_main_window_update_stats (mw, 0, 0, 0, 0, 0, 0, 0, 0);
+  if (mw->priv->qualitymeter)
+    gm_powermeter_set_level (GM_POWERMETER (mw->priv->qualitymeter), 0.0);
 }
 
 
 void 
-gm_main_window_update_stats (GtkWidget *main_window,
-			     float lost,
-			     float late,
-			     float out_of_order,
-			     int jitter,
-			     G_GNUC_UNUSED float new_video_octets_received,
-			     G_GNUC_UNUSED float new_video_octets_transmitted,
-			     G_GNUC_UNUSED float new_audio_octets_received,
-			     G_GNUC_UNUSED float new_audio_octets_transmitted,
-			     unsigned int re_width,
-			     unsigned int re_height,
-			     unsigned int tr_width,
-			     unsigned int tr_height)
+ekiga_main_window_update_stats (EkigaMainWindow *mw,
+				float lost,
+				float late,
+				float out_of_order,
+				int jitter,
+				unsigned int re_width,
+				unsigned int re_height,
+				unsigned int tr_width,
+				unsigned int tr_height)
 {
-  GmMainWindow *mw = NULL;
-  
   gchar *stats_msg = NULL;
   gchar *stats_msg_tr = NULL;
   gchar *stats_msg_re = NULL;
@@ -4492,12 +4116,7 @@
   int jitter_quality = 0;
   gfloat quality_level = 0.0;
 
-  
-  g_return_if_fail (main_window != NULL);
-
-  mw = gm_mw_get_mw (main_window);
-
-  g_return_if_fail (mw != NULL);
+  g_return_if_fail (EKIGA_IS_MAIN_WINDOW (mw));
 
   if ((tr_width > 0) && (tr_height > 0))
     /* Translators:
@@ -4522,79 +4141,65 @@
   g_free(stats_msg_re);
 
 
-  if (mw->statusbar_ebox) {
-    gtk_widget_set_tooltip_text (GTK_WIDGET (mw->statusbar_ebox), stats_msg);
+  if (mw->priv->statusbar_ebox) {
+    gtk_widget_set_tooltip_text (GTK_WIDGET (mw->priv->statusbar_ebox), stats_msg);
   }
   g_free (stats_msg);
 
-    /* "arithmetics" for the quality level */
-    /* Thanks Snark for the math hints */
-    if (jitter < 30)
-      jitter_quality = 100;
-    if (jitter >= 30 && jitter < 50)
-      jitter_quality = 100 - (jitter - 30);
-    if (jitter >= 50 && jitter < 100)
-      jitter_quality = 80 - (jitter - 50) * 20 / 50;
-    if (jitter >= 100 && jitter < 150)
-      jitter_quality = 60 - (jitter - 100) * 20 / 50;
-    if (jitter >= 150 && jitter < 200)
-      jitter_quality = 40 - (jitter - 150) * 20 / 50;
-    if (jitter >= 200 && jitter < 300)
-      jitter_quality = 20 - (jitter - 200) * 20 / 100;
-    if (jitter >= 300 || jitter_quality < 0)
-      jitter_quality = 0;
-
-    quality_level = (float) jitter_quality / 100;
-
-    if ( (lost > 0.0) ||
-         (late > 0.0) ||
-         ((out_of_order > 0.0) && quality_level > 0.2) ) {
-      quality_level = 0.2;
-    }
-
-    if ( (lost > 0.02) ||
-         (late > 0.02) ||
-         (out_of_order > 0.02) ) {
-      quality_level = 0;
-    }
-
-    if (mw->qualitymeter)
-      gm_powermeter_set_level (GM_POWERMETER (mw->qualitymeter),
-  			       quality_level);
+  /* "arithmetics" for the quality level */
+  /* Thanks Snark for the math hints */
+  if (jitter < 30)
+    jitter_quality = 100;
+  if (jitter >= 30 && jitter < 50)
+    jitter_quality = 100 - (jitter - 30);
+  if (jitter >= 50 && jitter < 100)
+    jitter_quality = 80 - (jitter - 50) * 20 / 50;
+  if (jitter >= 100 && jitter < 150)
+    jitter_quality = 60 - (jitter - 100) * 20 / 50;
+  if (jitter >= 150 && jitter < 200)
+    jitter_quality = 40 - (jitter - 150) * 20 / 50;
+  if (jitter >= 200 && jitter < 300)
+    jitter_quality = 20 - (jitter - 200) * 20 / 100;
+  if (jitter >= 300 || jitter_quality < 0)
+    jitter_quality = 0;
+
+  quality_level = (float) jitter_quality / 100;
+
+  if ( (lost > 0.0) ||
+       (late > 0.0) ||
+       ((out_of_order > 0.0) && quality_level > 0.2) ) {
+    quality_level = 0.2;
+  }
+
+  if ( (lost > 0.02) ||
+       (late > 0.02) ||
+       (out_of_order > 0.02) ) {
+    quality_level = 0;
+  }
+
+  if (mw->priv->qualitymeter)
+    gm_powermeter_set_level (GM_POWERMETER (mw->priv->qualitymeter),
+			     quality_level);
 }
 
 
 GdkPixbuf *
-gm_main_window_get_current_picture (GtkWidget *main_window)
+ekiga_main_window_get_current_picture (EkigaMainWindow *mw)
 {
-  GmMainWindow *mw = NULL;
-  
-  g_return_val_if_fail (main_window != NULL, NULL);
-
-  mw = gm_mw_get_mw (main_window);
+  g_return_val_if_fail (EKIGA_IS_MAIN_WINDOW (mw), NULL);
 
-  g_return_val_if_fail (mw != NULL, NULL);
-
-  return gtk_image_get_pixbuf (GTK_IMAGE (mw->main_video_image));
+  return gtk_image_get_pixbuf (GTK_IMAGE (mw->priv->main_video_image));
 }
 
 
 void 
-gm_main_window_set_stay_on_top (GtkWidget *main_window,
-				gboolean stay_on_top)
+ekiga_main_window_set_stay_on_top (EkigaMainWindow *mw,
+				   gboolean stay_on_top)
 {
-  GmMainWindow *mw = NULL;
-  
-  GdkWindow *gm_window = NULL;
-
-  g_return_if_fail (main_window != NULL);
-  mw = gm_mw_get_mw (main_window);
-  g_return_if_fail (mw != NULL);
-  
-  gm_window = GDK_WINDOW (main_window->window);
+  g_return_if_fail (EKIGA_IS_MAIN_WINDOW (mw));
 
   /* Update the stay-on-top attribute */
-  gdk_window_set_always_on_top (GDK_WINDOW (gm_window), stay_on_top);
+  gdk_window_set_always_on_top (GTK_WIDGET (mw)->window, stay_on_top);
 }
 
 /* The main () */
@@ -4754,8 +4359,8 @@
    * is a fatal error.
    */
   main_window = GnomeMeeting::Process ()->GetMainWindow ();
-  GmMainWindow *mw = gm_mw_get_mw (main_window); //TODO no gm_mw_get_mw here
-  Ekiga::CallCore *call_core = dynamic_cast<Ekiga::CallCore *> (mw->core.get ("call-core"));
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (main_window); //TODO no priv here
+  Ekiga::CallCore *call_core = dynamic_cast<Ekiga::CallCore *> (mw->priv->core->get ("call-core"));
   if (error == -1) {
 
     if (gm_conf_get_int (GENERAL_KEY "version") 
@@ -4827,7 +4432,7 @@
 
 #ifdef HAVE_DBUS
   /* Create the dbus server instance */
-  EkigaDBusComponent *dbus_component = ekiga_dbus_component_new (&mw->core);
+  EkigaDBusComponent *dbus_component = ekiga_dbus_component_new (mw->priv->core);
 #endif
 
   /* The GTK loop */

Modified: trunk/src/gui/main.h
==============================================================================
--- trunk/src/gui/main.h	(original)
+++ trunk/src/gui/main.h	Wed Oct  8 18:23:27 2008
@@ -85,14 +85,14 @@
  * BEHAVIOR     :  Return the video widget in which we can display.
  * PRE          :  The main window GMObject.
  */
-GtkWidget *gm_main_window_get_video_widget (GtkWidget *main_window);
+GtkWidget *ekiga_main_window_get_video_widget (EkigaMainWindow *main_window);
 
 
 /* DESCRIPTION  :  /
  * BEHAVIOR     :  Displays the gnomemeeting logo in the video window.
  * PRE          :  The main window GMObject.
  */
-void gm_main_window_update_logo_have_window (GtkWidget *main_window);
+void ekiga_main_window_update_logo_have_window (EkigaMainWindow *main_window);
 
 
 /* DESCRIPTION  :  /
@@ -106,8 +106,8 @@
  * 		   following the call is on hold (TRUE) or not (FALSE).
  * PRE          :  The main window GMObject.
  */
-void gm_main_window_set_call_hold (GtkWidget *main_window,
-                                   bool is_on_hold);
+void ekiga_main_window_set_call_hold (EkigaMainWindow *main_window,
+                                      bool is_on_hold);
 
 
 /* DESCRIPTION  :  /
@@ -117,9 +117,9 @@
  * 		   item.
  * PRE          :  The main window GMObject.
  */
-void gm_main_window_set_channel_pause (GtkWidget *main_window,
-				       gboolean pause,
-				       gboolean is_video);
+void ekiga_main_window_set_channel_pause (EkigaMainWindow *main_window,
+					  gboolean pause,
+					  gboolean is_video);
 
 
 /* DESCRIPTION  :  /
@@ -138,8 +138,8 @@
  * PRE          :  The main window GMObject.
  * 		   A valid GMH323Endpoint calling state.
  */
-void gm_main_window_update_calling_state (GtkWidget *main_window,
-					  unsigned calling_state);
+void ekiga_main_window_update_calling_state (EkigaMainWindow *mw,
+					     unsigned calling_state);
 
 
 
@@ -149,7 +149,7 @@
  * PRE          :  The main window GMObject.
  * 		   The first parameter is TRUE if we are busy.
  */
-void gm_main_window_set_busy (GtkWidget *main_window,
+void ekiga_main_window_set_busy (EkigaMainWindow *main_window,
 			      bool busy);
 
 
@@ -215,18 +215,10 @@
  * 		   and in the main window.
  * PRE          :  The main window GMObject and a valid section.
  */
-void gm_main_window_set_panel_section (GtkWidget *main_window,
-                                       int section);
+void ekiga_main_window_set_panel_section (EkigaMainWindow *main_window,
+                                          int section);
 
 
-/* DESCRIPTION  :  /
- * BEHAVIOR     :  Set the status for the main window.
- * PRE          :  The main window GMObject and a valid incoming call mode.
- */
-void gm_main_window_set_status (GtkWidget *main_window,
-                                std::string short_status,
-                                std::string long_status);
-
 
 /* DESCRIPTION  :  /
  * BEHAVIOR     :  Updates the information displayed in the info label
@@ -237,27 +229,27 @@
  * 		   the transmitted video codec,
  * 		   the received video codec(if any).
  */
-void gm_main_window_set_call_info (GtkWidget *main_window,
-				   const char *tr_audio_codec,
-				   const char *re_audio_codec,
-				   const char *tr_video_codec,
-				   const char *re_video_codec);
+void ekiga_main_window_set_call_info (EkigaMainWindow *main_window,
+				      const char *tr_audio_codec,
+				      const char *re_audio_codec,
+				      const char *tr_video_codec,
+				      const char *re_video_codec);
 
 
 /* DESCRIPTION   :  /
  * BEHAVIOR      : Sets the current call duration (as a string) in the GUI.
  * PRE           : The main window GMObject.
  */
-void gm_main_window_set_call_duration (GtkWidget *main_window,
-                                       const char *duration);
+void ekiga_main_window_set_call_duration (EkigaMainWindow *main_window,
+                                          const char *duration);
 
 
 /* DESCRIPTION   :  /
  * BEHAVIOR      : Sets the current status in the GUI.
  * PRE           : The main window GMObject.
  */
-void gm_main_window_set_status (GtkWidget *main_window,
-				const char *status);
+void ekiga_main_window_set_status (EkigaMainWindow *main_window,
+				   const char *status);
 
 
 /* DESCRIPTION  :  /
@@ -284,9 +276,9 @@
  * PRE          :  The main window GMObject, the parent window, the URL
  * 		   to put in the dialog as default.
  */
-gboolean gm_main_window_transfer_dialog_run (GtkWidget *main_window,
-					     GtkWidget *parent_window,
-					     const char *u);
+gboolean ekiga_main_window_transfer_dialog_run (EkigaMainWindow *main_window,
+					        GtkWidget *parent_window,
+					        const char *u);
 
 
 /* DESCRIPTION  :  /
@@ -301,20 +293,9 @@
  *                 Removes the previous message.
  * PRE           : The main window GMObject, followed by printf syntax format.
  */
-void gm_main_window_flash_message (GtkWidget *main_window,
-				   const char *msg,
-				   ...) G_GNUC_PRINTF(2,3);
-
-
-/* DESCRIPTION   :  /
- * BEHAVIOR      : Displays a message on the statusbar indicating the number
- * 		   of missed calls and voice mails.
- * PRE           : The main window GMObject, followed by the number of missed
- * 		   calls and the number of voice mails.
- */
-void gm_main_window_push_message (GtkWidget *main_window,
-				  unsigned int missed,
-				  unsigned int mwi);
+void ekiga_main_window_flash_message (EkigaMainWindow *main_window,
+				      const char *msg,
+				      ...) G_GNUC_PRINTF(2,3);
 
 
 /* DESCRIPTION   :  /
@@ -322,9 +303,9 @@
  *                 Removes the previous message.
  * PRE           : The main window GMObject, followed by printf syntax format.
  */
-void gm_main_window_push_message (GtkWidget *main_window,
-				  const char *msg,
-				  ...) G_GNUC_PRINTF(2,3);
+void ekiga_main_window_push_message (EkigaMainWindow *main_window,
+				     const char *msg,
+				     ...) G_GNUC_PRINTF(2,3);
 
 
 /* DESCRIPTION   :  /
@@ -332,16 +313,16 @@
  * 		   is only cleared when the user clicks on it.
  * PRE           : The main window GMObject, followed by printf syntax format.
  */
-void gm_main_window_push_info_message (GtkWidget *main_window,
-				       const char *msg,
-				       ...) G_GNUC_PRINTF(2,3);
+void ekiga_main_window_push_info_message (EkigaMainWindow *main_window,
+					  const char *msg,
+					  ...) G_GNUC_PRINTF(2,3);
 
 /* DESCRIPTION   :  /
  * BEHAVIOR      : Sets the given URL as called URL.
  * PRE           : The main window GMObject.
  */
-void gm_main_window_set_call_url (GtkWidget *main_window,
-				  const char *url);
+void ekiga_main_window_set_call_url (EkigaMainWindow *mw,
+				     const char *url);
 
 
 /* DESCRIPTION   :  /
@@ -349,22 +330,22 @@
  * 		   current selection if any.
  * PRE           : The main window GMObject.
  */
-void gm_main_window_append_call_url (GtkWidget *main_window,
-				     const char *url);
+void ekiga_main_window_append_call_url (EkigaMainWindow *mw,
+					const char *url);
 
 
 /* DESCRIPTION   :  /
  * BEHAVIOR      : Returns the currently called URL in the URL bar.
  * PRE           : The main window GMObject.
  */
-const char *gm_main_window_get_call_url (GtkWidget *main_window);
+const char *ekiga_main_window_get_call_url (EkigaMainWindow *main_window);
 
 
 /* DESCRIPTION   :  /
  * BEHAVIOR      : Clears the stats area in the control panel. 
  * PRE           : The main window GMObject.
  */
-void gm_main_window_clear_stats (GtkWidget *main_window);
+void ekiga_main_window_clear_stats (EkigaMainWindow *main_window);
 
 
 /* DESCRIPTION   :  /
@@ -373,34 +354,30 @@
  * 		   video bytes received, transmitted, audio bytes received,
  * 		   transmitted. All >= 0.
  */
-void gm_main_window_update_stats (GtkWidget *main_window,
-				  float lost,
-				  float late,
-				  float out_of_order,
-				  int jitter,
-				  float new_video_octets_received,
-				  float new_video_octets_transmitted,
-				  float new_audio_octets_received,
-				  float new_audio_octets_transmitted,
-				  unsigned int re_width,
-				  unsigned int re_height,
-				  unsigned int tr_width,
-				  unsigned int tr_height);
+void ekiga_main_window_update_stats (EkigaMainWindow *main_window,
+				     float lost,
+				     float late,
+				     float out_of_order,
+				     int jitter,
+				     unsigned int re_width,
+				     unsigned int re_height,
+				     unsigned int tr_width,
+				     unsigned int tr_height);
 
 
 /* DESCRIPTION   :  /
  * BEHAVIOR      : Returns the currently displayed picture as a pixbuf.
  * PRE           : The main window GMObject.
  */
-GdkPixbuf *gm_main_window_get_current_picture (GtkWidget *main_window);
+GdkPixbuf *ekiga_main_window_get_current_picture (EkigaMainWindow *main_window);
 
 
 /* DESCRIPTION   :  /
  * BEHAVIOR      : Returns the currently displayed picture as a pixbuf.
  * PRE           : The main window GMObject.
  */
-void gm_main_window_set_stay_on_top (GtkWidget *main_window,
-				     gboolean stay_on_top);
+void ekiga_main_window_set_stay_on_top (EkigaMainWindow *mw,
+				        gboolean stay_on_top);
 
 
 /* DESCRIPTION  :  /
@@ -414,10 +391,10 @@
  *                 if we are transmitting audio (or video), the third is TRUE
  *                 if we are receiving audio (or video).
  */
-void gm_main_window_update_sensitivity (GtkWidget *main_window,
-					bool is_video,
-					bool is_receiving,
-					bool is_transmitting);
+void ekiga_main_window_update_sensitivity (EkigaMainWindow *main_window,
+					   bool is_video,
+					   bool is_receiving,
+					   bool is_transmitting);
 
 
 /* DESCRIPTION   :  /



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