[clutter] Deprecate some more old, useless API



commit bf9339b8f468dfb12eee95472f0b284acbf56487
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Tue Nov 15 17:58:25 2011 +0000

    Deprecate some more old, useless API
    
    We still ship clutter_get_show_fps() and clutter_get_debug_enabled() as
    public entry points. Yet another case of missing API review prior to the
    1.0 release, so really the bucket stops around my desk.
    
    Let's deprecate these two useless functions, and reduce the API
    footprint of Clutter.

 clutter/clutter-main.c            |   28 +++++++++++++++++++---------
 clutter/clutter-main.h            |    2 --
 clutter/clutter-private.h         |    2 ++
 clutter/clutter-stage.c           |    4 ++--
 clutter/deprecated/clutter-main.h |    6 ++++++
 5 files changed, 29 insertions(+), 13 deletions(-)
---
diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c
index d234f1d..59558a8 100644
--- a/clutter/clutter-main.c
+++ b/clutter/clutter-main.c
@@ -462,11 +462,23 @@ clutter_config_read (void)
  * Return value: %TRUE if Clutter should show the FPS.
  *
  * Since: 0.4
+ *
+ * Deprecated: 1.10: This function does not do anything. Use the environment
+ *   variable or the configuration file to determine whether Clutter should
+ *   print out the FPS counter on the console.
  */
 gboolean
 clutter_get_show_fps (void)
 {
-  return clutter_show_fps;
+  return FALSE;
+}
+
+gboolean
+_clutter_context_get_show_fps (void)
+{
+  ClutterMainContext *context = _clutter_context_get_default ();
+
+  return context->show_fps;
 }
 
 /**
@@ -1291,18 +1303,16 @@ clutter_threads_leave (void)
 /**
  * clutter_get_debug_enabled:
  *
- * Check if clutter has debugging turned on.
+ * Check if Clutter has debugging enabled.
+ *
+ * Return value: %FALSE
  *
- * Return value: TRUE if debugging is turned on, FALSE otherwise.
+ * Deprecated: 1.10: This function does not do anything.
  */
 gboolean
 clutter_get_debug_enabled (void)
 {
-#ifdef CLUTTER_ENABLE_DEBUG
-  return clutter_debug_flags != 0;
-#else
   return FALSE;
-#endif
 }
 
 void
@@ -1767,10 +1777,10 @@ post_parse_hook (GOptionContext  *context,
     }
 
   clutter_context->frame_rate = clutter_default_fps;
+  clutter_context->show_fps = clutter_show_fps;
   clutter_context->options_parsed = TRUE;
 
-  /*
-   * If not asked to defer display setup, call clutter_init_real(),
+  /* If not asked to defer display setup, call clutter_init_real(),
    * which in turn calls the backend post parse hooks.
    */
   if (!clutter_context->defer_display_setup)
diff --git a/clutter/clutter-main.h b/clutter/clutter-main.h
index 622f80d..b59b572 100644
--- a/clutter/clutter-main.h
+++ b/clutter/clutter-main.h
@@ -98,8 +98,6 @@ gint                    clutter_main_level                      (void);
 void                    clutter_do_event                        (ClutterEvent *event);
 
 /* Debug utility functions */
-gboolean                clutter_get_debug_enabled               (void);
-gboolean                clutter_get_show_fps                    (void);
 gboolean                clutter_get_accessibility_enabled       (void);
 
 /* Threading functions */
diff --git a/clutter/clutter-private.h b/clutter/clutter-private.h
index 1740c69..103bc20 100644
--- a/clutter/clutter-private.h
+++ b/clutter/clutter-private.h
@@ -177,6 +177,7 @@ struct _ClutterMainContext
   guint motion_events_per_actor : 1;
   guint defer_display_setup     : 1;
   guint options_parsed          : 1;
+  guint show_fps                : 1;
 };
 
 /* shared between clutter-main.c and clutter-frame-source.c */
@@ -203,6 +204,7 @@ ClutterActor *          _clutter_context_peek_shader_stack              (void);
 guint32                 _clutter_context_acquire_id                     (gpointer      key);
 void                    _clutter_context_release_id                     (guint32       id_);
 gboolean                _clutter_context_get_motion_events_enabled      (void);
+gboolean                _clutter_context_get_show_fps                   (void);
 
 const gchar *_clutter_gettext (const gchar *str);
 
diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c
index 9ab7a3a..a292b92 100644
--- a/clutter/clutter-stage.c
+++ b/clutter/clutter-stage.c
@@ -1043,7 +1043,7 @@ clutter_stage_do_redraw (ClutterStage *stage)
 
   _clutter_backend_ensure_context (backend, stage);
 
-  if (clutter_get_show_fps ())
+  if (_clutter_context_get_show_fps ())
     {
       if (priv->fps_timer == NULL)
         priv->fps_timer = g_timer_new ();
@@ -1053,7 +1053,7 @@ clutter_stage_do_redraw (ClutterStage *stage)
 
   _clutter_backend_redraw (backend, stage);
 
-  if (clutter_get_show_fps ())
+  if (_clutter_context_get_show_fps ())
     {
       priv->timer_n_frames += 1;
 
diff --git a/clutter/deprecated/clutter-main.h b/clutter/deprecated/clutter-main.h
index 2067b3a..4c64360 100644
--- a/clutter/deprecated/clutter-main.h
+++ b/clutter/deprecated/clutter-main.h
@@ -54,6 +54,12 @@ void                    clutter_set_default_frame_rate          (guint
 CLUTTER_DEPRECATED
 gulong                  clutter_get_timestamp                   (void);
 
+CLUTTER_DEPRECATED
+gboolean                clutter_get_debug_enabled               (void);
+
+CLUTTER_DEPRECATED
+gboolean                clutter_get_show_fps                    (void);
+
 G_END_DECLS
 
 #endif /* __CLUTTER_MAIN_DEPRECATED_H__ */



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