gpu_display/
dwl.rs

1// Copyright 2019 The ChromiumOS Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5/* automatically generated by rust-bindgen */
6
7/// @page page_xdg_shell_unstable_v6 The xdg_shell_unstable_v6 protocol
8/// @section page_ifaces_xdg_shell_unstable_v6 Interfaces
9/// - @subpage page_iface_zxdg_shell_v6 - create desktop-style surfaces
10/// - @subpage page_iface_zxdg_positioner_v6 - child surface positioner
11/// - @subpage page_iface_zxdg_surface_v6 - desktop user interface surface base interface
12/// - @subpage page_iface_zxdg_toplevel_v6 - toplevel surface
13/// - @subpage page_iface_zxdg_popup_v6 - short-lived, popup surfaces for menus
14///
15/// @section page_copyright_xdg_shell_unstable_v6 Copyright
16/// <pre>
17///
18/// Copyright © 2008-2013 Kristian Høgsberg
19/// Copyright © 2013      Rafael Antognolli
20/// Copyright © 2013      Jasper St. Pierre
21/// Copyright © 2010-2013 Intel Corporation
22///
23/// Permission is hereby granted, free of charge, to any person obtaining a
24/// copy of this software and associated documentation files (the "Software"),
25/// to deal in the Software without restriction, including without limitation
26/// the rights to use, copy, modify, merge, publish, distribute, sublicense,
27/// and/or sell copies of the Software, and to permit persons to whom the
28/// Software is furnished to do so, subject to the following conditions:
29///
30/// The above copyright notice and this permission notice (including the next
31/// paragraph) shall be included in all copies or substantial portions of the
32/// Software.
33///
34/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
35/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
36/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
37/// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
38/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39/// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
40/// DEALINGS IN THE SOFTWARE.
41/// </pre>
42#[repr(C)]
43#[derive(Debug, Copy, Clone)]
44pub struct wl_output {
45    _unused: [u8; 0],
46}
47#[repr(C)]
48pub struct dwl_context {
49    pub _bindgen_opaque_blob: [u64; 52usize],
50}
51#[repr(C)]
52#[derive(Debug, Copy, Clone)]
53pub struct dwl_dmabuf {
54    pub _bindgen_opaque_blob: [u64; 3usize],
55}
56#[repr(C)]
57#[derive(Debug, Copy, Clone)]
58pub struct dwl_surface {
59    pub _bindgen_opaque_blob: [u64; 12usize],
60}
61
62#[allow(dead_code)]
63pub const DWL_KEYBOARD_KEY_STATE_RELEASED: i32 = 0;
64pub const DWL_KEYBOARD_KEY_STATE_PRESSED: i32 = 1;
65
66#[allow(dead_code)]
67pub const DWL_EVENT_TYPE_KEYBOARD_ENTER: u32 = 0x00;
68#[allow(dead_code)]
69pub const DWL_EVENT_TYPE_KEYBOARD_LEAVE: u32 = 0x01;
70pub const DWL_EVENT_TYPE_KEYBOARD_KEY: u32 = 0x02;
71#[allow(dead_code)]
72pub const DWL_EVENT_TYPE_POINTER_ENTER: u32 = 0x10;
73#[allow(dead_code)]
74pub const DWL_EVENT_TYPE_POINTER_LEAVE: u32 = 0x11;
75#[allow(dead_code)]
76pub const DWL_EVENT_TYPE_POINTER_MOVE: u32 = 0x12;
77#[allow(dead_code)]
78pub const DWL_EVENT_TYPE_POINTER_BUTTON: u32 = 0x13;
79pub const DWL_EVENT_TYPE_TOUCH_DOWN: u32 = 0x20;
80pub const DWL_EVENT_TYPE_TOUCH_UP: u32 = 0x21;
81pub const DWL_EVENT_TYPE_TOUCH_MOTION: u32 = 0x22;
82
83pub const DWL_SURFACE_FLAG_RECEIVE_INPUT: u32 = 1 << 0;
84pub const DWL_SURFACE_FLAG_HAS_ALPHA: u32 = 1 << 1;
85
86#[repr(C)]
87#[derive(Debug, Copy, Clone)]
88pub struct dwl_event {
89    pub surface_descriptor: *const ::std::ffi::c_void,
90    pub event_type: u32,
91    pub params: [i32; 3usize],
92}
93
94#[allow(non_camel_case_types)]
95pub type dwl_error_callback_type =
96    ::std::option::Option<unsafe extern "C" fn(message: *const ::std::os::raw::c_char)>;
97
98extern "C" {
99    pub fn dwl_context_new(log_proc: dwl_error_callback_type) -> *mut dwl_context;
100}
101extern "C" {
102    pub fn dwl_context_destroy(self_: *mut *mut dwl_context);
103}
104extern "C" {
105    pub fn dwl_context_setup(
106        self_: *mut dwl_context,
107        socket_path: *const ::std::os::raw::c_char,
108    ) -> bool;
109}
110extern "C" {
111    pub fn dwl_context_fd(self_: *mut dwl_context) -> ::std::os::raw::c_int;
112}
113extern "C" {
114    pub fn dwl_context_dispatch(self_: *mut dwl_context);
115}
116extern "C" {
117    pub fn dwl_context_dmabuf_new(
118        self_: *mut dwl_context,
119        import_id: u32,
120        fd: ::std::os::raw::c_int,
121        offset: u32,
122        stride: u32,
123        modifiers: u64,
124        width: u32,
125        height: u32,
126        fourcc: u32,
127    ) -> *mut dwl_dmabuf;
128}
129extern "C" {
130    pub fn dwl_dmabuf_destroy(self_: *mut *mut dwl_dmabuf);
131}
132extern "C" {
133    pub fn dwl_context_surface_new(
134        self_: *mut dwl_context,
135        parent_id: u32,
136        surface_id: u32,
137        shm_fd: ::std::os::raw::c_int,
138        shm_size: usize,
139        buffer_size: usize,
140        width: u32,
141        height: u32,
142        stride: u32,
143        flags: u32,
144    ) -> *mut dwl_surface;
145}
146
147extern "C" {
148    pub fn dwl_surface_destroy(self_: *mut *mut dwl_surface);
149}
150extern "C" {
151    pub fn dwl_surface_commit(self_: *mut dwl_surface);
152}
153extern "C" {
154    pub fn dwl_surface_buffer_in_use(self_: *mut dwl_surface, buffer_index: usize) -> bool;
155}
156extern "C" {
157    pub fn dwl_surface_flip(self_: *mut dwl_surface, buffer_index: usize);
158}
159extern "C" {
160    pub fn dwl_surface_flip_to(self_: *mut dwl_surface, import_id: u32);
161}
162extern "C" {
163    pub fn dwl_surface_close_requested(self_: *const dwl_surface) -> bool;
164}
165extern "C" {
166    pub fn dwl_surface_set_position(self_: *mut dwl_surface, x: u32, y: u32);
167}
168extern "C" {
169    pub fn dwl_surface_descriptor(self_: *const dwl_surface) -> *const ::std::ffi::c_void;
170}
171extern "C" {
172    pub fn dwl_context_pending_events(self_: *const dwl_context) -> bool;
173}
174extern "C" {
175    pub fn dwl_context_next_event(self_: *mut dwl_context, event: *mut dwl_event);
176}
177extern "C" {
178    pub fn dwl_surface_set_scanout_id(self_: *mut dwl_surface, scanout_id: u32);
179}