Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
8145620
Dirty Wayland backend implementation.
Feb 16, 2016
05f362d
wayland: Add wayland integration and use stable protocol.
3x380V Feb 3, 2018
e805a4a
wayland: Whitespace fixes
3x380V Oct 4, 2019
4311a81
wayland: Use memfd_create
3x380V Oct 4, 2019
c1cce2a
wayland: WIP
3x380V Dec 29, 2019
3db7a6f
wayland: Split the check for compositor and wm_base into two checks.
ivucica Jan 26, 2020
24cbc5a
wayland: Include a script for regenerating protocol headers/source.
ivucica Jan 26, 2020
e8e6155
wayland: Update license headers and copyright statement.
ivucica Apr 14, 2020
80cc412
wayland: Additional license header fixes noticed during PR.
ivucica Apr 14, 2020
36eefc9
wayland: Assortment of fixes noticed during code review.
ivucica Apr 14, 2020
41b2d29
wayland: Checking whether the surface is configured before committing.
ivucica Apr 17, 2020
359aa9e
wayland: Additional clean up for license headers.
ivucica Apr 25, 2020
84f71f5
wayland: Additional interface registration NSDebugLog() output.
ivucica Apr 25, 2020
b294b7f
wayland: In case *stable* XDG Shell protocol isn't supported, be more…
ivucica Apr 25, 2020
de9a8b3
wayland: Performed some investigation into freeing WaylandCairoSurfac…
ivucica Apr 25, 2020
12f1d48
wayland: Remove the 'fake drawing' branch.
ivucica Apr 25, 2020
c6e9ee8
wayland: Support mouse middle click and smooth scroll wheel events.
ivucica Apr 25, 2020
67e352b
wayland: Deleted the useless override of -[GSDisplayServer windowlist].
ivucica Apr 25, 2020
f8b8609
wayland: Implement -[WaylandServer mouselocation].
ivucica Apr 25, 2020
8f0cc1b
wayland: Write down TODOs for cairo_surface doublebuffering to itself…
ivucica Apr 25, 2020
2bbcb04
wayland: Update the changelog for the merge.
ivucica Apr 25, 2020
bf4efe9
wayland: Added a small readme noting some backend-specific information.
ivucica Apr 25, 2020
4ab5a69
wayland: Mention the new README in the changelog.
ivucica Apr 25, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
2020-04-25 Ivan Vucica <ivan@vucica.net>

* Source/GSBackend.m:
* Source/cairo/GNUmakefile:
* Source/cairo/CairoContext.m:
* Source/cairo/WaylandCairoSurface.m:
* Source/wayland/GNUmakefile:
* Source/wayland/GNUmakefile.preamble:
* Source/wayland/WaylandServer.m:
* Source/wayland/xdg-shell-protocol.c:
* Source/wayland/README.md:
* Headers/cairo/WaylandCairoSurface.h:
* Headers/wayland/WaylandServer.h:
* Headers/wayland/xdg-shell-client-protocol.h:
* wayland-regenerate.h:
* configure:
* configure.ac:
Initial merge of the Wayland backend into the master branch.

2020-04-13 Ivan Vucica <ivan@vucica.net>

* Documentation/announce.texi:
Expand Down
38 changes: 38 additions & 0 deletions Headers/cairo/WaylandCairoSurface.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
WaylandCairoSurface.h

Copyright (C) 2020 Free Software Foundation, Inc.

Author: Sergio L. Pascual <slp@sinrega.org>
Date: February 2016

This file is part of GNUstep.

This library 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 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
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/

#ifndef WaylandCairoSurface_h
#define WaylandCairoSurface_h

#include "cairo/CairoSurface.h"

@interface WaylandCairoSurface : CairoSurface
{
}
@end

#endif
138 changes: 138 additions & 0 deletions Headers/wayland/WaylandServer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
/* <title>WaylandServer</title>

<abstract>Backend server using Wayland.</abstract>

Copyright (C) 2020 Free Software Foundation, Inc.

Author: Sergio L. Pascual <slp@sinrega.org>
Date: February 2016

This file is part of the GNUstep Backend.

This library 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 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
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/

#ifndef _WaylandServer_h_INCLUDE
#define _WaylandServer_h_INCLUDE

#include "config.h"

#include <GNUstepGUI/GSDisplayServer.h>
#include <wayland-client.h>
#include <cairo/cairo.h>
#include <xkbcommon/xkbcommon.h>

#include "cairo/WaylandCairoSurface.h"
#include "wayland/xdg-shell-client-protocol.h"

struct pointer {
struct wl_pointer *wlpointer;
float x;
float y;
uint32_t last_click_button;
uint32_t last_click_time;
float last_click_x;
float last_click_y;

uint32_t serial;
struct window *focus;
};

typedef struct _WaylandConfig {
struct wl_display *display;
struct wl_registry *registry;
struct wl_compositor *compositor;
struct wl_shell *shell;
struct wl_shm *shm;
struct wl_seat *seat;
struct wl_keyboard *keyboard;
struct xdg_wm_base *wm_base;

struct wl_list output_list;
int output_count;
struct wl_list window_list;
int window_count;
int last_window_id;

struct pointer pointer;
struct xkb_context *xkb_context;
struct {
struct xkb_keymap *keymap;
struct xkb_state *state;
xkb_mod_mask_t control_mask;
xkb_mod_mask_t alt_mask;
xkb_mod_mask_t shift_mask;
} xkb;
int modifiers;

int seat_version;

float mouse_scroll_multiplier;
} WaylandConfig;

struct output {
WaylandConfig *wlconfig;
struct wl_output *output;
uint32_t server_output_id;
struct wl_list link;
int alloc_x;
int alloc_y;
int width;
int height;
int transform;
int scale;
char *make;
char *model;

void *user_data;
};

struct window {
WaylandConfig *wlconfig;
id instance;
int window_id;
struct wl_list link;
BOOL configured; // surface has been configured once

float pos_x;
float pos_y;
float width;
float height;
float saved_pos_x;
float saved_pos_y;
int is_out;

unsigned char *data;
struct wl_buffer *buffer;
struct wl_surface *surface;
struct xdg_surface *xdg_surface;
struct xdg_toplevel *toplevel;

struct output *output;
WaylandCairoSurface *wcs;
};


@interface WaylandServer : GSDisplayServer
{
WaylandConfig *wlconfig;

BOOL _mouseInitialized;
}
@end

#endif /* _XGServer_h_INCLUDE */
Loading