use crate::base::{self, BaseError, BaseEvent, GeEvent, Raw, Reply, WiredIn, WiredOut, Xid};
use crate::ext;
use crate::ffi::base::*;
use crate::ffi::ext::*;
use crate::lat1_str::{Lat1Str, Lat1String, Lat1StrF};
use crate::xproto;
use crate::xproto::PropEl;
use bitflags::bitflags;
use libc::{self, iovec};
use std::convert::TryInto;
use std::hash::{Hash, Hasher};
use std::os::unix::io::RawFd;
pub const XNAME: &str = "GLX";
pub const MAJOR_VERSION: u32 = 1;
pub const MINOR_VERSION: u32 = 4;
pub const VERSION_STRING: &str = "1.4";
pub(crate) static mut FFI_EXT: xcb_extension_t = xcb_extension_t {
name: "GLX\0".as_ptr() as *const _,
global_id: 0,
};
pub fn prefetch_extension_data(conn: &base::Connection) {
unsafe {
xcb_prefetch_extension_data(conn.get_raw_conn(), &mut FFI_EXT as *mut _);
}
}
pub fn get_extension_data(conn: &base::Connection) -> std::option::Option<ext::ExtensionData> {
unsafe {
let reply = xcb_get_extension_data(conn.get_raw_conn(), &mut FFI_EXT as *mut _);
assert!(!reply.is_null(), "Could not fetch Glx extension data");
let reply = xproto::QueryExtensionReply::from_raw(reply);
if !reply.present() {
std::mem::forget(reply);
return None;
}
let res = ext::ExtensionData{
ext: ext::Extension::Glx,
major_opcode: reply.major_opcode(),
first_event: reply.first_event(),
first_error: reply.first_error(),
};
std::mem::forget(reply);
Some(res)
}
}
pub struct GenericError {
raw: *mut xcb_generic_error_t,
}
impl base::Raw<xcb_generic_error_t> for GenericError {
unsafe fn from_raw(raw: *mut xcb_generic_error_t) -> Self { GenericError { raw } }
fn as_raw(&self) -> *mut xcb_generic_error_t {
self.raw
}
}
impl base::BaseError for GenericError {
const EXTENSION: std::option::Option<ext::Extension> = Some(ext::Extension::Glx);
const NUMBER: u32 = u32::MAX;
}
impl GenericError {
fn wire_ptr(&self) -> *const u8 { self.raw as *const u8 }
fn wire_len(&self) -> usize { 32 }
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn error_code(&self) -> u8 {
unsafe {
let offset = 1usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn bad_value(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn minor_opcode(&self) -> u16 {
unsafe {
let offset = 8usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn major_opcode(&self) -> u8 {
unsafe {
let offset = 10usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
}
impl std::fmt::Debug for GenericError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GenericError")
.field("response_type", &self.response_type())
.field("error_code", &self.error_code())
.field("sequence", &self.sequence())
.field("bad_value", &self.bad_value())
.field("minor_opcode", &self.minor_opcode())
.field("major_opcode", &self.major_opcode())
.field("pad", &21)
.finish()
}
}
impl Drop for GenericError {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl Send for GenericError {}
unsafe impl Sync for GenericError {}
pub type BadContextError = GenericError;
pub type BadContextStateError = GenericError;
pub type BadDrawableError = GenericError;
pub type BadPixmapError = GenericError;
pub type BadContextTagError = GenericError;
pub type BadCurrentWindowError = GenericError;
pub type BadRenderRequestError = GenericError;
pub type BadLargeRequestError = GenericError;
pub type UnsupportedPrivateRequestError = GenericError;
pub type BadFbConfigError = GenericError;
pub type BadPbufferError = GenericError;
pub type BadCurrentDrawableError = GenericError;
pub type BadWindowError = GenericError;
pub type GlxBadProfileArbError = GenericError;
#[derive(Debug)]
pub enum Error {
Generic(GenericError),
BadContext(BadContextError),
BadContextState(BadContextStateError),
BadDrawable(BadDrawableError),
BadPixmap(BadPixmapError),
BadContextTag(BadContextTagError),
BadCurrentWindow(BadCurrentWindowError),
BadRenderRequest(BadRenderRequestError),
BadLargeRequest(BadLargeRequestError),
UnsupportedPrivateRequest(UnsupportedPrivateRequestError),
BadFbConfig(BadFbConfigError),
BadPbuffer(BadPbufferError),
BadCurrentDrawable(BadCurrentDrawableError),
BadWindow(BadWindowError),
GlxBadProfileArb(GlxBadProfileArbError),
}
impl base::ResolveWireError for Error {
unsafe fn resolve_wire_error(first_error: u8, raw: *mut xcb_generic_error_t) -> Self {
debug_assert!(!raw.is_null());
let error_code = (*raw).error_code;
match error_code - first_error {
0 => Error::BadContext(BadContextError::from_raw(raw)),
1 => Error::BadContextState(BadContextStateError::from_raw(raw)),
2 => Error::BadDrawable(BadDrawableError::from_raw(raw)),
3 => Error::BadPixmap(BadPixmapError::from_raw(raw)),
4 => Error::BadContextTag(BadContextTagError::from_raw(raw)),
5 => Error::BadCurrentWindow(BadCurrentWindowError::from_raw(raw)),
6 => Error::BadRenderRequest(BadRenderRequestError::from_raw(raw)),
7 => Error::BadLargeRequest(BadLargeRequestError::from_raw(raw)),
8 => Error::UnsupportedPrivateRequest(UnsupportedPrivateRequestError::from_raw(raw)),
9 => Error::BadFbConfig(BadFbConfigError::from_raw(raw)),
10 => Error::BadPbuffer(BadPbufferError::from_raw(raw)),
11 => Error::BadCurrentDrawable(BadCurrentDrawableError::from_raw(raw)),
12 => Error::BadWindow(BadWindowError::from_raw(raw)),
13 => Error::GlxBadProfileArb(GlxBadProfileArbError::from_raw(raw)),
_ => unreachable!(
"Could not resolve glx Error with error_code {} and first_error {}",
error_code, first_error
),
}
}
}
pub struct PbufferClobberEvent {
raw: *mut xcb_generic_event_t,
}
impl base::Raw<xcb_generic_event_t> for PbufferClobberEvent {
unsafe fn from_raw(raw: *mut xcb_generic_event_t) -> Self { PbufferClobberEvent { raw } }
fn as_raw(&self) -> *mut xcb_generic_event_t {
self.raw
}
}
impl base::BaseEvent for PbufferClobberEvent {
const EXTENSION: std::option::Option<ext::Extension> = Some(ext::Extension::Glx);
const NUMBER: u32 = 0;
}
impl PbufferClobberEvent {
pub fn new(event_base: u8,
event_type: u16,
draw_type: u16,
drawable: Drawable,
b_mask: u32,
aux_buffer: u16,
x: u16,
y: u16,
width: u16,
height: u16,
count: u16,
) -> PbufferClobberEvent {
unsafe {
let ptr = libc::malloc(32) as *mut u8;
let wire_buf = std::slice::from_raw_parts_mut(ptr, 32);
let mut wire_off = 0usize;
let response_type = event_base;
let sequence = 0u16;
wire_off += response_type.serialize(&mut wire_buf[wire_off ..]);
wire_off += 1usize;
wire_off += sequence.serialize(&mut wire_buf[wire_off ..]);
wire_off += event_type.serialize(&mut wire_buf[wire_off ..]);
wire_off += draw_type.serialize(&mut wire_buf[wire_off ..]);
wire_off += drawable.serialize(&mut wire_buf[wire_off ..]);
wire_off += b_mask.serialize(&mut wire_buf[wire_off ..]);
wire_off += aux_buffer.serialize(&mut wire_buf[wire_off ..]);
wire_off += x.serialize(&mut wire_buf[wire_off ..]);
wire_off += y.serialize(&mut wire_buf[wire_off ..]);
wire_off += width.serialize(&mut wire_buf[wire_off ..]);
wire_off += height.serialize(&mut wire_buf[wire_off ..]);
count.serialize(&mut wire_buf[wire_off ..]);
PbufferClobberEvent::from_raw(ptr as *mut xcb_generic_event_t)
}
}
fn wire_ptr(&self) -> *const u8 { self.raw as *const u8 }
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn event_type(&self) -> u16 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn draw_type(&self) -> u16 {
unsafe {
let offset = 6usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
fn drawable(&self) -> Drawable {
unsafe {
let offset = 8usize;
let res_id = *(self.wire_ptr().add(offset) as *const u32);
Drawable::Unknown(res_id)
}
}
pub fn b_mask(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn aux_buffer(&self) -> u16 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn x(&self) -> u16 {
unsafe {
let offset = 18usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn y(&self) -> u16 {
unsafe {
let offset = 20usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn width(&self) -> u16 {
unsafe {
let offset = 22usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn height(&self) -> u16 {
unsafe {
let offset = 24usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn count(&self) -> u16 {
unsafe {
let offset = 26usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
}
impl std::fmt::Debug for PbufferClobberEvent {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("PbufferClobberEvent")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("event_type", &self.event_type())
.field("draw_type", &self.draw_type())
.field("drawable", &self.drawable())
.field("b_mask", &self.b_mask())
.field("aux_buffer", &self.aux_buffer())
.field("x", &self.x())
.field("y", &self.y())
.field("width", &self.width())
.field("height", &self.height())
.field("count", &self.count())
.field("pad", &4)
.finish()
}
}
impl base::WiredOut for PbufferClobberEvent {
fn wire_len(&self) -> usize {
32usize
}
fn serialize(&self, wire_buf: &mut[u8]) -> usize {
debug_assert!(wire_buf.len() >= self.wire_len());
let raw_slice = unsafe { std::slice::from_raw_parts(self.raw as *const u8, self.wire_len()) };
wire_buf[0 .. self.wire_len()].copy_from_slice(raw_slice);
self.wire_len()
}
}
impl base::WiredIn for PbufferClobberEvent {
type Params = ();
unsafe fn compute_wire_len(_ptr: *const u8, _params: ()) -> usize {
32
}
unsafe fn unserialize(ptr: *const u8, _params: (), offset: &mut usize) -> Self {
let sz = Self::compute_wire_len(ptr, ());
*offset += sz;
let raw = libc::malloc(sz) as *mut xcb_generic_event_t;
std::ptr::copy(ptr as *const xcb_generic_event_t, raw, sz);
PbufferClobberEvent { raw }
}
}
impl Drop for PbufferClobberEvent {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl Send for PbufferClobberEvent {}
unsafe impl Sync for PbufferClobberEvent {}
pub struct BufferSwapCompleteEvent {
raw: *mut xcb_generic_event_t,
}
impl base::Raw<xcb_generic_event_t> for BufferSwapCompleteEvent {
unsafe fn from_raw(raw: *mut xcb_generic_event_t) -> Self { BufferSwapCompleteEvent { raw } }
fn as_raw(&self) -> *mut xcb_generic_event_t {
self.raw
}
}
impl base::BaseEvent for BufferSwapCompleteEvent {
const EXTENSION: std::option::Option<ext::Extension> = Some(ext::Extension::Glx);
const NUMBER: u32 = 1;
}
impl BufferSwapCompleteEvent {
pub fn new(event_base: u8,
event_type: u16,
drawable: Drawable,
ust_hi: u32,
ust_lo: u32,
msc_hi: u32,
msc_lo: u32,
sbc: u32,
) -> BufferSwapCompleteEvent {
unsafe {
let ptr = libc::malloc(32) as *mut u8;
let wire_buf = std::slice::from_raw_parts_mut(ptr, 32);
let mut wire_off = 0usize;
let response_type = 1u8 + event_base;
let sequence = 0u16;
wire_off += response_type.serialize(&mut wire_buf[wire_off ..]);
wire_off += 1usize;
wire_off += sequence.serialize(&mut wire_buf[wire_off ..]);
wire_off += event_type.serialize(&mut wire_buf[wire_off ..]);
wire_off += 2usize;
wire_off += drawable.serialize(&mut wire_buf[wire_off ..]);
wire_off += ust_hi.serialize(&mut wire_buf[wire_off ..]);
wire_off += ust_lo.serialize(&mut wire_buf[wire_off ..]);
wire_off += msc_hi.serialize(&mut wire_buf[wire_off ..]);
wire_off += msc_lo.serialize(&mut wire_buf[wire_off ..]);
sbc.serialize(&mut wire_buf[wire_off ..]);
BufferSwapCompleteEvent::from_raw(ptr as *mut xcb_generic_event_t)
}
}
fn wire_ptr(&self) -> *const u8 { self.raw as *const u8 }
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn event_type(&self) -> u16 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
fn drawable(&self) -> Drawable {
unsafe {
let offset = 8usize;
let res_id = *(self.wire_ptr().add(offset) as *const u32);
Drawable::Unknown(res_id)
}
}
pub fn ust_hi(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn ust_lo(&self) -> u32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn msc_hi(&self) -> u32 {
unsafe {
let offset = 20usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn msc_lo(&self) -> u32 {
unsafe {
let offset = 24usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn sbc(&self) -> u32 {
unsafe {
let offset = 28usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
}
impl std::fmt::Debug for BufferSwapCompleteEvent {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("BufferSwapCompleteEvent")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("event_type", &self.event_type())
.field("pad", &2)
.field("drawable", &self.drawable())
.field("ust_hi", &self.ust_hi())
.field("ust_lo", &self.ust_lo())
.field("msc_hi", &self.msc_hi())
.field("msc_lo", &self.msc_lo())
.field("sbc", &self.sbc())
.finish()
}
}
impl base::WiredOut for BufferSwapCompleteEvent {
fn wire_len(&self) -> usize {
32usize
}
fn serialize(&self, wire_buf: &mut[u8]) -> usize {
debug_assert!(wire_buf.len() >= self.wire_len());
let raw_slice = unsafe { std::slice::from_raw_parts(self.raw as *const u8, self.wire_len()) };
wire_buf[0 .. self.wire_len()].copy_from_slice(raw_slice);
self.wire_len()
}
}
impl base::WiredIn for BufferSwapCompleteEvent {
type Params = ();
unsafe fn compute_wire_len(_ptr: *const u8, _params: ()) -> usize {
32
}
unsafe fn unserialize(ptr: *const u8, _params: (), offset: &mut usize) -> Self {
let sz = Self::compute_wire_len(ptr, ());
*offset += sz;
let raw = libc::malloc(sz) as *mut xcb_generic_event_t;
std::ptr::copy(ptr as *const xcb_generic_event_t, raw, sz);
BufferSwapCompleteEvent { raw }
}
}
impl Drop for BufferSwapCompleteEvent {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl Send for BufferSwapCompleteEvent {}
unsafe impl Sync for BufferSwapCompleteEvent {}
#[derive(Debug)]
pub enum Event {
PbufferClobber(PbufferClobberEvent),
BufferSwapComplete(BufferSwapCompleteEvent),
}
impl Event {
pub fn as_raw(&self) -> *mut xcb_generic_event_t {
match self {
Self::PbufferClobber(e) => e.as_raw(),
Self::BufferSwapComplete(e) => e.as_raw(),
}
}
}
impl base::ResolveWireEvent for Event {
unsafe fn resolve_wire_event(first_event: u8, raw: *mut xcb_generic_event_t) -> std::option::Option<Self> {
debug_assert!(!raw.is_null());
let response_type = (*raw).response_type & 0x7F;
debug_assert!(response_type != 0, "This is not an event but an error!");
debug_assert!(response_type != XCB_GE_GENERIC, "This is a GE_GENERIC event!");
match response_type - first_event {
0 => Some(Event::PbufferClobber(PbufferClobberEvent::from_raw(raw))),
1 => Some(Event::BufferSwapComplete(BufferSwapCompleteEvent::from_raw(raw))),
_ => None,
}
}
}
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[repr(C)]
pub struct Pixmap {
res_id: u32,
}
impl base::Xid for Pixmap {
fn none() -> Self { Pixmap { res_id: 0 } }
fn resource_id(&self) -> u32 { self.res_id }
}
impl base::XidNew for Pixmap {
unsafe fn new(res_id: u32) -> Self { Pixmap { res_id } }
}
#[test]
fn test_sizeof_pixmap() {
assert_eq!(std::mem::size_of::<Pixmap>(), 4);
}
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[repr(C)]
pub struct Context {
res_id: u32,
}
impl base::Xid for Context {
fn none() -> Self { Context { res_id: 0 } }
fn resource_id(&self) -> u32 { self.res_id }
}
impl base::XidNew for Context {
unsafe fn new(res_id: u32) -> Self { Context { res_id } }
}
#[test]
fn test_sizeof_context() {
assert_eq!(std::mem::size_of::<Context>(), 4);
}
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[repr(C)]
pub struct Pbuffer {
res_id: u32,
}
impl base::Xid for Pbuffer {
fn none() -> Self { Pbuffer { res_id: 0 } }
fn resource_id(&self) -> u32 { self.res_id }
}
impl base::XidNew for Pbuffer {
unsafe fn new(res_id: u32) -> Self { Pbuffer { res_id } }
}
#[test]
fn test_sizeof_pbuffer() {
assert_eq!(std::mem::size_of::<Pbuffer>(), 4);
}
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[repr(C)]
pub struct Window {
res_id: u32,
}
impl base::Xid for Window {
fn none() -> Self { Window { res_id: 0 } }
fn resource_id(&self) -> u32 { self.res_id }
}
impl base::XidNew for Window {
unsafe fn new(res_id: u32) -> Self { Window { res_id } }
}
#[test]
fn test_sizeof_window() {
assert_eq!(std::mem::size_of::<Window>(), 4);
}
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[repr(C)]
pub struct Fbconfig {
res_id: u32,
}
impl base::Xid for Fbconfig {
fn none() -> Self { Fbconfig { res_id: 0 } }
fn resource_id(&self) -> u32 { self.res_id }
}
impl base::XidNew for Fbconfig {
unsafe fn new(res_id: u32) -> Self { Fbconfig { res_id } }
}
#[test]
fn test_sizeof_fbconfig() {
assert_eq!(std::mem::size_of::<Fbconfig>(), 4);
}
#[derive(Copy, Clone, Debug)]
pub enum Drawable {
None,
Unknown(u32),
XprotoWindow(xproto::Window),
Pbuffer(Pbuffer),
Pixmap(Pixmap),
Window(Window),
}
impl base::Xid for Drawable {
fn none() -> Self { Drawable::None }
fn resource_id(&self) -> u32 {
match self {
Drawable::None => 0,
Drawable::Unknown(id) => *id,
Drawable::XprotoWindow(xid) => xid.resource_id(),
Drawable::Pbuffer(xid) => xid.resource_id(),
Drawable::Pixmap(xid) => xid.resource_id(),
Drawable::Window(xid) => xid.resource_id(),
}
}
}
impl PartialEq for Drawable {
fn eq(&self, rhs: &Drawable) -> bool {
self.resource_id() == rhs.resource_id()
}
}
impl Eq for Drawable {}
impl Hash for Drawable {
fn hash<H: Hasher>(&self, state: &mut H) {
self.resource_id().hash(state);
}
}
impl PartialEq<xproto::Window> for Drawable {
fn eq(&self, rhs: &xproto::Window) -> bool {
self.resource_id() == rhs.resource_id()
}
}
impl PartialEq<Drawable> for xproto::Window {
fn eq(&self, rhs: &Drawable) -> bool {
self.resource_id() == rhs.resource_id()
}
}
impl PartialEq<Pbuffer> for Drawable {
fn eq(&self, rhs: &Pbuffer) -> bool {
self.resource_id() == rhs.resource_id()
}
}
impl PartialEq<Drawable> for Pbuffer {
fn eq(&self, rhs: &Drawable) -> bool {
self.resource_id() == rhs.resource_id()
}
}
impl PartialEq<Pixmap> for Drawable {
fn eq(&self, rhs: &Pixmap) -> bool {
self.resource_id() == rhs.resource_id()
}
}
impl PartialEq<Drawable> for Pixmap {
fn eq(&self, rhs: &Drawable) -> bool {
self.resource_id() == rhs.resource_id()
}
}
impl PartialEq<Window> for Drawable {
fn eq(&self, rhs: &Window) -> bool {
self.resource_id() == rhs.resource_id()
}
}
impl PartialEq<Drawable> for Window {
fn eq(&self, rhs: &Drawable) -> bool {
self.resource_id() == rhs.resource_id()
}
}
pub type ContextTag = u32;
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
#[repr(u32)]
pub enum Pbcet {
Damaged = 32791,
Saved = 32792,
}
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
#[repr(u32)]
pub enum Pbcdt {
Window = 32793,
Pbuffer = 32794,
}
bitflags! {
pub struct Gc: u32 {
const GL_CURRENT_BIT = 0x00000001;
const GL_POINT_BIT = 0x00000002;
const GL_LINE_BIT = 0x00000004;
const GL_POLYGON_BIT = 0x00000008;
const GL_POLYGON_STIPPLE_BIT = 0x00000010;
const GL_PIXEL_MODE_BIT = 0x00000020;
const GL_LIGHTING_BIT = 0x00000040;
const GL_FOG_BIT = 0x00000080;
const GL_DEPTH_BUFFER_BIT = 0x00000100;
const GL_ACCUM_BUFFER_BIT = 0x00000200;
const GL_STENCIL_BUFFER_BIT = 0x00000400;
const GL_VIEWPORT_BIT = 0x00000800;
const GL_TRANSFORM_BIT = 0x00001000;
const GL_ENABLE_BIT = 0x00002000;
const GL_COLOR_BUFFER_BIT = 0x00004000;
const GL_HINT_BIT = 0x00008000;
const GL_EVAL_BIT = 0x00010000;
const GL_LIST_BIT = 0x00020000;
const GL_TEXTURE_BIT = 0x00040000;
const GL_SCISSOR_BIT = 0x00080000;
const GL_ALL_ATTRIB_BITS = 0x00ffffff;
}
}
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
#[repr(u32)]
pub enum Rm {
GlRender = 7168,
GlFeedback = 7169,
GlSelect = 7170,
}
pub(crate) fn request_name(opcode: u16) -> std::option::Option<&'static str> {
match opcode {
1 => Some("glx::Render"),
2 => Some("glx::RenderLarge"),
3 => Some("glx::CreateContext"),
4 => Some("glx::DestroyContext"),
5 => Some("glx::MakeCurrent"),
6 => Some("glx::IsDirect"),
7 => Some("glx::QueryVersion"),
8 => Some("glx::WaitGl"),
9 => Some("glx::WaitX"),
10 => Some("glx::CopyContext"),
11 => Some("glx::SwapBuffers"),
12 => Some("glx::UseXFont"),
13 => Some("glx::CreateGlxPixmap"),
14 => Some("glx::GetVisualConfigs"),
15 => Some("glx::DestroyGlxPixmap"),
16 => Some("glx::VendorPrivate"),
17 => Some("glx::VendorPrivateWithReply"),
18 => Some("glx::QueryExtensionsString"),
19 => Some("glx::QueryServerString"),
20 => Some("glx::ClientInfo"),
21 => Some("glx::GetFbConfigs"),
22 => Some("glx::CreatePixmap"),
23 => Some("glx::DestroyPixmap"),
24 => Some("glx::CreateNewContext"),
25 => Some("glx::QueryContext"),
26 => Some("glx::MakeContextCurrent"),
27 => Some("glx::CreatePbuffer"),
28 => Some("glx::DestroyPbuffer"),
29 => Some("glx::GetDrawableAttributes"),
30 => Some("glx::ChangeDrawableAttributes"),
31 => Some("glx::CreateWindow"),
32 => Some("glx::DeleteWindow"),
33 => Some("glx::SetClientInfoArb"),
34 => Some("glx::CreateContextAttribsArb"),
35 => Some("glx::SetClientInfo2arb"),
101 => Some("glx::NewList"),
102 => Some("glx::EndList"),
103 => Some("glx::DeleteLists"),
104 => Some("glx::GenLists"),
105 => Some("glx::FeedbackBuffer"),
106 => Some("glx::SelectBuffer"),
107 => Some("glx::RenderMode"),
108 => Some("glx::Finish"),
109 => Some("glx::PixelStoref"),
110 => Some("glx::PixelStorei"),
111 => Some("glx::ReadPixels"),
112 => Some("glx::GetBooleanv"),
113 => Some("glx::GetClipPlane"),
114 => Some("glx::GetDoublev"),
115 => Some("glx::GetError"),
116 => Some("glx::GetFloatv"),
117 => Some("glx::GetIntegerv"),
118 => Some("glx::GetLightfv"),
119 => Some("glx::GetLightiv"),
120 => Some("glx::GetMapdv"),
121 => Some("glx::GetMapfv"),
122 => Some("glx::GetMapiv"),
123 => Some("glx::GetMaterialfv"),
124 => Some("glx::GetMaterialiv"),
125 => Some("glx::GetPixelMapfv"),
126 => Some("glx::GetPixelMapuiv"),
127 => Some("glx::GetPixelMapusv"),
128 => Some("glx::GetPolygonStipple"),
129 => Some("glx::GetString"),
130 => Some("glx::GetTexEnvfv"),
131 => Some("glx::GetTexEnviv"),
132 => Some("glx::GetTexGendv"),
133 => Some("glx::GetTexGenfv"),
134 => Some("glx::GetTexGeniv"),
135 => Some("glx::GetTexImage"),
136 => Some("glx::GetTexParameterfv"),
137 => Some("glx::GetTexParameteriv"),
138 => Some("glx::GetTexLevelParameterfv"),
139 => Some("glx::GetTexLevelParameteriv"),
140 => Some("glx::IsEnabled"),
141 => Some("glx::IsList"),
142 => Some("glx::Flush"),
143 => Some("glx::AreTexturesResident"),
144 => Some("glx::DeleteTextures"),
145 => Some("glx::GenTextures"),
146 => Some("glx::IsTexture"),
147 => Some("glx::GetColorTable"),
148 => Some("glx::GetColorTableParameterfv"),
149 => Some("glx::GetColorTableParameteriv"),
150 => Some("glx::GetConvolutionFilter"),
151 => Some("glx::GetConvolutionParameterfv"),
152 => Some("glx::GetConvolutionParameteriv"),
153 => Some("glx::GetSeparableFilter"),
154 => Some("glx::GetHistogram"),
155 => Some("glx::GetHistogramParameterfv"),
156 => Some("glx::GetHistogramParameteriv"),
157 => Some("glx::GetMinmax"),
158 => Some("glx::GetMinmaxParameterfv"),
159 => Some("glx::GetMinmaxParameteriv"),
160 => Some("glx::GetCompressedTexImageArb"),
161 => Some("glx::DeleteQueriesArb"),
162 => Some("glx::GenQueriesArb"),
163 => Some("glx::IsQueryArb"),
164 => Some("glx::GetQueryivArb"),
165 => Some("glx::GetQueryObjectivArb"),
166 => Some("glx::GetQueryObjectuivArb"),
_ => None,
}
}
#[derive(Clone, Debug)]
pub struct Render<'a> {
pub context_tag: ContextTag,
pub data: &'a [u8],
}
unsafe impl<'a> base::RawRequest for Render<'a> {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 4,
ext: (&mut FFI_EXT) as *mut _,
opcode: 1,
isvoid: 1,
};
let mut sections: [iovec; 6] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 6];
let buf0: &mut [u8] = &mut [0; 8];
self.context_tag.serialize(&mut buf0[4 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 8;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
sections[4].iov_base = self.data.as_ptr() as *mut _;
sections[4].iov_len = self.data.len() * std::mem::size_of::<u8>();
sections[5].iov_len = base::align_pad(sections[4].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl<'a> base::Request for Render<'a> {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl<'a> base::RequestWithoutReply for Render<'a> {
}
#[derive(Clone, Debug)]
pub struct RenderLarge<'a> {
pub context_tag: ContextTag,
pub request_num: u16,
pub request_total: u16,
pub data: &'a [u8],
}
unsafe impl<'a> base::RawRequest for RenderLarge<'a> {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 4,
ext: (&mut FFI_EXT) as *mut _,
opcode: 2,
isvoid: 1,
};
let mut sections: [iovec; 6] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 6];
let buf0: &mut [u8] = &mut [0; 16];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.request_num.serialize(&mut buf0[8 .. ]);
self.request_total.serialize(&mut buf0[10 .. ]);
(self.data.len() as u32).serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
sections[4].iov_base = self.data.as_ptr() as *mut _;
sections[4].iov_len = self.data.len() * std::mem::size_of::<u8>();
sections[5].iov_len = base::align_pad(sections[4].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl<'a> base::Request for RenderLarge<'a> {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl<'a> base::RequestWithoutReply for RenderLarge<'a> {
}
#[derive(Clone, Debug)]
pub struct CreateContext {
pub context: Context,
pub visual: xproto::Visualid,
pub screen: u32,
pub share_list: Context,
pub is_direct: bool,
}
unsafe impl base::RawRequest for CreateContext {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 3,
isvoid: 1,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 24];
self.context.serialize(&mut buf0[4 .. ]);
self.visual.serialize(&mut buf0[8 .. ]);
self.screen.serialize(&mut buf0[12 .. ]);
self.share_list.serialize(&mut buf0[16 .. ]);
(if self.is_direct { 1u8 } else { 0u8 }).serialize(&mut buf0[20 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 24;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for CreateContext {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl base::RequestWithoutReply for CreateContext {
}
#[derive(Clone, Debug)]
pub struct DestroyContext {
pub context: Context,
}
unsafe impl base::RawRequest for DestroyContext {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 4,
isvoid: 1,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 8];
self.context.serialize(&mut buf0[4 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 8;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for DestroyContext {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl base::RequestWithoutReply for DestroyContext {
}
pub struct MakeCurrentReply {
raw: *const u8,
}
impl MakeCurrentReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn context_tag(&self) -> ContextTag {
unsafe {
let offset = 8usize;
let ptr = self.wire_ptr().add(offset) as *const ContextTag;
base::value_from_ptr(ptr)
}
}
}
impl base::Reply for MakeCurrentReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for MakeCurrentReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("MakeCurrentReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("context_tag", &self.context_tag())
.field("pad", &20)
.finish()
}
}
impl Drop for MakeCurrentReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for MakeCurrentReply {}
unsafe impl std::marker::Sync for MakeCurrentReply {}
#[derive(Debug)]
pub struct MakeCurrentCookie {
seq: u64,
}
#[derive(Debug)]
pub struct MakeCurrentCookieUnchecked {
seq: u64,
}
impl base::Cookie for MakeCurrentCookie {
unsafe fn from_sequence(seq: u64) -> Self {
MakeCurrentCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for MakeCurrentCookie {
}
unsafe impl base::CookieWithReplyChecked for MakeCurrentCookie {
type Reply = MakeCurrentReply;
}
impl base::Cookie for MakeCurrentCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
MakeCurrentCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for MakeCurrentCookieUnchecked {
type Reply = MakeCurrentReply;
}
#[derive(Clone, Debug)]
pub struct MakeCurrent {
pub drawable: Drawable,
pub context: Context,
pub old_context_tag: ContextTag,
}
unsafe impl base::RawRequest for MakeCurrent {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 5,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 16];
self.drawable.serialize(&mut buf0[4 .. ]);
self.context.serialize(&mut buf0[8 .. ]);
self.old_context_tag.serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for MakeCurrent {
type Cookie = MakeCurrentCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for MakeCurrent {
type Reply = MakeCurrentReply;
type Cookie = MakeCurrentCookie;
type CookieUnchecked = MakeCurrentCookieUnchecked;
}
pub struct IsDirectReply {
raw: *const u8,
}
impl IsDirectReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn is_direct(&self) -> bool {
let val = unsafe { *(self.wire_ptr().add(8usize)) };
val != 0
}
}
impl base::Reply for IsDirectReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for IsDirectReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("IsDirectReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("is_direct", &self.is_direct())
.field("pad", &23)
.finish()
}
}
impl Drop for IsDirectReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for IsDirectReply {}
unsafe impl std::marker::Sync for IsDirectReply {}
#[derive(Debug)]
pub struct IsDirectCookie {
seq: u64,
}
#[derive(Debug)]
pub struct IsDirectCookieUnchecked {
seq: u64,
}
impl base::Cookie for IsDirectCookie {
unsafe fn from_sequence(seq: u64) -> Self {
IsDirectCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for IsDirectCookie {
}
unsafe impl base::CookieWithReplyChecked for IsDirectCookie {
type Reply = IsDirectReply;
}
impl base::Cookie for IsDirectCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
IsDirectCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for IsDirectCookieUnchecked {
type Reply = IsDirectReply;
}
#[derive(Clone, Debug)]
pub struct IsDirect {
pub context: Context,
}
unsafe impl base::RawRequest for IsDirect {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 6,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 8];
self.context.serialize(&mut buf0[4 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 8;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for IsDirect {
type Cookie = IsDirectCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for IsDirect {
type Reply = IsDirectReply;
type Cookie = IsDirectCookie;
type CookieUnchecked = IsDirectCookieUnchecked;
}
pub struct QueryVersionReply {
raw: *const u8,
}
impl QueryVersionReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn major_version(&self) -> u32 {
unsafe {
let offset = 8usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn minor_version(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
}
impl base::Reply for QueryVersionReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for QueryVersionReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("QueryVersionReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("major_version", &self.major_version())
.field("minor_version", &self.minor_version())
.field("pad", &16)
.finish()
}
}
impl Drop for QueryVersionReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for QueryVersionReply {}
unsafe impl std::marker::Sync for QueryVersionReply {}
#[derive(Debug)]
pub struct QueryVersionCookie {
seq: u64,
}
#[derive(Debug)]
pub struct QueryVersionCookieUnchecked {
seq: u64,
}
impl base::Cookie for QueryVersionCookie {
unsafe fn from_sequence(seq: u64) -> Self {
QueryVersionCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for QueryVersionCookie {
}
unsafe impl base::CookieWithReplyChecked for QueryVersionCookie {
type Reply = QueryVersionReply;
}
impl base::Cookie for QueryVersionCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
QueryVersionCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for QueryVersionCookieUnchecked {
type Reply = QueryVersionReply;
}
#[derive(Clone, Debug)]
pub struct QueryVersion {
pub major_version: u32,
pub minor_version: u32,
}
unsafe impl base::RawRequest for QueryVersion {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 7,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 12];
self.major_version.serialize(&mut buf0[4 .. ]);
self.minor_version.serialize(&mut buf0[8 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 12;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for QueryVersion {
type Cookie = QueryVersionCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for QueryVersion {
type Reply = QueryVersionReply;
type Cookie = QueryVersionCookie;
type CookieUnchecked = QueryVersionCookieUnchecked;
}
#[derive(Clone, Debug)]
pub struct WaitGl {
pub context_tag: ContextTag,
}
unsafe impl base::RawRequest for WaitGl {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 8,
isvoid: 1,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 8];
self.context_tag.serialize(&mut buf0[4 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 8;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for WaitGl {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl base::RequestWithoutReply for WaitGl {
}
#[derive(Clone, Debug)]
pub struct WaitX {
pub context_tag: ContextTag,
}
unsafe impl base::RawRequest for WaitX {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 9,
isvoid: 1,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 8];
self.context_tag.serialize(&mut buf0[4 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 8;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for WaitX {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl base::RequestWithoutReply for WaitX {
}
#[derive(Clone, Debug)]
pub struct CopyContext {
pub src: Context,
pub dest: Context,
pub mask: u32,
pub src_context_tag: ContextTag,
}
unsafe impl base::RawRequest for CopyContext {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 10,
isvoid: 1,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 20];
self.src.serialize(&mut buf0[4 .. ]);
self.dest.serialize(&mut buf0[8 .. ]);
self.mask.serialize(&mut buf0[12 .. ]);
self.src_context_tag.serialize(&mut buf0[16 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 20;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for CopyContext {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl base::RequestWithoutReply for CopyContext {
}
#[derive(Clone, Debug)]
pub struct SwapBuffers {
pub context_tag: ContextTag,
pub drawable: Drawable,
}
unsafe impl base::RawRequest for SwapBuffers {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 11,
isvoid: 1,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 12];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.drawable.serialize(&mut buf0[8 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 12;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for SwapBuffers {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl base::RequestWithoutReply for SwapBuffers {
}
#[derive(Clone, Debug)]
pub struct UseXFont {
pub context_tag: ContextTag,
pub font: xproto::Font,
pub first: u32,
pub count: u32,
pub list_base: u32,
}
unsafe impl base::RawRequest for UseXFont {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 12,
isvoid: 1,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 24];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.font.serialize(&mut buf0[8 .. ]);
self.first.serialize(&mut buf0[12 .. ]);
self.count.serialize(&mut buf0[16 .. ]);
self.list_base.serialize(&mut buf0[20 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 24;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for UseXFont {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl base::RequestWithoutReply for UseXFont {
}
#[derive(Clone, Debug)]
pub struct CreateGlxPixmap {
pub screen: u32,
pub visual: xproto::Visualid,
pub pixmap: xproto::Pixmap,
pub glx_pixmap: Pixmap,
}
unsafe impl base::RawRequest for CreateGlxPixmap {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 13,
isvoid: 1,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 20];
self.screen.serialize(&mut buf0[4 .. ]);
self.visual.serialize(&mut buf0[8 .. ]);
self.pixmap.serialize(&mut buf0[12 .. ]);
self.glx_pixmap.serialize(&mut buf0[16 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 20;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for CreateGlxPixmap {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl base::RequestWithoutReply for CreateGlxPixmap {
}
pub struct GetVisualConfigsReply {
raw: *const u8,
}
impl GetVisualConfigsReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
let length = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 4usize;
sz += 16usize;
sz += ((length as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn num_visuals(&self) -> u32 {
unsafe {
let offset = 8usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn num_properties(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn property_list(&self) -> &[u32] {
unsafe {
let offset = 32usize;
let len = (self.length() as usize);
let ptr = self.wire_ptr().add(offset) as *const u32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetVisualConfigsReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetVisualConfigsReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetVisualConfigsReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("num_visuals", &self.num_visuals())
.field("num_properties", &self.num_properties())
.field("pad", &16)
.field("property_list", &self.property_list())
.finish()
}
}
impl Drop for GetVisualConfigsReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetVisualConfigsReply {}
unsafe impl std::marker::Sync for GetVisualConfigsReply {}
#[derive(Debug)]
pub struct GetVisualConfigsCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetVisualConfigsCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetVisualConfigsCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetVisualConfigsCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetVisualConfigsCookie {
}
unsafe impl base::CookieWithReplyChecked for GetVisualConfigsCookie {
type Reply = GetVisualConfigsReply;
}
impl base::Cookie for GetVisualConfigsCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetVisualConfigsCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetVisualConfigsCookieUnchecked {
type Reply = GetVisualConfigsReply;
}
#[derive(Clone, Debug)]
pub struct GetVisualConfigs {
pub screen: u32,
}
unsafe impl base::RawRequest for GetVisualConfigs {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 14,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 8];
self.screen.serialize(&mut buf0[4 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 8;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetVisualConfigs {
type Cookie = GetVisualConfigsCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetVisualConfigs {
type Reply = GetVisualConfigsReply;
type Cookie = GetVisualConfigsCookie;
type CookieUnchecked = GetVisualConfigsCookieUnchecked;
}
#[derive(Clone, Debug)]
pub struct DestroyGlxPixmap {
pub glx_pixmap: Pixmap,
}
unsafe impl base::RawRequest for DestroyGlxPixmap {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 15,
isvoid: 1,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 8];
self.glx_pixmap.serialize(&mut buf0[4 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 8;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for DestroyGlxPixmap {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl base::RequestWithoutReply for DestroyGlxPixmap {
}
#[derive(Clone, Debug)]
pub struct VendorPrivate<'a> {
pub vendor_code: u32,
pub context_tag: ContextTag,
pub data: &'a [u8],
}
unsafe impl<'a> base::RawRequest for VendorPrivate<'a> {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 4,
ext: (&mut FFI_EXT) as *mut _,
opcode: 16,
isvoid: 1,
};
let mut sections: [iovec; 6] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 6];
let buf0: &mut [u8] = &mut [0; 12];
self.vendor_code.serialize(&mut buf0[4 .. ]);
self.context_tag.serialize(&mut buf0[8 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 12;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
sections[4].iov_base = self.data.as_ptr() as *mut _;
sections[4].iov_len = self.data.len() * std::mem::size_of::<u8>();
sections[5].iov_len = base::align_pad(sections[4].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl<'a> base::Request for VendorPrivate<'a> {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl<'a> base::RequestWithoutReply for VendorPrivate<'a> {
}
pub struct VendorPrivateWithReplyReply {
raw: *const u8,
}
impl VendorPrivateWithReplyReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
let length = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 24usize;
sz += ((length as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn retval(&self) -> u32 {
unsafe {
let offset = 8usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn data1(&self) -> &[u8; 24] {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const [u8; 24];
&*ptr
}
}
pub fn data2(&self) -> &[u8] {
unsafe {
let offset = 36usize;
let len = ((self.length() as usize) * 4usize);
let ptr = self.wire_ptr().add(offset) as *const u8;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for VendorPrivateWithReplyReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for VendorPrivateWithReplyReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("VendorPrivateWithReplyReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("retval", &self.retval())
.field("data1", &self.data1())
.field("data2", &self.data2())
.finish()
}
}
impl Drop for VendorPrivateWithReplyReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for VendorPrivateWithReplyReply {}
unsafe impl std::marker::Sync for VendorPrivateWithReplyReply {}
#[derive(Debug)]
pub struct VendorPrivateWithReplyCookie {
seq: u64,
}
#[derive(Debug)]
pub struct VendorPrivateWithReplyCookieUnchecked {
seq: u64,
}
impl base::Cookie for VendorPrivateWithReplyCookie {
unsafe fn from_sequence(seq: u64) -> Self {
VendorPrivateWithReplyCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for VendorPrivateWithReplyCookie {
}
unsafe impl base::CookieWithReplyChecked for VendorPrivateWithReplyCookie {
type Reply = VendorPrivateWithReplyReply;
}
impl base::Cookie for VendorPrivateWithReplyCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
VendorPrivateWithReplyCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for VendorPrivateWithReplyCookieUnchecked {
type Reply = VendorPrivateWithReplyReply;
}
#[derive(Clone, Debug)]
pub struct VendorPrivateWithReply<'a> {
pub vendor_code: u32,
pub context_tag: ContextTag,
pub data: &'a [u8],
}
unsafe impl<'a> base::RawRequest for VendorPrivateWithReply<'a> {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 4,
ext: (&mut FFI_EXT) as *mut _,
opcode: 17,
isvoid: 0,
};
let mut sections: [iovec; 6] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 6];
let buf0: &mut [u8] = &mut [0; 12];
self.vendor_code.serialize(&mut buf0[4 .. ]);
self.context_tag.serialize(&mut buf0[8 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 12;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
sections[4].iov_base = self.data.as_ptr() as *mut _;
sections[4].iov_len = self.data.len() * std::mem::size_of::<u8>();
sections[5].iov_len = base::align_pad(sections[4].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl<'a> base::Request for VendorPrivateWithReply<'a> {
type Cookie = VendorPrivateWithReplyCookie;
const IS_VOID: bool = false;
}
impl<'a> base::RequestWithReply for VendorPrivateWithReply<'a> {
type Reply = VendorPrivateWithReplyReply;
type Cookie = VendorPrivateWithReplyCookie;
type CookieUnchecked = VendorPrivateWithReplyCookieUnchecked;
}
pub struct QueryExtensionsStringReply {
raw: *const u8,
}
impl QueryExtensionsStringReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
}
impl base::Reply for QueryExtensionsStringReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for QueryExtensionsStringReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("QueryExtensionsStringReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("pad", &16)
.finish()
}
}
impl Drop for QueryExtensionsStringReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for QueryExtensionsStringReply {}
unsafe impl std::marker::Sync for QueryExtensionsStringReply {}
#[derive(Debug)]
pub struct QueryExtensionsStringCookie {
seq: u64,
}
#[derive(Debug)]
pub struct QueryExtensionsStringCookieUnchecked {
seq: u64,
}
impl base::Cookie for QueryExtensionsStringCookie {
unsafe fn from_sequence(seq: u64) -> Self {
QueryExtensionsStringCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for QueryExtensionsStringCookie {
}
unsafe impl base::CookieWithReplyChecked for QueryExtensionsStringCookie {
type Reply = QueryExtensionsStringReply;
}
impl base::Cookie for QueryExtensionsStringCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
QueryExtensionsStringCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for QueryExtensionsStringCookieUnchecked {
type Reply = QueryExtensionsStringReply;
}
#[derive(Clone, Debug)]
pub struct QueryExtensionsString {
pub screen: u32,
}
unsafe impl base::RawRequest for QueryExtensionsString {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 18,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 8];
self.screen.serialize(&mut buf0[4 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 8;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for QueryExtensionsString {
type Cookie = QueryExtensionsStringCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for QueryExtensionsString {
type Reply = QueryExtensionsStringReply;
type Cookie = QueryExtensionsStringCookie;
type CookieUnchecked = QueryExtensionsStringCookieUnchecked;
}
pub struct QueryServerStringReply {
raw: *const u8,
}
impl QueryServerStringReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let str_len = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 16usize;
sz += (str_len as usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn str_len(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn string(&self) -> &Lat1Str {
unsafe {
let offset = 32usize;
let len = (self.str_len() as usize) as _;
let ptr = self.wire_ptr().add(offset);
let bytes = std::slice::from_raw_parts(ptr, len);
Lat1Str::from_bytes(bytes)
}
}
}
impl base::Reply for QueryServerStringReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for QueryServerStringReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("QueryServerStringReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("str_len", &self.str_len())
.field("pad", &16)
.field("string", &self.string())
.finish()
}
}
impl Drop for QueryServerStringReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for QueryServerStringReply {}
unsafe impl std::marker::Sync for QueryServerStringReply {}
#[derive(Debug)]
pub struct QueryServerStringCookie {
seq: u64,
}
#[derive(Debug)]
pub struct QueryServerStringCookieUnchecked {
seq: u64,
}
impl base::Cookie for QueryServerStringCookie {
unsafe fn from_sequence(seq: u64) -> Self {
QueryServerStringCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for QueryServerStringCookie {
}
unsafe impl base::CookieWithReplyChecked for QueryServerStringCookie {
type Reply = QueryServerStringReply;
}
impl base::Cookie for QueryServerStringCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
QueryServerStringCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for QueryServerStringCookieUnchecked {
type Reply = QueryServerStringReply;
}
#[derive(Clone, Debug)]
pub struct QueryServerString {
pub screen: u32,
pub name: u32,
}
unsafe impl base::RawRequest for QueryServerString {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 19,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 12];
self.screen.serialize(&mut buf0[4 .. ]);
self.name.serialize(&mut buf0[8 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 12;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for QueryServerString {
type Cookie = QueryServerStringCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for QueryServerString {
type Reply = QueryServerStringReply;
type Cookie = QueryServerStringCookie;
type CookieUnchecked = QueryServerStringCookieUnchecked;
}
#[derive(Clone, Debug)]
pub struct ClientInfo<'a> {
pub major_version: u32,
pub minor_version: u32,
pub string: &'a [u8],
}
unsafe impl<'a> base::RawRequest for ClientInfo<'a> {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 4,
ext: (&mut FFI_EXT) as *mut _,
opcode: 20,
isvoid: 1,
};
let mut sections: [iovec; 6] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 6];
let buf0: &mut [u8] = &mut [0; 16];
self.major_version.serialize(&mut buf0[4 .. ]);
self.minor_version.serialize(&mut buf0[8 .. ]);
(self.string.len() as u32).serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
sections[4].iov_base = self.string.as_ptr() as *mut _;
sections[4].iov_len = self.string.len();
sections[5].iov_len = base::align_pad(sections[4].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl<'a> base::Request for ClientInfo<'a> {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl<'a> base::RequestWithoutReply for ClientInfo<'a> {
}
pub struct GetFbConfigsReply {
raw: *const u8,
}
impl GetFbConfigsReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
let length = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 4usize;
sz += 16usize;
sz += ((length as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn num_fb_configs(&self) -> u32 {
unsafe {
let offset = 8usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn num_properties(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn property_list(&self) -> &[u32] {
unsafe {
let offset = 32usize;
let len = (self.length() as usize);
let ptr = self.wire_ptr().add(offset) as *const u32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetFbConfigsReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetFbConfigsReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetFbConfigsReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("num_fb_configs", &self.num_fb_configs())
.field("num_properties", &self.num_properties())
.field("pad", &16)
.field("property_list", &self.property_list())
.finish()
}
}
impl Drop for GetFbConfigsReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetFbConfigsReply {}
unsafe impl std::marker::Sync for GetFbConfigsReply {}
#[derive(Debug)]
pub struct GetFbConfigsCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetFbConfigsCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetFbConfigsCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetFbConfigsCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetFbConfigsCookie {
}
unsafe impl base::CookieWithReplyChecked for GetFbConfigsCookie {
type Reply = GetFbConfigsReply;
}
impl base::Cookie for GetFbConfigsCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetFbConfigsCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetFbConfigsCookieUnchecked {
type Reply = GetFbConfigsReply;
}
#[derive(Clone, Debug)]
pub struct GetFbConfigs {
pub screen: u32,
}
unsafe impl base::RawRequest for GetFbConfigs {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 21,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 8];
self.screen.serialize(&mut buf0[4 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 8;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetFbConfigs {
type Cookie = GetFbConfigsCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetFbConfigs {
type Reply = GetFbConfigsReply;
type Cookie = GetFbConfigsCookie;
type CookieUnchecked = GetFbConfigsCookieUnchecked;
}
#[derive(Clone, Debug)]
pub struct CreatePixmap<'a> {
pub screen: u32,
pub fbconfig: Fbconfig,
pub pixmap: xproto::Pixmap,
pub glx_pixmap: Pixmap,
pub num_attribs: u32,
pub attribs: &'a [u32],
}
unsafe impl<'a> base::RawRequest for CreatePixmap<'a> {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 4,
ext: (&mut FFI_EXT) as *mut _,
opcode: 22,
isvoid: 1,
};
let mut sections: [iovec; 6] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 6];
let buf0: &mut [u8] = &mut [0; 24];
self.screen.serialize(&mut buf0[4 .. ]);
self.fbconfig.serialize(&mut buf0[8 .. ]);
self.pixmap.serialize(&mut buf0[12 .. ]);
self.glx_pixmap.serialize(&mut buf0[16 .. ]);
self.num_attribs.serialize(&mut buf0[20 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 24;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
sections[4].iov_base = self.attribs.as_ptr() as *mut _;
sections[4].iov_len = self.attribs.len() * std::mem::size_of::<u32>();
sections[5].iov_len = base::align_pad(sections[4].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl<'a> base::Request for CreatePixmap<'a> {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl<'a> base::RequestWithoutReply for CreatePixmap<'a> {
}
#[derive(Clone, Debug)]
pub struct DestroyPixmap {
pub glx_pixmap: Pixmap,
}
unsafe impl base::RawRequest for DestroyPixmap {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 23,
isvoid: 1,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 8];
self.glx_pixmap.serialize(&mut buf0[4 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 8;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for DestroyPixmap {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl base::RequestWithoutReply for DestroyPixmap {
}
#[derive(Clone, Debug)]
pub struct CreateNewContext {
pub context: Context,
pub fbconfig: Fbconfig,
pub screen: u32,
pub render_type: u32,
pub share_list: Context,
pub is_direct: bool,
}
unsafe impl base::RawRequest for CreateNewContext {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 24,
isvoid: 1,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 28];
self.context.serialize(&mut buf0[4 .. ]);
self.fbconfig.serialize(&mut buf0[8 .. ]);
self.screen.serialize(&mut buf0[12 .. ]);
self.render_type.serialize(&mut buf0[16 .. ]);
self.share_list.serialize(&mut buf0[20 .. ]);
(if self.is_direct { 1u8 } else { 0u8 }).serialize(&mut buf0[24 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 28;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for CreateNewContext {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl base::RequestWithoutReply for CreateNewContext {
}
pub struct QueryContextReply {
raw: *const u8,
}
impl QueryContextReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
let num_attribs = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 20usize;
sz += (((num_attribs as usize) * 2usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn num_attribs(&self) -> u32 {
unsafe {
let offset = 8usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn attribs(&self) -> &[u32] {
unsafe {
let offset = 32usize;
let len = ((self.num_attribs() as usize) * 2usize);
let ptr = self.wire_ptr().add(offset) as *const u32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for QueryContextReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for QueryContextReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("QueryContextReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("num_attribs", &self.num_attribs())
.field("pad", &20)
.field("attribs", &self.attribs())
.finish()
}
}
impl Drop for QueryContextReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for QueryContextReply {}
unsafe impl std::marker::Sync for QueryContextReply {}
#[derive(Debug)]
pub struct QueryContextCookie {
seq: u64,
}
#[derive(Debug)]
pub struct QueryContextCookieUnchecked {
seq: u64,
}
impl base::Cookie for QueryContextCookie {
unsafe fn from_sequence(seq: u64) -> Self {
QueryContextCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for QueryContextCookie {
}
unsafe impl base::CookieWithReplyChecked for QueryContextCookie {
type Reply = QueryContextReply;
}
impl base::Cookie for QueryContextCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
QueryContextCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for QueryContextCookieUnchecked {
type Reply = QueryContextReply;
}
#[derive(Clone, Debug)]
pub struct QueryContext {
pub context: Context,
}
unsafe impl base::RawRequest for QueryContext {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 25,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 8];
self.context.serialize(&mut buf0[4 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 8;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for QueryContext {
type Cookie = QueryContextCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for QueryContext {
type Reply = QueryContextReply;
type Cookie = QueryContextCookie;
type CookieUnchecked = QueryContextCookieUnchecked;
}
pub struct MakeContextCurrentReply {
raw: *const u8,
}
impl MakeContextCurrentReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn context_tag(&self) -> ContextTag {
unsafe {
let offset = 8usize;
let ptr = self.wire_ptr().add(offset) as *const ContextTag;
base::value_from_ptr(ptr)
}
}
}
impl base::Reply for MakeContextCurrentReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for MakeContextCurrentReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("MakeContextCurrentReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("context_tag", &self.context_tag())
.field("pad", &20)
.finish()
}
}
impl Drop for MakeContextCurrentReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for MakeContextCurrentReply {}
unsafe impl std::marker::Sync for MakeContextCurrentReply {}
#[derive(Debug)]
pub struct MakeContextCurrentCookie {
seq: u64,
}
#[derive(Debug)]
pub struct MakeContextCurrentCookieUnchecked {
seq: u64,
}
impl base::Cookie for MakeContextCurrentCookie {
unsafe fn from_sequence(seq: u64) -> Self {
MakeContextCurrentCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for MakeContextCurrentCookie {
}
unsafe impl base::CookieWithReplyChecked for MakeContextCurrentCookie {
type Reply = MakeContextCurrentReply;
}
impl base::Cookie for MakeContextCurrentCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
MakeContextCurrentCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for MakeContextCurrentCookieUnchecked {
type Reply = MakeContextCurrentReply;
}
#[derive(Clone, Debug)]
pub struct MakeContextCurrent {
pub old_context_tag: ContextTag,
pub drawable: Drawable,
pub read_drawable: Drawable,
pub context: Context,
}
unsafe impl base::RawRequest for MakeContextCurrent {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 26,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 20];
self.old_context_tag.serialize(&mut buf0[4 .. ]);
self.drawable.serialize(&mut buf0[8 .. ]);
self.read_drawable.serialize(&mut buf0[12 .. ]);
self.context.serialize(&mut buf0[16 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 20;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for MakeContextCurrent {
type Cookie = MakeContextCurrentCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for MakeContextCurrent {
type Reply = MakeContextCurrentReply;
type Cookie = MakeContextCurrentCookie;
type CookieUnchecked = MakeContextCurrentCookieUnchecked;
}
#[derive(Clone, Debug)]
pub struct CreatePbuffer<'a> {
pub screen: u32,
pub fbconfig: Fbconfig,
pub pbuffer: Pbuffer,
pub num_attribs: u32,
pub attribs: &'a [u32],
}
unsafe impl<'a> base::RawRequest for CreatePbuffer<'a> {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 4,
ext: (&mut FFI_EXT) as *mut _,
opcode: 27,
isvoid: 1,
};
let mut sections: [iovec; 6] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 6];
let buf0: &mut [u8] = &mut [0; 20];
self.screen.serialize(&mut buf0[4 .. ]);
self.fbconfig.serialize(&mut buf0[8 .. ]);
self.pbuffer.serialize(&mut buf0[12 .. ]);
self.num_attribs.serialize(&mut buf0[16 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 20;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
sections[4].iov_base = self.attribs.as_ptr() as *mut _;
sections[4].iov_len = self.attribs.len() * std::mem::size_of::<u32>();
sections[5].iov_len = base::align_pad(sections[4].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl<'a> base::Request for CreatePbuffer<'a> {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl<'a> base::RequestWithoutReply for CreatePbuffer<'a> {
}
#[derive(Clone, Debug)]
pub struct DestroyPbuffer {
pub pbuffer: Pbuffer,
}
unsafe impl base::RawRequest for DestroyPbuffer {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 28,
isvoid: 1,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 8];
self.pbuffer.serialize(&mut buf0[4 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 8;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for DestroyPbuffer {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl base::RequestWithoutReply for DestroyPbuffer {
}
pub struct GetDrawableAttributesReply {
raw: *const u8,
}
impl GetDrawableAttributesReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
let num_attribs = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 20usize;
sz += (((num_attribs as usize) * 2usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn num_attribs(&self) -> u32 {
unsafe {
let offset = 8usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn attribs(&self) -> &[u32] {
unsafe {
let offset = 32usize;
let len = ((self.num_attribs() as usize) * 2usize);
let ptr = self.wire_ptr().add(offset) as *const u32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetDrawableAttributesReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetDrawableAttributesReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetDrawableAttributesReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("num_attribs", &self.num_attribs())
.field("pad", &20)
.field("attribs", &self.attribs())
.finish()
}
}
impl Drop for GetDrawableAttributesReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetDrawableAttributesReply {}
unsafe impl std::marker::Sync for GetDrawableAttributesReply {}
#[derive(Debug)]
pub struct GetDrawableAttributesCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetDrawableAttributesCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetDrawableAttributesCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetDrawableAttributesCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetDrawableAttributesCookie {
}
unsafe impl base::CookieWithReplyChecked for GetDrawableAttributesCookie {
type Reply = GetDrawableAttributesReply;
}
impl base::Cookie for GetDrawableAttributesCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetDrawableAttributesCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetDrawableAttributesCookieUnchecked {
type Reply = GetDrawableAttributesReply;
}
#[derive(Clone, Debug)]
pub struct GetDrawableAttributes {
pub drawable: Drawable,
}
unsafe impl base::RawRequest for GetDrawableAttributes {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 29,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 8];
self.drawable.serialize(&mut buf0[4 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 8;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetDrawableAttributes {
type Cookie = GetDrawableAttributesCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetDrawableAttributes {
type Reply = GetDrawableAttributesReply;
type Cookie = GetDrawableAttributesCookie;
type CookieUnchecked = GetDrawableAttributesCookieUnchecked;
}
#[derive(Clone, Debug)]
pub struct ChangeDrawableAttributes<'a> {
pub drawable: Drawable,
pub num_attribs: u32,
pub attribs: &'a [u32],
}
unsafe impl<'a> base::RawRequest for ChangeDrawableAttributes<'a> {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 4,
ext: (&mut FFI_EXT) as *mut _,
opcode: 30,
isvoid: 1,
};
let mut sections: [iovec; 6] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 6];
let buf0: &mut [u8] = &mut [0; 12];
self.drawable.serialize(&mut buf0[4 .. ]);
self.num_attribs.serialize(&mut buf0[8 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 12;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
sections[4].iov_base = self.attribs.as_ptr() as *mut _;
sections[4].iov_len = self.attribs.len() * std::mem::size_of::<u32>();
sections[5].iov_len = base::align_pad(sections[4].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl<'a> base::Request for ChangeDrawableAttributes<'a> {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl<'a> base::RequestWithoutReply for ChangeDrawableAttributes<'a> {
}
#[derive(Clone, Debug)]
pub struct CreateWindow<'a> {
pub screen: u32,
pub fbconfig: Fbconfig,
pub window: xproto::Window,
pub glx_window: Window,
pub num_attribs: u32,
pub attribs: &'a [u32],
}
unsafe impl<'a> base::RawRequest for CreateWindow<'a> {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 4,
ext: (&mut FFI_EXT) as *mut _,
opcode: 31,
isvoid: 1,
};
let mut sections: [iovec; 6] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 6];
let buf0: &mut [u8] = &mut [0; 24];
self.screen.serialize(&mut buf0[4 .. ]);
self.fbconfig.serialize(&mut buf0[8 .. ]);
self.window.serialize(&mut buf0[12 .. ]);
self.glx_window.serialize(&mut buf0[16 .. ]);
self.num_attribs.serialize(&mut buf0[20 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 24;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
sections[4].iov_base = self.attribs.as_ptr() as *mut _;
sections[4].iov_len = self.attribs.len() * std::mem::size_of::<u32>();
sections[5].iov_len = base::align_pad(sections[4].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl<'a> base::Request for CreateWindow<'a> {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl<'a> base::RequestWithoutReply for CreateWindow<'a> {
}
#[derive(Clone, Debug)]
pub struct DeleteWindow {
pub glxwindow: Window,
}
unsafe impl base::RawRequest for DeleteWindow {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 32,
isvoid: 1,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 8];
self.glxwindow.serialize(&mut buf0[4 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 8;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for DeleteWindow {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl base::RequestWithoutReply for DeleteWindow {
}
#[derive(Clone, Debug)]
pub struct SetClientInfoArb<'a> {
pub major_version: u32,
pub minor_version: u32,
pub num_versions: u32,
pub gl_versions: &'a [u32],
pub gl_extension_string: &'a [u8],
pub glx_extension_string: &'a [u8],
}
unsafe impl<'a> base::RawRequest for SetClientInfoArb<'a> {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 8,
ext: (&mut FFI_EXT) as *mut _,
opcode: 33,
isvoid: 1,
};
let mut sections: [iovec; 10] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 10];
let buf0: &mut [u8] = &mut [0; 24];
self.major_version.serialize(&mut buf0[4 .. ]);
self.minor_version.serialize(&mut buf0[8 .. ]);
self.num_versions.serialize(&mut buf0[12 .. ]);
(self.gl_extension_string.len() as u32).serialize(&mut buf0[16 .. ]);
(self.glx_extension_string.len() as u32).serialize(&mut buf0[20 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 24;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
sections[4].iov_base = self.gl_versions.as_ptr() as *mut _;
sections[4].iov_len = self.gl_versions.len() * std::mem::size_of::<u32>();
sections[5].iov_len = base::align_pad(sections[4].iov_len, 4);
sections[6].iov_base = self.gl_extension_string.as_ptr() as *mut _;
sections[6].iov_len = self.gl_extension_string.len();
sections[7].iov_len = base::align_pad(sections[6].iov_len, 4);
sections[8].iov_base = self.glx_extension_string.as_ptr() as *mut _;
sections[8].iov_len = self.glx_extension_string.len();
sections[9].iov_len = base::align_pad(sections[8].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl<'a> base::Request for SetClientInfoArb<'a> {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl<'a> base::RequestWithoutReply for SetClientInfoArb<'a> {
}
#[derive(Clone, Debug)]
pub struct CreateContextAttribsArb<'a> {
pub context: Context,
pub fbconfig: Fbconfig,
pub screen: u32,
pub share_list: Context,
pub is_direct: bool,
pub num_attribs: u32,
pub attribs: &'a [u32],
}
unsafe impl<'a> base::RawRequest for CreateContextAttribsArb<'a> {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 4,
ext: (&mut FFI_EXT) as *mut _,
opcode: 34,
isvoid: 1,
};
let mut sections: [iovec; 6] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 6];
let buf0: &mut [u8] = &mut [0; 28];
self.context.serialize(&mut buf0[4 .. ]);
self.fbconfig.serialize(&mut buf0[8 .. ]);
self.screen.serialize(&mut buf0[12 .. ]);
self.share_list.serialize(&mut buf0[16 .. ]);
(if self.is_direct { 1u8 } else { 0u8 }).serialize(&mut buf0[20 .. ]);
self.num_attribs.serialize(&mut buf0[24 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 28;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
sections[4].iov_base = self.attribs.as_ptr() as *mut _;
sections[4].iov_len = self.attribs.len() * std::mem::size_of::<u32>();
sections[5].iov_len = base::align_pad(sections[4].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl<'a> base::Request for CreateContextAttribsArb<'a> {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl<'a> base::RequestWithoutReply for CreateContextAttribsArb<'a> {
}
#[derive(Clone, Debug)]
pub struct SetClientInfo2arb<'a> {
pub major_version: u32,
pub minor_version: u32,
pub num_versions: u32,
pub gl_versions: &'a [u32],
pub gl_extension_string: &'a [u8],
pub glx_extension_string: &'a [u8],
}
unsafe impl<'a> base::RawRequest for SetClientInfo2arb<'a> {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 8,
ext: (&mut FFI_EXT) as *mut _,
opcode: 35,
isvoid: 1,
};
let mut sections: [iovec; 10] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 10];
let buf0: &mut [u8] = &mut [0; 24];
self.major_version.serialize(&mut buf0[4 .. ]);
self.minor_version.serialize(&mut buf0[8 .. ]);
self.num_versions.serialize(&mut buf0[12 .. ]);
(self.gl_extension_string.len() as u32).serialize(&mut buf0[16 .. ]);
(self.glx_extension_string.len() as u32).serialize(&mut buf0[20 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 24;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
sections[4].iov_base = self.gl_versions.as_ptr() as *mut _;
sections[4].iov_len = self.gl_versions.len() * std::mem::size_of::<u32>();
sections[5].iov_len = base::align_pad(sections[4].iov_len, 4);
sections[6].iov_base = self.gl_extension_string.as_ptr() as *mut _;
sections[6].iov_len = self.gl_extension_string.len();
sections[7].iov_len = base::align_pad(sections[6].iov_len, 4);
sections[8].iov_base = self.glx_extension_string.as_ptr() as *mut _;
sections[8].iov_len = self.glx_extension_string.len();
sections[9].iov_len = base::align_pad(sections[8].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl<'a> base::Request for SetClientInfo2arb<'a> {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl<'a> base::RequestWithoutReply for SetClientInfo2arb<'a> {
}
#[derive(Clone, Debug)]
pub struct NewList {
pub context_tag: ContextTag,
pub list: u32,
pub mode: u32,
}
unsafe impl base::RawRequest for NewList {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 101,
isvoid: 1,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 16];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.list.serialize(&mut buf0[8 .. ]);
self.mode.serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for NewList {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl base::RequestWithoutReply for NewList {
}
#[derive(Clone, Debug)]
pub struct EndList {
pub context_tag: ContextTag,
}
unsafe impl base::RawRequest for EndList {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 102,
isvoid: 1,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 8];
self.context_tag.serialize(&mut buf0[4 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 8;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for EndList {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl base::RequestWithoutReply for EndList {
}
#[derive(Clone, Debug)]
pub struct DeleteLists {
pub context_tag: ContextTag,
pub list: u32,
pub range: i32,
}
unsafe impl base::RawRequest for DeleteLists {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 103,
isvoid: 1,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 16];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.list.serialize(&mut buf0[8 .. ]);
self.range.serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for DeleteLists {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl base::RequestWithoutReply for DeleteLists {
}
pub struct GenListsReply {
raw: *const u8,
}
impl GenListsReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn ret_val(&self) -> u32 {
unsafe {
let offset = 8usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
}
impl base::Reply for GenListsReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GenListsReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GenListsReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("ret_val", &self.ret_val())
.finish()
}
}
impl Drop for GenListsReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GenListsReply {}
unsafe impl std::marker::Sync for GenListsReply {}
#[derive(Debug)]
pub struct GenListsCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GenListsCookieUnchecked {
seq: u64,
}
impl base::Cookie for GenListsCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GenListsCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GenListsCookie {
}
unsafe impl base::CookieWithReplyChecked for GenListsCookie {
type Reply = GenListsReply;
}
impl base::Cookie for GenListsCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GenListsCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GenListsCookieUnchecked {
type Reply = GenListsReply;
}
#[derive(Clone, Debug)]
pub struct GenLists {
pub context_tag: ContextTag,
pub range: i32,
}
unsafe impl base::RawRequest for GenLists {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 104,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 12];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.range.serialize(&mut buf0[8 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 12;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GenLists {
type Cookie = GenListsCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GenLists {
type Reply = GenListsReply;
type Cookie = GenListsCookie;
type CookieUnchecked = GenListsCookieUnchecked;
}
#[derive(Clone, Debug)]
pub struct FeedbackBuffer {
pub context_tag: ContextTag,
pub size: i32,
pub r#type: i32,
}
unsafe impl base::RawRequest for FeedbackBuffer {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 105,
isvoid: 1,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 16];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.size.serialize(&mut buf0[8 .. ]);
self.r#type.serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for FeedbackBuffer {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl base::RequestWithoutReply for FeedbackBuffer {
}
#[derive(Clone, Debug)]
pub struct SelectBuffer {
pub context_tag: ContextTag,
pub size: i32,
}
unsafe impl base::RawRequest for SelectBuffer {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 106,
isvoid: 1,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 12];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.size.serialize(&mut buf0[8 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 12;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for SelectBuffer {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl base::RequestWithoutReply for SelectBuffer {
}
pub struct RenderModeReply {
raw: *const u8,
}
impl RenderModeReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 12usize;
sz += ((n as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn ret_val(&self) -> u32 {
unsafe {
let offset = 8usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn new_mode(&self) -> u32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[u32] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const u32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for RenderModeReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for RenderModeReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("RenderModeReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("ret_val", &self.ret_val())
.field("n", &self.n())
.field("new_mode", &self.new_mode())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for RenderModeReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for RenderModeReply {}
unsafe impl std::marker::Sync for RenderModeReply {}
#[derive(Debug)]
pub struct RenderModeCookie {
seq: u64,
}
#[derive(Debug)]
pub struct RenderModeCookieUnchecked {
seq: u64,
}
impl base::Cookie for RenderModeCookie {
unsafe fn from_sequence(seq: u64) -> Self {
RenderModeCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for RenderModeCookie {
}
unsafe impl base::CookieWithReplyChecked for RenderModeCookie {
type Reply = RenderModeReply;
}
impl base::Cookie for RenderModeCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
RenderModeCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for RenderModeCookieUnchecked {
type Reply = RenderModeReply;
}
#[derive(Clone, Debug)]
pub struct RenderMode {
pub context_tag: ContextTag,
pub mode: u32,
}
unsafe impl base::RawRequest for RenderMode {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 107,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 12];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.mode.serialize(&mut buf0[8 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 12;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for RenderMode {
type Cookie = RenderModeCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for RenderMode {
type Reply = RenderModeReply;
type Cookie = RenderModeCookie;
type CookieUnchecked = RenderModeCookieUnchecked;
}
pub struct FinishReply {
raw: *const u8,
}
impl FinishReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
}
impl base::Reply for FinishReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for FinishReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("FinishReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.finish()
}
}
impl Drop for FinishReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for FinishReply {}
unsafe impl std::marker::Sync for FinishReply {}
#[derive(Debug)]
pub struct FinishCookie {
seq: u64,
}
#[derive(Debug)]
pub struct FinishCookieUnchecked {
seq: u64,
}
impl base::Cookie for FinishCookie {
unsafe fn from_sequence(seq: u64) -> Self {
FinishCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for FinishCookie {
}
unsafe impl base::CookieWithReplyChecked for FinishCookie {
type Reply = FinishReply;
}
impl base::Cookie for FinishCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
FinishCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for FinishCookieUnchecked {
type Reply = FinishReply;
}
#[derive(Clone, Debug)]
pub struct Finish {
pub context_tag: ContextTag,
}
unsafe impl base::RawRequest for Finish {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 108,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 8];
self.context_tag.serialize(&mut buf0[4 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 8;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for Finish {
type Cookie = FinishCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for Finish {
type Reply = FinishReply;
type Cookie = FinishCookie;
type CookieUnchecked = FinishCookieUnchecked;
}
#[derive(Clone, Debug)]
pub struct PixelStoref {
pub context_tag: ContextTag,
pub pname: u32,
pub datum: f32,
}
unsafe impl base::RawRequest for PixelStoref {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 109,
isvoid: 1,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 16];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.pname.serialize(&mut buf0[8 .. ]);
self.datum.serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for PixelStoref {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl base::RequestWithoutReply for PixelStoref {
}
#[derive(Clone, Debug)]
pub struct PixelStorei {
pub context_tag: ContextTag,
pub pname: u32,
pub datum: i32,
}
unsafe impl base::RawRequest for PixelStorei {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 110,
isvoid: 1,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 16];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.pname.serialize(&mut buf0[8 .. ]);
self.datum.serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for PixelStorei {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl base::RequestWithoutReply for PixelStorei {
}
pub struct ReadPixelsReply {
raw: *const u8,
}
impl ReadPixelsReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
let length = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 24usize;
sz += ((length as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[u8] {
unsafe {
let offset = 32usize;
let len = ((self.length() as usize) * 4usize);
let ptr = self.wire_ptr().add(offset) as *const u8;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for ReadPixelsReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for ReadPixelsReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("ReadPixelsReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &24)
.field("data", &self.data())
.finish()
}
}
impl Drop for ReadPixelsReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for ReadPixelsReply {}
unsafe impl std::marker::Sync for ReadPixelsReply {}
#[derive(Debug)]
pub struct ReadPixelsCookie {
seq: u64,
}
#[derive(Debug)]
pub struct ReadPixelsCookieUnchecked {
seq: u64,
}
impl base::Cookie for ReadPixelsCookie {
unsafe fn from_sequence(seq: u64) -> Self {
ReadPixelsCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for ReadPixelsCookie {
}
unsafe impl base::CookieWithReplyChecked for ReadPixelsCookie {
type Reply = ReadPixelsReply;
}
impl base::Cookie for ReadPixelsCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
ReadPixelsCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for ReadPixelsCookieUnchecked {
type Reply = ReadPixelsReply;
}
#[derive(Clone, Debug)]
pub struct ReadPixels {
pub context_tag: ContextTag,
pub x: i32,
pub y: i32,
pub width: i32,
pub height: i32,
pub format: u32,
pub r#type: u32,
pub swap_bytes: bool,
pub lsb_first: bool,
}
unsafe impl base::RawRequest for ReadPixels {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 111,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 34];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.x.serialize(&mut buf0[8 .. ]);
self.y.serialize(&mut buf0[12 .. ]);
self.width.serialize(&mut buf0[16 .. ]);
self.height.serialize(&mut buf0[20 .. ]);
self.format.serialize(&mut buf0[24 .. ]);
self.r#type.serialize(&mut buf0[28 .. ]);
(if self.swap_bytes { 1u8 } else { 0u8 }).serialize(&mut buf0[32 .. ]);
(if self.lsb_first { 1u8 } else { 0u8 }).serialize(&mut buf0[33 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 34;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for ReadPixels {
type Cookie = ReadPixelsCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for ReadPixels {
type Reply = ReadPixelsReply;
type Cookie = ReadPixelsCookie;
type CookieUnchecked = ReadPixelsCookieUnchecked;
}
pub struct GetBooleanvReply {
raw: *const u8,
}
impl GetBooleanvReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 1usize;
sz += 15usize;
sz += (n as usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> bool {
let val = unsafe { *(self.wire_ptr().add(16usize)) };
val != 0
}
pub fn data(&self) -> &[bool] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const bool;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetBooleanvReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetBooleanvReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetBooleanvReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &15)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetBooleanvReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetBooleanvReply {}
unsafe impl std::marker::Sync for GetBooleanvReply {}
#[derive(Debug)]
pub struct GetBooleanvCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetBooleanvCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetBooleanvCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetBooleanvCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetBooleanvCookie {
}
unsafe impl base::CookieWithReplyChecked for GetBooleanvCookie {
type Reply = GetBooleanvReply;
}
impl base::Cookie for GetBooleanvCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetBooleanvCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetBooleanvCookieUnchecked {
type Reply = GetBooleanvReply;
}
#[derive(Clone, Debug)]
pub struct GetBooleanv {
pub context_tag: ContextTag,
pub pname: i32,
}
unsafe impl base::RawRequest for GetBooleanv {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 112,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 12];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.pname.serialize(&mut buf0[8 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 12;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetBooleanv {
type Cookie = GetBooleanvCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetBooleanv {
type Reply = GetBooleanvReply;
type Cookie = GetBooleanvCookie;
type CookieUnchecked = GetBooleanvCookieUnchecked;
}
pub struct GetClipPlaneReply {
raw: *const u8,
}
impl GetClipPlaneReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
let length = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 24usize;
sz += (((length as usize) / 2usize) * 8usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[f64] {
unsafe {
let offset = 32usize;
let len = ((self.length() as usize) / 2usize);
let ptr = self.wire_ptr().add(offset) as *const f64;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetClipPlaneReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetClipPlaneReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetClipPlaneReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &24)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetClipPlaneReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetClipPlaneReply {}
unsafe impl std::marker::Sync for GetClipPlaneReply {}
#[derive(Debug)]
pub struct GetClipPlaneCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetClipPlaneCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetClipPlaneCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetClipPlaneCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetClipPlaneCookie {
}
unsafe impl base::CookieWithReplyChecked for GetClipPlaneCookie {
type Reply = GetClipPlaneReply;
}
impl base::Cookie for GetClipPlaneCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetClipPlaneCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetClipPlaneCookieUnchecked {
type Reply = GetClipPlaneReply;
}
#[derive(Clone, Debug)]
pub struct GetClipPlane {
pub context_tag: ContextTag,
pub plane: i32,
}
unsafe impl base::RawRequest for GetClipPlane {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 113,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 12];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.plane.serialize(&mut buf0[8 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 12;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetClipPlane {
type Cookie = GetClipPlaneCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetClipPlane {
type Reply = GetClipPlaneReply;
type Cookie = GetClipPlaneCookie;
type CookieUnchecked = GetClipPlaneCookieUnchecked;
}
pub struct GetDoublevReply {
raw: *const u8,
}
impl GetDoublevReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 8usize;
sz += 8usize;
sz += ((n as usize) * 8usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> f64 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const f64;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[f64] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const f64;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetDoublevReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetDoublevReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetDoublevReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &8)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetDoublevReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetDoublevReply {}
unsafe impl std::marker::Sync for GetDoublevReply {}
#[derive(Debug)]
pub struct GetDoublevCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetDoublevCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetDoublevCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetDoublevCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetDoublevCookie {
}
unsafe impl base::CookieWithReplyChecked for GetDoublevCookie {
type Reply = GetDoublevReply;
}
impl base::Cookie for GetDoublevCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetDoublevCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetDoublevCookieUnchecked {
type Reply = GetDoublevReply;
}
#[derive(Clone, Debug)]
pub struct GetDoublev {
pub context_tag: ContextTag,
pub pname: u32,
}
unsafe impl base::RawRequest for GetDoublev {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 114,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 12];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.pname.serialize(&mut buf0[8 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 12;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetDoublev {
type Cookie = GetDoublevCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetDoublev {
type Reply = GetDoublevReply;
type Cookie = GetDoublevCookie;
type CookieUnchecked = GetDoublevCookieUnchecked;
}
pub struct GetErrorReply {
raw: *const u8,
}
impl GetErrorReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn error(&self) -> i32 {
unsafe {
let offset = 8usize;
let ptr = self.wire_ptr().add(offset) as *const i32;
base::value_from_ptr(ptr)
}
}
}
impl base::Reply for GetErrorReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetErrorReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetErrorReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("error", &self.error())
.finish()
}
}
impl Drop for GetErrorReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetErrorReply {}
unsafe impl std::marker::Sync for GetErrorReply {}
#[derive(Debug)]
pub struct GetErrorCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetErrorCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetErrorCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetErrorCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetErrorCookie {
}
unsafe impl base::CookieWithReplyChecked for GetErrorCookie {
type Reply = GetErrorReply;
}
impl base::Cookie for GetErrorCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetErrorCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetErrorCookieUnchecked {
type Reply = GetErrorReply;
}
#[derive(Clone, Debug)]
pub struct GetError {
pub context_tag: ContextTag,
}
unsafe impl base::RawRequest for GetError {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 115,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 8];
self.context_tag.serialize(&mut buf0[4 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 8;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetError {
type Cookie = GetErrorCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetError {
type Reply = GetErrorReply;
type Cookie = GetErrorCookie;
type CookieUnchecked = GetErrorCookieUnchecked;
}
pub struct GetFloatvReply {
raw: *const u8,
}
impl GetFloatvReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 12usize;
sz += ((n as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> f32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const f32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[f32] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const f32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetFloatvReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetFloatvReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetFloatvReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetFloatvReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetFloatvReply {}
unsafe impl std::marker::Sync for GetFloatvReply {}
#[derive(Debug)]
pub struct GetFloatvCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetFloatvCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetFloatvCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetFloatvCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetFloatvCookie {
}
unsafe impl base::CookieWithReplyChecked for GetFloatvCookie {
type Reply = GetFloatvReply;
}
impl base::Cookie for GetFloatvCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetFloatvCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetFloatvCookieUnchecked {
type Reply = GetFloatvReply;
}
#[derive(Clone, Debug)]
pub struct GetFloatv {
pub context_tag: ContextTag,
pub pname: u32,
}
unsafe impl base::RawRequest for GetFloatv {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 116,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 12];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.pname.serialize(&mut buf0[8 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 12;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetFloatv {
type Cookie = GetFloatvCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetFloatv {
type Reply = GetFloatvReply;
type Cookie = GetFloatvCookie;
type CookieUnchecked = GetFloatvCookieUnchecked;
}
pub struct GetIntegervReply {
raw: *const u8,
}
impl GetIntegervReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 12usize;
sz += ((n as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> i32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const i32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[i32] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const i32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetIntegervReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetIntegervReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetIntegervReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetIntegervReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetIntegervReply {}
unsafe impl std::marker::Sync for GetIntegervReply {}
#[derive(Debug)]
pub struct GetIntegervCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetIntegervCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetIntegervCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetIntegervCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetIntegervCookie {
}
unsafe impl base::CookieWithReplyChecked for GetIntegervCookie {
type Reply = GetIntegervReply;
}
impl base::Cookie for GetIntegervCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetIntegervCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetIntegervCookieUnchecked {
type Reply = GetIntegervReply;
}
#[derive(Clone, Debug)]
pub struct GetIntegerv {
pub context_tag: ContextTag,
pub pname: u32,
}
unsafe impl base::RawRequest for GetIntegerv {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 117,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 12];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.pname.serialize(&mut buf0[8 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 12;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetIntegerv {
type Cookie = GetIntegervCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetIntegerv {
type Reply = GetIntegervReply;
type Cookie = GetIntegervCookie;
type CookieUnchecked = GetIntegervCookieUnchecked;
}
pub struct GetLightfvReply {
raw: *const u8,
}
impl GetLightfvReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 12usize;
sz += ((n as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> f32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const f32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[f32] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const f32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetLightfvReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetLightfvReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetLightfvReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetLightfvReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetLightfvReply {}
unsafe impl std::marker::Sync for GetLightfvReply {}
#[derive(Debug)]
pub struct GetLightfvCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetLightfvCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetLightfvCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetLightfvCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetLightfvCookie {
}
unsafe impl base::CookieWithReplyChecked for GetLightfvCookie {
type Reply = GetLightfvReply;
}
impl base::Cookie for GetLightfvCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetLightfvCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetLightfvCookieUnchecked {
type Reply = GetLightfvReply;
}
#[derive(Clone, Debug)]
pub struct GetLightfv {
pub context_tag: ContextTag,
pub light: u32,
pub pname: u32,
}
unsafe impl base::RawRequest for GetLightfv {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 118,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 16];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.light.serialize(&mut buf0[8 .. ]);
self.pname.serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetLightfv {
type Cookie = GetLightfvCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetLightfv {
type Reply = GetLightfvReply;
type Cookie = GetLightfvCookie;
type CookieUnchecked = GetLightfvCookieUnchecked;
}
pub struct GetLightivReply {
raw: *const u8,
}
impl GetLightivReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 12usize;
sz += ((n as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> i32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const i32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[i32] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const i32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetLightivReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetLightivReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetLightivReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetLightivReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetLightivReply {}
unsafe impl std::marker::Sync for GetLightivReply {}
#[derive(Debug)]
pub struct GetLightivCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetLightivCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetLightivCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetLightivCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetLightivCookie {
}
unsafe impl base::CookieWithReplyChecked for GetLightivCookie {
type Reply = GetLightivReply;
}
impl base::Cookie for GetLightivCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetLightivCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetLightivCookieUnchecked {
type Reply = GetLightivReply;
}
#[derive(Clone, Debug)]
pub struct GetLightiv {
pub context_tag: ContextTag,
pub light: u32,
pub pname: u32,
}
unsafe impl base::RawRequest for GetLightiv {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 119,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 16];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.light.serialize(&mut buf0[8 .. ]);
self.pname.serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetLightiv {
type Cookie = GetLightivCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetLightiv {
type Reply = GetLightivReply;
type Cookie = GetLightivCookie;
type CookieUnchecked = GetLightivCookieUnchecked;
}
pub struct GetMapdvReply {
raw: *const u8,
}
impl GetMapdvReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 8usize;
sz += 8usize;
sz += ((n as usize) * 8usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> f64 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const f64;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[f64] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const f64;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetMapdvReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetMapdvReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetMapdvReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &8)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetMapdvReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetMapdvReply {}
unsafe impl std::marker::Sync for GetMapdvReply {}
#[derive(Debug)]
pub struct GetMapdvCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetMapdvCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetMapdvCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetMapdvCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetMapdvCookie {
}
unsafe impl base::CookieWithReplyChecked for GetMapdvCookie {
type Reply = GetMapdvReply;
}
impl base::Cookie for GetMapdvCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetMapdvCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetMapdvCookieUnchecked {
type Reply = GetMapdvReply;
}
#[derive(Clone, Debug)]
pub struct GetMapdv {
pub context_tag: ContextTag,
pub target: u32,
pub query: u32,
}
unsafe impl base::RawRequest for GetMapdv {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 120,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 16];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.target.serialize(&mut buf0[8 .. ]);
self.query.serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetMapdv {
type Cookie = GetMapdvCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetMapdv {
type Reply = GetMapdvReply;
type Cookie = GetMapdvCookie;
type CookieUnchecked = GetMapdvCookieUnchecked;
}
pub struct GetMapfvReply {
raw: *const u8,
}
impl GetMapfvReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 12usize;
sz += ((n as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> f32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const f32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[f32] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const f32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetMapfvReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetMapfvReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetMapfvReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetMapfvReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetMapfvReply {}
unsafe impl std::marker::Sync for GetMapfvReply {}
#[derive(Debug)]
pub struct GetMapfvCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetMapfvCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetMapfvCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetMapfvCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetMapfvCookie {
}
unsafe impl base::CookieWithReplyChecked for GetMapfvCookie {
type Reply = GetMapfvReply;
}
impl base::Cookie for GetMapfvCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetMapfvCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetMapfvCookieUnchecked {
type Reply = GetMapfvReply;
}
#[derive(Clone, Debug)]
pub struct GetMapfv {
pub context_tag: ContextTag,
pub target: u32,
pub query: u32,
}
unsafe impl base::RawRequest for GetMapfv {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 121,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 16];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.target.serialize(&mut buf0[8 .. ]);
self.query.serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetMapfv {
type Cookie = GetMapfvCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetMapfv {
type Reply = GetMapfvReply;
type Cookie = GetMapfvCookie;
type CookieUnchecked = GetMapfvCookieUnchecked;
}
pub struct GetMapivReply {
raw: *const u8,
}
impl GetMapivReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 12usize;
sz += ((n as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> i32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const i32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[i32] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const i32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetMapivReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetMapivReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetMapivReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetMapivReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetMapivReply {}
unsafe impl std::marker::Sync for GetMapivReply {}
#[derive(Debug)]
pub struct GetMapivCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetMapivCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetMapivCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetMapivCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetMapivCookie {
}
unsafe impl base::CookieWithReplyChecked for GetMapivCookie {
type Reply = GetMapivReply;
}
impl base::Cookie for GetMapivCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetMapivCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetMapivCookieUnchecked {
type Reply = GetMapivReply;
}
#[derive(Clone, Debug)]
pub struct GetMapiv {
pub context_tag: ContextTag,
pub target: u32,
pub query: u32,
}
unsafe impl base::RawRequest for GetMapiv {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 122,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 16];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.target.serialize(&mut buf0[8 .. ]);
self.query.serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetMapiv {
type Cookie = GetMapivCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetMapiv {
type Reply = GetMapivReply;
type Cookie = GetMapivCookie;
type CookieUnchecked = GetMapivCookieUnchecked;
}
pub struct GetMaterialfvReply {
raw: *const u8,
}
impl GetMaterialfvReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 12usize;
sz += ((n as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> f32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const f32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[f32] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const f32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetMaterialfvReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetMaterialfvReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetMaterialfvReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetMaterialfvReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetMaterialfvReply {}
unsafe impl std::marker::Sync for GetMaterialfvReply {}
#[derive(Debug)]
pub struct GetMaterialfvCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetMaterialfvCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetMaterialfvCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetMaterialfvCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetMaterialfvCookie {
}
unsafe impl base::CookieWithReplyChecked for GetMaterialfvCookie {
type Reply = GetMaterialfvReply;
}
impl base::Cookie for GetMaterialfvCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetMaterialfvCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetMaterialfvCookieUnchecked {
type Reply = GetMaterialfvReply;
}
#[derive(Clone, Debug)]
pub struct GetMaterialfv {
pub context_tag: ContextTag,
pub face: u32,
pub pname: u32,
}
unsafe impl base::RawRequest for GetMaterialfv {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 123,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 16];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.face.serialize(&mut buf0[8 .. ]);
self.pname.serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetMaterialfv {
type Cookie = GetMaterialfvCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetMaterialfv {
type Reply = GetMaterialfvReply;
type Cookie = GetMaterialfvCookie;
type CookieUnchecked = GetMaterialfvCookieUnchecked;
}
pub struct GetMaterialivReply {
raw: *const u8,
}
impl GetMaterialivReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 12usize;
sz += ((n as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> i32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const i32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[i32] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const i32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetMaterialivReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetMaterialivReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetMaterialivReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetMaterialivReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetMaterialivReply {}
unsafe impl std::marker::Sync for GetMaterialivReply {}
#[derive(Debug)]
pub struct GetMaterialivCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetMaterialivCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetMaterialivCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetMaterialivCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetMaterialivCookie {
}
unsafe impl base::CookieWithReplyChecked for GetMaterialivCookie {
type Reply = GetMaterialivReply;
}
impl base::Cookie for GetMaterialivCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetMaterialivCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetMaterialivCookieUnchecked {
type Reply = GetMaterialivReply;
}
#[derive(Clone, Debug)]
pub struct GetMaterialiv {
pub context_tag: ContextTag,
pub face: u32,
pub pname: u32,
}
unsafe impl base::RawRequest for GetMaterialiv {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 124,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 16];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.face.serialize(&mut buf0[8 .. ]);
self.pname.serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetMaterialiv {
type Cookie = GetMaterialivCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetMaterialiv {
type Reply = GetMaterialivReply;
type Cookie = GetMaterialivCookie;
type CookieUnchecked = GetMaterialivCookieUnchecked;
}
pub struct GetPixelMapfvReply {
raw: *const u8,
}
impl GetPixelMapfvReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 12usize;
sz += ((n as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> f32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const f32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[f32] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const f32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetPixelMapfvReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetPixelMapfvReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetPixelMapfvReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetPixelMapfvReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetPixelMapfvReply {}
unsafe impl std::marker::Sync for GetPixelMapfvReply {}
#[derive(Debug)]
pub struct GetPixelMapfvCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetPixelMapfvCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetPixelMapfvCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetPixelMapfvCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetPixelMapfvCookie {
}
unsafe impl base::CookieWithReplyChecked for GetPixelMapfvCookie {
type Reply = GetPixelMapfvReply;
}
impl base::Cookie for GetPixelMapfvCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetPixelMapfvCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetPixelMapfvCookieUnchecked {
type Reply = GetPixelMapfvReply;
}
#[derive(Clone, Debug)]
pub struct GetPixelMapfv {
pub context_tag: ContextTag,
pub map: u32,
}
unsafe impl base::RawRequest for GetPixelMapfv {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 125,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 12];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.map.serialize(&mut buf0[8 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 12;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetPixelMapfv {
type Cookie = GetPixelMapfvCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetPixelMapfv {
type Reply = GetPixelMapfvReply;
type Cookie = GetPixelMapfvCookie;
type CookieUnchecked = GetPixelMapfvCookieUnchecked;
}
pub struct GetPixelMapuivReply {
raw: *const u8,
}
impl GetPixelMapuivReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 12usize;
sz += ((n as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> u32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[u32] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const u32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetPixelMapuivReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetPixelMapuivReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetPixelMapuivReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetPixelMapuivReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetPixelMapuivReply {}
unsafe impl std::marker::Sync for GetPixelMapuivReply {}
#[derive(Debug)]
pub struct GetPixelMapuivCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetPixelMapuivCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetPixelMapuivCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetPixelMapuivCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetPixelMapuivCookie {
}
unsafe impl base::CookieWithReplyChecked for GetPixelMapuivCookie {
type Reply = GetPixelMapuivReply;
}
impl base::Cookie for GetPixelMapuivCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetPixelMapuivCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetPixelMapuivCookieUnchecked {
type Reply = GetPixelMapuivReply;
}
#[derive(Clone, Debug)]
pub struct GetPixelMapuiv {
pub context_tag: ContextTag,
pub map: u32,
}
unsafe impl base::RawRequest for GetPixelMapuiv {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 126,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 12];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.map.serialize(&mut buf0[8 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 12;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetPixelMapuiv {
type Cookie = GetPixelMapuivCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetPixelMapuiv {
type Reply = GetPixelMapuivReply;
type Cookie = GetPixelMapuivCookie;
type CookieUnchecked = GetPixelMapuivCookieUnchecked;
}
pub struct GetPixelMapusvReply {
raw: *const u8,
}
impl GetPixelMapusvReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 2usize;
sz += 16usize;
sz += ((n as usize) * 2usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> u16 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[u16] {
unsafe {
let offset = 34usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const u16;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetPixelMapusvReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetPixelMapusvReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetPixelMapusvReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &16)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetPixelMapusvReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetPixelMapusvReply {}
unsafe impl std::marker::Sync for GetPixelMapusvReply {}
#[derive(Debug)]
pub struct GetPixelMapusvCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetPixelMapusvCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetPixelMapusvCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetPixelMapusvCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetPixelMapusvCookie {
}
unsafe impl base::CookieWithReplyChecked for GetPixelMapusvCookie {
type Reply = GetPixelMapusvReply;
}
impl base::Cookie for GetPixelMapusvCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetPixelMapusvCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetPixelMapusvCookieUnchecked {
type Reply = GetPixelMapusvReply;
}
#[derive(Clone, Debug)]
pub struct GetPixelMapusv {
pub context_tag: ContextTag,
pub map: u32,
}
unsafe impl base::RawRequest for GetPixelMapusv {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 127,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 12];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.map.serialize(&mut buf0[8 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 12;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetPixelMapusv {
type Cookie = GetPixelMapusvCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetPixelMapusv {
type Reply = GetPixelMapusvReply;
type Cookie = GetPixelMapusvCookie;
type CookieUnchecked = GetPixelMapusvCookieUnchecked;
}
pub struct GetPolygonStippleReply {
raw: *const u8,
}
impl GetPolygonStippleReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
let length = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 24usize;
sz += ((length as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[u8] {
unsafe {
let offset = 32usize;
let len = ((self.length() as usize) * 4usize);
let ptr = self.wire_ptr().add(offset) as *const u8;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetPolygonStippleReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetPolygonStippleReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetPolygonStippleReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &24)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetPolygonStippleReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetPolygonStippleReply {}
unsafe impl std::marker::Sync for GetPolygonStippleReply {}
#[derive(Debug)]
pub struct GetPolygonStippleCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetPolygonStippleCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetPolygonStippleCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetPolygonStippleCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetPolygonStippleCookie {
}
unsafe impl base::CookieWithReplyChecked for GetPolygonStippleCookie {
type Reply = GetPolygonStippleReply;
}
impl base::Cookie for GetPolygonStippleCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetPolygonStippleCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetPolygonStippleCookieUnchecked {
type Reply = GetPolygonStippleReply;
}
#[derive(Clone, Debug)]
pub struct GetPolygonStipple {
pub context_tag: ContextTag,
pub lsb_first: bool,
}
unsafe impl base::RawRequest for GetPolygonStipple {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 128,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 9];
self.context_tag.serialize(&mut buf0[4 .. ]);
(if self.lsb_first { 1u8 } else { 0u8 }).serialize(&mut buf0[8 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 9;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetPolygonStipple {
type Cookie = GetPolygonStippleCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetPolygonStipple {
type Reply = GetPolygonStippleReply;
type Cookie = GetPolygonStippleCookie;
type CookieUnchecked = GetPolygonStippleCookieUnchecked;
}
pub struct GetStringReply {
raw: *const u8,
}
impl GetStringReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 16usize;
sz += (n as usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn string(&self) -> &Lat1Str {
unsafe {
let offset = 32usize;
let len = (self.n() as usize) as _;
let ptr = self.wire_ptr().add(offset);
let bytes = std::slice::from_raw_parts(ptr, len);
Lat1Str::from_bytes(bytes)
}
}
}
impl base::Reply for GetStringReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetStringReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetStringReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("pad", &16)
.field("string", &self.string())
.finish()
}
}
impl Drop for GetStringReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetStringReply {}
unsafe impl std::marker::Sync for GetStringReply {}
#[derive(Debug)]
pub struct GetStringCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetStringCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetStringCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetStringCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetStringCookie {
}
unsafe impl base::CookieWithReplyChecked for GetStringCookie {
type Reply = GetStringReply;
}
impl base::Cookie for GetStringCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetStringCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetStringCookieUnchecked {
type Reply = GetStringReply;
}
#[derive(Clone, Debug)]
pub struct GetString {
pub context_tag: ContextTag,
pub name: u32,
}
unsafe impl base::RawRequest for GetString {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 129,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 12];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.name.serialize(&mut buf0[8 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 12;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetString {
type Cookie = GetStringCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetString {
type Reply = GetStringReply;
type Cookie = GetStringCookie;
type CookieUnchecked = GetStringCookieUnchecked;
}
pub struct GetTexEnvfvReply {
raw: *const u8,
}
impl GetTexEnvfvReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 12usize;
sz += ((n as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> f32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const f32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[f32] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const f32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetTexEnvfvReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetTexEnvfvReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetTexEnvfvReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetTexEnvfvReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetTexEnvfvReply {}
unsafe impl std::marker::Sync for GetTexEnvfvReply {}
#[derive(Debug)]
pub struct GetTexEnvfvCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetTexEnvfvCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetTexEnvfvCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetTexEnvfvCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetTexEnvfvCookie {
}
unsafe impl base::CookieWithReplyChecked for GetTexEnvfvCookie {
type Reply = GetTexEnvfvReply;
}
impl base::Cookie for GetTexEnvfvCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetTexEnvfvCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetTexEnvfvCookieUnchecked {
type Reply = GetTexEnvfvReply;
}
#[derive(Clone, Debug)]
pub struct GetTexEnvfv {
pub context_tag: ContextTag,
pub target: u32,
pub pname: u32,
}
unsafe impl base::RawRequest for GetTexEnvfv {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 130,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 16];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.target.serialize(&mut buf0[8 .. ]);
self.pname.serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetTexEnvfv {
type Cookie = GetTexEnvfvCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetTexEnvfv {
type Reply = GetTexEnvfvReply;
type Cookie = GetTexEnvfvCookie;
type CookieUnchecked = GetTexEnvfvCookieUnchecked;
}
pub struct GetTexEnvivReply {
raw: *const u8,
}
impl GetTexEnvivReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 12usize;
sz += ((n as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> i32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const i32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[i32] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const i32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetTexEnvivReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetTexEnvivReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetTexEnvivReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetTexEnvivReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetTexEnvivReply {}
unsafe impl std::marker::Sync for GetTexEnvivReply {}
#[derive(Debug)]
pub struct GetTexEnvivCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetTexEnvivCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetTexEnvivCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetTexEnvivCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetTexEnvivCookie {
}
unsafe impl base::CookieWithReplyChecked for GetTexEnvivCookie {
type Reply = GetTexEnvivReply;
}
impl base::Cookie for GetTexEnvivCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetTexEnvivCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetTexEnvivCookieUnchecked {
type Reply = GetTexEnvivReply;
}
#[derive(Clone, Debug)]
pub struct GetTexEnviv {
pub context_tag: ContextTag,
pub target: u32,
pub pname: u32,
}
unsafe impl base::RawRequest for GetTexEnviv {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 131,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 16];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.target.serialize(&mut buf0[8 .. ]);
self.pname.serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetTexEnviv {
type Cookie = GetTexEnvivCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetTexEnviv {
type Reply = GetTexEnvivReply;
type Cookie = GetTexEnvivCookie;
type CookieUnchecked = GetTexEnvivCookieUnchecked;
}
pub struct GetTexGendvReply {
raw: *const u8,
}
impl GetTexGendvReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 8usize;
sz += 8usize;
sz += ((n as usize) * 8usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> f64 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const f64;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[f64] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const f64;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetTexGendvReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetTexGendvReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetTexGendvReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &8)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetTexGendvReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetTexGendvReply {}
unsafe impl std::marker::Sync for GetTexGendvReply {}
#[derive(Debug)]
pub struct GetTexGendvCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetTexGendvCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetTexGendvCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetTexGendvCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetTexGendvCookie {
}
unsafe impl base::CookieWithReplyChecked for GetTexGendvCookie {
type Reply = GetTexGendvReply;
}
impl base::Cookie for GetTexGendvCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetTexGendvCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetTexGendvCookieUnchecked {
type Reply = GetTexGendvReply;
}
#[derive(Clone, Debug)]
pub struct GetTexGendv {
pub context_tag: ContextTag,
pub coord: u32,
pub pname: u32,
}
unsafe impl base::RawRequest for GetTexGendv {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 132,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 16];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.coord.serialize(&mut buf0[8 .. ]);
self.pname.serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetTexGendv {
type Cookie = GetTexGendvCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetTexGendv {
type Reply = GetTexGendvReply;
type Cookie = GetTexGendvCookie;
type CookieUnchecked = GetTexGendvCookieUnchecked;
}
pub struct GetTexGenfvReply {
raw: *const u8,
}
impl GetTexGenfvReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 12usize;
sz += ((n as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> f32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const f32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[f32] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const f32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetTexGenfvReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetTexGenfvReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetTexGenfvReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetTexGenfvReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetTexGenfvReply {}
unsafe impl std::marker::Sync for GetTexGenfvReply {}
#[derive(Debug)]
pub struct GetTexGenfvCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetTexGenfvCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetTexGenfvCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetTexGenfvCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetTexGenfvCookie {
}
unsafe impl base::CookieWithReplyChecked for GetTexGenfvCookie {
type Reply = GetTexGenfvReply;
}
impl base::Cookie for GetTexGenfvCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetTexGenfvCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetTexGenfvCookieUnchecked {
type Reply = GetTexGenfvReply;
}
#[derive(Clone, Debug)]
pub struct GetTexGenfv {
pub context_tag: ContextTag,
pub coord: u32,
pub pname: u32,
}
unsafe impl base::RawRequest for GetTexGenfv {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 133,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 16];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.coord.serialize(&mut buf0[8 .. ]);
self.pname.serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetTexGenfv {
type Cookie = GetTexGenfvCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetTexGenfv {
type Reply = GetTexGenfvReply;
type Cookie = GetTexGenfvCookie;
type CookieUnchecked = GetTexGenfvCookieUnchecked;
}
pub struct GetTexGenivReply {
raw: *const u8,
}
impl GetTexGenivReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 12usize;
sz += ((n as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> i32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const i32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[i32] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const i32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetTexGenivReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetTexGenivReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetTexGenivReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetTexGenivReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetTexGenivReply {}
unsafe impl std::marker::Sync for GetTexGenivReply {}
#[derive(Debug)]
pub struct GetTexGenivCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetTexGenivCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetTexGenivCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetTexGenivCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetTexGenivCookie {
}
unsafe impl base::CookieWithReplyChecked for GetTexGenivCookie {
type Reply = GetTexGenivReply;
}
impl base::Cookie for GetTexGenivCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetTexGenivCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetTexGenivCookieUnchecked {
type Reply = GetTexGenivReply;
}
#[derive(Clone, Debug)]
pub struct GetTexGeniv {
pub context_tag: ContextTag,
pub coord: u32,
pub pname: u32,
}
unsafe impl base::RawRequest for GetTexGeniv {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 134,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 16];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.coord.serialize(&mut buf0[8 .. ]);
self.pname.serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetTexGeniv {
type Cookie = GetTexGenivCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetTexGeniv {
type Reply = GetTexGenivReply;
type Cookie = GetTexGenivCookie;
type CookieUnchecked = GetTexGenivCookieUnchecked;
}
pub struct GetTexImageReply {
raw: *const u8,
}
impl GetTexImageReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
let length = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 8usize;
sz += 4usize;
sz += 4usize;
sz += 4usize;
sz += 4usize;
sz += ((length as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn width(&self) -> i32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const i32;
base::value_from_ptr(ptr)
}
}
pub fn height(&self) -> i32 {
unsafe {
let offset = 20usize;
let ptr = self.wire_ptr().add(offset) as *const i32;
base::value_from_ptr(ptr)
}
}
pub fn depth(&self) -> i32 {
unsafe {
let offset = 24usize;
let ptr = self.wire_ptr().add(offset) as *const i32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[u8] {
unsafe {
let offset = 32usize;
let len = ((self.length() as usize) * 4usize);
let ptr = self.wire_ptr().add(offset) as *const u8;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetTexImageReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetTexImageReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetTexImageReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &8)
.field("width", &self.width())
.field("height", &self.height())
.field("depth", &self.depth())
.field("pad", &4)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetTexImageReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetTexImageReply {}
unsafe impl std::marker::Sync for GetTexImageReply {}
#[derive(Debug)]
pub struct GetTexImageCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetTexImageCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetTexImageCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetTexImageCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetTexImageCookie {
}
unsafe impl base::CookieWithReplyChecked for GetTexImageCookie {
type Reply = GetTexImageReply;
}
impl base::Cookie for GetTexImageCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetTexImageCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetTexImageCookieUnchecked {
type Reply = GetTexImageReply;
}
#[derive(Clone, Debug)]
pub struct GetTexImage {
pub context_tag: ContextTag,
pub target: u32,
pub level: i32,
pub format: u32,
pub r#type: u32,
pub swap_bytes: bool,
}
unsafe impl base::RawRequest for GetTexImage {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 135,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 25];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.target.serialize(&mut buf0[8 .. ]);
self.level.serialize(&mut buf0[12 .. ]);
self.format.serialize(&mut buf0[16 .. ]);
self.r#type.serialize(&mut buf0[20 .. ]);
(if self.swap_bytes { 1u8 } else { 0u8 }).serialize(&mut buf0[24 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 25;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetTexImage {
type Cookie = GetTexImageCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetTexImage {
type Reply = GetTexImageReply;
type Cookie = GetTexImageCookie;
type CookieUnchecked = GetTexImageCookieUnchecked;
}
pub struct GetTexParameterfvReply {
raw: *const u8,
}
impl GetTexParameterfvReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 12usize;
sz += ((n as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> f32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const f32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[f32] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const f32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetTexParameterfvReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetTexParameterfvReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetTexParameterfvReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetTexParameterfvReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetTexParameterfvReply {}
unsafe impl std::marker::Sync for GetTexParameterfvReply {}
#[derive(Debug)]
pub struct GetTexParameterfvCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetTexParameterfvCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetTexParameterfvCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetTexParameterfvCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetTexParameterfvCookie {
}
unsafe impl base::CookieWithReplyChecked for GetTexParameterfvCookie {
type Reply = GetTexParameterfvReply;
}
impl base::Cookie for GetTexParameterfvCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetTexParameterfvCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetTexParameterfvCookieUnchecked {
type Reply = GetTexParameterfvReply;
}
#[derive(Clone, Debug)]
pub struct GetTexParameterfv {
pub context_tag: ContextTag,
pub target: u32,
pub pname: u32,
}
unsafe impl base::RawRequest for GetTexParameterfv {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 136,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 16];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.target.serialize(&mut buf0[8 .. ]);
self.pname.serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetTexParameterfv {
type Cookie = GetTexParameterfvCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetTexParameterfv {
type Reply = GetTexParameterfvReply;
type Cookie = GetTexParameterfvCookie;
type CookieUnchecked = GetTexParameterfvCookieUnchecked;
}
pub struct GetTexParameterivReply {
raw: *const u8,
}
impl GetTexParameterivReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 12usize;
sz += ((n as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> i32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const i32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[i32] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const i32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetTexParameterivReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetTexParameterivReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetTexParameterivReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetTexParameterivReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetTexParameterivReply {}
unsafe impl std::marker::Sync for GetTexParameterivReply {}
#[derive(Debug)]
pub struct GetTexParameterivCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetTexParameterivCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetTexParameterivCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetTexParameterivCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetTexParameterivCookie {
}
unsafe impl base::CookieWithReplyChecked for GetTexParameterivCookie {
type Reply = GetTexParameterivReply;
}
impl base::Cookie for GetTexParameterivCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetTexParameterivCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetTexParameterivCookieUnchecked {
type Reply = GetTexParameterivReply;
}
#[derive(Clone, Debug)]
pub struct GetTexParameteriv {
pub context_tag: ContextTag,
pub target: u32,
pub pname: u32,
}
unsafe impl base::RawRequest for GetTexParameteriv {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 137,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 16];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.target.serialize(&mut buf0[8 .. ]);
self.pname.serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetTexParameteriv {
type Cookie = GetTexParameterivCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetTexParameteriv {
type Reply = GetTexParameterivReply;
type Cookie = GetTexParameterivCookie;
type CookieUnchecked = GetTexParameterivCookieUnchecked;
}
pub struct GetTexLevelParameterfvReply {
raw: *const u8,
}
impl GetTexLevelParameterfvReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 12usize;
sz += ((n as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> f32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const f32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[f32] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const f32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetTexLevelParameterfvReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetTexLevelParameterfvReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetTexLevelParameterfvReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetTexLevelParameterfvReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetTexLevelParameterfvReply {}
unsafe impl std::marker::Sync for GetTexLevelParameterfvReply {}
#[derive(Debug)]
pub struct GetTexLevelParameterfvCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetTexLevelParameterfvCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetTexLevelParameterfvCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetTexLevelParameterfvCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetTexLevelParameterfvCookie {
}
unsafe impl base::CookieWithReplyChecked for GetTexLevelParameterfvCookie {
type Reply = GetTexLevelParameterfvReply;
}
impl base::Cookie for GetTexLevelParameterfvCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetTexLevelParameterfvCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetTexLevelParameterfvCookieUnchecked {
type Reply = GetTexLevelParameterfvReply;
}
#[derive(Clone, Debug)]
pub struct GetTexLevelParameterfv {
pub context_tag: ContextTag,
pub target: u32,
pub level: i32,
pub pname: u32,
}
unsafe impl base::RawRequest for GetTexLevelParameterfv {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 138,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 20];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.target.serialize(&mut buf0[8 .. ]);
self.level.serialize(&mut buf0[12 .. ]);
self.pname.serialize(&mut buf0[16 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 20;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetTexLevelParameterfv {
type Cookie = GetTexLevelParameterfvCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetTexLevelParameterfv {
type Reply = GetTexLevelParameterfvReply;
type Cookie = GetTexLevelParameterfvCookie;
type CookieUnchecked = GetTexLevelParameterfvCookieUnchecked;
}
pub struct GetTexLevelParameterivReply {
raw: *const u8,
}
impl GetTexLevelParameterivReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 12usize;
sz += ((n as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> i32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const i32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[i32] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const i32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetTexLevelParameterivReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetTexLevelParameterivReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetTexLevelParameterivReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetTexLevelParameterivReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetTexLevelParameterivReply {}
unsafe impl std::marker::Sync for GetTexLevelParameterivReply {}
#[derive(Debug)]
pub struct GetTexLevelParameterivCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetTexLevelParameterivCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetTexLevelParameterivCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetTexLevelParameterivCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetTexLevelParameterivCookie {
}
unsafe impl base::CookieWithReplyChecked for GetTexLevelParameterivCookie {
type Reply = GetTexLevelParameterivReply;
}
impl base::Cookie for GetTexLevelParameterivCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetTexLevelParameterivCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetTexLevelParameterivCookieUnchecked {
type Reply = GetTexLevelParameterivReply;
}
#[derive(Clone, Debug)]
pub struct GetTexLevelParameteriv {
pub context_tag: ContextTag,
pub target: u32,
pub level: i32,
pub pname: u32,
}
unsafe impl base::RawRequest for GetTexLevelParameteriv {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 139,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 20];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.target.serialize(&mut buf0[8 .. ]);
self.level.serialize(&mut buf0[12 .. ]);
self.pname.serialize(&mut buf0[16 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 20;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetTexLevelParameteriv {
type Cookie = GetTexLevelParameterivCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetTexLevelParameteriv {
type Reply = GetTexLevelParameterivReply;
type Cookie = GetTexLevelParameterivCookie;
type CookieUnchecked = GetTexLevelParameterivCookieUnchecked;
}
pub struct IsEnabledReply {
raw: *const u8,
}
impl IsEnabledReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn ret_val(&self) -> bool {
let val = unsafe { *(self.wire_ptr().add(8usize)) };
val != 0
}
}
impl base::Reply for IsEnabledReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for IsEnabledReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("IsEnabledReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("ret_val", &self.ret_val())
.finish()
}
}
impl Drop for IsEnabledReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for IsEnabledReply {}
unsafe impl std::marker::Sync for IsEnabledReply {}
#[derive(Debug)]
pub struct IsEnabledCookie {
seq: u64,
}
#[derive(Debug)]
pub struct IsEnabledCookieUnchecked {
seq: u64,
}
impl base::Cookie for IsEnabledCookie {
unsafe fn from_sequence(seq: u64) -> Self {
IsEnabledCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for IsEnabledCookie {
}
unsafe impl base::CookieWithReplyChecked for IsEnabledCookie {
type Reply = IsEnabledReply;
}
impl base::Cookie for IsEnabledCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
IsEnabledCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for IsEnabledCookieUnchecked {
type Reply = IsEnabledReply;
}
#[derive(Clone, Debug)]
pub struct IsEnabled {
pub context_tag: ContextTag,
pub capability: u32,
}
unsafe impl base::RawRequest for IsEnabled {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 140,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 12];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.capability.serialize(&mut buf0[8 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 12;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for IsEnabled {
type Cookie = IsEnabledCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for IsEnabled {
type Reply = IsEnabledReply;
type Cookie = IsEnabledCookie;
type CookieUnchecked = IsEnabledCookieUnchecked;
}
pub struct IsListReply {
raw: *const u8,
}
impl IsListReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn ret_val(&self) -> bool {
let val = unsafe { *(self.wire_ptr().add(8usize)) };
val != 0
}
}
impl base::Reply for IsListReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for IsListReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("IsListReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("ret_val", &self.ret_val())
.finish()
}
}
impl Drop for IsListReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for IsListReply {}
unsafe impl std::marker::Sync for IsListReply {}
#[derive(Debug)]
pub struct IsListCookie {
seq: u64,
}
#[derive(Debug)]
pub struct IsListCookieUnchecked {
seq: u64,
}
impl base::Cookie for IsListCookie {
unsafe fn from_sequence(seq: u64) -> Self {
IsListCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for IsListCookie {
}
unsafe impl base::CookieWithReplyChecked for IsListCookie {
type Reply = IsListReply;
}
impl base::Cookie for IsListCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
IsListCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for IsListCookieUnchecked {
type Reply = IsListReply;
}
#[derive(Clone, Debug)]
pub struct IsList {
pub context_tag: ContextTag,
pub list: u32,
}
unsafe impl base::RawRequest for IsList {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 141,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 12];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.list.serialize(&mut buf0[8 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 12;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for IsList {
type Cookie = IsListCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for IsList {
type Reply = IsListReply;
type Cookie = IsListCookie;
type CookieUnchecked = IsListCookieUnchecked;
}
#[derive(Clone, Debug)]
pub struct Flush {
pub context_tag: ContextTag,
}
unsafe impl base::RawRequest for Flush {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 142,
isvoid: 1,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 8];
self.context_tag.serialize(&mut buf0[4 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 8;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for Flush {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl base::RequestWithoutReply for Flush {
}
pub struct AreTexturesResidentReply {
raw: *const u8,
}
impl AreTexturesResidentReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
let length = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 20usize;
sz += ((length as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn ret_val(&self) -> bool {
let val = unsafe { *(self.wire_ptr().add(8usize)) };
val != 0
}
pub fn data(&self) -> &[bool] {
unsafe {
let offset = 32usize;
let len = ((self.length() as usize) * 4usize);
let ptr = self.wire_ptr().add(offset) as *const bool;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for AreTexturesResidentReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for AreTexturesResidentReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("AreTexturesResidentReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("ret_val", &self.ret_val())
.field("pad", &20)
.field("data", &self.data())
.finish()
}
}
impl Drop for AreTexturesResidentReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for AreTexturesResidentReply {}
unsafe impl std::marker::Sync for AreTexturesResidentReply {}
#[derive(Debug)]
pub struct AreTexturesResidentCookie {
seq: u64,
}
#[derive(Debug)]
pub struct AreTexturesResidentCookieUnchecked {
seq: u64,
}
impl base::Cookie for AreTexturesResidentCookie {
unsafe fn from_sequence(seq: u64) -> Self {
AreTexturesResidentCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for AreTexturesResidentCookie {
}
unsafe impl base::CookieWithReplyChecked for AreTexturesResidentCookie {
type Reply = AreTexturesResidentReply;
}
impl base::Cookie for AreTexturesResidentCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
AreTexturesResidentCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for AreTexturesResidentCookieUnchecked {
type Reply = AreTexturesResidentReply;
}
#[derive(Clone, Debug)]
pub struct AreTexturesResident<'a> {
pub context_tag: ContextTag,
pub textures: &'a [u32],
}
unsafe impl<'a> base::RawRequest for AreTexturesResident<'a> {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 4,
ext: (&mut FFI_EXT) as *mut _,
opcode: 143,
isvoid: 0,
};
let mut sections: [iovec; 6] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 6];
let buf0: &mut [u8] = &mut [0; 12];
self.context_tag.serialize(&mut buf0[4 .. ]);
(self.textures.len() as i32).serialize(&mut buf0[8 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 12;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
sections[4].iov_base = self.textures.as_ptr() as *mut _;
sections[4].iov_len = self.textures.len() * std::mem::size_of::<u32>();
sections[5].iov_len = base::align_pad(sections[4].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl<'a> base::Request for AreTexturesResident<'a> {
type Cookie = AreTexturesResidentCookie;
const IS_VOID: bool = false;
}
impl<'a> base::RequestWithReply for AreTexturesResident<'a> {
type Reply = AreTexturesResidentReply;
type Cookie = AreTexturesResidentCookie;
type CookieUnchecked = AreTexturesResidentCookieUnchecked;
}
#[derive(Clone, Debug)]
pub struct DeleteTextures<'a> {
pub context_tag: ContextTag,
pub textures: &'a [u32],
}
unsafe impl<'a> base::RawRequest for DeleteTextures<'a> {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 4,
ext: (&mut FFI_EXT) as *mut _,
opcode: 144,
isvoid: 1,
};
let mut sections: [iovec; 6] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 6];
let buf0: &mut [u8] = &mut [0; 12];
self.context_tag.serialize(&mut buf0[4 .. ]);
(self.textures.len() as i32).serialize(&mut buf0[8 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 12;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
sections[4].iov_base = self.textures.as_ptr() as *mut _;
sections[4].iov_len = self.textures.len() * std::mem::size_of::<u32>();
sections[5].iov_len = base::align_pad(sections[4].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl<'a> base::Request for DeleteTextures<'a> {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl<'a> base::RequestWithoutReply for DeleteTextures<'a> {
}
pub struct GenTexturesReply {
raw: *const u8,
}
impl GenTexturesReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
let length = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 24usize;
sz += ((length as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[u32] {
unsafe {
let offset = 32usize;
let len = (self.length() as usize);
let ptr = self.wire_ptr().add(offset) as *const u32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GenTexturesReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GenTexturesReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GenTexturesReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &24)
.field("data", &self.data())
.finish()
}
}
impl Drop for GenTexturesReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GenTexturesReply {}
unsafe impl std::marker::Sync for GenTexturesReply {}
#[derive(Debug)]
pub struct GenTexturesCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GenTexturesCookieUnchecked {
seq: u64,
}
impl base::Cookie for GenTexturesCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GenTexturesCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GenTexturesCookie {
}
unsafe impl base::CookieWithReplyChecked for GenTexturesCookie {
type Reply = GenTexturesReply;
}
impl base::Cookie for GenTexturesCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GenTexturesCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GenTexturesCookieUnchecked {
type Reply = GenTexturesReply;
}
#[derive(Clone, Debug)]
pub struct GenTextures {
pub context_tag: ContextTag,
pub n: i32,
}
unsafe impl base::RawRequest for GenTextures {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 145,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 12];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.n.serialize(&mut buf0[8 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 12;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GenTextures {
type Cookie = GenTexturesCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GenTextures {
type Reply = GenTexturesReply;
type Cookie = GenTexturesCookie;
type CookieUnchecked = GenTexturesCookieUnchecked;
}
pub struct IsTextureReply {
raw: *const u8,
}
impl IsTextureReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn ret_val(&self) -> bool {
let val = unsafe { *(self.wire_ptr().add(8usize)) };
val != 0
}
}
impl base::Reply for IsTextureReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for IsTextureReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("IsTextureReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("ret_val", &self.ret_val())
.finish()
}
}
impl Drop for IsTextureReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for IsTextureReply {}
unsafe impl std::marker::Sync for IsTextureReply {}
#[derive(Debug)]
pub struct IsTextureCookie {
seq: u64,
}
#[derive(Debug)]
pub struct IsTextureCookieUnchecked {
seq: u64,
}
impl base::Cookie for IsTextureCookie {
unsafe fn from_sequence(seq: u64) -> Self {
IsTextureCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for IsTextureCookie {
}
unsafe impl base::CookieWithReplyChecked for IsTextureCookie {
type Reply = IsTextureReply;
}
impl base::Cookie for IsTextureCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
IsTextureCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for IsTextureCookieUnchecked {
type Reply = IsTextureReply;
}
#[derive(Clone, Debug)]
pub struct IsTexture {
pub context_tag: ContextTag,
pub texture: u32,
}
unsafe impl base::RawRequest for IsTexture {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 146,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 12];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.texture.serialize(&mut buf0[8 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 12;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for IsTexture {
type Cookie = IsTextureCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for IsTexture {
type Reply = IsTextureReply;
type Cookie = IsTextureCookie;
type CookieUnchecked = IsTextureCookieUnchecked;
}
pub struct GetColorTableReply {
raw: *const u8,
}
impl GetColorTableReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
let length = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 8usize;
sz += 4usize;
sz += 12usize;
sz += ((length as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn width(&self) -> i32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const i32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[u8] {
unsafe {
let offset = 32usize;
let len = ((self.length() as usize) * 4usize);
let ptr = self.wire_ptr().add(offset) as *const u8;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetColorTableReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetColorTableReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetColorTableReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &8)
.field("width", &self.width())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetColorTableReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetColorTableReply {}
unsafe impl std::marker::Sync for GetColorTableReply {}
#[derive(Debug)]
pub struct GetColorTableCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetColorTableCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetColorTableCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetColorTableCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetColorTableCookie {
}
unsafe impl base::CookieWithReplyChecked for GetColorTableCookie {
type Reply = GetColorTableReply;
}
impl base::Cookie for GetColorTableCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetColorTableCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetColorTableCookieUnchecked {
type Reply = GetColorTableReply;
}
#[derive(Clone, Debug)]
pub struct GetColorTable {
pub context_tag: ContextTag,
pub target: u32,
pub format: u32,
pub r#type: u32,
pub swap_bytes: bool,
}
unsafe impl base::RawRequest for GetColorTable {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 147,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 21];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.target.serialize(&mut buf0[8 .. ]);
self.format.serialize(&mut buf0[12 .. ]);
self.r#type.serialize(&mut buf0[16 .. ]);
(if self.swap_bytes { 1u8 } else { 0u8 }).serialize(&mut buf0[20 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 21;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetColorTable {
type Cookie = GetColorTableCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetColorTable {
type Reply = GetColorTableReply;
type Cookie = GetColorTableCookie;
type CookieUnchecked = GetColorTableCookieUnchecked;
}
pub struct GetColorTableParameterfvReply {
raw: *const u8,
}
impl GetColorTableParameterfvReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 12usize;
sz += ((n as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> f32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const f32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[f32] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const f32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetColorTableParameterfvReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetColorTableParameterfvReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetColorTableParameterfvReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetColorTableParameterfvReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetColorTableParameterfvReply {}
unsafe impl std::marker::Sync for GetColorTableParameterfvReply {}
#[derive(Debug)]
pub struct GetColorTableParameterfvCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetColorTableParameterfvCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetColorTableParameterfvCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetColorTableParameterfvCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetColorTableParameterfvCookie {
}
unsafe impl base::CookieWithReplyChecked for GetColorTableParameterfvCookie {
type Reply = GetColorTableParameterfvReply;
}
impl base::Cookie for GetColorTableParameterfvCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetColorTableParameterfvCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetColorTableParameterfvCookieUnchecked {
type Reply = GetColorTableParameterfvReply;
}
#[derive(Clone, Debug)]
pub struct GetColorTableParameterfv {
pub context_tag: ContextTag,
pub target: u32,
pub pname: u32,
}
unsafe impl base::RawRequest for GetColorTableParameterfv {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 148,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 16];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.target.serialize(&mut buf0[8 .. ]);
self.pname.serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetColorTableParameterfv {
type Cookie = GetColorTableParameterfvCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetColorTableParameterfv {
type Reply = GetColorTableParameterfvReply;
type Cookie = GetColorTableParameterfvCookie;
type CookieUnchecked = GetColorTableParameterfvCookieUnchecked;
}
pub struct GetColorTableParameterivReply {
raw: *const u8,
}
impl GetColorTableParameterivReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 12usize;
sz += ((n as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> i32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const i32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[i32] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const i32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetColorTableParameterivReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetColorTableParameterivReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetColorTableParameterivReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetColorTableParameterivReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetColorTableParameterivReply {}
unsafe impl std::marker::Sync for GetColorTableParameterivReply {}
#[derive(Debug)]
pub struct GetColorTableParameterivCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetColorTableParameterivCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetColorTableParameterivCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetColorTableParameterivCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetColorTableParameterivCookie {
}
unsafe impl base::CookieWithReplyChecked for GetColorTableParameterivCookie {
type Reply = GetColorTableParameterivReply;
}
impl base::Cookie for GetColorTableParameterivCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetColorTableParameterivCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetColorTableParameterivCookieUnchecked {
type Reply = GetColorTableParameterivReply;
}
#[derive(Clone, Debug)]
pub struct GetColorTableParameteriv {
pub context_tag: ContextTag,
pub target: u32,
pub pname: u32,
}
unsafe impl base::RawRequest for GetColorTableParameteriv {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 149,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 16];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.target.serialize(&mut buf0[8 .. ]);
self.pname.serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetColorTableParameteriv {
type Cookie = GetColorTableParameterivCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetColorTableParameteriv {
type Reply = GetColorTableParameterivReply;
type Cookie = GetColorTableParameterivCookie;
type CookieUnchecked = GetColorTableParameterivCookieUnchecked;
}
pub struct GetConvolutionFilterReply {
raw: *const u8,
}
impl GetConvolutionFilterReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
let length = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 8usize;
sz += 4usize;
sz += 4usize;
sz += 8usize;
sz += ((length as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn width(&self) -> i32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const i32;
base::value_from_ptr(ptr)
}
}
pub fn height(&self) -> i32 {
unsafe {
let offset = 20usize;
let ptr = self.wire_ptr().add(offset) as *const i32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[u8] {
unsafe {
let offset = 32usize;
let len = ((self.length() as usize) * 4usize);
let ptr = self.wire_ptr().add(offset) as *const u8;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetConvolutionFilterReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetConvolutionFilterReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetConvolutionFilterReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &8)
.field("width", &self.width())
.field("height", &self.height())
.field("pad", &8)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetConvolutionFilterReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetConvolutionFilterReply {}
unsafe impl std::marker::Sync for GetConvolutionFilterReply {}
#[derive(Debug)]
pub struct GetConvolutionFilterCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetConvolutionFilterCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetConvolutionFilterCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetConvolutionFilterCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetConvolutionFilterCookie {
}
unsafe impl base::CookieWithReplyChecked for GetConvolutionFilterCookie {
type Reply = GetConvolutionFilterReply;
}
impl base::Cookie for GetConvolutionFilterCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetConvolutionFilterCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetConvolutionFilterCookieUnchecked {
type Reply = GetConvolutionFilterReply;
}
#[derive(Clone, Debug)]
pub struct GetConvolutionFilter {
pub context_tag: ContextTag,
pub target: u32,
pub format: u32,
pub r#type: u32,
pub swap_bytes: bool,
}
unsafe impl base::RawRequest for GetConvolutionFilter {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 150,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 21];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.target.serialize(&mut buf0[8 .. ]);
self.format.serialize(&mut buf0[12 .. ]);
self.r#type.serialize(&mut buf0[16 .. ]);
(if self.swap_bytes { 1u8 } else { 0u8 }).serialize(&mut buf0[20 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 21;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetConvolutionFilter {
type Cookie = GetConvolutionFilterCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetConvolutionFilter {
type Reply = GetConvolutionFilterReply;
type Cookie = GetConvolutionFilterCookie;
type CookieUnchecked = GetConvolutionFilterCookieUnchecked;
}
pub struct GetConvolutionParameterfvReply {
raw: *const u8,
}
impl GetConvolutionParameterfvReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 12usize;
sz += ((n as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> f32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const f32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[f32] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const f32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetConvolutionParameterfvReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetConvolutionParameterfvReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetConvolutionParameterfvReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetConvolutionParameterfvReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetConvolutionParameterfvReply {}
unsafe impl std::marker::Sync for GetConvolutionParameterfvReply {}
#[derive(Debug)]
pub struct GetConvolutionParameterfvCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetConvolutionParameterfvCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetConvolutionParameterfvCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetConvolutionParameterfvCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetConvolutionParameterfvCookie {
}
unsafe impl base::CookieWithReplyChecked for GetConvolutionParameterfvCookie {
type Reply = GetConvolutionParameterfvReply;
}
impl base::Cookie for GetConvolutionParameterfvCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetConvolutionParameterfvCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetConvolutionParameterfvCookieUnchecked {
type Reply = GetConvolutionParameterfvReply;
}
#[derive(Clone, Debug)]
pub struct GetConvolutionParameterfv {
pub context_tag: ContextTag,
pub target: u32,
pub pname: u32,
}
unsafe impl base::RawRequest for GetConvolutionParameterfv {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 151,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 16];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.target.serialize(&mut buf0[8 .. ]);
self.pname.serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetConvolutionParameterfv {
type Cookie = GetConvolutionParameterfvCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetConvolutionParameterfv {
type Reply = GetConvolutionParameterfvReply;
type Cookie = GetConvolutionParameterfvCookie;
type CookieUnchecked = GetConvolutionParameterfvCookieUnchecked;
}
pub struct GetConvolutionParameterivReply {
raw: *const u8,
}
impl GetConvolutionParameterivReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 12usize;
sz += ((n as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> i32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const i32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[i32] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const i32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetConvolutionParameterivReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetConvolutionParameterivReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetConvolutionParameterivReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetConvolutionParameterivReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetConvolutionParameterivReply {}
unsafe impl std::marker::Sync for GetConvolutionParameterivReply {}
#[derive(Debug)]
pub struct GetConvolutionParameterivCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetConvolutionParameterivCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetConvolutionParameterivCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetConvolutionParameterivCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetConvolutionParameterivCookie {
}
unsafe impl base::CookieWithReplyChecked for GetConvolutionParameterivCookie {
type Reply = GetConvolutionParameterivReply;
}
impl base::Cookie for GetConvolutionParameterivCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetConvolutionParameterivCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetConvolutionParameterivCookieUnchecked {
type Reply = GetConvolutionParameterivReply;
}
#[derive(Clone, Debug)]
pub struct GetConvolutionParameteriv {
pub context_tag: ContextTag,
pub target: u32,
pub pname: u32,
}
unsafe impl base::RawRequest for GetConvolutionParameteriv {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 152,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 16];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.target.serialize(&mut buf0[8 .. ]);
self.pname.serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetConvolutionParameteriv {
type Cookie = GetConvolutionParameterivCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetConvolutionParameteriv {
type Reply = GetConvolutionParameterivReply;
type Cookie = GetConvolutionParameterivCookie;
type CookieUnchecked = GetConvolutionParameterivCookieUnchecked;
}
pub struct GetSeparableFilterReply {
raw: *const u8,
}
impl GetSeparableFilterReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
let length = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 8usize;
sz += 4usize;
sz += 4usize;
sz += 8usize;
sz += ((length as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn row_w(&self) -> i32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const i32;
base::value_from_ptr(ptr)
}
}
pub fn col_h(&self) -> i32 {
unsafe {
let offset = 20usize;
let ptr = self.wire_ptr().add(offset) as *const i32;
base::value_from_ptr(ptr)
}
}
pub fn rows_and_cols(&self) -> &[u8] {
unsafe {
let offset = 32usize;
let len = ((self.length() as usize) * 4usize);
let ptr = self.wire_ptr().add(offset) as *const u8;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetSeparableFilterReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetSeparableFilterReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetSeparableFilterReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &8)
.field("row_w", &self.row_w())
.field("col_h", &self.col_h())
.field("pad", &8)
.field("rows_and_cols", &self.rows_and_cols())
.finish()
}
}
impl Drop for GetSeparableFilterReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetSeparableFilterReply {}
unsafe impl std::marker::Sync for GetSeparableFilterReply {}
#[derive(Debug)]
pub struct GetSeparableFilterCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetSeparableFilterCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetSeparableFilterCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetSeparableFilterCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetSeparableFilterCookie {
}
unsafe impl base::CookieWithReplyChecked for GetSeparableFilterCookie {
type Reply = GetSeparableFilterReply;
}
impl base::Cookie for GetSeparableFilterCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetSeparableFilterCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetSeparableFilterCookieUnchecked {
type Reply = GetSeparableFilterReply;
}
#[derive(Clone, Debug)]
pub struct GetSeparableFilter {
pub context_tag: ContextTag,
pub target: u32,
pub format: u32,
pub r#type: u32,
pub swap_bytes: bool,
}
unsafe impl base::RawRequest for GetSeparableFilter {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 153,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 21];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.target.serialize(&mut buf0[8 .. ]);
self.format.serialize(&mut buf0[12 .. ]);
self.r#type.serialize(&mut buf0[16 .. ]);
(if self.swap_bytes { 1u8 } else { 0u8 }).serialize(&mut buf0[20 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 21;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetSeparableFilter {
type Cookie = GetSeparableFilterCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetSeparableFilter {
type Reply = GetSeparableFilterReply;
type Cookie = GetSeparableFilterCookie;
type CookieUnchecked = GetSeparableFilterCookieUnchecked;
}
pub struct GetHistogramReply {
raw: *const u8,
}
impl GetHistogramReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
let length = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 8usize;
sz += 4usize;
sz += 12usize;
sz += ((length as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn width(&self) -> i32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const i32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[u8] {
unsafe {
let offset = 32usize;
let len = ((self.length() as usize) * 4usize);
let ptr = self.wire_ptr().add(offset) as *const u8;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetHistogramReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetHistogramReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetHistogramReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &8)
.field("width", &self.width())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetHistogramReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetHistogramReply {}
unsafe impl std::marker::Sync for GetHistogramReply {}
#[derive(Debug)]
pub struct GetHistogramCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetHistogramCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetHistogramCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetHistogramCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetHistogramCookie {
}
unsafe impl base::CookieWithReplyChecked for GetHistogramCookie {
type Reply = GetHistogramReply;
}
impl base::Cookie for GetHistogramCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetHistogramCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetHistogramCookieUnchecked {
type Reply = GetHistogramReply;
}
#[derive(Clone, Debug)]
pub struct GetHistogram {
pub context_tag: ContextTag,
pub target: u32,
pub format: u32,
pub r#type: u32,
pub swap_bytes: bool,
pub reset: bool,
}
unsafe impl base::RawRequest for GetHistogram {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 154,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 22];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.target.serialize(&mut buf0[8 .. ]);
self.format.serialize(&mut buf0[12 .. ]);
self.r#type.serialize(&mut buf0[16 .. ]);
(if self.swap_bytes { 1u8 } else { 0u8 }).serialize(&mut buf0[20 .. ]);
(if self.reset { 1u8 } else { 0u8 }).serialize(&mut buf0[21 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 22;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetHistogram {
type Cookie = GetHistogramCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetHistogram {
type Reply = GetHistogramReply;
type Cookie = GetHistogramCookie;
type CookieUnchecked = GetHistogramCookieUnchecked;
}
pub struct GetHistogramParameterfvReply {
raw: *const u8,
}
impl GetHistogramParameterfvReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 12usize;
sz += ((n as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> f32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const f32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[f32] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const f32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetHistogramParameterfvReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetHistogramParameterfvReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetHistogramParameterfvReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetHistogramParameterfvReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetHistogramParameterfvReply {}
unsafe impl std::marker::Sync for GetHistogramParameterfvReply {}
#[derive(Debug)]
pub struct GetHistogramParameterfvCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetHistogramParameterfvCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetHistogramParameterfvCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetHistogramParameterfvCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetHistogramParameterfvCookie {
}
unsafe impl base::CookieWithReplyChecked for GetHistogramParameterfvCookie {
type Reply = GetHistogramParameterfvReply;
}
impl base::Cookie for GetHistogramParameterfvCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetHistogramParameterfvCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetHistogramParameterfvCookieUnchecked {
type Reply = GetHistogramParameterfvReply;
}
#[derive(Clone, Debug)]
pub struct GetHistogramParameterfv {
pub context_tag: ContextTag,
pub target: u32,
pub pname: u32,
}
unsafe impl base::RawRequest for GetHistogramParameterfv {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 155,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 16];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.target.serialize(&mut buf0[8 .. ]);
self.pname.serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetHistogramParameterfv {
type Cookie = GetHistogramParameterfvCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetHistogramParameterfv {
type Reply = GetHistogramParameterfvReply;
type Cookie = GetHistogramParameterfvCookie;
type CookieUnchecked = GetHistogramParameterfvCookieUnchecked;
}
pub struct GetHistogramParameterivReply {
raw: *const u8,
}
impl GetHistogramParameterivReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 12usize;
sz += ((n as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> i32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const i32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[i32] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const i32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetHistogramParameterivReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetHistogramParameterivReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetHistogramParameterivReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetHistogramParameterivReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetHistogramParameterivReply {}
unsafe impl std::marker::Sync for GetHistogramParameterivReply {}
#[derive(Debug)]
pub struct GetHistogramParameterivCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetHistogramParameterivCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetHistogramParameterivCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetHistogramParameterivCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetHistogramParameterivCookie {
}
unsafe impl base::CookieWithReplyChecked for GetHistogramParameterivCookie {
type Reply = GetHistogramParameterivReply;
}
impl base::Cookie for GetHistogramParameterivCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetHistogramParameterivCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetHistogramParameterivCookieUnchecked {
type Reply = GetHistogramParameterivReply;
}
#[derive(Clone, Debug)]
pub struct GetHistogramParameteriv {
pub context_tag: ContextTag,
pub target: u32,
pub pname: u32,
}
unsafe impl base::RawRequest for GetHistogramParameteriv {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 156,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 16];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.target.serialize(&mut buf0[8 .. ]);
self.pname.serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetHistogramParameteriv {
type Cookie = GetHistogramParameterivCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetHistogramParameteriv {
type Reply = GetHistogramParameterivReply;
type Cookie = GetHistogramParameterivCookie;
type CookieUnchecked = GetHistogramParameterivCookieUnchecked;
}
pub struct GetMinmaxReply {
raw: *const u8,
}
impl GetMinmaxReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
let length = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 24usize;
sz += ((length as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[u8] {
unsafe {
let offset = 32usize;
let len = ((self.length() as usize) * 4usize);
let ptr = self.wire_ptr().add(offset) as *const u8;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetMinmaxReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetMinmaxReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetMinmaxReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &24)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetMinmaxReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetMinmaxReply {}
unsafe impl std::marker::Sync for GetMinmaxReply {}
#[derive(Debug)]
pub struct GetMinmaxCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetMinmaxCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetMinmaxCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetMinmaxCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetMinmaxCookie {
}
unsafe impl base::CookieWithReplyChecked for GetMinmaxCookie {
type Reply = GetMinmaxReply;
}
impl base::Cookie for GetMinmaxCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetMinmaxCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetMinmaxCookieUnchecked {
type Reply = GetMinmaxReply;
}
#[derive(Clone, Debug)]
pub struct GetMinmax {
pub context_tag: ContextTag,
pub target: u32,
pub format: u32,
pub r#type: u32,
pub swap_bytes: bool,
pub reset: bool,
}
unsafe impl base::RawRequest for GetMinmax {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 157,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 22];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.target.serialize(&mut buf0[8 .. ]);
self.format.serialize(&mut buf0[12 .. ]);
self.r#type.serialize(&mut buf0[16 .. ]);
(if self.swap_bytes { 1u8 } else { 0u8 }).serialize(&mut buf0[20 .. ]);
(if self.reset { 1u8 } else { 0u8 }).serialize(&mut buf0[21 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 22;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetMinmax {
type Cookie = GetMinmaxCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetMinmax {
type Reply = GetMinmaxReply;
type Cookie = GetMinmaxCookie;
type CookieUnchecked = GetMinmaxCookieUnchecked;
}
pub struct GetMinmaxParameterfvReply {
raw: *const u8,
}
impl GetMinmaxParameterfvReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 12usize;
sz += ((n as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> f32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const f32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[f32] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const f32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetMinmaxParameterfvReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetMinmaxParameterfvReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetMinmaxParameterfvReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetMinmaxParameterfvReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetMinmaxParameterfvReply {}
unsafe impl std::marker::Sync for GetMinmaxParameterfvReply {}
#[derive(Debug)]
pub struct GetMinmaxParameterfvCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetMinmaxParameterfvCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetMinmaxParameterfvCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetMinmaxParameterfvCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetMinmaxParameterfvCookie {
}
unsafe impl base::CookieWithReplyChecked for GetMinmaxParameterfvCookie {
type Reply = GetMinmaxParameterfvReply;
}
impl base::Cookie for GetMinmaxParameterfvCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetMinmaxParameterfvCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetMinmaxParameterfvCookieUnchecked {
type Reply = GetMinmaxParameterfvReply;
}
#[derive(Clone, Debug)]
pub struct GetMinmaxParameterfv {
pub context_tag: ContextTag,
pub target: u32,
pub pname: u32,
}
unsafe impl base::RawRequest for GetMinmaxParameterfv {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 158,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 16];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.target.serialize(&mut buf0[8 .. ]);
self.pname.serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetMinmaxParameterfv {
type Cookie = GetMinmaxParameterfvCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetMinmaxParameterfv {
type Reply = GetMinmaxParameterfvReply;
type Cookie = GetMinmaxParameterfvCookie;
type CookieUnchecked = GetMinmaxParameterfvCookieUnchecked;
}
pub struct GetMinmaxParameterivReply {
raw: *const u8,
}
impl GetMinmaxParameterivReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 12usize;
sz += ((n as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> i32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const i32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[i32] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const i32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetMinmaxParameterivReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetMinmaxParameterivReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetMinmaxParameterivReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetMinmaxParameterivReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetMinmaxParameterivReply {}
unsafe impl std::marker::Sync for GetMinmaxParameterivReply {}
#[derive(Debug)]
pub struct GetMinmaxParameterivCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetMinmaxParameterivCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetMinmaxParameterivCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetMinmaxParameterivCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetMinmaxParameterivCookie {
}
unsafe impl base::CookieWithReplyChecked for GetMinmaxParameterivCookie {
type Reply = GetMinmaxParameterivReply;
}
impl base::Cookie for GetMinmaxParameterivCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetMinmaxParameterivCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetMinmaxParameterivCookieUnchecked {
type Reply = GetMinmaxParameterivReply;
}
#[derive(Clone, Debug)]
pub struct GetMinmaxParameteriv {
pub context_tag: ContextTag,
pub target: u32,
pub pname: u32,
}
unsafe impl base::RawRequest for GetMinmaxParameteriv {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 159,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 16];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.target.serialize(&mut buf0[8 .. ]);
self.pname.serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetMinmaxParameteriv {
type Cookie = GetMinmaxParameterivCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetMinmaxParameteriv {
type Reply = GetMinmaxParameterivReply;
type Cookie = GetMinmaxParameterivCookie;
type CookieUnchecked = GetMinmaxParameterivCookieUnchecked;
}
pub struct GetCompressedTexImageArbReply {
raw: *const u8,
}
impl GetCompressedTexImageArbReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
let length = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 8usize;
sz += 4usize;
sz += 12usize;
sz += ((length as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn size(&self) -> i32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const i32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[u8] {
unsafe {
let offset = 32usize;
let len = ((self.length() as usize) * 4usize);
let ptr = self.wire_ptr().add(offset) as *const u8;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetCompressedTexImageArbReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetCompressedTexImageArbReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetCompressedTexImageArbReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &8)
.field("size", &self.size())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetCompressedTexImageArbReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetCompressedTexImageArbReply {}
unsafe impl std::marker::Sync for GetCompressedTexImageArbReply {}
#[derive(Debug)]
pub struct GetCompressedTexImageArbCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetCompressedTexImageArbCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetCompressedTexImageArbCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetCompressedTexImageArbCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetCompressedTexImageArbCookie {
}
unsafe impl base::CookieWithReplyChecked for GetCompressedTexImageArbCookie {
type Reply = GetCompressedTexImageArbReply;
}
impl base::Cookie for GetCompressedTexImageArbCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetCompressedTexImageArbCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetCompressedTexImageArbCookieUnchecked {
type Reply = GetCompressedTexImageArbReply;
}
#[derive(Clone, Debug)]
pub struct GetCompressedTexImageArb {
pub context_tag: ContextTag,
pub target: u32,
pub level: i32,
}
unsafe impl base::RawRequest for GetCompressedTexImageArb {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 160,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 16];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.target.serialize(&mut buf0[8 .. ]);
self.level.serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetCompressedTexImageArb {
type Cookie = GetCompressedTexImageArbCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetCompressedTexImageArb {
type Reply = GetCompressedTexImageArbReply;
type Cookie = GetCompressedTexImageArbCookie;
type CookieUnchecked = GetCompressedTexImageArbCookieUnchecked;
}
#[derive(Clone, Debug)]
pub struct DeleteQueriesArb<'a> {
pub context_tag: ContextTag,
pub ids: &'a [u32],
}
unsafe impl<'a> base::RawRequest for DeleteQueriesArb<'a> {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 4,
ext: (&mut FFI_EXT) as *mut _,
opcode: 161,
isvoid: 1,
};
let mut sections: [iovec; 6] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 6];
let buf0: &mut [u8] = &mut [0; 12];
self.context_tag.serialize(&mut buf0[4 .. ]);
(self.ids.len() as i32).serialize(&mut buf0[8 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 12;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
sections[4].iov_base = self.ids.as_ptr() as *mut _;
sections[4].iov_len = self.ids.len() * std::mem::size_of::<u32>();
sections[5].iov_len = base::align_pad(sections[4].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl<'a> base::Request for DeleteQueriesArb<'a> {
type Cookie = base::VoidCookie;
const IS_VOID: bool = true;
}
impl<'a> base::RequestWithoutReply for DeleteQueriesArb<'a> {
}
pub struct GenQueriesArbReply {
raw: *const u8,
}
impl GenQueriesArbReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
let length = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 24usize;
sz += ((length as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[u32] {
unsafe {
let offset = 32usize;
let len = (self.length() as usize);
let ptr = self.wire_ptr().add(offset) as *const u32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GenQueriesArbReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GenQueriesArbReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GenQueriesArbReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &24)
.field("data", &self.data())
.finish()
}
}
impl Drop for GenQueriesArbReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GenQueriesArbReply {}
unsafe impl std::marker::Sync for GenQueriesArbReply {}
#[derive(Debug)]
pub struct GenQueriesArbCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GenQueriesArbCookieUnchecked {
seq: u64,
}
impl base::Cookie for GenQueriesArbCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GenQueriesArbCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GenQueriesArbCookie {
}
unsafe impl base::CookieWithReplyChecked for GenQueriesArbCookie {
type Reply = GenQueriesArbReply;
}
impl base::Cookie for GenQueriesArbCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GenQueriesArbCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GenQueriesArbCookieUnchecked {
type Reply = GenQueriesArbReply;
}
#[derive(Clone, Debug)]
pub struct GenQueriesArb {
pub context_tag: ContextTag,
pub n: i32,
}
unsafe impl base::RawRequest for GenQueriesArb {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 162,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 12];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.n.serialize(&mut buf0[8 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 12;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GenQueriesArb {
type Cookie = GenQueriesArbCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GenQueriesArb {
type Reply = GenQueriesArbReply;
type Cookie = GenQueriesArbCookie;
type CookieUnchecked = GenQueriesArbCookieUnchecked;
}
pub struct IsQueryArbReply {
raw: *const u8,
}
impl IsQueryArbReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn ret_val(&self) -> bool {
let val = unsafe { *(self.wire_ptr().add(8usize)) };
val != 0
}
}
impl base::Reply for IsQueryArbReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for IsQueryArbReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("IsQueryArbReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("ret_val", &self.ret_val())
.finish()
}
}
impl Drop for IsQueryArbReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for IsQueryArbReply {}
unsafe impl std::marker::Sync for IsQueryArbReply {}
#[derive(Debug)]
pub struct IsQueryArbCookie {
seq: u64,
}
#[derive(Debug)]
pub struct IsQueryArbCookieUnchecked {
seq: u64,
}
impl base::Cookie for IsQueryArbCookie {
unsafe fn from_sequence(seq: u64) -> Self {
IsQueryArbCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for IsQueryArbCookie {
}
unsafe impl base::CookieWithReplyChecked for IsQueryArbCookie {
type Reply = IsQueryArbReply;
}
impl base::Cookie for IsQueryArbCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
IsQueryArbCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for IsQueryArbCookieUnchecked {
type Reply = IsQueryArbReply;
}
#[derive(Clone, Debug)]
pub struct IsQueryArb {
pub context_tag: ContextTag,
pub id: u32,
}
unsafe impl base::RawRequest for IsQueryArb {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 163,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 12];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.id.serialize(&mut buf0[8 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 12;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for IsQueryArb {
type Cookie = IsQueryArbCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for IsQueryArb {
type Reply = IsQueryArbReply;
type Cookie = IsQueryArbCookie;
type CookieUnchecked = IsQueryArbCookieUnchecked;
}
pub struct GetQueryivArbReply {
raw: *const u8,
}
impl GetQueryivArbReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 12usize;
sz += ((n as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> i32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const i32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[i32] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const i32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetQueryivArbReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetQueryivArbReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetQueryivArbReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetQueryivArbReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetQueryivArbReply {}
unsafe impl std::marker::Sync for GetQueryivArbReply {}
#[derive(Debug)]
pub struct GetQueryivArbCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetQueryivArbCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetQueryivArbCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetQueryivArbCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetQueryivArbCookie {
}
unsafe impl base::CookieWithReplyChecked for GetQueryivArbCookie {
type Reply = GetQueryivArbReply;
}
impl base::Cookie for GetQueryivArbCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetQueryivArbCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetQueryivArbCookieUnchecked {
type Reply = GetQueryivArbReply;
}
#[derive(Clone, Debug)]
pub struct GetQueryivArb {
pub context_tag: ContextTag,
pub target: u32,
pub pname: u32,
}
unsafe impl base::RawRequest for GetQueryivArb {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 164,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 16];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.target.serialize(&mut buf0[8 .. ]);
self.pname.serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetQueryivArb {
type Cookie = GetQueryivArbCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetQueryivArb {
type Reply = GetQueryivArbReply;
type Cookie = GetQueryivArbCookie;
type CookieUnchecked = GetQueryivArbCookieUnchecked;
}
pub struct GetQueryObjectivArbReply {
raw: *const u8,
}
impl GetQueryObjectivArbReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 12usize;
sz += ((n as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> i32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const i32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[i32] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const i32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetQueryObjectivArbReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetQueryObjectivArbReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetQueryObjectivArbReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetQueryObjectivArbReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetQueryObjectivArbReply {}
unsafe impl std::marker::Sync for GetQueryObjectivArbReply {}
#[derive(Debug)]
pub struct GetQueryObjectivArbCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetQueryObjectivArbCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetQueryObjectivArbCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetQueryObjectivArbCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetQueryObjectivArbCookie {
}
unsafe impl base::CookieWithReplyChecked for GetQueryObjectivArbCookie {
type Reply = GetQueryObjectivArbReply;
}
impl base::Cookie for GetQueryObjectivArbCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetQueryObjectivArbCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetQueryObjectivArbCookieUnchecked {
type Reply = GetQueryObjectivArbReply;
}
#[derive(Clone, Debug)]
pub struct GetQueryObjectivArb {
pub context_tag: ContextTag,
pub id: u32,
pub pname: u32,
}
unsafe impl base::RawRequest for GetQueryObjectivArb {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 165,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 16];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.id.serialize(&mut buf0[8 .. ]);
self.pname.serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetQueryObjectivArb {
type Cookie = GetQueryObjectivArbCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetQueryObjectivArb {
type Reply = GetQueryObjectivArbReply;
type Cookie = GetQueryObjectivArbCookie;
type CookieUnchecked = GetQueryObjectivArbCookieUnchecked;
}
pub struct GetQueryObjectuivArbReply {
raw: *const u8,
}
impl GetQueryObjectuivArbReply {
fn wire_ptr(&self) -> *const u8 {
self.raw
}
fn wire_len(&self) -> usize {
(32 + self.length() * 4) as _
}
unsafe fn compute_len(ptr: *const u8, _params: ()) -> usize {
let mut sz = 0;
sz += 1usize;
sz += 1usize;
sz += 2usize;
sz += 4usize;
sz += 4usize;
let n = *(ptr.add(sz) as *const u32);
sz += 4usize;
sz += 4usize;
sz += 12usize;
sz += ((n as usize) * 4usize);
sz
}
pub fn response_type(&self) -> u8 {
unsafe {
let offset = 0usize;
let ptr = self.wire_ptr().add(offset) as *const u8;
base::value_from_ptr(ptr)
}
}
pub fn sequence(&self) -> u16 {
unsafe {
let offset = 2usize;
let ptr = self.wire_ptr().add(offset) as *const u16;
base::value_from_ptr(ptr)
}
}
pub fn length(&self) -> u32 {
unsafe {
let offset = 4usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
fn n(&self) -> u32 {
unsafe {
let offset = 12usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn datum(&self) -> u32 {
unsafe {
let offset = 16usize;
let ptr = self.wire_ptr().add(offset) as *const u32;
base::value_from_ptr(ptr)
}
}
pub fn data(&self) -> &[u32] {
unsafe {
let offset = 32usize;
let len = (self.n() as usize);
let ptr = self.wire_ptr().add(offset) as *const u32;
std::slice::from_raw_parts(ptr, len)
}
}
}
impl base::Reply for GetQueryObjectuivArbReply {
unsafe fn from_raw(raw: *const u8) -> Self {
Self { raw }
}
unsafe fn into_raw(self) -> *const u8 {
let raw = self.raw;
std::mem::forget(self);
raw
}
}
impl std::fmt::Debug for GetQueryObjectuivArbReply {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GetQueryObjectuivArbReply")
.field("response_type", &self.response_type())
.field("pad", &1)
.field("sequence", &self.sequence())
.field("length", &self.length())
.field("pad", &4)
.field("n", &self.n())
.field("datum", &self.datum())
.field("pad", &12)
.field("data", &self.data())
.finish()
}
}
impl Drop for GetQueryObjectuivArbReply {
fn drop(&mut self) {
unsafe { libc::free(self.raw as *mut _); }
}
}
unsafe impl std::marker::Send for GetQueryObjectuivArbReply {}
unsafe impl std::marker::Sync for GetQueryObjectuivArbReply {}
#[derive(Debug)]
pub struct GetQueryObjectuivArbCookie {
seq: u64,
}
#[derive(Debug)]
pub struct GetQueryObjectuivArbCookieUnchecked {
seq: u64,
}
impl base::Cookie for GetQueryObjectuivArbCookie {
unsafe fn from_sequence(seq: u64) -> Self {
GetQueryObjectuivArbCookie { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieChecked for GetQueryObjectuivArbCookie {
}
unsafe impl base::CookieWithReplyChecked for GetQueryObjectuivArbCookie {
type Reply = GetQueryObjectuivArbReply;
}
impl base::Cookie for GetQueryObjectuivArbCookieUnchecked {
unsafe fn from_sequence(seq: u64) -> Self {
GetQueryObjectuivArbCookieUnchecked { seq }
}
fn sequence(&self) -> u64 {
self.seq
}
}
unsafe impl base::CookieWithReplyUnchecked for GetQueryObjectuivArbCookieUnchecked {
type Reply = GetQueryObjectuivArbReply;
}
#[derive(Clone, Debug)]
pub struct GetQueryObjectuivArb {
pub context_tag: ContextTag,
pub id: u32,
pub pname: u32,
}
unsafe impl base::RawRequest for GetQueryObjectuivArb {
fn raw_request(&self, c: &base::Connection, checked: bool) -> u64 { unsafe {
let mut protocol_request = xcb_protocol_request_t {
count: 2,
ext: (&mut FFI_EXT) as *mut _,
opcode: 166,
isvoid: 0,
};
let mut sections: [iovec; 4] = [iovec {
iov_base: std::ptr::null_mut(),
iov_len: 0,
}; 4];
let buf0: &mut [u8] = &mut [0; 16];
self.context_tag.serialize(&mut buf0[4 .. ]);
self.id.serialize(&mut buf0[8 .. ]);
self.pname.serialize(&mut buf0[12 .. ]);
sections[2].iov_base = buf0.as_mut_ptr() as *mut _;
sections[2].iov_len = 16;
sections[3].iov_len = base::align_pad(sections[2].iov_len, 4);
let flags = if checked { base::RequestFlags::CHECKED } else { base::RequestFlags::NONE };
xcb_send_request64(
c.get_raw_conn(),
flags.bits() as _,
sections.as_mut_ptr().add(2),
&mut protocol_request as *mut _,
)
}
}}
impl base::Request for GetQueryObjectuivArb {
type Cookie = GetQueryObjectuivArbCookie;
const IS_VOID: bool = false;
}
impl base::RequestWithReply for GetQueryObjectuivArb {
type Reply = GetQueryObjectuivArbReply;
type Cookie = GetQueryObjectuivArbCookie;
type CookieUnchecked = GetQueryObjectuivArbCookieUnchecked;
}