From cb36a7363fbbe744f2a9c8b9a75012bab8fda43e Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Wed, 20 Feb 2019 10:28:17 -0300 Subject: [PATCH] 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(+) create mode 100644 clutter/clutter/clutter-graphene.c create mode 100644 clutter/clutter/clutter-graphene.h 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 + * + * 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 . + */ + +#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 + * + * 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 . + */ + +#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 71ec0d80c..eb37af6ad 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" @@ -2574,6 +2575,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 ff31a7c7d..8b276f4a4 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-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',