build: Add a new fonts option

Allowing to disable font rendering integration, making it possible to
build Mutter without pango/harfbuzz/fribidi dependencies.

This commit also adds a new clutter-pango header that is used to include
pango specific bits.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106>
This commit is contained in:
Bilal Elmoussaoui 2024-11-12 14:17:34 +01:00 committed by Marge Bot
parent b0b1e0ef4e
commit 32c5faf010
41 changed files with 300 additions and 79 deletions

View File

@ -31,6 +31,9 @@
#include "clutter/clutter-stage-manager-accessible-private.h"
#include "clutter/clutter.h"
#include "clutter/clutter-private.h"
#ifdef HAVE_FONTS
#include "clutter/clutter-pango.h"
#endif
#define DEFAULT_PASSWORD_CHAR '*'
@ -243,9 +246,11 @@ check_key_visibility (ClutterStage *stage)
still better fill this with a default unichar that the original
one */
#ifdef HAVE_FONTS
if (CLUTTER_IS_TEXT (focus))
return clutter_text_get_password_char (CLUTTER_TEXT (focus));
else
#endif
return DEFAULT_PASSWORD_CHAR;
}

View File

@ -482,13 +482,18 @@
#include <math.h>
#include <gobject/gvaluecollector.h>
#ifdef HAVE_FONTS
#include <pango/pangocairo.h>
#endif
#include "cogl/cogl.h"
#include "clutter/clutter-actor-private.h"
#ifdef HAVE_FONTS
#include "clutter/pango/clutter-actor-pango.h"
#include "clutter/pango/clutter-pango-private.h"
#endif
#include "clutter/clutter-action.h"
#include "clutter/clutter-action-private.h"
#include "clutter/clutter-actor-meta-private.h"
@ -611,7 +616,9 @@ struct _ClutterActorPrivate
/* a back-pointer to the Pango context that we can use
* to create pre-configured PangoLayout
*/
#ifdef HAVE_FONTS
PangoContext *pango_context;
#endif
/* the text direction configured for this child - either by
* application code, or by the actor's parent
@ -5361,7 +5368,9 @@ clutter_actor_dispose (GObject *object)
g_clear_pointer (&priv->accessible_name, g_free);
#ifdef HAVE_FONTS
g_clear_object (&priv->pango_context);
#endif
g_clear_object (&priv->actions);
g_clear_object (&priv->color_state);
g_clear_object (&priv->constraints);
@ -12997,6 +13006,7 @@ clutter_actor_grab_key_focus (ClutterActor *self)
clutter_stage_set_key_focus (CLUTTER_STAGE (stage), self);
}
#ifdef HAVE_FONTS
static void
update_pango_context (ClutterBackend *backend,
PangoContext *context)
@ -13146,6 +13156,7 @@ clutter_actor_create_pango_layout (ClutterActor *self,
return layout;
}
#endif
/**
* clutter_actor_set_opacity_override:

View File

@ -30,9 +30,8 @@
/* clutter-actor.h */
#include <gio/gio.h>
#include <pango/pango.h>
#include <atk/atk.h>
#include <gio/gio.h>
#include "cogl/cogl.h"
@ -614,14 +613,6 @@ gboolean clutter_actor_event
CLUTTER_EXPORT
gboolean clutter_actor_has_pointer (ClutterActor *self);
/* Text */
CLUTTER_EXPORT
PangoContext * clutter_actor_get_pango_context (ClutterActor *self);
CLUTTER_EXPORT
PangoContext * clutter_actor_create_pango_context (ClutterActor *self);
CLUTTER_EXPORT
PangoLayout * clutter_actor_create_pango_layout (ClutterActor *self,
const gchar *text);
CLUTTER_EXPORT
void clutter_actor_set_text_direction (ClutterActor *self,
ClutterTextDirection text_dir);

View File

