1#[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}