[clutter/wip/clutter-1.99: 24/28] 1.99: Remove deprecated API from ClutterStage



commit d427fe911acbf23152a97370372394dde1871c8b
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Thu Jun 21 18:23:58 2012 +0100

    1.99: Remove deprecated API from ClutterStage

 clutter/clutter-stage.c |  380 -----------------------------------------------
 clutter/clutter-stage.h |   21 ---
 2 files changed, 0 insertions(+), 401 deletions(-)
---
diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c
index 7580f5e..10a96d5 100644
--- a/clutter/clutter-stage.c
+++ b/clutter/clutter-stage.c
@@ -51,11 +51,7 @@
 #include <math.h>
 #include <cairo.h>
 
-#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
-
 #include "clutter-stage.h"
-#include "deprecated/clutter-stage.h"
-#include "deprecated/clutter-container.h"
 
 #include "clutter-actor-private.h"
 #include "clutter-backend-private.h"
@@ -122,8 +118,6 @@ struct _ClutterStagePrivate
   CoglMatrix view;
   float viewport[4];
 
-  ClutterFog fog;
-
   gchar *title;
   ClutterActor *key_focused_actor;
 
@@ -179,13 +173,10 @@ enum
 
   PROP_COLOR,
   PROP_FULLSCREEN_SET,
-  PROP_OFFSCREEN,
   PROP_CURSOR_VISIBLE,
   PROP_PERSPECTIVE,
   PROP_TITLE,
   PROP_USER_RESIZABLE,
-  PROP_USE_FOG,
-  PROP_FOG,
   PROP_USE_ALPHA,
   PROP_KEY_FOCUS,
   PROP_NO_CLEAR_HINT,
@@ -1588,11 +1579,6 @@ clutter_stage_set_property (GObject      *object,
                                           clutter_value_get_color (value));
       break;
 
-    case PROP_OFFSCREEN:
-      if (g_value_get_boolean (value))
-        g_warning ("Offscreen stages are currently not supported\n");
-      break;
-
     case PROP_CURSOR_VISIBLE:
       if (g_value_get_boolean (value))
         clutter_stage_show_cursor (stage);
