From 0d9295523e8c215b1011f91fefcd5d5aed907bc1 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 7 Feb 2019 10:10:40 -0500 Subject: [PATCH] clutter: Remove deprecate/clutter-frame-source.h https://gitlab.gnome.org/GNOME/mutter/merge_requests/445 --- clutter/clutter/clutter-deprecated.h | 1 - .../clutter/deprecated/clutter-frame-source.c | 261 ------------------ .../clutter/deprecated/clutter-frame-source.h | 49 ---- clutter/clutter/deprecated/clutter-main.h | 11 - clutter/clutter/meson.build | 2 - 5 files changed, 324 deletions(-) delete mode 100644 clutter/clutter/deprecated/clutter-frame-source.c delete mode 100644 clutter/clutter/deprecated/clutter-frame-source.h diff --git a/clutter/clutter/clutter-deprecated.h b/clutter/clutter/clutter-deprecated.h index e2018a8cf..a9f0021d4 100644 --- a/clutter/clutter/clutter-deprecated.h +++ b/clutter/clutter/clutter-deprecated.h @@ -19,7 +19,6 @@ #include "deprecated/clutter-box.h" #include "deprecated/clutter-cairo-texture.h" #include "deprecated/clutter-container.h" -#include "deprecated/clutter-frame-source.h" #include "deprecated/clutter-group.h" #include "deprecated/clutter-input-device.h" #include "deprecated/clutter-keysyms.h" diff --git a/clutter/clutter/deprecated/clutter-frame-source.c b/clutter/clutter/deprecated/clutter-frame-source.c deleted file mode 100644 index b2747da48..000000000 --- a/clutter/clutter/deprecated/clutter-frame-source.c +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Neil Roberts - * - * Copyright (C) 2008 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 . - * - * - */ - -#include "clutter-build-config.h" - -#define CLUTTER_DISABLE_DEPRECATION_WARNINGS - -#include "clutter-main.h" -#include "clutter-private.h" - -#include "deprecated/clutter-frame-source.h" -#include "deprecated/clutter-timeout-interval.h" - -typedef struct _ClutterFrameSource ClutterFrameSource; - -struct _ClutterFrameSource -{ - GSource source; - - ClutterTimeoutInterval timeout; -}; - -static gboolean clutter_frame_source_prepare (GSource *source, - gint *timeout); -static gboolean clutter_frame_source_check (GSource *source); -static gboolean clutter_frame_source_dispatch (GSource *source, - GSourceFunc callback, - gpointer user_data); - -static GSourceFuncs clutter_frame_source_funcs = -{ - clutter_frame_source_prepare, - clutter_frame_source_check, - clutter_frame_source_dispatch, - NULL -}; - -/** - * clutter_frame_source_add_full: (rename-to clutter_frame_source_add) - * @priority: the priority of the frame source. Typically this will be in the - * range between %G_PRIORITY_DEFAULT and %G_PRIORITY_HIGH. - * @fps: the number of times per second to call the function - * @func: function to call - * @data: data to pass to the function - * @notify: function to call when the timeout source is removed - * - * Sets a function to be called at regular intervals with the given - * priority. The function is called repeatedly until it returns - * %FALSE, at which point the timeout is automatically destroyed and - * the function will not be called again. The @notify function is - * called when the timeout is destroyed. The first call to the - * function will be at the end of the first @interval. - * - * This function is similar to g_timeout_add_full() except that it - * will try to compensate for delays. For example, if @func takes half - * the interval time to execute then the function will be called again - * half the interval time after it finished. In contrast - * g_timeout_add_full() would not fire until a full interval after the - * function completes so the delay between calls would be 1.0 / @fps * - * 1.5. This function does not however try to invoke the function - * multiple times to catch up missing frames if @func takes more than - * @interval ms to execute. - * - * Return value: the ID (greater than 0) of the event source. - * - * Since: 0.8 - * - * Deprecated: 1.6: There is no direct replacement for this API. - */ -guint -clutter_frame_source_add_full (gint priority, - guint fps, - GSourceFunc func, - gpointer data, - GDestroyNotify notify) -{ - guint ret; - GSource *source = g_source_new (&clutter_frame_source_funcs, - sizeof (ClutterFrameSource)); - ClutterFrameSource *frame_source = (ClutterFrameSource *) source; - - _clutter_timeout_interval_init (&frame_source->timeout, fps); - - if (priority != G_PRIORITY_DEFAULT) - g_source_set_priority (source, priority); - - g_source_set_name (source, "Clutter frame timeout"); - g_source_set_callback (source, func, data, notify); - - ret = g_source_attach (source, NULL); - - g_source_unref (source); - - return ret; -} - -/** - * clutter_frame_source_add: (skip) - * @fps: the number of times per second to call the function - * @func: function to call - * @data: data to pass to the function - * - * Simple wrapper around clutter_frame_source_add_full(). - * - * Return value: the ID (greater than 0) of the event source. - * - * Since: 0.8 - * - * Deprecated: 1.6: There is no direct replacement for this API - */ -guint -clutter_frame_source_add (guint fps, - GSourceFunc func, - gpointer data) -{ - return clutter_frame_source_add_full (G_PRIORITY_DEFAULT, - fps, func, data, NULL); -} - -static gboolean -clutter_frame_source_prepare (GSource *source, - gint *delay) -{ - ClutterFrameSource *frame_source = (ClutterFrameSource *) source; - gint64 current_time; - -#if GLIB_CHECK_VERSION (2, 27, 3) - current_time = g_source_get_time (source) / 1000; -#else - { - GTimeVal source_time; - g_source_get_current_time (source, &source_time); - current_time = source_time.tv_sec * 1000 + source_time.tv_usec / 1000; - } -#endif - - return _clutter_timeout_interval_prepare (current_time, - &frame_source->timeout, - delay); -} - -static gboolean -clutter_frame_source_check (GSource *source) -{ - return clutter_frame_source_prepare (source, NULL); -} - -static gboolean -clutter_frame_source_dispatch (GSource *source, - GSourceFunc callback, - gpointer user_data) -{ - ClutterFrameSource *frame_source = (ClutterFrameSource *) source; - - return _clutter_timeout_interval_dispatch (&frame_source->timeout, - callback, user_data); -} - -/** - * clutter_threads_add_frame_source_full: (rename-to clutter_threads_add_frame_source) - * @priority: the priority of the frame source. Typically this will be in the - * range between %G_PRIORITY_DEFAULT and %G_PRIORITY_HIGH. - * @fps: the number of times per second to call the function - * @func: function to call - * @data: data to pass to the function - * @notify: function to call when the timeout source is removed - * - * Sets a function to be called at regular intervals holding the Clutter - * threads lock, with the given priority. The function is called repeatedly - * until it returns %FALSE, at which point the timeout is automatically - * removed and the function will not be called again. The @notify function - * is called when the timeout is removed. - * - * This function is similar to clutter_threads_add_timeout_full() - * except that it will try to compensate for delays. For example, if - * @func takes half the interval time to execute then the function - * will be called again half the interval time after it finished. In - * contrast clutter_threads_add_timeout_full() would not fire until a - * full interval after the function completes so the delay between - * calls would be @interval * 1.5. This function does not however try - * to invoke the function multiple times to catch up missing frames if - * @func takes more than @interval ms to execute. - * - * See also clutter_threads_add_idle_full(). - * - * Return value: the ID (greater than 0) of the event source. - * - * Since: 0.8 - * - * Deprecated: 1.6: There is no direct replacement for this API - */ -guint -clutter_threads_add_frame_source_full (gint priority, - guint fps, - GSourceFunc func, - gpointer data, - GDestroyNotify notify) -{ - ClutterThreadsDispatch *dispatch; - - g_return_val_if_fail (func != NULL, 0); - - dispatch = g_slice_new (ClutterThreadsDispatch); - dispatch->func = func; - dispatch->data = data; - dispatch->notify = notify; - - return clutter_frame_source_add_full (priority, - fps, - _clutter_threads_dispatch, dispatch, - _clutter_threads_dispatch_free); -} - -/** - * clutter_threads_add_frame_source: (skip) - * @fps: the number of times per second to call the function - * @func: function to call - * @data: data to pass to the function - * - * Simple wrapper around clutter_threads_add_frame_source_full(). - * - * Return value: the ID (greater than 0) of the event source. - * - * Since: 0.8 - * - * Deprecated: 1.6: There is no direct replacement for this API - */ -guint -clutter_threads_add_frame_source (guint fps, - GSourceFunc func, - gpointer data) -{ - g_return_val_if_fail (func != NULL, 0); - - return clutter_threads_add_frame_source_full (G_PRIORITY_DEFAULT, - fps, - func, data, - NULL); -} diff --git a/clutter/clutter/deprecated/clutter-frame-source.h b/clutter/clutter/deprecated/clutter-frame-source.h deleted file mode 100644 index d3649fbd3..000000000 --- a/clutter/clutter/deprecated/clutter-frame-source.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * Copyright (C) 2008 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_FRAME_SOURCE_H__ -#define __CLUTTER_FRAME_SOURCE_H__ - -#include - -G_BEGIN_DECLS - -CLUTTER_DEPRECATED -guint clutter_frame_source_add (guint fps, - GSourceFunc func, - gpointer data); - -CLUTTER_DEPRECATED -guint clutter_frame_source_add_full (gint priority, - guint fps, - GSourceFunc func, - gpointer data, - GDestroyNotify notify); - -G_END_DECLS - -#endif /* __CLUTTER_FRAME_SOURCE_H__ */ diff --git a/clutter/clutter/deprecated/clutter-main.h b/clutter/clutter/deprecated/clutter-main.h index afcc4aa24..a2e8d9c72 100644 --- a/clutter/clutter/deprecated/clutter-main.h +++ b/clutter/clutter/deprecated/clutter-main.h @@ -40,17 +40,6 @@ void clutter_threads_enter (void); CLUTTER_DEPRECATED void clutter_threads_leave (void); -CLUTTER_DEPRECATED -guint clutter_threads_add_frame_source (guint fps, - GSourceFunc func, - gpointer data); -CLUTTER_DEPRECATED -guint clutter_threads_add_frame_source_full (gint priority, - guint fps, - GSourceFunc func, - gpointer data, - GDestroyNotify notify); - CLUTTER_DEPRECATED_FOR(clutter_stage_set_motion_events_enabled) void clutter_set_motion_events_enabled (gboolean enable); diff --git a/clutter/clutter/meson.build b/clutter/clutter/meson.build index ffe45fbb7..f4c94f7cb 100644 --- a/clutter/clutter/meson.build +++ b/clutter/clutter/meson.build @@ -232,7 +232,6 @@ clutter_deprecated_headers = [ 'deprecated/clutter-box.h', 'deprecated/clutter-cairo-texture.h', 'deprecated/clutter-container.h', - 'deprecated/clutter-frame-source.h', 'deprecated/clutter-group.h', 'deprecated/clutter-input-device.h', 'deprecated/clutter-keysyms.h', @@ -264,7 +263,6 @@ clutter_deprecated_sources = [ 'deprecated/clutter-behaviour-scale.c', 'deprecated/clutter-box.c', 'deprecated/clutter-cairo-texture.c', - 'deprecated/clutter-frame-source.c', 'deprecated/clutter-group.c', 'deprecated/clutter-input-device-deprecated.c', 'deprecated/clutter-layout-manager-deprecated.c',