ekiga r7420 - trunk/lib/engine/gui/gtk-frontend
- From: jpuydt svn gnome org
- To: svn-commits-list gnome org
- Subject: ekiga r7420 - trunk/lib/engine/gui/gtk-frontend
- Date: Tue, 25 Nov 2008 19:19:11 +0000 (UTC)
Author: jpuydt
Date: Tue Nov 25 19:19:10 2008
New Revision: 7420
URL: http://svn.gnome.org/viewvc/ekiga?rev=7420&view=rev
Log:
Made the chat GUI use gmref_ptr too
Modified:
trunk/lib/engine/gui/gtk-frontend/chat-area.cpp
trunk/lib/engine/gui/gtk-frontend/chat-area.h
trunk/lib/engine/gui/gtk-frontend/chat-window.cpp
trunk/lib/engine/gui/gtk-frontend/multiple-chat-page.cpp
trunk/lib/engine/gui/gtk-frontend/multiple-chat-page.h
trunk/lib/engine/gui/gtk-frontend/simple-chat-page.cpp
trunk/lib/engine/gui/gtk-frontend/simple-chat-page.h
Modified: trunk/lib/engine/gui/gtk-frontend/chat-area.cpp
==============================================================================
--- trunk/lib/engine/gui/gtk-frontend/chat-area.cpp (original)
+++ trunk/lib/engine/gui/gtk-frontend/chat-area.cpp Tue Nov 25 19:19:10 2008
@@ -59,7 +59,7 @@
{
Ekiga::Chat* chat;
sigc::connection connection;
- ChatAreaHelper* helper;
+ gmref_ptr<ChatAreaHelper> helper;
GmTextBufferEnhancer* enhancer;
GtkWidget* smiley_menu;
@@ -638,9 +638,8 @@
self->priv->connection.disconnect ();
if (self->priv->helper) {
- self->priv->chat->disconnect (*(self->priv->helper));
- delete self->priv->helper;
- self->priv->helper = NULL;
+ self->priv->chat->disconnect (self->priv->helper);
+ self->priv->helper.reset ();
}
self->priv->chat = NULL;
}
@@ -687,8 +686,8 @@
ptr = g_value_get_pointer (value);
self->priv->chat = (Ekiga::Chat *)ptr;
self->priv->connection = self->priv->chat->removed.connect (sigc::bind (sigc::ptr_fun (on_chat_removed), self));
- self->priv->helper = new ChatAreaHelper (self);
- self->priv->chat->connect (*(self->priv->helper));
+ self->priv->helper = gmref_ptr<ChatAreaHelper>(new ChatAreaHelper (self));
+ self->priv->chat->connect (self->priv->helper);
break;
default:
@@ -1007,10 +1006,10 @@
/* public api */
GtkWidget*
-chat_area_new (Ekiga::Chat& chat)
+chat_area_new (gmref_ptr<Ekiga::Chat> chat)
{
return (GtkWidget*)g_object_new (TYPE_CHAT_AREA,
- "chat", &chat,
+ "chat", &*chat,
NULL);
}
Modified: trunk/lib/engine/gui/gtk-frontend/chat-area.h
==============================================================================
--- trunk/lib/engine/gui/gtk-frontend/chat-area.h (original)
+++ trunk/lib/engine/gui/gtk-frontend/chat-area.h Tue Nov 25 19:19:10 2008
@@ -65,7 +65,7 @@
/* public api */
-GtkWidget *chat_area_new (Ekiga::Chat& chat);
+GtkWidget *chat_area_new (gmref_ptr<Ekiga::Chat> chat);
const std::string chat_area_get_title (ChatArea* chat);
Modified: trunk/lib/engine/gui/gtk-frontend/chat-window.cpp
==============================================================================
--- trunk/lib/engine/gui/gtk-frontend/chat-window.cpp (original)
+++ trunk/lib/engine/gui/gtk-frontend/chat-window.cpp Tue Nov 25 19:19:10 2008
@@ -88,11 +88,11 @@
gpointer data);
static bool on_dialect_added (ChatWindow* self,
- Ekiga::Dialect& dialect);
+ gmref_ptr<Ekiga::Dialect> dialect);
static bool on_simple_chat_added (ChatWindow* self,
- Ekiga::SimpleChat& chat);
+ gmref_ptr<Ekiga::SimpleChat> chat);
static bool on_multiple_chat_added (ChatWindow* self,
- Ekiga::MultipleChat& chat);
+ gmref_ptr<Ekiga::MultipleChat> chat);
static void on_some_chat_user_requested (ChatWindow* self,
GtkWidget* page);
@@ -265,20 +265,20 @@
static bool
on_dialect_added (ChatWindow* self,
- Ekiga::Dialect& dialect)
+ gmref_ptr<Ekiga::Dialect> dialect)
{
- self->priv->connections.push_front (dialect.simple_chat_added.connect (sigc::hide_return (sigc::bind<0> (sigc::ptr_fun (on_simple_chat_added), self))));
- self->priv->connections.push_front (dialect.multiple_chat_added.connect (sigc::hide_return (sigc::bind<0> (sigc::ptr_fun (on_multiple_chat_added), self))));
+ self->priv->connections.push_front (dialect->simple_chat_added.connect (sigc::hide_return (sigc::bind<0> (sigc::ptr_fun (on_simple_chat_added), self))));
+ self->priv->connections.push_front (dialect->multiple_chat_added.connect (sigc::hide_return (sigc::bind<0> (sigc::ptr_fun (on_multiple_chat_added), self))));
- dialect.visit_simple_chats (sigc::bind<0> (sigc::ptr_fun (on_simple_chat_added), self));
- dialect.visit_multiple_chats (sigc::bind<0> (sigc::ptr_fun (on_multiple_chat_added), self));
+ dialect->visit_simple_chats (sigc::bind<0> (sigc::ptr_fun (on_simple_chat_added), self));
+ dialect->visit_multiple_chats (sigc::bind<0> (sigc::ptr_fun (on_multiple_chat_added), self));
return true;
}
static bool
on_simple_chat_added (ChatWindow* self,
- Ekiga::SimpleChat &chat)
+ gmref_ptr<Ekiga::SimpleChat> chat)
{
GtkWidget* page = NULL;
GtkWidget* hbox = NULL;
@@ -290,9 +290,9 @@
page = simple_chat_page_new (chat);
hbox = gtk_hbox_new (FALSE, 2);
- label = gtk_label_new (chat.get_title ().c_str ());
+ label = gtk_label_new (chat->get_title ().c_str ());
g_object_set_data_full (G_OBJECT (label), "base-title",
- g_strdup (chat.get_title ().c_str ()),
+ g_strdup (chat->get_title ().c_str ()),
g_free);
close_button = gtk_button_new ();
@@ -319,27 +319,27 @@
g_signal_connect (page, "message-notice-event",
G_CALLBACK (on_message_notice_event), self);
- self->priv->connections.push_front (chat.user_requested.connect (sigc::bind (sigc::ptr_fun (on_some_chat_user_requested), self, page)));
+ self->priv->connections.push_front (chat->user_requested.connect (sigc::bind (sigc::ptr_fun (on_some_chat_user_requested), self, page)));
return true;
}
static bool
on_multiple_chat_added (ChatWindow* self,
- Ekiga::MultipleChat &chat)
+ gmref_ptr<Ekiga::MultipleChat> chat)
{
GtkWidget* page = NULL;
GtkWidget* label = NULL;
gint num;
page = multiple_chat_page_new (chat);
- label = gtk_label_new (chat.get_title ().c_str ());
+ label = gtk_label_new (chat->get_title ().c_str ());
num = gtk_notebook_append_page (GTK_NOTEBOOK (self->priv->notebook),
page, label);
gtk_widget_show_all (page);
- self->priv->connections.push_front (chat.user_requested.connect (sigc::bind (sigc::ptr_fun (on_some_chat_user_requested), self, page)));
+ self->priv->connections.push_front (chat->user_requested.connect (sigc::bind (sigc::ptr_fun (on_some_chat_user_requested), self, page)));
return true;
}
Modified: trunk/lib/engine/gui/gtk-frontend/multiple-chat-page.cpp
==============================================================================
--- trunk/lib/engine/gui/gtk-frontend/multiple-chat-page.cpp (original)
+++ trunk/lib/engine/gui/gtk-frontend/multiple-chat-page.cpp Tue Nov 25 19:19:10 2008
@@ -133,7 +133,7 @@
/* implementation of the public api */
GtkWidget*
-multiple_chat_page_new (Ekiga::MultipleChat& chat)
+multiple_chat_page_new (gmref_ptr<Ekiga::MultipleChat> chat)
{
MultipleChatPage* result = NULL;
GtkWidget* area = NULL;
Modified: trunk/lib/engine/gui/gtk-frontend/multiple-chat-page.h
==============================================================================
--- trunk/lib/engine/gui/gtk-frontend/multiple-chat-page.h (original)
+++ trunk/lib/engine/gui/gtk-frontend/multiple-chat-page.h Tue Nov 25 19:19:10 2008
@@ -45,7 +45,7 @@
/* public api */
-GtkWidget* multiple_chat_page_new (Ekiga::MultipleChat& chat);
+GtkWidget* multiple_chat_page_new (gmref_ptr<Ekiga::MultipleChat> chat);
/* GObject boilerplate */
Modified: trunk/lib/engine/gui/gtk-frontend/simple-chat-page.cpp
==============================================================================
--- trunk/lib/engine/gui/gtk-frontend/simple-chat-page.cpp (original)
+++ trunk/lib/engine/gui/gtk-frontend/simple-chat-page.cpp Tue Nov 25 19:19:10 2008
@@ -162,7 +162,7 @@
/* implementation of the public api */
GtkWidget*
-simple_chat_page_new (Ekiga::SimpleChat& chat)
+simple_chat_page_new (gmref_ptr<Ekiga::SimpleChat> chat)
{
SimpleChatPage* result = NULL;
GtkWidget* presentity_view = NULL;
@@ -170,7 +170,7 @@
result = (SimpleChatPage*)g_object_new (TYPE_SIMPLE_CHAT_PAGE, NULL);
- presentity_view = presentity_view_new (chat.get_presentity ());
+ presentity_view = presentity_view_new (chat->get_presentity ());
gtk_box_pack_start (GTK_BOX (result), presentity_view,
FALSE, TRUE, 2);
gtk_widget_show (presentity_view);
Modified: trunk/lib/engine/gui/gtk-frontend/simple-chat-page.h
==============================================================================
--- trunk/lib/engine/gui/gtk-frontend/simple-chat-page.h (original)
+++ trunk/lib/engine/gui/gtk-frontend/simple-chat-page.h Tue Nov 25 19:19:10 2008
@@ -45,7 +45,7 @@
/* public api */
-GtkWidget* simple_chat_page_new (Ekiga::SimpleChat& chat);
+GtkWidget* simple_chat_page_new (gmref_ptr<Ekiga::SimpleChat> chat);
/* GObject boilerplate */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]