[niepce] * Remove boost::shared_ptr and weak_ptr and use tr1



commit a8f5e1407b9ec512a427557ce4e997201a0b3d81
Author: Hubert Figuiere <hub figuiere net>
Date:   Sat May 2 13:45:07 2009 -0400

    	* Remove boost::shared_ptr and weak_ptr and use tr1
    	instead.
---
 ChangeLog                                       |    3 ++
 configure.ac                                    |    4 --
 src/engine/db/filebundle.hpp                    |    6 ++--
 src/engine/db/fsfile.h                          |    4 +-
 src/engine/db/keyword.h                         |    6 ++--
 src/engine/db/libfile.h                         |    6 ++--
 src/engine/db/libfolder.h                       |    6 ++--
 src/engine/db/libmetadata.h                     |    4 +-
 src/engine/db/library.hpp                       |    7 ++--
 src/engine/db/storage.h                         |    4 +-
 src/engine/library/commands.cpp                 |    1 +
 src/engine/library/op.hpp                       |    4 +-
 src/engine/library/thumbnailcache.h             |    6 ++--
 src/fwk/toolkit/application.cpp                 |   10 +++---
 src/fwk/toolkit/application.hpp                 |    2 +-
 src/fwk/toolkit/controller.cpp                  |    1 +
 src/fwk/toolkit/controller.hpp                  |   12 +++----
 src/fwk/toolkit/frame.hpp                       |    4 +-
 src/fwk/toolkit/notification.hpp                |    6 ++--
 src/fwk/toolkit/notificationcenter.hpp          |    4 +-
 src/fwk/utils/boost.h                           |   36 +++++++++++++++++++----
 src/fwk/utils/db/iconnectiondriver.h            |    5 ++-
 src/fwk/utils/db/iconnectionmanagerdriver.h     |    3 +-
 src/fwk/utils/db/sqlite/sqlitecnxdrv.h          |    4 +--
 src/fwk/utils/db/sqlite/sqlitecnxmgrdrv.h       |    2 -
 src/fwk/utils/exempi.h                          |    1 -
 src/fwk/utils/files.h                           |    4 +-
 src/libraryclient/libraryclient.hpp             |    4 +-
 src/ncr/image.h                                 |    9 ++---
 src/niepce/modules/darkroom/darkroommodule.h    |    2 +-
 src/niepce/modules/darkroom/toolboxcontroller.h |    2 +-
 src/niepce/ui/dialogs/editlabels.cpp            |    1 +
 src/niepce/ui/dialogs/editlabels.hpp            |    2 +-
 src/niepce/ui/dialogs/importdialog.hpp          |    2 +-
 src/niepce/ui/dialogs/preferencesdialog.cpp     |    1 +
 src/niepce/ui/filmstripcontroller.hpp           |    4 +-
 src/niepce/ui/imageliststore.cpp                |    2 +-
 src/niepce/ui/librarymainviewcontroller.cpp     |    2 +-
 src/niepce/ui/librarymainviewcontroller.hpp     |    4 +-
 src/niepce/ui/metadatapanecontroller.hpp        |    2 +-
 src/niepce/ui/niepcewindow.hpp                  |    1 -
 src/niepce/ui/selectioncontroller.cpp           |    7 ++--
 src/niepce/ui/selectioncontroller.hpp           |    4 +-
 src/niepce/ui/workspacecontroller.cpp           |    2 +-
 src/niepce/ui/workspacecontroller.h             |    3 +-
 45 files changed, 113 insertions(+), 96 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 56672a1..3e348d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2009-05-02  Hubert Figuiere  <hub figuiere net>
 
+	* Remove boost::shared_ptr and weak_ptr and use tr1
+	instead.
+
 	* Remove boost::thread and use Glibmm instead.
 
 2009-05-01  Hubert Figuiere  <hub figuiere net>
diff --git a/configure.ac b/configure.ac
index 28ea2f0..76f3343 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,8 +20,6 @@ dnl all the library version.
 dnl if one is harcoded elsewhere, it is a bug
 LIBGLIBMM_VERSION=2.0
 LIBGTKMM_VERSION=2.12.0
-dnl LIBGLADEMM_VERSION=2.6.0
-dnl LIBGCONFMM_VERSION=2.6.0
 LIBGCONF_VERSION=2.0.0
 LIBGNOMEUI_VERSION=2.0.0
 LIBGOOCANVASMM_VERSION=0.6.0
@@ -67,8 +65,6 @@ AC_LANG_COMPILER_REQUIRE
 
 PKG_CHECK_MODULES(LIBGLIBMM, [glibmm-2.4])
 PKG_CHECK_MODULES(LIBGTKMM, [gtkmm-2.4 >= $LIBGTKMM_VERSION])
-dnl PKG_CHECK_MODULES(LIBGLADEMM, [libglademm-2.4 >= $LIBGLADEMM_VERSION])
-dnl PKG_CHECK_MODULES(LIBGNOMEUI, [libgnomeui-2.0 >= $LIBGNOMEUI_VERSION])
 dnl PKG_CHECK_MODULES(LIBGCONFMM, [gconfmm-2.6 >= $LIBGCONFMM_VERSION])
 PKG_CHECK_MODULES(GCONF, [gconf-2.0 >= $LIBGCONF_VERSION])
 PKG_CHECK_MODULES(GNOMEVFS, [gnome-vfs-2.0 >= 2.12])
diff --git a/src/engine/db/filebundle.hpp b/src/engine/db/filebundle.hpp
index 744a537..a78c787 100644
--- a/src/engine/db/filebundle.hpp
+++ b/src/engine/db/filebundle.hpp
@@ -22,7 +22,7 @@
 
 #include <list>
 
