Commit 2f4a68c8 authored by Jonas Ådahl's avatar Jonas Ådahl

Clean up include macros mess

The order and way include macros were structured was chaotic, with no
real common thread between files. Try to tidy up the mess with some
common scheme, to make things look less messy.
parent 92f4ffc0
......@@ -20,10 +20,6 @@ AM_CPPFLAGS = \
$(MUTTER_NATIVE_BACKEND_CFLAGS) \
-I$(builddir) \
-I$(srcdir) \
-I$(srcdir)/backends \
-I$(srcdir)/core \
-I$(srcdir)/ui \
-I$(srcdir)/compositor \
-I$(top_srcdir)/cogl \
-I$(top_srcdir)/cogl/cogl \
-I$(top_srcdir)/cogl/cogl/winsys \
......
......@@ -22,12 +22,15 @@
/* Author: Soren Sandmann <sandmann@redhat.com> */
#include "edid.h"
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <glib.h>
#include "backends/edid.h"
static int
get_bit (int in, int bit)
{
......
......@@ -27,24 +27,25 @@
#define META_BACKEND_PRIVATE_H
#include <glib-object.h>
#include <xkbcommon/xkbcommon.h>
#include <meta/meta-backend.h>
#include <meta/meta-idle-monitor.h>
#include "meta-cursor-renderer.h"
#include "meta-monitor-manager-private.h"
#include "meta-orientation-manager.h"
#include "meta-input-settings-private.h"
#include "meta/meta-backend.h"
#include "meta/meta-idle-monitor.h"
#include "backends/meta-backend-types.h"
#include "backends/meta-cursor-renderer.h"
#include "backends/meta-egl.h"
#include "backends/meta-input-settings-private.h"
#include "backends/meta-monitor-manager-private.h"
#include "backends/meta-orientation-manager.h"
#include "backends/meta-pointer-constraint.h"
#ifdef HAVE_REMOTE_DESKTOP
#include "backends/meta-remote-desktop.h"
#endif
#include "backends/meta-renderer.h"
#include "backends/meta-settings-private.h"
#include "core/util-private.h"
#ifdef HAVE_REMOTE_DESKTOP
#include "backends/meta-remote-desktop.h"
#endif
#define DEFAULT_XKB_RULES_FILE "evdev"
#define DEFAULT_XKB_MODEL "pc105+inet"
......
/*
* Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2003 Rob Adams
* Copyright (C) 2004-2006 Elijah Newren
* Copyright (C) 2013-2018 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef META_BACKEND_TYPE_H
#define META_BACKEND_TYPE_H
typedef struct _MetaMonitorManager MetaMonitorManager;
typedef struct _MetaMonitorConfigManager MetaMonitorConfigManager;
typedef struct _MetaMonitorConfigStore MetaMonitorConfigStore;
typedef struct _MetaMonitorsConfig MetaMonitorsConfig;
typedef struct _MetaMonitor MetaMonitor;
typedef struct _MetaMonitorNormal MetaMonitorNormal;
typedef struct _MetaMonitorTiled MetaMonitorTiled;
typedef struct _MetaMonitorSpec MetaMonitorSpec;
typedef struct _MetaLogicalMonitor MetaLogicalMonitor;
typedef enum _MetaMonitorTransform
{
META_MONITOR_TRANSFORM_NORMAL,
META_MONITOR_TRANSFORM_90,
META_MONITOR_TRANSFORM_180,
META_MONITOR_TRANSFORM_270,
META_MONITOR_TRANSFORM_FLIPPED,
META_MONITOR_TRANSFORM_FLIPPED_90,
META_MONITOR_TRANSFORM_FLIPPED_180,
META_MONITOR_TRANSFORM_FLIPPED_270,
} MetaMonitorTransform;
typedef struct _MetaMonitorMode MetaMonitorMode;
typedef struct _MetaGpu MetaGpu;
typedef struct _MetaCrtc MetaCrtc;
typedef struct _MetaOutput MetaOutput;
typedef struct _MetaCrtcMode MetaCrtcMode;
typedef struct _MetaCrtcInfo MetaCrtcInfo;
typedef struct _MetaOutputInfo MetaOutputInfo;
typedef struct _MetaTileInfo MetaTileInfo;
typedef struct _MetaRenderer MetaRenderer;
typedef struct _MetaRendererView MetaRendererView;
#endif /* META_BACKEND_TYPE_H */
......@@ -24,34 +24,34 @@
#include "config.h"
#include "backends/meta-backend-private.h"
#include <stdlib.h>
#include <clutter/clutter-mutter.h>
#include <meta/meta-backend.h>
#include <meta/main.h>
#include <meta/util.h>
#include "meta-backend-private.h"
#include "meta-input-settings-private.h"
#include "backends/meta-cursor-tracker-private.h"
#include "backends/meta-idle-monitor-private.h"
#include "backends/meta-input-settings-private.h"
#include "backends/meta-logical-monitor.h"
#include "backends/meta-monitor-manager-dummy.h"
#include "backends/meta-settings-private.h"
#include "backends/meta-stage-private.h"
#include "backends/x11/meta-backend-x11.h"
#include "meta-cursor-tracker-private.h"
#include "meta-stage-private.h"
#include "clutter/clutter-mutter.h"
#include "meta/main.h"
#include "meta/meta-backend.h"
#include "meta/util.h"
#ifdef HAVE_REMOTE_DESKTOP
#include "backends/meta-dbus-session-watcher.h"
#include "backends/meta-screen-cast.h"
#include "backends/meta-remote-access-controller-private.h"
#include "backends/meta-remote-desktop.h"
#include "backends/meta-screen-cast.h"
#endif
#ifdef HAVE_NATIVE_BACKEND
#include "backends/native/meta-backend-native.h"
#endif
#include "backends/meta-idle-monitor-private.h"
#include "backends/meta-logical-monitor.h"
#include "backends/meta-monitor-manager-dummy.h"
#include "backends/meta-settings-private.h"
#define META_IDLE_MONITOR_CORE_DEVICE 0
enum
......
......@@ -27,6 +27,7 @@
#define META_BARRIER_PRIVATE_H
#include "core/meta-border.h"
#include "meta/barrier.h"
G_BEGIN_DECLS
......
......@@ -8,15 +8,20 @@
#include "config.h"
#include "meta/barrier.h"
#include "backends/meta-barrier-private.h"
#include <glib-object.h>
#include <meta/util.h>
#include <meta/barrier.h>
#include "backends/native/meta-backend-native.h"
#include "backends/native/meta-barrier-native.h"
#include "backends/x11/meta-backend-x11.h"
#include "backends/x11/meta-barrier-x11.h"
#include <meta/meta-enum-types.h>
#include "meta/meta-enum-types.h"
#include "meta/util.h"
#ifdef HAVE_NATIVE_BACKEND
#include "backends/native/meta-backend-native.h"
#include "backends/native/meta-barrier-native.h"
#endif
G_DEFINE_TYPE_WITH_PRIVATE (MetaBarrier, meta_barrier, G_TYPE_OBJECT)
G_DEFINE_TYPE (MetaBarrierImpl, meta_barrier_impl, G_TYPE_OBJECT)
......
......@@ -22,7 +22,8 @@
#include <glib-object.h>
#include "backends/meta-gpu.h"
#include "backends/meta-backend-types.h"
#include "meta/boxes.h"
/* Same as KMS mode flags and X11 randr flags */
typedef enum _MetaCrtcModeFlag
......
......@@ -24,16 +24,15 @@
#include "config.h"
#include "meta-cursor-renderer.h"
#include "backends/meta-cursor-renderer.h"
#include <meta/meta-backend.h>
#include <meta/util.h>
#include <math.h>
#include <cogl/cogl.h>
#include <clutter/clutter.h>
#include "meta-stage-private.h"
#include "backends/meta-stage-private.h"
#include "clutter/clutter.h"
#include "cogl/cogl.h"
#include "meta/meta-backend.h"
#include "meta/util.h"
struct _MetaCursorRendererPrivate
{
......
......@@ -27,7 +27,7 @@
#include <glib-object.h>
#include "meta-cursor.h"
#include "backends/meta-cursor.h"
#define META_TYPE_CURSOR_RENDERER (meta_cursor_renderer_get_type ())
G_DECLARE_DERIVABLE_TYPE (MetaCursorRenderer, meta_cursor_renderer,
......
......@@ -22,11 +22,10 @@
#ifndef META_CURSOR_TRACKER_PRIVATE_H
#define META_CURSOR_TRACKER_PRIVATE_H
#include <meta/meta-cursor-tracker.h>
#include "meta-cursor.h"
#include "meta-cursor-renderer.h"
#include "backends/meta-cursor.h"
#include "backends/meta-cursor-renderer.h"
#include "backends/x11/cm/meta-cursor-sprite-xfixes.h"
#include "meta/meta-cursor-tracker.h"
struct _MetaCursorTracker {
GObject parent_instance;
......
......@@ -28,21 +28,20 @@
*/
#include "config.h"
#include "meta-cursor-tracker-private.h"
#include <string.h>
#include <meta/main.h>
#include <meta/util.h>
#include <meta/meta-x11-errors.h>
#include <cogl/cogl.h>
#include <clutter/clutter.h>
#include "backends/meta-cursor-tracker-private.h"
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
#include <string.h>
#include "meta-backend-private.h"
#include "backends/meta-backend-private.h"
#include "backends/x11/cm/meta-cursor-sprite-xfixes.h"
#include "cogl/cogl.h"
#include "clutter/clutter.h"
#include "meta/main.h"
#include "meta/meta-x11-errors.h"
#include "meta/util.h"
#include "x11/meta-x11-display-private.h"
G_DEFINE_TYPE (MetaCursorTracker, meta_cursor_tracker, G_TYPE_OBJECT);
......
......@@ -21,7 +21,7 @@
#include "config.h"
#include "meta-cursor.h"
#include "backends/meta-cursor.h"
#include "backends/meta-backend-private.h"
#include "cogl/cogl.h"
......
......@@ -22,8 +22,8 @@
#ifndef META_CURSOR_H
#define META_CURSOR_H
#include <meta/common.h>
#include <meta/boxes.h>
#include "meta/common.h"
#include "meta/boxes.h"
#define META_TYPE_CURSOR_SPRITE (meta_cursor_sprite_get_type ())
G_DECLARE_DERIVABLE_TYPE (MetaCursorSprite,
......
......@@ -20,8 +20,11 @@
#ifndef META_DND_PRIVATE__H
#define META_DND_PRIVATE__H
#include <glib.h>
#include <X11/Xlib.h>
#include "backends/meta-backend-private.h"
gboolean meta_dnd_handle_xdnd_event (MetaBackend *backend,
MetaCompositor *compositor,
Display *xdisplay,
......
......@@ -24,17 +24,17 @@
#include "config.h"
#include "backends/meta-backend-private.h"
#include "backends/meta-egl.h"
#include "backends/meta-egl-ext.h"
#include "meta/util.h"
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <gio/gio.h>
#include <glib.h>
#include <glib-object.h>
#include "backends/meta-backend-private.h"
#include "backends/meta-egl.h"
#include "backends/meta-egl-ext.h"
#include "meta/util.h"
struct _MetaEgl
{
GObject parent;
......
......@@ -22,14 +22,15 @@
#include "config.h"
#include "meta-idle-monitor-dbus.h"
#include <meta/meta-idle-monitor.h>
#include <backends/meta-idle-monitor-private.h>
#include "meta-dbus-idle-monitor.h"
#include "backends/meta-idle-monitor-dbus.h"
#include "backends/meta-idle-monitor-private.h"
#include "clutter/clutter.h"
#include "meta/main.h"
#include "meta/meta-idle-monitor.h"
#include "meta/util.h"
#include <clutter/clutter.h>
#include <meta/util.h>
#include <meta/main.h> /* for meta_get_replace_current_wm () */
#include "meta-dbus-idle-monitor.h"
static gboolean
handle_get_idletime (MetaDBusIdleMonitor *skeleton,
......
......@@ -23,8 +23,8 @@
#ifndef META_IDLE_MONITOR_PRIVATE_H
#define META_IDLE_MONITOR_PRIVATE_H
#include <meta/meta-idle-monitor.h>
#include "display-private.h"
#include "core/display-private.h"
#include "meta/meta-idle-monitor.h"
typedef struct
{
......
......@@ -29,17 +29,17 @@
#include "config.h"
#include <string.h>
#include <clutter/clutter.h>
#include <X11/Xlib.h>
#include <X11/extensions/sync.h>
#include <meta/util.h>
#include <meta/main.h>
#include <meta/meta-idle-monitor.h>
#include "gsm-inhibitor-flag.h"
#include "meta-idle-monitor-private.h"
#include "meta-idle-monitor-dbus.h"
#include "meta-backend-private.h"
#include "backends/gsm-inhibitor-flag.h"
#include "backends/meta-backend-private.h"
#include "backends/meta-idle-monitor-private.h"
#include "backends/meta-idle-monitor-dbus.h"
#include "clutter/clutter.h"
#include "meta/main.h"
#include "meta/meta-idle-monitor.h"
#include "meta/util.h"
G_STATIC_ASSERT(sizeof(unsigned long) == sizeof(gpointer));
......
......@@ -22,15 +22,16 @@
#ifndef META_INPUT_SETTINGS_PRIVATE_H
#define META_INPUT_SETTINGS_PRIVATE_H
#include "display-private.h"
#include "meta-monitor-manager-private.h"
#include <clutter/clutter.h>
#include <gsettings-desktop-schemas/gdesktop-enums.h>
#ifdef HAVE_LIBWACOM
#include <libwacom/libwacom.h>
#endif
#include "backends/meta-backend-types.h"
#include "clutter/clutter.h"
#include "meta/display.h"
#define META_TYPE_INPUT_SETTINGS (meta_input_settings_get_type ())
G_DECLARE_DERIVABLE_TYPE (MetaInputSettings, meta_input_settings,
META, INPUT_SETTINGS, GObject)
......
......@@ -27,15 +27,15 @@
#include "config.h"
#include <glib/gi18n-lib.h>
#include <string.h>
#include "meta-backend-private.h"
#include "meta-input-settings-private.h"
#include "backends/meta-backend-private.h"
#include "backends/meta-input-settings-private.h"
#include "backends/meta-logical-monitor.h"
#include "backends/meta-monitor.h"
#include <glib/gi18n-lib.h>
#include <meta/util.h>
#include "core/display-private.h"
#include "meta/util.h"
static GQuark quark_tool_settings = 0;
......
......@@ -25,16 +25,16 @@
#include "config.h"
#include "meta-monitor-manager-dummy.h"
#include "backends/meta-monitor-manager-dummy.h"
#include <stdlib.h>
#include <meta/util.h>
#include "backends/meta-backend-private.h"
#include "backends/meta-crtc.h"
#include "backends/meta-monitor.h"
#include "backends/meta-monitor-config-manager.h"
#include "backends/meta-output.h"
#include "meta/util.h"
#define ALL_TRANSFORMS ((1 << (META_MONITOR_TRANSFORM_FLIPPED_270 + 1)) - 1)
......
......@@ -23,8 +23,8 @@
#ifndef META_MONITOR_MANAGER_DUMMY_H
#define META_MONITOR_MANAGER_DUMMY_H
#include "meta-monitor-manager-private.h"
#include "backends/meta-gpu.h"
#include "backends/meta-monitor-manager-private.h"
#define META_TYPE_MONITOR_MANAGER_DUMMY (meta_monitor_manager_dummy_get_type ())
G_DECLARE_FINAL_TYPE (MetaMonitorManagerDummy, meta_monitor_manager_dummy,
......
......@@ -38,34 +38,13 @@
#include <cogl/cogl.h>
#include <libgnome-desktop/gnome-pnp-ids.h>
#include "display-private.h"
#include "stack-tracker.h"
#include <meta/meta-monitor-manager.h>
#include "backends/meta-backend-private.h"
#include "backends/meta-cursor.h"
#include "backends/meta-display-config-shared.h"
#include "meta/display.h"
#include "meta/meta-monitor-manager.h"
#include "meta-display-config-shared.h"
#include "meta-dbus-display-config.h"
#include "meta-cursor.h"
typedef struct _MetaMonitorConfigManager MetaMonitorConfigManager;
typedef struct _MetaMonitorConfigStore MetaMonitorConfigStore;
typedef struct _MetaMonitorsConfig MetaMonitorsConfig;
typedef struct _MetaMonitor MetaMonitor;
typedef struct _MetaMonitorNormal MetaMonitorNormal;
typedef struct _MetaMonitorTiled MetaMonitorTiled;
typedef struct _MetaMonitorSpec MetaMonitorSpec;
typedef struct _MetaLogicalMonitor MetaLogicalMonitor;
typedef struct _MetaMonitorMode MetaMonitorMode;
typedef struct _MetaGpu MetaGpu;
typedef struct _MetaCrtc MetaCrtc;
typedef struct _MetaOutput MetaOutput;
typedef struct _MetaCrtcMode MetaCrtcMode;
typedef struct _MetaCrtcInfo MetaCrtcInfo;
typedef struct _MetaOutputInfo MetaOutputInfo;
typedef struct _MetaTileInfo MetaTileInfo;
#define META_MONITOR_MANAGER_MIN_SCREEN_WIDTH 640
#define META_MONITOR_MANAGER_MIN_SCREEN_HEIGHT 480
......@@ -93,18 +72,6 @@ typedef enum _MetaLogicalMonitorLayoutMode
META_LOGICAL_MONITOR_LAYOUT_MODE_PHYSICAL = 2
} MetaLogicalMonitorLayoutMode;
typedef enum
{
META_MONITOR_TRANSFORM_NORMAL,
META_MONITOR_TRANSFORM_90,
META_MONITOR_TRANSFORM_180,
META_MONITOR_TRANSFORM_270,
META_MONITOR_TRANSFORM_FLIPPED,
META_MONITOR_TRANSFORM_FLIPPED_90,
META_MONITOR_TRANSFORM_FLIPPED_180,
META_MONITOR_TRANSFORM_FLIPPED_270,
} MetaMonitorTransform;
/*
* MetaCrtcInfo:
*
......
......@@ -25,17 +25,13 @@
#include "config.h"
#include "meta-monitor-manager-private.h"
#include "backends/meta-monitor-manager-private.h"
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <clutter/clutter.h>
#include <meta/main.h>
#include "util-private.h"
#include <meta/meta-x11-errors.h>
#include "edid.h"
#include "backends/edid.h"
#include "backends/meta-backend-private.h"
#include "backends/meta-crtc.h"
#include "backends/meta-logical-monitor.h"
......@@ -44,7 +40,10 @@
#include "backends/meta-orientation-manager.h"
#include "backends/meta-output.h"
#include "backends/x11/meta-monitor-manager-xrandr.h"
#include "meta-backend-private.h"
#include "clutter/clutter.h"
#include "core/util-private.h"
#include "meta/main.h"
#include "meta/meta-x11-errors.h"
#define DEFAULT_DISPLAY_CONFIGURATION_TIMEOUT 20
......
......@@ -24,8 +24,8 @@
#include <glib-object.h>
#include "backends/meta-backend-types.h"
#include "backends/meta-crtc.h"
#include "backends/meta-monitor-manager-private.h"
#include "backends/meta-output.h"
typedef struct _MetaMonitorSpec
......
......@@ -21,10 +21,10 @@
#include "config.h"
#include <gio/gio.h>