From b2405b701a82d5a4306ea75a6c3f63efa4a29949 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Sun, 30 Mar 2014 20:25:31 -0400 Subject: [PATCH] Move monitor manager headers to their own files Instead of having them in monitor-private.h. This way, it's easier to move our own backend when the chance arises. --- src/Makefile.am | 2 ++ src/core/meta-monitor-manager-kms.c | 3 +- src/core/meta-monitor-manager-kms.h | 40 ++++++++++++++++++++++++++ src/core/meta-monitor-manager-xrandr.c | 4 +-- src/core/meta-monitor-manager-xrandr.h | 40 ++++++++++++++++++++++++++ src/core/monitor-private.h | 24 ---------------- src/core/monitor.c | 2 ++ 7 files changed, 88 insertions(+), 27 deletions(-) create mode 100644 src/core/meta-monitor-manager-kms.h create mode 100644 src/core/meta-monitor-manager-xrandr.h diff --git a/src/Makefile.am b/src/Makefile.am index 4b5cf7498..df5e040bd 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -136,7 +136,9 @@ libmutter_wayland_la_SOURCES = \ core/monitor-config.c \ core/monitor-private.h \ core/meta-monitor-manager-kms.c \ + core/meta-monitor-manager-kms.h \ core/meta-monitor-manager-xrandr.c \ + core/meta-monitor-manager-xrandr.h \ core/mutter-Xatomtype.h \ core/place.c \ core/place.h \ diff --git a/src/core/meta-monitor-manager-kms.c b/src/core/meta-monitor-manager-kms.c index a44df83c2..698c60608 100644 --- a/src/core/meta-monitor-manager-kms.c +++ b/src/core/meta-monitor-manager-kms.c @@ -23,6 +23,8 @@ #include "config.h" +#include "meta-monitor-manager-kms.h" + #include #include #include @@ -36,7 +38,6 @@ #include #include -#include "monitor-private.h" #include "edid.h" #define ALL_WL_TRANSFORMS ((1 << (WL_OUTPUT_TRANSFORM_FLIPPED_270 + 1)) - 1) diff --git a/src/core/meta-monitor-manager-kms.h b/src/core/meta-monitor-manager-kms.h new file mode 100644 index 000000000..ef75dd60c --- /dev/null +++ b/src/core/meta-monitor-manager-kms.h @@ -0,0 +1,40 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ + +/* + * Copyright (C) 2001 Havoc Pennington + * Copyright (C) 2003 Rob Adams + * Copyright (C) 2004-2006 Elijah Newren + * Copyright (C) 2013 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 . + */ + +#ifndef META_MONITOR_MANAGER_KMS_H +#define META_MONITOR_MANAGER_KMS_H + +#include "monitor-private.h" + +#define META_TYPE_MONITOR_MANAGER_KMS (meta_monitor_manager_kms_get_type ()) +#define META_MONITOR_MANAGER_KMS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_MONITOR_MANAGER_KMS, MetaMonitorManagerKms)) +#define META_MONITOR_MANAGER_KMS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_MONITOR_MANAGER_KMS, MetaMonitorManagerKmsClass)) +#define META_IS_MONITOR_MANAGER_KMS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_MONITOR_MANAGER_KMS)) +#define META_IS_MONITOR_MANAGER_KMS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_MONITOR_MANAGER_KMS)) +#define META_MONITOR_MANAGER_KMS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_MONITOR_MANAGER_KMS, MetaMonitorManagerKmsClass)) + +typedef struct _MetaMonitorManagerKmsClass MetaMonitorManagerKmsClass; +typedef struct _MetaMonitorManagerKms MetaMonitorManagerKms; + +GType meta_monitor_manager_kms_get_type (void); + +#endif /* META_MONITOR_MANAGER_KMS_H */ diff --git a/src/core/meta-monitor-manager-xrandr.c b/src/core/meta-monitor-manager-xrandr.c index 66d89539d..59b5fbac7 100644 --- a/src/core/meta-monitor-manager-xrandr.c +++ b/src/core/meta-monitor-manager-xrandr.c @@ -25,6 +25,8 @@ #include "config.h" +#include "meta-monitor-manager-xrandr.h" + #include #include #include @@ -36,8 +38,6 @@ #include #include -#include "monitor-private.h" - #include "edid.h" #define ALL_WL_TRANSFORMS ((1 << (WL_OUTPUT_TRANSFORM_FLIPPED_270 + 1)) - 1) diff --git a/src/core/meta-monitor-manager-xrandr.h b/src/core/meta-monitor-manager-xrandr.h new file mode 100644 index 000000000..15268e1c1 --- /dev/null +++ b/src/core/meta-monitor-manager-xrandr.h @@ -0,0 +1,40 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ + +/* + * Copyright (C) 2001 Havoc Pennington + * Copyright (C) 2003 Rob Adams + * Copyright (C) 2004-2006 Elijah Newren + * Copyright (C) 2013 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 . + */ + +#ifndef META_MONITOR_MANAGER_XRANDR_H +#define META_MONITOR_MANAGER_XRANDR_H + +#include "monitor-private.h" + +#define META_TYPE_MONITOR_MANAGER_XRANDR (meta_monitor_manager_xrandr_get_type ()) +#define META_MONITOR_MANAGER_XRANDR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_MONITOR_MANAGER_XRANDR, MetaMonitorManagerXrandr)) +#define META_MONITOR_MANAGER_XRANDR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_MONITOR_MANAGER_XRANDR, MetaMonitorManagerXrandrClass)) +#define META_IS_MONITOR_MANAGER_XRANDR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_MONITOR_MANAGER_XRANDR)) +#define META_IS_MONITOR_MANAGER_XRANDR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_MONITOR_MANAGER_XRANDR)) +#define META_MONITOR_MANAGER_XRANDR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_MONITOR_MANAGER_XRANDR, MetaMonitorManagerXrandrClass)) + +typedef struct _MetaMonitorManagerXrandrClass MetaMonitorManagerXrandrClass; +typedef struct _MetaMonitorManagerXrandr MetaMonitorManagerXrandr; + +GType meta_monitor_manager_xrandr_get_type (void); + +#endif /* META_MONITOR_MANAGER_XRANDR_H */ diff --git a/src/core/monitor-private.h b/src/core/monitor-private.h index 842ab97af..7f215b57e 100644 --- a/src/core/monitor-private.h +++ b/src/core/monitor-private.h @@ -335,30 +335,6 @@ void meta_monitor_manager_apply_configuration (MetaMonitorManager void meta_monitor_manager_confirm_configuration (MetaMonitorManager *manager, gboolean ok); -#define META_TYPE_MONITOR_MANAGER_XRANDR (meta_monitor_manager_xrandr_get_type ()) -#define META_MONITOR_MANAGER_XRANDR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_MONITOR_MANAGER_XRANDR, MetaMonitorManagerXrandr)) -#define META_MONITOR_MANAGER_XRANDR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_MONITOR_MANAGER_XRANDR, MetaMonitorManagerXrandrClass)) -#define META_IS_MONITOR_MANAGER_XRANDR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_MONITOR_MANAGER_XRANDR)) -#define META_IS_MONITOR_MANAGER_XRANDR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_MONITOR_MANAGER_XRANDR)) -#define META_MONITOR_MANAGER_XRANDR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_MONITOR_MANAGER_XRANDR, MetaMonitorManagerXrandrClass)) - -typedef struct _MetaMonitorManagerXrandrClass MetaMonitorManagerXrandrClass; -typedef struct _MetaMonitorManagerXrandr MetaMonitorManagerXrandr; - -GType meta_monitor_manager_xrandr_get_type (void); - -#define META_TYPE_MONITOR_MANAGER_KMS (meta_monitor_manager_kms_get_type ()) -#define META_MONITOR_MANAGER_KMS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_MONITOR_MANAGER_KMS, MetaMonitorManagerKms)) -#define META_MONITOR_MANAGER_KMS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_MONITOR_MANAGER_KMS, MetaMonitorManagerKmsClass)) -#define META_IS_MONITOR_MANAGER_KMS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_MONITOR_MANAGER_KMS)) -#define META_IS_MONITOR_MANAGER_KMS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_MONITOR_MANAGER_KMS)) -#define META_MONITOR_MANAGER_KMS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_MONITOR_MANAGER_KMS, MetaMonitorManagerKmsClass)) - -typedef struct _MetaMonitorManagerKmsClass MetaMonitorManagerKmsClass; -typedef struct _MetaMonitorManagerKms MetaMonitorManagerKms; - -GType meta_monitor_manager_kms_get_type (void); - #define META_TYPE_MONITOR_CONFIG (meta_monitor_config_get_type ()) #define META_MONITOR_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_MONITOR_CONFIG, MetaMonitorConfig)) #define META_MONITOR_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_MONITOR_CONFIG, MetaMonitorConfigClass)) diff --git a/src/core/monitor.c b/src/core/monitor.c index 2b2c1f781..51fb28004 100644 --- a/src/core/monitor.c +++ b/src/core/monitor.c @@ -34,6 +34,8 @@ #include "util-private.h" #include #include "monitor-private.h" +#include "meta-monitor-manager-kms.h" +#include "meta-monitor-manager-xrandr.h" #include "meta-dbus-xrandr.h"