From ec0b81e1eb8f9e153d6f6dc3532c26fbcdaf095f Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 5 Apr 2016 07:32:33 -0400 Subject: [PATCH] broadway: Move monitor to its own files --- gdk/broadway/Makefile.am | 3 ++ gdk/broadway/gdkbroadway.h | 1 + gdk/broadway/gdkbroadwaymonitor.h | 46 ++++++++++++++++++++++++++++++ gdk/broadway/gdkdisplay-broadway.c | 5 +++- gdk/broadway/gdkmonitor-broadway.c | 37 ++++++++++++++++++++++++ gdk/broadway/gdkmonitor-broadway.h | 38 ++++++++++++++++++++++++ 6 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 gdk/broadway/gdkbroadwaymonitor.h create mode 100644 gdk/broadway/gdkmonitor-broadway.c create mode 100644 gdk/broadway/gdkmonitor-broadway.h diff --git a/gdk/broadway/Makefile.am b/gdk/broadway/Makefile.am index 2f8457e726..59dc5d09a5 100644 --- a/gdk/broadway/Makefile.am +++ b/gdk/broadway/Makefile.am @@ -28,6 +28,7 @@ libgdkbroadwayinclude_HEADERS = \ gdkbroadwaydisplay.h \ gdkbroadwaywindow.h \ gdkbroadwaycursor.h \ + gdkbroadwaymonitor.h \ gdkbroadwayvisual.h EXTRA_DIST += toarray.pl @@ -64,6 +65,8 @@ libgdk_broadway_la_SOURCES = \ gdkeventsource.h \ gdkglobals-broadway.c \ gdkkeys-broadway.c \ + gdkmonitor-broadway.c \ + gdkmonitor-broadway.h \ gdkproperty-broadway.c \ gdkscreen-broadway.c \ gdkscreen-broadway.h \ diff --git a/gdk/broadway/gdkbroadway.h b/gdk/broadway/gdkbroadway.h index 6c646585f0..89086c461c 100644 --- a/gdk/broadway/gdkbroadway.h +++ b/gdk/broadway/gdkbroadway.h @@ -32,6 +32,7 @@ #include #include #include +#include #include #undef __GDKBROADWAY_H_INSIDE__ diff --git a/gdk/broadway/gdkbroadwaymonitor.h b/gdk/broadway/gdkbroadwaymonitor.h new file mode 100644 index 0000000000..2021c0c392 --- /dev/null +++ b/gdk/broadway/gdkbroadwaymonitor.h @@ -0,0 +1,46 @@ +/* + * gdkbroadwaymonitor.h + * + * Copyright 2016 Red Hat, Inc. + * + * Matthias Clasen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library. If not, see . + */ + +#ifndef __GDK_BROADWAY_MONITOR_H__ +#define __GDK_BROADWAY_MONITOR_H__ + +#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) +#error "Only can be included directly." +#endif + +#include + +G_BEGIN_DECLS + +#define GDK_TYPE_BROADWAY_MONITOR (gdk_broadway_monitor_get_type ()) +#define GDK_BROADWAY_MONITOR(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_BROADWAY_MONITOR, GdkBroadwayMonitor)) +#define GDK_IS_BROADWAY_MONITOR(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_BROADWAY_MONITOR)) + +typedef struct _GdkBroadwayMonitor GdkBroadwayMonitor; +typedef struct _GdkBroadwayMonitorClass GdkBroadwayMonitorClass; + +GDK_AVAILABLE_IN_3_22 +GType gdk_broadway_monitor_get_type (void) G_GNUC_CONST; + +G_END_DECLS + +#endif /* __GDK_BROADWAY_MONITOR_H__ */ + diff --git a/gdk/broadway/gdkdisplay-broadway.c b/gdk/broadway/gdkdisplay-broadway.c index a56acaf765..54a1fa85fb 100644 --- a/gdk/broadway/gdkdisplay-broadway.c +++ b/gdk/broadway/gdkdisplay-broadway.c @@ -28,6 +28,7 @@ #include "gdkeventsource.h" #include "gdkscreen.h" #include "gdkscreen-broadway.h" +#include "gdkmonitor-broadway.h" #include "gdkinternals.h" #include "gdkdeviceprivate.h" #include "gdkdevicemanager-broadway.h" @@ -56,7 +57,9 @@ gdk_broadway_display_init (GdkBroadwayDisplay *display) { display->id_ht = g_hash_table_new (NULL, NULL); - display->monitor = g_object_new (gdk_monitor_get_type (), "display", display, NULL); + display->monitor = g_object_new (GDK_TYPE_BROADWAY_MONITOR, + "display", display, + NULL); gdk_monitor_set_manufacturer (display->monitor, "browser"); gdk_monitor_set_model (display->monitor, "0"); } diff --git a/gdk/broadway/gdkmonitor-broadway.c b/gdk/broadway/gdkmonitor-broadway.c new file mode 100644 index 0000000000..aebc2804a1 --- /dev/null +++ b/gdk/broadway/gdkmonitor-broadway.c @@ -0,0 +1,37 @@ +/* + * Copyright © 2016 Red Hat, Inc + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library. If not, see . + */ + +#include "config.h" + +#include +#include + +#include "gdkmonitor-broadway.h" +#include "gdkscreen-broadway.h" + + +G_DEFINE_TYPE (GdkBroadwayMonitor, gdk_broadway_monitor, GDK_TYPE_MONITOR) + +static void +gdk_broadway_monitor_init (GdkBroadwayMonitor *monitor) +{ +} + +static void +gdk_broadway_monitor_class_init (GdkBroadwayMonitorClass *class) +{ +} diff --git a/gdk/broadway/gdkmonitor-broadway.h b/gdk/broadway/gdkmonitor-broadway.h new file mode 100644 index 0000000000..96b175195d --- /dev/null +++ b/gdk/broadway/gdkmonitor-broadway.h @@ -0,0 +1,38 @@ +/* + * Copyright © 2016 Red Hat, Inc + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library. If not, see . + */ + +#ifndef __GDK_BROADWAY_MONITOR_PRIVATE_H__ +#define __GDK_BROADWAY_MONITOR_PRIVATE_H__ + +#include +#include + +#include "gdkmonitorprivate.h" + +#include "gdkbroadwaymonitor.h" + + +struct _GdkBroadwayMonitor +{ + GdkMonitor parent; +}; + +struct _GdkBroadwayMonitorClass { + GdkMonitorClass parent_class; +}; + +#endif