1/*
2 * Copyright © 2016 Red Hat, Inc
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "config.h"
19
20#include <glib.h>
21#include <gio/gio.h>
22#include "gdkprivate-wayland.h"
23
24#include "gdkmonitor-wayland.h"
25
26G_DEFINE_TYPE (GdkWaylandMonitor, gdk_wayland_monitor, GDK_TYPE_MONITOR)
27
28static void
29gdk_wayland_monitor_init (GdkWaylandMonitor *monitor)
30{
31}
32
33static void
34gdk_wayland_monitor_finalize (GObject *object)
35{
36 GdkWaylandMonitor *monitor = (GdkWaylandMonitor *)object;
37
38 wl_output_destroy (monitor->output);
39
40 G_OBJECT_CLASS (gdk_wayland_monitor_parent_class)->finalize (object);
41}
42
43static void
44gdk_wayland_monitor_class_init (GdkWaylandMonitorClass *class)
45{
46 G_OBJECT_CLASS (class)->finalize = gdk_wayland_monitor_finalize;
47}
48
49/**
50 * gdk_wayland_monitor_get_wl_output:
51 * @monitor: (type GdkWaylandMonitor): a #GdkMonitor
52 *
53 * Returns the Wayland wl_output of a #GdkMonitor.
54 *
55 * Returns: (transfer none): a Wayland wl_output
56 * Since: 3.22
57 */
58struct wl_output *
59gdk_wayland_monitor_get_wl_output (GdkMonitor *monitor)
60{
61 g_return_val_if_fail (GDK_IS_WAYLAND_MONITOR (monitor), NULL);
62
63 return GDK_WAYLAND_MONITOR (monitor)->output;
64}
65