clutter/stage: Remove all deprecated functions

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1332
This commit is contained in:
Georges Basile Stavracas Neto 2020-06-26 17:01:43 -03:00 committed by Robert Mader
parent ae49f89cf3
commit d4993c4b22
6 changed files with 1 additions and 222 deletions

View File

@ -8700,9 +8700,6 @@ clutter_actor_new (void)
* container, the actor will be removed. * container, the actor will be removed.
* *
* When you destroy a container, its children will be destroyed as well. * When you destroy a container, its children will be destroyed as well.
*
* Note: you cannot destroy the #ClutterStage returned by
* clutter_stage_get_default().
*/ */
void void
clutter_actor_destroy (ClutterActor *self) clutter_actor_destroy (ClutterActor *self)

View File

@ -7,7 +7,6 @@
#include "deprecated/clutter-box.h" #include "deprecated/clutter-box.h"
#include "deprecated/clutter-container.h" #include "deprecated/clutter-container.h"
#include "deprecated/clutter-rectangle.h" #include "deprecated/clutter-rectangle.h"
#include "deprecated/clutter-stage.h"
#include "deprecated/clutter-timeline.h" #include "deprecated/clutter-timeline.h"
#undef __CLUTTER_DEPRECATED_H_INSIDE__ #undef __CLUTTER_DEPRECATED_H_INSIDE__

View File

@ -51,7 +51,6 @@
#define CLUTTER_ENABLE_EXPERIMENTAL_API #define CLUTTER_ENABLE_EXPERIMENTAL_API
#include "clutter-stage.h" #include "clutter-stage.h"
#include "deprecated/clutter-stage.h"
#include "deprecated/clutter-container.h" #include "deprecated/clutter-container.h"
#include "clutter-actor-private.h" #include "clutter-actor-private.h"
@ -2109,56 +2108,6 @@ clutter_stage_init (ClutterStage *self)
priv->cached_pick_mode = CLUTTER_PICK_NONE; priv->cached_pick_mode = CLUTTER_PICK_NONE;
} }
/**
* 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);
}
static void static void
clutter_stage_set_perspective (ClutterStage *stage, clutter_stage_set_perspective (ClutterStage *stage,
ClutterPerspective *perspective) ClutterPerspective *perspective)
@ -2719,10 +2668,7 @@ G_DEFINE_BOXED_TYPE (ClutterPerspective, clutter_perspective,
* clutter_stage_new: * clutter_stage_new:
* *
* Creates a new, non-default stage. A non-default stage is a new * Creates a new, non-default stage. A non-default stage is a new
* top-level actor which can be used as another container. It works * top-level actor which can be used as another container.
* exactly like the default stage, but while clutter_stage_get_default()
* will always return the same instance, you will have to keep a pointer
* to any #ClutterStage returned by clutter_stage_new().
* *
* The ability to support multiple stages depends on the current * The ability to support multiple stages depends on the current
* backend. Use clutter_feature_available() and * backend. Use clutter_feature_available() and
@ -2741,23 +2687,6 @@ clutter_stage_new (void)
return g_object_new (CLUTTER_TYPE_STAGE, NULL); return g_object_new (CLUTTER_TYPE_STAGE, NULL);
} }
/**
* clutter_stage_ensure_current:
* @stage: the #ClutterStage
*
* This function essentially makes sure the right GL context is
* current for the passed stage. It is not intended to
* be used by applications.
*
* Since: 0.8
* Deprecated: mutter: This function does not do anything.
*/
void
clutter_stage_ensure_current (ClutterStage *stage)
{
g_return_if_fail (CLUTTER_IS_STAGE (stage));
}
/** /**
* clutter_stage_ensure_viewport: * clutter_stage_ensure_viewport:
* @stage: a #ClutterStage * @stage: a #ClutterStage
@ -3007,50 +2936,6 @@ clutter_stage_is_redraw_queued (ClutterStage *stage)
return priv->redraw_pending; return priv->redraw_pending;
} }
/**
* clutter_stage_queue_redraw:
* @stage: the #ClutterStage
*
* Queues a redraw for the passed stage.
*
* Applications should call clutter_actor_queue_redraw() and not
* this function.
*
* 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 void
_clutter_stage_set_window (ClutterStage *stage, _clutter_stage_set_window (ClutterStage *stage,
ClutterStageWindow *stage_window) ClutterStageWindow *stage_window)

View File

@ -1,82 +0,0 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Copyright (C) 2011 Intel Corp
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#ifndef __CLUTTER_STAGE_DEPRECATED_H__
#define __CLUTTER_STAGE_DEPRECATED_H__
#include <clutter/clutter-types.h>
G_BEGIN_DECLS
#ifndef CLUTTER_DISABLE_DEPRECATED
/**
* CLUTTER_STAGE_WIDTH:
*
* Macro that evaluates to the width of the default stage
*
* Since: 0.2
*
* Deprecated: 1.2: Use clutter_actor_get_width() instead
*/
#define CLUTTER_STAGE_WIDTH() (clutter_actor_get_width (clutter_stage_get_default ()))
/**
* CLUTTER_STAGE_HEIGHT:
*
* Macro that evaluates to the height of the default stage
*
* Since: 0.2
*
* Deprecated: 1.2: use clutter_actor_get_height() instead
*/
#define CLUTTER_STAGE_HEIGHT() (clutter_actor_get_height (clutter_stage_get_default ()))
/* Commodity macro, for mallum only */
#define clutter_stage_add(stage,actor) G_STMT_START { \
if (CLUTTER_IS_STAGE ((stage)) && CLUTTER_IS_ACTOR ((actor))) \
{ \
ClutterContainer *_container = (ClutterContainer *) (stage); \
ClutterActor *_actor = (ClutterActor *) (actor); \
clutter_container_add_actor (_container, _actor); \
} } G_STMT_END
#endif /* CLUTTER_DISABLE_DEPRECATED */
CLUTTER_DEPRECATED_FOR(clutter_stage_new)
ClutterActor * clutter_stage_get_default (void);
CLUTTER_DEPRECATED
gboolean clutter_stage_is_default (ClutterStage *stage);
CLUTTER_DEPRECATED_FOR(clutter_actor_queue_redraw)
void clutter_stage_queue_redraw (ClutterStage *stage);
CLUTTER_DEPRECATED
void clutter_stage_ensure_current (ClutterStage *stage);
G_END_DECLS
#endif /* __CLUTTER_STAGE_DEPRECATED_H__ */

