xref: /aosp_15_r20/external/crosvm/gpu_display/src/dwl.rs (revision bb4ee6a4ae7042d18b07a98463b9c8b875e44b39)
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)]
44 pub struct wl_output {
45     _unused: [u8; 0],
46 }
47 #[repr(C)]
48 pub struct dwl_context {
49     pub _bindgen_opaque_blob: [u64; 52usize],
50 }
51 #[repr(C)]
52 #[derive(Debug, Copy, Clone)]
53 pub struct dwl_dmabuf {
54     pub _bindgen_opaque_blob: [u64; 3usize],
55 }
56 #[repr(C)]
57 #[derive(Debug, Copy, Clone)]
58 pub struct dwl_surface {
59     pub _bindgen_opaque_blob: [u64; 12usize],
60 }
61 
62 #[allow(dead_code)]
63 pub const DWL_KEYBOARD_KEY_STATE_RELEASED: i32 = 0;
64 pub const DWL_KEYBOARD_KEY_STATE_PRESSED: i32 = 1;
65 
66 #[allow(dead_code)]
67 pub const DWL_EVENT_TYPE_KEYBOARD_ENTER: u32 = 0x00;
68 #[allow(dead_code)]
69 pub const DWL_EVENT_TYPE_KEYBOARD_LEAVE: u32 = 0x01;
70 pub const DWL_EVENT_TYPE_KEYBOARD_KEY: u32 = 0x02;
71 #[allow(dead_code)]
72 pub const DWL_EVENT_TYPE_POINTER_ENTER: u32 = 0x10;
73 #[allow(dead_code)]
74 pub const DWL_EVENT_TYPE_POINTER_LEAVE: u32 = 0x11;
75 #[allow(dead_code)]
76 pub const DWL_EVENT_TYPE_POINTER_MOVE: u32 = 0x12;
77 #[allow(dead_code)]
78 pub const DWL_EVENT_TYPE_POINTER_BUTTON: u32 = 0x13;
79 pub const DWL_EVENT_TYPE_TOUCH_DOWN: u32 = 0x20;
80 pub const DWL_EVENT_TYPE_TOUCH_UP: u32 = 0x21;
81 pub const DWL_EVENT_TYPE_TOUCH_MOTION: u32 = 0x22;
82 
83 pub const DWL_SURFACE_FLAG_RECEIVE_INPUT: u32 = 1 << 0;
84 pub const DWL_SURFACE_FLAG_HAS_ALPHA: u32 = 1 << 1;
85 
86 #[repr(C)]
87 #[derive(Debug, Copy, Clone)]
88 pub 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)]
95 pub type dwl_error_callback_type =
96     ::std::option::Option<unsafe extern "C" fn(message: *const ::std::os::raw::c_char)>;
97 
98 extern "C" {
dwl_context_new(log_proc: dwl_error_callback_type) -> *mut dwl_context99     pub fn dwl_context_new(log_proc: dwl_error_callback_type) -> *mut dwl_context;
100 }
101 extern "C" {
dwl_context_destroy(self_: *mut *mut dwl_context)102     pub fn dwl_context_destroy(self_: *mut *mut dwl_context);
103 }
104 extern "C" {
dwl_context_setup( self_: *mut dwl_context, socket_path: *const ::std::os::raw::c_char, ) -> bool105     pub fn dwl_context_setup(
106         self_: *mut dwl_context,
107         socket_path: *const ::std::os::raw::c_char,
108     ) -> bool;
109 }
110 extern "C" {
dwl_context_fd(self_: *mut dwl_context) -> ::std::os::raw::c_int111     pub fn dwl_context_fd(self_: *mut dwl_context) -> ::std::os::raw::c_int;
112 }
113 extern "C" {
dwl_context_dispatch(self_: *mut dwl_context)114     pub fn dwl_context_dispatch(self_: *mut dwl_context);
115 }
116 extern "C" {
dwl_context_dmabuf_new( self_: *mut dwl_context, import_id: u32, fd: ::std::os::raw::c_int, offset: u32, stride: u32, modifiers: u64, width: u32, height: u32, fourcc: u32, ) -> *mut dwl_dmabuf117     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 }
129 extern "C" {
dwl_dmabuf_destroy(self_: *mut *mut dwl_dmabuf)130     pub fn dwl_dmabuf_destroy(self_: *mut *mut dwl_dmabuf);
131 }
132 extern "C" {
dwl_context_surface_new( self_: *mut dwl_context, parent_id: u32, surface_id: u32, shm_fd: ::std::os::raw::c_int, shm_size: usize, buffer_size: usize, width: u32, height: u32, stride: u32, flags: u32, ) -> *mut dwl_surface133     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 
147 extern "C" {
dwl_surface_destroy(self_: *mut *mut dwl_surface)148     pub fn dwl_surface_destroy(self_: *mut *mut dwl_surface);
149 }
150 extern "C" {
dwl_surface_commit(self_: *mut dwl_surface)151     pub fn dwl_surface_commit(self_: *mut dwl_surface);
152 }
153 extern "C" {
dwl_surface_buffer_in_use(self_: *mut dwl_surface, buffer_index: usize) -> bool154     pub fn dwl_surface_buffer_in_use(self_: *mut dwl_surface, buffer_index: usize) -> bool;
155 }
156 extern "C" {
dwl_surface_flip(self_: *mut dwl_surface, buffer_index: usize)157     pub fn dwl_surface_flip(self_: *mut dwl_surface, buffer_index: usize);
158 }
159 extern "C" {
dwl_surface_flip_to(self_: *mut dwl_surface, import_id: u32)160     pub fn dwl_surface_flip_to(self_: *mut dwl_surface, import_id: u32);
161 }
162 extern "C" {
dwl_surface_close_requested(self_: *const dwl_surface) -> bool163     pub fn dwl_surface_close_requested(self_: *const dwl_surface) -> bool;
164 }
165 extern "C" {
dwl_surface_set_position(self_: *mut dwl_surface, x: u32, y: u32)166     pub fn dwl_surface_set_position(self_: *mut dwl_surface, x: u32, y: u32);
167 }
168 extern "C" {
dwl_surface_descriptor(self_: *const dwl_surface) -> *const ::std::ffi::c_void169     pub fn dwl_surface_descriptor(self_: *const dwl_surface) -> *const ::std::ffi::c_void;
170 }
171 extern "C" {
dwl_context_pending_events(self_: *const dwl_context) -> bool172     pub fn dwl_context_pending_events(self_: *const dwl_context) -> bool;
173 }
174 extern "C" {
dwl_context_next_event(self_: *mut dwl_context, event: *mut dwl_event)175     pub fn dwl_context_next_event(self_: *mut dwl_context, event: *mut dwl_event);
176 }
177 extern "C" {
dwl_surface_set_scanout_id(self_: *mut dwl_surface, scanout_id: u32)178     pub fn dwl_surface_set_scanout_id(self_: *mut dwl_surface, scanout_id: u32);
179 }
180