2013-02-28 18:55:02 +00:00
|
|
|
/*
|
2013-09-09 16:37:33 +00:00
|
|
|
* This file is part of mpv video player.
|
2013-02-28 18:55:02 +00:00
|
|
|
*
|
Relicense some non-MPlayer source files to LGPL 2.1 or later
This covers source files which were added in mplayer2 and mpv times
only, and where all code is covered by LGPL relicensing agreements.
There are probably more files to which this applies, but I'm being
conservative here.
A file named ao_sdl.c exists in MPlayer too, but the mpv one is a
complete rewrite, and was added some time after the original ao_sdl.c
was removed. The same applies to vo_sdl.c, for which the SDL2 API is
radically different in addition (MPlayer supports SDL 1.2 only).
common.c contains only code written by me. But common.h is a strange
case: although it originally was named mp_common.h and exists in MPlayer
too, by now it contains only definitions written by uau and me. The
exceptions are the CONTROL_ defines - thus not changing the license of
common.h yet.
codec_tags.c contained once large tables generated from MPlayer's
codecs.conf, but all of these tables were removed.
From demux_playlist.c I'm removing a code fragment from someone who was
not asked; this probably could be done later (see commit 15dccc37).
misc.c is a bit complicated to reason about (it was split off mplayer.c
and thus contains random functions out of this file), but actually all
functions have been added post-MPlayer. Except get_relative_time(),
which was written by uau, but looks similar to 3 different versions of
something similar in each of the Unix/win32/OSX timer source files. I'm
not sure what that means in regards to copyright, so I've just moved it
into another still-GPL source file for now.
screenshot.c once had some minor parts of MPlayer's vf_screenshot.c, but
they're all gone.
2016-01-19 17:36:06 +00:00
|
|
|
* mpv is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
2013-02-28 18:55:02 +00:00
|
|
|
*
|
2013-09-09 16:37:33 +00:00
|
|
|
* mpv is distributed in the hope that it will be useful,
|
2013-02-28 18:55:02 +00:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
Relicense some non-MPlayer source files to LGPL 2.1 or later
This covers source files which were added in mplayer2 and mpv times
only, and where all code is covered by LGPL relicensing agreements.
There are probably more files to which this applies, but I'm being
conservative here.
A file named ao_sdl.c exists in MPlayer too, but the mpv one is a
complete rewrite, and was added some time after the original ao_sdl.c
was removed. The same applies to vo_sdl.c, for which the SDL2 API is
radically different in addition (MPlayer supports SDL 1.2 only).
common.c contains only code written by me. But common.h is a strange
case: although it originally was named mp_common.h and exists in MPlayer
too, by now it contains only definitions written by uau and me. The
exceptions are the CONTROL_ defines - thus not changing the license of
common.h yet.
codec_tags.c contained once large tables generated from MPlayer's
codecs.conf, but all of these tables were removed.
From demux_playlist.c I'm removing a code fragment from someone who was
not asked; this probably could be done later (see commit 15dccc37).
misc.c is a bit complicated to reason about (it was split off mplayer.c
and thus contains random functions out of this file), but actually all
functions have been added post-MPlayer. Except get_relative_time(),
which was written by uau, but looks similar to 3 different versions of
something similar in each of the Unix/win32/OSX timer source files. I'm
not sure what that means in regards to copyright, so I've just moved it
into another still-GPL source file for now.
screenshot.c once had some minor parts of MPlayer's vf_screenshot.c, but
they're all gone.
2016-01-19 17:36:06 +00:00
|
|
|
* GNU Lesser General Public License for more details.
|
2013-02-28 18:55:02 +00:00
|
|
|
*
|
Relicense some non-MPlayer source files to LGPL 2.1 or later
This covers source files which were added in mplayer2 and mpv times
only, and where all code is covered by LGPL relicensing agreements.
There are probably more files to which this applies, but I'm being
conservative here.
A file named ao_sdl.c exists in MPlayer too, but the mpv one is a
complete rewrite, and was added some time after the original ao_sdl.c
was removed. The same applies to vo_sdl.c, for which the SDL2 API is
radically different in addition (MPlayer supports SDL 1.2 only).
common.c contains only code written by me. But common.h is a strange
case: although it originally was named mp_common.h and exists in MPlayer
too, by now it contains only definitions written by uau and me. The
exceptions are the CONTROL_ defines - thus not changing the license of
common.h yet.
codec_tags.c contained once large tables generated from MPlayer's
codecs.conf, but all of these tables were removed.
From demux_playlist.c I'm removing a code fragment from someone who was
not asked; this probably could be done later (see commit 15dccc37).
misc.c is a bit complicated to reason about (it was split off mplayer.c
and thus contains random functions out of this file), but actually all
functions have been added post-MPlayer. Except get_relative_time(),
which was written by uau, but looks similar to 3 different versions of
something similar in each of the Unix/win32/OSX timer source files. I'm
not sure what that means in regards to copyright, so I've just moved it
into another still-GPL source file for now.
screenshot.c once had some minor parts of MPlayer's vf_screenshot.c, but
they're all gone.
2016-01-19 17:36:06 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with mpv. If not, see <http://www.gnu.org/licenses/>.
|
2013-02-28 18:55:02 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MPLAYER_WAYLAND_COMMON_H
|
|
|
|
#define MPLAYER_WAYLAND_COMMON_H
|
|
|
|
|
|
|
|
#include <wayland-client.h>
|
|
|
|
#include <wayland-cursor.h>
|
|
|
|
#include <xkbcommon/xkbcommon.h>
|
|
|
|
|
2017-10-01 20:16:49 +00:00
|
|
|
#include "vo.h"
|
|
|
|
#include "input/event.h"
|
2013-02-28 18:55:02 +00:00
|
|
|
|
|
|
|
struct vo_wayland_output {
|
2017-10-09 01:08:36 +00:00
|
|
|
struct vo_wayland_state *wl;
|
2017-10-01 20:16:49 +00:00
|
|
|
uint32_t id;
|
2013-02-28 18:55:02 +00:00
|
|
|
struct wl_output *output;
|
2017-10-01 20:16:49 +00:00
|
|
|
struct mp_rect geometry;
|
2017-10-09 01:08:36 +00:00
|
|
|
int phys_width;
|
|
|
|
int phys_height;
|
2017-10-01 20:16:49 +00:00
|
|
|
int scale;
|
2013-02-28 18:55:02 +00:00
|
|
|
uint32_t flags;
|
2017-10-01 20:16:49 +00:00
|
|
|
double refresh_rate;
|
2017-10-09 01:08:36 +00:00
|
|
|
char *make;
|
|
|
|
char *model;
|
|
|
|
bool has_surface;
|
2013-02-28 18:55:02 +00:00
|
|
|
struct wl_list link;
|
|
|
|
};
|
|
|
|
|
2013-07-18 15:35:28 +00:00
|
|
|
struct vo_wayland_state {
|
2017-10-01 20:16:49 +00:00
|
|
|
struct mp_log *log;
|
|
|
|
struct vo *vo;
|
|
|
|
struct wl_display *display;
|
|
|
|
struct wl_shm *shm;
|
|
|
|
struct wl_compositor *compositor;
|
|
|
|
struct wl_registry *registry;
|
|
|
|
|
|
|
|
/* State */
|
|
|
|
struct mp_rect geometry;
|
|
|
|
struct mp_rect window_size;
|
|
|
|
float aspect_ratio;
|
2017-10-09 01:08:36 +00:00
|
|
|
bool fullscreen;
|
|
|
|
bool configured;
|
2016-07-21 11:25:30 +00:00
|
|
|
int wakeup_pipe[2];
|
2017-10-01 20:16:49 +00:00
|
|
|
int pending_vo_events;
|
|
|
|
int mouse_x;
|
|
|
|
int mouse_y;
|
|
|
|
int scaling;
|
|
|
|
int touch_entries;
|
|
|
|
uint32_t pointer_id;
|
|
|
|
int display_fd;
|
|
|
|
struct wl_callback *frame_callback;
|
|
|
|
struct wl_list output_list;
|
|
|
|
struct vo_wayland_output *current_output;
|
|
|
|
|
|
|
|
/* Shell */
|
|
|
|
struct wl_surface *surface;
|
|
|
|
struct zxdg_shell_v6 *shell;
|
|
|
|
struct zxdg_toplevel_v6 *xdg_toplevel;
|
|
|
|
struct zxdg_surface_v6 *xdg_surface;
|
|
|
|
struct org_kde_kwin_server_decoration_manager *server_decoration_manager;
|
|
|
|
struct org_kde_kwin_server_decoration *server_decoration;
|
|
|
|
struct zwp_idle_inhibit_manager_v1 *idle_inhibit_manager;
|
|
|
|
struct zwp_idle_inhibitor_v1 *idle_inhibitor;
|
|
|
|
|
|
|
|
/* Input */
|
|
|
|
struct wl_seat *seat;
|
|
|
|
struct wl_pointer *pointer;
|
|
|
|
struct wl_touch *touch;
|
|
|
|
struct wl_keyboard *keyboard;
|
|
|
|
struct xkb_context *xkb_context;
|
|
|
|
struct xkb_keymap *xkb_keymap;
|
|
|
|
struct xkb_state *xkb_state;
|
|
|
|
|
|
|
|
/* DND */
|
|
|
|
struct wl_data_device_manager *dnd_devman;
|
|
|
|
struct wl_data_device *dnd_ddev;
|
|
|
|
struct wl_data_offer *dnd_offer;
|
|
|
|
enum mp_dnd_action dnd_action;
|
|
|
|
char *dnd_mime_type;
|
|
|
|
int dnd_mime_score;
|
|
|
|
int dnd_fd;
|
|
|
|
|
|
|
|
/* Cursor */
|
|
|
|
struct wl_cursor_theme *cursor_theme;
|
|
|
|
struct wl_cursor *default_cursor;
|
|
|
|
struct wl_surface *cursor_surface;
|
2017-10-22 04:45:23 +00:00
|
|
|
int allocated_cursor_scale;
|
2013-02-28 18:55:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
int vo_wayland_init(struct vo *vo);
|
2017-10-01 20:16:49 +00:00
|
|
|
int vo_wayland_reconfig(struct vo *vo);
|
2013-05-15 16:17:18 +00:00
|
|
|
int vo_wayland_control(struct vo *vo, int *events, int request, void *arg);
|
2017-10-01 20:16:49 +00:00
|
|
|
void vo_wayland_check_events(struct vo *vo);
|
|
|
|
void vo_wayland_uninit(struct vo *vo);
|
2016-07-21 11:25:30 +00:00
|
|
|
void vo_wayland_wakeup(struct vo *vo);
|
|
|
|
void vo_wayland_wait_events(struct vo *vo, int64_t until_time_us);
|
2013-02-28 18:55:02 +00:00
|
|
|
|
|
|
|
#endif /* MPLAYER_WAYLAND_COMMON_H */
|