@ -39,7 +39,9 @@
#include "config.h"
#ifdef HAVE_FONTS
#include <pango/pangocairo.h>
#endif
#include "clutter/clutter-backend-private.h"
#include "clutter/clutter-context-private.h"
@ -137,6 +139,7 @@ clutter_backend_set_property (GObject *object,
}
}
#ifdef HAVE_FONTS
static void
clutter_backend_real_resolution_changed (ClutterBackend *backend)
{
@ -156,6 +159,7 @@ clutter_backend_real_resolution_changed (ClutterBackend *backend)
pango_cairo_font_map_set_resolution (PANGO_CAIRO_FONT_MAP (context->font_map),
resolution);
}
#endif
static gboolean
clutter_backend_real_create_context (ClutterBackend *backend,
@ -269,7 +273,9 @@ clutter_backend_class_init (ClutterBackendClass *klass)
g_object_class_install_properties (gobject_class, N_PROPS, pspecs);
#ifdef HAVE_FONTS
klass->resolution_changed = clutter_backend_real_resolution_changed;
#endif
klass->create_context = clutter_backend_real_create_context;
}

View File

@ -19,7 +19,9 @@
#pragma once
#ifdef HAVE_FONTS
#include <pango/pango.h>
#endif
#include "clutter/clutter-context.h"
#include "clutter-stage-manager-private.h"
@ -37,8 +39,10 @@ struct _ClutterContext
* ordered from least recently added to most recently added */
GList *event_filters;
#ifdef HAVE_FONTS
PangoRenderer *font_renderer;
PangoFontMap *font_map;
#endif
GSList *current_event;
@ -54,9 +58,11 @@ ClutterStageManager * clutter_context_get_stage_manager (ClutterContext *context
gboolean clutter_context_get_show_fps (ClutterContext *context);
#ifdef HAVE_FONTS
PangoRenderer * clutter_context_get_font_renderer (ClutterContext *context);
/**
* clutter_context_get_pango_fontmap: (skip)
*/
PangoFontMap * clutter_context_get_pango_fontmap (ClutterContext *context);
#endif

View File

@ -20,8 +20,10 @@
#include "clutter/clutter-context-private.h"
#ifdef HAVE_FONTS
#include <hb-glib.h>
#include <pango/pangocairo.h>
#endif
#include "clutter/clutter-accessibility-private.h"
#include "clutter/clutter-backend-private.h"
@ -31,7 +33,9 @@
#include "clutter/clutter-private.h"
#include "clutter/clutter-paint-node-private.h"
#include "clutter/clutter-settings-private.h"
#ifdef HAVE_FONTS
#include "clutter/pango/clutter-pango-private.h"
#endif
static gboolean clutter_show_fps = FALSE;
static gboolean clutter_enable_accessibility = TRUE;
@ -101,7 +105,9 @@ clutter_context_dispose (GObject *object)
g_clear_pointer (&context->backend, clutter_backend_destroy);
g_clear_object (&context->stage_manager);
g_clear_object (&context->settings);
#ifdef HAVE_FONTS
g_clear_object (&context->font_map);
#endif
G_OBJECT_CLASS (clutter_context_parent_class)->dispose (object);
}
@ -138,6 +144,7 @@ clutter_get_text_direction (void)
else if (strcmp (direction, "ltr") == 0)
dir = CLUTTER_TEXT_DIRECTION_LTR;
}
#ifdef HAVE_FONTS
else
{
PangoLanguage *language;
@ -163,6 +170,7 @@ clutter_get_text_direction (void)
continue;
}
}
#endif
CLUTTER_NOTE (MISC, "Text direction: %s",
dir == CLUTTER_TEXT_DIRECTION_RTL ? "rtl" : "ltr");
@ -306,6 +314,7 @@ clutter_context_get_backend (ClutterContext *context)
return context->backend;
}
#ifdef HAVE_FONTS
PangoFontMap *
clutter_context_get_pango_fontmap (ClutterContext *context)
{
@ -333,6 +342,15 @@ clutter_context_get_pango_fontmap (ClutterContext *context)
return context->font_map;
}
PangoRenderer *
clutter_context_get_font_renderer (ClutterContext *context)
{
g_return_val_if_fail (CLUTTER_IS_CONTEXT (context), NULL);
return context->font_renderer;
}
#endif
ClutterTextDirection
clutter_context_get_text_direction (ClutterContext *context)
{
@ -392,11 +410,3 @@ clutter_context_get_settings (ClutterContext *context)
return context->settings;
}
PangoRenderer *
clutter_context_get_font_renderer (ClutterContext *context)
{
g_return_val_if_fail (CLUTTER_IS_CONTEXT (context), NULL);
return context->font_renderer;
}

