Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Commit

Permalink
types: add wlr_xdg_foreign_v1
Browse files Browse the repository at this point in the history
Co-authored-by: Jason Francis <cycl0ps@tuta.io>
  • Loading branch information
2 people authored and emersion committed Jan 5, 2021
1 parent 37602e1 commit 162f160
Show file tree
Hide file tree
Showing 5 changed files with 486 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ if conf_data.get('WLR_HAS_XWAYLAND', 0) != 1
endif
if conf_data.get('WLR_HAS_XDG_FOREIGN', 0) != 1
exclude_files += [
'types/wlr_xdg_foreign_v1.h',
'types/wlr_xdg_foreign_registry.h',
]
endif
Expand Down
64 changes: 64 additions & 0 deletions include/wlr/types/wlr_xdg_foreign_v1.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* This an unstable interface of wlroots. No guarantees are made regarding the
* future consistency of this API.
*/
#ifndef WLR_USE_UNSTABLE
#error "Add -DWLR_USE_UNSTABLE to enable unstable wlroots features"
#endif

#ifndef WLR_TYPES_WLR_XDG_FOREIGN_V1_H
#define WLR_TYPES_WLR_XDG_FOREIGN_V1_H

#include <wayland-server-core.h>
#include <wlr/types/wlr_xdg_foreign_registry.h>

struct wlr_xdg_foreign_v1 {
struct {
struct wl_global *global;
struct wl_list objects; // wlr_xdg_exported_v1::link or wlr_xdg_imported_v1::link
} exporter, importer;

struct wl_listener foreign_registry_destroy;
struct wl_listener display_destroy;

struct wlr_xdg_foreign_registry *registry;

struct {
struct wl_signal destroy;
} events;

void *data;
};

struct wlr_xdg_exported_v1 {
struct wlr_xdg_foreign_exported base;

struct wl_resource *resource;
struct wl_listener xdg_surface_destroy;

struct wl_list link; // wlr_xdg_foreign_v1::exporter::objects
};

struct wlr_xdg_imported_v1 {
struct wlr_xdg_foreign_exported *exported;
struct wl_listener exported_destroyed;

struct wl_resource *resource;
struct wl_list link; // wlr_xdg_foreign_v1::importer::objects
struct wl_list children;
};

struct wlr_xdg_imported_child_v1 {
struct wlr_xdg_imported_v1 *imported;
struct wlr_surface *surface;

struct wl_list link; // wlr_xdg_imported_v1::children

struct wl_listener xdg_surface_unmap;
struct wl_listener xdg_toplevel_set_parent;
};

struct wlr_xdg_foreign_v1 *wlr_xdg_foreign_v1_create(
struct wl_display *display, struct wlr_xdg_foreign_registry *registry);

#endif
1 change: 1 addition & 0 deletions protocol/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ protocols = {
'tablet-unstable-v2': wl_protocol_dir / 'unstable/tablet/tablet-unstable-v2.xml',
'text-input-unstable-v3': wl_protocol_dir / 'unstable/text-input/text-input-unstable-v3.xml',
'xdg-decoration-unstable-v1': wl_protocol_dir / 'unstable/xdg-decoration/xdg-decoration-unstable-v1.xml',
'xdg-foreign-unstable-v1': wl_protocol_dir / 'unstable/xdg-foreign/xdg-foreign-unstable-v1.xml',
'xdg-output-unstable-v1': wl_protocol_dir / 'unstable/xdg-output/xdg-output-unstable-v1.xml',
# Other protocols
'gtk-primary-selection': 'gtk-primary-selection.xml',
Expand Down
1 change: 1 addition & 0 deletions types/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ wlr_files += files(

if conf_data.get('WLR_HAS_XDG_FOREIGN', 0) == 1
wlr_files += files(
'wlr_xdg_foreign_v1.c',
'wlr_xdg_foreign_registry.c',
)
endif
Loading

0 comments on commit 162f160

Please sign in to comment.