mirror of
https://github.com/brl/mutter.git
synced 2025-06-13 16:59:30 +00:00
clutter: Remove unused deprecated/clutter-behaviour-opacity.c
https://gitlab.gnome.org/GNOME/mutter/merge_requests/879
This commit is contained in:

committed by
Georges Basile Stavracas Neto

parent
18e0a8f7bf
commit
68fca552d7
@ -1,88 +0,0 @@
|
||||
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
||||
#include <clutter/clutter.h>
|
||||
|
||||
#include "tests/clutter-test-utils.h"
|
||||
|
||||
static void
|
||||
behaviour_opacity (void)
|
||||
{
|
||||
ClutterBehaviour *behaviour;
|
||||
ClutterTimeline *timeline;
|
||||
ClutterAlpha *alpha;
|
||||
guint8 start, end;
|
||||
guint starti;
|
||||
|
||||
timeline = clutter_timeline_new (500);
|
||||
alpha = clutter_alpha_new_full (timeline, CLUTTER_LINEAR);
|
||||
behaviour = clutter_behaviour_opacity_new (alpha, 0, 255);
|
||||
g_assert (CLUTTER_IS_BEHAVIOUR_OPACITY (behaviour));
|
||||
g_object_add_weak_pointer (G_OBJECT (behaviour), (gpointer *) &behaviour);
|
||||
g_object_add_weak_pointer (G_OBJECT (timeline), (gpointer *) &timeline);
|
||||
|
||||
clutter_behaviour_opacity_get_bounds (CLUTTER_BEHAVIOUR_OPACITY (behaviour),
|
||||
&start,
|
||||
&end);
|
||||
|
||||
if (g_test_verbose ())
|
||||
g_print ("BehaviourOpacity:bounds = %d, %d (expected: 0, 255)\n",
|
||||
start,
|
||||
end);
|
||||
|
||||
g_assert_cmpint (start, ==, 0);
|
||||
g_assert_cmpint (end, ==, 255);
|
||||
|
||||
clutter_behaviour_opacity_set_bounds (CLUTTER_BEHAVIOUR_OPACITY (behaviour),
|
||||
255,
|
||||
0);
|
||||
/* XXX: The gobject property is actually a unsigned int not unsigned char
|
||||
* property so we have to be careful not to corrupt the stack by passing
|
||||
* a guint8 pointer here... */
|
||||
starti = 0;
|
||||
g_object_get (G_OBJECT (behaviour), "opacity-start", &starti, NULL);
|
||||
|
||||
if (g_test_verbose ())
|
||||
g_print ("BehaviourOpacity:start = %d (expected: 255)\n", start);
|
||||
|
||||
g_assert_cmpint (starti, ==, 255);
|
||||
|
||||
g_object_unref (behaviour);
|
||||
g_object_unref (timeline);
|
||||
|
||||
g_assert_null (behaviour);
|
||||
g_assert_null (timeline);
|
||||
}
|
||||
|
||||
static struct
|
||||
{
|
||||
const gchar *path;
|
||||
GTestFunc func;
|
||||
} behaviour_tests[] = {
|
||||
{ "opacity", behaviour_opacity },
|
||||
};
|
||||
|
||||
static const int n_behaviour_tests = G_N_ELEMENTS (behaviour_tests);
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
int i;
|
||||
|
||||
meta_wayland_override_display_name ("mutter-test-display");
|
||||
meta_xwayland_override_display_number (512);
|
||||
meta_override_compositor_configuration (META_COMPOSITOR_TYPE_WAYLAND,
|
||||
META_TYPE_BACKEND_X11_NESTED);
|
||||
meta_init ();
|
||||
|
||||
clutter_test_init (&argc, &argv);
|
||||
|
||||
for (i = 0; i < n_behaviour_tests; i++)
|
||||
{
|
||||
char *path = g_strconcat ("/behaviours/", behaviour_tests[i].path, NULL);
|
||||
|
||||
clutter_test_add (path, behaviour_tests[i].func);
|
||||
|
||||
g_free (path);
|
||||
}
|
||||
|
||||
return clutter_test_run ();
|
||||
}
|
@ -36,7 +36,6 @@ clutter_conform_tests_general_tests = [
|
||||
]
|
||||
|
||||
clutter_conform_tests_deprecated_tests = [
|
||||
'behaviours',
|
||||
'group',
|
||||
'rectangle',
|
||||
]
|
||||
|
@ -198,44 +198,6 @@ script_single (void)
|
||||
g_free (test_file);
|
||||
}
|
||||
|
||||
static void
|
||||
script_implicit_alpha (void)
|
||||
{
|
||||
ClutterScript *script = clutter_script_new ();
|
||||
ClutterTimeline *timeline;
|
||||
GObject *behaviour = NULL;
|
||||
GError *error = NULL;
|
||||
ClutterAlpha *alpha;
|
||||
gchar *test_file;
|
||||
|
||||
test_file = g_test_build_filename (G_TEST_DIST, "scripts", "test-script-implicit-alpha.json", NULL);
|
||||
clutter_script_load_from_file (script, test_file, &error);
|
||||
if (g_test_verbose () && error)
|
||||
g_print ("Error: %s", error->message);
|
||||
|
||||
#if GLIB_CHECK_VERSION (2, 20, 0)
|
||||
g_assert_no_error (error);
|
||||
#else
|
||||
g_assert (error == NULL);
|
||||
#endif
|
||||
|
||||
behaviour = clutter_script_get_object (script, "test");
|
||||
g_assert (CLUTTER_IS_BEHAVIOUR (behaviour));
|
||||
|
||||
alpha = clutter_behaviour_get_alpha (CLUTTER_BEHAVIOUR (behaviour));
|
||||
g_assert (CLUTTER_IS_ALPHA (alpha));
|
||||
|
||||
g_assert_cmpint (clutter_alpha_get_mode (alpha), ==, CLUTTER_EASE_OUT_CIRC);
|
||||
|
||||
timeline = clutter_alpha_get_timeline (alpha);
|
||||
g_assert (CLUTTER_IS_TIMELINE (timeline));
|
||||
|
||||
g_assert_cmpint (clutter_timeline_get_duration (timeline), ==, 500);
|
||||
|
||||
g_object_unref (script);
|
||||
g_free (test_file);
|
||||
}
|
||||
|
||||
static void
|
||||
script_object_property (void)
|
||||
{
|
||||
@ -422,7 +384,6 @@ CLUTTER_TEST_SUITE (
|
||||
CLUTTER_TEST_UNIT ("/script/container-child", script_child)
|
||||
CLUTTER_TEST_UNIT ("/script/named-object", script_named_object)
|
||||
CLUTTER_TEST_UNIT ("/script/animation", script_animation)
|
||||
CLUTTER_TEST_UNIT ("/script/implicit-alpha", script_implicit_alpha)
|
||||
CLUTTER_TEST_UNIT ("/script/object-property", script_object_property)
|
||||
CLUTTER_TEST_UNIT ("/script/layout-property", script_layout_property)
|
||||
CLUTTER_TEST_UNIT ("/script/actor-margin", script_margin)
|
||||
|
@ -1,8 +0,0 @@
|
||||
{
|
||||
"id" : "test",
|
||||
"type" : "ClutterBehaviourOpacity",
|
||||
"alpha" : {
|
||||
"mode" : "easeOutCirc",
|
||||
"timeline" : { "duration" : 500 }
|
||||
}
|
||||
}
|
@ -47,18 +47,6 @@ static const gchar *test_behaviour =
|
||||
" \"function\" : \"sine_alpha\","
|
||||
" \"timeline\" : \"main-timeline\""
|
||||
" },"
|
||||
" {"
|
||||
" \"id\" : \"fade-behaviour\","
|
||||
" \"type\" : \"ClutterBehaviourOpacity\","
|
||||
" \"opacity-start\" : 255,"
|
||||
" \"opacity-end\" : 0,"
|
||||
" \"alpha\" : {"
|
||||
" \"id\" : \"fade-alpha\","
|
||||
" \"type\" : \"ClutterAlpha\","
|
||||
" \"timeline\" : \"main-timeline\","
|
||||
" \"mode\" : \"linear\""
|
||||
" }"
|
||||
" }"
|
||||
"]";
|
||||
|
||||
static gboolean
|
||||
|
Reference in New Issue
Block a user