diff --git a/src/backends/native/meta-backend-native-types.h b/src/backends/native/meta-backend-native-types.h index bfc506788..ba73b4a56 100644 --- a/src/backends/native/meta-backend-native-types.h +++ b/src/backends/native/meta-backend-native-types.h @@ -23,5 +23,7 @@ typedef struct _MetaBackendNative MetaBackendNative; typedef struct _MetaSeatNative MetaSeatNative; +typedef struct _MetaSeatImpl MetaSeatImpl; +typedef struct _MetaKeymapNative MetaKeymapNative; #endif /* META_BACKEND_NATIVE_TYPES_H */ diff --git a/src/backends/native/meta-backend-native.c b/src/backends/native/meta-backend-native.c index c397a7893..939885a64 100644 --- a/src/backends/native/meta-backend-native.c +++ b/src/backends/native/meta-backend-native.c @@ -36,6 +36,7 @@ #include "backends/native/meta-backend-native.h" #include "backends/native/meta-backend-native-private.h" +#include "backends/native/meta-input-thread.h" #include #include @@ -50,8 +51,6 @@ #include "backends/meta-stage-private.h" #include "backends/native/meta-clutter-backend-native.h" #include "backends/native/meta-event-native.h" -#include "backends/native/meta-input-device-native.h" -#include "backends/native/meta-input-settings-native.h" #include "backends/native/meta-kms.h" #include "backends/native/meta-kms-device.h" #include "backends/native/meta-launcher.h" diff --git a/src/backends/native/meta-event-native.c b/src/backends/native/meta-event-native.c index 61603d19e..8a1d8f348 100644 --- a/src/backends/native/meta-event-native.c +++ b/src/backends/native/meta-event-native.c @@ -21,7 +21,7 @@ #include "config.h" #include "backends/native/meta-event-native.h" -#include "backends/native/meta-input-device-native.h" +#include "backends/native/meta-input-thread.h" #include "clutter/clutter-mutter.h" typedef struct _MetaEventNative MetaEventNative; diff --git a/src/backends/native/meta-input-device-native.c b/src/backends/native/meta-input-device-native.c index 9aab8e070..2878675f2 100644 --- a/src/backends/native/meta-input-device-native.c +++ b/src/backends/native/meta-input-device-native.c @@ -25,9 +25,7 @@ #include #include "backends/meta-backend-private.h" -#include "backends/native/meta-input-device-tool-native.h" -#include "backends/native/meta-input-device-native.h" -#include "backends/native/meta-seat-impl.h" +#include "backends/native/meta-input-thread.h" #include "clutter/clutter-mutter.h" G_DEFINE_TYPE (MetaInputDeviceNative, diff --git a/src/backends/native/meta-input-device-native.h b/src/backends/native/meta-input-device-native.h index db28d0516..2000888dc 100644 --- a/src/backends/native/meta-input-device-native.h +++ b/src/backends/native/meta-input-device-native.h @@ -26,6 +26,10 @@ #ifndef META_INPUT_DEVICE_NATIVE_H #define META_INPUT_DEVICE_NATIVE_H +#ifndef META_INPUT_THREAD_H_INSIDE +#error "This header cannot be included directly. Use "backends/native/meta-input-thread.h"" +#endif /* META_INPUT_THREAD_H_INSIDE */ + #include #include "backends/meta-input-device-private.h" diff --git a/src/backends/native/meta-input-device-tool-native.c b/src/backends/native/meta-input-device-tool-native.c index ad6a3bdb6..e6ec0c758 100644 --- a/src/backends/native/meta-input-device-tool-native.c +++ b/src/backends/native/meta-input-device-tool-native.c @@ -19,7 +19,7 @@ #include "config.h" -#include "backends/native/meta-input-device-tool-native.h" +#include "backends/native/meta-input-thread.h" G_DEFINE_TYPE (MetaInputDeviceToolNative, meta_input_device_tool_native, CLUTTER_TYPE_INPUT_DEVICE_TOOL) diff --git a/src/backends/native/meta-input-device-tool-native.h b/src/backends/native/meta-input-device-tool-native.h index 3eff6261c..fa12358ad 100644 --- a/src/backends/native/meta-input-device-tool-native.h +++ b/src/backends/native/meta-input-device-tool-native.h @@ -20,6 +20,10 @@ #ifndef META_INPUT_DEVICE_NATIVE_TOOL_H #define META_INPUT_DEVICE_NATIVE_TOOL_H +#ifndef META_INPUT_THREAD_H_INSIDE +#error "This header cannot be included directly. Use "backends/native/meta-input-thread.h"" +#endif /* META_INPUT_THREAD_H_INSIDE */ + #include #include "clutter/clutter.h" diff --git a/src/backends/native/meta-input-settings-native.c b/src/backends/native/meta-input-settings-native.c index becf557db..3f9f71fe7 100644 --- a/src/backends/native/meta-input-settings-native.c +++ b/src/backends/native/meta-input-settings-native.c @@ -27,8 +27,7 @@ #include #include "backends/native/meta-backend-native.h" -#include "backends/native/meta-input-device-native.h" -#include "backends/native/meta-input-device-tool-native.h" +#include "backends/native/meta-input-thread.h" #include "backends/native/meta-input-settings-native.h" G_DEFINE_TYPE (MetaInputSettingsNative, meta_input_settings_native, META_TYPE_INPUT_SETTINGS) diff --git a/src/backends/native/meta-input-settings-native.h b/src/backends/native/meta-input-settings-native.h index 43926fd5f..cddd5b15f 100644 --- a/src/backends/native/meta-input-settings-native.h +++ b/src/backends/native/meta-input-settings-native.h @@ -22,6 +22,10 @@ #ifndef META_INPUT_SETTINGS_NATIVE_H #define META_INPUT_SETTINGS_NATIVE_H +#ifndef META_INPUT_THREAD_H_INSIDE +#error "This header cannot be included directly. Use "backends/native/meta-input-thread.h"" +#endif /* META_INPUT_THREAD_H_INSIDE */ + #include "backends/meta-input-settings-private.h" #define META_TYPE_INPUT_SETTINGS_NATIVE (meta_input_settings_native_get_type ()) diff --git a/src/backends/native/meta-input-thread.h b/src/backends/native/meta-input-thread.h new file mode 100644 index 000000000..196adc27b --- /dev/null +++ b/src/backends/native/meta-input-thread.h @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2020 Red Hat Inc. + * + * 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 . + * + * Author: Carlos Garnacho + */ + +#ifndef META_INPUT_THREAD_H +#define META_INPUT_THREAD_H + +#define META_INPUT_THREAD_H_INSIDE + +#include "src/backends/native/meta-input-device-native.h" +#include "src/backends/native/meta-input-device-tool-native.h" +#include "src/backends/native/meta-input-settings-native.h" +#include "src/backends/native/meta-keymap-native.h" +#include "src/backends/native/meta-seat-impl.h" + +#undef META_INPUT_THREAD_H_INSIDE + +#endif /* META_INPUT_THREAD_H */ diff --git a/src/backends/native/meta-keymap-native.c b/src/backends/native/meta-keymap-native.c index 036eb6b4d..d3348e8a9 100644 --- a/src/backends/native/meta-keymap-native.c +++ b/src/backends/native/meta-keymap-native.c @@ -22,7 +22,7 @@ #include "config.h" #include "backends/meta-keymap-utils.h" -#include "backends/native/meta-keymap-native.h" +#include "backends/native/meta-input-thread.h" #include "backends/native/meta-seat-native.h" static const char *option_xkb_layout = "us"; diff --git a/src/backends/native/meta-keymap-native.h b/src/backends/native/meta-keymap-native.h index 49da0775d..6a6b12d9a 100644 --- a/src/backends/native/meta-keymap-native.h +++ b/src/backends/native/meta-keymap-native.h @@ -21,6 +21,10 @@ #ifndef META_KEYMAP_NATIVE_H #define META_KEYMAP_NATIVE_H +#ifndef META_INPUT_THREAD_H_INSIDE +#error "This header cannot be included directly. Use "backends/native/meta-input-thread.h"" +#endif /* META_INPUT_THREAD_H_INSIDE */ + #include "backends/native/meta-xkb-utils.h" #include "clutter/clutter.h" diff --git a/src/backends/native/meta-launcher.c b/src/backends/native/meta-launcher.c index c794563ef..190d0fa88 100644 --- a/src/backends/native/meta-launcher.c +++ b/src/backends/native/meta-launcher.c @@ -39,8 +39,8 @@ #include "backends/native/meta-backend-native.h" #include "backends/native/meta-clutter-backend-native.h" #include "backends/native/meta-cursor-renderer-native.h" +#include "backends/native/meta-input-thread.h" #include "backends/native/meta-renderer-native.h" -#include "backends/native/meta-seat-native.h" #include "clutter/clutter.h" #include "meta-dbus-login1.h" diff --git a/src/backends/native/meta-seat-impl.c b/src/backends/native/meta-seat-impl.c index 2075ddd34..f5e45e5d0 100644 --- a/src/backends/native/meta-seat-impl.c +++ b/src/backends/native/meta-seat-impl.c @@ -27,8 +27,6 @@ #include "config.h" -#include "backends/native/meta-seat-impl.h" - #include #include #include @@ -38,10 +36,7 @@ #include "backends/meta-cursor-tracker-private.h" #include "backends/native/meta-barrier-native.h" #include "backends/native/meta-event-native.h" -#include "backends/native/meta-input-device-native.h" -#include "backends/native/meta-input-device-tool-native.h" -#include "backends/native/meta-input-settings-native.h" -#include "backends/native/meta-keymap-native.h" +#include "backends/native/meta-input-thread.h" #include "backends/native/meta-virtual-input-device-native.h" #include "clutter/clutter-mutter.h" #include "core/bell.h" diff --git a/src/backends/native/meta-seat-impl.h b/src/backends/native/meta-seat-impl.h index ac5b7e42d..ab0ef75d3 100644 --- a/src/backends/native/meta-seat-impl.h +++ b/src/backends/native/meta-seat-impl.h @@ -23,6 +23,10 @@ #ifndef META_SEAT_IMPL_H #define META_SEAT_IMPL_H +#ifndef META_INPUT_THREAD_H_INSIDE +#error "This header cannot be included directly. Use "backends/native/meta-input-thread.h"" +#endif /* META_INPUT_THREAD_H_INSIDE */ + #include #include #include diff --git a/src/backends/native/meta-seat-native.c b/src/backends/native/meta-seat-native.c index 432b0fc00..73abb9052 100644 --- a/src/backends/native/meta-seat-native.c +++ b/src/backends/native/meta-seat-native.c @@ -32,8 +32,7 @@ #include "backends/meta-keymap-utils.h" #include "backends/native/meta-barrier-native.h" #include "backends/native/meta-event-native.h" -#include "backends/native/meta-input-device-native.h" -#include "backends/native/meta-input-device-tool-native.h" +#include "backends/native/meta-input-thread.h" #include "backends/native/meta-keymap-native.h" #include "backends/native/meta-virtual-input-device-native.h" #include "clutter/clutter-mutter.h" diff --git a/src/backends/native/meta-seat-native.h b/src/backends/native/meta-seat-native.h index 4f7c30e46..7f94828d0 100644 --- a/src/backends/native/meta-seat-native.h +++ b/src/backends/native/meta-seat-native.h @@ -27,12 +27,12 @@ #include #include +#include "backends/meta-input-settings-private.h" #include "backends/meta-viewport-info.h" +#include "backends/native/meta-backend-native-types.h" #include "backends/native/meta-barrier-native.h" #include "backends/native/meta-cursor-renderer-native.h" -#include "backends/native/meta-keymap-native.h" #include "backends/native/meta-pointer-constraint-native.h" -#include "backends/native/meta-seat-impl.h" #include "backends/native/meta-xkb-utils.h" #include "clutter/clutter.h" diff --git a/src/backends/native/meta-virtual-input-device-native.c b/src/backends/native/meta-virtual-input-device-native.c index 39caa8b09..9291d3f3d 100644 --- a/src/backends/native/meta-virtual-input-device-native.c +++ b/src/backends/native/meta-virtual-input-device-native.c @@ -22,8 +22,7 @@ #include #include -#include "backends/native/meta-input-device-native.h" -#include "backends/native/meta-keymap-native.h" +#include "backends/native/meta-input-thread.h" #include "backends/native/meta-seat-native.h" #include "backends/native/meta-virtual-input-device-native.h" #include "clutter/clutter-mutter.h"