[gtk/wip/ebassi/animations: 4/5] WIP: Add GtkAnimationManager
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/ebassi/animations: 4/5] WIP: Add GtkAnimationManager
- Date: Wed, 24 Jul 2019 15:47:06 +0000 (UTC)
commit 14094d7be1d20c3de5fb1c347bdbfa2321e97155
Author: Emmanuele Bassi <ebassi gnome org>
Date: Wed Jul 24 16:41:12 2019 +0100
WIP: Add GtkAnimationManager
A private class that keeps track of all in flight animations for a top
level.
gtk/gtkanimationmanager.c | 37 +++++++++++++++++++++++++++++++++++++
gtk/gtkanimationmanagerprivate.h | 38 ++++++++++++++++++++++++++++++++++++++
gtk/meson.build | 1 +
3 files changed, 76 insertions(+)
---
diff --git a/gtk/gtkanimationmanager.c b/gtk/gtkanimationmanager.c
new file mode 100644
index 0000000000..aaf126c62f
--- /dev/null
+++ b/gtk/gtkanimationmanager.c
@@ -0,0 +1,37 @@
+#include "config.h"
+
+#include "gtkanimationmanagerprivate.h"
+
+struct _GtkAnimationManager
+{
+ GObject parent_instance;
+
+ GdkFrameClock *frame_clock;
+
+ gint64 last_frame_time;
+};
+
+G_DEFINE_TYPE (GtkAnimationManager, gtk_animation_manager, G_TYPE_OBJECT)
+
+static void
+gtk_animation_manager_class_init (GtkAnimationManagerClass *klass)
+{
+}
+
+static void
+gtk_animation_manager_init (GtkAnimationManager *self)
+{
+}
+
+GtkAnimationManager *
+gtk_animation_manager_new (void)
+{
+ return g_object_new (GTK_TYPE_ANIMATION_MANAGER, NULL);
+}
+
+void
+gtk_animation_manager_set_frame_clock (GtkAnimationManager *self,
+ GdkFrameClock *frame_clock)
+{
+
+}
diff --git a/gtk/gtkanimationmanagerprivate.h b/gtk/gtkanimationmanagerprivate.h
new file mode 100644
index 0000000000..8067ee97b2
--- /dev/null
+++ b/gtk/gtkanimationmanagerprivate.h
@@ -0,0 +1,38 @@
+/* gtkanimationmanagerprivate.h: Animation manager
+ *
+ * Copyright 2019 GNOME Foundation
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ *
+ * 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.1 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/>.
+ */
+
+#pragma once
+
+#include <gtk/gtktypes.h>
+
+G_BEGIN_DECLS
+
+#define GTK_TYPE_ANIMATION_MANAGER (gtk_animation_manager_get_type())
+
+G_DECLARE_FINAL_TYPE (GtkAnimationManager, gtk_animation_manager, GTK, ANIMATION_MANAGER, GObject)
+
+GtkAnimationManager *
+gtk_animation_manager_new (void);
+
+void
+gtk_animation_manager_set_frame_clock (GtkAnimationManager *self,
+ GdkFrameClock *frame_clock);
+
+G_END_DECLS
diff --git a/gtk/meson.build b/gtk/meson.build
index 8342f63487..b2301a4d2c 100644
--- a/gtk/meson.build
+++ b/gtk/meson.build
@@ -23,6 +23,7 @@ gtk_private_sources = files([
'gtkactionobservable.c',
'gtkactionobserver.c',
'gtkallocatedbitmask.c',
+ 'gtkanimationmanager.c',
'gtkapplicationaccels.c',
'gtkapplicationimpl.c',
'gtkbookmarksmanager.c',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]