[gtk+/wip/matthiasc/monitor] wayland: Split off monitor into separate files
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/matthiasc/monitor] wayland: Split off monitor into separate files
- Date: Tue, 5 Apr 2016 03:37:21 +0000 (UTC)
commit b348de178e8daeed97b528367715611f165b2580
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Apr 4 23:15:42 2016 -0400
wayland: Split off monitor into separate files
gdk/wayland/Makefile.am | 3 ++
gdk/wayland/gdkmonitor-wayland.c | 49 ++++++++++++++++++++++++++++++++++++++
gdk/wayland/gdkmonitor-wayland.h | 39 ++++++++++++++++++++++++++++++
gdk/wayland/gdkscreen-wayland.c | 37 +---------------------------
gdk/wayland/gdkwayland.h | 1 +
gdk/wayland/gdkwaylandmonitor.h | 45 ++++++++++++++++++++++++++++++++++
6 files changed, 139 insertions(+), 35 deletions(-)
---
diff --git a/gdk/wayland/Makefile.am b/gdk/wayland/Makefile.am
index 7f677b0..2b26da8 100644
--- a/gdk/wayland/Makefile.am
+++ b/gdk/wayland/Makefile.am
@@ -46,6 +46,8 @@ libgdk_wayland_la_SOURCES = \
gdkkeys-wayland.c \
gdkglcontext-wayland.c \
gdkglcontext-wayland.h \
+ gdkmonitor-wayland.c \
+ gdkmonitor-wayland.h \
gdkscreen-wayland.c \
gdkseat-wayland.h \
gdkselection-wayland.c \
@@ -62,6 +64,7 @@ libgdkwaylandinclude_HEADERS = \
gdkwaylanddevice.h \
gdkwaylanddisplay.h \
gdkwaylandglcontext.h \
+ gdkwaylandmonitor.h \
gdkwaylandselection.h \
gdkwaylandwindow.h
diff --git a/gdk/wayland/gdkmonitor-wayland.c b/gdk/wayland/gdkmonitor-wayland.c
new file mode 100644
index 0000000..53f23db
--- /dev/null
+++ b/gdk/wayland/gdkmonitor-wayland.c
@@ -0,0 +1,49 @@
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include <glib.h>
+#include <gio/gio.h>
+#include "gdkwaylandmonitor.h"
+#include "gdkmonitorprivate.h"
+#include "gdkprivate-wayland.h"
+
+#include "gdkmonitor-wayland.h"
+
+G_DEFINE_TYPE (GdkWaylandMonitor, gdk_wayland_monitor, GDK_TYPE_MONITOR);
+
+static void
+gdk_wayland_monitor_init (GdkWaylandMonitor *monitor)
+{
+}
+
+static void
+gdk_wayland_monitor_finalize (GObject *object)
+{
+ GdkWaylandMonitor *monitor = (GdkWaylandMonitor *)object;
+
+ wl_output_destroy (monitor->output);
+
+ G_OBJECT_CLASS (gdk_wayland_monitor_parent_class)->finalize (object);
+}
+
+static void
+gdk_wayland_monitor_class_init (GdkWaylandMonitorClass *class)
+{
+ G_OBJECT_CLASS (class)->finalize = gdk_wayland_monitor_finalize;
+}
diff --git a/gdk/wayland/gdkmonitor-wayland.h b/gdk/wayland/gdkmonitor-wayland.h
new file mode 100644
index 0000000..581908c
--- /dev/null
+++ b/gdk/wayland/gdkmonitor-wayland.h
@@ -0,0 +1,39 @@
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __GDK_WAYLAND_MONITOR_PRIVATE_H__
+#define __GDK_WAYLAND_MONITOR_PRIVATE_H__
+
+#include <glib.h>
+#include "gdkwaylandmonitor.h"
+#include "gdkmonitorprivate.h"
+#include "gdkprivate-wayland.h"
+
+struct _GdkWaylandMonitor {
+ GdkMonitor parent;
+
+ guint32 id;
+ guint32 version;
+ struct wl_output *output;
+ gboolean added;
+};
+
+struct _GdkWaylandMonitorClass {
+ GdkMonitorClass parent_class;
+};
+
+#endif
diff --git a/gdk/wayland/gdkscreen-wayland.c b/gdk/wayland/gdkscreen-wayland.c
index ec1ac99..14841a7 100644
--- a/gdk/wayland/gdkscreen-wayland.c
+++ b/gdk/wayland/gdkscreen-wayland.c
@@ -27,6 +27,7 @@
#include "gdkmonitorprivate.h"
#include "gdkdisplay.h"
#include "gdkdisplay-wayland.h"
+#include "gdkmonitor-wayland.h"
#include "gdkwayland.h"
#include "gdkprivate-wayland.h"
@@ -50,40 +51,6 @@ typedef struct {
const gchar *hintstyle;
} GsdXftSettings;
-typedef struct _GdkWaylandMonitor GdkWaylandMonitor;
-typedef GdkMonitorClass GdkWaylandMonitorClass;
-
-struct _GdkWaylandMonitor {
- GdkMonitor parent;
-
- guint32 id;
- guint32 version;
- struct wl_output *output;
- gboolean added;
-};
-
-G_DEFINE_TYPE (GdkWaylandMonitor, gdk_wayland_monitor, GDK_TYPE_MONITOR);
-
-static void
-gdk_wayland_monitor_init (GdkWaylandMonitor *monitor)
-{
-}
-
-static void
-gdk_wayland_monitor_finalize (GObject *object)
-{
- GdkWaylandMonitor *monitor = (GdkWaylandMonitor *)object;
-
- wl_output_destroy (monitor->output);
-
- G_OBJECT_CLASS (gdk_wayland_monitor_parent_class)->finalize (object);
-}
-
-static void
-gdk_wayland_monitor_class_init (GdkWaylandMonitorClass *class)
-{
- G_OBJECT_CLASS (class)->finalize = gdk_wayland_monitor_finalize;
-}
struct _GdkWaylandScreen
{
@@ -1141,7 +1108,7 @@ _gdk_wayland_screen_add_output (GdkScreen *screen,
GdkDisplay *display = gdk_screen_get_display (screen);
GdkWaylandMonitor *monitor;
- monitor = g_object_new (gdk_wayland_monitor_get_type (),
+ monitor = g_object_new (GDK_TYPE_WAYLAND_MONITOR,
"display", display,
NULL);
diff --git a/gdk/wayland/gdkwayland.h b/gdk/wayland/gdkwayland.h
index 64f64b6..2b79295 100644
--- a/gdk/wayland/gdkwayland.h
+++ b/gdk/wayland/gdkwayland.h
@@ -31,6 +31,7 @@
#include <gdk/wayland/gdkwaylanddevice.h>
#include <gdk/wayland/gdkwaylanddisplay.h>
+#include <gdk/wayland/gdkwaylandmonitor.h>
#include <gdk/wayland/gdkwaylandselection.h>
#include <gdk/wayland/gdkwaylandwindow.h>
#include <gdk/wayland/gdkwaylandglcontext.h>
diff --git a/gdk/wayland/gdkwaylandmonitor.h b/gdk/wayland/gdkwaylandmonitor.h
new file mode 100644
index 0000000..3e7bc38
--- /dev/null
+++ b/gdk/wayland/gdkwaylandmonitor.h
@@ -0,0 +1,45 @@
+/*
+ * gdkwaylandmonitor.h
+ *
+ * Copyright 2016 Red Hat, Inc.
+ *
+ * Matthias Clasen <mclasen redhat com>
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __GDK_WAYLAND_MONITOR_H__
+#define __GDK_WAYLAND_MONITOR_H__
+
+#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
+#error "Only <gdk/gdk.h> can be included directly."
+#endif
+
+#include <gdk/gdkmonitor.h>
+
+G_BEGIN_DECLS
+
+#define GDK_TYPE_WAYLAND_MONITOR (gdk_wayland_monitor_get_type ())
+#define GDK_WAYLAND_MONITOR(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WAYLAND_MONITOR,
GdkWaylandMonitor))
+#define GDK_IS_WAYLAND_MONITOR(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WAYLAND_MONITOR))
+
+typedef struct _GdkWaylandMonitor GdkWaylandMonitor;
+typedef struct _GdkWaylandMonitorClass GdkWaylandMonitorClass;
+
+GDK_AVAILABLE_IN_3_22
+GType gdk_wayland_monitor_get_type (void) G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif /* __GDK_WAYLAND_MONITOR_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]