@@ -1612,14 +1598,6 @@ clutter_stage_set_property (GObject      *object,
       clutter_stage_set_user_resizable (stage, g_value_get_boolean (value));
       break;
 
-    case PROP_USE_FOG:
-      clutter_stage_set_use_fog (stage, g_value_get_boolean (value));
-      break;
-
-    case PROP_FOG:
-      clutter_stage_set_fog (stage, g_value_get_boxed (value));
-      break;
-
     case PROP_USE_ALPHA:
       clutter_stage_set_use_alpha (stage, g_value_get_boolean (value));
       break;
@@ -1662,10 +1640,6 @@ clutter_stage_get_property (GObject    *gobject,
       }
       break;
 
-    case PROP_OFFSCREEN:
-      g_value_set_boolean (value, FALSE);
-      break;
-
     case PROP_FULLSCREEN_SET:
       g_value_set_boolean (value, priv->is_fullscreen);
       break;
@@ -1686,14 +1660,6 @@ clutter_stage_get_property (GObject    *gobject,
       g_value_set_boolean (value, priv->is_user_resizable);
       break;
 
-    case PROP_USE_FOG:
-      g_value_set_boolean (value, priv->use_fog);
-      break;
-
-    case PROP_FOG:
-      g_value_set_boxed (value, &priv->fog);
-      break;
-
     case PROP_USE_ALPHA:
       g_value_set_boolean (value, priv->use_alpha);
       break;
@@ -1829,21 +1795,6 @@ clutter_stage_class_init (ClutterStageClass *klass)
                                    PROP_FULLSCREEN_SET,
                                    pspec);
   /**
-   * ClutterStage:offscreen:
-   *
-   * Whether the stage should be rendered in an offscreen buffer.
-   *
-   * Deprecated: 1.10: This property does not do anything.
-   */
-  pspec = g_param_spec_boolean ("offscreen",
-                                P_("Offscreen"),
-                                P_("Whether the main stage should be rendered offscreen"),
-                                FALSE,
-                                CLUTTER_PARAM_READWRITE | G_PARAM_DEPRECATED);
-  g_object_class_install_property (gobject_class,
-                                   PROP_OFFSCREEN,
-                                   pspec);
-  /**
    * ClutterStage:cursor-visible:
    *
    * Whether the mouse pointer should be visible
@@ -1872,22 +1823,6 @@ clutter_stage_class_init (ClutterStageClass *klass)
                                    PROP_USER_RESIZABLE,
                                    pspec);
   /**
-   * ClutterStage:color:
-   *
-   * The background color of the main stage.
-   *
-   * Deprecated: 1.10: Use the #ClutterActor:background-color property of
-   *   #ClutterActor instead.
-   */
-  pspec = clutter_param_spec_color ("color",
-                                    P_("Color"),
-                                    P_("The color of the stage"),
-                                    &default_stage_color,
-                                    CLUTTER_PARAM_READWRITE |
-                                    G_PARAM_DEPRECATED);
-  g_object_class_install_property (gobject_class, PROP_COLOR, pspec);
-
-  /**
    * ClutterStage:perspective:
    *
    * The parameters used for the perspective projection from 3D
@@ -1919,41 +1854,6 @@ clutter_stage_class_init (ClutterStageClass *klass)
   g_object_class_install_property (gobject_class, PROP_TITLE, pspec);
 
   /**
-   * ClutterStage:use-fog:
-   *
-   * Whether the stage should use a linear GL "fog" in creating the
-   * depth-cueing effect, to enhance the perception of depth by fading
-   * actors farther from the viewpoint.
-   *
-   * Since: 0.6
-   *
-   * Deprecated: 1.10: This property does not do anything.
-   */
-  pspec = g_param_spec_boolean ("use-fog",
-                                P_("Use Fog"),
-                                P_("Whether to enable depth cueing"),
-                                FALSE,
-                                CLUTTER_PARAM_READWRITE | G_PARAM_DEPRECATED);
-  g_object_class_install_property (gobject_class, PROP_USE_FOG, pspec);
-
-  /**
-   * ClutterStage:fog:
-   *
-   * The settings for the GL "fog", used only if #ClutterStage:use-fog
-   * is set to %TRUE
-   *
-   * Since: 1.0
-   *
-   * Deprecated: 1.10: This property does not do anything.
-   */
-  pspec = g_param_spec_boxed ("fog",
-                              P_("Fog"),
-                              P_("Settings for the depth cueing"),
-                              CLUTTER_TYPE_FOG,
-                              CLUTTER_PARAM_READWRITE | G_PARAM_DEPRECATED);
-  g_object_class_install_property (gobject_class, PROP_FOG, pspec);
-
-  /**
    * ClutterStage:use-alpha:
    *
    * Whether the #ClutterStage should honour the alpha component of the
@@ -2211,10 +2111,6 @@ clutter_stage_init (ClutterStage *self)
                                       geom.height);
 
 
-  /* FIXME - remove for 2.0 */
-  priv->fog.z_near = 1.0;
-  priv->fog.z_far  = 2.0;
-
   priv->relayout_pending = TRUE;
 
   clutter_actor_set_reactive (CLUTTER_ACTOR (self), TRUE);
@@ -2239,90 +2135,6 @@ clutter_stage_init (ClutterStage *self)
   priv->pick_id_pool = _clutter_id_pool_new (256);
 }
 
-/**
- * clutter_stage_get_default:
- *
- * Retrieves a #ClutterStage singleton.
- *
- * This function is not as useful as it sounds, and will most likely
- * by deprecated in the future. Application code should only create
- * a #ClutterStage instance using clutter_stage_new(), and manage the
- * lifetime of the stage manually.
- *
- * The default stage singleton has a platform-specific behaviour: on
- * platforms without the %CLUTTER_FEATURE_STAGE_MULTIPLE feature flag
- * set, the first #ClutterStage instance will also be set to be the
- * default stage instance, and this function will always return a
- * pointer to it.
- *
- * On platforms with the %CLUTTER_FEATURE_STAGE_MULTIPLE feature flag
- * set, the default stage will be created by the first call to this
- * function, and every following call will return the same pointer to
- * it.
- *
- * Return value: (transfer none) (type Clutter.Stage): the main
- *   #ClutterStage. You should never destroy or unref the returned
- *   actor.
- *
- * Deprecated: 1.10: Use clutter_stage_new() instead.
- */
-ClutterActor *
-clutter_stage_get_default (void)
-{
-  ClutterStageManager *stage_manager = clutter_stage_manager_get_default ();
-  ClutterStage *stage;
-
-  stage = clutter_stage_manager_get_default_stage (stage_manager);
-  if (G_UNLIKELY (stage == NULL))
-    {
-      /* This will take care of automatically adding the stage to the
-       * stage manager and setting it as the default. Its floating
-       * reference will be claimed by the stage manager.
-       */
-      stage = g_object_new (CLUTTER_TYPE_STAGE, NULL);
-      _clutter_stage_manager_set_default_stage (stage_manager, stage);
-
-      /* the default stage is realized by default */
-      clutter_actor_realize (CLUTTER_ACTOR (stage));
-    }
-
-  return CLUTTER_ACTOR (stage);
-}
-
-/**
- * clutter_stage_set_color:
- * @stage: A #ClutterStage
- * @color: A #ClutterColor
- *
- * Sets the stage color.
- *
- * Deprecated: 1.10: Use clutter_actor_set_background_color() instead.
- */
-void
-clutter_stage_set_color (ClutterStage       *stage,
-			 const ClutterColor *color)
-{
-  clutter_actor_set_background_color (CLUTTER_ACTOR (stage), color);
-
-  g_object_notify (G_OBJECT (stage), "color");
-}
-
-/**
- * clutter_stage_get_color:
- * @stage: A #ClutterStage
- * @color: (out caller-allocates): return location for a #ClutterColor
- *
- * Retrieves the stage color.
- *
- * Deprecated: 1.10: Use clutter_actor_get_background_color() instead.
- */
-void
-clutter_stage_get_color (ClutterStage *stage,
-			 ClutterColor *color)
-{
-  clutter_actor_get_background_color (CLUTTER_ACTOR (stage), color);
-}
-
 static void
 clutter_stage_set_perspective_internal (ClutterStage       *stage,
                                         ClutterPerspective *perspective)
