[mutter/gbsneto/graphene: 8/13] clutter: Set progress function on graphene_point3d_t
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/gbsneto/graphene: 8/13] clutter: Set progress function on graphene_point3d_t
- Date: Tue, 26 Feb 2019 19:58:10 +0000 (UTC)
commit 2d7ab1d71cdfd1be9f64d871ae5c498f208a1e2d
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Wed Feb 20 10:28:17 2019 -0300
clutter: Set progress function on graphene_point3d_t
This was dropped by the previous commit.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/458
clutter/clutter/clutter-graphene.c | 51 ++++++++++++++++++++++++++++++++++++++
clutter/clutter/clutter-graphene.h | 30 ++++++++++++++++++++++
clutter/clutter/clutter-main.c | 3 +++
clutter/clutter/meson.build | 2 ++
4 files changed, 86 insertions(+)
---
diff --git a/clutter/clutter/clutter-graphene.c b/clutter/clutter/clutter-graphene.c
new file mode 100644
index 000000000..b09e544b0
--- /dev/null
+++ b/clutter/clutter/clutter-graphene.c
@@ -0,0 +1,51 @@
+/*
+ * Clutter.
+ *
+ * An OpenGL based 'interactive canvas' library.
+ *
+ * Authored By Georges Basile Stavracas Neto <georges stavracas gmail com>
+ *
+ * Copyright (C) 2019 Endless, Inc
+ * Copyright (C) 2009, 2010 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/>.
+ */
+
+#include "clutter-graphene.h"
+#include "clutter-private.h"
+#include "clutter-types.h"
+
+static gboolean
+graphene_point3d_progress (const GValue *a,
+ const GValue *b,
+ gdouble progress,
+ GValue *retval)
+{
+ const graphene_point3d_t *av = g_value_get_boxed (a);
+ const graphene_point3d_t *bv = g_value_get_boxed (b);
+ graphene_point3d_t res;
+
+ graphene_point3d_interpolate (av, bv, progress, &res);
+
+ g_value_set_boxed (retval, &res);
+
+ return TRUE;
+}
+
+void
+clutter_graphene_init (void)
+{
+ clutter_interval_register_progress_func (GRAPHENE_TYPE_POINT3D,
+ graphene_point3d_progress);
+}
diff --git a/clutter/clutter/clutter-graphene.h b/clutter/clutter/clutter-graphene.h
new file mode 100644
index 000000000..ddea3ca4a
--- /dev/null
+++ b/clutter/clutter/clutter-graphene.h
@@ -0,0 +1,30 @@
+/*
+ * Clutter.
+ *
+ * An OpenGL based 'interactive canvas' library.
+ *
+ * Authored By Georges Basile Stavracas Neto <georges stavracas gmail com>
+ *
+ * Copyright (C) 2019 Endless, Inc
+ * Copyright (C) 2009, 2010 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/>.
+ */
+
+#ifndef CLUTTER_GRAPHENE_H
+#define CLUTTER_GRAPHENE_H
+
+void clutter_graphene_init (void);
+
+#endif
diff --git a/clutter/clutter/clutter-main.c b/clutter/clutter/clutter-main.c
index 07b8e9a2a..08bc0ba4c 100644
--- a/clutter/clutter/clutter-main.c
+++ b/clutter/clutter/clutter-main.c
@@ -58,6 +58,7 @@
#include "clutter-device-manager-private.h"
#include "clutter-event-private.h"
#include "clutter-feature.h"
+#include "clutter-graphene.h"
#include "clutter-main.h"
#include "clutter-master-clock.h"
#include "clutter-mutter.h"
@@ -2585,6 +2586,8 @@ clutter_base_init (void)
/* initialise the Big Clutter Lockā¢ if necessary */
clutter_threads_init_default ();
+
+ clutter_graphene_init ();
}
}
diff --git a/clutter/clutter/meson.build b/clutter/clutter/meson.build
index a5a3d98a8..11adc0bb5 100644
--- a/clutter/clutter/meson.build
+++ b/clutter/clutter/meson.build
@@ -126,6 +126,7 @@ clutter_sources = [
'clutter-flatten-effect.c',
'clutter-flow-layout.c',
'clutter-gesture-action.c',
+ 'clutter-graphene.c',
'clutter-grid-layout.c',
'clutter-image.c',
'clutter-input-device.c',
@@ -190,6 +191,7 @@ clutter_private_headers = [
'clutter-event-translator.h',
'clutter-event-private.h',
'clutter-flatten-effect.h',
+ 'clutter-graphene.h',
'clutter-gesture-action-private.h',
'clutter-id-pool.h',
'clutter-input-focus-private.h',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]