[mutter/gbsneto/graphene: 26/31] clutter: Set progress function on graphene_point3d_t



commit 001d86e504c1e4382b54ae377412ad347854dffd
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 2bb5bd2c8..3b1eec459 100644
--- a/clutter/clutter/clutter-main.c
+++ b/clutter/clutter/clutter-main.c
@@ -59,6 +59,7 @@
 #include "clutter-event-private.h"
 #include "clutter-feature.h"
 #include "clutter-input-pointer-a11y-private.h"
+#include "clutter-graphene.h"
 #include "clutter-main.h"
 #include "clutter-master-clock.h"
 #include "clutter-mutter.h"
@@ -2194,6 +2195,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 b3d5a2fd6..c551f8984 100644
--- a/clutter/clutter/meson.build
+++ b/clutter/clutter/meson.build
@@ -127,6 +127,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',
@@ -191,6 +192,7 @@ clutter_private_headers = [
   'clutter-effect-private.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]