@@ -3037,136 +2849,6 @@ clutter_stage_get_key_focus (ClutterStage *stage)
   return CLUTTER_ACTOR (stage);
 }
 
-/**
- * clutter_stage_get_use_fog:
- * @stage: the #ClutterStage
- *
- * Gets whether the depth cueing effect is enabled on @stage.
- *
- * Return value: %TRUE if the depth cueing effect is enabled
- *
- * Since: 0.6
- *
- * Deprecated: 1.10: This function will always return %FALSE
- */
-gboolean
-clutter_stage_get_use_fog (ClutterStage *stage)
-{
-  g_return_val_if_fail (CLUTTER_IS_STAGE (stage), FALSE);
-
-  return stage->priv->use_fog;
-}
-
-/**
- * clutter_stage_set_use_fog:
- * @stage: the #ClutterStage
- * @fog: %TRUE for enabling the depth cueing effect
- *
- * Sets whether the depth cueing effect on the stage should be enabled
- * or not.
- *
- * Depth cueing is a 3D effect that makes actors farther away from the
- * viewing point less opaque, by fading them with the stage color.
-
- * The parameters of the GL fog used can be changed using the
- * clutter_stage_set_fog() function.
- *
- * Since: 0.6
- *
- * Deprecated: 1.10: Calling this function produces no visible effect
- */
-void
-clutter_stage_set_use_fog (ClutterStage *stage,
-                           gboolean      fog)
-{
-}
-
-/**
- * clutter_stage_set_fog:
- * @stage: the #ClutterStage
- * @fog: a #ClutterFog structure
- *
- * Sets the fog (also known as "depth cueing") settings for the @stage.
- *
- * A #ClutterStage will only use a linear fog progression, which
- * depends solely on the distance from the viewer. The cogl_set_fog()
- * function in COGL exposes more of the underlying implementation,
- * and allows changing the for progression function. It can be directly
- * used by disabling the #ClutterStage:use-fog property and connecting
- * a signal handler to the #ClutterActor::paint signal on the @stage,
- * like:
- *
- * |[
- *   clutter_stage_set_use_fog (stage, FALSE);
- *   g_signal_connect (stage, "paint", G_CALLBACK (on_stage_paint), NULL);
- * ]|
- *
- * The paint signal handler will call cogl_set_fog() with the
- * desired settings:
- *
- * |[
- *   static void
- *   on_stage_paint (ClutterActor *actor)
- *   {
- *     ClutterColor stage_color = { 0, };
- *     CoglColor fog_color = { 0, };
- *
- *     /&ast; set the fog color to the stage background color &ast;/
- *     clutter_stage_get_color (CLUTTER_STAGE (actor), &amp;stage_color);
- *     cogl_color_init_from_4ub (&amp;fog_color,
- *                               stage_color.red,
- *                               stage_color.green,
- *                               stage_color.blue,
- *                               stage_color.alpha);
- *
- *     /&ast; enable fog &ast;/
- *     cogl_set_fog (&amp;fog_color,
- *                   COGL_FOG_MODE_EXPONENTIAL, /&ast; mode &ast;/
- *                   0.5,                       /&ast; density &ast;/
- *                   5.0, 30.0);                /&ast; z_near and z_far &ast;/
- *   }
- * ]|
- *
- * <note>The fogging functions only work correctly when the visible actors use
- * unmultiplied alpha colors. By default Cogl will premultiply textures and
- * cogl_set_source_color() will premultiply colors, so unless you explicitly
- * load your textures requesting an unmultiplied internal format and use
- * cogl_material_set_color() you can only use fogging with fully opaque actors.
- * Support for premultiplied colors will improve in the future when we can
- * depend on fragment shaders.</note>
- *
- * Since: 0.6
- *
- * Deprecated: 1.10: Fog settings are ignored.
- */
-void
-clutter_stage_set_fog (ClutterStage *stage,
-                       ClutterFog   *fog)
-{
-}
-
-/**
- * clutter_stage_get_fog:
- * @stage: the #ClutterStage
- * @fog: (out): return location for a #ClutterFog structure
- *
- * Retrieves the current depth cueing settings from the stage.
- *
- * Since: 0.6
- *
- * Deprecated: 1.10: This function will always return the default
- *   values of #ClutterFog
- */
-void
-clutter_stage_get_fog (ClutterStage *stage,
-                        ClutterFog   *fog)
-{
-  g_return_if_fail (CLUTTER_IS_STAGE (stage));
-  g_return_if_fail (fog != NULL);
-
-  *fog = stage->priv->fog;
-}
-
 /*** Perspective boxed type ******/
 
 static gpointer
