[ekiga/gnome-2-26] Syntactic sugar : Ekiga::BookPtr instead of gmref_ptr<Ekiga::Book>



commit f7d89a0e77826ead6b21781ca230e51df030bacb
Author: Julien Puydt <jpuydt src gnome org>
Date:   Tue Mar 24 21:08:00 2009 +0000

    Syntactic sugar : Ekiga::BookPtr instead of gmref_ptr<Ekiga::Book>
    
    svn path=/trunk/; revision=7810
---
 lib/engine/addressbook/book.h                      |    2 +
 lib/engine/gui/gtk-frontend/addressbook-window.cpp |   32 ++++++++++----------
 lib/engine/gui/gtk-frontend/book-view-gtk.cpp      |    6 ++--
 lib/engine/gui/gtk-frontend/book-view-gtk.h        |    2 +-
 4 files changed, 22 insertions(+), 20 deletions(-)

diff --git a/lib/engine/addressbook/book.h b/lib/engine/addressbook/book.h
index c78825a..ace008d 100644
--- a/lib/engine/addressbook/book.h
+++ b/lib/engine/addressbook/book.h
@@ -135,6 +135,8 @@ namespace Ekiga {
      */
     ChainOfResponsibility<FormRequest*> questions;
   };
+
+  typedef gmref_ptr<Book> BookPtr;
 };
 
 #endif
