[clutter/wip/clutter-1.99: 40/79] 2.0: Remove deprecated API from ClutterStage



commit 194ea1f38fbcae66ed059875112c8daf7883d782
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Fri Aug 24 08:36:35 2012 +0100

    2.0: Remove deprecated API from ClutterStage

 clutter/clutter-stage.c |  388 +----------------------------------------------
 clutter/clutter-stage.h |   21 ---
 2 files changed, 1 insertions(+), 408 deletions(-)
---
diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c
index 12c842f..352151d 100644
--- a/clutter/clutter-stage.c
+++ b/clutter/clutter-stage.c
@@ -124,8 +124,6 @@ struct _ClutterStagePrivate
   CoglMatrix view;
   float viewport[4];
 
-  ClutterFog fog;
-
   gchar *title;
   ClutterActor *key_focused_actor;
 
@@ -161,7 +159,6 @@ struct _ClutterStagePrivate
   guint is_fullscreen          : 1;
   guint is_cursor_visible      : 1;
   guint is_user_resizable      : 1;
-  guint use_fog                : 1;
   guint throttle_motion_events : 1;
   guint use_alpha              : 1;
   guint min_size_changed       : 1;
@@ -337,23 +334,6 @@ queue_full_redraw (ClutterStage *stage)
   _clutter_stage_window_add_redraw_clip (stage_window, NULL);
 }
 
-static gboolean
-stage_is_default (ClutterStage *stage)
-{
-  ClutterStageManager *stage_manager;
-  ClutterStageWindow *impl;
-
-  stage_manager = clutter_stage_manager_get_default ();
-  if (stage != clutter_stage_manager_get_default_stage (stage_manager))
-    return FALSE;
-
-  impl = _clutter_stage_get_window (stage);
-  if (impl != _clutter_stage_get_default_window ())
-    return FALSE;
-
-  return TRUE;
-}
-
 static void
 clutter_stage_allocate (ClutterActor           *self,
                         const ClutterActorBox  *box,
@@ -1592,10 +1572,7 @@ static gboolean
 clutter_stage_real_delete_event (ClutterStage *stage,
                                  ClutterEvent *event)
 {
-  if (stage_is_default (stage))
-    clutter_main_quit ();
-  else
-    clutter_actor_destroy (CLUTTER_ACTOR (stage));
+  clutter_actor_destroy (CLUTTER_ACTOR (stage));
 
   return TRUE;
 }
@@ -1684,14 +1661,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;
@@ -1758,14 +1727,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;
@@ -1900,21 +1861,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
@@ -1943,22 +1889,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
@@ -1990,41 +1920,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
@@ -2246,7 +2141,6 @@ clutter_stage_init (ClutterStage *self)
   priv->is_fullscreen = FALSE;
   priv->is_user_resizable = FALSE;
   priv->is_cursor_visible = TRUE;
-  priv->use_fog = FALSE;
   priv->throttle_motion_events = TRUE;
   priv->min_size_changed = FALSE;
 
@@ -2284,10 +2178,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);
@@ -2310,90 +2200,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)
@@ -3112,136 +2918,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
@@ -3264,24 +2940,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:
  *
@@ -3567,50 +3225,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 9669a2f..1dc00b7 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]