@@ -3189,24 +2871,6 @@ G_DEFINE_BOXED_TYPE (ClutterPerspective, clutter_perspective,
                      clutter_perspective_copy,
                      clutter_perspective_free);
 
-static gpointer
-clutter_fog_copy (gpointer data)
-{
-  if (G_LIKELY (data))
-    return g_slice_dup (ClutterFog, data);
-
-  return NULL;
-}
-
-static void
-clutter_fog_free (gpointer data)
-{
-  if (G_LIKELY (data))
-    g_slice_free (ClutterFog, data);
-}
-
-G_DEFINE_BOXED_TYPE (ClutterFog, clutter_fog, clutter_fog_copy, clutter_fog_free);
-
 /**
  * clutter_stage_new:
  *
@@ -3492,50 +3156,6 @@ clutter_stage_ensure_redraw (ClutterStage *stage)
   _clutter_master_clock_start_running (master_clock);
 }
 
-/**
- * clutter_stage_queue_redraw:
- * @stage: the #ClutterStage
- *
- * Queues a redraw for the passed stage.
- *
- * <note>Applications should call clutter_actor_queue_redraw() and not
- * this function.</note>
- *
- * Since: 0.8
- *
- * Deprecated: 1.10: Use clutter_actor_queue_redraw() instead.
- */
-void
-clutter_stage_queue_redraw (ClutterStage *stage)
-{
-  g_return_if_fail (CLUTTER_IS_STAGE (stage));
-
-  clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
-}
-
-/**
- * clutter_stage_is_default:
- * @stage: a #ClutterStage
- *
- * Checks if @stage is the default stage, or an instance created using
- * clutter_stage_new() but internally using the same implementation.
- *
- * Return value: %TRUE if the passed stage is the default one
- *
- * Since: 0.8
- *
- * Deprecated: 1.10: Track the stage pointer inside your application
- *   code, or use clutter_actor_get_stage() to retrieve the stage for
- *   a given actor.
- */
-gboolean
-clutter_stage_is_default (ClutterStage *stage)
-{
-  g_return_val_if_fail (CLUTTER_IS_STAGE (stage), FALSE);
-
-  return stage_is_default (stage);
-}
-
 void
 _clutter_stage_set_window (ClutterStage       *stage,
                            ClutterStageWindow *stage_window)
diff --git a/clutter/clutter-stage.h b/clutter/clutter-stage.h
index 851d402..79377c1 100644
--- a/clutter/clutter-stage.h
+++ b/clutter/clutter-stage.h
@@ -115,28 +115,7 @@ struct _ClutterPerspective
   gfloat z_far;
 };
 
-/**
- * ClutterFog:
- * @z_near: starting distance from the viewer to the near clipping
- *   plane (always positive)
- * @z_far: final distance from the viewer to the far clipping
- *   plane (always positive)
- *
- * Fog settings used to create the depth cueing effect.
- *
- * Since: 0.6
- *
- * Deprecated: 1.10: The fog-related API in #ClutterStage has been
- *   deprecated as well.
- */
-struct _ClutterFog
-{
-  gfloat z_near;
-  gfloat z_far;
-};
-
 GType clutter_perspective_get_type (void) G_GNUC_CONST;
-GType clutter_fog_get_type (void) G_GNUC_CONST;
 GType clutter_stage_get_type (void) G_GNUC_CONST;
 
 ClutterActor *  clutter_stage_new                               (void);



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