View File

@ -0,0 +1,32 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Copyright (C) 2024 Red Hat
*
* 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/>.
*
*/
#pragma once
#define __CLUTTER_H_INSIDE__
#include "clutter/pango/clutter-actor-pango.h"
#include "clutter/pango/clutter-text.h"
#include "clutter/pango/clutter-text-buffer.h"
#include "clutter/pango/clutter-text-node.h"
#undef __CLUTTER_H_INSIDE__

View File

@ -41,7 +41,10 @@
#include "clutter/clutter-stage.h"
#ifdef HAVE_FONTS
#include "clutter/pango/clutter-actor-pango.h"
#include "clutter/pango/clutter-text-node.h"
#endif
#include "clutter/clutter-stage-accessible-private.h"
#include "clutter/clutter-action-private.h"
#include "clutter/clutter-actor-private.h"
@ -1427,10 +1430,13 @@ static void
clutter_stage_paint (ClutterActor *actor,
ClutterPaintContext *paint_context)
{
#ifdef HAVE_FONTS
ClutterStageView *view;
#endif
CLUTTER_ACTOR_CLASS (clutter_stage_parent_class)->paint (actor, paint_context);
#ifdef HAVE_FONTS
view = clutter_paint_context_get_stage_view (paint_context);
if (view &&
G_UNLIKELY (clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_MAX_RENDER_TIME))
@ -1465,6 +1471,7 @@ clutter_stage_paint (ClutterActor *actor,
g_object_unref (layout);
}
#endif
}
static void

View File

@ -105,8 +105,4 @@
#include "clutter/clutter-virtual-input-device.h"
#include "clutter/clutter-zoom-action.h"
#include "clutter/pango/clutter-text.h"
#include "clutter/pango/clutter-text-buffer.h"
#include "clutter/pango/clutter-text-node.h"
#undef __CLUTTER_H_INSIDE__

View File

