Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
G
gtk
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dorota Czaplejewicz
gtk
Commits
90262893
Commit
90262893
authored
Apr 02, 2016
by
Matthias Clasen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wayland: Port to new monitor api
parent
a2f02f1c
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
290 additions
and
197 deletions
+290
-197
gdk/wayland/Makefile.am
gdk/wayland/Makefile.am
+3
-0
gdk/wayland/gdkdisplay-wayland.c
gdk/wayland/gdkdisplay-wayland.c
+27
-0
gdk/wayland/gdkdisplay-wayland.h
gdk/wayland/gdkdisplay-wayland.h
+2
-0
gdk/wayland/gdkmonitor-wayland.c
gdk/wayland/gdkmonitor-wayland.c
+64
-0
gdk/wayland/gdkmonitor-wayland.h
gdk/wayland/gdkmonitor-wayland.h
+39
-0
gdk/wayland/gdkscreen-wayland.c
gdk/wayland/gdkscreen-wayland.c
+106
-197
gdk/wayland/gdkwayland.h
gdk/wayland/gdkwayland.h
+1
-0
gdk/wayland/gdkwaylandmonitor.h
gdk/wayland/gdkwaylandmonitor.h
+48
-0
No files found.
gdk/wayland/Makefile.am
View file @
90262893
...
...
@@ -48,6 +48,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
\
...
...
@@ -64,6 +66,7 @@ libgdkwaylandinclude_HEADERS = \
gdkwaylanddevice.h
\
gdkwaylanddisplay.h
\
gdkwaylandglcontext.h
\
gdkwaylandmonitor.h
\
gdkwaylandselection.h
\
gdkwaylandwindow.h
...
...
gdk/wayland/gdkdisplay-wayland.c
View file @
90262893
...
...
@@ -598,6 +598,8 @@ gdk_wayland_display_finalize (GObject *object)
g_free
(
display_wayland
->
startup_notification_id
);
g_ptr_array_free
(
display_wayland
->
monitors
,
TRUE
);
G_OBJECT_CLASS
(
gdk_wayland_display_parent_class
)
->
finalize
(
object
);
}
...
...
@@ -812,6 +814,26 @@ gdk_wayland_display_pop_error_trap (GdkDisplay *display,
return
0
;
}
static
int
gdk_wayland_display_get_n_monitors
(
GdkDisplay
*
display
)
{
GdkWaylandDisplay
*
display_wayland
=
GDK_WAYLAND_DISPLAY
(
display
);
return
display_wayland
->
monitors
->
len
;
}
static
GdkMonitor
*
gdk_wayland_display_get_monitor
(
GdkDisplay
*
display
,
int
monitor_num
)
{
GdkWaylandDisplay
*
display_wayland
=
GDK_WAYLAND_DISPLAY
(
display
);
if
(
monitor_num
<
0
||
monitor_num
>=
display_wayland
->
monitors
->
len
)
return
NULL
;
return
(
GdkMonitor
*
)
display_wayland
->
monitors
->
pdata
[
monitor_num
];
}
static
void
gdk_wayland_display_class_init
(
GdkWaylandDisplayClass
*
class
)
{
...
...
@@ -863,12 +885,17 @@ gdk_wayland_display_class_init (GdkWaylandDisplayClass *class)
display_class
->
utf8_to_string_target
=
_gdk_wayland_display_utf8_to_string_target
;
display_class
->
make_gl_context_current
=
gdk_wayland_display_make_gl_context_current
;
display_class
->
get_n_monitors
=
gdk_wayland_display_get_n_monitors
;
display_class
->
get_monitor
=
gdk_wayland_display_get_monitor
;
}
static
void
gdk_wayland_display_init
(
GdkWaylandDisplay
*
display
)
{
display
->
xkb_context
=
xkb_context_new
(
0
);
display
->
monitors
=
g_ptr_array_new_with_free_func
(
g_object_unref
);
}
void
...
...
gdk/wayland/gdkdisplay-wayland.h
View file @
90262893
...
...
@@ -103,6 +103,8 @@ struct _GdkWaylandDisplay
GdkWaylandSelection
*
selection
;
GPtrArray
*
monitors
;
/* egl info */
EGLDisplay
egl_display
;
int
egl_major_version
;
...
...
gdk/wayland/gdkmonitor-wayland.c
0 → 100644
View file @
90262893
/*
* 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 "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
;
}
/**
* gdk_wayland_monitor_get_wl_output:
* @monitor: (type GdkWaylandMonitor): a #GdkMonitor
*
* Returns the Wayland wl_output of a #GdkMonitor.
*
* Returns: (transfer none): a Wayland wl_output
* Since: 3.22
*/
struct
wl_output
*
gdk_wayland_monitor_get_wl_output
(
GdkMonitor
*
monitor
)
{
g_return_val_if_fail
(
GDK_IS_WAYLAND_MONITOR
(
monitor
),
NULL
);
return
GDK_WAYLAND_MONITOR
(
monitor
)
->
output
;
}
gdk/wayland/gdkmonitor-wayland.h
0 → 100644
View file @
90262893
/*
* 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
gdk/wayland/gdkscreen-wayland.c
View file @
90262893
This diff is collapsed.
Click to expand it.
gdk/wayland/gdkwayland.h
View file @
90262893
...
...
@@ -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>
...
...
gdk/wayland/gdkwaylandmonitor.h
0 → 100644
View file @
90262893
/*
* 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 (__GDKWAYLAND_H_INSIDE__) && !defined (GDK_COMPILATION)
#error "Only <gdk/gdkwayland.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
;
GDK_AVAILABLE_IN_3_22
struct
wl_output
*
gdk_wayland_monitor_get_wl_output
(
GdkMonitor
*
monitor
);
G_END_DECLS
#endif
/* __GDK_WAYLAND_MONITOR_H__ */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment