river/src/c.zig

59 lines
2.5 KiB
Zig
Raw Normal View History

2020-05-02 10:21:10 -07:00
// This file is part of river, a dynamic tiling wayland compositor.
//
// Copyright 2020 Isaac Freund
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
2020-03-29 10:36:15 -07:00
pub usingnamespace @cImport({
2020-03-20 14:44:08 -07:00
@cDefine("WLR_USE_UNSTABLE", {});
@cInclude("time.h");
@cInclude("stdlib.h");
@cInclude("wayland-server-core.h");
//@cInclude("wlr/backend.h");
//@cInclude("wlr/render/wlr_renderer.h");
@cInclude("wlr/types/wlr_buffer.h");
2020-03-20 14:44:08 -07:00
@cInclude("wlr/types/wlr_compositor.h");
@cInclude("wlr/types/wlr_cursor.h");
2020-03-20 14:44:08 -07:00
@cInclude("wlr/types/wlr_data_device.h");
@cInclude("wlr/types/wlr_input_device.h");
2020-04-18 15:59:07 -07:00
@cInclude("wlr/types/wlr_input_inhibitor.h");
2020-03-20 14:44:08 -07:00
@cInclude("wlr/types/wlr_keyboard.h");
@cInclude("wlr/types/wlr_layer_shell_v1.h");
2020-03-20 14:44:08 -07:00
@cInclude("wlr/types/wlr_matrix.h");
@cInclude("wlr/types/wlr_output.h");
@cInclude("wlr/types/wlr_output_layout.h");
@cInclude("wlr/types/wlr_pointer.h");
@cInclude("wlr/types/wlr_screencopy_v1.h");
2020-03-20 14:44:08 -07:00
@cInclude("wlr/types/wlr_seat.h");
@cInclude("wlr/types/wlr_xcursor_manager.h");
@cInclude("wlr/types/wlr_xdg_decoration_v1.h");
2020-04-10 08:23:25 -07:00
@cInclude("wlr/types/wlr_xdg_output_v1.h");
2020-03-20 14:44:08 -07:00
@cInclude("wlr/types/wlr_xdg_shell.h");
2020-05-08 05:51:10 -07:00
if (@import("build_options").xwayland) @cInclude("wlr/xwayland.h");
2020-03-20 14:44:08 -07:00
@cInclude("wlr/util/log.h");
@cInclude("xkbcommon/xkbcommon.h");
2020-03-23 08:50:20 -07:00
// Contains a subset of functions from wlr/backend.h and wlr/render/wlr_renderer.h
// that can be automatically imported
2020-04-15 03:47:55 -07:00
@cInclude("include/bindings.h");
2020-05-19 04:25:16 -07:00
@cInclude("river-window-management-unstable-v1-protocol.h");
2020-03-20 14:44:08 -07:00
});
// These are needed because zig currently names translated anonymous unions
// with a global counter, which makes code unportable.
// See https://github.com/ifreund/river/issues/17
pub const wlr_xdg_surface_union = @typeInfo(wlr_xdg_surface).Struct.fields[5].name;
pub const wlr_input_device_union = @typeInfo(wlr_input_device).Struct.fields[8].name;