@ -2,9 +2,6 @@ clutter_clutter_includesubdir = clutter_includesubdir / 'clutter'
clutter_clutter_includedir = clutter_includedir / 'clutter'
clutter_headers = [
'pango/clutter-text.h',
'pango/clutter-text-buffer.h',
'pango/clutter-text-node.h',
'clutter.h',
'clutter-action.h',
'clutter-actor-accessible.h',
@ -83,14 +80,6 @@ clutter_headers = [
]
clutter_sources = [
'pango/clutter-pango-display-list.c',
'pango/clutter-pango-glyph-cache.c',
'pango/clutter-pango-pipeline-cache.c',
'pango/clutter-pango-render.c',
'pango/clutter-text.c',
'pango/clutter-text-accessible.c',
'pango/clutter-text-buffer.c',
'pango/clutter-text-node.c',
'clutter-accessibility.c',
'clutter-action.c',
'clutter-actor-box.c',
@ -182,11 +171,6 @@ clutter_sources = [
]
clutter_private_headers = [
'pango/clutter-pango-display-list.h',
'pango/clutter-pango-glyph-cache.h',
'pango/clutter-pango-pipeline-cache.h',
'pango/clutter-pango-private.h',
'pango/clutter-text-accessible-private.h',
'clutter-accessibility-private.h',
'clutter-actor-meta-private.h',
'clutter-actor-private.h',
@ -224,6 +208,40 @@ clutter_private_headers = [
'clutter-timeline-private.h',
]
clutter_fonts_headers = [
'pango/clutter-actor-pango.h',
'pango/clutter-text.h',
'pango/clutter-text-buffer.h',
'pango/clutter-text-node.h',
]
clutter_fonts_sources = [
'pango/clutter-pango-display-list.c',
'pango/clutter-pango-glyph-cache.c',
'pango/clutter-pango-pipeline-cache.c',
'pango/clutter-pango-render.c',
'pango/clutter-text.c',
'pango/clutter-text-accessible.c',
'pango/clutter-text-buffer.c',
'pango/clutter-text-node.c',
]
clutter_fonts_private_headers = [
'pango/clutter-pango-display-list.h',
'pango/clutter-pango-glyph-cache.h',
'pango/clutter-pango-pipeline-cache.h',
'pango/clutter-pango-private.h',
'pango/clutter-text-accessible-private.h',
]
if have_fonts
clutter_sources += clutter_fonts_sources
clutter_private_headers += clutter_fonts_private_headers
clutter_headers += [
'clutter-pango.h',
]
endif
clutter_nonintrospected_sources = [
'clutter-easing.c',
]
@ -254,16 +272,23 @@ clutter_marshal = gnome.genmarshal('clutter-marshal',
clutter_built_sources += clutter_marshal[0]
clutter_built_headers += clutter_marshal[1]
sources = [
clutter_sources,
clutter_headers,
clutter_private_headers,
clutter_nonintrospected_sources,
clutter_built_sources,
clutter_built_headers,
]
if have_fonts
sources += clutter_fonts_headers
endif
libmutter_clutter_name = 'mutter-clutter-' + libmutter_api_version
libmutter_clutter = shared_library(libmutter_clutter_name,
sources: [
clutter_sources,
clutter_headers,
clutter_private_headers,
clutter_nonintrospected_sources,
clutter_built_sources,
clutter_built_headers,
],
sources: sources,
version: '0.0.0',
soversion: 0,
c_args: clutter_c_args,
@ -290,13 +315,25 @@ if have_introspection
'-DG_LOG_DOMAIN="Clutter"'
]
extra_args = clutter_introspection_args + ['--c-include=clutter/clutter.h']
if have_fonts
extra_args += [
'--c-include=clutter/clutter-pango.h'
]
endif
sources = [
clutter_built_sources,
clutter_built_headers,
clutter_sources,
clutter_headers,
]
if have_fonts
sources += [clutter_fonts_headers]
endif
libmutter_clutter_gir = gnome.generate_gir(libmutter_clutter,
sources: [
clutter_built_sources,
clutter_built_headers,
clutter_sources,
clutter_headers,
],
sources: sources,
nsversion: libmutter_api_version,
namespace: 'Clutter',
export_packages: [libmutter_clutter_name],
@ -311,7 +348,7 @@ if have_introspection
'Pango-1.0',
],
dependencies: [cogl_deps],
extra_args: clutter_introspection_args + ['--c-include=clutter/clutter.h'],
extra_args: extra_args,
kwargs: introspection_common,
)
endif
@ -319,6 +356,11 @@ endif
install_headers(clutter_headers,
subdir: clutter_clutter_includesubdir)
if have_fonts
install_headers(clutter_fonts_headers,
subdir: clutter_clutter_includesubdir / 'pango')
endif
pkg.generate(libmutter_clutter,
name: 'Mutters Clutter',
filebase: libmutter_clutter_name,

View File

@ -0,0 +1,44 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Copyright (C) 2024 Red Hat
*
* 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/>.
*/
#pragma once
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#include <pango/pango.h>
#include "clutter/clutter-types.h"
G_BEGIN_DECLS
CLUTTER_EXPORT
PangoContext * clutter_actor_get_pango_context (ClutterActor *self);
CLUTTER_EXPORT
PangoContext * clutter_actor_create_pango_context (ClutterActor *self);
CLUTTER_EXPORT
PangoLayout * clutter_actor_create_pango_layout (ClutterActor *self,
const gchar *text);
G_END_DECLS

View File

@ -47,6 +47,7 @@
#include "clutter/pango/clutter-text.h"
#include "clutter/pango/clutter-actor-pango.h"
#include "clutter/pango/clutter-pango-private.h"
#include "clutter/pango/clutter-text-accessible-private.h"
#include "clutter/pango/clutter-text-buffer.h"

View File

@ -28,17 +28,22 @@ clutter_pkg_deps = [
glib_dep,
gobject_dep,
gio_dep,
pango_dep,
harfbuzz_dep,
]
clutter_pkg_private_deps = [
fribidi_dep,
gthread_dep,
gmodule_no_export_dep,
pangocairo_dep,
]
if have_fonts
clutter_pkg_private_deps += [
fribidi_dep,
pangocairo_dep,
pango_dep,
harfbuzz_dep,
]
endif
clutter_deps = [
clutter_pkg_deps,
clutter_pkg_private_deps,

View File

@ -138,3 +138,6 @@
/* libdrm defines struct drm_plane_size_hint */
#mesondefine HAVE_DRM_PLANE_SIZE_HINT
/* Building with font rendering integration support */
#mesondefine HAVE_FONTS

View File

@ -111,11 +111,8 @@ subproject('gvdb')
m_dep = cc.find_library('m', required: true)
graphene_dep = dependency('graphene-gobject-1.0', version: graphene_req)
gdk_pixbuf_dep = dependency('gdk-pixbuf-2.0', version: gdk_pixbuf_req)
pango_dep = dependency('pango', version: pango_req)
cairo_dep = dependency('cairo', version: cairo_req)
pangocairo_dep = dependency('pangocairo', version: pangocairo_req)
pixman_dep = dependency('pixman-1', version: pixman_req)
fribidi_dep = dependency('fribidi', version: fribidi_req)
gsettings_desktop_schemas_dep = dependency('gsettings-desktop-schemas',
version: gsettings_desktop_schemas_req)
glib_dep = dependency('glib-2.0', version: glib_req)
@ -129,7 +126,6 @@ xkbcommon_dep = dependency('xkbcommon', version: xkbcommon_req)
atk_dep = dependency('atk', version: atk_req)
colord_dep = dependency('colord', version: colord_req)
lcms2_dep = dependency('lcms2', version: lcms2_req)
harfbuzz_dep = dependency('harfbuzz', version: harfbuzz_req)
libeis_dep = dependency('libeis-1.0', version: libei_req)
libei_dep = dependency('libei-1.0', version: libei_req)
gvdb_dep = dependency('gvdb')
@ -148,6 +144,18 @@ if not have_wayland and not have_x11
error('A Wayland/X11 backend must be enabled')
endif
have_fonts = get_option('fonts')
if have_fonts
pango_dep = dependency('pango', version: pango_req)
pangocairo_dep = dependency('pangocairo', version: pangocairo_req)
harfbuzz_dep = dependency('harfbuzz', version: harfbuzz_req)
endif
if have_fonts or have_x11
fribidi_dep = dependency('fribidi', version: fribidi_req)
endif
if have_x11_client
gtk4_dep = dependency('gtk4', version: gtk4_req)
@ -566,6 +574,7 @@ cdata.set('HAVE_PROFILER', have_profiler)
cdata.set('HAVE_TIMERFD', have_timerfd)
cdata.set('HAVE_MALLOC_TRIM', have_malloc_trim)
cdata.set('HAVE_EVENTFD', have_eventfd)
cdata.set('HAVE_FONTS', have_fonts)
cdata.set('HAVE_DRM_PLANE_SIZE_HINT', have_drm_plane_size_hint)
if have_x11_client
@ -738,6 +747,7 @@ summary('Sound player', have_sound_player, section: 'Options')
summary('gudev', have_libgudev, section: 'Options')
summary('Wacom', have_libwacom, section: 'Options')
summary('SM', have_sm, section: 'Options')
summary('Fonts', have_fonts, section: 'Options')
summary('Startup notification', have_startup_notification, section: 'Options')
summary('Introspection', have_introspection, section: 'Options')
summary('Documentation', have_documentation, section: 'Options')

View File

@ -218,3 +218,9 @@ option('catch',
value: false,
description: 'Use catch to catch backtraces'
)
option('fonts',
type: 'boolean',
value: true,
description: 'Enable font rendering integration using Pango'
)

View File

@ -1355,6 +1355,7 @@ pkg.generate(libmutter,
'have_x11=@0@'.format(have_x11),
'have_x11_client=@0@'.format(have_x11_client),
'have_wayland=@0@'.format(have_wayland),
'have_fonts=@0@'.format(have_fonts),
],
install_dir: pcdir,
)

View File

@ -20,6 +20,7 @@
#include <atk/atk.h>
#include <clutter/clutter.h>
#include <clutter/clutter-pango.h>
#include "cally-examples-util.h"

View File

@ -29,6 +29,7 @@
*/
#include <atk/atk.h>
#include <clutter/clutter.h>
#include <clutter/clutter-pango.h>
#include "cally-examples-util.h"

View File

@ -20,6 +20,7 @@
#include <atk/atk.h>
#include <clutter/clutter.h>
#include <clutter/clutter-pango.h>
#include "cally-examples-util.h"

View File

@ -20,6 +20,7 @@
#include <atk/atk.h>
#include <clutter/clutter.h>
#include <clutter/clutter-pango.h>
#include "cally-examples-util.h"

View File

@ -16,12 +16,17 @@ clutter_accessibility_tests_dependencies = [
clutter_accessibility_tests = [
'cally-atkcomponent-example',
'cally-atktext-example',
'cally-atkevents-example',
'cally-atkeditabletext-example',
'cally-clone-example',
]
if have_fonts
clutter_accessibility_tests += [
'cally-atkeditabletext-example',
'cally-atkevents-example',
'cally-atktext-example',
'cally-clone-example',
]
endif
foreach test : clutter_accessibility_tests
executable(test,
sources: [

View File

@ -76,7 +76,7 @@ test_destroy_init (TestDestroy *self)
clutter_actor_add_child (CLUTTER_ACTOR (self), self->bg);
clutter_actor_set_name (self->bg, "Background");
self->label = clutter_text_new ();
self->label = clutter_actor_new ();
clutter_actor_add_child (CLUTTER_ACTOR (self), self->label);
clutter_actor_set_name (self->label, "Label");
}

View File

@ -1,4 +1,5 @@
#include <clutter/clutter.h>
#include <clutter/clutter-pango.h>
#include <stdlib.h>
#include "tests/clutter-test-utils.h"

View File

@ -1,4 +1,5 @@
#include <clutter/clutter.h>
#include <clutter/clutter-pango.h>
#include <string.h>
#include <stdlib.h>

View File

@ -20,16 +20,23 @@ clutter_conform_tests_actor_tests = [
'actor-layout',
'actor-meta',
'actor-offscreen-redirect',
'actor-paint-opacity',
'actor-pick',
'actor-pivot-point',
'actor-shader-effect',
'actor-size',
]
clutter_conform_tests_classes_tests = [
'text',
]
clutter_conform_tests_classes_tests = []
if have_fonts
clutter_conform_tests_actor_tests += [
'actor-paint-opacity',
]
clutter_conform_tests_classes_tests += [
'text',
]
endif
clutter_conform_tests_general_tests = [
'binding-pool',

View File

@ -1,4 +1,5 @@
#include <clutter/clutter.h>
#include <clutter/clutter-pango.h>
#include <string.h>
#include <stdlib.h>

View File

@ -1,5 +1,6 @@
#include <glib.h>
#include <clutter/clutter.h>
#include <clutter/clutter-pango.h>
#include <string.h>
#include "tests/clutter-test-utils.h"

View File

@ -1,4 +1,5 @@
#include <clutter/clutter.h>
#include <clutter/clutter-pango.h>
#include <cogl/cogl.h>
#include "test-conform-common.h"

View File

@ -17,15 +17,20 @@ clutter_tests_interactive_test_sources = [
'test-grab.c',
'test-animation.c',
'test-binding-pool.c',
'test-text.c',
'test-text-field.c',
'test-stage-sizing.c',
'test-swipe-action.c',
'test-cogl-point-sprites.c',
'test-content.c',
'test-keyframe-transition.c',
]
if have_fonts
clutter_tests_interactive_test_sources += [
'test-content.c',
'test-stage-sizing.c',
'test-swipe-action.c',
'test-text.c',
'test-text-field.c',
]
endif
gen_test_unit_names = find_program('meson/gen-test-unit-names.sh')
clutter_interactive_test_unit_names_h = custom_target('gen-test-unit-names',
output: 'test-unit-names.h',

View File

@ -1,6 +1,7 @@
#include <stdlib.h>
#include <gmodule.h>
#include <clutter/clutter.h>
#include <clutter/clutter-pango.h>
#include "tests/clutter-test-utils.h"

View File

@ -1,6 +1,7 @@
#include <stdlib.h>
#include <gmodule.h>
#include <clutter/clutter.h>
#include <clutter/clutter-pango.h>
#include "tests/clutter-test-utils.h"

View File

@ -1,5 +1,6 @@
#include <stdlib.h>
#include <clutter/clutter.h>
#include <clutter/clutter-pango.h>
#include "tests/clutter-test-utils.h"

View File

@ -1,6 +1,7 @@
#include <stdlib.h>
#include <gmodule.h>
#include <clutter/clutter.h>
#include <clutter/clutter-pango.h>
#include "tests/clutter-test-utils.h"

View File

@ -2,6 +2,7 @@
#include <gmodule.h>
#include <clutter/clutter.h>
#include <clutter/clutter-pango.h>
#include "tests/clutter-test-utils.h"

View File

@ -5,13 +5,18 @@ clutter_tests_micro_bench_c_args = [
clutter_tests_micro_bench_c_args += clutter_debug_c_args
clutter_tests_micro_bench_tests = [
'test-text',
'test-picking',
'test-text-perf',
'test-random-text',
'test-cogl-perf',
]
if have_fonts
clutter_tests_micro_bench_tests += [
'test-text',
'test-text-perf',
'test-random-text',
]
endif
foreach test : clutter_tests_micro_bench_tests
executable(test,
sources: [

View File

@ -1,5 +1,6 @@
#include <gmodule.h>
#include <clutter/clutter.h>
#include <clutter/clutter-pango.h>
#include <stdlib.h>
#include "tests/clutter-test-utils.h"

View File

@ -1,4 +1,5 @@
#include <clutter/clutter.h>
#include <clutter/clutter-pango.h>
#include <stdlib.h>
#include <string.h>

View File

@ -1,4 +1,5 @@
#include <clutter/clutter.h>
#include <clutter/clutter-pango.h>
#include <stdlib.h>
#include <string.h>

View File

@ -8,9 +8,14 @@ clutter_tests_performance_c_args += clutter_debug_c_args
clutter_tests_performance_tests = [
'test-picking',
'test-text-perf',
]
if have_fonts
clutter_tests_performance_tests += [
'test-text-perf',
]
endif
foreach test : clutter_tests_performance_tests
executable(test,
sources: [

View File

@ -1,4 +1,5 @@
#include <clutter/clutter.h>
#include <clutter/clutter-pango.h>
#include <stdlib.h>
#include <string.h>