From 7655e09d004ec1bb8b844f2829814b10f811114d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 2 May 2018 18:53:11 +0200 Subject: [PATCH] build: Introspect some more types While MetaStage, MetaWindowGroup and MetaDBusDisplayConfigSkeleton don't appear explicitly in the public API, their gtypes are still exposed via meta_get_stage_for_screen(), meta_get_*window_group_for_screen() and MetaMonitorManager's parent type. Newer versions of gjs will warn about undefined properties if it encounters a gtype without introspection information, so expose those types to shut up the warnings. https://bugzilla.gnome.org/show_bug.cgi?id=781471 --- src/Makefile.am | 2 ++ src/backends/meta-backend.c | 2 +- src/backends/meta-cursor-renderer.c | 2 +- .../{meta-stage.h => meta-stage-private.h} | 24 +++---------- src/backends/meta-stage.c | 2 +- src/backends/native/meta-backend-native.c | 2 +- src/backends/x11/meta-backend-x11.c | 2 +- src/backends/x11/meta-cursor-renderer-x11.c | 2 +- src/compositor/compositor.c | 2 +- src/compositor/meta-window-group-private.h | 24 +++++++++++++ src/compositor/meta-window-group.c | 2 +- src/compositor/meta-window-group.h | 34 ------------------- src/core/display.c | 2 +- src/meta/meta-monitor-manager.h | 3 ++ src/meta/meta-stage.h | 32 +++++++++++++++++ src/meta/meta-window-group.h | 11 ++++++ 16 files changed, 85 insertions(+), 63 deletions(-) rename src/backends/{meta-stage.h => meta-stage-private.h} (65%) create mode 100644 src/compositor/meta-window-group-private.h delete mode 100644 src/compositor/meta-window-group.h create mode 100644 src/meta/meta-stage.h create mode 100644 src/meta/meta-window-group.h diff --git a/src/Makefile.am b/src/Makefile.am index fd82d1f42..59108c069 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -543,7 +543,9 @@ libmutterinclude_headers = \ meta/meta-settings.h \ meta/meta-shaped-texture.h \ meta/meta-shadow-factory.h \ + meta/meta-stage.h \ meta/meta-window-actor.h \ + meta/meta-window-group.h \ meta/meta-window-shape.h \ meta/prefs.h \ meta/screen.h \ diff --git a/src/backends/meta-backend.c b/src/backends/meta-backend.c index 4a8c3bc4e..ce7e385b9 100644 --- a/src/backends/meta-backend.c +++ b/src/backends/meta-backend.c @@ -34,7 +34,7 @@ #include "meta-input-settings-private.h" #include "backends/x11/meta-backend-x11.h" #include "meta-cursor-tracker-private.h" -#include "meta-stage.h" +#include "meta-stage-private.h" #ifdef HAVE_REMOTE_DESKTOP #include "backends/meta-dbus-session-watcher.h" diff --git a/src/backends/meta-cursor-renderer.c b/src/backends/meta-cursor-renderer.c index 6c0ec57a8..f6470e66a 100644 --- a/src/backends/meta-cursor-renderer.c +++ b/src/backends/meta-cursor-renderer.c @@ -33,7 +33,7 @@ #include #include -#include "meta-stage.h" +#include "meta-stage-private.h" struct _MetaCursorRendererPrivate { diff --git a/src/backends/meta-stage.h b/src/backends/meta-stage-private.h similarity index 65% rename from src/backends/meta-stage.h rename to src/backends/meta-stage-private.h index 7043832ca..8a9309772 100644 --- a/src/backends/meta-stage.h +++ b/src/backends/meta-stage-private.h @@ -17,39 +17,23 @@ * 02111-1307, USA. */ -#ifndef META_STAGE_H -#define META_STAGE_H +#ifndef META_STAGE_PRIVATE_H +#define META_STAGE_PRIVATE_H -#include +#include #include "meta-cursor.h" #include G_BEGIN_DECLS -#define META_TYPE_STAGE (meta_stage_get_type ()) -#define META_STAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_STAGE, MetaStage)) -#define META_STAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_STAGE, MetaStageClass)) -#define META_IS_STAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_STAGE)) -#define META_IS_STAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_STAGE)) -#define META_STAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_STAGE, MetaStageClass)) - -typedef struct _MetaStage MetaStage; -typedef struct _MetaStageClass MetaStageClass; typedef struct _MetaOverlay MetaOverlay; -struct _MetaStageClass -{ - ClutterStageClass parent_class; -}; - struct _MetaStage { ClutterStage parent; }; -GType meta_stage_get_type (void) G_GNUC_CONST; - ClutterActor *meta_stage_new (void); MetaOverlay *meta_stage_create_cursor_overlay (MetaStage *stage); @@ -68,4 +52,4 @@ void meta_stage_update_view_layout (MetaStage *stage); G_END_DECLS -#endif /* META_STAGE_H */ +#endif /* META_STAGE_PRIVATE_H */ diff --git a/src/backends/meta-stage.c b/src/backends/meta-stage.c index eb0dd0e46..73ca70118 100644 --- a/src/backends/meta-stage.c +++ b/src/backends/meta-stage.c @@ -22,7 +22,7 @@ #include -#include "meta-stage.h" +#include "meta-stage-private.h" #include #include diff --git a/src/backends/native/meta-backend-native.c b/src/backends/native/meta-backend-native.c index f7803da03..a29f593ea 100644 --- a/src/backends/native/meta-backend-native.c +++ b/src/backends/native/meta-backend-native.c @@ -43,7 +43,7 @@ #include "backends/meta-logical-monitor.h" #include "backends/meta-monitor-manager-private.h" #include "backends/meta-pointer-constraint.h" -#include "backends/meta-stage.h" +#include "backends/meta-stage-private.h" #include "backends/native/meta-clutter-backend-native.h" #include "backends/native/meta-input-settings-native.h" #include "backends/native/meta-renderer-native.h" diff --git a/src/backends/x11/meta-backend-x11.c b/src/backends/x11/meta-backend-x11.c index e3dba9913..2b131d2d0 100644 --- a/src/backends/x11/meta-backend-x11.c +++ b/src/backends/x11/meta-backend-x11.c @@ -37,7 +37,7 @@ #include #include -#include "backends/meta-stage.h" +#include "backends/meta-stage-private.h" #include "backends/x11/meta-clutter-backend-x11.h" #include "backends/x11/meta-renderer-x11.h" #include "meta/meta-cursor-tracker.h" diff --git a/src/backends/x11/meta-cursor-renderer-x11.c b/src/backends/x11/meta-cursor-renderer-x11.c index 3911ffdc2..82109f1f3 100644 --- a/src/backends/x11/meta-cursor-renderer-x11.c +++ b/src/backends/x11/meta-cursor-renderer-x11.c @@ -29,7 +29,7 @@ #include #include "meta-backend-x11.h" -#include "meta-stage.h" +#include "meta-stage-private.h" struct _MetaCursorRendererX11Private { diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c index aa49347c9..8c924d256 100644 --- a/src/compositor/compositor.c +++ b/src/compositor/compositor.c @@ -67,7 +67,7 @@ #include #include #include "meta-window-actor-private.h" -#include "meta-window-group.h" +#include "meta-window-group-private.h" #include "window-private.h" /* to check window->hidden */ #include "display-private.h" /* for meta_display_lookup_x_window() and meta_display_cancel_touch() */ #include "util-private.h" diff --git a/src/compositor/meta-window-group-private.h b/src/compositor/meta-window-group-private.h new file mode 100644 index 000000000..bc461fd5f --- /dev/null +++ b/src/compositor/meta-window-group-private.h @@ -0,0 +1,24 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ + +#ifndef META_WINDOW_GROUP_PRIVATE_H +#define META_WINDOW_GROUP_PRIVATE_H + +#include + +#include + +/** + * MetaWindowGroup: + * + * This class is a subclass of ClutterActor with special handling for + * #MetaCullable when painting children. It uses code similar to + * meta_cullable_cull_out_children(), but also has additional special + * cases for the undirected window, and similar. + */ + + +typedef struct _MetaWindowGroupPrivate MetaWindowGroupPrivate; + +ClutterActor *meta_window_group_new (MetaScreen *screen); + +#endif /* META_WINDOW_GROUP_PRIVATE_H */ diff --git a/src/compositor/meta-window-group.c b/src/compositor/meta-window-group.c index 4b907777e..665adee77 100644 --- a/src/compositor/meta-window-group.c +++ b/src/compositor/meta-window-group.c @@ -10,7 +10,7 @@ #include "clutter-utils.h" #include "compositor-private.h" #include "meta-window-actor-private.h" -#include "meta-window-group.h" +#include "meta-window-group-private.h" #include "window-private.h" #include "meta-cullable.h" diff --git a/src/compositor/meta-window-group.h b/src/compositor/meta-window-group.h deleted file mode 100644 index 685337efd..000000000 --- a/src/compositor/meta-window-group.h +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ - -#ifndef META_WINDOW_GROUP_H -#define META_WINDOW_GROUP_H - -#include - -#include - -/** - * MetaWindowGroup: - * - * This class is a subclass of ClutterActor with special handling for - * #MetaCullable when painting children. It uses code similar to - * meta_cullable_cull_out_children(), but also has additional special - * cases for the undirected window, and similar. - */ - -#define META_TYPE_WINDOW_GROUP (meta_window_group_get_type ()) -#define META_WINDOW_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_WINDOW_GROUP, MetaWindowGroup)) -#define META_WINDOW_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_WINDOW_GROUP, MetaWindowGroupClass)) -#define META_IS_WINDOW_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_WINDOW_GROUP)) -#define META_IS_WINDOW_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_WINDOW_GROUP)) -#define META_WINDOW_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_WINDOW_GROUP, MetaWindowGroupClass)) - -typedef struct _MetaWindowGroup MetaWindowGroup; -typedef struct _MetaWindowGroupClass MetaWindowGroupClass; -typedef struct _MetaWindowGroupPrivate MetaWindowGroupPrivate; - -GType meta_window_group_get_type (void); - -ClutterActor *meta_window_group_new (MetaScreen *screen); - -#endif /* META_WINDOW_GROUP_H */ diff --git a/src/core/display.c b/src/core/display.c index 7faa61a95..d6da84b30 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -53,7 +53,7 @@ #include "backends/meta-logical-monitor.h" #include "backends/native/meta-backend-native.h" #include "backends/x11/meta-backend-x11.h" -#include "backends/meta-stage.h" +#include "backends/meta-stage-private.h" #include "backends/meta-input-settings-private.h" #include diff --git a/src/meta/meta-monitor-manager.h b/src/meta/meta-monitor-manager.h index d902d9f11..0e7b93016 100644 --- a/src/meta/meta-monitor-manager.h +++ b/src/meta/meta-monitor-manager.h @@ -54,4 +54,7 @@ MetaMonitorSwitchConfigType meta_monitor_manager_get_switch_config (MetaMonitorM gint meta_monitor_manager_get_display_configuration_timeout (void); +/* Re-declaration of parent type for introspection */ +GType meta_dbus_display_config_skeleton_get_type (void) G_GNUC_CONST; + #endif /* META_MONITOR_MANAGER_H */ diff --git a/src/meta/meta-stage.h b/src/meta/meta-stage.h new file mode 100644 index 000000000..700ae7876 --- /dev/null +++ b/src/meta/meta-stage.h @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2012 Intel Corporation + * + * 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_STAGE_H +#define META_STAGE_H + +#include "clutter/clutter.h" + +G_BEGIN_DECLS + +#define META_TYPE_STAGE (meta_stage_get_type ()) +G_DECLARE_FINAL_TYPE (MetaStage, meta_stage, META, STAGE, ClutterStage) + +G_END_DECLS + +#endif /* META_STAGE_H */ diff --git a/src/meta/meta-window-group.h b/src/meta/meta-window-group.h new file mode 100644 index 000000000..624e07c9a --- /dev/null +++ b/src/meta/meta-window-group.h @@ -0,0 +1,11 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ + +#ifndef META_WINDOW_GROUP_H +#define META_WINDOW_GROUP_H + +#include "clutter/clutter.h" + +#define META_TYPE_WINDOW_GROUP (meta_window_group_get_type()) +G_DECLARE_FINAL_TYPE (MetaWindowGroup, meta_window_group, META, WINDOW_GROUP, ClutterActor) + +#endif /* META_WINDOW_GROUP_H */