From 7d116bee0fbe2f2037b8b50079471e4e5ee43ef7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Tue, 2 Mar 2021 10:21:20 +0100 Subject: [PATCH] main: Move MetaX11DisplayPolicy to a new meta-private-enums.h As with the compositor type enum, also have the X11 display policy enum, as it's also effectively part of the context configuration. But as with the compositor type, move it to a header file for enums only, and since this is a private one, create a private variant meta-enums.h. Part-of: --- src/backends/meta-backend-private.h | 1 + src/backends/meta-backend.c | 1 + src/core/main-private.h | 8 +------- src/core/meta-private-enums.h | 31 +++++++++++++++++++++++++++++ src/meson.build | 1 + src/tests/clutter-test-utils.c | 2 +- src/wayland/meta-wayland.c | 1 + src/wayland/meta-wayland.h | 1 + 8 files changed, 38 insertions(+), 8 deletions(-) create mode 100644 src/core/meta-private-enums.h diff --git a/src/backends/meta-backend-private.h b/src/backends/meta-backend-private.h index bce77c2ec..d2b210498 100644 --- a/src/backends/meta-backend-private.h +++ b/src/backends/meta-backend-private.h @@ -41,6 +41,7 @@ #include "backends/meta-pointer-constraint.h" #include "backends/meta-renderer.h" #include "backends/meta-settings-private.h" +#include "core/meta-context-private.h" #include "core/util-private.h" #define DEFAULT_XKB_RULES_FILE "evdev" diff --git a/src/backends/meta-backend.c b/src/backends/meta-backend.c index bf3c7d7a6..5b785ab40 100644 --- a/src/backends/meta-backend.c +++ b/src/backends/meta-backend.c @@ -66,6 +66,7 @@ #include "backends/x11/meta-backend-x11.h" #include "clutter/clutter-mutter.h" #include "clutter/clutter-seat-private.h" +#include "core/meta-context-private.h" #include "meta/main.h" #include "meta/meta-backend.h" #include "meta/meta-context.h" diff --git a/src/core/main-private.h b/src/core/main-private.h index 95eee4571..e35efe8fe 100644 --- a/src/core/main-private.h +++ b/src/core/main-private.h @@ -21,13 +21,7 @@ #define META_MAIN_PRIVATE_H #include "core/util-private.h" - -typedef enum _MetaX11DisplayPolicy -{ - META_X11_DISPLAY_POLICY_MANDATORY, - META_X11_DISPLAY_POLICY_ON_DEMAND, - META_X11_DISPLAY_POLICY_DISABLED, -} MetaX11DisplayPolicy; +#include "core/meta-private-enums.h" META_EXPORT_TEST MetaX11DisplayPolicy meta_get_x11_display_policy (void); diff --git a/src/core/meta-private-enums.h b/src/core/meta-private-enums.h new file mode 100644 index 000000000..1a361c782 --- /dev/null +++ b/src/core/meta-private-enums.h @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2019-2021 Red Hat Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + */ + +#ifndef META_PRIVATE_ENUMS_H +#define META_PRIVATE_ENUMS_H + +typedef enum _MetaX11DisplayPolicy +{ + META_X11_DISPLAY_POLICY_MANDATORY, + META_X11_DISPLAY_POLICY_ON_DEMAND, + META_X11_DISPLAY_POLICY_DISABLED, +} MetaX11DisplayPolicy; + +#endif /* META_PRIVATE_ENUMS_H */ diff --git a/src/meson.build b/src/meson.build index aba2dc952..fc64f7aa1 100644 --- a/src/meson.build +++ b/src/meson.build @@ -384,6 +384,7 @@ mutter_sources = [ 'core/meta-inhibit-shortcuts-dialog-default-private.h', 'core/meta-launch-context.c', 'core/meta-pad-action-mapper.c', + 'core/meta-private-enums.h', 'core/meta-selection.c', 'core/meta-selection-source.c', 'core/meta-selection-source-memory.c', diff --git a/src/tests/clutter-test-utils.c b/src/tests/clutter-test-utils.c index 800664cd4..de4b94e23 100644 --- a/src/tests/clutter-test-utils.c +++ b/src/tests/clutter-test-utils.c @@ -5,7 +5,7 @@ #include #include "compositor/meta-plugin-manager.h" -#include "core/main-private.h" +#include "core/meta-context-private.h" typedef struct { gpointer dummy_field; diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c index d96b60fe2..4431fcc19 100644 --- a/src/wayland/meta-wayland.c +++ b/src/wayland/meta-wayland.c @@ -32,6 +32,7 @@ #include "cogl/cogl-egl.h" #include "compositor/meta-surface-actor-wayland.h" #include "core/main-private.h" +#include "core/meta-context-private.h" #include "wayland/meta-wayland-activation.h" #include "wayland/meta-wayland-buffer.h" #include "wayland/meta-wayland-data-device.h" diff --git a/src/wayland/meta-wayland.h b/src/wayland/meta-wayland.h index 38700cedd..84e4ccb03 100644 --- a/src/wayland/meta-wayland.h +++ b/src/wayland/meta-wayland.h @@ -24,6 +24,7 @@ #define META_WAYLAND_H #include "clutter/clutter.h" +#include "core/meta-context-private.h" #include "core/util-private.h" #include "meta/types.h" #include "wayland/meta-wayland-types.h"