Debian Codegraph @

gdk/wayland/gdkmonitor-wayland.c

raw
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
26 G_DEFINE_TYPE (GdkWaylandMonitor, gdk_wayland_monitor, GDK_TYPE_MONITOR)
27
28 static void
29 gdk_wayland_monitor_init (GdkWaylandMonitor *monitor)
30 {
31 }
32
33 static void
34 gdk_wayland_monitor_finalize (GObject *object)
35 {
36 GdkWaylandMonitor *monitor = (GdkWaylandMonitor *)object;
37
38 g_free (monitor->name);
39
40 wl_output_destroy (monitor->output);
41
42 G_OBJECT_CLASS (gdk_wayland_monitor_parent_class)->finalize (object);
43 }
44
45 static void
46 gdk_wayland_monitor_class_init (GdkWaylandMonitorClass *class)
47 {
48 G_OBJECT_CLASS (class)->finalize = gdk_wayland_monitor_finalize;
49 }
50
51 /**
52 * gdk_wayland_monitor_get_wl_output:
53 * @monitor: (type GdkWaylandMonitor): a #GdkMonitor
54 *
55 * Returns the Wayland wl_output of a #GdkMonitor.
56 *
57 * Returns: (transfer none): a Wayland wl_output
58 * Since: 3.22
59 */
60 struct wl_output *
61 gdk_wayland_monitor_get_wl_output (GdkMonitor *monitor)
62 {
63 g_return_val_if_fail (GDK_IS_WAYLAND_MONITOR (monitor), NULL);
64
65 return GDK_WAYLAND_MONITOR (monitor)->output;
66 }