diff --git a/lib/engine/gui/gtk-frontend/addressbook-window.cpp b/lib/engine/gui/gtk-frontend/addressbook-window.cpp
index 3136ea9..5a4c13a 100644
--- a/lib/engine/gui/gtk-frontend/addressbook-window.cpp
+++ b/lib/engine/gui/gtk-frontend/addressbook-window.cpp
@@ -104,7 +104,7 @@ static void on_source_added (gmref_ptr<Ekiga::Source> source,
  * BEHAVIOR     : 
  * PRE          : The given GtkWidget pointer must be an SearchBook GObject.
  */
-static bool visit_books (gmref_ptr<Ekiga::Book> book,
+static bool visit_books (Ekiga::BookPtr book,
 			 gmref_ptr<Ekiga::Source> source,
 			 gpointer data);
 
@@ -115,7 +115,7 @@ static bool visit_books (gmref_ptr<Ekiga::Book> book,
  * PRE          : The given GtkWidget pointer must be an SearchBook GObject.
  */
 static void on_book_added (gmref_ptr<Ekiga::Source> source,
-			   gmref_ptr<Ekiga::Book> book,
+			   Ekiga::BookPtr book,
                            gpointer data);
 
 
@@ -125,7 +125,7 @@ static void on_book_added (gmref_ptr<Ekiga::Source> source,
  * PRE          : The given GtkWidget pointer must be an SearchBook GObject.
  */
 static void on_book_removed (gmref_ptr<Ekiga::Source> source,
-			     gmref_ptr<Ekiga::Book> book,
+			     Ekiga::BookPtr book,
                              gpointer data);
 
 
@@ -135,7 +135,7 @@ static void on_book_removed (gmref_ptr<Ekiga::Source> source,
  * PRE          : The given GtkWidget pointer must be an SearchBook GObject.
  */
 static void on_book_updated (gmref_ptr<Ekiga::Source> source,
-			     gmref_ptr<Ekiga::Book> book,
+			     Ekiga::BookPtr book,
                              gpointer data);
 
 /* DESCRIPTION  : Called when the ContactCore has a form request
@@ -187,7 +187,7 @@ static gint on_book_clicked (GtkWidget *tree_view,
  * PRE          : /
  */
 static void addressbook_window_add_book (AddressBookWindow * self,
-                                         gmref_ptr<Ekiga::Book> book);
+                                         Ekiga::BookPtr book);
 
 
 /* DESCRIPTION  : /
@@ -196,7 +196,7 @@ static void addressbook_window_add_book (AddressBookWindow * self,
  * PRE          : /
  */
 static void addressbook_window_update_book (AddressBookWindow *self,
-                                            gmref_ptr<Ekiga::Book> book);
+                                            Ekiga::BookPtr book);
 
 
 /* DESCRIPTION  : /
@@ -204,7 +204,7 @@ static void addressbook_window_update_book (AddressBookWindow *self,
  * PRE          : /
  */
 static void addressbook_window_remove_book (AddressBookWindow *self,
-                                            gmref_ptr<Ekiga::Book> book);
+                                            Ekiga::BookPtr book);
 
 
 /* DESCRIPTION  : /
@@ -215,7 +215,7 @@ static void addressbook_window_remove_book (AddressBookWindow *self,
  * PRE          : /
  */
 static gboolean find_iter_for_book (AddressBookWindow *addressbook_window,
-                                    gmref_ptr<Ekiga::Book> book,
+                                    Ekiga::BookPtr book,
                                     GtkTreeIter *iter);
 
 
@@ -259,7 +259,7 @@ on_source_added (gmref_ptr<Ekiga::Source> source,
 }
 
 
-static bool visit_books (gmref_ptr<Ekiga::Book> book,
+static bool visit_books (Ekiga::BookPtr book,
 			 gmref_ptr<Ekiga::Source> source,
 			 gpointer data)
 {
@@ -271,7 +271,7 @@ static bool visit_books (gmref_ptr<Ekiga::Book> book,
 
 static void
 on_book_added (gmref_ptr<Ekiga::Source> /*source*/,
-	       gmref_ptr<Ekiga::Book> book,
+	       Ekiga::BookPtr book,
                gpointer data)
 {
   addressbook_window_add_book (ADDRESSBOOK_WINDOW (data), book);
@@ -280,7 +280,7 @@ on_book_added (gmref_ptr<Ekiga::Source> /*source*/,
 
 static void
 on_book_removed (gmref_ptr<Ekiga::Source> /*source*/,
-		 gmref_ptr<Ekiga::Book> book,
+		 Ekiga::BookPtr book,
                  gpointer data)
 {
   addressbook_window_remove_book (ADDRESSBOOK_WINDOW (data), book);
@@ -289,7 +289,7 @@ on_book_removed (gmref_ptr<Ekiga::Source> /*source*/,
 
 static void
 on_book_updated (gmref_ptr<Ekiga::Source> /*source*/,
-		 gmref_ptr<Ekiga::Book> book,
+		 Ekiga::BookPtr book,
                  gpointer data)
 {
   addressbook_window_update_book (ADDRESSBOOK_WINDOW (data), book);
@@ -422,7 +422,7 @@ on_book_clicked (GtkWidget *tree_view,
 /* Implementation of the private functions */
 static void
 addressbook_window_add_book (AddressBookWindow *self,
-                             gmref_ptr<Ekiga::Book> book)
+                             Ekiga::BookPtr book)
 {
   GtkTreeIter iter;
   GtkTreeModel *store = NULL;
@@ -465,7 +465,7 @@ addressbook_window_add_book (AddressBookWindow *self,
 
 static void
 addressbook_window_update_book (AddressBookWindow *self,
-                                gmref_ptr<Ekiga::Book> book)
+                                Ekiga::BookPtr book)
 {
   GtkTreeIter iter;
   GtkTreeModel *store = NULL;
@@ -480,7 +480,7 @@ addressbook_window_update_book (AddressBookWindow *self,
 
 static void
 addressbook_window_remove_book (AddressBookWindow *self,
-                                gmref_ptr<Ekiga::Book> book)
+                                Ekiga::BookPtr book)
 {
   GtkTreeIter iter;
   gint page = -1;
@@ -517,7 +517,7 @@ addressbook_window_remove_book (AddressBookWindow *self,
 
 static gboolean
 find_iter_for_book (AddressBookWindow *self,
-                    gmref_ptr<Ekiga::Book> book,
+                    Ekiga::BookPtr book,
                     GtkTreeIter *iter)
 {
   Ekiga::Book *book_iter = NULL;
diff --git a/lib/engine/gui/gtk-frontend/book-view-gtk.cpp b/lib/engine/gui/gtk-frontend/book-view-gtk.cpp
index 08576fa..e0cb92e 100644
--- a/lib/engine/gui/gtk-frontend/book-view-gtk.cpp
+++ b/lib/engine/gui/gtk-frontend/book-view-gtk.cpp
@@ -51,7 +51,7 @@
  */
 struct _BookViewGtkPrivate
 {
-  _BookViewGtkPrivate (gmref_ptr<Ekiga::Book> book_) : book (book_) { }
+  _BookViewGtkPrivate (Ekiga::BookPtr book_) : book (book_) { }
 
   GtkTreeView *tree_view;
   GtkWidget *vbox;
@@ -59,7 +59,7 @@ struct _BookViewGtkPrivate
   GtkWidget *statusbar;
   GtkWidget *scrolled_window;
 
-  gmref_ptr<Ekiga::Book> book;
+  Ekiga::BookPtr book;
   std::list<sigc::connection> connections;
 };
 
@@ -523,7 +523,7 @@ book_view_gtk_get_type ()
 
 /* public methods implementation */
 GtkWidget *
-book_view_gtk_new (gmref_ptr<Ekiga::Book> book)
+book_view_gtk_new (Ekiga::BookPtr book)
 {
   BookViewGtk *result = NULL;
 
diff --git a/lib/engine/gui/gtk-frontend/book-view-gtk.h b/lib/engine/gui/gtk-frontend/book-view-gtk.h
index 1c256cf..d3982f8 100644
--- a/lib/engine/gui/gtk-frontend/book-view-gtk.h
+++ b/lib/engine/gui/gtk-frontend/book-view-gtk.h
@@ -47,7 +47,7 @@ typedef struct _BookViewGtkClass BookViewGtkClass;
 
 /* public api */
 
-GtkWidget *book_view_gtk_new (gmref_ptr<Ekiga::Book> book);
+GtkWidget *book_view_gtk_new (Ekiga::BookPtr book);
 
 void book_view_gtk_populate_menu (BookViewGtk *, GtkWidget *);
 



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