View File

@ -223,7 +223,6 @@ clutter_deprecated_headers = [
'deprecated/clutter-box.h', 'deprecated/clutter-box.h',
'deprecated/clutter-container.h', 'deprecated/clutter-container.h',
'deprecated/clutter-rectangle.h', 'deprecated/clutter-rectangle.h',
'deprecated/clutter-stage.h',
'deprecated/clutter-timeline.h', 'deprecated/clutter-timeline.h',
] ]

View File

@ -341,24 +341,6 @@ clone_no_map (void)
clutter_actor_destroy (CLUTTER_ACTOR (group)); clutter_actor_destroy (CLUTTER_ACTOR (group));
} }
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static void
default_stage (void)
{
ClutterActor *stage, *def_stage;
stage = clutter_test_get_stage ();
def_stage = clutter_stage_get_default ();
if (clutter_feature_available (CLUTTER_FEATURE_STAGE_MULTIPLE))
g_assert (stage != def_stage);
else
g_assert (stage == def_stage);
g_assert (CLUTTER_ACTOR_IS_REALIZED (def_stage));
}
G_GNUC_END_IGNORE_DEPRECATIONS
CLUTTER_TEST_SUITE ( CLUTTER_TEST_SUITE (
CLUTTER_TEST_UNIT ("/actor/invariants/initial-state", actor_initial_state) CLUTTER_TEST_UNIT ("/actor/invariants/initial-state", actor_initial_state)
CLUTTER_TEST_UNIT ("/actor/invariants/show-not-parented", actor_shown_not_parented) CLUTTER_TEST_UNIT ("/actor/invariants/show-not-parented", actor_shown_not_parented)
@ -369,5 +351,4 @@ CLUTTER_TEST_SUITE (
CLUTTER_TEST_UNIT ("/actor/invariants/map-recursive", actor_map_recursive) CLUTTER_TEST_UNIT ("/actor/invariants/map-recursive", actor_map_recursive)
CLUTTER_TEST_UNIT ("/actor/invariants/show-on-set-parent", actor_show_on_set_parent) CLUTTER_TEST_UNIT ("/actor/invariants/show-on-set-parent", actor_show_on_set_parent)
CLUTTER_TEST_UNIT ("/actor/invariants/clone-no-map", clone_no_map) CLUTTER_TEST_UNIT ("/actor/invariants/clone-no-map", clone_no_map)
CLUTTER_TEST_UNIT ("/actor/invariants/default-stage", default_stage)
) )