From 3f2d658f202df0fbd70fe1368fef26bd66d218f0 Mon Sep 17 00:00:00 2001 From: Rui Matos Date: Fri, 30 Jan 2015 14:51:18 +0100 Subject: [PATCH] monitor-manager: Expose MetaMonitorManager to introspection This just exposes the type and the singleton getter necessary to make it available to introspection. We'll expose more functionality as it becomes needed. https://bugzilla.gnome.org/show_bug.cgi?id=743745 --- src/Makefile.am | 4 ++- src/backends/meta-backend-private.h | 2 +- src/backends/meta-monitor-config.h | 2 +- src/backends/meta-monitor-manager-dummy.h | 2 +- ...nager.h => meta-monitor-manager-private.h} | 9 ++--- src/backends/meta-monitor-manager.c | 9 ++++- .../native/meta-cursor-renderer-native.c | 2 +- .../native/meta-monitor-manager-kms.h | 2 +- .../x11/meta-monitor-manager-xrandr.h | 2 +- src/compositor/meta-plugin.c | 2 +- src/compositor/meta-window-actor.c | 2 +- src/core/screen-private.h | 2 +- src/meta/meta-monitor-manager.h | 34 +++++++++++++++++++ src/wayland/meta-wayland-outputs.c | 2 +- 14 files changed, 57 insertions(+), 19 deletions(-) rename src/backends/{meta-monitor-manager.h => meta-monitor-manager-private.h} (98%) create mode 100644 src/meta/meta-monitor-manager.h diff --git a/src/Makefile.am b/src/Makefile.am index d397ee29b..20ed3e28a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -80,7 +80,8 @@ libmutter_la_SOURCES = \ backends/meta-monitor-config.c \ backends/meta-monitor-config.h \ backends/meta-monitor-manager.c \ - backends/meta-monitor-manager.h \ + meta/meta-monitor-manager.h \ + backends/meta-monitor-manager-private.h \ backends/meta-monitor-manager-dummy.c \ backends/meta-monitor-manager-dummy.h \ backends/meta-stage.h \ @@ -315,6 +316,7 @@ libmutterinclude_headers = \ meta/meta-cursor-tracker.h \ meta/meta-idle-monitor.h \ meta/meta-plugin.h \ + meta/meta-monitor-manager.h \ meta/meta-shaped-texture.h \ meta/meta-shadow-factory.h \ meta/meta-window-actor.h \ diff --git a/src/backends/meta-backend-private.h b/src/backends/meta-backend-private.h index f9c9a304b..9a0c806fd 100644 --- a/src/backends/meta-backend-private.h +++ b/src/backends/meta-backend-private.h @@ -33,7 +33,7 @@ #include #include #include "meta-cursor-renderer.h" -#include "meta-monitor-manager.h" +#include "meta-monitor-manager-private.h" #define DEFAULT_XKB_RULES_FILE "evdev" #define DEFAULT_XKB_MODEL "pc105+inet" diff --git a/src/backends/meta-monitor-config.h b/src/backends/meta-monitor-config.h index 5599b6a4e..10b95d260 100644 --- a/src/backends/meta-monitor-config.h +++ b/src/backends/meta-monitor-config.h @@ -23,7 +23,7 @@ #ifndef META_MONITOR_CONFIG_H #define META_MONITOR_CONFIG_H -#include "meta-monitor-manager.h" +#include "meta-monitor-manager-private.h" #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)) diff --git a/src/backends/meta-monitor-manager-dummy.h b/src/backends/meta-monitor-manager-dummy.h index 4f1fb349c..06255901a 100644 --- a/src/backends/meta-monitor-manager-dummy.h +++ b/src/backends/meta-monitor-manager-dummy.h @@ -23,7 +23,7 @@ #ifndef META_MONITOR_MANAGER_DUMMY_H #define META_MONITOR_MANAGER_DUMMY_H -#include "meta-monitor-manager.h" +#include "meta-monitor-manager-private.h" #define META_TYPE_MONITOR_MANAGER_DUMMY (meta_monitor_manager_dummy_get_type ()) #define META_MONITOR_MANAGER_DUMMY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_MONITOR_MANAGER_DUMMY, MetaMonitorManagerDummy)) diff --git a/src/backends/meta-monitor-manager.h b/src/backends/meta-monitor-manager-private.h similarity index 98% rename from src/backends/meta-monitor-manager.h rename to src/backends/meta-monitor-manager-private.h index d1f15309a..b3c2e8dc6 100644 --- a/src/backends/meta-monitor-manager.h +++ b/src/backends/meta-monitor-manager-private.h @@ -41,18 +41,17 @@ #include "display-private.h" #include #include "stack-tracker.h" +#include #include "meta-display-config-shared.h" #include "meta-dbus-display-config.h" #include "meta-cursor.h" -typedef struct _MetaMonitorManagerClass MetaMonitorManagerClass; -typedef struct _MetaMonitorManager MetaMonitorManager; typedef struct _MetaMonitorConfigClass MetaMonitorConfigClass; typedef struct _MetaMonitorConfig MetaMonitorConfig; -typedef struct _MetaOutput MetaOutput; typedef struct _MetaCRTC MetaCRTC; +typedef struct _MetaOutput MetaOutput; typedef struct _MetaMonitorMode MetaMonitorMode; typedef struct _MetaMonitorInfo MetaMonitorInfo; typedef struct _MetaCRTCInfo MetaCRTCInfo; @@ -322,10 +321,6 @@ struct _MetaMonitorManagerClass unsigned short *); }; -GType meta_monitor_manager_get_type (void); - -MetaMonitorManager *meta_monitor_manager_get (void); - void meta_monitor_manager_rebuild_derived (MetaMonitorManager *manager); MetaMonitorInfo *meta_monitor_manager_get_monitor_infos (MetaMonitorManager *manager, diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c index 352a1822d..d955af7fd 100644 --- a/src/backends/meta-monitor-manager.c +++ b/src/backends/meta-monitor-manager.c @@ -25,7 +25,7 @@ #include "config.h" -#include "meta-monitor-manager.h" +#include "meta-monitor-manager-private.h" #include #include @@ -1107,6 +1107,13 @@ initialize_dbus_interface (MetaMonitorManager *manager) g_object_unref); } +/** + * meta_monitor_manager_get: + * + * Accessor for the singleton MetaMonitorManager. + * + * Returns: (transfer none): The only #MetaMonitorManager there is. + */ MetaMonitorManager * meta_monitor_manager_get (void) { diff --git a/src/backends/native/meta-cursor-renderer-native.c b/src/backends/native/meta-cursor-renderer-native.c index ca29882fb..f0863f6bd 100644 --- a/src/backends/native/meta-cursor-renderer-native.c +++ b/src/backends/native/meta-cursor-renderer-native.c @@ -30,7 +30,7 @@ #include #include "meta-cursor-private.h" -#include "meta-monitor-manager.h" +#include "meta-monitor-manager-private.h" #ifndef DRM_CAP_CURSOR_WIDTH #define DRM_CAP_CURSOR_WIDTH 0x8 diff --git a/src/backends/native/meta-monitor-manager-kms.h b/src/backends/native/meta-monitor-manager-kms.h index 4794e313d..294fb4f44 100644 --- a/src/backends/native/meta-monitor-manager-kms.h +++ b/src/backends/native/meta-monitor-manager-kms.h @@ -23,7 +23,7 @@ #ifndef META_MONITOR_MANAGER_KMS_H #define META_MONITOR_MANAGER_KMS_H -#include "meta-monitor-manager.h" +#include "meta-monitor-manager-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)) diff --git a/src/backends/x11/meta-monitor-manager-xrandr.h b/src/backends/x11/meta-monitor-manager-xrandr.h index f440b0a01..9443ab0ec 100644 --- a/src/backends/x11/meta-monitor-manager-xrandr.h +++ b/src/backends/x11/meta-monitor-manager-xrandr.h @@ -23,7 +23,7 @@ #ifndef META_MONITOR_MANAGER_XRANDR_H #define META_MONITOR_MANAGER_XRANDR_H -#include "meta-monitor-manager.h" +#include "meta-monitor-manager-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)) diff --git a/src/compositor/meta-plugin.c b/src/compositor/meta-plugin.c index 170fa691c..26b9c266a 100644 --- a/src/compositor/meta-plugin.c +++ b/src/compositor/meta-plugin.c @@ -40,7 +40,7 @@ #include "compositor-private.h" #include "meta-window-actor-private.h" -#include "meta-monitor-manager.h" +#include "meta-monitor-manager-private.h" G_DEFINE_ABSTRACT_TYPE (MetaPlugin, meta_plugin, G_TYPE_OBJECT); diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c index 3d6fab163..d61c2fb30 100644 --- a/src/compositor/meta-window-actor.c +++ b/src/compositor/meta-window-actor.c @@ -27,7 +27,7 @@ #include "meta-window-actor-private.h" #include "meta-texture-rectangle.h" #include "region-utils.h" -#include "meta-monitor-manager.h" +#include "meta-monitor-manager-private.h" #include "meta-cullable.h" #include "meta-surface-actor.h" diff --git a/src/core/screen-private.h b/src/core/screen-private.h index 9d520e5dd..322dfb466 100644 --- a/src/core/screen-private.h +++ b/src/core/screen-private.h @@ -36,7 +36,7 @@ #include #include "stack-tracker.h" #include "ui.h" -#include "meta-monitor-manager.h" +#include "meta-monitor-manager-private.h" typedef void (* MetaScreenWindowFunc) (MetaWindow *window, gpointer user_data); diff --git a/src/meta/meta-monitor-manager.h b/src/meta/meta-monitor-manager.h new file mode 100644 index 000000000..84f77fb7d --- /dev/null +++ b/src/meta/meta-monitor-manager.h @@ -0,0 +1,34 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ + +/* + * Copyright (C) 2015 Red Hat + * + * 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_MONITOR_MANAGER_H +#define META_MONITOR_MANAGER_H + +#include + +typedef struct _MetaMonitorManagerClass MetaMonitorManagerClass; +typedef struct _MetaMonitorManager MetaMonitorManager; + +GType meta_monitor_manager_get_type (void); + +MetaMonitorManager *meta_monitor_manager_get (void); + +#endif /* META_MONITOR_MANAGER_H */ diff --git a/src/wayland/meta-wayland-outputs.c b/src/wayland/meta-wayland-outputs.c index 7ed3ae16f..e83bee241 100644 --- a/src/wayland/meta-wayland-outputs.c +++ b/src/wayland/meta-wayland-outputs.c @@ -27,7 +27,7 @@ #include "meta-wayland-outputs.h" #include "meta-wayland-private.h" -#include "meta-monitor-manager.h" +#include "meta-monitor-manager-private.h" #include