From b4b13ac9968e7f61c135706c48397dcd65919b73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 20 Jul 2016 13:48:57 +0800 Subject: [PATCH] clutter: Remove ClutterFixed We don't use it any more. Lets get rid of it. https://bugzilla.gnome.org/show_bug.cgi?id=768977 --- clutter/clutter/Makefile.am | 2 - clutter/clutter/clutter-deprecated.h | 1 - clutter/clutter/clutter-interval.c | 22 --- clutter/clutter/deprecated/clutter-fixed.c | 205 --------------------- clutter/clutter/deprecated/clutter-fixed.h | 99 ---------- 5 files changed, 329 deletions(-) delete mode 100644 clutter/clutter/deprecated/clutter-fixed.c delete mode 100644 clutter/clutter/deprecated/clutter-fixed.h diff --git a/clutter/clutter/Makefile.am b/clutter/clutter/Makefile.am index df157df48..d22fa6a1d 100644 --- a/clutter/clutter/Makefile.am +++ b/clutter/clutter/Makefile.am @@ -269,7 +269,6 @@ deprecated_h = \ deprecated/clutter-box.h \ deprecated/clutter-cairo-texture.h \ deprecated/clutter-container.h \ - deprecated/clutter-fixed.h \ deprecated/clutter-frame-source.h \ deprecated/clutter-group.h \ deprecated/clutter-input-device.h \ @@ -306,7 +305,6 @@ deprecated_c = \ deprecated/clutter-behaviour-scale.c \ deprecated/clutter-box.c \ deprecated/clutter-cairo-texture.c \ - deprecated/clutter-fixed.c \ deprecated/clutter-frame-source.c \ deprecated/clutter-group.c \ deprecated/clutter-input-device-deprecated.c \ diff --git a/clutter/clutter/clutter-deprecated.h b/clutter/clutter/clutter-deprecated.h index 0b16c9b94..c54440d88 100644 --- a/clutter/clutter/clutter-deprecated.h +++ b/clutter/clutter/clutter-deprecated.h @@ -20,7 +20,6 @@ #include "deprecated/clutter-box.h" #include "deprecated/clutter-cairo-texture.h" #include "deprecated/clutter-container.h" -#include "deprecated/clutter-fixed.h" #include "deprecated/clutter-frame-source.h" #include "deprecated/clutter-group.h" #include "deprecated/clutter-input-device.h" diff --git a/clutter/clutter/clutter-interval.c b/clutter/clutter/clutter-interval.c index 270864bad..6f14287b4 100644 --- a/clutter/clutter/clutter-interval.c +++ b/clutter/clutter/clutter-interval.c @@ -62,9 +62,6 @@ #include "clutter-scriptable.h" #include "clutter-script-private.h" -#define CLUTTER_DISABLE_DEPRECATION_WARNINGS -#include "deprecated/clutter-fixed.h" - enum { PROP_0, @@ -110,25 +107,6 @@ clutter_interval_real_validate (ClutterInterval *interval, { GType pspec_gtype = G_PARAM_SPEC_VALUE_TYPE (pspec); -G_GNUC_BEGIN_IGNORE_DEPRECATIONS; - - /* check the GTypes we provide first */ - if (pspec_gtype == COGL_TYPE_FIXED) - { - ClutterParamSpecFixed *pspec_fixed = CLUTTER_PARAM_SPEC_FIXED (pspec); - CoglFixed a, b; - - a = b = 0; - clutter_interval_get_interval (interval, &a, &b); - if ((a >= pspec_fixed->minimum && a <= pspec_fixed->maximum) && - (b >= pspec_fixed->minimum && b <= pspec_fixed->maximum)) - return TRUE; - else - return FALSE; - } - -G_GNUC_END_IGNORE_DEPRECATIONS; - /* then check the fundamental types */ switch (G_TYPE_FUNDAMENTAL (pspec_gtype)) { diff --git a/clutter/clutter/deprecated/clutter-fixed.c b/clutter/clutter/deprecated/clutter-fixed.c deleted file mode 100644 index 8a255bd75..000000000 --- a/clutter/clutter/deprecated/clutter-fixed.c +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Tomas Frydrych - * - * Copyright (C) 2006, 2007 OpenedHand - * - * 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 . - * - * - */ - -#define G_IMPLEMENT_INLINES - -#ifdef HAVE_CONFIG_H -#include "clutter-build-config.h" -#endif - -#define CLUTTER_DISABLE_DEPRECATION_WARNINGS - -/* This file depends on the cogl-fixed api which isn't exposed when - * COGL_ENABLE_EXPERIMENTAL_2_0_API is defined... - */ -#undef COGL_ENABLE_EXPERIMENTAL_2_0_API -#include - -#include - -#include "clutter-fixed.h" -#include "clutter-private.h" - -/** - * clutter_value_set_fixed: (skip) - * @value: a #GValue initialized to %COGL_TYPE_FIXED - * @fixed_: the fixed point value to set - * - * Sets @value to @fixed_. - * - * Since: 0.8 - * - * Deprecated: 1.10: Use g_value_set_int() instead. - */ -void -clutter_value_set_fixed (GValue *value, - CoglFixed fixed_) -{ - g_return_if_fail (CLUTTER_VALUE_HOLDS_FIXED (value)); - - value->data[0].v_int = fixed_; -} - -/** - * clutter_value_get_fixed: (skip) - * @value: a #GValue initialized to %COGL_TYPE_FIXED - * - * Gets the fixed point value stored inside @value. - * - * Return value: the value inside the passed #GValue - * - * Since: 0.8 - * - * Deprecated: 1.10: Use g_value_get_int() instead. - */ -CoglFixed -clutter_value_get_fixed (const GValue *value) -{ - g_return_val_if_fail (CLUTTER_VALUE_HOLDS_FIXED (value), 0); - - return value->data[0].v_int; -} - -static void -param_fixed_init (GParamSpec *pspec) -{ - ClutterParamSpecFixed *fspec = CLUTTER_PARAM_SPEC_FIXED (pspec); - - fspec->minimum = COGL_FIXED_MIN; - fspec->maximum = COGL_FIXED_MAX; - fspec->default_value = 0; -} - -static void -param_fixed_set_default (GParamSpec *pspec, - GValue *value) -{ - value->data[0].v_int = CLUTTER_PARAM_SPEC_FIXED (pspec)->default_value; -} - -static gboolean -param_fixed_validate (GParamSpec *pspec, - GValue *value) -{ - ClutterParamSpecFixed *fspec = CLUTTER_PARAM_SPEC_FIXED (pspec); - gint oval = value->data[0].v_int; - gint min, max, val; - - g_assert (CLUTTER_IS_PARAM_SPEC_FIXED (pspec)); - - /* we compare the integer part of the value because the minimum - * and maximum values cover just that part of the representation - */ - min = fspec->minimum; - max = fspec->maximum; - val = (value->data[0].v_int); - - val = CLAMP (val, min, max); - if (val != oval) - { - value->data[0].v_int = val; - return TRUE; - } - - return FALSE; -} - -static gint -param_fixed_values_cmp (GParamSpec *pspec, - const GValue *value1, - const GValue *value2) -{ - if (value1->data[0].v_int < value2->data[0].v_int) - return -1; - else - return value1->data[0].v_int > value2->data[0].v_int; -} - -GType -clutter_param_fixed_get_type (void) -{ - static GType pspec_type = 0; - - if (G_UNLIKELY (pspec_type == 0)) - { - const GParamSpecTypeInfo pspec_info = { - sizeof (ClutterParamSpecFixed), - 16, - param_fixed_init, - COGL_TYPE_FIXED, - NULL, - param_fixed_set_default, - param_fixed_validate, - param_fixed_values_cmp, - }; - - pspec_type = g_param_type_register_static (I_("ClutterParamSpecFixed"), - &pspec_info); - } - - return pspec_type; -} - -/** - * clutter_param_spec_fixed: (skip) - * @name: name of the property - * @nick: short name - * @blurb: description (can be translatable) - * @minimum: lower boundary - * @maximum: higher boundary - * @default_value: default value - * @flags: flags for the param spec - * - * Creates a #GParamSpec for properties using #CoglFixed values - * - * Return value: (transfer full): the newly created #GParamSpec - * - * Since: 0.8 - * - * Deprecated: 1.10: Use #GParamSpecInt instead. - */ -GParamSpec * -clutter_param_spec_fixed (const gchar *name, - const gchar *nick, - const gchar *blurb, - CoglFixed minimum, - CoglFixed maximum, - CoglFixed default_value, - GParamFlags flags) -{ - ClutterParamSpecFixed *fspec; - - g_return_val_if_fail (default_value >= minimum && default_value <= maximum, - NULL); - - fspec = g_param_spec_internal (CLUTTER_TYPE_PARAM_FIXED, - name, nick, blurb, - flags); - fspec->minimum = minimum; - fspec->maximum = maximum; - fspec->default_value = default_value; - - return G_PARAM_SPEC (fspec); -} diff --git a/clutter/clutter/deprecated/clutter-fixed.h b/clutter/clutter/deprecated/clutter-fixed.h deleted file mode 100644 index 98e0e1a74..000000000 --- a/clutter/clutter/deprecated/clutter-fixed.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * Tomas Frydrych - * - * Copyright (C) 2006 OpenedHand - * - * 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 . - */ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __CLUTTER_FIXED_H__ -#define __CLUTTER_FIXED_H__ - -#include -#include - -G_BEGIN_DECLS - -#define CLUTTER_TYPE_PARAM_FIXED (clutter_param_fixed_get_type ()) -#define CLUTTER_PARAM_SPEC_FIXED(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), CLUTTER_TYPE_PARAM_FIXED, ClutterParamSpecFixed)) -#define CLUTTER_IS_PARAM_SPEC_FIXED(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), CLUTTER_TYPE_PARAM_FIXED)) - -/** - * CLUTTER_VALUE_HOLDS_FIXED: - * @x: a #GValue - * - * Evaluates to %TRUE if @x holds a #CoglFixed . - * - * Since: 0.8 - * - * Deprecated: 1.10: Use %G_VALUE_HOLDS_INT instead - */ -#define CLUTTER_VALUE_HOLDS_FIXED(x) (G_VALUE_HOLDS ((x), COGL_TYPE_FIXED)) - -typedef struct _ClutterParamSpecFixed ClutterParamSpecFixed; - -/** - * ClutterParamSpecFixed: (skip) - * @minimum: lower boundary - * @maximum: higher boundary - * @default_value: default value - * - * #GParamSpec subclass for fixed point based properties - * - * Since: 0.8 - * - * Deprecated: 1.10: Do not use fixed-point values in public - * API. If you must, use #GParamSpecInt instead. - */ -struct _ClutterParamSpecFixed -{ - /*< private >*/ - GParamSpec parent_instance; - - /*< public >*/ - CoglFixed minimum; - CoglFixed maximum; - CoglFixed default_value; -}; - -CLUTTER_DEPRECATED_IN_1_10 -GType clutter_param_fixed_get_type (void) G_GNUC_CONST; - -CLUTTER_DEPRECATED_IN_1_10_FOR(g_value_set_int) -void clutter_value_set_fixed (GValue *value, - CoglFixed fixed_); -CLUTTER_DEPRECATED_IN_1_10_FOR(g_value_get_int) -CoglFixed clutter_value_get_fixed (const GValue *value); - -CLUTTER_DEPRECATED_IN_1_10_FOR(g_param_spec_int) -GParamSpec * clutter_param_spec_fixed (const gchar *name, - const gchar *nick, - const gchar *blurb, - CoglFixed minimum, - CoglFixed maximum, - CoglFixed default_value, - GParamFlags flags); - -G_END_DECLS - -#endif /* __CLUTTER_FIXED_H__ */