[cluttermm] Deprecate threads_init/enter/leave/frame_source().



commit 7177742bad5a69050f911133565599b364120570
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon Mar 24 11:14:12 2014 +0100

    Deprecate threads_init/enter/leave/frame_source().

 clutter/cluttermm/threads.cc |   15 +++++++++++++++
 clutter/cluttermm/threads.h  |   18 ++++++++++++++++++
 2 files changed, 33 insertions(+), 0 deletions(-)
---
diff --git a/clutter/cluttermm/threads.cc b/clutter/cluttermm/threads.cc
index ab1e140..d867572 100644
--- a/clutter/cluttermm/threads.cc
+++ b/clutter/cluttermm/threads.cc
@@ -17,9 +17,13 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#define CLUTTER_DISABLE_DEPRECATION_WARNINGS 1
+
 #include <cluttermm/threads.h>
 #include <clutter/clutter.h>
 
+#ifndef CLUTTERMM_DISABLE_DEPRECATED
+
 namespace
 {
 
@@ -102,9 +106,13 @@ gboolean source_callback(void* data)
 
 } // anonymous namespace
 
+#endif //CLUTTERMM_DISABLE_DEPRECATED
+
 namespace Clutter
 {
 
+#ifndef CLUTTERMM_DISABLE_DEPRECATED
+
 void threads_init()
 {
   clutter_threads_init();
@@ -119,6 +127,7 @@ void threads_leave()
 {
   clutter_threads_leave();
 }
+#endif //CLUTTERMM_DISABLE_DEPRECATED
 
 // TODO: This is unlikely to be thread-safe because of the returned connection
 // object.  It's the same problem as with the glibmm idle source.
@@ -144,6 +153,9 @@ sigc::connection threads_add_timeout(const sigc::slot<bool>& callback,
   return connection;
 }
 
+
+#ifndef CLUTTERMM_DISABLE_DEPRECATED
+
 sigc::connection threads_add_frame_source(const sigc::slot<bool>& callback,
                                           guint interval, int priority)
 {
@@ -156,4 +168,7 @@ sigc::connection threads_add_frame_source(const sigc::slot<bool>& callback,
   return connection;
 }
 
+#endif //CLUTTERMM_DISABLE_DEPRECATED
+
+
 } // namespace Clutter
diff --git a/clutter/cluttermm/threads.h b/clutter/cluttermm/threads.h
index 30d8301..6163f5e 100644
--- a/clutter/cluttermm/threads.h
+++ b/clutter/cluttermm/threads.h
@@ -26,6 +26,8 @@ namespace Clutter
 
 // TODO: clutter_threads_set_lock_functions ()?
 
+#ifndef CLUTTERMM_DISABLE_DEPRECATED
+
 /** Initialises the Clutter threading mechanism, so that Clutter API can be 
  * called by multiple threads, using threads_enter() and
  * threads_leave() to mark the critical sections.
@@ -33,17 +35,26 @@ namespace Clutter
  * You must call Glib::thread_init() before this function. 
  *
  * This function must be called before init().
+ *
+ * @deprecated This function does not do anything. Threading support is initialized when Clutter is 
initialized.
  */
 void threads_init();
 
 /** Locks the Clutter thread lock.
+ *
+ * @deprecated This function should not be used by application code. Marking critical sections is not 
portable on various platforms. Instead of acquiring the Clutter lock, schedule UI updates from the main loop 
using threads_add_idle() or threads_add_timeout().
  */
 void threads_enter();
 
 /** Unlocks the Clutter thread lock.
+ *
+ * @deprecated This function should not be used by application code. Marking critical sections is not 
portable on various platforms. Instead of acquiring the Clutter lock, schedule UI updates from the main loop 
using threads_add_idle() or threads_add_timeout().
  */
 void threads_leave();
 
+#endif //CLUTTERMM_DISABLE_DEPRECATED
+
+
 // TODO: Should there be a SignalSomething class for these, so the
 // sigc::connection makes more semantical sense?
 
@@ -86,6 +97,9 @@ sigc::connection threads_add_idle(const sigc::slot<bool>& callback, int priority
  */
 sigc::connection threads_add_timeout(const sigc::slot<bool>& callback, guint interval, gint priority = 
Glib::PRIORITY_DEFAULT);
 
+
+#ifndef CLUTTERMM_DISABLE_DEPRECATED
+
 /** Sets a function to be called at regular intervals holding the Clutter
  * lock, with the given priority. The function is called repeatedly until it
  * returns false, at which point the timeout is automatically destroyed and
@@ -108,9 +122,13 @@ sigc::connection threads_add_timeout(const sigc::slot<bool>& callback, guint int
  * @param interval the time between calls to the function, in milliseconds
  * @param the priority of the timeout source. Typically this will be in the range between 
Glib::PRIORITY_DEFAULT and Glib::PRIORITY_HIGH.
  * @return A sigc::connection that can be used to disconnect the callback from the timeout source.
+ *
+ * @deprecated This function is no longer useful.
  */
 sigc::connection threads_add_frame_source(const sigc::slot<bool>& callback, guint interval, gint priority = 
Glib::PRIORITY_DEFAULT);
 
+#endif //CLUTTERMM_DISABLE_DEPRECATED
+
 } //namespace Clutter
 
 #endif //_LIBCLUTTERMM_THREADS_H


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