-#include <boost/shared_ptr.hpp>
+#include <tr1/memory>
 #include <boost/filesystem/path.hpp>
 
 #include "fwk/utils/files.h"
@@ -34,9 +34,9 @@ namespace db {
 class FileBundle
 {
 public:
-    typedef boost::shared_ptr<FileBundle> Ptr;
+    typedef std::tr1::shared_ptr<FileBundle> Ptr;
     typedef std::list<Ptr> List;
-    typedef boost::shared_ptr<List> ListPtr;
+    typedef std::tr1::shared_ptr<List> ListPtr;
 
     /** add a file to a bundle. Will determine what type it is. */
     void add(const boost::filesystem::path & path);
diff --git a/src/engine/db/fsfile.h b/src/engine/db/fsfile.h
index fad2bb9..488dc76 100644
--- a/src/engine/db/fsfile.h
+++ b/src/engine/db/fsfile.h
@@ -21,7 +21,7 @@
 #define __NIEPCE_DB_FSFILE_H__
 
 #include <string>
-#include <boost/shared_ptr.hpp>
+#include <tr1/memory>
 #include <boost/filesystem/path.hpp>
 
 
@@ -31,7 +31,7 @@ namespace db {
 class FsFile
 {
 public:
-    typedef boost::shared_ptr< FsFile > Ptr;
+    typedef std::tr1::shared_ptr< FsFile > Ptr;
 
     FsFile(int id, const boost::filesystem::path & path);
 
diff --git a/src/engine/db/keyword.h b/src/engine/db/keyword.h
index 1f9250a..ae8b47b 100644
--- a/src/engine/db/keyword.h
+++ b/src/engine/db/keyword.h
@@ -23,16 +23,16 @@
 
 #include <string>
 #include <vector>
-#include <boost/shared_ptr.hpp>
+#include <tr1/memory>
 
 namespace db {
 
 	class Keyword
 	{
 	public:
-		typedef boost::shared_ptr<Keyword> Ptr;
+		typedef std::tr1::shared_ptr<Keyword> Ptr;
 		typedef std::vector<Ptr> List;
-		typedef boost::shared_ptr<List> ListPtr;
+		typedef std::tr1::shared_ptr<List> ListPtr;
 		typedef std::vector<int> IdList;
 
 		Keyword(int id, const std::string & keyword);
diff --git a/src/engine/db/libfile.h b/src/engine/db/libfile.h
index 771504d..0c5e397 100644
--- a/src/engine/db/libfile.h
+++ b/src/engine/db/libfile.h
@@ -22,7 +22,7 @@
 
 #include <string>
 #include <list>
-#include <boost/shared_ptr.hpp>
+#include <tr1/memory>
 #include <boost/filesystem/path.hpp>
 
 #include "fwk/toolkit/mimetype.hpp"
@@ -36,9 +36,9 @@ namespace db {
 class LibFile
 {
 public:
-    typedef boost::shared_ptr< LibFile > Ptr;
+    typedef std::tr1::shared_ptr< LibFile > Ptr;
     typedef std::list< Ptr > List;
-    typedef boost::shared_ptr< List > ListPtr;
+    typedef std::tr1::shared_ptr< List > ListPtr;
 
     enum FileType {
         FILE_TYPE_UNKNOWN = 0,
diff --git a/src/engine/db/libfolder.h b/src/engine/db/libfolder.h
index d679e94..877e800 100644
--- a/src/engine/db/libfolder.h
+++ b/src/engine/db/libfolder.h
@@ -24,16 +24,16 @@
 
 #include <string>
 #include <list>
-#include <boost/shared_ptr.hpp>
+#include <tr1/memory>
 
 namespace db {
 
 	class LibFolder
 	{
 	public:
-		typedef boost::shared_ptr< LibFolder > Ptr;
+		typedef std::tr1::shared_ptr< LibFolder > Ptr;
 		typedef std::list< Ptr > List;
-		typedef boost::shared_ptr< List > ListPtr;
+		typedef std::tr1::shared_ptr< List > ListPtr;
 
 		LibFolder(int _id, std::string _name)
 			: m_id(_id), m_name(_name)
diff --git a/src/engine/db/libmetadata.h b/src/engine/db/libmetadata.h
index 30370bc..1e11832 100644
--- a/src/engine/db/libmetadata.h
+++ b/src/engine/db/libmetadata.h
@@ -22,7 +22,7 @@
 
 #include <vector>
 #include <string>
-#include <boost/shared_ptr.hpp>
+#include <tr1/memory>
 #include <boost/any.hpp>
 
 #include "fwk/utils/exempi.h"
@@ -34,7 +34,7 @@ namespace db {
 		: public utils::XmpMeta
 	{
 	public:
-		typedef boost::shared_ptr<LibMetadata> Ptr;
+		typedef std::tr1::shared_ptr<LibMetadata> Ptr;
 
 		LibMetadata(int _id);
 
diff --git a/src/engine/db/library.hpp b/src/engine/db/library.hpp
index bf191b2..69edd86 100644
--- a/src/engine/db/library.hpp
+++ b/src/engine/db/library.hpp
@@ -24,8 +24,7 @@
 
 #include <string>
 
-#include <boost/shared_ptr.hpp>
-#include <boost/weak_ptr.hpp>
+#include <tr1/memory>
 #include <boost/any.hpp>
 #include <boost/filesystem/path.hpp>
 
@@ -52,7 +51,7 @@ namespace db {
 class Library
 {
 public:
-		typedef boost::shared_ptr<Library> Ptr;
+		typedef std::tr1::shared_ptr<Library> Ptr;
 
 		typedef enum {
         NOTIFY_NONE = 0,
@@ -212,7 +211,7 @@ private:
 		boost::filesystem::path           m_dbname;
 		db::IConnectionManagerDriver::Ptr m_dbmgr;
 		db::IConnectionDriver::Ptr        m_dbdrv;
-		boost::weak_ptr<fwk::NotificationCenter>  m_notif_center;
+		std::tr1::weak_ptr<fwk::NotificationCenter>  m_notif_center;
 		bool                              m_inited;
 };
 
diff --git a/src/engine/db/storage.h b/src/engine/db/storage.h
index f06e3af..551ded9 100644
--- a/src/engine/db/storage.h
+++ b/src/engine/db/storage.h
@@ -21,7 +21,7 @@
 #ifndef __NIEPCE_LIBRARY_STORAGE_H__
 #define __NIEPCE_LIBRARY_STORAGE_H__
 
-#include <boost/shared_ptr.hpp>
+#include <tr1/memory>
 
 #include "engine/db/keyword.h"
 
@@ -31,7 +31,7 @@ namespace db {
 	class Storage
 	{
 	public:
-		typedef boost::shared_ptr<Storage> Ptr;
+		typedef std::tr1::shared_ptr<Storage> Ptr;
 
 		virtual ~Storage();
 
diff --git a/src/engine/library/commands.cpp b/src/engine/library/commands.cpp
index c9b5b2b..914cd66 100644
--- a/src/engine/library/commands.cpp
+++ b/src/engine/library/commands.cpp
@@ -24,6 +24,7 @@
 #include <boost/filesystem/path.hpp>
 
 
+#include "fwk/utils/boost.h"
 #include "fwk/utils/debug.h"
 #include "engine/db/library.hpp"
 #include "engine/db/libfolder.h"
diff --git a/src/engine/library/op.hpp b/src/engine/library/op.hpp
index 0f97cf1..8e903e9 100644
--- a/src/engine/library/op.hpp
+++ b/src/engine/library/op.hpp
@@ -21,7 +21,7 @@
 #ifndef __NIEPCE_LIBRARY_OP_H__
 #define __NIEPCE_LIBRARY_OP_H__
 
-#include <boost/shared_ptr.hpp>
+#include <tr1/memory>
 #include <boost/function.hpp>
 
 #include "engine/library/clienttypes.h"
@@ -33,7 +33,7 @@ namespace library {
 	class Op
 	{
 	public:
-		typedef boost::shared_ptr< Op > Ptr;
+		typedef std::tr1::shared_ptr< Op > Ptr;
 		typedef boost::function<void (const db::Library::Ptr &)> function_t;
 
 		Op(tid_t id, const function_t & func);
diff --git a/src/engine/library/thumbnailcache.h b/src/engine/library/thumbnailcache.h
index 4e7050f..911a8e9 100644
--- a/src/engine/library/thumbnailcache.h
+++ b/src/engine/library/thumbnailcache.h
@@ -22,7 +22,7 @@
 #define _LIBRARY_THUMBNAILCACHE_H__
 
 #include <boost/filesystem/path.hpp>
-#include <boost/weak_ptr.hpp>
+#include <tr1/memory>
 
 #include "fwk/utils/worker.h"
 #include "fwk/toolkit/notificationcenter.hpp"
@@ -34,7 +34,7 @@ namespace library {
 	class ThumbnailTask
 	{
 	public:
-		typedef boost::shared_ptr< ThumbnailTask > Ptr;
+		typedef std::tr1::shared_ptr< ThumbnailTask > Ptr;
 		
 		ThumbnailTask(const db::LibFile::Ptr & f, int w, int h)
 			: m_file(f), m_width(w), m_height(h)
@@ -68,7 +68,7 @@ namespace library {
 		virtual void execute(const  ThumbnailTask::Ptr & task);
 	private:
 		boost::filesystem::path         m_cacheDir;
-		boost::weak_ptr<fwk::NotificationCenter> m_notif_center;
+		std::tr1::weak_ptr<fwk::NotificationCenter> m_notif_center;
 	};
 
 }
diff --git a/src/fwk/toolkit/application.cpp b/src/fwk/toolkit/application.cpp
index 34fdb21..91d7f51 100644
--- a/src/fwk/toolkit/application.cpp
+++ b/src/fwk/toolkit/application.cpp
@@ -1,7 +1,7 @@
 /*
  * niepce - framework/application.cpp
  *
- * Copyright (C) 2007-2008 Hubert Figuiere
+ * Copyright (C) 2007-2009 Hubert Figuiere
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -17,9 +17,8 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <boost/scoped_ptr.hpp>
-#include <boost/function.hpp>
 #include <boost/bind.hpp>
+#include <boost/function.hpp>
 #include <boost/lexical_cast.hpp>
 
 #include <glibmm/i18n.h>
@@ -28,6 +27,7 @@
 #include <gtkmm/rc.h>
 #include <gconf/gconf.h>
 
+#include "fwk/utils/boost.h"
 #include "fwk/utils/debug.h"
 #include "application.hpp"
 #include "frame.hpp"
@@ -127,7 +127,7 @@ int Application::main(boost::function<Application::Ptr (void)> constructor,
         }
     }
 
-    kit.signal_run().connect(sigc::mem_fun(get_pointer(app), 
+    kit.signal_run().connect(sigc::mem_fun(*app,
                                            &Application::_ready));
     Frame::Ptr window(app->makeMainFrame());
     app->add(window);
@@ -143,7 +143,7 @@ void Application::terminate()
     std::for_each(m_subs.begin(), m_subs.end(),
                   boost::bind(&Controller::terminate, _1));
     std::for_each(m_subs.begin(), m_subs.end(),
-                  boost::bind(&Controller::clearParent, _1));		
+                  boost::bind(&Controller::clearParent, _1));
     m_subs.clear();
 }
 
diff --git a/src/fwk/toolkit/application.hpp b/src/fwk/toolkit/application.hpp
index 28bcd41..b4d252f 100644
--- a/src/fwk/toolkit/application.hpp
+++ b/src/fwk/toolkit/application.hpp
@@ -38,7 +38,7 @@ class Application
     : public Controller
 {
 public:
-    typedef boost::shared_ptr<Application> Ptr;
+    typedef std::tr1::shared_ptr<Application> Ptr;
     typedef std::pair<std::string, std::string> ThemeDesc;
 
     virtual ~Application();
diff --git a/src/fwk/toolkit/controller.cpp b/src/fwk/toolkit/controller.cpp
index 4e98b85..aa76e15 100644
--- a/src/fwk/toolkit/controller.cpp
+++ b/src/fwk/toolkit/controller.cpp
@@ -21,6 +21,7 @@
 
 #include <gtkmm/widget.h>
 
+#include "fwk/utils/boost.h"
 #include "fwk/utils/debug.h"
 #include "controller.hpp"
 
diff --git a/src/fwk/toolkit/controller.hpp b/src/fwk/toolkit/controller.hpp
index dcc6f3f..1f5d102 100644
--- a/src/fwk/toolkit/controller.hpp
+++ b/src/fwk/toolkit/controller.hpp
@@ -1,7 +1,7 @@
 /*
  * niepce - framework/controller.h
  *
- * Copyright (C) 2007 Hubert Figuiere
+ * Copyright (C) 2007-2009 Hubert Figuiere
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -24,9 +24,7 @@
 
 
 #include <list>
-#include <boost/shared_ptr.hpp>
-#include <boost/weak_ptr.hpp>
-#include <boost/enable_shared_from_this.hpp>
+#include <tr1/memory>
 
 #include "sigc++/trackable.h"
 
@@ -41,12 +39,12 @@ namespace fwk {
 	/** Generic controller class
 	 */
 	class Controller
-      : public boost::enable_shared_from_this<Controller>
+      : public std::tr1::enable_shared_from_this<Controller>
       , public sigc::trackable
 	{
 	public:
-		typedef boost::shared_ptr<Controller> Ptr;
-		typedef boost::weak_ptr<Controller> WeakPtr;
+		typedef std::tr1::shared_ptr<Controller> Ptr;
+		typedef std::tr1::weak_ptr<Controller> WeakPtr;
 
 		Controller();
 		virtual ~Controller();
diff --git a/src/fwk/toolkit/frame.hpp b/src/fwk/toolkit/frame.hpp
index 059c84d..7e91082 100644
--- a/src/fwk/toolkit/frame.hpp
+++ b/src/fwk/toolkit/frame.hpp
@@ -40,7 +40,7 @@ class Frame
 		: public Controller
 {
 public:
-		typedef boost::shared_ptr<Frame> Ptr;
+		typedef std::tr1::shared_ptr<Frame> Ptr;
 
 		Frame(const std::string & gladeFile, const Glib::ustring & widgetName,
           const std::string & layout_cfg_key = "");
@@ -50,7 +50,7 @@ public:
     /** convenience to return the Frame::Ptr from this */
     Ptr shared_frame_ptr()
         {
-            return boost::static_pointer_cast<Frame>(shared_from_this());
+            return std::tr1::static_pointer_cast<Frame>(shared_from_this());
         }
 
 		Gtk::Window & gtkWindow()
diff --git a/src/fwk/toolkit/notification.hpp b/src/fwk/toolkit/notification.hpp
index bf25a1e..f960320 100644
--- a/src/fwk/toolkit/notification.hpp
+++ b/src/fwk/toolkit/notification.hpp
@@ -1,7 +1,7 @@
 /*
  * niepce - fwk/notification.h
  *
- * Copyright (C) 2007 Hubert Figuiere
+ * Copyright (C) 2007-2009 Hubert Figuiere
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -24,7 +24,7 @@
 #ifndef __FWK_NOTIFICATION_H__
 #define __FWK_NOTIFICATION_H__
 
-#include <boost/shared_ptr.hpp>
+#include <tr1/memory>
 #include <boost/any.hpp>
 
 #include <glibmm/thread.h>
@@ -35,7 +35,7 @@ namespace fwk {
 	class Notification
 	{
 	public:
-		typedef boost::shared_ptr<Notification> Ptr;
+		typedef std::tr1::shared_ptr<Notification> Ptr;
 		typedef Glib::RecMutex mutex_t;
 
 		Notification(int _type)
diff --git a/src/fwk/toolkit/notificationcenter.hpp b/src/fwk/toolkit/notificationcenter.hpp
index 673cefa..0a03336 100644
--- a/src/fwk/toolkit/notificationcenter.hpp
+++ b/src/fwk/toolkit/notificationcenter.hpp
@@ -24,7 +24,7 @@
 #define __FWK_NOTIFICATIONCENTER_H__
 
 #include <boost/function.hpp>
-#include <boost/shared_ptr.hpp>
+#include <tr1/memory>
 
 #include "fwk/toolkit/notification.hpp"
 
@@ -33,7 +33,7 @@ namespace fwk {
 	class NotificationCenter
 	{
 	public:
-		typedef boost::shared_ptr< NotificationCenter > Ptr;
+		typedef std::tr1::shared_ptr< NotificationCenter > Ptr;
 		typedef boost::function< void (Notification::Ptr) > subscriber_t;
 
 		NotificationCenter();
diff --git a/src/fwk/utils/boost.h b/src/fwk/utils/boost.h
index e49e2fc..10cb9fd 100644
--- a/src/fwk/utils/boost.h
+++ b/src/fwk/utils/boost.h
@@ -1,7 +1,7 @@
 /*
  * niepce - utils/boost.h
  *
- * Copyright (C) 2007 Hubert Figuiere
+ * Copyright (C) 2007-2009 Hubert Figuiere
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -22,11 +22,12 @@
 #ifndef _UTILS_BOOST_H_
 #define _UTILS_BOOST_H_
 
-#include <boost/shared_ptr.hpp>
-#include <boost/weak_ptr.hpp>
+#include <tr1/memory>
 #include <boost/bind.hpp>
 #include <boost/function.hpp>
 
+#include <glibmm/refptr.h>
+
 namespace Glib {
 
 	/** Dereference Glib::RefPtr<> for use in boost::bind */
@@ -38,15 +39,29 @@ namespace Glib {
 
 }
 
+
+namespace std {
+namespace tr1 {
+
+template< class T_CppObject > inline
+T_CppObject *get_pointer(const shared_ptr< T_CppObject > &p)
+{
+    return p.get();
+}
+
+
+}
+}
+
 namespace utils {
 
 /** function to make a shared_ptr<> form a weak_ptr<> 
  * idea from http://lists.boost.org/boost-users/2007/01/24384.php
  */
 template<class T> 
-boost::shared_ptr<T> shared_ptr_from( boost::weak_ptr<T> const & wpt )
+std::tr1::shared_ptr<T> shared_ptr_from( std::tr1::weak_ptr<T> const & wpt )
 {
-    return boost::shared_ptr<T>( wpt ); // throws on wpt.expired()
+    return std::tr1::shared_ptr<T>( wpt ); // throws on wpt.expired()
 } 
 
 }
@@ -55,7 +70,16 @@ boost::shared_ptr<T> shared_ptr_from( boost::weak_ptr<T> const & wpt )
  * this allow breaking some circular references.
  */
 #define BIND_SHARED_PTR(_type, _spt) \
-    boost::bind(&utils::shared_ptr_from<_type>, boost::weak_ptr<_type>(_spt))
+    boost::bind(&utils::shared_ptr_from<_type>, std::tr1::weak_ptr<_type>(_spt))
 
 
 #endif
+/*
+  Local Variables:
+  mode:c++
+  c-file-style:"stroustrup"
+  c-file-offsets:((innamespace . 0))
+  indent-tabs-mode:nil
+  fill-column:80
+  End:
+*/
diff --git a/src/fwk/utils/db/iconnectiondriver.h b/src/fwk/utils/db/iconnectiondriver.h
index 8a05cfb..3797780 100644
--- a/src/fwk/utils/db/iconnectiondriver.h
+++ b/src/fwk/utils/db/iconnectiondriver.h
@@ -27,7 +27,8 @@
 #define __NEMIVER_I_CONNECTION_DRIVER_H__
 
 #include <stdint.h>
-#include <boost/shared_ptr.hpp>
+#include <tr1/memory>
+
 #include <boost/function.hpp>
 
 namespace utils {
@@ -53,7 +54,7 @@ class SQLStatement;
 class IConnectionDriver {
 
 public:
-    typedef boost::shared_ptr<IConnectionDriver> Ptr;
+    typedef std::tr1::shared_ptr<IConnectionDriver> Ptr;
 
     typedef boost::function<void (void)> f0_t;
 
diff --git a/src/fwk/utils/db/iconnectionmanagerdriver.h b/src/fwk/utils/db/iconnectionmanagerdriver.h
index ceddb6b..91b140a 100644
--- a/src/fwk/utils/db/iconnectionmanagerdriver.h
+++ b/src/fwk/utils/db/iconnectionmanagerdriver.h
@@ -27,7 +27,6 @@
 #define __NEMIVER_I_CONNECTION_MANAGER_DRIVER_H__
 
 #include <string>
-#include <boost/shared_ptr.hpp>
 
 #include "iconnectiondriver.h"
 
@@ -90,7 +89,7 @@ public:
 
 class  IConnectionManagerDriver {
 public:
-    typedef boost::shared_ptr<IConnectionManagerDriver> Ptr;
+    typedef std::tr1::shared_ptr<IConnectionManagerDriver> Ptr;
     IConnectionManagerDriver()
     {
     }
diff --git a/src/fwk/utils/db/sqlite/sqlitecnxdrv.h b/src/fwk/utils/db/sqlite/sqlitecnxdrv.h
index c6f7d9f..02a2498 100644
--- a/src/fwk/utils/db/sqlite/sqlitecnxdrv.h
+++ b/src/fwk/utils/db/sqlite/sqlitecnxdrv.h
@@ -46,16 +46,14 @@ class SqliteCnxDrv: public db::IConnectionDriver {
     boost::scoped_ptr<Priv> m_priv ;
     mutable Glib::RecMutex m_mutex;
 
-    friend void boost::checked_delete<SqliteCnxDrv>(SqliteCnxDrv * x);
-
     //forbid copy
     SqliteCnxDrv (const SqliteCnxDrv &) ;
     SqliteCnxDrv& operator= (const SqliteCnxDrv &) ;
 
     SqliteCnxDrv (sqlite3 *a_sqlite_handle) ;
 
-    virtual ~SqliteCnxDrv () ;
 public:
+    virtual ~SqliteCnxDrv () ;
     sqlite3* sqlite_handle() const;
     const char* get_last_error () const ;
 
diff --git a/src/fwk/utils/db/sqlite/sqlitecnxmgrdrv.h b/src/fwk/utils/db/sqlite/sqlitecnxmgrdrv.h
index 799e5d3..865ee15 100644
--- a/src/fwk/utils/db/sqlite/sqlitecnxmgrdrv.h
+++ b/src/fwk/utils/db/sqlite/sqlitecnxmgrdrv.h
@@ -26,8 +26,6 @@
 #ifndef __NEMIVER_SQLITE_CNX_MGR_DRV_H__
 #define __NEMIVER_SQLITE_CNX_MGR_DRV_H__
 
-#include <boost/shared_ptr.hpp>
-
 #include "fwk/utils/db/iconnectionmanagerdriver.h"
 #include "fwk/utils/db/iconnectiondriver.h"
 
diff --git a/src/fwk/utils/exempi.h b/src/fwk/utils/exempi.h
index 883410e..e28d40d 100644
--- a/src/fwk/utils/exempi.h
+++ b/src/fwk/utils/exempi.h
@@ -26,7 +26,6 @@
 
 #include <boost/filesystem/path.hpp>
 #include <boost/noncopyable.hpp>
-#include <boost/shared_ptr.hpp>
 
 #include <exempi/xmp.h>
 
diff --git a/src/fwk/utils/files.h b/src/fwk/utils/files.h
index 71c1a2a..e805a4d 100644
--- a/src/fwk/utils/files.h
+++ b/src/fwk/utils/files.h
@@ -25,8 +25,8 @@
 
 #include <list>
 #include <string>
+#include <tr1/memory>
 
-#include <boost/shared_ptr.hpp>
 #include <boost/function.hpp>
 #include <boost/filesystem/path.hpp>
 
@@ -39,7 +39,7 @@ namespace utils {
 		: private std::list< boost::filesystem::path >
 	{
 	public:
-		typedef boost::shared_ptr< FileList > Ptr;
+		typedef std::tr1::shared_ptr< FileList > Ptr;
 
 		typedef std::list< boost::filesystem::path >    _impltype_t;
 		typedef _impltype_t::value_type       value_type;
diff --git a/src/libraryclient/libraryclient.hpp b/src/libraryclient/libraryclient.hpp
index 23b04d1..bb2cd69 100644
--- a/src/libraryclient/libraryclient.hpp
+++ b/src/libraryclient/libraryclient.hpp
@@ -21,7 +21,7 @@
 #define _LIBRARYCLIENT_H_
 
 #include <string>
-#include <boost/shared_ptr.hpp>
+#include <tr1/memory>
 
 #include "engine/library/clienttypes.h"
 #include "engine/library/thumbnailcache.h"
@@ -43,7 +43,7 @@ namespace libraryclient {
 		: public db::Storage
 	{
 	public:
-		typedef boost::shared_ptr< LibraryClient > Ptr;
+		typedef std::tr1::shared_ptr< LibraryClient > Ptr;
 
 		LibraryClient(const utils::Moniker & moniker, const fwk::NotificationCenter::Ptr & nc);
 		virtual ~LibraryClient();
diff --git a/src/ncr/image.h b/src/ncr/image.h
index 94f5fed..027fde2 100644
--- a/src/ncr/image.h
+++ b/src/ncr/image.h
@@ -1,7 +1,7 @@
 /*
  * niepce - ncr/image.h
  *
- * Copyright (C) 2008 Hubert Figuiere
+ * Copyright (C) 2008-2009 Hubert Figuiere
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -23,8 +23,7 @@
 #ifndef _NCR_IMAGE_H_
 #define _NCR_IMAGE_H_
 
-#include <boost/shared_ptr.hpp>
-#include <boost/enable_shared_from_this.hpp>
+#include <tr1/memory>
 #include <boost/filesystem/path.hpp>
 
 #include <gdkmm/pixbuf.h>
@@ -32,10 +31,10 @@
 namespace ncr {
 
 class Image 
-    : public boost::enable_shared_from_this<Image>
+    : public std::tr1::enable_shared_from_this<Image>
 {
 public:
-    typedef boost::shared_ptr<Image> Ptr;
+    typedef std::tr1::shared_ptr<Image> Ptr;
 
     Image();
     virtual ~Image();
diff --git a/src/niepce/modules/darkroom/darkroommodule.h b/src/niepce/modules/darkroom/darkroommodule.h
index 2dd8b5f..a5258b4 100644
--- a/src/niepce/modules/darkroom/darkroommodule.h
+++ b/src/niepce/modules/darkroom/darkroommodule.h
@@ -46,7 +46,7 @@ class DarkroomModule
 	: public fwk::Controller
 {
 public:
-	typedef boost::shared_ptr<DarkroomModule> Ptr;
+	typedef std::tr1::shared_ptr<DarkroomModule> Ptr;
 
 	DarkroomModule(const Glib::RefPtr<Gtk::ActionGroup> & action_group,
                    const libraryclient::LibraryClient::Ptr & client)
diff --git a/src/niepce/modules/darkroom/toolboxcontroller.h b/src/niepce/modules/darkroom/toolboxcontroller.h
index 8a38494..8c9fed6 100644
--- a/src/niepce/modules/darkroom/toolboxcontroller.h
+++ b/src/niepce/modules/darkroom/toolboxcontroller.h
@@ -33,7 +33,7 @@ class ToolboxController
     : public fwk::Dockable
 {
 public:
-    typedef boost::shared_ptr<ToolboxController> Ptr;
+    typedef std::tr1::shared_ptr<ToolboxController> Ptr;
     ToolboxController(fwk::Dock &);
     virtual Gtk::Widget * buildWidget();
 };
diff --git a/src/niepce/ui/dialogs/editlabels.cpp b/src/niepce/ui/dialogs/editlabels.cpp
index 4accd18..11fdb19 100644
--- a/src/niepce/ui/dialogs/editlabels.cpp
+++ b/src/niepce/ui/dialogs/editlabels.cpp
@@ -27,6 +27,7 @@
 #include <gtkmm/entry.h>
 #include <gtkmm/label.h>
 
+#include "fwk/utils/boost.h"
 #include "fwk/utils/debug.h"
 #include "fwk/toolkit/application.hpp"
 #include "fwk/toolkit/gdkutils.hpp"
diff --git a/src/niepce/ui/dialogs/editlabels.hpp b/src/niepce/ui/dialogs/editlabels.hpp
index 5b2202f..dd90073 100644
--- a/src/niepce/ui/dialogs/editlabels.hpp
+++ b/src/niepce/ui/dialogs/editlabels.hpp
@@ -38,7 +38,7 @@ class EditLabels
     : public fwk::Dialog
 {
 public:
-    typedef boost::shared_ptr<EditLabels> Ptr;
+    typedef std::tr1::shared_ptr<EditLabels> Ptr;
     EditLabels(const eng::Label::List &, const libraryclient::LibraryClient::Ptr &);
 
     virtual void setup_widget();
diff --git a/src/niepce/ui/dialogs/importdialog.hpp b/src/niepce/ui/dialogs/importdialog.hpp
index 10ff2ff..84848fa 100644
--- a/src/niepce/ui/dialogs/importdialog.hpp
+++ b/src/niepce/ui/dialogs/importdialog.hpp
@@ -44,7 +44,7 @@ class ImportDialog
 	: public fwk::Dialog
 {
 public:
-	typedef boost::shared_ptr<ImportDialog> Ptr;
+  typedef std::tr1::shared_ptr<ImportDialog> Ptr;
 
 	ImportDialog();
 
diff --git a/src/niepce/ui/dialogs/preferencesdialog.cpp b/src/niepce/ui/dialogs/preferencesdialog.cpp
index ff067b4..13559f3 100644
--- a/src/niepce/ui/dialogs/preferencesdialog.cpp
+++ b/src/niepce/ui/dialogs/preferencesdialog.cpp
@@ -24,6 +24,7 @@
 #include <gtkmm/liststore.h>
 #include <gtkmm/checkbutton.h>
 
+#include "fwk/utils/boost.h"
 #include "fwk/toolkit/configdatabinder.hpp"
 #include "fwk/toolkit/application.hpp"
 #include "fwk/toolkit/gtkutils.hpp"
diff --git a/src/niepce/ui/filmstripcontroller.hpp b/src/niepce/ui/filmstripcontroller.hpp
index 93f295f..f6db159 100644
--- a/src/niepce/ui/filmstripcontroller.hpp
+++ b/src/niepce/ui/filmstripcontroller.hpp
@@ -38,8 +38,8 @@ class FilmStripController
 	  public IImageSelectable
 {
 public:
-	typedef boost::shared_ptr<FilmStripController> Ptr;
-	typedef boost::weak_ptr<FilmStripController> WeakPtr;
+	typedef std::tr1::shared_ptr<FilmStripController> Ptr;
+	typedef std::tr1::weak_ptr<FilmStripController> WeakPtr;
 
 	FilmStripController(const Glib::RefPtr<ImageListStore> & store);
 
diff --git a/src/niepce/ui/imageliststore.cpp b/src/niepce/ui/imageliststore.cpp
index 45a9dc5..80f8731 100644
--- a/src/niepce/ui/imageliststore.cpp
+++ b/src/niepce/ui/imageliststore.cpp
@@ -146,7 +146,7 @@ void ImageListStore::on_tnail_notification(const fwk::Notification::Ptr &n)
 
 libraryclient::LibraryClient::Ptr ImageListStore::getLibraryClient()
 {
-    return	boost::dynamic_pointer_cast<NiepceWindow>(m_controller.lock())->getLibraryClient();
+    return	std::tr1::dynamic_pointer_cast<NiepceWindow>(m_controller.lock())->getLibraryClient();
 }
 
 }
diff --git a/src/niepce/ui/librarymainviewcontroller.cpp b/src/niepce/ui/librarymainviewcontroller.cpp
index 5d7d52f..c60f1e2 100644
--- a/src/niepce/ui/librarymainviewcontroller.cpp
+++ b/src/niepce/ui/librarymainviewcontroller.cpp
@@ -151,7 +151,7 @@ void LibraryMainViewController::on_image_activated(int id)
 
 libraryclient::LibraryClient::Ptr LibraryMainViewController::getLibraryClient()
 {
-    return	boost::dynamic_pointer_cast<NiepceWindow>(m_parent.lock())->getLibraryClient();
+    return	std::tr1::dynamic_pointer_cast<NiepceWindow>(m_parent.lock())->getLibraryClient();
 }
 
 
diff --git a/src/niepce/ui/librarymainviewcontroller.hpp b/src/niepce/ui/librarymainviewcontroller.hpp
index 153c8fd..9f98948 100644
--- a/src/niepce/ui/librarymainviewcontroller.hpp
+++ b/src/niepce/ui/librarymainviewcontroller.hpp
@@ -52,8 +52,8 @@ class LibraryMainViewController
 		  public IImageSelectable
 {
 public:
-		typedef boost::shared_ptr<LibraryMainViewController> Ptr;
-		typedef boost::weak_ptr<LibraryMainViewController> WeakPtr;
+		typedef std::tr1::shared_ptr<LibraryMainViewController> Ptr;
+		typedef std::tr1::weak_ptr<LibraryMainViewController> WeakPtr;
 
 		LibraryMainViewController(const Glib::RefPtr<Gtk::ActionGroup> & actions,
                               const Glib::RefPtr<ImageListStore> & store)
diff --git a/src/niepce/ui/metadatapanecontroller.hpp b/src/niepce/ui/metadatapanecontroller.hpp
index 1f000a3..bca0165 100644
--- a/src/niepce/ui/metadatapanecontroller.hpp
+++ b/src/niepce/ui/metadatapanecontroller.hpp
@@ -39,7 +39,7 @@ class MetaDataPaneController
 		: public fwk::Dockable
 {
 public:
-		typedef boost::shared_ptr<MetaDataPaneController> Ptr;
+		typedef std::tr1::shared_ptr<MetaDataPaneController> Ptr;
 		MetaDataPaneController(fwk::Dock &);
     ~MetaDataPaneController();
 		virtual Gtk::Widget * buildWidget();
diff --git a/src/niepce/ui/niepcewindow.hpp b/src/niepce/ui/niepcewindow.hpp
index ceca558..013a113 100644
--- a/src/niepce/ui/niepcewindow.hpp
+++ b/src/niepce/ui/niepcewindow.hpp
@@ -21,7 +21,6 @@
 #ifndef _UI_NIEPCEWINDOW_H_
 #define _UI_NIEPCEWINDOW_H_
 
-#include <boost/scoped_ptr.hpp>
 
 #include <gtkmm/treemodel.h>
 #include <gtkmm/box.h>
diff --git a/src/niepce/ui/selectioncontroller.cpp b/src/niepce/ui/selectioncontroller.cpp
index cd4099e..f78b67c 100644
--- a/src/niepce/ui/selectioncontroller.cpp
+++ b/src/niepce/ui/selectioncontroller.cpp
@@ -1,7 +1,7 @@
 /*
  * niepce - ui/selectioncontroller.cpp
  *
- * Copyright (C) 2008 Hubert Figuiere
+ * Copyright (C) 2008-2009 Hubert Figuiere
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -23,6 +23,7 @@
 #include <glibmm/i18n.h>
 
 #include "fwk/utils/autoflag.h"
+#include "fwk/utils/boost.h"
 #include "fwk/utils/debug.h"
 #include "fwk/toolkit/undo.hpp"
 #include "fwk/toolkit/command.hpp"
@@ -89,7 +90,7 @@ void SelectionController::selected(IImageSelectable * selectable)
 
 libraryclient::LibraryClient::Ptr SelectionController::getLibraryClient()
 {
-    return	boost::dynamic_pointer_cast<NiepceWindow>(m_parent.lock())->getLibraryClient();
+    return	std::tr1::dynamic_pointer_cast<NiepceWindow>(m_parent.lock())->getLibraryClient();
 }
 
 inline int SelectionController::get_selection()
@@ -106,7 +107,7 @@ void SelectionController::_selection_move(bool backwards)
     if(iter) {
         if(backwards) {
             if(iter != m_imageliststore->children().begin()) {
-                iter--;
+                --iter;
             }
         }
         else {
diff --git a/src/niepce/ui/selectioncontroller.hpp b/src/niepce/ui/selectioncontroller.hpp
index 7e50cff..8eb504e 100644
--- a/src/niepce/ui/selectioncontroller.hpp
+++ b/src/niepce/ui/selectioncontroller.hpp
@@ -1,7 +1,7 @@
 /*
  * niepce - ui/selectioncontroller.h
  *
- * Copyright (C) 2008 Hubert Figuiere
+ * Copyright (C) 2008-2009 Hubert Figuiere
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -56,7 +56,7 @@ class SelectionController
 	: public fwk::Controller
 {
 public:
-	typedef boost::shared_ptr<SelectionController> Ptr;
+	typedef std::tr1::shared_ptr<SelectionController> Ptr;
 	SelectionController();
 
 	void add_selectable(IImageSelectable *);
diff --git a/src/niepce/ui/workspacecontroller.cpp b/src/niepce/ui/workspacecontroller.cpp
index 327b956..e8236a9 100644
--- a/src/niepce/ui/workspacecontroller.cpp
+++ b/src/niepce/ui/workspacecontroller.cpp
@@ -64,7 +64,7 @@ namespace ui {
 
 	libraryclient::LibraryClient::Ptr WorkspaceController::getLibraryClient()
 	{
-		return	boost::dynamic_pointer_cast<NiepceWindow>(m_parent.lock())->getLibraryClient();
+		return	std::tr1::dynamic_pointer_cast<NiepceWindow>(m_parent.lock())->getLibraryClient();
 	}
 
 
diff --git a/src/niepce/ui/workspacecontroller.h b/src/niepce/ui/workspacecontroller.h
index 8dde8cb..9948f4f 100644
--- a/src/niepce/ui/workspacecontroller.h
+++ b/src/niepce/ui/workspacecontroller.h
@@ -23,7 +23,6 @@
 #define __UI_WORKSPACECONTROLLER_H__
 
 #include <boost/array.hpp>
-#include <boost/shared_ptr.hpp>
 
 #include <glibmm/ustring.h>
 
@@ -45,7 +44,7 @@ namespace ui {
 		: public fwk::Controller
 	{
 	public:
-		typedef boost::shared_ptr<WorkspaceController> Ptr;
+		typedef std::tr1::shared_ptr<WorkspaceController> Ptr;
 
 		enum {
 			FOLDERS_ITEM,



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