1
use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [ * const sys :: common :: wl_interface ; 8 ] = [ NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , ] ; pub mod presentation_time { use super :: wayland :: * ; use super :: xdg_shell :: * ; # [ doc = "timed presentation related wl_surface requests\n\nThe main feature of this interface is accurate presentation\ntiming feedback to ensure smooth video playback while maintaining\naudio/video synchronization. Some features use the concept of a\npresentation clock, which is defined in the\npresentation.clock_id event.\n\nA content update for a wl_surface is submitted by a\nwl_surface.commit request. Request 'feedback' associates with\nthe wl_surface.commit and provides feedback on the content\nupdate, particularly the final realized presentation time.\n\n\n\nWhen the final realized presentation time is available, e.g.\nafter a framebuffer flip completes, the requested\npresentation_feedback.presented events are sent. The final\npresentation time can differ from the compositor's predicted\ndisplay update time and the update's target time, especially\nwhen the compositor misses its target vertical blanking period." ] pub mod wp_presentation { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum wp_presentation { } # [ doc = "fatal presentation errors\n\nThese fatal protocol errors may be emitted in response to\nillegal presentation requests." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum error { # [ doc = "invalid value in tv_nsec" ] invalid_timestamp = 0 , # [ doc = "invalid flag" ] invalid_flag = 1 , # [ doc ( hidden ) ] __nonexhaustive , } impl error { pub fn from_raw ( n : u32 ) -> Option < error > { match n { 0 => Some ( error :: invalid_timestamp ) , 1 => Some ( error :: invalid_flag ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } static mut wp_presentation_requests_feedback_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wp_presentation_feedback :: wp_presentation_feedback_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wp_presentation_requests : [ wl_message ; 2 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"feedback\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & wp_presentation_requests_feedback_types as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wp_presentation_events : [ wl_message ; 1 ] = [ wl_message { name : b"clock_id\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut wp_presentation_interface : wl_interface = wl_interface { name : b"wp_presentation\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & wp_presentation_requests as * const _ } , event_count : 1 , events : unsafe { & wp_presentation_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait wp_presentation_listener { # [ doc = "clock ID for timestamps\n\nThis event tells the client in which clock domain the\ncompositor interprets the timestamps used by the presentation\nextension. This clock is called the presentation clock.\n\nThe compositor sends this event when the client binds to the\npresentation interface. The presentation clock does not change\nduring the lifetime of the client connection.\n\nThe clock identifier is platform dependent. On Linux/glibc,\nthe identifier value is one of the clockid_t values accepted\nby clock_gettime(). clock_gettime() is defined by\nPOSIX.1-2001.\n\nTimestamps in this clock domain are expressed as tv_sec_hi,\ntv_sec_lo, tv_nsec triples, each component being an unsigned\n32-bit value. Whole seconds are in tv_sec which is a 64-bit\nvalue combined from tv_sec_hi and tv_sec_lo, and the\nadditional fractional part in tv_nsec as nanoseconds. Hence,\nfor valid timestamps tv_nsec must be in [0, 999999999].\n\nNote that clock_id applies only to the presentation clock,\nand implies nothing about e.g. the timestamps used in the\nWayland core protocol input events.\n\nCompositors should prefer a clock which does not jump and is\nnot slewed e.g. by NTP. The absolute value of the clock is\nirrelevant. Precision of one millisecond or better is\nrecommended. Clients must be able to query the current clock\nvalue directly, not by asking the compositor." ] fn clock_id ( & mut self , object : * mut wp_presentation , clk_id : u32 ) { } } pub unsafe fn wp_presentation_set_user_data ( wp_presentation : * mut super :: wp_presentation :: wp_presentation , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , wp_presentation as _ , user_data ) ; } pub unsafe fn wp_presentation_get_user_data ( wp_presentation : * mut super :: wp_presentation :: wp_presentation ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , wp_presentation as _ ) ; } pub unsafe fn wp_presentation_get_version ( wp_presentation : * mut super :: wp_presentation :: wp_presentation ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , wp_presentation as _ ) ; } pub unsafe fn wp_presentation_add_listener ( wp_presentation : * mut super :: wp_presentation :: wp_presentation , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , wp_presentation as _ , listener as _ , data as _ ) ; } pub unsafe fn wp_presentation_add_rust_listener ( wp_presentation : * mut super :: wp_presentation :: wp_presentation , listener : & dyn wp_presentation_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return wp_presentation_add_listener ( wp_presentation as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "unbind from the presentation interface\n\nInforms the server that the client will no longer be using\nthis protocol object. Existing objects created by this object\nare not affected." ] pub unsafe fn wp_presentation_destroy ( wp_presentation : * mut super :: wp_presentation :: wp_presentation ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wp_presentation as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , wp_presentation as _ ) ; } # [ doc = "request presentation feedback information\n\nRequest presentation feedback for the current content submission\non the given surface. This creates a new presentation_feedback\nobject, which will deliver the feedback information once. If\nmultiple presentation_feedback objects are created for the same\nsubmission, they will all deliver the same information.\n\nFor details on what information is returned, see the\npresentation_feedback interface." ] pub unsafe fn wp_presentation_feedback ( wp_presentation : * mut super :: wp_presentation :: wp_presentation , surface : * mut super :: wl_surface :: wl_surface ) -> * mut super :: wp_presentation_feedback :: wp_presentation_feedback { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , wp_presentation as _ , 1u32 , & super :: wp_presentation_feedback :: wp_presentation_feedback_interface as * const _ , surface , std :: ptr :: null :: < c_void > ( ) ) ; return r as _ ; } } # [ doc = "presentation time feedback event\n\nA presentation_feedback object returns an indication that a\nwl_surface content update has become visible to the user.\nOne object corresponds to one content update submission\n(wl_surface.commit). There are two possible outcomes: the\ncontent update is presented to the user, and a presentation\ntimestamp delivered; or, the user did not see the content\nupdate because it was superseded or its surface destroyed,\nand the content update is discarded.\n\nOnce a presentation_feedback object has delivered a 'presented'\nor 'discarded' event it is automatically destroyed." ] pub mod wp_presentation_feedback { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum wp_presentation_feedback { } # [ doc = "bitmask of flags in presented event\n\nThese flags provide information about how the presentation of\nthe related content update was done. The intent is to help\nclients assess the reliability of the feedback and the visual\nquality with respect to possible tearing and timings. The\nflags are:\n\nVSYNC:\nThe presentation was synchronized to the \"vertical retrace\" by\nthe display hardware such that tearing does not happen.\nRelying on user space scheduling is not acceptable for this\nflag. If presentation is done by a copy to the active\nfrontbuffer, then it must guarantee that tearing cannot\nhappen.\n\nHW_CLOCK:\nThe display hardware provided measurements that the hardware\ndriver converted into a presentation timestamp. Sampling a\nclock in user space is not acceptable for this flag.\n\nHW_COMPLETION:\nThe display hardware signalled that it started using the new\nimage content. The opposite of this is e.g. a timer being used\nto guess when the display hardware has switched to the new\nimage content.\n\nZERO_COPY:\nThe presentation of this update was done zero-copy. This means\nthe buffer from the client was given to display hardware as\nis, without copying it. Compositing with OpenGL counts as\ncopying, even if textured directly from the client buffer.\nPossible zero-copy cases include direct scanout of a\nfullscreen surface and a surface on a hardware overlay." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum kind { # [ doc = "presentation was vsync'd" ] vsync = 1 , # [ doc = "hardware provided the presentation timestamp" ] hw_clock = 2 , # [ doc = "hardware signalled the start of the presentation" ] hw_completion = 4 , # [ doc = "presentation was done zero-copy" ] zero_copy = 8 , # [ doc ( hidden ) ] __nonexhaustive , } impl kind { pub fn from_raw ( n : u32 ) -> Option < kind > { match n { 1 => Some ( kind :: vsync ) , 2 => Some ( kind :: hw_clock ) , 4 => Some ( kind :: hw_completion ) , 8 => Some ( kind :: zero_copy ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } static mut wp_presentation_feedback_events_sync_output_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wp_presentation_feedback_events : [ wl_message ; 3 ] = [ wl_message { name : b"sync_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & wp_presentation_feedback_events_sync_output_types as * const _ } , } , wl_message { name : b"presented\0" as * const u8 as * const c_char , signature : b"uuuuuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"discarded\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut wp_presentation_feedback_interface : wl_interface = wl_interface { name : b"wp_presentation_feedback\0" as * const u8 as * const c_char , version : 1 , request_count : 0 , requests : NULLPTR as * const wl_message , event_count : 3 , events : unsafe { & wp_presentation_feedback_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait wp_presentation_feedback_listener { # [ doc = "presentation synchronized to this output\n\nAs presentation can be synchronized to only one output at a\ntime, this event tells which output it was. This event is only\nsent prior to the presented event.\n\nAs clients may bind to the same global wl_output multiple\ntimes, this event is sent for each bound instance that matches\nthe synchronized output. If a client has not bound to the\nright wl_output global at all, this event is not sent." ] fn sync_output ( & mut self , object : * mut wp_presentation_feedback , output : * mut super :: wl_output :: wl_output ) { } # [ doc = "the content update was displayed\n\nThe associated content update was displayed to the user at the\nindicated time (tv_sec_hi/lo, tv_nsec). For the interpretation of\nthe timestamp, see presentation.clock_id event.\n\nThe timestamp corresponds to the time when the content update\nturned into light the first time on the surface's main output.\nCompositors may approximate this from the framebuffer flip\ncompletion events from the system, and the latency of the\nphysical display path if known.\n\nThis event is preceded by all related sync_output events\ntelling which output's refresh cycle the feedback corresponds\nto, i.e. the main output for the surface. Compositors are\nrecommended to choose the output containing the largest part\nof the wl_surface, or keeping the output they previously\nchose. Having a stable presentation output association helps\nclients predict future output refreshes (vblank).\n\nThe 'refresh' argument gives the compositor's prediction of how\nmany nanoseconds after tv_sec, tv_nsec the very next output\nrefresh may occur. This is to further aid clients in\npredicting future refreshes, i.e., estimating the timestamps\ntargeting the next few vblanks. If such prediction cannot\nusefully be done, the argument is zero.\n\nIf the output does not have a constant refresh rate, explicit\nvideo mode switches excluded, then the refresh argument must\nbe zero.\n\nThe 64-bit value combined from seq_hi and seq_lo is the value\nof the output's vertical retrace counter when the content\nupdate was first scanned out to the display. This value must\nbe compatible with the definition of MSC in\nGLX_OML_sync_control specification. Note, that if the display\npath has a non-zero latency, the time instant specified by\nthis counter may differ from the timestamp's.\n\nIf the output does not have a concept of vertical retrace or a\nrefresh cycle, or the output device is self-refreshing without\na way to query the refresh count, then the arguments seq_hi\nand seq_lo must be zero." ] fn presented ( & mut self , object : * mut wp_presentation_feedback , tv_sec_hi : u32 , tv_sec_lo : u32 , tv_nsec : u32 , refresh : u32 , seq_hi : u32 , seq_lo : u32 , flags : u32 ) { } # [ doc = "the content update was not displayed\n\nThe content update was never displayed to the user." ] fn discarded ( & mut self , object : * mut wp_presentation_feedback , ) { } } pub unsafe fn wp_presentation_feedback_set_user_data ( wp_presentation_feedback : * mut super :: wp_presentation_feedback :: wp_presentation_feedback , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , wp_presentation_feedback as _ , user_data ) ; } pub unsafe fn wp_presentation_feedback_get_user_data ( wp_presentation_feedback : * mut super :: wp_presentation_feedback :: wp_presentation_feedback ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , wp_presentation_feedback as _ ) ; } pub unsafe fn wp_presentation_feedback_get_version ( wp_presentation_feedback : * mut super :: wp_presentation_feedback :: wp_presentation_feedback ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , wp_presentation_feedback as _ ) ; } pub unsafe fn wp_presentation_feedback_add_listener ( wp_presentation_feedback : * mut super :: wp_presentation_feedback :: wp_presentation_feedback , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , wp_presentation_feedback as _ , listener as _ , data as _ ) ; } pub unsafe fn wp_presentation_feedback_add_rust_listener ( wp_presentation_feedback : * mut super :: wp_presentation_feedback :: wp_presentation_feedback , listener : & dyn wp_presentation_feedback_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return wp_presentation_feedback_add_listener ( wp_presentation_feedback as _ , fp as _ , op as _ ) == 0 ; } pub unsafe fn wp_presentation_feedback_destroy ( wp_presentation_feedback : * mut super :: wp_presentation_feedback :: wp_presentation_feedback ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , wp_presentation_feedback as _ ) ; } } } pub mod xdg_shell { use super :: wayland :: * ; # [ doc = "create desktop-style surfaces\n\nThe xdg_wm_base interface is exposed as a global object enabling clients\nto turn their wl_surfaces into windows in a desktop environment. It\ndefines the basic functionality needed for clients and the compositor to\ncreate windows that can be dragged, resized, maximized, etc, as well as\ncreating transient windows such as popup menus." ] pub mod xdg_wm_base { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum xdg_wm_base { } # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum error { # [ doc = "given wl_surface has another role" ] role = 0 , # [ doc = "xdg_wm_base was destroyed before children" ] defunct_surfaces = 1 , # [ doc = "the client tried to map or destroy a non-topmost popup" ] not_the_topmost_popup = 2 , # [ doc = "the client specified an invalid popup parent surface" ] invalid_popup_parent = 3 , # [ doc = "the client provided an invalid surface state" ] invalid_surface_state = 4 , # [ doc = "the client provided an invalid positioner" ] invalid_positioner = 5 , # [ doc ( hidden ) ] __nonexhaustive , } impl error { pub fn from_raw ( n : u32 ) -> Option < error > { match n { 0 => Some ( error :: role ) , 1 => Some ( error :: defunct_surfaces ) , 2 => Some ( error :: not_the_topmost_popup ) , 3 => Some ( error :: invalid_popup_parent ) , 4 => Some ( error :: invalid_surface_state ) , 5 => Some ( error :: invalid_positioner ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } static mut xdg_wm_base_requests_create_positioner_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: xdg_positioner :: xdg_positioner_interface as * const wl_interface } , ] ; static mut xdg_wm_base_requests_get_xdg_surface_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: xdg_surface :: xdg_surface_interface as * const wl_interface } , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut xdg_wm_base_requests : [ wl_message ; 4 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_positioner\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & xdg_wm_base_requests_create_positioner_types as * const _ } , } , wl_message { name : b"get_xdg_surface\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & xdg_wm_base_requests_get_xdg_surface_types as * const _ } , } , wl_message { name : b"pong\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut xdg_wm_base_events : [ wl_message ; 1 ] = [ wl_message { name : b"ping\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut xdg_wm_base_interface : wl_interface = wl_interface { name : b"xdg_wm_base\0" as * const u8 as * const c_char , version : 2 , request_count : 4 , requests : unsafe { & xdg_wm_base_requests as * const _ } , event_count : 1 , events : unsafe { & xdg_wm_base_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait xdg_wm_base_listener { # [ doc = "check if the client is alive\n\nThe ping event asks the client if it's still alive. Pass the\nserial specified in the event back to the compositor by sending\na \"pong\" request back with the specified serial. See xdg_wm_base.pong.\n\nCompositors can use this to determine if the client is still\nalive. It's unspecified what will happen if the client doesn't\nrespond to the ping request, or in what timeframe. Clients should\ntry to respond in a reasonable amount of time.\n\nA compositor is free to ping in any way it wants, but a client must\nalways respond to any xdg_wm_base object it created." ] fn ping ( & mut self , object : * mut xdg_wm_base , serial : u32 ) { } } pub unsafe fn xdg_wm_base_set_user_data ( xdg_wm_base : * mut super :: xdg_wm_base :: xdg_wm_base , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , xdg_wm_base as _ , user_data ) ; } pub unsafe fn xdg_wm_base_get_user_data ( xdg_wm_base : * mut super :: xdg_wm_base :: xdg_wm_base ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , xdg_wm_base as _ ) ; } pub unsafe fn xdg_wm_base_get_version ( xdg_wm_base : * mut super :: xdg_wm_base :: xdg_wm_base ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , xdg_wm_base as _ ) ; } pub unsafe fn xdg_wm_base_add_listener ( xdg_wm_base : * mut super :: xdg_wm_base :: xdg_wm_base , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , xdg_wm_base as _ , listener as _ , data as _ ) ; } pub unsafe fn xdg_wm_base_add_rust_listener ( xdg_wm_base : * mut super :: xdg_wm_base :: xdg_wm_base , listener : & dyn xdg_wm_base_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return xdg_wm_base_add_listener ( xdg_wm_base as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy xdg_wm_base\n\nDestroy this xdg_wm_base object.\n\nDestroying a bound xdg_wm_base object while there are surfaces\nstill alive created by this xdg_wm_base object instance is illegal\nand will result in a protocol error." ] pub unsafe fn xdg_wm_base_destroy ( xdg_wm_base : * mut super :: xdg_wm_base :: xdg_wm_base ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_wm_base as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , xdg_wm_base as _ ) ; } # [ doc = "create a positioner object\n\nCreate a positioner object. A positioner object is used to position\nsurfaces relative to some parent surface. See the interface description\nand xdg_surface.get_popup for details." ] pub unsafe fn xdg_wm_base_create_positioner ( xdg_wm_base : * mut super :: xdg_wm_base :: xdg_wm_base ) -> * mut super :: xdg_positioner :: xdg_positioner { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , xdg_wm_base as _ , 1u32 , & super :: xdg_positioner :: xdg_positioner_interface as * const _ , std :: ptr :: null :: < c_void > ( ) ) ; return r as _ ; } # [ doc = "create a shell surface from a surface\n\nThis creates an xdg_surface for the given surface. While xdg_surface\nitself is not a role, the corresponding surface may only be assigned\na role extending xdg_surface, such as xdg_toplevel or xdg_popup.\n\nThis creates an xdg_surface for the given surface. An xdg_surface is\nused as basis to define a role to a given surface, such as xdg_toplevel\nor xdg_popup. It also manages functionality shared between xdg_surface\nbased surface roles.\n\nSee the documentation of xdg_surface for more details about what an\nxdg_surface is and how it is used." ] pub unsafe fn xdg_wm_base_get_xdg_surface ( xdg_wm_base : * mut super :: xdg_wm_base :: xdg_wm_base , surface : * mut super :: wl_surface :: wl_surface ) -> * mut super :: xdg_surface :: xdg_surface { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , xdg_wm_base as _ , 2u32 , & super :: xdg_surface :: xdg_surface_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , surface ) ; return r as _ ; } # [ doc = "respond to a ping event\n\nA client must respond to a ping event with a pong request or\nthe client may be deemed unresponsive. See xdg_wm_base.ping." ] pub unsafe fn xdg_wm_base_pong ( xdg_wm_base : * mut super :: xdg_wm_base :: xdg_wm_base , serial : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_wm_base as _ , 3u32 , serial , std :: ptr :: null :: < c_void > ( ) ) ; } } # [ doc = "child surface positioner\n\nThe xdg_positioner provides a collection of rules for the placement of a\nchild surface relative to a parent surface. Rules can be defined to ensure\nthe child surface remains within the visible area's borders, and to\nspecify how the child surface changes its position, such as sliding along\nan axis, or flipping around a rectangle. These positioner-created rules are\nconstrained by the requirement that a child surface must intersect with or\nbe at least partially adjacent to its parent surface.\n\nSee the various requests for details about possible rules.\n\nAt the time of the request, the compositor makes a copy of the rules\nspecified by the xdg_positioner. Thus, after the request is complete the\nxdg_positioner object can be destroyed or reused; further changes to the\nobject will have no effect on previous usages.\n\nFor an xdg_positioner object to be considered complete, it must have a\nnon-zero size set by set_size, and a non-zero anchor rectangle set by\nset_anchor_rect. Passing an incomplete xdg_positioner object when\npositioning a surface raises an error." ] pub mod xdg_positioner { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum xdg_positioner { } # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum error { # [ doc = "invalid input provided" ] invalid_input = 0 , # [ doc ( hidden ) ] __nonexhaustive , } impl error { pub fn from_raw ( n : u32 ) -> Option < error > { match n { 0 => Some ( error :: invalid_input ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum anchor { none = 0 , top = 1 , bottom = 2 , left = 3 , right = 4 , top_left = 5 , bottom_left = 6 , top_right = 7 , bottom_right = 8 , # [ doc ( hidden ) ] __nonexhaustive , } impl anchor { pub fn from_raw ( n : u32 ) -> Option < anchor > { match n { 0 => Some ( anchor :: none ) , 1 => Some ( anchor :: top ) , 2 => Some ( anchor :: bottom ) , 3 => Some ( anchor :: left ) , 4 => Some ( anchor :: right ) , 5 => Some ( anchor :: top_left ) , 6 => Some ( anchor :: bottom_left ) , 7 => Some ( anchor :: top_right ) , 8 => Some ( anchor :: bottom_right ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum gravity { none = 0 , top = 1 , bottom = 2 , left = 3 , right = 4 , top_left = 5 , bottom_left = 6 , top_right = 7 , bottom_right = 8 , # [ doc ( hidden ) ] __nonexhaustive , } impl gravity { pub fn from_raw ( n : u32 ) -> Option < gravity > { match n { 0 => Some ( gravity :: none ) , 1 => Some ( gravity :: top ) , 2 => Some ( gravity :: bottom ) , 3 => Some ( gravity :: left ) , 4 => Some ( gravity :: right ) , 5 => Some ( gravity :: top_left ) , 6 => Some ( gravity :: bottom_left ) , 7 => Some ( gravity :: top_right ) , 8 => Some ( gravity :: bottom_right ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } bitflags ! { # [ doc = "constraint adjustments\n\nThe constraint adjustment value define ways the compositor will adjust\nthe position of the surface, if the unadjusted position would result\nin the surface being partly constrained.\n\nWhether a surface is considered 'constrained' is left to the compositor\nto determine. For example, the surface may be partly outside the\ncompositor's defined 'work area', thus necessitating the child surface's\nposition be adjusted until it is entirely inside the work area.\n\nThe adjustments can be combined, according to a defined precedence: 1)\nFlip, 2) Slide, 3) Resize." ] pub struct constraint_adjustment : u32 { # [ doc = "don't move the child surface when constrained\n\nDon't alter the surface position even if it is constrained on some\naxis, for example partially outside the edge of an output." ] const none = 0 ; # [ doc = "move along the x axis until unconstrained\n\nSlide the surface along the x axis until it is no longer constrained.\n\nFirst try to slide towards the direction of the gravity on the x axis\nuntil either the edge in the opposite direction of the gravity is\nunconstrained or the edge in the direction of the gravity is\nconstrained.\n\nThen try to slide towards the opposite direction of the gravity on the\nx axis until either the edge in the direction of the gravity is\nunconstrained or the edge in the opposite direction of the gravity is\nconstrained." ] const slide_x = 1 ; # [ doc = "move along the y axis until unconstrained\n\nSlide the surface along the y axis until it is no longer constrained.\n\nFirst try to slide towards the direction of the gravity on the y axis\nuntil either the edge in the opposite direction of the gravity is\nunconstrained or the edge in the direction of the gravity is\nconstrained.\n\nThen try to slide towards the opposite direction of the gravity on the\ny axis until either the edge in the direction of the gravity is\nunconstrained or the edge in the opposite direction of the gravity is\nconstrained." ] const slide_y = 2 ; # [ doc = "invert the anchor and gravity on the x axis\n\nInvert the anchor and gravity on the x axis if the surface is\nconstrained on the x axis. For example, if the left edge of the\nsurface is constrained, the gravity is 'left' and the anchor is\n'left', change the gravity to 'right' and the anchor to 'right'.\n\nIf the adjusted position also ends up being constrained, the resulting\nposition of the flip_x adjustment will be the one before the\nadjustment." ] const flip_x = 4 ; # [ doc = "invert the anchor and gravity on the y axis\n\nInvert the anchor and gravity on the y axis if the surface is\nconstrained on the y axis. For example, if the bottom edge of the\nsurface is constrained, the gravity is 'bottom' and the anchor is\n'bottom', change the gravity to 'top' and the anchor to 'top'.\n\nThe adjusted position is calculated given the original anchor\nrectangle and offset, but with the new flipped anchor and gravity\nvalues.\n\nIf the adjusted position also ends up being constrained, the resulting\nposition of the flip_y adjustment will be the one before the\nadjustment." ] const flip_y = 8 ; # [ doc = "horizontally resize the surface\n\nResize the surface horizontally so that it is completely\nunconstrained." ] const resize_x = 16 ; # [ doc = "vertically resize the surface\n\nResize the surface vertically so that it is completely unconstrained." ] const resize_y = 32 ; } } impl constraint_adjustment { pub fn from_raw ( n : u32 ) -> Option < constraint_adjustment > { Some ( constraint_adjustment :: from_bits_truncate ( n ) ) } pub fn to_raw ( & self ) -> u32 { self . bits ( ) } } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut xdg_positioner_requests : [ wl_message ; 7 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_size\0" as * const u8 as * const c_char , signature : b"ii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_anchor_rect\0" as * const u8 as * const c_char , signature : b"iiii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_anchor\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_gravity\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_constraint_adjustment\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_offset\0" as * const u8 as * const c_char , signature : b"ii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut xdg_positioner_interface : wl_interface = wl_interface { name : b"xdg_positioner\0" as * const u8 as * const c_char , version : 2 , request_count : 7 , requests : unsafe { & xdg_positioner_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait xdg_positioner_listener { } pub unsafe fn xdg_positioner_set_user_data ( xdg_positioner : * mut super :: xdg_positioner :: xdg_positioner , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , xdg_positioner as _ , user_data ) ; } pub unsafe fn xdg_positioner_get_user_data ( xdg_positioner : * mut super :: xdg_positioner :: xdg_positioner ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , xdg_positioner as _ ) ; } pub unsafe fn xdg_positioner_get_version ( xdg_positioner : * mut super :: xdg_positioner :: xdg_positioner ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , xdg_positioner as _ ) ; } pub unsafe fn xdg_positioner_add_listener ( xdg_positioner : * mut super :: xdg_positioner :: xdg_positioner , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , xdg_positioner as _ , listener as _ , data as _ ) ; } pub unsafe fn xdg_positioner_add_rust_listener ( xdg_positioner : * mut super :: xdg_positioner :: xdg_positioner , listener : & dyn xdg_positioner_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return xdg_positioner_add_listener ( xdg_positioner as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the xdg_positioner object\n\nNotify the compositor that the xdg_positioner will no longer be used." ] pub unsafe fn xdg_positioner_destroy ( xdg_positioner : * mut super :: xdg_positioner :: xdg_positioner ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_positioner as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , xdg_positioner as _ ) ; } # [ doc = "set the size of the to-be positioned rectangle\n\nSet the size of the surface that is to be positioned with the positioner\nobject. The size is in surface-local coordinates and corresponds to the\nwindow geometry. See xdg_surface.set_window_geometry.\n\nIf a zero or negative size is set the invalid_input error is raised." ] pub unsafe fn xdg_positioner_set_size ( xdg_positioner : * mut super :: xdg_positioner :: xdg_positioner , width : i32 , height : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_positioner as _ , 1u32 , width , height , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set the anchor rectangle within the parent surface\n\nSpecify the anchor rectangle within the parent surface that the child\nsurface will be placed relative to. The rectangle is relative to the\nwindow geometry as defined by xdg_surface.set_window_geometry of the\nparent surface.\n\nWhen the xdg_positioner object is used to position a child surface, the\nanchor rectangle may not extend outside the window geometry of the\npositioned child's parent surface.\n\nIf a negative size is set the invalid_input error is raised." ] pub unsafe fn xdg_positioner_set_anchor_rect ( xdg_positioner : * mut super :: xdg_positioner :: xdg_positioner , x : i32 , y : i32 , width : i32 , height : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_positioner as _ , 2u32 , x , y , width , height , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set anchor rectangle anchor\n\nDefines the anchor point for the anchor rectangle. The specified anchor\nis used derive an anchor point that the child surface will be\npositioned relative to. If a corner anchor is set (e.g. 'top_left' or\n'bottom_right'), the anchor point will be at the specified corner;\notherwise, the derived anchor point will be centered on the specified\nedge, or in the center of the anchor rectangle if no edge is specified." ] pub unsafe fn xdg_positioner_set_anchor ( xdg_positioner : * mut super :: xdg_positioner :: xdg_positioner , anchor : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_positioner as _ , 3u32 , anchor , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set child surface gravity\n\nDefines in what direction a surface should be positioned, relative to\nthe anchor point of the parent surface. If a corner gravity is\nspecified (e.g. 'bottom_right' or 'top_left'), then the child surface\nwill be placed towards the specified gravity; otherwise, the child\nsurface will be centered over the anchor point on any axis that had no\ngravity specified." ] pub unsafe fn xdg_positioner_set_gravity ( xdg_positioner : * mut super :: xdg_positioner :: xdg_positioner , gravity : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_positioner as _ , 4u32 , gravity , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set the adjustment to be done when constrained\n\nSpecify how the window should be positioned if the originally intended\nposition caused the surface to be constrained, meaning at least\npartially outside positioning boundaries set by the compositor. The\nadjustment is set by constructing a bitmask describing the adjustment to\nbe made when the surface is constrained on that axis.\n\nIf no bit for one axis is set, the compositor will assume that the child\nsurface should not change its position on that axis when constrained.\n\nIf more than one bit for one axis is set, the order of how adjustments\nare applied is specified in the corresponding adjustment descriptions.\n\nThe default adjustment is none." ] pub unsafe fn xdg_positioner_set_constraint_adjustment ( xdg_positioner : * mut super :: xdg_positioner :: xdg_positioner , constraint_adjustment : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_positioner as _ , 5u32 , constraint_adjustment , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set surface position offset\n\nSpecify the surface position offset relative to the position of the\nanchor on the anchor rectangle and the anchor on the surface. For\nexample if the anchor of the anchor rectangle is at (x, y), the surface\nhas the gravity bottom|right, and the offset is (ox, oy), the calculated\nsurface position will be (x + ox, y + oy). The offset position of the\nsurface is the one used for constraint testing. See\nset_constraint_adjustment.\n\nAn example use case is placing a popup menu on top of a user interface\nelement, while aligning the user interface element of the parent surface\nwith some user interface element placed somewhere in the popup surface." ] pub unsafe fn xdg_positioner_set_offset ( xdg_positioner : * mut super :: xdg_positioner :: xdg_positioner , x : i32 , y : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_positioner as _ , 6u32 , x , y , std :: ptr :: null :: < c_void > ( ) ) ; } } # [ doc = "desktop user interface surface base interface\n\nAn interface that may be implemented by a wl_surface, for\nimplementations that provide a desktop-style user interface.\n\nIt provides a base set of functionality required to construct user\ninterface elements requiring management by the compositor, such as\ntoplevel windows, menus, etc. The types of functionality are split into\nxdg_surface roles.\n\nCreating an xdg_surface does not set the role for a wl_surface. In order\nto map an xdg_surface, the client must create a role-specific object\nusing, e.g., get_toplevel, get_popup. The wl_surface for any given\nxdg_surface can have at most one role, and may not be assigned any role\nnot based on xdg_surface.\n\nA role must be assigned before any other requests are made to the\nxdg_surface object.\n\nThe client must call wl_surface.commit on the corresponding wl_surface\nfor the xdg_surface state to take effect.\n\nCreating an xdg_surface from a wl_surface which has a buffer attached or\ncommitted is a client error, and any attempts by a client to attach or\nmanipulate a buffer prior to the first xdg_surface.configure call must\nalso be treated as errors.\n\nMapping an xdg_surface-based role surface is defined as making it\npossible for the surface to be shown by the compositor. Note that\na mapped surface is not guaranteed to be visible once it is mapped.\n\nFor an xdg_surface to be mapped by the compositor, the following\nconditions must be met:\n(1) the client has assigned an xdg_surface-based role to the surface\n(2) the client has set and committed the xdg_surface state and the\nrole-dependent state to the surface\n(3) the client has committed a buffer to the surface\n\nA newly-unmapped surface is considered to have met condition (1) out\nof the 3 required conditions for mapping a surface if its role surface\nhas not been destroyed." ] pub mod xdg_surface { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum xdg_surface { } # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum error { not_constructed = 1 , already_constructed = 2 , unconfigured_buffer = 3 , # [ doc ( hidden ) ] __nonexhaustive , } impl error { pub fn from_raw ( n : u32 ) -> Option < error > { match n { 1 => Some ( error :: not_constructed ) , 2 => Some ( error :: already_constructed ) , 3 => Some ( error :: unconfigured_buffer ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } static mut xdg_surface_requests_get_toplevel_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: xdg_toplevel :: xdg_toplevel_interface as * const wl_interface } , ] ; static mut xdg_surface_requests_get_popup_types : [ * const wl_interface ; 3 ] = [ unsafe { & super :: xdg_popup :: xdg_popup_interface as * const wl_interface } , unsafe { & super :: xdg_surface :: xdg_surface_interface as * const wl_interface } , unsafe { & super :: xdg_positioner :: xdg_positioner_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut xdg_surface_requests : [ wl_message ; 5 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & xdg_surface_requests_get_toplevel_types as * const _ } , } , wl_message { name : b"get_popup\0" as * const u8 as * const c_char , signature : b"n?oo\0" as * const u8 as * const c_char , types : unsafe { & xdg_surface_requests_get_popup_types as * const _ } , } , wl_message { name : b"set_window_geometry\0" as * const u8 as * const c_char , signature : b"iiii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"ack_configure\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut xdg_surface_events : [ wl_message ; 1 ] = [ wl_message { name : b"configure\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut xdg_surface_interface : wl_interface = wl_interface { name : b"xdg_surface\0" as * const u8 as * const c_char , version : 2 , request_count : 5 , requests : unsafe { & xdg_surface_requests as * const _ } , event_count : 1 , events : unsafe { & xdg_surface_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait xdg_surface_listener { # [ doc = "suggest a surface change\n\nThe configure event marks the end of a configure sequence. A configure\nsequence is a set of one or more events configuring the state of the\nxdg_surface, including the final xdg_surface.configure event.\n\nWhere applicable, xdg_surface surface roles will during a configure\nsequence extend this event as a latched state sent as events before the\nxdg_surface.configure event. Such events should be considered to make up\na set of atomically applied configuration states, where the\nxdg_surface.configure commits the accumulated state.\n\nClients should arrange their surface for the new states, and then send\nan ack_configure request with the serial sent in this configure event at\nsome point before committing the new surface.\n\nIf the client receives multiple configure events before it can respond\nto one, it is free to discard all but the last event it received." ] fn configure ( & mut self , object : * mut xdg_surface , serial : u32 ) { } } pub unsafe fn xdg_surface_set_user_data ( xdg_surface : * mut super :: xdg_surface :: xdg_surface , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , xdg_surface as _ , user_data ) ; } pub unsafe fn xdg_surface_get_user_data ( xdg_surface : * mut super :: xdg_surface :: xdg_surface ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , xdg_surface as _ ) ; } pub unsafe fn xdg_surface_get_version ( xdg_surface : * mut super :: xdg_surface :: xdg_surface ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , xdg_surface as _ ) ; } pub unsafe fn xdg_surface_add_listener ( xdg_surface : * mut super :: xdg_surface :: xdg_surface , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , xdg_surface as _ , listener as _ , data as _ ) ; } pub unsafe fn xdg_surface_add_rust_listener ( xdg_surface : * mut super :: xdg_surface :: xdg_surface , listener : & dyn xdg_surface_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return xdg_surface_add_listener ( xdg_surface as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the xdg_surface\n\nDestroy the xdg_surface object. An xdg_surface must only be destroyed\nafter its role object has been destroyed." ] pub unsafe fn xdg_surface_destroy ( xdg_surface : * mut super :: xdg_surface :: xdg_surface ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_surface as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , xdg_surface as _ ) ; } # [ doc = "assign the xdg_toplevel surface role\n\nThis creates an xdg_toplevel object for the given xdg_surface and gives\nthe associated wl_surface the xdg_toplevel role.\n\nSee the documentation of xdg_toplevel for more details about what an\nxdg_toplevel is and how it is used." ] pub unsafe fn xdg_surface_get_toplevel ( xdg_surface : * mut super :: xdg_surface :: xdg_surface ) -> * mut super :: xdg_toplevel :: xdg_toplevel { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , xdg_surface as _ , 1u32 , & super :: xdg_toplevel :: xdg_toplevel_interface as * const _ , std :: ptr :: null :: < c_void > ( ) ) ; return r as _ ; } # [ doc = "assign the xdg_popup surface role\n\nThis creates an xdg_popup object for the given xdg_surface and gives\nthe associated wl_surface the xdg_popup role.\n\nIf null is passed as a parent, a parent surface must be specified using\nsome other protocol, before committing the initial state.\n\nSee the documentation of xdg_popup for more details about what an\nxdg_popup is and how it is used." ] pub unsafe fn xdg_surface_get_popup ( xdg_surface : * mut super :: xdg_surface :: xdg_surface , parent : * mut super :: xdg_surface :: xdg_surface , positioner : * mut super :: xdg_positioner :: xdg_positioner ) -> * mut super :: xdg_popup :: xdg_popup { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , xdg_surface as _ , 2u32 , & super :: xdg_popup :: xdg_popup_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , parent , positioner ) ; return r as _ ; } # [ doc = "set the new window geometry\n\nThe window geometry of a surface is its \"visible bounds\" from the\nuser's perspective. Client-side decorations often have invisible\nportions like drop-shadows which should be ignored for the\npurposes of aligning, placing and constraining windows.\n\nThe window geometry is double buffered, and will be applied at the\ntime wl_surface.commit of the corresponding wl_surface is called.\n\nWhen maintaining a position, the compositor should treat the (x, y)\ncoordinate of the window geometry as the top left corner of the window.\nA client changing the (x, y) window geometry coordinate should in\ngeneral not alter the position of the window.\n\nOnce the window geometry of the surface is set, it is not possible to\nunset it, and it will remain the same until set_window_geometry is\ncalled again, even if a new subsurface or buffer is attached.\n\nIf never set, the value is the full bounds of the surface,\nincluding any subsurfaces. This updates dynamically on every\ncommit. This unset is meant for extremely simple clients.\n\nThe arguments are given in the surface-local coordinate space of\nthe wl_surface associated with this xdg_surface.\n\nThe width and height must be greater than zero. Setting an invalid size\nwill raise an error. When applied, the effective window geometry will be\nthe set window geometry clamped to the bounding rectangle of the\ncombined geometry of the surface of the xdg_surface and the associated\nsubsurfaces." ] pub unsafe fn xdg_surface_set_window_geometry ( xdg_surface : * mut super :: xdg_surface :: xdg_surface , x : i32 , y : i32 , width : i32 , height : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_surface as _ , 3u32 , x , y , width , height , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "ack a configure event\n\nWhen a configure event is received, if a client commits the\nsurface in response to the configure event, then the client\nmust make an ack_configure request sometime before the commit\nrequest, passing along the serial of the configure event.\n\nFor instance, for toplevel surfaces the compositor might use this\ninformation to move a surface to the top left only when the client has\ndrawn itself for the maximized or fullscreen state.\n\nIf the client receives multiple configure events before it\ncan respond to one, it only has to ack the last configure event.\n\nA client is not required to commit immediately after sending\nan ack_configure request - it may even ack_configure several times\nbefore its next surface commit.\n\nA client may send multiple ack_configure requests before committing, but\nonly the last request sent before a commit indicates which configure\nevent the client really is responding to." ] pub unsafe fn xdg_surface_ack_configure ( xdg_surface : * mut super :: xdg_surface :: xdg_surface , serial : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_surface as _ , 4u32 , serial , std :: ptr :: null :: < c_void > ( ) ) ; } } # [ doc = "toplevel surface\n\nThis interface defines an xdg_surface role which allows a surface to,\namong other things, set window-like properties such as maximize,\nfullscreen, and minimize, set application-specific metadata like title and\nid, and well as trigger user interactive operations such as interactive\nresize and move.\n\nUnmapping an xdg_toplevel means that the surface cannot be shown\nby the compositor until it is explicitly mapped again.\nAll active operations (e.g., move, resize) are canceled and all\nattributes (e.g. title, state, stacking, ...) are discarded for\nan xdg_toplevel surface when it is unmapped.\n\nAttaching a null buffer to a toplevel unmaps the surface." ] pub mod xdg_toplevel { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum xdg_toplevel { } # [ doc = "edge values for resizing\n\nThese values are used to indicate which edge of a surface\nis being dragged in a resize operation." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum resize_edge { none = 0 , top = 1 , bottom = 2 , left = 4 , top_left = 5 , bottom_left = 6 , right = 8 , top_right = 9 , bottom_right = 10 , # [ doc ( hidden ) ] __nonexhaustive , } impl resize_edge { pub fn from_raw ( n : u32 ) -> Option < resize_edge > { match n { 0 => Some ( resize_edge :: none ) , 1 => Some ( resize_edge :: top ) , 2 => Some ( resize_edge :: bottom ) , 4 => Some ( resize_edge :: left ) , 5 => Some ( resize_edge :: top_left ) , 6 => Some ( resize_edge :: bottom_left ) , 8 => Some ( resize_edge :: right ) , 9 => Some ( resize_edge :: top_right ) , 10 => Some ( resize_edge :: bottom_right ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ doc = "types of state on the surface\n\nThe different state values used on the surface. This is designed for\nstate values like maximized, fullscreen. It is paired with the\nconfigure event to ensure that both the client and the compositor\nsetting the state can be synchronized.\n\nStates set in this way are double-buffered. They will get applied on\nthe next commit." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum state { # [ doc = "the surface is maximized\n\nThe surface is maximized. The window geometry specified in the configure\nevent must be obeyed by the client.\n\nThe client should draw without shadow or other\ndecoration outside of the window geometry." ] maximized = 1 , # [ doc = "the surface is fullscreen\n\nThe surface is fullscreen. The window geometry specified in the\nconfigure event is a maximum; the client cannot resize beyond it. For\na surface to cover the whole fullscreened area, the geometry\ndimensions must be obeyed by the client. For more details, see\nxdg_toplevel.set_fullscreen." ] fullscreen = 2 , # [ doc = "the surface is being resized\n\nThe surface is being resized. The window geometry specified in the\nconfigure event is a maximum; the client cannot resize beyond it.\nClients that have aspect ratio or cell sizing configuration can use\na smaller size, however." ] resizing = 3 , # [ doc = "the surface is now activated\n\nClient window decorations should be painted as if the window is\nactive. Do not assume this means that the window actually has\nkeyboard or pointer focus." ] activated = 4 , # [ doc = "the surface is tiled\n\nThe window is currently in a tiled layout and the left edge is\nconsidered to be adjacent to another part of the tiling grid." ] tiled_left = 5 , # [ doc = "the surface is tiled\n\nThe window is currently in a tiled layout and the right edge is\nconsidered to be adjacent to another part of the tiling grid." ] tiled_right = 6 , # [ doc = "the surface is tiled\n\nThe window is currently in a tiled layout and the top edge is\nconsidered to be adjacent to another part of the tiling grid." ] tiled_top = 7 , # [ doc = "the surface is tiled\n\nThe window is currently in a tiled layout and the bottom edge is\nconsidered to be adjacent to another part of the tiling grid." ] tiled_bottom = 8 , # [ doc ( hidden ) ] __nonexhaustive , } impl state { pub fn from_raw ( n : u32 ) -> Option < state > { match n { 1 => Some ( state :: maximized ) , 2 => Some ( state :: fullscreen ) , 3 => Some ( state :: resizing ) , 4 => Some ( state :: activated ) , 5 => Some ( state :: tiled_left ) , 6 => Some ( state :: tiled_right ) , 7 => Some ( state :: tiled_top ) , 8 => Some ( state :: tiled_bottom ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } static mut xdg_toplevel_requests_set_parent_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: xdg_toplevel :: xdg_toplevel_interface as * const wl_interface } , ] ; static mut xdg_toplevel_requests_show_window_menu_types : [ * const wl_interface ; 4 ] = [ unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , ] ; static mut xdg_toplevel_requests_move_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface , ] ; static mut xdg_toplevel_requests_resize_types : [ * const wl_interface ; 3 ] = [ unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , ] ; static mut xdg_toplevel_requests_set_fullscreen_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut xdg_toplevel_requests : [ wl_message ; 14 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_parent\0" as * const u8 as * const c_char , signature : b"?o\0" as * const u8 as * const c_char , types : unsafe { & xdg_toplevel_requests_set_parent_types as * const _ } , } , wl_message { name : b"set_title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"show_window_menu\0" as * const u8 as * const c_char , signature : b"ouii\0" as * const u8 as * const c_char , types : unsafe { & xdg_toplevel_requests_show_window_menu_types as * const _ } , } , wl_message { name : b"move\0" as * const u8 as * const c_char , signature : b"ou\0" as * const u8 as * const c_char , types : unsafe { & xdg_toplevel_requests_move_types as * const _ } , } , wl_message { name : b"resize\0" as * const u8 as * const c_char , signature : b"ouu\0" as * const u8 as * const c_char , types : unsafe { & xdg_toplevel_requests_resize_types as * const _ } , } , wl_message { name : b"set_max_size\0" as * const u8 as * const c_char , signature : b"ii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_min_size\0" as * const u8 as * const c_char , signature : b"ii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"?o\0" as * const u8 as * const c_char , types : unsafe { & xdg_toplevel_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut xdg_toplevel_events : [ wl_message ; 2 ] = [ wl_message { name : b"configure\0" as * const u8 as * const c_char , signature : b"iia\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut xdg_toplevel_interface : wl_interface = wl_interface { name : b"xdg_toplevel\0" as * const u8 as * const c_char , version : 2 , request_count : 14 , requests : unsafe { & xdg_toplevel_requests as * const _ } , event_count : 2 , events : unsafe { & xdg_toplevel_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait xdg_toplevel_listener { # [ doc = "suggest a surface change\n\nThis configure event asks the client to resize its toplevel surface or\nto change its state. The configured state should not be applied\nimmediately. See xdg_surface.configure for details.\n\nThe width and height arguments specify a hint to the window\nabout how its surface should be resized in window geometry\ncoordinates. See set_window_geometry.\n\nIf the width or height arguments are zero, it means the client\nshould decide its own window dimension. This may happen when the\ncompositor needs to configure the state of the surface but doesn't\nhave any information about any previous or expected dimension.\n\nThe states listed in the event specify how the width/height\narguments should be interpreted, and possibly how it should be\ndrawn.\n\nClients must send an ack_configure in response to this event. See\nxdg_surface.configure and xdg_surface.ack_configure for details." ] fn configure ( & mut self , object : * mut xdg_toplevel , width : i32 , height : i32 , states : * mut wl_array ) { } # [ doc = "surface wants to be closed\n\nThe close event is sent by the compositor when the user\nwants the surface to be closed. This should be equivalent to\nthe user clicking the close button in client-side decorations,\nif your application has any.\n\nThis is only a request that the user intends to close the\nwindow. The client may choose to ignore this request, or show\na dialog to ask the user to save their data, etc." ] fn close ( & mut self , object : * mut xdg_toplevel , ) { } } pub unsafe fn xdg_toplevel_set_user_data ( xdg_toplevel : * mut super :: xdg_toplevel :: xdg_toplevel , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , xdg_toplevel as _ , user_data ) ; } pub unsafe fn xdg_toplevel_get_user_data ( xdg_toplevel : * mut super :: xdg_toplevel :: xdg_toplevel ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , xdg_toplevel as _ ) ; } pub unsafe fn xdg_toplevel_get_version ( xdg_toplevel : * mut super :: xdg_toplevel :: xdg_toplevel ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , xdg_toplevel as _ ) ; } pub unsafe fn xdg_toplevel_add_listener ( xdg_toplevel : * mut super :: xdg_toplevel :: xdg_toplevel , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , xdg_toplevel as _ , listener as _ , data as _ ) ; } pub unsafe fn xdg_toplevel_add_rust_listener ( xdg_toplevel : * mut super :: xdg_toplevel :: xdg_toplevel , listener : & dyn xdg_toplevel_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return xdg_toplevel_add_listener ( xdg_toplevel as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the xdg_toplevel\n\nThis request destroys the role surface and unmaps the surface;\nsee \"Unmapping\" behavior in interface section for details." ] pub unsafe fn xdg_toplevel_destroy ( xdg_toplevel : * mut super :: xdg_toplevel :: xdg_toplevel ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_toplevel as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , xdg_toplevel as _ ) ; } # [ doc = "set the parent of this surface\n\nSet the \"parent\" of this surface. This surface should be stacked\nabove the parent surface and all other ancestor surfaces.\n\nParent windows should be set on dialogs, toolboxes, or other\n\"auxiliary\" surfaces, so that the parent is raised when the dialog\nis raised.\n\nSetting a null parent for a child window removes any parent-child\nrelationship for the child. Setting a null parent for a window which\ncurrently has no parent is a no-op.\n\nIf the parent is unmapped then its children are managed as\nthough the parent of the now-unmapped parent has become the\nparent of this surface. If no parent exists for the now-unmapped\nparent then the children are managed as though they have no\nparent surface." ] pub unsafe fn xdg_toplevel_set_parent ( xdg_toplevel : * mut super :: xdg_toplevel :: xdg_toplevel , parent : * mut super :: xdg_toplevel :: xdg_toplevel ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_toplevel as _ , 1u32 , parent , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set surface title\n\nSet a short title for the surface.\n\nThis string may be used to identify the surface in a task bar,\nwindow list, or other user interface elements provided by the\ncompositor.\n\nThe string must be encoded in UTF-8." ] pub unsafe fn xdg_toplevel_set_title ( xdg_toplevel : * mut super :: xdg_toplevel :: xdg_toplevel , title : * mut c_char ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_toplevel as _ , 2u32 , title , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set application ID\n\nSet an application identifier for the surface.\n\nThe app ID identifies the general class of applications to which\nthe surface belongs. The compositor can use this to group multiple\nsurfaces together, or to determine how to launch a new application.\n\nFor D-Bus activatable applications, the app ID is used as the D-Bus\nservice name.\n\nThe compositor shell will try to group application surfaces together\nby their app ID. As a best practice, it is suggested to select app\nID's that match the basename of the application's .desktop file.\nFor example, \"org.freedesktop.FooViewer\" where the .desktop file is\n\"org.freedesktop.FooViewer.desktop\".\n\nLike other properties, a set_app_id request can be sent after the\nxdg_toplevel has been mapped to update the property.\n\nSee the desktop-entry specification [0] for more details on\napplication identifiers and how they relate to well-known D-Bus\nnames and .desktop files.\n\n[0] http://standards.freedesktop.org/desktop-entry-spec/" ] pub unsafe fn xdg_toplevel_set_app_id ( xdg_toplevel : * mut super :: xdg_toplevel :: xdg_toplevel , app_id : * mut c_char ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_toplevel as _ , 3u32 , app_id , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "show the window menu\n\nClients implementing client-side decorations might want to show\na context menu when right-clicking on the decorations, giving the\nuser a menu that they can use to maximize or minimize the window.\n\nThis request asks the compositor to pop up such a window menu at\nthe given position, relative to the local surface coordinates of\nthe parent surface. There are no guarantees as to what menu items\nthe window menu contains.\n\nThis request must be used in response to some sort of user action\nlike a button press, key press, or touch down event." ] pub unsafe fn xdg_toplevel_show_window_menu ( xdg_toplevel : * mut super :: xdg_toplevel :: xdg_toplevel , seat : * mut super :: wl_seat :: wl_seat , serial : u32 , x : i32 , y : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_toplevel as _ , 4u32 , seat , serial , x , y , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "start an interactive move\n\nStart an interactive, user-driven move of the surface.\n\nThis request must be used in response to some sort of user action\nlike a button press, key press, or touch down event. The passed\nserial is used to determine the type of interactive move (touch,\npointer, etc).\n\nThe server may ignore move requests depending on the state of\nthe surface (e.g. fullscreen or maximized), or if the passed serial\nis no longer valid.\n\nIf triggered, the surface will lose the focus of the device\n(wl_pointer, wl_touch, etc) used for the move. It is up to the\ncompositor to visually indicate that the move is taking place, such as\nupdating a pointer cursor, during the move. There is no guarantee\nthat the device focus will return when the move is completed." ] pub unsafe fn xdg_toplevel_move ( xdg_toplevel : * mut super :: xdg_toplevel :: xdg_toplevel , seat : * mut super :: wl_seat :: wl_seat , serial : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_toplevel as _ , 5u32 , seat , serial , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "start an interactive resize\n\nStart a user-driven, interactive resize of the surface.\n\nThis request must be used in response to some sort of user action\nlike a button press, key press, or touch down event. The passed\nserial is used to determine the type of interactive resize (touch,\npointer, etc).\n\nThe server may ignore resize requests depending on the state of\nthe surface (e.g. fullscreen or maximized).\n\nIf triggered, the client will receive configure events with the\n\"resize\" state enum value and the expected sizes. See the \"resize\"\nenum value for more details about what is required. The client\nmust also acknowledge configure events using \"ack_configure\". After\nthe resize is completed, the client will receive another \"configure\"\nevent without the resize state.\n\nIf triggered, the surface also will lose the focus of the device\n(wl_pointer, wl_touch, etc) used for the resize. It is up to the\ncompositor to visually indicate that the resize is taking place,\nsuch as updating a pointer cursor, during the resize. There is no\nguarantee that the device focus will return when the resize is\ncompleted.\n\nThe edges parameter specifies how the surface should be resized,\nand is one of the values of the resize_edge enum. The compositor\nmay use this information to update the surface position for\nexample when dragging the top left corner. The compositor may also\nuse this information to adapt its behavior, e.g. choose an\nappropriate cursor image." ] pub unsafe fn xdg_toplevel_resize ( xdg_toplevel : * mut super :: xdg_toplevel :: xdg_toplevel , seat : * mut super :: wl_seat :: wl_seat , serial : u32 , edges : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_toplevel as _ , 6u32 , seat , serial , edges , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set the maximum size\n\nSet a maximum size for the window.\n\nThe client can specify a maximum size so that the compositor does\nnot try to configure the window beyond this size.\n\nThe width and height arguments are in window geometry coordinates.\nSee xdg_surface.set_window_geometry.\n\nValues set in this way are double-buffered. They will get applied\non the next commit.\n\nThe compositor can use this information to allow or disallow\ndifferent states like maximize or fullscreen and draw accurate\nanimations.\n\nSimilarly, a tiling window manager may use this information to\nplace and resize client windows in a more effective way.\n\nThe client should not rely on the compositor to obey the maximum\nsize. The compositor may decide to ignore the values set by the\nclient and request a larger size.\n\nIf never set, or a value of zero in the request, means that the\nclient has no expected maximum size in the given dimension.\nAs a result, a client wishing to reset the maximum size\nto an unspecified state can use zero for width and height in the\nrequest.\n\nRequesting a maximum size to be smaller than the minimum size of\na surface is illegal and will result in a protocol error.\n\nThe width and height must be greater than or equal to zero. Using\nstrictly negative values for width and height will result in a\nprotocol error." ] pub unsafe fn xdg_toplevel_set_max_size ( xdg_toplevel : * mut super :: xdg_toplevel :: xdg_toplevel , width : i32 , height : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_toplevel as _ , 7u32 , width , height , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set the minimum size\n\nSet a minimum size for the window.\n\nThe client can specify a minimum size so that the compositor does\nnot try to configure the window below this size.\n\nThe width and height arguments are in window geometry coordinates.\nSee xdg_surface.set_window_geometry.\n\nValues set in this way are double-buffered. They will get applied\non the next commit.\n\nThe compositor can use this information to allow or disallow\ndifferent states like maximize or fullscreen and draw accurate\nanimations.\n\nSimilarly, a tiling window manager may use this information to\nplace and resize client windows in a more effective way.\n\nThe client should not rely on the compositor to obey the minimum\nsize. The compositor may decide to ignore the values set by the\nclient and request a smaller size.\n\nIf never set, or a value of zero in the request, means that the\nclient has no expected minimum size in the given dimension.\nAs a result, a client wishing to reset the minimum size\nto an unspecified state can use zero for width and height in the\nrequest.\n\nRequesting a minimum size to be larger than the maximum size of\na surface is illegal and will result in a protocol error.\n\nThe width and height must be greater than or equal to zero. Using\nstrictly negative values for width and height will result in a\nprotocol error." ] pub unsafe fn xdg_toplevel_set_min_size ( xdg_toplevel : * mut super :: xdg_toplevel :: xdg_toplevel , width : i32 , height : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_toplevel as _ , 8u32 , width , height , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "maximize the window\n\nMaximize the surface.\n\nAfter requesting that the surface should be maximized, the compositor\nwill respond by emitting a configure event. Whether this configure\nactually sets the window maximized is subject to compositor policies.\nThe client must then update its content, drawing in the configured\nstate. The client must also acknowledge the configure when committing\nthe new content (see ack_configure).\n\nIt is up to the compositor to decide how and where to maximize the\nsurface, for example which output and what region of the screen should\nbe used.\n\nIf the surface was already maximized, the compositor will still emit\na configure event with the \"maximized\" state.\n\nIf the surface is in a fullscreen state, this request has no direct\neffect. It may alter the state the surface is returned to when\nunmaximized unless overridden by the compositor." ] pub unsafe fn xdg_toplevel_set_maximized ( xdg_toplevel : * mut super :: xdg_toplevel :: xdg_toplevel ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_toplevel as _ , 9u32 , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "unmaximize the window\n\nUnmaximize the surface.\n\nAfter requesting that the surface should be unmaximized, the compositor\nwill respond by emitting a configure event. Whether this actually\nun-maximizes the window is subject to compositor policies.\nIf available and applicable, the compositor will include the window\ngeometry dimensions the window had prior to being maximized in the\nconfigure event. The client must then update its content, drawing it in\nthe configured state. The client must also acknowledge the configure\nwhen committing the new content (see ack_configure).\n\nIt is up to the compositor to position the surface after it was\nunmaximized; usually the position the surface had before maximizing, if\napplicable.\n\nIf the surface was already not maximized, the compositor will still\nemit a configure event without the \"maximized\" state.\n\nIf the surface is in a fullscreen state, this request has no direct\neffect. It may alter the state the surface is returned to when\nunmaximized unless overridden by the compositor." ] pub unsafe fn xdg_toplevel_unset_maximized ( xdg_toplevel : * mut super :: xdg_toplevel :: xdg_toplevel ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_toplevel as _ , 10u32 , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set the window as fullscreen on an output\n\nMake the surface fullscreen.\n\nAfter requesting that the surface should be fullscreened, the\ncompositor will respond by emitting a configure event. Whether the\nclient is actually put into a fullscreen state is subject to compositor\npolicies. The client must also acknowledge the configure when\ncommitting the new content (see ack_configure).\n\nThe output passed by the request indicates the client's preference as\nto which display it should be set fullscreen on. If this value is NULL,\nit's up to the compositor to choose which display will be used to map\nthis surface.\n\nIf the surface doesn't cover the whole output, the compositor will\nposition the surface in the center of the output and compensate with\nwith border fill covering the rest of the output. The content of the\nborder fill is undefined, but should be assumed to be in some way that\nattempts to blend into the surrounding area (e.g. solid black).\n\nIf the fullscreened surface is not opaque, the compositor must make\nsure that other screen content not part of the same surface tree (made\nup of subsurfaces, popups or similarly coupled surfaces) are not\nvisible below the fullscreened surface." ] pub unsafe fn xdg_toplevel_set_fullscreen ( xdg_toplevel : * mut super :: xdg_toplevel :: xdg_toplevel , output : * mut super :: wl_output :: wl_output ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_toplevel as _ , 11u32 , output , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "unset the window as fullscreen\n\nMake the surface no longer fullscreen.\n\nAfter requesting that the surface should be unfullscreened, the\ncompositor will respond by emitting a configure event.\nWhether this actually removes the fullscreen state of the client is\nsubject to compositor policies.\n\nMaking a surface unfullscreen sets states for the surface based on the following:\n* the state(s) it may have had before becoming fullscreen\n* any state(s) decided by the compositor\n* any state(s) requested by the client while the surface was fullscreen\n\nThe compositor may include the previous window geometry dimensions in\nthe configure event, if applicable.\n\nThe client must also acknowledge the configure when committing the new\ncontent (see ack_configure)." ] pub unsafe fn xdg_toplevel_unset_fullscreen ( xdg_toplevel : * mut super :: xdg_toplevel :: xdg_toplevel ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_toplevel as _ , 12u32 , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set the window as minimized\n\nRequest that the compositor minimize your surface. There is no\nway to know if the surface is currently minimized, nor is there\nany way to unset minimization on this surface.\n\nIf you are looking to throttle redrawing when minimized, please\ninstead use the wl_surface.frame event for this, as this will\nalso work with live previews on windows in Alt-Tab, Expose or\nsimilar compositor features." ] pub unsafe fn xdg_toplevel_set_minimized ( xdg_toplevel : * mut super :: xdg_toplevel :: xdg_toplevel ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_toplevel as _ , 13u32 , std :: ptr :: null :: < c_void > ( ) ) ; } } # [ doc = "short-lived, popup surfaces for menus\n\nA popup surface is a short-lived, temporary surface. It can be used to\nimplement for example menus, popovers, tooltips and other similar user\ninterface concepts.\n\nA popup can be made to take an explicit grab. See xdg_popup.grab for\ndetails.\n\nWhen the popup is dismissed, a popup_done event will be sent out, and at\nthe same time the surface will be unmapped. See the xdg_popup.popup_done\nevent for details.\n\nExplicitly destroying the xdg_popup object will also dismiss the popup and\nunmap the surface. Clients that want to dismiss the popup when another\nsurface of their own is clicked should dismiss the popup using the destroy\nrequest.\n\nA newly created xdg_popup will be stacked on top of all previously created\nxdg_popup surfaces associated with the same xdg_toplevel.\n\nThe parent of an xdg_popup must be mapped (see the xdg_surface\ndescription) before the xdg_popup itself.\n\nThe x and y arguments passed when creating the popup object specify\nwhere the top left of the popup should be placed, relative to the\nlocal surface coordinates of the parent surface. See\nxdg_surface.get_popup. An xdg_popup must intersect with or be at least\npartially adjacent to its parent surface.\n\nThe client must call wl_surface.commit on the corresponding wl_surface\nfor the xdg_popup state to take effect." ] pub mod xdg_popup { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum xdg_popup { } # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum error { # [ doc = "tried to grab after being mapped" ] invalid_grab = 0 , # [ doc ( hidden ) ] __nonexhaustive , } impl error { pub fn from_raw ( n : u32 ) -> Option < error > { match n { 0 => Some ( error :: invalid_grab ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } static mut xdg_popup_requests_grab_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut xdg_popup_requests : [ wl_message ; 2 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"grab\0" as * const u8 as * const c_char , signature : b"ou\0" as * const u8 as * const c_char , types : unsafe { & xdg_popup_requests_grab_types as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut xdg_popup_events : [ wl_message ; 2 ] = [ wl_message { name : b"configure\0" as * const u8 as * const c_char , signature : b"iiii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"popup_done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut xdg_popup_interface : wl_interface = wl_interface { name : b"xdg_popup\0" as * const u8 as * const c_char , version : 2 , request_count : 2 , requests : unsafe { & xdg_popup_requests as * const _ } , event_count : 2 , events : unsafe { & xdg_popup_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait xdg_popup_listener { # [ doc = "configure the popup surface\n\nThis event asks the popup surface to configure itself given the\nconfiguration. The configured state should not be applied immediately.\nSee xdg_surface.configure for details.\n\nThe x and y arguments represent the position the popup was placed at\ngiven the xdg_positioner rule, relative to the upper left corner of the\nwindow geometry of the parent surface." ] fn configure ( & mut self , object : * mut xdg_popup , x : i32 , y : i32 , width : i32 , height : i32 ) { } # [ doc = "popup interaction is done\n\nThe popup_done event is sent out when a popup is dismissed by the\ncompositor. The client should destroy the xdg_popup object at this\npoint." ] fn popup_done ( & mut self , object : * mut xdg_popup , ) { } } pub unsafe fn xdg_popup_set_user_data ( xdg_popup : * mut super :: xdg_popup :: xdg_popup , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , xdg_popup as _ , user_data ) ; } pub unsafe fn xdg_popup_get_user_data ( xdg_popup : * mut super :: xdg_popup :: xdg_popup ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , xdg_popup as _ ) ; } pub unsafe fn xdg_popup_get_version ( xdg_popup : * mut super :: xdg_popup :: xdg_popup ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , xdg_popup as _ ) ; } pub unsafe fn xdg_popup_add_listener ( xdg_popup : * mut super :: xdg_popup :: xdg_popup , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , xdg_popup as _ , listener as _ , data as _ ) ; } pub unsafe fn xdg_popup_add_rust_listener ( xdg_popup : * mut super :: xdg_popup :: xdg_popup , listener : & dyn xdg_popup_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return xdg_popup_add_listener ( xdg_popup as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "remove xdg_popup interface\n\nThis destroys the popup. Explicitly destroying the xdg_popup\nobject will also dismiss the popup, and unmap the surface.\n\nIf this xdg_popup is not the \"topmost\" popup, a protocol error\nwill be sent." ] pub unsafe fn xdg_popup_destroy ( xdg_popup : * mut super :: xdg_popup :: xdg_popup ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_popup as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , xdg_popup as _ ) ; } # [ doc = "make the popup take an explicit grab\n\nThis request makes the created popup take an explicit grab. An explicit\ngrab will be dismissed when the user dismisses the popup, or when the\nclient destroys the xdg_popup. This can be done by the user clicking\noutside the surface, using the keyboard, or even locking the screen\nthrough closing the lid or a timeout.\n\nIf the compositor denies the grab, the popup will be immediately\ndismissed.\n\nThis request must be used in response to some sort of user action like a\nbutton press, key press, or touch down event. The serial number of the\nevent should be passed as 'serial'.\n\nThe parent of a grabbing popup must either be an xdg_toplevel surface or\nanother xdg_popup with an explicit grab. If the parent is another\nxdg_popup it means that the popups are nested, with this popup now being\nthe topmost popup.\n\nNested popups must be destroyed in the reverse order they were created\nin, e.g. the only popup you are allowed to destroy at all times is the\ntopmost one.\n\nWhen compositors choose to dismiss a popup, they may dismiss every\nnested grabbing popup as well. When a compositor dismisses popups, it\nwill follow the same dismissing order as required from the client.\n\nThe parent of a grabbing popup must either be another xdg_popup with an\nactive explicit grab, or an xdg_popup or xdg_toplevel, if there are no\nexplicit grabs already taken.\n\nIf the topmost grabbing popup is destroyed, the grab will be returned to\nthe parent of the popup, if that parent previously had an explicit grab.\n\nIf the parent is a grabbing popup which has already been dismissed, this\npopup will be immediately dismissed. If the parent is a popup that did\nnot take an explicit grab, an error will be raised.\n\nDuring a popup grab, the client owning the grab will receive pointer\nand touch events for all their surfaces as normal (similar to an\n\"owner-events\" grab in X11 parlance), while the top most grabbing popup\nwill always have keyboard focus." ] pub unsafe fn xdg_popup_grab ( xdg_popup : * mut super :: xdg_popup :: xdg_popup , seat : * mut super :: wl_seat :: wl_seat , serial : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_popup as _ , 1u32 , seat , serial , std :: ptr :: null :: < c_void > ( ) ) ; } } } pub mod viewporter { use super :: wayland :: * ; use super :: xdg_shell :: * ; # [ doc = "surface cropping and scaling\n\nThe global interface exposing surface cropping and scaling\ncapabilities is used to instantiate an interface extension for a\nwl_surface object. This extended interface will then allow\ncropping and scaling the surface contents, effectively\ndisconnecting the direct relationship between the buffer and the\nsurface size." ] pub mod wp_viewporter { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum wp_viewporter { } # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum error { # [ doc = "the surface already has a viewport object associated" ] viewport_exists = 0 , # [ doc ( hidden ) ] __nonexhaustive , } impl error { pub fn from_raw ( n : u32 ) -> Option < error > { match n { 0 => Some ( error :: viewport_exists ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } static mut wp_viewporter_requests_get_viewport_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: wp_viewport :: wp_viewport_interface as * const wl_interface } , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wp_viewporter_requests : [ wl_message ; 2 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_viewport\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & wp_viewporter_requests_get_viewport_types as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut wp_viewporter_interface : wl_interface = wl_interface { name : b"wp_viewporter\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & wp_viewporter_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait wp_viewporter_listener { } pub unsafe fn wp_viewporter_set_user_data ( wp_viewporter : * mut super :: wp_viewporter :: wp_viewporter , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , wp_viewporter as _ , user_data ) ; } pub unsafe fn wp_viewporter_get_user_data ( wp_viewporter : * mut super :: wp_viewporter :: wp_viewporter ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , wp_viewporter as _ ) ; } pub unsafe fn wp_viewporter_get_version ( wp_viewporter : * mut super :: wp_viewporter :: wp_viewporter ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , wp_viewporter as _ ) ; } pub unsafe fn wp_viewporter_add_listener ( wp_viewporter : * mut super :: wp_viewporter :: wp_viewporter , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , wp_viewporter as _ , listener as _ , data as _ ) ; } pub unsafe fn wp_viewporter_add_rust_listener ( wp_viewporter : * mut super :: wp_viewporter :: wp_viewporter , listener : & dyn wp_viewporter_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return wp_viewporter_add_listener ( wp_viewporter as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "unbind from the cropping and scaling interface\n\nInforms the server that the client will not be using this\nprotocol object anymore. This does not affect any other objects,\nwp_viewport objects included." ] pub unsafe fn wp_viewporter_destroy ( wp_viewporter : * mut super :: wp_viewporter :: wp_viewporter ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wp_viewporter as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , wp_viewporter as _ ) ; } # [ doc = "extend surface interface for crop and scale\n\nInstantiate an interface extension for the given wl_surface to\ncrop and scale its content. If the given wl_surface already has\na wp_viewport object associated, the viewport_exists\nprotocol error is raised." ] pub unsafe fn wp_viewporter_get_viewport ( wp_viewporter : * mut super :: wp_viewporter :: wp_viewporter , surface : * mut super :: wl_surface :: wl_surface ) -> * mut super :: wp_viewport :: wp_viewport { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , wp_viewporter as _ , 1u32 , & super :: wp_viewport :: wp_viewport_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , surface ) ; return r as _ ; } } # [ doc = "crop and scale interface to a wl_surface\n\nAn additional interface to a wl_surface object, which allows the\nclient to specify the cropping and scaling of the surface\ncontents.\n\nThis interface works with two concepts: the source rectangle (src_x,\nsrc_y, src_width, src_height), and the destination size (dst_width,\ndst_height). The contents of the source rectangle are scaled to the\ndestination size, and content outside the source rectangle is ignored.\nThis state is double-buffered, and is applied on the next\nwl_surface.commit.\n\nThe two parts of crop and scale state are independent: the source\nrectangle, and the destination size. Initially both are unset, that\nis, no scaling is applied. The whole of the current wl_buffer is\nused as the source, and the surface size is as defined in\nwl_surface.attach.\n\nIf the destination size is set, it causes the surface size to become\ndst_width, dst_height. The source (rectangle) is scaled to exactly\nthis size. This overrides whatever the attached wl_buffer size is,\nunless the wl_buffer is NULL. If the wl_buffer is NULL, the surface\nhas no content and therefore no size. Otherwise, the size is always\nat least 1x1 in surface local coordinates.\n\nIf the source rectangle is set, it defines what area of the wl_buffer is\ntaken as the source. If the source rectangle is set and the destination\nsize is not set, then src_width and src_height must be integers, and the\nsurface size becomes the source rectangle size. This results in cropping\nwithout scaling. If src_width or src_height are not integers and\ndestination size is not set, the bad_size protocol error is raised when\nthe surface state is applied.\n\nThe coordinate transformations from buffer pixel coordinates up to\nthe surface-local coordinates happen in the following order:\n1. buffer_transform (wl_surface.set_buffer_transform)\n2. buffer_scale (wl_surface.set_buffer_scale)\n3. crop and scale (wp_viewport.set*)\nThis means, that the source rectangle coordinates of crop and scale\nare given in the coordinates after the buffer transform and scale,\ni.e. in the coordinates that would be the surface-local coordinates\nif the crop and scale was not applied.\n\nIf src_x or src_y are negative, the bad_value protocol error is raised.\nOtherwise, if the source rectangle is partially or completely outside of\nthe non-NULL wl_buffer, then the out_of_buffer protocol error is raised\nwhen the surface state is applied. A NULL wl_buffer does not raise the\nout_of_buffer error.\n\nThe x, y arguments of wl_surface.attach are applied as normal to\nthe surface. They indicate how many pixels to remove from the\nsurface size from the left and the top. In other words, they are\nstill in the surface-local coordinate system, just like dst_width\nand dst_height are.\n\nIf the wl_surface associated with the wp_viewport is destroyed,\nall wp_viewport requests except 'destroy' raise the protocol error\nno_surface.\n\nIf the wp_viewport object is destroyed, the crop and scale\nstate is removed from the wl_surface. The change will be applied\non the next wl_surface.commit." ] pub mod wp_viewport { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum wp_viewport { } # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum error { # [ doc = "negative or zero values in width or height" ] bad_value = 0 , # [ doc = "destination size is not integer" ] bad_size = 1 , # [ doc = "source rectangle extends outside of the content area" ] out_of_buffer = 2 , # [ doc = "the wl_surface was destroyed" ] no_surface = 3 , # [ doc ( hidden ) ] __nonexhaustive , } impl error { pub fn from_raw ( n : u32 ) -> Option < error > { match n { 0 => Some ( error :: bad_value ) , 1 => Some ( error :: bad_size ) , 2 => Some ( error :: out_of_buffer ) , 3 => Some ( error :: no_surface ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wp_viewport_requests : [ wl_message ; 3 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_source\0" as * const u8 as * const c_char , signature : b"ffff\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_destination\0" as * const u8 as * const c_char , signature : b"ii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut wp_viewport_interface : wl_interface = wl_interface { name : b"wp_viewport\0" as * const u8 as * const c_char , version : 1 , request_count : 3 , requests : unsafe { & wp_viewport_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait wp_viewport_listener { } pub unsafe fn wp_viewport_set_user_data ( wp_viewport : * mut super :: wp_viewport :: wp_viewport , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , wp_viewport as _ , user_data ) ; } pub unsafe fn wp_viewport_get_user_data ( wp_viewport : * mut super :: wp_viewport :: wp_viewport ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , wp_viewport as _ ) ; } pub unsafe fn wp_viewport_get_version ( wp_viewport : * mut super :: wp_viewport :: wp_viewport ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , wp_viewport as _ ) ; } pub unsafe fn wp_viewport_add_listener ( wp_viewport : * mut super :: wp_viewport :: wp_viewport , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , wp_viewport as _ , listener as _ , data as _ ) ; } pub unsafe fn wp_viewport_add_rust_listener ( wp_viewport : * mut super :: wp_viewport :: wp_viewport , listener : & dyn wp_viewport_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return wp_viewport_add_listener ( wp_viewport as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "remove scaling and cropping from the surface\n\nThe associated wl_surface's crop and scale state is removed.\nThe change is applied on the next wl_surface.commit." ] pub unsafe fn wp_viewport_destroy ( wp_viewport : * mut super :: wp_viewport :: wp_viewport ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wp_viewport as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , wp_viewport as _ ) ; } # [ doc = "set the source rectangle for cropping\n\nSet the source rectangle of the associated wl_surface. See\nwp_viewport for the description, and relation to the wl_buffer\nsize.\n\nIf all of x, y, width and height are -1.0, the source rectangle is\nunset instead. Any other set of values where width or height are zero\nor negative, or x or y are negative, raise the bad_value protocol\nerror.\n\nThe crop and scale state is double-buffered state, and will be\napplied on the next wl_surface.commit." ] pub unsafe fn wp_viewport_set_source ( wp_viewport : * mut super :: wp_viewport :: wp_viewport , x : wl_fixed_t , y : wl_fixed_t , width : wl_fixed_t , height : wl_fixed_t ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wp_viewport as _ , 1u32 , x , y , width , height , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set the surface size for scaling\n\nSet the destination size of the associated wl_surface. See\nwp_viewport for the description, and relation to the wl_buffer\nsize.\n\nIf width is -1 and height is -1, the destination size is unset\ninstead. Any other pair of values for width and height that\ncontains zero or negative values raises the bad_value protocol\nerror.\n\nThe crop and scale state is double-buffered state, and will be\napplied on the next wl_surface.commit." ] pub unsafe fn wp_viewport_set_destination ( wp_viewport : * mut super :: wp_viewport :: wp_viewport , width : i32 , height : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wp_viewport as _ , 2u32 , width , height , std :: ptr :: null :: < c_void > ( ) ) ; } } } pub mod input_timestamps_unstable_v1 { use super :: wayland :: * ; use super :: xdg_shell :: * ; # [ doc = "context object for high-resolution input timestamps\n\nA global interface used for requesting high-resolution timestamps\nfor input events." ] pub mod zwp_input_timestamps_manager_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_input_timestamps_manager_v1 { } static mut zwp_input_timestamps_manager_v1_requests_get_keyboard_timestamps_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: zwp_input_timestamps_v1 :: zwp_input_timestamps_v1_interface as * const wl_interface } , unsafe { & super :: wl_keyboard :: wl_keyboard_interface as * const wl_interface } , ] ; static mut zwp_input_timestamps_manager_v1_requests_get_pointer_timestamps_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: zwp_input_timestamps_v1 :: zwp_input_timestamps_v1_interface as * const wl_interface } , unsafe { & super :: wl_pointer :: wl_pointer_interface as * const wl_interface } , ] ; static mut zwp_input_timestamps_manager_v1_requests_get_touch_timestamps_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: zwp_input_timestamps_v1 :: zwp_input_timestamps_v1_interface as * const wl_interface } , unsafe { & super :: wl_touch :: wl_touch_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_input_timestamps_manager_v1_requests : [ wl_message ; 4 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_keyboard_timestamps\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zwp_input_timestamps_manager_v1_requests_get_keyboard_timestamps_types as * const _ } , } , wl_message { name : b"get_pointer_timestamps\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zwp_input_timestamps_manager_v1_requests_get_pointer_timestamps_types as * const _ } , } , wl_message { name : b"get_touch_timestamps\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zwp_input_timestamps_manager_v1_requests_get_touch_timestamps_types as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_input_timestamps_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_input_timestamps_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_input_timestamps_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_input_timestamps_manager_v1_listener { } pub unsafe fn zwp_input_timestamps_manager_v1_set_user_data ( zwp_input_timestamps_manager_v1 : * mut super :: zwp_input_timestamps_manager_v1 :: zwp_input_timestamps_manager_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_input_timestamps_manager_v1 as _ , user_data ) ; } pub unsafe fn zwp_input_timestamps_manager_v1_get_user_data ( zwp_input_timestamps_manager_v1 : * mut super :: zwp_input_timestamps_manager_v1 :: zwp_input_timestamps_manager_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_input_timestamps_manager_v1 as _ ) ; } pub unsafe fn zwp_input_timestamps_manager_v1_get_version ( zwp_input_timestamps_manager_v1 : * mut super :: zwp_input_timestamps_manager_v1 :: zwp_input_timestamps_manager_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_input_timestamps_manager_v1 as _ ) ; } pub unsafe fn zwp_input_timestamps_manager_v1_add_listener ( zwp_input_timestamps_manager_v1 : * mut super :: zwp_input_timestamps_manager_v1 :: zwp_input_timestamps_manager_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_input_timestamps_manager_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_input_timestamps_manager_v1_add_rust_listener ( zwp_input_timestamps_manager_v1 : * mut super :: zwp_input_timestamps_manager_v1 :: zwp_input_timestamps_manager_v1 , listener : & dyn zwp_input_timestamps_manager_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_input_timestamps_manager_v1_add_listener ( zwp_input_timestamps_manager_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the input timestamps manager object\n\nInforms the server that the client will no longer be using this\nprotocol object. Existing objects created by this object are not\naffected." ] pub unsafe fn zwp_input_timestamps_manager_v1_destroy ( zwp_input_timestamps_manager_v1 : * mut super :: zwp_input_timestamps_manager_v1 :: zwp_input_timestamps_manager_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_input_timestamps_manager_v1 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_input_timestamps_manager_v1 as _ ) ; } # [ doc = "subscribe to high-resolution keyboard timestamp events\n\nCreates a new input timestamps object that represents a subscription\nto high-resolution timestamp events for all wl_keyboard events that\ncarry a timestamp.\n\nIf the associated wl_keyboard object is invalidated, either through\nclient action (e.g. release) or server-side changes, the input\ntimestamps object becomes inert and the client should destroy it\nby calling zwp_input_timestamps_v1.destroy." ] pub unsafe fn zwp_input_timestamps_manager_v1_get_keyboard_timestamps ( zwp_input_timestamps_manager_v1 : * mut super :: zwp_input_timestamps_manager_v1 :: zwp_input_timestamps_manager_v1 , keyboard : * mut super :: wl_keyboard :: wl_keyboard ) -> * mut super :: zwp_input_timestamps_v1 :: zwp_input_timestamps_v1 { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zwp_input_timestamps_manager_v1 as _ , 1u32 , & super :: zwp_input_timestamps_v1 :: zwp_input_timestamps_v1_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , keyboard ) ; return r as _ ; } # [ doc = "subscribe to high-resolution pointer timestamp events\n\nCreates a new input timestamps object that represents a subscription\nto high-resolution timestamp events for all wl_pointer events that\ncarry a timestamp.\n\nIf the associated wl_pointer object is invalidated, either through\nclient action (e.g. release) or server-side changes, the input\ntimestamps object becomes inert and the client should destroy it\nby calling zwp_input_timestamps_v1.destroy." ] pub unsafe fn zwp_input_timestamps_manager_v1_get_pointer_timestamps ( zwp_input_timestamps_manager_v1 : * mut super :: zwp_input_timestamps_manager_v1 :: zwp_input_timestamps_manager_v1 , pointer : * mut super :: wl_pointer :: wl_pointer ) -> * mut super :: zwp_input_timestamps_v1 :: zwp_input_timestamps_v1 { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zwp_input_timestamps_manager_v1 as _ , 2u32 , & super :: zwp_input_timestamps_v1 :: zwp_input_timestamps_v1_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , pointer ) ; return r as _ ; } # [ doc = "subscribe to high-resolution touch timestamp events\n\nCreates a new input timestamps object that represents a subscription\nto high-resolution timestamp events for all wl_touch events that\ncarry a timestamp.\n\nIf the associated wl_touch object becomes invalid, either through\nclient action (e.g. release) or server-side changes, the input\ntimestamps object becomes inert and the client should destroy it\nby calling zwp_input_timestamps_v1.destroy." ] pub unsafe fn zwp_input_timestamps_manager_v1_get_touch_timestamps ( zwp_input_timestamps_manager_v1 : * mut super :: zwp_input_timestamps_manager_v1 :: zwp_input_timestamps_manager_v1 , touch : * mut super :: wl_touch :: wl_touch ) -> * mut super :: zwp_input_timestamps_v1 :: zwp_input_timestamps_v1 { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zwp_input_timestamps_manager_v1 as _ , 3u32 , & super :: zwp_input_timestamps_v1 :: zwp_input_timestamps_v1_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , touch ) ; return r as _ ; } } # [ doc = "context object for input timestamps\n\nProvides high-resolution timestamp events for a set of subscribed input\nevents. The set of subscribed input events is determined by the\nzwp_input_timestamps_manager_v1 request used to create this object." ] pub mod zwp_input_timestamps_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_input_timestamps_v1 { } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_input_timestamps_v1_requests : [ wl_message ; 1 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_input_timestamps_v1_events : [ wl_message ; 1 ] = [ wl_message { name : b"timestamp\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_input_timestamps_v1_interface : wl_interface = wl_interface { name : b"zwp_input_timestamps_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_input_timestamps_v1_requests as * const _ } , event_count : 1 , events : unsafe { & zwp_input_timestamps_v1_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_input_timestamps_v1_listener { # [ doc = "high-resolution timestamp event\n\nThe timestamp event is associated with the first subsequent input event\ncarrying a timestamp which belongs to the set of input events this\nobject is subscribed to.\n\nThe timestamp provided by this event is a high-resolution version of\nthe timestamp argument of the associated input event. The provided\ntimestamp is in the same clock domain and is at least as accurate as\nthe associated input event timestamp.\n\nThe timestamp is expressed as tv_sec_hi, tv_sec_lo, tv_nsec triples,\neach component being an unsigned 32-bit value. Whole seconds are in\ntv_sec which is a 64-bit value combined from tv_sec_hi and tv_sec_lo,\nand the additional fractional part in tv_nsec as nanoseconds. Hence,\nfor valid timestamps tv_nsec must be in [0, 999999999]." ] fn timestamp ( & mut self , object : * mut zwp_input_timestamps_v1 , tv_sec_hi : u32 , tv_sec_lo : u32 , tv_nsec : u32 ) { } } pub unsafe fn zwp_input_timestamps_v1_set_user_data ( zwp_input_timestamps_v1 : * mut super :: zwp_input_timestamps_v1 :: zwp_input_timestamps_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_input_timestamps_v1 as _ , user_data ) ; } pub unsafe fn zwp_input_timestamps_v1_get_user_data ( zwp_input_timestamps_v1 : * mut super :: zwp_input_timestamps_v1 :: zwp_input_timestamps_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_input_timestamps_v1 as _ ) ; } pub unsafe fn zwp_input_timestamps_v1_get_version ( zwp_input_timestamps_v1 : * mut super :: zwp_input_timestamps_v1 :: zwp_input_timestamps_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_input_timestamps_v1 as _ ) ; } pub unsafe fn zwp_input_timestamps_v1_add_listener ( zwp_input_timestamps_v1 : * mut super :: zwp_input_timestamps_v1 :: zwp_input_timestamps_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_input_timestamps_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_input_timestamps_v1_add_rust_listener ( zwp_input_timestamps_v1 : * mut super :: zwp_input_timestamps_v1 :: zwp_input_timestamps_v1 , listener : & dyn zwp_input_timestamps_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_input_timestamps_v1_add_listener ( zwp_input_timestamps_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the input timestamps object\n\nInforms the server that the client will no longer be using this\nprotocol object. After the server processes the request, no more\ntimestamp events will be emitted." ] pub unsafe fn zwp_input_timestamps_v1_destroy ( zwp_input_timestamps_v1 : * mut super :: zwp_input_timestamps_v1 :: zwp_input_timestamps_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_input_timestamps_v1 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_input_timestamps_v1 as _ ) ; } } } pub mod pointer_constraints_unstable_v1 { use super :: wayland :: * ; use super :: xdg_shell :: * ; # [ doc = "constrain the movement of a pointer\n\nThe global interface exposing pointer constraining functionality. It\nexposes two requests: lock_pointer for locking the pointer to its\nposition, and confine_pointer for locking the pointer to a region.\n\nThe lock_pointer and confine_pointer requests create the objects\nwp_locked_pointer and wp_confined_pointer respectively, and the client can\nuse these objects to interact with the lock.\n\nFor any surface, only one lock or confinement may be active across all\nwl_pointer objects of the same seat. If a lock or confinement is requested\nwhen another lock or confinement is active or requested on the same surface\nand with any of the wl_pointer objects of the same seat, an\n'already_constrained' error will be raised." ] pub mod zwp_pointer_constraints_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_pointer_constraints_v1 { } # [ doc = "wp_pointer_constraints error values\n\nThese errors can be emitted in response to wp_pointer_constraints\nrequests." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum error { # [ doc = "pointer constraint already requested on that surface" ] already_constrained = 1 , # [ doc ( hidden ) ] __nonexhaustive , } impl error { pub fn from_raw ( n : u32 ) -> Option < error > { match n { 1 => Some ( error :: already_constrained ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ doc = "constraint lifetime\n\nThese values represent different lifetime semantics. They are passed\nas arguments to the factory requests to specify how the constraint\nlifetimes should be managed." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum lifetime { # [ doc = "the pointer constraint is defunct once deactivated\n\nA oneshot pointer constraint will never reactivate once it has been\ndeactivated. See the corresponding deactivation event\n(wp_locked_pointer.unlocked and wp_confined_pointer.unconfined) for\ndetails." ] oneshot = 1 , # [ doc = "the pointer constraint may reactivate\n\nA persistent pointer constraint may again reactivate once it has\nbeen deactivated. See the corresponding deactivation event\n(wp_locked_pointer.unlocked and wp_confined_pointer.unconfined) for\ndetails." ] persistent = 2 , # [ doc ( hidden ) ] __nonexhaustive , } impl lifetime { pub fn from_raw ( n : u32 ) -> Option < lifetime > { match n { 1 => Some ( lifetime :: oneshot ) , 2 => Some ( lifetime :: persistent ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } static mut zwp_pointer_constraints_v1_requests_lock_pointer_types : [ * const wl_interface ; 5 ] = [ unsafe { & super :: zwp_locked_pointer_v1 :: zwp_locked_pointer_v1_interface as * const wl_interface } , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_pointer :: wl_pointer_interface as * const wl_interface } , unsafe { & super :: wl_region :: wl_region_interface as * const wl_interface } , NULLPTR as * const wl_interface , ] ; static mut zwp_pointer_constraints_v1_requests_confine_pointer_types : [ * const wl_interface ; 5 ] = [ unsafe { & super :: zwp_confined_pointer_v1 :: zwp_confined_pointer_v1_interface as * const wl_interface } , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_pointer :: wl_pointer_interface as * const wl_interface } , unsafe { & super :: wl_region :: wl_region_interface as * const wl_interface } , NULLPTR as * const wl_interface , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_pointer_constraints_v1_requests : [ wl_message ; 3 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"lock_pointer\0" as * const u8 as * const c_char , signature : b"noo?ou\0" as * const u8 as * const c_char , types : unsafe { & zwp_pointer_constraints_v1_requests_lock_pointer_types as * const _ } , } , wl_message { name : b"confine_pointer\0" as * const u8 as * const c_char , signature : b"noo?ou\0" as * const u8 as * const c_char , types : unsafe { & zwp_pointer_constraints_v1_requests_confine_pointer_types as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_pointer_constraints_v1_interface : wl_interface = wl_interface { name : b"zwp_pointer_constraints_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 3 , requests : unsafe { & zwp_pointer_constraints_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_pointer_constraints_v1_listener { } pub unsafe fn zwp_pointer_constraints_v1_set_user_data ( zwp_pointer_constraints_v1 : * mut super :: zwp_pointer_constraints_v1 :: zwp_pointer_constraints_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_pointer_constraints_v1 as _ , user_data ) ; } pub unsafe fn zwp_pointer_constraints_v1_get_user_data ( zwp_pointer_constraints_v1 : * mut super :: zwp_pointer_constraints_v1 :: zwp_pointer_constraints_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_pointer_constraints_v1 as _ ) ; } pub unsafe fn zwp_pointer_constraints_v1_get_version ( zwp_pointer_constraints_v1 : * mut super :: zwp_pointer_constraints_v1 :: zwp_pointer_constraints_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_pointer_constraints_v1 as _ ) ; } pub unsafe fn zwp_pointer_constraints_v1_add_listener ( zwp_pointer_constraints_v1 : * mut super :: zwp_pointer_constraints_v1 :: zwp_pointer_constraints_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_pointer_constraints_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_pointer_constraints_v1_add_rust_listener ( zwp_pointer_constraints_v1 : * mut super :: zwp_pointer_constraints_v1 :: zwp_pointer_constraints_v1 , listener : & dyn zwp_pointer_constraints_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_pointer_constraints_v1_add_listener ( zwp_pointer_constraints_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the pointer constraints manager object\n\nUsed by the client to notify the server that it will no longer use this\npointer constraints object." ] pub unsafe fn zwp_pointer_constraints_v1_destroy ( zwp_pointer_constraints_v1 : * mut super :: zwp_pointer_constraints_v1 :: zwp_pointer_constraints_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_pointer_constraints_v1 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_pointer_constraints_v1 as _ ) ; } # [ doc = "lock pointer to a position\n\nThe lock_pointer request lets the client request to disable movements of\nthe virtual pointer (i.e. the cursor), effectively locking the pointer\nto a position. This request may not take effect immediately; in the\nfuture, when the compositor deems implementation-specific constraints\nare satisfied, the pointer lock will be activated and the compositor\nsends a locked event.\n\nThe protocol provides no guarantee that the constraints are ever\nsatisfied, and does not require the compositor to send an error if the\nconstraints cannot ever be satisfied. It is thus possible to request a\nlock that will never activate.\n\nThere may not be another pointer constraint of any kind requested or\nactive on the surface for any of the wl_pointer objects of the seat of\nthe passed pointer when requesting a lock. If there is, an error will be\nraised. See general pointer lock documentation for more details.\n\nThe intersection of the region passed with this request and the input\nregion of the surface is used to determine where the pointer must be\nin order for the lock to activate. It is up to the compositor whether to\nwarp the pointer or require some kind of user interaction for the lock\nto activate. If the region is null the surface input region is used.\n\nA surface may receive pointer focus without the lock being activated.\n\nThe request creates a new object wp_locked_pointer which is used to\ninteract with the lock as well as receive updates about its state. See\nthe the description of wp_locked_pointer for further information.\n\nNote that while a pointer is locked, the wl_pointer objects of the\ncorresponding seat will not emit any wl_pointer.motion events, but\nrelative motion events will still be emitted via wp_relative_pointer\nobjects of the same seat. wl_pointer.axis and wl_pointer.button events\nare unaffected." ] pub unsafe fn zwp_pointer_constraints_v1_lock_pointer ( zwp_pointer_constraints_v1 : * mut super :: zwp_pointer_constraints_v1 :: zwp_pointer_constraints_v1 , surface : * mut super :: wl_surface :: wl_surface , pointer : * mut super :: wl_pointer :: wl_pointer , region : * mut super :: wl_region :: wl_region , lifetime : u32 ) -> * mut super :: zwp_locked_pointer_v1 :: zwp_locked_pointer_v1 { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zwp_pointer_constraints_v1 as _ , 1u32 , & super :: zwp_locked_pointer_v1 :: zwp_locked_pointer_v1_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , surface , pointer , region , lifetime ) ; return r as _ ; } # [ doc = "confine pointer to a region\n\nThe confine_pointer request lets the client request to confine the\npointer cursor to a given region. This request may not take effect\nimmediately; in the future, when the compositor deems implementation-\nspecific constraints are satisfied, the pointer confinement will be\nactivated and the compositor sends a confined event.\n\nThe intersection of the region passed with this request and the input\nregion of the surface is used to determine where the pointer must be\nin order for the confinement to activate. It is up to the compositor\nwhether to warp the pointer or require some kind of user interaction for\nthe confinement to activate. If the region is null the surface input\nregion is used.\n\nThe request will create a new object wp_confined_pointer which is used\nto interact with the confinement as well as receive updates about its\nstate. See the the description of wp_confined_pointer for further\ninformation." ] pub unsafe fn zwp_pointer_constraints_v1_confine_pointer ( zwp_pointer_constraints_v1 : * mut super :: zwp_pointer_constraints_v1 :: zwp_pointer_constraints_v1 , surface : * mut super :: wl_surface :: wl_surface , pointer : * mut super :: wl_pointer :: wl_pointer , region : * mut super :: wl_region :: wl_region , lifetime : u32 ) -> * mut super :: zwp_confined_pointer_v1 :: zwp_confined_pointer_v1 { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zwp_pointer_constraints_v1 as _ , 2u32 , & super :: zwp_confined_pointer_v1 :: zwp_confined_pointer_v1_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , surface , pointer , region , lifetime ) ; return r as _ ; } } # [ doc = "receive relative pointer motion events\n\nThe wp_locked_pointer interface represents a locked pointer state.\n\nWhile the lock of this object is active, the wl_pointer objects of the\nassociated seat will not emit any wl_pointer.motion events.\n\nThis object will send the event 'locked' when the lock is activated.\nWhenever the lock is activated, it is guaranteed that the locked surface\nwill already have received pointer focus and that the pointer will be\nwithin the region passed to the request creating this object.\n\nTo unlock the pointer, send the destroy request. This will also destroy\nthe wp_locked_pointer object.\n\nIf the compositor decides to unlock the pointer the unlocked event is\nsent. See wp_locked_pointer.unlock for details.\n\nWhen unlocking, the compositor may warp the cursor position to the set\ncursor position hint. If it does, it will not result in any relative\nmotion events emitted via wp_relative_pointer.\n\nIf the surface the lock was requested on is destroyed and the lock is not\nyet activated, the wp_locked_pointer object is now defunct and must be\ndestroyed." ] pub mod zwp_locked_pointer_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_locked_pointer_v1 { } static mut zwp_locked_pointer_v1_requests_set_region_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: wl_region :: wl_region_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_locked_pointer_v1_requests : [ wl_message ; 3 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_cursor_position_hint\0" as * const u8 as * const c_char , signature : b"ff\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_region\0" as * const u8 as * const c_char , signature : b"?o\0" as * const u8 as * const c_char , types : unsafe { & zwp_locked_pointer_v1_requests_set_region_types as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_locked_pointer_v1_events : [ wl_message ; 2 ] = [ wl_message { name : b"locked\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unlocked\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_locked_pointer_v1_interface : wl_interface = wl_interface { name : b"zwp_locked_pointer_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 3 , requests : unsafe { & zwp_locked_pointer_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwp_locked_pointer_v1_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_locked_pointer_v1_listener { # [ doc = "lock activation event\n\nNotification that the pointer lock of the seat's pointer is activated." ] fn locked ( & mut self , object : * mut zwp_locked_pointer_v1 , ) { } # [ doc = "lock deactivation event\n\nNotification that the pointer lock of the seat's pointer is no longer\nactive. If this is a oneshot pointer lock (see\nwp_pointer_constraints.lifetime) this object is now defunct and should\nbe destroyed. If this is a persistent pointer lock (see\nwp_pointer_constraints.lifetime) this pointer lock may again\nreactivate in the future." ] fn unlocked ( & mut self , object : * mut zwp_locked_pointer_v1 , ) { } } pub unsafe fn zwp_locked_pointer_v1_set_user_data ( zwp_locked_pointer_v1 : * mut super :: zwp_locked_pointer_v1 :: zwp_locked_pointer_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_locked_pointer_v1 as _ , user_data ) ; } pub unsafe fn zwp_locked_pointer_v1_get_user_data ( zwp_locked_pointer_v1 : * mut super :: zwp_locked_pointer_v1 :: zwp_locked_pointer_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_locked_pointer_v1 as _ ) ; } pub unsafe fn zwp_locked_pointer_v1_get_version ( zwp_locked_pointer_v1 : * mut super :: zwp_locked_pointer_v1 :: zwp_locked_pointer_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_locked_pointer_v1 as _ ) ; } pub unsafe fn zwp_locked_pointer_v1_add_listener ( zwp_locked_pointer_v1 : * mut super :: zwp_locked_pointer_v1 :: zwp_locked_pointer_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_locked_pointer_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_locked_pointer_v1_add_rust_listener ( zwp_locked_pointer_v1 : * mut super :: zwp_locked_pointer_v1 :: zwp_locked_pointer_v1 , listener : & dyn zwp_locked_pointer_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_locked_pointer_v1_add_listener ( zwp_locked_pointer_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the locked pointer object\n\nDestroy the locked pointer object. If applicable, the compositor will\nunlock the pointer." ] pub unsafe fn zwp_locked_pointer_v1_destroy ( zwp_locked_pointer_v1 : * mut super :: zwp_locked_pointer_v1 :: zwp_locked_pointer_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_locked_pointer_v1 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_locked_pointer_v1 as _ ) ; } # [ doc = "set the pointer cursor position hint\n\nSet the cursor position hint relative to the top left corner of the\nsurface.\n\nIf the client is drawing its own cursor, it should update the position\nhint to the position of its own cursor. A compositor may use this\ninformation to warp the pointer upon unlock in order to avoid pointer\njumps.\n\nThe cursor position hint is double buffered. The new hint will only take\neffect when the associated surface gets it pending state applied. See\nwl_surface.commit for details." ] pub unsafe fn zwp_locked_pointer_v1_set_cursor_position_hint ( zwp_locked_pointer_v1 : * mut super :: zwp_locked_pointer_v1 :: zwp_locked_pointer_v1 , surface_x : wl_fixed_t , surface_y : wl_fixed_t ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_locked_pointer_v1 as _ , 1u32 , surface_x , surface_y , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set a new lock region\n\nSet a new region used to lock the pointer.\n\nThe new lock region is double-buffered. The new lock region will\nonly take effect when the associated surface gets its pending state\napplied. See wl_surface.commit for details.\n\nFor details about the lock region, see wp_locked_pointer." ] pub unsafe fn zwp_locked_pointer_v1_set_region ( zwp_locked_pointer_v1 : * mut super :: zwp_locked_pointer_v1 :: zwp_locked_pointer_v1 , region : * mut super :: wl_region :: wl_region ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_locked_pointer_v1 as _ , 2u32 , region , std :: ptr :: null :: < c_void > ( ) ) ; } } # [ doc = "confined pointer object\n\nThe wp_confined_pointer interface represents a confined pointer state.\n\nThis object will send the event 'confined' when the confinement is\nactivated. Whenever the confinement is activated, it is guaranteed that\nthe surface the pointer is confined to will already have received pointer\nfocus and that the pointer will be within the region passed to the request\ncreating this object. It is up to the compositor to decide whether this\nrequires some user interaction and if the pointer will warp to within the\npassed region if outside.\n\nTo unconfine the pointer, send the destroy request. This will also destroy\nthe wp_confined_pointer object.\n\nIf the compositor decides to unconfine the pointer the unconfined event is\nsent. The wp_confined_pointer object is at this point defunct and should\nbe destroyed." ] pub mod zwp_confined_pointer_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_confined_pointer_v1 { } static mut zwp_confined_pointer_v1_requests_set_region_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: wl_region :: wl_region_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_confined_pointer_v1_requests : [ wl_message ; 2 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_region\0" as * const u8 as * const c_char , signature : b"?o\0" as * const u8 as * const c_char , types : unsafe { & zwp_confined_pointer_v1_requests_set_region_types as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_confined_pointer_v1_events : [ wl_message ; 2 ] = [ wl_message { name : b"confined\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unconfined\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_confined_pointer_v1_interface : wl_interface = wl_interface { name : b"zwp_confined_pointer_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & zwp_confined_pointer_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwp_confined_pointer_v1_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_confined_pointer_v1_listener { # [ doc = "pointer confined\n\nNotification that the pointer confinement of the seat's pointer is\nactivated." ] fn confined ( & mut self , object : * mut zwp_confined_pointer_v1 , ) { } # [ doc = "pointer unconfined\n\nNotification that the pointer confinement of the seat's pointer is no\nlonger active. If this is a oneshot pointer confinement (see\nwp_pointer_constraints.lifetime) this object is now defunct and should\nbe destroyed. If this is a persistent pointer confinement (see\nwp_pointer_constraints.lifetime) this pointer confinement may again\nreactivate in the future." ] fn unconfined ( & mut self , object : * mut zwp_confined_pointer_v1 , ) { } } pub unsafe fn zwp_confined_pointer_v1_set_user_data ( zwp_confined_pointer_v1 : * mut super :: zwp_confined_pointer_v1 :: zwp_confined_pointer_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_confined_pointer_v1 as _ , user_data ) ; } pub unsafe fn zwp_confined_pointer_v1_get_user_data ( zwp_confined_pointer_v1 : * mut super :: zwp_confined_pointer_v1 :: zwp_confined_pointer_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_confined_pointer_v1 as _ ) ; } pub unsafe fn zwp_confined_pointer_v1_get_version ( zwp_confined_pointer_v1 : * mut super :: zwp_confined_pointer_v1 :: zwp_confined_pointer_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_confined_pointer_v1 as _ ) ; } pub unsafe fn zwp_confined_pointer_v1_add_listener ( zwp_confined_pointer_v1 : * mut super :: zwp_confined_pointer_v1 :: zwp_confined_pointer_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_confined_pointer_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_confined_pointer_v1_add_rust_listener ( zwp_confined_pointer_v1 : * mut super :: zwp_confined_pointer_v1 :: zwp_confined_pointer_v1 , listener : & dyn zwp_confined_pointer_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_confined_pointer_v1_add_listener ( zwp_confined_pointer_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the confined pointer object\n\nDestroy the confined pointer object. If applicable, the compositor will\nunconfine the pointer." ] pub unsafe fn zwp_confined_pointer_v1_destroy ( zwp_confined_pointer_v1 : * mut super :: zwp_confined_pointer_v1 :: zwp_confined_pointer_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_confined_pointer_v1 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_confined_pointer_v1 as _ ) ; } # [ doc = "set a new confine region\n\nSet a new region used to confine the pointer.\n\nThe new confine region is double-buffered. The new confine region will\nonly take effect when the associated surface gets its pending state\napplied. See wl_surface.commit for details.\n\nIf the confinement is active when the new confinement region is applied\nand the pointer ends up outside of newly applied region, the pointer may\nwarped to a position within the new confinement region. If warped, a\nwl_pointer.motion event will be emitted, but no\nwp_relative_pointer.relative_motion event.\n\nThe compositor may also, instead of using the new region, unconfine the\npointer.\n\nFor details about the confine region, see wp_confined_pointer." ] pub unsafe fn zwp_confined_pointer_v1_set_region ( zwp_confined_pointer_v1 : * mut super :: zwp_confined_pointer_v1 :: zwp_confined_pointer_v1 , region : * mut super :: wl_region :: wl_region ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_confined_pointer_v1 as _ , 1u32 , region , std :: ptr :: null :: < c_void > ( ) ) ; } } } pub mod xwayland_keyboard_grab_unstable_v1 { use super :: wayland :: * ; use super :: xdg_shell :: * ; # [ doc = "context object for keyboard grab manager\n\nA global interface used for grabbing the keyboard." ] pub mod zwp_xwayland_keyboard_grab_manager_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_xwayland_keyboard_grab_manager_v1 { } static mut zwp_xwayland_keyboard_grab_manager_v1_requests_grab_keyboard_types : [ * const wl_interface ; 3 ] = [ unsafe { & super :: zwp_xwayland_keyboard_grab_v1 :: zwp_xwayland_keyboard_grab_v1_interface as * const wl_interface } , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_xwayland_keyboard_grab_manager_v1_requests : [ wl_message ; 2 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"grab_keyboard\0" as * const u8 as * const c_char , signature : b"noo\0" as * const u8 as * const c_char , types : unsafe { & zwp_xwayland_keyboard_grab_manager_v1_requests_grab_keyboard_types as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_xwayland_keyboard_grab_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_xwayland_keyboard_grab_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & zwp_xwayland_keyboard_grab_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_xwayland_keyboard_grab_manager_v1_listener { } pub unsafe fn zwp_xwayland_keyboard_grab_manager_v1_set_user_data ( zwp_xwayland_keyboard_grab_manager_v1 : * mut super :: zwp_xwayland_keyboard_grab_manager_v1 :: zwp_xwayland_keyboard_grab_manager_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_xwayland_keyboard_grab_manager_v1 as _ , user_data ) ; } pub unsafe fn zwp_xwayland_keyboard_grab_manager_v1_get_user_data ( zwp_xwayland_keyboard_grab_manager_v1 : * mut super :: zwp_xwayland_keyboard_grab_manager_v1 :: zwp_xwayland_keyboard_grab_manager_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_xwayland_keyboard_grab_manager_v1 as _ ) ; } pub unsafe fn zwp_xwayland_keyboard_grab_manager_v1_get_version ( zwp_xwayland_keyboard_grab_manager_v1 : * mut super :: zwp_xwayland_keyboard_grab_manager_v1 :: zwp_xwayland_keyboard_grab_manager_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_xwayland_keyboard_grab_manager_v1 as _ ) ; } pub unsafe fn zwp_xwayland_keyboard_grab_manager_v1_add_listener ( zwp_xwayland_keyboard_grab_manager_v1 : * mut super :: zwp_xwayland_keyboard_grab_manager_v1 :: zwp_xwayland_keyboard_grab_manager_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_xwayland_keyboard_grab_manager_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_xwayland_keyboard_grab_manager_v1_add_rust_listener ( zwp_xwayland_keyboard_grab_manager_v1 : * mut super :: zwp_xwayland_keyboard_grab_manager_v1 :: zwp_xwayland_keyboard_grab_manager_v1 , listener : & dyn zwp_xwayland_keyboard_grab_manager_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_xwayland_keyboard_grab_manager_v1_add_listener ( zwp_xwayland_keyboard_grab_manager_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the keyboard grab manager\n\nDestroy the keyboard grab manager." ] pub unsafe fn zwp_xwayland_keyboard_grab_manager_v1_destroy ( zwp_xwayland_keyboard_grab_manager_v1 : * mut super :: zwp_xwayland_keyboard_grab_manager_v1 :: zwp_xwayland_keyboard_grab_manager_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_xwayland_keyboard_grab_manager_v1 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_xwayland_keyboard_grab_manager_v1 as _ ) ; } # [ doc = "grab the keyboard to a surface\n\nThe grab_keyboard request asks for a grab of the keyboard, forcing\nthe keyboard focus for the given seat upon the given surface.\n\nThe protocol provides no guarantee that the grab is ever satisfied,\nand does not require the compositor to send an error if the grab\ncannot ever be satisfied. It is thus possible to request a keyboard\ngrab that will never be effective.\n\nThe protocol:\n\n* does not guarantee that the grab itself is applied for a surface,\nthe grab request may be silently ignored by the compositor,\n* does not guarantee that any events are sent to this client even\nif the grab is applied to a surface,\n* does not guarantee that events sent to this client are exhaustive,\na compositor may filter some events for its own consumption,\n* does not guarantee that events sent to this client are continuous,\na compositor may change and reroute keyboard events while the grab\nis nominally active." ] pub unsafe fn zwp_xwayland_keyboard_grab_manager_v1_grab_keyboard ( zwp_xwayland_keyboard_grab_manager_v1 : * mut super :: zwp_xwayland_keyboard_grab_manager_v1 :: zwp_xwayland_keyboard_grab_manager_v1 , surface : * mut super :: wl_surface :: wl_surface , seat : * mut super :: wl_seat :: wl_seat ) -> * mut super :: zwp_xwayland_keyboard_grab_v1 :: zwp_xwayland_keyboard_grab_v1 { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zwp_xwayland_keyboard_grab_manager_v1 as _ , 1u32 , & super :: zwp_xwayland_keyboard_grab_v1 :: zwp_xwayland_keyboard_grab_v1_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , surface , seat ) ; return r as _ ; } } # [ doc = "interface for grabbing the keyboard\n\nA global interface used for grabbing the keyboard." ] pub mod zwp_xwayland_keyboard_grab_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_xwayland_keyboard_grab_v1 { } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_xwayland_keyboard_grab_v1_requests : [ wl_message ; 1 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_xwayland_keyboard_grab_v1_interface : wl_interface = wl_interface { name : b"zwp_xwayland_keyboard_grab_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_xwayland_keyboard_grab_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_xwayland_keyboard_grab_v1_listener { } pub unsafe fn zwp_xwayland_keyboard_grab_v1_set_user_data ( zwp_xwayland_keyboard_grab_v1 : * mut super :: zwp_xwayland_keyboard_grab_v1 :: zwp_xwayland_keyboard_grab_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_xwayland_keyboard_grab_v1 as _ , user_data ) ; } pub unsafe fn zwp_xwayland_keyboard_grab_v1_get_user_data ( zwp_xwayland_keyboard_grab_v1 : * mut super :: zwp_xwayland_keyboard_grab_v1 :: zwp_xwayland_keyboard_grab_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_xwayland_keyboard_grab_v1 as _ ) ; } pub unsafe fn zwp_xwayland_keyboard_grab_v1_get_version ( zwp_xwayland_keyboard_grab_v1 : * mut super :: zwp_xwayland_keyboard_grab_v1 :: zwp_xwayland_keyboard_grab_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_xwayland_keyboard_grab_v1 as _ ) ; } pub unsafe fn zwp_xwayland_keyboard_grab_v1_add_listener ( zwp_xwayland_keyboard_grab_v1 : * mut super :: zwp_xwayland_keyboard_grab_v1 :: zwp_xwayland_keyboard_grab_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_xwayland_keyboard_grab_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_xwayland_keyboard_grab_v1_add_rust_listener ( zwp_xwayland_keyboard_grab_v1 : * mut super :: zwp_xwayland_keyboard_grab_v1 :: zwp_xwayland_keyboard_grab_v1 , listener : & dyn zwp_xwayland_keyboard_grab_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_xwayland_keyboard_grab_v1_add_listener ( zwp_xwayland_keyboard_grab_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the grabbed keyboard object\n\nDestroy the grabbed keyboard object. If applicable, the compositor\nwill ungrab the keyboard." ] pub unsafe fn zwp_xwayland_keyboard_grab_v1_destroy ( zwp_xwayland_keyboard_grab_v1 : * mut super :: zwp_xwayland_keyboard_grab_v1 :: zwp_xwayland_keyboard_grab_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_xwayland_keyboard_grab_v1 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_xwayland_keyboard_grab_v1 as _ ) ; } } } pub mod tablet_unstable_v2 { use super :: wayland :: * ; use super :: xdg_shell :: * ; # [ doc = "controller object for graphic tablet devices\n\nAn object that provides access to the graphics tablets available on this\nsystem. All tablets are associated with a seat, to get access to the\nactual tablets, use wp_tablet_manager.get_tablet_seat." ] pub mod zwp_tablet_manager_v2 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_tablet_manager_v2 { } static mut zwp_tablet_manager_v2_requests_get_tablet_seat_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: zwp_tablet_seat_v2 :: zwp_tablet_seat_v2_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_tablet_manager_v2_requests : [ wl_message ; 2 ] = [ wl_message { name : b"get_tablet_seat\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zwp_tablet_manager_v2_requests_get_tablet_seat_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_tablet_manager_v2_interface : wl_interface = wl_interface { name : b"zwp_tablet_manager_v2\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & zwp_tablet_manager_v2_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_tablet_manager_v2_listener { } pub unsafe fn zwp_tablet_manager_v2_set_user_data ( zwp_tablet_manager_v2 : * mut super :: zwp_tablet_manager_v2 :: zwp_tablet_manager_v2 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_tablet_manager_v2 as _ , user_data ) ; } pub unsafe fn zwp_tablet_manager_v2_get_user_data ( zwp_tablet_manager_v2 : * mut super :: zwp_tablet_manager_v2 :: zwp_tablet_manager_v2 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_tablet_manager_v2 as _ ) ; } pub unsafe fn zwp_tablet_manager_v2_get_version ( zwp_tablet_manager_v2 : * mut super :: zwp_tablet_manager_v2 :: zwp_tablet_manager_v2 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_tablet_manager_v2 as _ ) ; } pub unsafe fn zwp_tablet_manager_v2_add_listener ( zwp_tablet_manager_v2 : * mut super :: zwp_tablet_manager_v2 :: zwp_tablet_manager_v2 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_tablet_manager_v2 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_tablet_manager_v2_add_rust_listener ( zwp_tablet_manager_v2 : * mut super :: zwp_tablet_manager_v2 :: zwp_tablet_manager_v2 , listener : & dyn zwp_tablet_manager_v2_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_tablet_manager_v2_add_listener ( zwp_tablet_manager_v2 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "get the tablet seat\n\nGet the wp_tablet_seat object for the given seat. This object\nprovides access to all graphics tablets in this seat." ] pub unsafe fn zwp_tablet_manager_v2_get_tablet_seat ( zwp_tablet_manager_v2 : * mut super :: zwp_tablet_manager_v2 :: zwp_tablet_manager_v2 , seat : * mut super :: wl_seat :: wl_seat ) -> * mut super :: zwp_tablet_seat_v2 :: zwp_tablet_seat_v2 { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zwp_tablet_manager_v2 as _ , 0u32 , & super :: zwp_tablet_seat_v2 :: zwp_tablet_seat_v2_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , seat ) ; return r as _ ; } # [ doc = "release the memory for the tablet manager object\n\nDestroy the wp_tablet_manager object. Objects created from this\nobject are unaffected and should be destroyed separately." ] pub unsafe fn zwp_tablet_manager_v2_destroy ( zwp_tablet_manager_v2 : * mut super :: zwp_tablet_manager_v2 :: zwp_tablet_manager_v2 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_tablet_manager_v2 as _ , 1u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_tablet_manager_v2 as _ ) ; } } # [ doc = "controller object for graphic tablet devices of a seat\n\nAn object that provides access to the graphics tablets available on this\nseat. After binding to this interface, the compositor sends a set of\nwp_tablet_seat.tablet_added and wp_tablet_seat.tool_added events." ] pub mod zwp_tablet_seat_v2 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_tablet_seat_v2 { } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_tablet_seat_v2_requests : [ wl_message ; 1 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; static mut zwp_tablet_seat_v2_events_tablet_added_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: zwp_tablet_v2 :: zwp_tablet_v2_interface as * const wl_interface } , ] ; static mut zwp_tablet_seat_v2_events_tool_added_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: zwp_tablet_tool_v2 :: zwp_tablet_tool_v2_interface as * const wl_interface } , ] ; static mut zwp_tablet_seat_v2_events_pad_added_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: zwp_tablet_pad_v2 :: zwp_tablet_pad_v2_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_tablet_seat_v2_events : [ wl_message ; 3 ] = [ wl_message { name : b"tablet_added\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwp_tablet_seat_v2_events_tablet_added_types as * const _ } , } , wl_message { name : b"tool_added\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwp_tablet_seat_v2_events_tool_added_types as * const _ } , } , wl_message { name : b"pad_added\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwp_tablet_seat_v2_events_pad_added_types as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_tablet_seat_v2_interface : wl_interface = wl_interface { name : b"zwp_tablet_seat_v2\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_tablet_seat_v2_requests as * const _ } , event_count : 3 , events : unsafe { & zwp_tablet_seat_v2_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_tablet_seat_v2_listener { # [ doc = "new device notification\n\nThis event is sent whenever a new tablet becomes available on this\nseat. This event only provides the object id of the tablet, any\nstatic information about the tablet (device name, vid/pid, etc.) is\nsent through the wp_tablet interface." ] fn tablet_added ( & mut self , object : * mut zwp_tablet_seat_v2 , id : * mut super :: zwp_tablet_v2 :: zwp_tablet_v2 ) { } # [ doc = "a new tool has been used with a tablet\n\nThis event is sent whenever a tool that has not previously been used\nwith a tablet comes into use. This event only provides the object id\nof the tool; any static information about the tool (capabilities,\ntype, etc.) is sent through the wp_tablet_tool interface." ] fn tool_added ( & mut self , object : * mut zwp_tablet_seat_v2 , id : * mut super :: zwp_tablet_tool_v2 :: zwp_tablet_tool_v2 ) { } # [ doc = "new pad notification\n\nThis event is sent whenever a new pad is known to the system. Typically,\npads are physically attached to tablets and a pad_added event is\nsent immediately after the wp_tablet_seat.tablet_added.\nHowever, some standalone pad devices logically attach to tablets at\nruntime, and the client must wait for wp_tablet_pad.enter to know\nthe tablet a pad is attached to.\n\nThis event only provides the object id of the pad. All further\nfeatures (buttons, strips, rings) are sent through the wp_tablet_pad\ninterface." ] fn pad_added ( & mut self , object : * mut zwp_tablet_seat_v2 , id : * mut super :: zwp_tablet_pad_v2 :: zwp_tablet_pad_v2 ) { } } pub unsafe fn zwp_tablet_seat_v2_set_user_data ( zwp_tablet_seat_v2 : * mut super :: zwp_tablet_seat_v2 :: zwp_tablet_seat_v2 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_tablet_seat_v2 as _ , user_data ) ; } pub unsafe fn zwp_tablet_seat_v2_get_user_data ( zwp_tablet_seat_v2 : * mut super :: zwp_tablet_seat_v2 :: zwp_tablet_seat_v2 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_tablet_seat_v2 as _ ) ; } pub unsafe fn zwp_tablet_seat_v2_get_version ( zwp_tablet_seat_v2 : * mut super :: zwp_tablet_seat_v2 :: zwp_tablet_seat_v2 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_tablet_seat_v2 as _ ) ; } pub unsafe fn zwp_tablet_seat_v2_add_listener ( zwp_tablet_seat_v2 : * mut super :: zwp_tablet_seat_v2 :: zwp_tablet_seat_v2 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_tablet_seat_v2 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_tablet_seat_v2_add_rust_listener ( zwp_tablet_seat_v2 : * mut super :: zwp_tablet_seat_v2 :: zwp_tablet_seat_v2 , listener : & dyn zwp_tablet_seat_v2_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_tablet_seat_v2_add_listener ( zwp_tablet_seat_v2 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "release the memory for the tablet seat object\n\nDestroy the wp_tablet_seat object. Objects created from this\nobject are unaffected and should be destroyed separately." ] pub unsafe fn zwp_tablet_seat_v2_destroy ( zwp_tablet_seat_v2 : * mut super :: zwp_tablet_seat_v2 :: zwp_tablet_seat_v2 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_tablet_seat_v2 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_tablet_seat_v2 as _ ) ; } } # [ doc = "a physical tablet tool\n\nAn object that represents a physical tool that has been, or is\ncurrently in use with a tablet in this seat. Each wp_tablet_tool\nobject stays valid until the client destroys it; the compositor\nreuses the wp_tablet_tool object to indicate that the object's\nrespective physical tool has come into proximity of a tablet again.\n\nA wp_tablet_tool object's relation to a physical tool depends on the\ntablet's ability to report serial numbers. If the tablet supports\nthis capability, then the object represents a specific physical tool\nand can be identified even when used on multiple tablets.\n\nA tablet tool has a number of static characteristics, e.g. tool type,\nhardware_serial and capabilities. These capabilities are sent in an\nevent sequence after the wp_tablet_seat.tool_added event before any\nactual events from this tool. This initial event sequence is\nterminated by a wp_tablet_tool.done event.\n\nTablet tool events are grouped by wp_tablet_tool.frame events.\nAny events received before a wp_tablet_tool.frame event should be\nconsidered part of the same hardware state change." ] pub mod zwp_tablet_tool_v2 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_tablet_tool_v2 { } # [ doc = "a physical tool type\n\nDescribes the physical type of a tool. The physical type of a tool\ngenerally defines its base usage.\n\nThe mouse tool represents a mouse-shaped tool that is not a relative\ndevice but bound to the tablet's surface, providing absolute\ncoordinates.\n\nThe lens tool is a mouse-shaped tool with an attached lens to\nprovide precision focus." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum _type { # [ doc = "Pen" ] pen = 320 , # [ doc = "Eraser" ] eraser = 321 , # [ doc = "Brush" ] brush = 322 , # [ doc = "Pencil" ] pencil = 323 , # [ doc = "Airbrush" ] airbrush = 324 , # [ doc = "Finger" ] finger = 325 , # [ doc = "Mouse" ] mouse = 326 , # [ doc = "Lens" ] lens = 327 , # [ doc ( hidden ) ] __nonexhaustive , } impl _type { pub fn from_raw ( n : u32 ) -> Option < _type > { match n { 320 => Some ( _type :: pen ) , 321 => Some ( _type :: eraser ) , 322 => Some ( _type :: brush ) , 323 => Some ( _type :: pencil ) , 324 => Some ( _type :: airbrush ) , 325 => Some ( _type :: finger ) , 326 => Some ( _type :: mouse ) , 327 => Some ( _type :: lens ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ doc = "capability flags for a tool\n\nDescribes extra capabilities on a tablet.\n\nAny tool must provide x and y values, extra axes are\ndevice-specific." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum capability { # [ doc = "Tilt axes" ] tilt = 1 , # [ doc = "Pressure axis" ] pressure = 2 , # [ doc = "Distance axis" ] distance = 3 , # [ doc = "Z-rotation axis" ] rotation = 4 , # [ doc = "Slider axis" ] slider = 5 , # [ doc = "Wheel axis" ] wheel = 6 , # [ doc ( hidden ) ] __nonexhaustive , } impl capability { pub fn from_raw ( n : u32 ) -> Option < capability > { match n { 1 => Some ( capability :: tilt ) , 2 => Some ( capability :: pressure ) , 3 => Some ( capability :: distance ) , 4 => Some ( capability :: rotation ) , 5 => Some ( capability :: slider ) , 6 => Some ( capability :: wheel ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ doc = "physical button state\n\nDescribes the physical state of a button that produced the button event." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum button_state { # [ doc = "button is not pressed" ] released = 0 , # [ doc = "button is pressed" ] pressed = 1 , # [ doc ( hidden ) ] __nonexhaustive , } impl button_state { pub fn from_raw ( n : u32 ) -> Option < button_state > { match n { 0 => Some ( button_state :: released ) , 1 => Some ( button_state :: pressed ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum error { # [ doc = "given wl_surface has another role" ] role = 0 , # [ doc ( hidden ) ] __nonexhaustive , } impl error { pub fn from_raw ( n : u32 ) -> Option < error > { match n { 0 => Some ( error :: role ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } static mut zwp_tablet_tool_v2_requests_set_cursor_types : [ * const wl_interface ; 4 ] = [ NULLPTR as * const wl_interface , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_tablet_tool_v2_requests : [ wl_message ; 2 ] = [ wl_message { name : b"set_cursor\0" as * const u8 as * const c_char , signature : b"u?oii\0" as * const u8 as * const c_char , types : unsafe { & zwp_tablet_tool_v2_requests_set_cursor_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; static mut zwp_tablet_tool_v2_events_proximity_in_types : [ * const wl_interface ; 3 ] = [ NULLPTR as * const wl_interface , unsafe { & super :: zwp_tablet_v2 :: zwp_tablet_v2_interface as * const wl_interface } , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_tablet_tool_v2_events : [ wl_message ; 19 ] = [ wl_message { name : b"type\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"hardware_serial\0" as * const u8 as * const c_char , signature : b"uu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"hardware_id_wacom\0" as * const u8 as * const c_char , signature : b"uu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"capability\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"removed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"proximity_in\0" as * const u8 as * const c_char , signature : b"uoo\0" as * const u8 as * const c_char , types : unsafe { & zwp_tablet_tool_v2_events_proximity_in_types as * const _ } , } , wl_message { name : b"proximity_out\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"down\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"up\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"motion\0" as * const u8 as * const c_char , signature : b"ff\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"pressure\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"distance\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"tilt\0" as * const u8 as * const c_char , signature : b"ff\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"rotation\0" as * const u8 as * const c_char , signature : b"f\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"slider\0" as * const u8 as * const c_char , signature : b"i\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"wheel\0" as * const u8 as * const c_char , signature : b"fi\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"button\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"frame\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_tablet_tool_v2_interface : wl_interface = wl_interface { name : b"zwp_tablet_tool_v2\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & zwp_tablet_tool_v2_requests as * const _ } , event_count : 19 , events : unsafe { & zwp_tablet_tool_v2_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_tablet_tool_v2_listener { # [ doc = "tool type\n\nThe tool type is the high-level type of the tool and usually decides\nthe interaction expected from this tool.\n\nThis event is sent in the initial burst of events before the\nwp_tablet_tool.done event." ] fn _type ( & mut self , object : * mut zwp_tablet_tool_v2 , tool_type : _type ) { } # [ doc = "unique hardware serial number of the tool\n\nIf the physical tool can be identified by a unique 64-bit serial\nnumber, this event notifies the client of this serial number.\n\nIf multiple tablets are available in the same seat and the tool is\nuniquely identifiable by the serial number, that tool may move\nbetween tablets.\n\nOtherwise, if the tool has no serial number and this event is\nmissing, the tool is tied to the tablet it first comes into\nproximity with. Even if the physical tool is used on multiple\ntablets, separate wp_tablet_tool objects will be created, one per\ntablet.\n\nThis event is sent in the initial burst of events before the\nwp_tablet_tool.done event." ] fn hardware_serial ( & mut self , object : * mut zwp_tablet_tool_v2 , hardware_serial_hi : u32 , hardware_serial_lo : u32 ) { } # [ doc = "hardware id notification in Wacom's format\n\nThis event notifies the client of a hardware id available on this tool.\n\nThe hardware id is a device-specific 64-bit id that provides extra\ninformation about the tool in use, beyond the wl_tool.type\nenumeration. The format of the id is specific to tablets made by\nWacom Inc. For example, the hardware id of a Wacom Grip\nPen (a stylus) is 0x802.\n\nThis event is sent in the initial burst of events before the\nwp_tablet_tool.done event." ] fn hardware_id_wacom ( & mut self , object : * mut zwp_tablet_tool_v2 , hardware_id_hi : u32 , hardware_id_lo : u32 ) { } # [ doc = "tool capability notification\n\nThis event notifies the client of any capabilities of this tool,\nbeyond the main set of x/y axes and tip up/down detection.\n\nOne event is sent for each extra capability available on this tool.\n\nThis event is sent in the initial burst of events before the\nwp_tablet_tool.done event." ] fn capability ( & mut self , object : * mut zwp_tablet_tool_v2 , capability : capability ) { } # [ doc = "tool description events sequence complete\n\nThis event signals the end of the initial burst of descriptive\nevents. A client may consider the static description of the tool to\nbe complete and finalize initialization of the tool." ] fn done ( & mut self , object : * mut zwp_tablet_tool_v2 , ) { } # [ doc = "tool removed\n\nThis event is sent when the tool is removed from the system and will\nsend no further events. Should the physical tool come back into\nproximity later, a new wp_tablet_tool object will be created.\n\nIt is compositor-dependent when a tool is removed. A compositor may\nremove a tool on proximity out, tablet removal or any other reason.\nA compositor may also keep a tool alive until shutdown.\n\nIf the tool is currently in proximity, a proximity_out event will be\nsent before the removed event. See wp_tablet_tool.proximity_out for\nthe handling of any buttons logically down.\n\nWhen this event is received, the client must wp_tablet_tool.destroy\nthe object." ] fn removed ( & mut self , object : * mut zwp_tablet_tool_v2 , ) { } # [ doc = "proximity in event\n\nNotification that this tool is focused on a certain surface.\n\nThis event can be received when the tool has moved from one surface to\nanother, or when the tool has come back into proximity above the\nsurface.\n\nIf any button is logically down when the tool comes into proximity,\nthe respective button event is sent after the proximity_in event but\nwithin the same frame as the proximity_in event." ] fn proximity_in ( & mut self , object : * mut zwp_tablet_tool_v2 , serial : u32 , tablet : * mut super :: zwp_tablet_v2 :: zwp_tablet_v2 , surface : * mut super :: wl_surface :: wl_surface ) { } # [ doc = "proximity out event\n\nNotification that this tool has either left proximity, or is no\nlonger focused on a certain surface.\n\nWhen the tablet tool leaves proximity of the tablet, button release\nevents are sent for each button that was held down at the time of\nleaving proximity. These events are sent before the proximity_out\nevent but within the same wp_tablet.frame.\n\nIf the tool stays within proximity of the tablet, but the focus\nchanges from one surface to another, a button release event may not\nbe sent until the button is actually released or the tool leaves the\nproximity of the tablet." ] fn proximity_out ( & mut self , object : * mut zwp_tablet_tool_v2 , ) { } # [ doc = "tablet tool is making contact\n\nSent whenever the tablet tool comes in contact with the surface of the\ntablet.\n\nIf the tool is already in contact with the tablet when entering the\ninput region, the client owning said region will receive a\nwp_tablet.proximity_in event, followed by a wp_tablet.down\nevent and a wp_tablet.frame event.\n\nNote that this event describes logical contact, not physical\ncontact. On some devices, a compositor may not consider a tool in\nlogical contact until a minimum physical pressure threshold is\nexceeded." ] fn down ( & mut self , object : * mut zwp_tablet_tool_v2 , serial : u32 ) { } # [ doc = "tablet tool is no longer making contact\n\nSent whenever the tablet tool stops making contact with the surface of\nthe tablet, or when the tablet tool moves out of the input region\nand the compositor grab (if any) is dismissed.\n\nIf the tablet tool moves out of the input region while in contact\nwith the surface of the tablet and the compositor does not have an\nongoing grab on the surface, the client owning said region will\nreceive a wp_tablet.up event, followed by a wp_tablet.proximity_out\nevent and a wp_tablet.frame event. If the compositor has an ongoing\ngrab on this device, this event sequence is sent whenever the grab\nis dismissed in the future.\n\nNote that this event describes logical contact, not physical\ncontact. On some devices, a compositor may not consider a tool out\nof logical contact until physical pressure falls below a specific\nthreshold." ] fn up ( & mut self , object : * mut zwp_tablet_tool_v2 , ) { } # [ doc = "motion event\n\nSent whenever a tablet tool moves." ] fn motion ( & mut self , object : * mut zwp_tablet_tool_v2 , x : wl_fixed_t , y : wl_fixed_t ) { } # [ doc = "pressure change event\n\nSent whenever the pressure axis on a tool changes. The value of this\nevent is normalized to a value between 0 and 65535.\n\nNote that pressure may be nonzero even when a tool is not in logical\ncontact. See the down and up events for more details." ] fn pressure ( & mut self , object : * mut zwp_tablet_tool_v2 , pressure : u32 ) { } # [ doc = "distance change event\n\nSent whenever the distance axis on a tool changes. The value of this\nevent is normalized to a value between 0 and 65535.\n\nNote that distance may be nonzero even when a tool is not in logical\ncontact. See the down and up events for more details." ] fn distance ( & mut self , object : * mut zwp_tablet_tool_v2 , distance : u32 ) { } # [ doc = "tilt change event\n\nSent whenever one or both of the tilt axes on a tool change. Each tilt\nvalue is in degrees, relative to the z-axis of the tablet.\nThe angle is positive when the top of a tool tilts along the\npositive x or y axis." ] fn tilt ( & mut self , object : * mut zwp_tablet_tool_v2 , tilt_x : wl_fixed_t , tilt_y : wl_fixed_t ) { } # [ doc = "z-rotation change event\n\nSent whenever the z-rotation axis on the tool changes. The\nrotation value is in degrees clockwise from the tool's\nlogical neutral position." ] fn rotation ( & mut self , object : * mut zwp_tablet_tool_v2 , degrees : wl_fixed_t ) { } # [ doc = "Slider position change event\n\nSent whenever the slider position on the tool changes. The\nvalue is normalized between -65535 and 65535, with 0 as the logical\nneutral position of the slider.\n\nThe slider is available on e.g. the Wacom Airbrush tool." ] fn slider ( & mut self , object : * mut zwp_tablet_tool_v2 , position : i32 ) { } # [ doc = "Wheel delta event\n\nSent whenever the wheel on the tool emits an event. This event\ncontains two values for the same axis change. The degrees value is\nin the same orientation as the wl_pointer.vertical_scroll axis. The\nclicks value is in discrete logical clicks of the mouse wheel. This\nvalue may be zero if the movement of the wheel was less\nthan one logical click.\n\nClients should choose either value and avoid mixing degrees and\nclicks. The compositor may accumulate values smaller than a logical\nclick and emulate click events when a certain threshold is met.\nThus, wl_tablet_tool.wheel events with non-zero clicks values may\nhave different degrees values." ] fn wheel ( & mut self , object : * mut zwp_tablet_tool_v2 , degrees : wl_fixed_t , clicks : i32 ) { } # [ doc = "button event\n\nSent whenever a button on the tool is pressed or released.\n\nIf a button is held down when the tool moves in or out of proximity,\nbutton events are generated by the compositor. See\nwp_tablet_tool.proximity_in and wp_tablet_tool.proximity_out for\ndetails." ] fn button ( & mut self , object : * mut zwp_tablet_tool_v2 , serial : u32 , button : u32 , state : button_state ) { } # [ doc = "frame event\n\nMarks the end of a series of axis and/or button updates from the\ntablet. The Wayland protocol requires axis updates to be sent\nsequentially, however all events within a frame should be considered\none hardware event." ] fn frame ( & mut self , object : * mut zwp_tablet_tool_v2 , time : u32 ) { } } pub unsafe fn zwp_tablet_tool_v2_set_user_data ( zwp_tablet_tool_v2 : * mut super :: zwp_tablet_tool_v2 :: zwp_tablet_tool_v2 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_tablet_tool_v2 as _ , user_data ) ; } pub unsafe fn zwp_tablet_tool_v2_get_user_data ( zwp_tablet_tool_v2 : * mut super :: zwp_tablet_tool_v2 :: zwp_tablet_tool_v2 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_tablet_tool_v2 as _ ) ; } pub unsafe fn zwp_tablet_tool_v2_get_version ( zwp_tablet_tool_v2 : * mut super :: zwp_tablet_tool_v2 :: zwp_tablet_tool_v2 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_tablet_tool_v2 as _ ) ; } pub unsafe fn zwp_tablet_tool_v2_add_listener ( zwp_tablet_tool_v2 : * mut super :: zwp_tablet_tool_v2 :: zwp_tablet_tool_v2 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_tablet_tool_v2 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_tablet_tool_v2_add_rust_listener ( zwp_tablet_tool_v2 : * mut super :: zwp_tablet_tool_v2 :: zwp_tablet_tool_v2 , listener : & dyn zwp_tablet_tool_v2_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_tablet_tool_v2_add_listener ( zwp_tablet_tool_v2 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "set the tablet tool's surface\n\nSets the surface of the cursor used for this tool on the given\ntablet. This request only takes effect if the tool is in proximity\nof one of the requesting client's surfaces or the surface parameter\nis the current pointer surface. If there was a previous surface set\nwith this request it is replaced. If surface is NULL, the cursor\nimage is hidden.\n\nThe parameters hotspot_x and hotspot_y define the position of the\npointer surface relative to the pointer location. Its top-left corner\nis always at (x, y) - (hotspot_x, hotspot_y), where (x, y) are the\ncoordinates of the pointer location, in surface-local coordinates.\n\nOn surface.attach requests to the pointer surface, hotspot_x and\nhotspot_y are decremented by the x and y parameters passed to the\nrequest. Attach must be confirmed by wl_surface.commit as usual.\n\nThe hotspot can also be updated by passing the currently set pointer\nsurface to this request with new values for hotspot_x and hotspot_y.\n\nThe current and pending input regions of the wl_surface are cleared,\nand wl_surface.set_input_region is ignored until the wl_surface is no\nlonger used as the cursor. When the use as a cursor ends, the current\nand pending input regions become undefined, and the wl_surface is\nunmapped.\n\nThis request gives the surface the role of a wp_tablet_tool cursor. A\nsurface may only ever be used as the cursor surface for one\nwp_tablet_tool. If the surface already has another role or has\npreviously been used as cursor surface for a different tool, a\nprotocol error is raised." ] pub unsafe fn zwp_tablet_tool_v2_set_cursor ( zwp_tablet_tool_v2 : * mut super :: zwp_tablet_tool_v2 :: zwp_tablet_tool_v2 , serial : u32 , surface : * mut super :: wl_surface :: wl_surface , hotspot_x : i32 , hotspot_y : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_tablet_tool_v2 as _ , 0u32 , serial , surface , hotspot_x , hotspot_y , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "destroy the tool object\n\nThis destroys the client's resource for this tool object." ] pub unsafe fn zwp_tablet_tool_v2_destroy ( zwp_tablet_tool_v2 : * mut super :: zwp_tablet_tool_v2 :: zwp_tablet_tool_v2 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_tablet_tool_v2 as _ , 1u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_tablet_tool_v2 as _ ) ; } } # [ doc = "graphics tablet device\n\nThe wp_tablet interface represents one graphics tablet device. The\ntablet interface itself does not generate events; all events are\ngenerated by wp_tablet_tool objects when in proximity above a tablet.\n\nA tablet has a number of static characteristics, e.g. device name and\npid/vid. These capabilities are sent in an event sequence after the\nwp_tablet_seat.tablet_added event. This initial event sequence is\nterminated by a wp_tablet.done event." ] pub mod zwp_tablet_v2 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_tablet_v2 { } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_tablet_v2_requests : [ wl_message ; 1 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_tablet_v2_events : [ wl_message ; 5 ] = [ wl_message { name : b"name\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"id\0" as * const u8 as * const c_char , signature : b"uu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"path\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"removed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_tablet_v2_interface : wl_interface = wl_interface { name : b"zwp_tablet_v2\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_tablet_v2_requests as * const _ } , event_count : 5 , events : unsafe { & zwp_tablet_v2_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_tablet_v2_listener { # [ doc = "tablet device name\n\nThis event is sent in the initial burst of events before the\nwp_tablet.done event." ] fn name ( & mut self , object : * mut zwp_tablet_v2 , name : * mut c_char ) { } # [ doc = "tablet device USB vendor/product id\n\nThis event is sent in the initial burst of events before the\nwp_tablet.done event." ] fn id ( & mut self , object : * mut zwp_tablet_v2 , vid : u32 , pid : u32 ) { } # [ doc = "path to the device\n\nA system-specific device path that indicates which device is behind\nthis wp_tablet. This information may be used to gather additional\ninformation about the device, e.g. through libwacom.\n\nA device may have more than one device path. If so, multiple\nwp_tablet.path events are sent. A device may be emulated and not\nhave a device path, and in that case this event will not be sent.\n\nThe format of the path is unspecified, it may be a device node, a\nsysfs path, or some other identifier. It is up to the client to\nidentify the string provided.\n\nThis event is sent in the initial burst of events before the\nwp_tablet.done event." ] fn path ( & mut self , object : * mut zwp_tablet_v2 , path : * mut c_char ) { } # [ doc = "tablet description events sequence complete\n\nThis event is sent immediately to signal the end of the initial\nburst of descriptive events. A client may consider the static\ndescription of the tablet to be complete and finalize initialization\nof the tablet." ] fn done ( & mut self , object : * mut zwp_tablet_v2 , ) { } # [ doc = "tablet removed event\n\nSent when the tablet has been removed from the system. When a tablet\nis removed, some tools may be removed.\n\nWhen this event is received, the client must wp_tablet.destroy\nthe object." ] fn removed ( & mut self , object : * mut zwp_tablet_v2 , ) { } } pub unsafe fn zwp_tablet_v2_set_user_data ( zwp_tablet_v2 : * mut super :: zwp_tablet_v2 :: zwp_tablet_v2 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_tablet_v2 as _ , user_data ) ; } pub unsafe fn zwp_tablet_v2_get_user_data ( zwp_tablet_v2 : * mut super :: zwp_tablet_v2 :: zwp_tablet_v2 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_tablet_v2 as _ ) ; } pub unsafe fn zwp_tablet_v2_get_version ( zwp_tablet_v2 : * mut super :: zwp_tablet_v2 :: zwp_tablet_v2 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_tablet_v2 as _ ) ; } pub unsafe fn zwp_tablet_v2_add_listener ( zwp_tablet_v2 : * mut super :: zwp_tablet_v2 :: zwp_tablet_v2 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_tablet_v2 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_tablet_v2_add_rust_listener ( zwp_tablet_v2 : * mut super :: zwp_tablet_v2 :: zwp_tablet_v2 , listener : & dyn zwp_tablet_v2_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_tablet_v2_add_listener ( zwp_tablet_v2 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the tablet object\n\nThis destroys the client's resource for this tablet object." ] pub unsafe fn zwp_tablet_v2_destroy ( zwp_tablet_v2 : * mut super :: zwp_tablet_v2 :: zwp_tablet_v2 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_tablet_v2 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_tablet_v2 as _ ) ; } } # [ doc = "pad ring\n\nA circular interaction area, such as the touch ring on the Wacom Intuos\nPro series tablets.\n\nEvents on a ring are logically grouped by the wl_tablet_pad_ring.frame\nevent." ] pub mod zwp_tablet_pad_ring_v2 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_tablet_pad_ring_v2 { } # [ doc = "ring axis source\n\nDescribes the source types for ring events. This indicates to the\nclient how a ring event was physically generated; a client may\nadjust the user interface accordingly. For example, events\nfrom a \"finger\" source may trigger kinetic scrolling." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum source { # [ doc = "finger" ] finger = 1 , # [ doc ( hidden ) ] __nonexhaustive , } impl source { pub fn from_raw ( n : u32 ) -> Option < source > { match n { 1 => Some ( source :: finger ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_tablet_pad_ring_v2_requests : [ wl_message ; 2 ] = [ wl_message { name : b"set_feedback\0" as * const u8 as * const c_char , signature : b"su\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_tablet_pad_ring_v2_events : [ wl_message ; 4 ] = [ wl_message { name : b"source\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"angle\0" as * const u8 as * const c_char , signature : b"f\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"frame\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_tablet_pad_ring_v2_interface : wl_interface = wl_interface { name : b"zwp_tablet_pad_ring_v2\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & zwp_tablet_pad_ring_v2_requests as * const _ } , event_count : 4 , events : unsafe { & zwp_tablet_pad_ring_v2_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_tablet_pad_ring_v2_listener { # [ doc = "ring event source\n\nSource information for ring events.\n\nThis event does not occur on its own. It is sent before a\nwp_tablet_pad_ring.frame event and carries the source information\nfor all events within that frame.\n\nThe source specifies how this event was generated. If the source is\nwp_tablet_pad_ring.source.finger, a wp_tablet_pad_ring.stop event\nwill be sent when the user lifts the finger off the device.\n\nThis event is optional. If the source is unknown for an interaction,\nno event is sent." ] fn source ( & mut self , object : * mut zwp_tablet_pad_ring_v2 , source : source ) { } # [ doc = "angle changed\n\nSent whenever the angle on a ring changes.\n\nThe angle is provided in degrees clockwise from the logical\nnorth of the ring in the pad's current rotation." ] fn angle ( & mut self , object : * mut zwp_tablet_pad_ring_v2 , degrees : wl_fixed_t ) { } # [ doc = "interaction stopped\n\nStop notification for ring events.\n\nFor some wp_tablet_pad_ring.source types, a wp_tablet_pad_ring.stop\nevent is sent to notify a client that the interaction with the ring\nhas terminated. This enables the client to implement kinetic scrolling.\nSee the wp_tablet_pad_ring.source documentation for information on\nwhen this event may be generated.\n\nAny wp_tablet_pad_ring.angle events with the same source after this\nevent should be considered as the start of a new interaction." ] fn stop ( & mut self , object : * mut zwp_tablet_pad_ring_v2 , ) { } # [ doc = "end of a ring event sequence\n\nIndicates the end of a set of ring events that logically belong\ntogether. A client is expected to accumulate the data in all events\nwithin the frame before proceeding.\n\nAll wp_tablet_pad_ring events before a wp_tablet_pad_ring.frame event belong\nlogically together. For example, on termination of a finger interaction\non a ring the compositor will send a wp_tablet_pad_ring.source event,\na wp_tablet_pad_ring.stop event and a wp_tablet_pad_ring.frame event.\n\nA wp_tablet_pad_ring.frame event is sent for every logical event\ngroup, even if the group only contains a single wp_tablet_pad_ring\nevent. Specifically, a client may get a sequence: angle, frame,\nangle, frame, etc." ] fn frame ( & mut self , object : * mut zwp_tablet_pad_ring_v2 , time : u32 ) { } } pub unsafe fn zwp_tablet_pad_ring_v2_set_user_data ( zwp_tablet_pad_ring_v2 : * mut super :: zwp_tablet_pad_ring_v2 :: zwp_tablet_pad_ring_v2 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_tablet_pad_ring_v2 as _ , user_data ) ; } pub unsafe fn zwp_tablet_pad_ring_v2_get_user_data ( zwp_tablet_pad_ring_v2 : * mut super :: zwp_tablet_pad_ring_v2 :: zwp_tablet_pad_ring_v2 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_tablet_pad_ring_v2 as _ ) ; } pub unsafe fn zwp_tablet_pad_ring_v2_get_version ( zwp_tablet_pad_ring_v2 : * mut super :: zwp_tablet_pad_ring_v2 :: zwp_tablet_pad_ring_v2 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_tablet_pad_ring_v2 as _ ) ; } pub unsafe fn zwp_tablet_pad_ring_v2_add_listener ( zwp_tablet_pad_ring_v2 : * mut super :: zwp_tablet_pad_ring_v2 :: zwp_tablet_pad_ring_v2 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_tablet_pad_ring_v2 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_tablet_pad_ring_v2_add_rust_listener ( zwp_tablet_pad_ring_v2 : * mut super :: zwp_tablet_pad_ring_v2 :: zwp_tablet_pad_ring_v2 , listener : & dyn zwp_tablet_pad_ring_v2_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_tablet_pad_ring_v2_add_listener ( zwp_tablet_pad_ring_v2 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "set compositor feedback\n\nRequest that the compositor use the provided feedback string\nassociated with this ring. This request should be issued immediately\nafter a wp_tablet_pad_group.mode_switch event from the corresponding\ngroup is received, or whenever the ring is mapped to a different\naction. See wp_tablet_pad_group.mode_switch for more details.\n\nClients are encouraged to provide context-aware descriptions for\nthe actions associated with the ring; compositors may use this\ninformation to offer visual feedback about the button layout\n(eg. on-screen displays).\n\nThe provided string 'description' is a UTF-8 encoded string to be\nassociated with this ring, and is considered user-visible; general\ninternationalization rules apply.\n\nThe serial argument will be that of the last\nwp_tablet_pad_group.mode_switch event received for the group of this\nring. Requests providing other serials than the most recent one will be\nignored." ] pub unsafe fn zwp_tablet_pad_ring_v2_set_feedback ( zwp_tablet_pad_ring_v2 : * mut super :: zwp_tablet_pad_ring_v2 :: zwp_tablet_pad_ring_v2 , description : * mut c_char , serial : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_tablet_pad_ring_v2 as _ , 0u32 , description , serial , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "destroy the ring object\n\nThis destroys the client's resource for this ring object." ] pub unsafe fn zwp_tablet_pad_ring_v2_destroy ( zwp_tablet_pad_ring_v2 : * mut super :: zwp_tablet_pad_ring_v2 :: zwp_tablet_pad_ring_v2 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_tablet_pad_ring_v2 as _ , 1u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_tablet_pad_ring_v2 as _ ) ; } } # [ doc = "pad strip\n\nA linear interaction area, such as the strips found in Wacom Cintiq\nmodels.\n\nEvents on a strip are logically grouped by the wl_tablet_pad_strip.frame\nevent." ] pub mod zwp_tablet_pad_strip_v2 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_tablet_pad_strip_v2 { } # [ doc = "strip axis source\n\nDescribes the source types for strip events. This indicates to the\nclient how a strip event was physically generated; a client may\nadjust the user interface accordingly. For example, events\nfrom a \"finger\" source may trigger kinetic scrolling." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum source { # [ doc = "finger" ] finger = 1 , # [ doc ( hidden ) ] __nonexhaustive , } impl source { pub fn from_raw ( n : u32 ) -> Option < source > { match n { 1 => Some ( source :: finger ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_tablet_pad_strip_v2_requests : [ wl_message ; 2 ] = [ wl_message { name : b"set_feedback\0" as * const u8 as * const c_char , signature : b"su\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_tablet_pad_strip_v2_events : [ wl_message ; 4 ] = [ wl_message { name : b"source\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"position\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"frame\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_tablet_pad_strip_v2_interface : wl_interface = wl_interface { name : b"zwp_tablet_pad_strip_v2\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & zwp_tablet_pad_strip_v2_requests as * const _ } , event_count : 4 , events : unsafe { & zwp_tablet_pad_strip_v2_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_tablet_pad_strip_v2_listener { # [ doc = "strip event source\n\nSource information for strip events.\n\nThis event does not occur on its own. It is sent before a\nwp_tablet_pad_strip.frame event and carries the source information\nfor all events within that frame.\n\nThe source specifies how this event was generated. If the source is\nwp_tablet_pad_strip.source.finger, a wp_tablet_pad_strip.stop event\nwill be sent when the user lifts their finger off the device.\n\nThis event is optional. If the source is unknown for an interaction,\nno event is sent." ] fn source ( & mut self , object : * mut zwp_tablet_pad_strip_v2 , source : source ) { } # [ doc = "position changed\n\nSent whenever the position on a strip changes.\n\nThe position is normalized to a range of [0, 65535], the 0-value\nrepresents the top-most and/or left-most position of the strip in\nthe pad's current rotation." ] fn position ( & mut self , object : * mut zwp_tablet_pad_strip_v2 , position : u32 ) { } # [ doc = "interaction stopped\n\nStop notification for strip events.\n\nFor some wp_tablet_pad_strip.source types, a wp_tablet_pad_strip.stop\nevent is sent to notify a client that the interaction with the strip\nhas terminated. This enables the client to implement kinetic\nscrolling. See the wp_tablet_pad_strip.source documentation for\ninformation on when this event may be generated.\n\nAny wp_tablet_pad_strip.position events with the same source after this\nevent should be considered as the start of a new interaction." ] fn stop ( & mut self , object : * mut zwp_tablet_pad_strip_v2 , ) { } # [ doc = "end of a strip event sequence\n\nIndicates the end of a set of events that represent one logical\nhardware strip event. A client is expected to accumulate the data\nin all events within the frame before proceeding.\n\nAll wp_tablet_pad_strip events before a wp_tablet_pad_strip.frame event belong\nlogically together. For example, on termination of a finger interaction\non a strip the compositor will send a wp_tablet_pad_strip.source event,\na wp_tablet_pad_strip.stop event and a wp_tablet_pad_strip.frame\nevent.\n\nA wp_tablet_pad_strip.frame event is sent for every logical event\ngroup, even if the group only contains a single wp_tablet_pad_strip\nevent. Specifically, a client may get a sequence: position, frame,\nposition, frame, etc." ] fn frame ( & mut self , object : * mut zwp_tablet_pad_strip_v2 , time : u32 ) { } } pub unsafe fn zwp_tablet_pad_strip_v2_set_user_data ( zwp_tablet_pad_strip_v2 : * mut super :: zwp_tablet_pad_strip_v2 :: zwp_tablet_pad_strip_v2 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_tablet_pad_strip_v2 as _ , user_data ) ; } pub unsafe fn zwp_tablet_pad_strip_v2_get_user_data ( zwp_tablet_pad_strip_v2 : * mut super :: zwp_tablet_pad_strip_v2 :: zwp_tablet_pad_strip_v2 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_tablet_pad_strip_v2 as _ ) ; } pub unsafe fn zwp_tablet_pad_strip_v2_get_version ( zwp_tablet_pad_strip_v2 : * mut super :: zwp_tablet_pad_strip_v2 :: zwp_tablet_pad_strip_v2 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_tablet_pad_strip_v2 as _ ) ; } pub unsafe fn zwp_tablet_pad_strip_v2_add_listener ( zwp_tablet_pad_strip_v2 : * mut super :: zwp_tablet_pad_strip_v2 :: zwp_tablet_pad_strip_v2 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_tablet_pad_strip_v2 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_tablet_pad_strip_v2_add_rust_listener ( zwp_tablet_pad_strip_v2 : * mut super :: zwp_tablet_pad_strip_v2 :: zwp_tablet_pad_strip_v2 , listener : & dyn zwp_tablet_pad_strip_v2_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_tablet_pad_strip_v2_add_listener ( zwp_tablet_pad_strip_v2 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "set compositor feedback\n\nRequests the compositor to use the provided feedback string\nassociated with this strip. This request should be issued immediately\nafter a wp_tablet_pad_group.mode_switch event from the corresponding\ngroup is received, or whenever the strip is mapped to a different\naction. See wp_tablet_pad_group.mode_switch for more details.\n\nClients are encouraged to provide context-aware descriptions for\nthe actions associated with the strip, and compositors may use this\ninformation to offer visual feedback about the button layout\n(eg. on-screen displays).\n\nThe provided string 'description' is a UTF-8 encoded string to be\nassociated with this ring, and is considered user-visible; general\ninternationalization rules apply.\n\nThe serial argument will be that of the last\nwp_tablet_pad_group.mode_switch event received for the group of this\nstrip. Requests providing other serials than the most recent one will be\nignored." ] pub unsafe fn zwp_tablet_pad_strip_v2_set_feedback ( zwp_tablet_pad_strip_v2 : * mut super :: zwp_tablet_pad_strip_v2 :: zwp_tablet_pad_strip_v2 , description : * mut c_char , serial : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_tablet_pad_strip_v2 as _ , 0u32 , description , serial , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "destroy the strip object\n\nThis destroys the client's resource for this strip object." ] pub unsafe fn zwp_tablet_pad_strip_v2_destroy ( zwp_tablet_pad_strip_v2 : * mut super :: zwp_tablet_pad_strip_v2 :: zwp_tablet_pad_strip_v2 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_tablet_pad_strip_v2 as _ , 1u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_tablet_pad_strip_v2 as _ ) ; } } # [ doc = "a set of buttons, rings and strips\n\nA pad group describes a distinct (sub)set of buttons, rings and strips\npresent in the tablet. The criteria of this grouping is usually positional,\neg. if a tablet has buttons on the left and right side, 2 groups will be\npresented. The physical arrangement of groups is undisclosed and may\nchange on the fly.\n\nPad groups will announce their features during pad initialization. Between\nthe corresponding wp_tablet_pad.group event and wp_tablet_pad_group.done, the\npad group will announce the buttons, rings and strips contained in it,\nplus the number of supported modes.\n\nModes are a mechanism to allow multiple groups of actions for every element\nin the pad group. The number of groups and available modes in each is\npersistent across device plugs. The current mode is user-switchable, it\nwill be announced through the wp_tablet_pad_group.mode_switch event both\nwhenever it is switched, and after wp_tablet_pad.enter.\n\nThe current mode logically applies to all elements in the pad group,\nalthough it is at clients' discretion whether to actually perform different\nactions, and/or issue the respective .set_feedback requests to notify the\ncompositor. See the wp_tablet_pad_group.mode_switch event for more details." ] pub mod zwp_tablet_pad_group_v2 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_tablet_pad_group_v2 { } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_tablet_pad_group_v2_requests : [ wl_message ; 1 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; static mut zwp_tablet_pad_group_v2_events_ring_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: zwp_tablet_pad_ring_v2 :: zwp_tablet_pad_ring_v2_interface as * const wl_interface } , ] ; static mut zwp_tablet_pad_group_v2_events_strip_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: zwp_tablet_pad_strip_v2 :: zwp_tablet_pad_strip_v2_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_tablet_pad_group_v2_events : [ wl_message ; 6 ] = [ wl_message { name : b"buttons\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"ring\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwp_tablet_pad_group_v2_events_ring_types as * const _ } , } , wl_message { name : b"strip\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwp_tablet_pad_group_v2_events_strip_types as * const _ } , } , wl_message { name : b"modes\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode_switch\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_tablet_pad_group_v2_interface : wl_interface = wl_interface { name : b"zwp_tablet_pad_group_v2\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_tablet_pad_group_v2_requests as * const _ } , event_count : 6 , events : unsafe { & zwp_tablet_pad_group_v2_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_tablet_pad_group_v2_listener { # [ doc = "buttons announced\n\nSent on wp_tablet_pad_group initialization to announce the available\nbuttons in the group. Button indices start at 0, a button may only be\nin one group at a time.\n\nThis event is first sent in the initial burst of events before the\nwp_tablet_pad_group.done event.\n\nSome buttons are reserved by the compositor. These buttons may not be\nassigned to any wp_tablet_pad_group. Compositors may broadcast this\nevent in the case of changes to the mapping of these reserved buttons.\nIf the compositor happens to reserve all buttons in a group, this event\nwill be sent with an empty array." ] fn buttons ( & mut self , object : * mut zwp_tablet_pad_group_v2 , buttons : * mut wl_array ) { } # [ doc = "ring announced\n\nSent on wp_tablet_pad_group initialization to announce available rings.\nOne event is sent for each ring available on this pad group.\n\nThis event is sent in the initial burst of events before the\nwp_tablet_pad_group.done event." ] fn ring ( & mut self , object : * mut zwp_tablet_pad_group_v2 , ring : * mut super :: zwp_tablet_pad_ring_v2 :: zwp_tablet_pad_ring_v2 ) { } # [ doc = "strip announced\n\nSent on wp_tablet_pad initialization to announce available strips.\nOne event is sent for each strip available on this pad group.\n\nThis event is sent in the initial burst of events before the\nwp_tablet_pad_group.done event." ] fn strip ( & mut self , object : * mut zwp_tablet_pad_group_v2 , strip : * mut super :: zwp_tablet_pad_strip_v2 :: zwp_tablet_pad_strip_v2 ) { } # [ doc = "mode-switch ability announced\n\nSent on wp_tablet_pad_group initialization to announce that the pad\ngroup may switch between modes. A client may use a mode to store a\nspecific configuration for buttons, rings and strips and use the\nwl_tablet_pad_group.mode_switch event to toggle between these\nconfigurations. Mode indices start at 0.\n\nSwitching modes is compositor-dependent. See the\nwp_tablet_pad_group.mode_switch event for more details.\n\nThis event is sent in the initial burst of events before the\nwp_tablet_pad_group.done event. This event is only sent when more than\nmore than one mode is available." ] fn modes ( & mut self , object : * mut zwp_tablet_pad_group_v2 , modes : u32 ) { } # [ doc = "tablet group description events sequence complete\n\nThis event is sent immediately to signal the end of the initial\nburst of descriptive events. A client may consider the static\ndescription of the tablet to be complete and finalize initialization\nof the tablet group." ] fn done ( & mut self , object : * mut zwp_tablet_pad_group_v2 , ) { } # [ doc = "mode switch event\n\nNotification that the mode was switched.\n\nA mode applies to all buttons, rings and strips in a group\nsimultaneously, but a client is not required to assign different actions\nfor each mode. For example, a client may have mode-specific button\nmappings but map the ring to vertical scrolling in all modes. Mode\nindices start at 0.\n\nSwitching modes is compositor-dependent. The compositor may provide\nvisual cues to the client about the mode, e.g. by toggling LEDs on\nthe tablet device. Mode-switching may be software-controlled or\ncontrolled by one or more physical buttons. For example, on a Wacom\nIntuos Pro, the button inside the ring may be assigned to switch\nbetween modes.\n\nThe compositor will also send this event after wp_tablet_pad.enter on\neach group in order to notify of the current mode. Groups that only\nfeature one mode will use mode=0 when emitting this event.\n\nIf a button action in the new mode differs from the action in the\nprevious mode, the client should immediately issue a\nwp_tablet_pad.set_feedback request for each changed button.\n\nIf a ring or strip action in the new mode differs from the action\nin the previous mode, the client should immediately issue a\nwp_tablet_ring.set_feedback or wp_tablet_strip.set_feedback request\nfor each changed ring or strip." ] fn mode_switch ( & mut self , object : * mut zwp_tablet_pad_group_v2 , time : u32 , serial : u32 , mode : u32 ) { } } pub unsafe fn zwp_tablet_pad_group_v2_set_user_data ( zwp_tablet_pad_group_v2 : * mut super :: zwp_tablet_pad_group_v2 :: zwp_tablet_pad_group_v2 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_tablet_pad_group_v2 as _ , user_data ) ; } pub unsafe fn zwp_tablet_pad_group_v2_get_user_data ( zwp_tablet_pad_group_v2 : * mut super :: zwp_tablet_pad_group_v2 :: zwp_tablet_pad_group_v2 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_tablet_pad_group_v2 as _ ) ; } pub unsafe fn zwp_tablet_pad_group_v2_get_version ( zwp_tablet_pad_group_v2 : * mut super :: zwp_tablet_pad_group_v2 :: zwp_tablet_pad_group_v2 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_tablet_pad_group_v2 as _ ) ; } pub unsafe fn zwp_tablet_pad_group_v2_add_listener ( zwp_tablet_pad_group_v2 : * mut super :: zwp_tablet_pad_group_v2 :: zwp_tablet_pad_group_v2 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_tablet_pad_group_v2 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_tablet_pad_group_v2_add_rust_listener ( zwp_tablet_pad_group_v2 : * mut super :: zwp_tablet_pad_group_v2 :: zwp_tablet_pad_group_v2 , listener : & dyn zwp_tablet_pad_group_v2_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_tablet_pad_group_v2_add_listener ( zwp_tablet_pad_group_v2 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the pad object\n\nDestroy the wp_tablet_pad_group object. Objects created from this object\nare unaffected and should be destroyed separately." ] pub unsafe fn zwp_tablet_pad_group_v2_destroy ( zwp_tablet_pad_group_v2 : * mut super :: zwp_tablet_pad_group_v2 :: zwp_tablet_pad_group_v2 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_tablet_pad_group_v2 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_tablet_pad_group_v2 as _ ) ; } } # [ doc = "a set of buttons, rings and strips\n\nA pad device is a set of buttons, rings and strips\nusually physically present on the tablet device itself. Some\nexceptions exist where the pad device is physically detached, e.g. the\nWacom ExpressKey Remote.\n\nPad devices have no axes that control the cursor and are generally\nauxiliary devices to the tool devices used on the tablet surface.\n\nA pad device has a number of static characteristics, e.g. the number\nof rings. These capabilities are sent in an event sequence after the\nwp_tablet_seat.pad_added event before any actual events from this pad.\nThis initial event sequence is terminated by a wp_tablet_pad.done\nevent.\n\nAll pad features (buttons, rings and strips) are logically divided into\ngroups and all pads have at least one group. The available groups are\nnotified through the wp_tablet_pad.group event; the compositor will\nemit one event per group before emitting wp_tablet_pad.done.\n\nGroups may have multiple modes. Modes allow clients to map multiple\nactions to a single pad feature. Only one mode can be active per group,\nalthough different groups may have different active modes." ] pub mod zwp_tablet_pad_v2 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_tablet_pad_v2 { } # [ doc = "physical button state\n\nDescribes the physical state of a button that caused the button\nevent." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum button_state { # [ doc = "the button is not pressed" ] released = 0 , # [ doc = "the button is pressed" ] pressed = 1 , # [ doc ( hidden ) ] __nonexhaustive , } impl button_state { pub fn from_raw ( n : u32 ) -> Option < button_state > { match n { 0 => Some ( button_state :: released ) , 1 => Some ( button_state :: pressed ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_tablet_pad_v2_requests : [ wl_message ; 2 ] = [ wl_message { name : b"set_feedback\0" as * const u8 as * const c_char , signature : b"usu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; static mut zwp_tablet_pad_v2_events_group_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: zwp_tablet_pad_group_v2 :: zwp_tablet_pad_group_v2_interface as * const wl_interface } , ] ; static mut zwp_tablet_pad_v2_events_enter_types : [ * const wl_interface ; 3 ] = [ NULLPTR as * const wl_interface , unsafe { & super :: zwp_tablet_v2 :: zwp_tablet_v2_interface as * const wl_interface } , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , ] ; static mut zwp_tablet_pad_v2_events_leave_types : [ * const wl_interface ; 2 ] = [ NULLPTR as * const wl_interface , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_tablet_pad_v2_events : [ wl_message ; 8 ] = [ wl_message { name : b"group\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwp_tablet_pad_v2_events_group_types as * const _ } , } , wl_message { name : b"path\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"buttons\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"button\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"enter\0" as * const u8 as * const c_char , signature : b"uoo\0" as * const u8 as * const c_char , types : unsafe { & zwp_tablet_pad_v2_events_enter_types as * const _ } , } , wl_message { name : b"leave\0" as * const u8 as * const c_char , signature : b"uo\0" as * const u8 as * const c_char , types : unsafe { & zwp_tablet_pad_v2_events_leave_types as * const _ } , } , wl_message { name : b"removed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_tablet_pad_v2_interface : wl_interface = wl_interface { name : b"zwp_tablet_pad_v2\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & zwp_tablet_pad_v2_requests as * const _ } , event_count : 8 , events : unsafe { & zwp_tablet_pad_v2_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_tablet_pad_v2_listener { # [ doc = "group announced\n\nSent on wp_tablet_pad initialization to announce available groups.\nOne event is sent for each pad group available.\n\nThis event is sent in the initial burst of events before the\nwp_tablet_pad.done event. At least one group will be announced." ] fn group ( & mut self , object : * mut zwp_tablet_pad_v2 , pad_group : * mut super :: zwp_tablet_pad_group_v2 :: zwp_tablet_pad_group_v2 ) { } # [ doc = "path to the device\n\nA system-specific device path that indicates which device is behind\nthis wp_tablet_pad. This information may be used to gather additional\ninformation about the device, e.g. through libwacom.\n\nThe format of the path is unspecified, it may be a device node, a\nsysfs path, or some other identifier. It is up to the client to\nidentify the string provided.\n\nThis event is sent in the initial burst of events before the\nwp_tablet_pad.done event." ] fn path ( & mut self , object : * mut zwp_tablet_pad_v2 , path : * mut c_char ) { } # [ doc = "buttons announced\n\nSent on wp_tablet_pad initialization to announce the available\nbuttons.\n\nThis event is sent in the initial burst of events before the\nwp_tablet_pad.done event. This event is only sent when at least one\nbutton is available." ] fn buttons ( & mut self , object : * mut zwp_tablet_pad_v2 , buttons : u32 ) { } # [ doc = "pad description event sequence complete\n\nThis event signals the end of the initial burst of descriptive\nevents. A client may consider the static description of the pad to\nbe complete and finalize initialization of the pad." ] fn done ( & mut self , object : * mut zwp_tablet_pad_v2 , ) { } # [ doc = "physical button state\n\nSent whenever the physical state of a button changes." ] fn button ( & mut self , object : * mut zwp_tablet_pad_v2 , time : u32 , button : u32 , state : button_state ) { } # [ doc = "enter event\n\nNotification that this pad is focused on the specified surface." ] fn enter ( & mut self , object : * mut zwp_tablet_pad_v2 , serial : u32 , tablet : * mut super :: zwp_tablet_v2 :: zwp_tablet_v2 , surface : * mut super :: wl_surface :: wl_surface ) { } # [ doc = "enter event\n\nNotification that this pad is no longer focused on the specified\nsurface." ] fn leave ( & mut self , object : * mut zwp_tablet_pad_v2 , serial : u32 , surface : * mut super :: wl_surface :: wl_surface ) { } # [ doc = "pad removed event\n\nSent when the pad has been removed from the system. When a tablet\nis removed its pad(s) will be removed too.\n\nWhen this event is received, the client must destroy all rings, strips\nand groups that were offered by this pad, and issue wp_tablet_pad.destroy\nthe pad itself." ] fn removed ( & mut self , object : * mut zwp_tablet_pad_v2 , ) { } } pub unsafe fn zwp_tablet_pad_v2_set_user_data ( zwp_tablet_pad_v2 : * mut super :: zwp_tablet_pad_v2 :: zwp_tablet_pad_v2 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_tablet_pad_v2 as _ , user_data ) ; } pub unsafe fn zwp_tablet_pad_v2_get_user_data ( zwp_tablet_pad_v2 : * mut super :: zwp_tablet_pad_v2 :: zwp_tablet_pad_v2 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_tablet_pad_v2 as _ ) ; } pub unsafe fn zwp_tablet_pad_v2_get_version ( zwp_tablet_pad_v2 : * mut super :: zwp_tablet_pad_v2 :: zwp_tablet_pad_v2 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_tablet_pad_v2 as _ ) ; } pub unsafe fn zwp_tablet_pad_v2_add_listener ( zwp_tablet_pad_v2 : * mut super :: zwp_tablet_pad_v2 :: zwp_tablet_pad_v2 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_tablet_pad_v2 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_tablet_pad_v2_add_rust_listener ( zwp_tablet_pad_v2 : * mut super :: zwp_tablet_pad_v2 :: zwp_tablet_pad_v2 , listener : & dyn zwp_tablet_pad_v2_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_tablet_pad_v2_add_listener ( zwp_tablet_pad_v2 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "set compositor feedback\n\nRequests the compositor to use the provided feedback string\nassociated with this button. This request should be issued immediately\nafter a wp_tablet_pad_group.mode_switch event from the corresponding\ngroup is received, or whenever a button is mapped to a different\naction. See wp_tablet_pad_group.mode_switch for more details.\n\nClients are encouraged to provide context-aware descriptions for\nthe actions associated with each button, and compositors may use\nthis information to offer visual feedback on the button layout\n(e.g. on-screen displays).\n\nButton indices start at 0. Setting the feedback string on a button\nthat is reserved by the compositor (i.e. not belonging to any\nwp_tablet_pad_group) does not generate an error but the compositor\nis free to ignore the request.\n\nThe provided string 'description' is a UTF-8 encoded string to be\nassociated with this ring, and is considered user-visible; general\ninternationalization rules apply.\n\nThe serial argument will be that of the last\nwp_tablet_pad_group.mode_switch event received for the group of this\nbutton. Requests providing other serials than the most recent one will\nbe ignored." ] pub unsafe fn zwp_tablet_pad_v2_set_feedback ( zwp_tablet_pad_v2 : * mut super :: zwp_tablet_pad_v2 :: zwp_tablet_pad_v2 , button : u32 , description : * mut c_char , serial : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_tablet_pad_v2 as _ , 0u32 , button , description , serial , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "destroy the pad object\n\nDestroy the wp_tablet_pad object. Objects created from this object\nare unaffected and should be destroyed separately." ] pub unsafe fn zwp_tablet_pad_v2_destroy ( zwp_tablet_pad_v2 : * mut super :: zwp_tablet_pad_v2 :: zwp_tablet_pad_v2 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_tablet_pad_v2 as _ , 1u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_tablet_pad_v2 as _ ) ; } } } pub mod tablet_unstable_v1 { use super :: wayland :: * ; use super :: xdg_shell :: * ; # [ doc = "controller object for graphic tablet devices\n\nAn object that provides access to the graphics tablets available on this\nsystem. All tablets are associated with a seat, to get access to the\nactual tablets, use wp_tablet_manager.get_tablet_seat." ] pub mod zwp_tablet_manager_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_tablet_manager_v1 { } static mut zwp_tablet_manager_v1_requests_get_tablet_seat_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: zwp_tablet_seat_v1 :: zwp_tablet_seat_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_tablet_manager_v1_requests : [ wl_message ; 2 ] = [ wl_message { name : b"get_tablet_seat\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zwp_tablet_manager_v1_requests_get_tablet_seat_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_tablet_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_tablet_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & zwp_tablet_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_tablet_manager_v1_listener { } pub unsafe fn zwp_tablet_manager_v1_set_user_data ( zwp_tablet_manager_v1 : * mut super :: zwp_tablet_manager_v1 :: zwp_tablet_manager_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_tablet_manager_v1 as _ , user_data ) ; } pub unsafe fn zwp_tablet_manager_v1_get_user_data ( zwp_tablet_manager_v1 : * mut super :: zwp_tablet_manager_v1 :: zwp_tablet_manager_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_tablet_manager_v1 as _ ) ; } pub unsafe fn zwp_tablet_manager_v1_get_version ( zwp_tablet_manager_v1 : * mut super :: zwp_tablet_manager_v1 :: zwp_tablet_manager_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_tablet_manager_v1 as _ ) ; } pub unsafe fn zwp_tablet_manager_v1_add_listener ( zwp_tablet_manager_v1 : * mut super :: zwp_tablet_manager_v1 :: zwp_tablet_manager_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_tablet_manager_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_tablet_manager_v1_add_rust_listener ( zwp_tablet_manager_v1 : * mut super :: zwp_tablet_manager_v1 :: zwp_tablet_manager_v1 , listener : & dyn zwp_tablet_manager_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_tablet_manager_v1_add_listener ( zwp_tablet_manager_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "get the tablet seat\n\nGet the wp_tablet_seat object for the given seat. This object\nprovides access to all graphics tablets in this seat." ] pub unsafe fn zwp_tablet_manager_v1_get_tablet_seat ( zwp_tablet_manager_v1 : * mut super :: zwp_tablet_manager_v1 :: zwp_tablet_manager_v1 , seat : * mut super :: wl_seat :: wl_seat ) -> * mut super :: zwp_tablet_seat_v1 :: zwp_tablet_seat_v1 { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zwp_tablet_manager_v1 as _ , 0u32 , & super :: zwp_tablet_seat_v1 :: zwp_tablet_seat_v1_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , seat ) ; return r as _ ; } # [ doc = "release the memory for the tablet manager object\n\nDestroy the wp_tablet_manager object. Objects created from this\nobject are unaffected and should be destroyed separately." ] pub unsafe fn zwp_tablet_manager_v1_destroy ( zwp_tablet_manager_v1 : * mut super :: zwp_tablet_manager_v1 :: zwp_tablet_manager_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_tablet_manager_v1 as _ , 1u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_tablet_manager_v1 as _ ) ; } } # [ doc = "controller object for graphic tablet devices of a seat\n\nAn object that provides access to the graphics tablets available on this\nseat. After binding to this interface, the compositor sends a set of\nwp_tablet_seat.tablet_added and wp_tablet_seat.tool_added events." ] pub mod zwp_tablet_seat_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_tablet_seat_v1 { } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_tablet_seat_v1_requests : [ wl_message ; 1 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; static mut zwp_tablet_seat_v1_events_tablet_added_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: zwp_tablet_v1 :: zwp_tablet_v1_interface as * const wl_interface } , ] ; static mut zwp_tablet_seat_v1_events_tool_added_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: zwp_tablet_tool_v1 :: zwp_tablet_tool_v1_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_tablet_seat_v1_events : [ wl_message ; 2 ] = [ wl_message { name : b"tablet_added\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwp_tablet_seat_v1_events_tablet_added_types as * const _ } , } , wl_message { name : b"tool_added\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwp_tablet_seat_v1_events_tool_added_types as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_tablet_seat_v1_interface : wl_interface = wl_interface { name : b"zwp_tablet_seat_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_tablet_seat_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwp_tablet_seat_v1_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_tablet_seat_v1_listener { # [ doc = "new device notification\n\nThis event is sent whenever a new tablet becomes available on this\nseat. This event only provides the object id of the tablet, any\nstatic information about the tablet (device name, vid/pid, etc.) is\nsent through the wp_tablet interface." ] fn tablet_added ( & mut self , object : * mut zwp_tablet_seat_v1 , id : * mut super :: zwp_tablet_v1 :: zwp_tablet_v1 ) { } # [ doc = "a new tool has been used with a tablet\n\nThis event is sent whenever a tool that has not previously been used\nwith a tablet comes into use. This event only provides the object id\nof the tool; any static information about the tool (capabilities,\ntype, etc.) is sent through the wp_tablet_tool interface." ] fn tool_added ( & mut self , object : * mut zwp_tablet_seat_v1 , id : * mut super :: zwp_tablet_tool_v1 :: zwp_tablet_tool_v1 ) { } } pub unsafe fn zwp_tablet_seat_v1_set_user_data ( zwp_tablet_seat_v1 : * mut super :: zwp_tablet_seat_v1 :: zwp_tablet_seat_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_tablet_seat_v1 as _ , user_data ) ; } pub unsafe fn zwp_tablet_seat_v1_get_user_data ( zwp_tablet_seat_v1 : * mut super :: zwp_tablet_seat_v1 :: zwp_tablet_seat_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_tablet_seat_v1 as _ ) ; } pub unsafe fn zwp_tablet_seat_v1_get_version ( zwp_tablet_seat_v1 : * mut super :: zwp_tablet_seat_v1 :: zwp_tablet_seat_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_tablet_seat_v1 as _ ) ; } pub unsafe fn zwp_tablet_seat_v1_add_listener ( zwp_tablet_seat_v1 : * mut super :: zwp_tablet_seat_v1 :: zwp_tablet_seat_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_tablet_seat_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_tablet_seat_v1_add_rust_listener ( zwp_tablet_seat_v1 : * mut super :: zwp_tablet_seat_v1 :: zwp_tablet_seat_v1 , listener : & dyn zwp_tablet_seat_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_tablet_seat_v1_add_listener ( zwp_tablet_seat_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "release the memory for the tablet seat object\n\nDestroy the wp_tablet_seat object. Objects created from this\nobject are unaffected and should be destroyed separately." ] pub unsafe fn zwp_tablet_seat_v1_destroy ( zwp_tablet_seat_v1 : * mut super :: zwp_tablet_seat_v1 :: zwp_tablet_seat_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_tablet_seat_v1 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_tablet_seat_v1 as _ ) ; } } # [ doc = "a physical tablet tool\n\nAn object that represents a physical tool that has been, or is\ncurrently in use with a tablet in this seat. Each wp_tablet_tool\nobject stays valid until the client destroys it; the compositor\nreuses the wp_tablet_tool object to indicate that the object's\nrespective physical tool has come into proximity of a tablet again.\n\nA wp_tablet_tool object's relation to a physical tool depends on the\ntablet's ability to report serial numbers. If the tablet supports\nthis capability, then the object represents a specific physical tool\nand can be identified even when used on multiple tablets.\n\nA tablet tool has a number of static characteristics, e.g. tool type,\nhardware_serial and capabilities. These capabilities are sent in an\nevent sequence after the wp_tablet_seat.tool_added event before any\nactual events from this tool. This initial event sequence is\nterminated by a wp_tablet_tool.done event.\n\nTablet tool events are grouped by wp_tablet_tool.frame events.\nAny events received before a wp_tablet_tool.frame event should be\nconsidered part of the same hardware state change." ] pub mod zwp_tablet_tool_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_tablet_tool_v1 { } # [ doc = "a physical tool type\n\nDescribes the physical type of a tool. The physical type of a tool\ngenerally defines its base usage.\n\nThe mouse tool represents a mouse-shaped tool that is not a relative\ndevice but bound to the tablet's surface, providing absolute\ncoordinates.\n\nThe lens tool is a mouse-shaped tool with an attached lens to\nprovide precision focus." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum _type { # [ doc = "Pen" ] pen = 320 , # [ doc = "Eraser" ] eraser = 321 , # [ doc = "Brush" ] brush = 322 , # [ doc = "Pencil" ] pencil = 323 , # [ doc = "Airbrush" ] airbrush = 324 , # [ doc = "Finger" ] finger = 325 , # [ doc = "Mouse" ] mouse = 326 , # [ doc = "Lens" ] lens = 327 , # [ doc ( hidden ) ] __nonexhaustive , } impl _type { pub fn from_raw ( n : u32 ) -> Option < _type > { match n { 320 => Some ( _type :: pen ) , 321 => Some ( _type :: eraser ) , 322 => Some ( _type :: brush ) , 323 => Some ( _type :: pencil ) , 324 => Some ( _type :: airbrush ) , 325 => Some ( _type :: finger ) , 326 => Some ( _type :: mouse ) , 327 => Some ( _type :: lens ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ doc = "capability flags for a tool\n\nDescribes extra capabilities on a tablet.\n\nAny tool must provide x and y values, extra axes are\ndevice-specific." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum capability { # [ doc = "Tilt axes" ] tilt = 1 , # [ doc = "Pressure axis" ] pressure = 2 , # [ doc = "Distance axis" ] distance = 3 , # [ doc = "Z-rotation axis" ] rotation = 4 , # [ doc = "Slider axis" ] slider = 5 , # [ doc = "Wheel axis" ] wheel = 6 , # [ doc ( hidden ) ] __nonexhaustive , } impl capability { pub fn from_raw ( n : u32 ) -> Option < capability > { match n { 1 => Some ( capability :: tilt ) , 2 => Some ( capability :: pressure ) , 3 => Some ( capability :: distance ) , 4 => Some ( capability :: rotation ) , 5 => Some ( capability :: slider ) , 6 => Some ( capability :: wheel ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ doc = "physical button state\n\nDescribes the physical state of a button that produced the button event." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum button_state { # [ doc = "button is not pressed" ] released = 0 , # [ doc = "button is pressed" ] pressed = 1 , # [ doc ( hidden ) ] __nonexhaustive , } impl button_state { pub fn from_raw ( n : u32 ) -> Option < button_state > { match n { 0 => Some ( button_state :: released ) , 1 => Some ( button_state :: pressed ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum error { # [ doc = "given wl_surface has another role" ] role = 0 , # [ doc ( hidden ) ] __nonexhaustive , } impl error { pub fn from_raw ( n : u32 ) -> Option < error > { match n { 0 => Some ( error :: role ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } static mut zwp_tablet_tool_v1_requests_set_cursor_types : [ * const wl_interface ; 4 ] = [ NULLPTR as * const wl_interface , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_tablet_tool_v1_requests : [ wl_message ; 2 ] = [ wl_message { name : b"set_cursor\0" as * const u8 as * const c_char , signature : b"u?oii\0" as * const u8 as * const c_char , types : unsafe { & zwp_tablet_tool_v1_requests_set_cursor_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; static mut zwp_tablet_tool_v1_events_proximity_in_types : [ * const wl_interface ; 3 ] = [ NULLPTR as * const wl_interface , unsafe { & super :: zwp_tablet_v1 :: zwp_tablet_v1_interface as * const wl_interface } , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_tablet_tool_v1_events : [ wl_message ; 19 ] = [ wl_message { name : b"type\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"hardware_serial\0" as * const u8 as * const c_char , signature : b"uu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"hardware_id_wacom\0" as * const u8 as * const c_char , signature : b"uu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"capability\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"removed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"proximity_in\0" as * const u8 as * const c_char , signature : b"uoo\0" as * const u8 as * const c_char , types : unsafe { & zwp_tablet_tool_v1_events_proximity_in_types as * const _ } , } , wl_message { name : b"proximity_out\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"down\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"up\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"motion\0" as * const u8 as * const c_char , signature : b"ff\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"pressure\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"distance\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"tilt\0" as * const u8 as * const c_char , signature : b"ii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"rotation\0" as * const u8 as * const c_char , signature : b"i\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"slider\0" as * const u8 as * const c_char , signature : b"i\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"wheel\0" as * const u8 as * const c_char , signature : b"ii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"button\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"frame\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_tablet_tool_v1_interface : wl_interface = wl_interface { name : b"zwp_tablet_tool_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & zwp_tablet_tool_v1_requests as * const _ } , event_count : 19 , events : unsafe { & zwp_tablet_tool_v1_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_tablet_tool_v1_listener { # [ doc = "tool type\n\nThe tool type is the high-level type of the tool and usually decides\nthe interaction expected from this tool.\n\nThis event is sent in the initial burst of events before the\nwp_tablet_tool.done event." ] fn _type ( & mut self , object : * mut zwp_tablet_tool_v1 , tool_type : _type ) { } # [ doc = "unique hardware serial number of the tool\n\nIf the physical tool can be identified by a unique 64-bit serial\nnumber, this event notifies the client of this serial number.\n\nIf multiple tablets are available in the same seat and the tool is\nuniquely identifiable by the serial number, that tool may move\nbetween tablets.\n\nOtherwise, if the tool has no serial number and this event is\nmissing, the tool is tied to the tablet it first comes into\nproximity with. Even if the physical tool is used on multiple\ntablets, separate wp_tablet_tool objects will be created, one per\ntablet.\n\nThis event is sent in the initial burst of events before the\nwp_tablet_tool.done event." ] fn hardware_serial ( & mut self , object : * mut zwp_tablet_tool_v1 , hardware_serial_hi : u32 , hardware_serial_lo : u32 ) { } # [ doc = "hardware id notification in Wacom's format\n\nThis event notifies the client of a hardware id available on this tool.\n\nThe hardware id is a device-specific 64-bit id that provides extra\ninformation about the tool in use, beyond the wl_tool.type\nenumeration. The format of the id is specific to tablets made by\nWacom Inc. For example, the hardware id of a Wacom Grip\nPen (a stylus) is 0x802.\n\nThis event is sent in the initial burst of events before the\nwp_tablet_tool.done event." ] fn hardware_id_wacom ( & mut self , object : * mut zwp_tablet_tool_v1 , hardware_id_hi : u32 , hardware_id_lo : u32 ) { } # [ doc = "tool capability notification\n\nThis event notifies the client of any capabilities of this tool,\nbeyond the main set of x/y axes and tip up/down detection.\n\nOne event is sent for each extra capability available on this tool.\n\nThis event is sent in the initial burst of events before the\nwp_tablet_tool.done event." ] fn capability ( & mut self , object : * mut zwp_tablet_tool_v1 , capability : capability ) { } # [ doc = "tool description events sequence complete\n\nThis event signals the end of the initial burst of descriptive\nevents. A client may consider the static description of the tool to\nbe complete and finalize initialization of the tool." ] fn done ( & mut self , object : * mut zwp_tablet_tool_v1 , ) { } # [ doc = "tool removed\n\nThis event is sent when the tool is removed from the system and will\nsend no further events. Should the physical tool come back into\nproximity later, a new wp_tablet_tool object will be created.\n\nIt is compositor-dependent when a tool is removed. A compositor may\nremove a tool on proximity out, tablet removal or any other reason.\nA compositor may also keep a tool alive until shutdown.\n\nIf the tool is currently in proximity, a proximity_out event will be\nsent before the removed event. See wp_tablet_tool.proximity_out for\nthe handling of any buttons logically down.\n\nWhen this event is received, the client must wp_tablet_tool.destroy\nthe object." ] fn removed ( & mut self , object : * mut zwp_tablet_tool_v1 , ) { } # [ doc = "proximity in event\n\nNotification that this tool is focused on a certain surface.\n\nThis event can be received when the tool has moved from one surface to\nanother, or when the tool has come back into proximity above the\nsurface.\n\nIf any button is logically down when the tool comes into proximity,\nthe respective button event is sent after the proximity_in event but\nwithin the same frame as the proximity_in event." ] fn proximity_in ( & mut self , object : * mut zwp_tablet_tool_v1 , serial : u32 , tablet : * mut super :: zwp_tablet_v1 :: zwp_tablet_v1 , surface : * mut super :: wl_surface :: wl_surface ) { } # [ doc = "proximity out event\n\nNotification that this tool has either left proximity, or is no\nlonger focused on a certain surface.\n\nWhen the tablet tool leaves proximity of the tablet, button release\nevents are sent for each button that was held down at the time of\nleaving proximity. These events are sent before the proximity_out\nevent but within the same wp_tablet.frame.\n\nIf the tool stays within proximity of the tablet, but the focus\nchanges from one surface to another, a button release event may not\nbe sent until the button is actually released or the tool leaves the\nproximity of the tablet." ] fn proximity_out ( & mut self , object : * mut zwp_tablet_tool_v1 , ) { } # [ doc = "tablet tool is making contact\n\nSent whenever the tablet tool comes in contact with the surface of the\ntablet.\n\nIf the tool is already in contact with the tablet when entering the\ninput region, the client owning said region will receive a\nwp_tablet.proximity_in event, followed by a wp_tablet.down\nevent and a wp_tablet.frame event.\n\nNote that this event describes logical contact, not physical\ncontact. On some devices, a compositor may not consider a tool in\nlogical contact until a minimum physical pressure threshold is\nexceeded." ] fn down ( & mut self , object : * mut zwp_tablet_tool_v1 , serial : u32 ) { } # [ doc = "tablet tool is no longer making contact\n\nSent whenever the tablet tool stops making contact with the surface of\nthe tablet, or when the tablet tool moves out of the input region\nand the compositor grab (if any) is dismissed.\n\nIf the tablet tool moves out of the input region while in contact\nwith the surface of the tablet and the compositor does not have an\nongoing grab on the surface, the client owning said region will\nreceive a wp_tablet.up event, followed by a wp_tablet.proximity_out\nevent and a wp_tablet.frame event. If the compositor has an ongoing\ngrab on this device, this event sequence is sent whenever the grab\nis dismissed in the future.\n\nNote that this event describes logical contact, not physical\ncontact. On some devices, a compositor may not consider a tool out\nof logical contact until physical pressure falls below a specific\nthreshold." ] fn up ( & mut self , object : * mut zwp_tablet_tool_v1 , ) { } # [ doc = "motion event\n\nSent whenever a tablet tool moves." ] fn motion ( & mut self , object : * mut zwp_tablet_tool_v1 , x : wl_fixed_t , y : wl_fixed_t ) { } # [ doc = "pressure change event\n\nSent whenever the pressure axis on a tool changes. The value of this\nevent is normalized to a value between 0 and 65535.\n\nNote that pressure may be nonzero even when a tool is not in logical\ncontact. See the down and up events for more details." ] fn pressure ( & mut self , object : * mut zwp_tablet_tool_v1 , pressure : u32 ) { } # [ doc = "distance change event\n\nSent whenever the distance axis on a tool changes. The value of this\nevent is normalized to a value between 0 and 65535.\n\nNote that distance may be nonzero even when a tool is not in logical\ncontact. See the down and up events for more details." ] fn distance ( & mut self , object : * mut zwp_tablet_tool_v1 , distance : u32 ) { } # [ doc = "tilt change event\n\nSent whenever one or both of the tilt axes on a tool change. Each tilt\nvalue is in 0.01 of a degree, relative to the z-axis of the tablet.\nThe angle is positive when the top of a tool tilts along the\npositive x or y axis." ] fn tilt ( & mut self , object : * mut zwp_tablet_tool_v1 , tilt_x : i32 , tilt_y : i32 ) { } # [ doc = "z-rotation change event\n\nSent whenever the z-rotation axis on the tool changes. The\nrotation value is in 0.01 of a degree clockwise from the tool's\nlogical neutral position." ] fn rotation ( & mut self , object : * mut zwp_tablet_tool_v1 , degrees : i32 ) { } # [ doc = "Slider position change event\n\nSent whenever the slider position on the tool changes. The\nvalue is normalized between -65535 and 65535, with 0 as the logical\nneutral position of the slider.\n\nThe slider is available on e.g. the Wacom Airbrush tool." ] fn slider ( & mut self , object : * mut zwp_tablet_tool_v1 , position : i32 ) { } # [ doc = "Wheel delta event\n\nSent whenever the wheel on the tool emits an event. This event\ncontains two values for the same axis change. The degrees value is\nin 0.01 of a degree in the same orientation as the\nwl_pointer.vertical_scroll axis. The clicks value is in discrete\nlogical clicks of the mouse wheel. This value may be zero if the\nmovement of the wheel was less than one logical click.\n\nClients should choose either value and avoid mixing degrees and\nclicks. The compositor may accumulate values smaller than a logical\nclick and emulate click events when a certain threshold is met.\nThus, wl_tablet_tool.wheel events with non-zero clicks values may\nhave different degrees values." ] fn wheel ( & mut self , object : * mut zwp_tablet_tool_v1 , degrees : i32 , clicks : i32 ) { } # [ doc = "button event\n\nSent whenever a button on the tool is pressed or released.\n\nIf a button is held down when the tool moves in or out of proximity,\nbutton events are generated by the compositor. See\nwp_tablet_tool.proximity_in and wp_tablet_tool.proximity_out for\ndetails." ] fn button ( & mut self , object : * mut zwp_tablet_tool_v1 , serial : u32 , button : u32 , state : button_state ) { } # [ doc = "frame event\n\nMarks the end of a series of axis and/or button updates from the\ntablet. The Wayland protocol requires axis updates to be sent\nsequentially, however all events within a frame should be considered\none hardware event." ] fn frame ( & mut self , object : * mut zwp_tablet_tool_v1 , time : u32 ) { } } pub unsafe fn zwp_tablet_tool_v1_set_user_data ( zwp_tablet_tool_v1 : * mut super :: zwp_tablet_tool_v1 :: zwp_tablet_tool_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_tablet_tool_v1 as _ , user_data ) ; } pub unsafe fn zwp_tablet_tool_v1_get_user_data ( zwp_tablet_tool_v1 : * mut super :: zwp_tablet_tool_v1 :: zwp_tablet_tool_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_tablet_tool_v1 as _ ) ; } pub unsafe fn zwp_tablet_tool_v1_get_version ( zwp_tablet_tool_v1 : * mut super :: zwp_tablet_tool_v1 :: zwp_tablet_tool_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_tablet_tool_v1 as _ ) ; } pub unsafe fn zwp_tablet_tool_v1_add_listener ( zwp_tablet_tool_v1 : * mut super :: zwp_tablet_tool_v1 :: zwp_tablet_tool_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_tablet_tool_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_tablet_tool_v1_add_rust_listener ( zwp_tablet_tool_v1 : * mut super :: zwp_tablet_tool_v1 :: zwp_tablet_tool_v1 , listener : & dyn zwp_tablet_tool_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_tablet_tool_v1_add_listener ( zwp_tablet_tool_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "set the tablet tool's surface\n\nSets the surface of the cursor used for this tool on the given\ntablet. This request only takes effect if the tool is in proximity\nof one of the requesting client's surfaces or the surface parameter\nis the current pointer surface. If there was a previous surface set\nwith this request it is replaced. If surface is NULL, the cursor\nimage is hidden.\n\nThe parameters hotspot_x and hotspot_y define the position of the\npointer surface relative to the pointer location. Its top-left corner\nis always at (x, y) - (hotspot_x, hotspot_y), where (x, y) are the\ncoordinates of the pointer location, in surface-local coordinates.\n\nOn surface.attach requests to the pointer surface, hotspot_x and\nhotspot_y are decremented by the x and y parameters passed to the\nrequest. Attach must be confirmed by wl_surface.commit as usual.\n\nThe hotspot can also be updated by passing the currently set pointer\nsurface to this request with new values for hotspot_x and hotspot_y.\n\nThe current and pending input regions of the wl_surface are cleared,\nand wl_surface.set_input_region is ignored until the wl_surface is no\nlonger used as the cursor. When the use as a cursor ends, the current\nand pending input regions become undefined, and the wl_surface is\nunmapped.\n\nThis request gives the surface the role of a cursor. The role\nassigned by this request is the same as assigned by\nwl_pointer.set_cursor meaning the same surface can be\nused both as a wl_pointer cursor and a wp_tablet cursor. If the\nsurface already has another role, it raises a protocol error.\nThe surface may be used on multiple tablets and across multiple\nseats." ] pub unsafe fn zwp_tablet_tool_v1_set_cursor ( zwp_tablet_tool_v1 : * mut super :: zwp_tablet_tool_v1 :: zwp_tablet_tool_v1 , serial : u32 , surface : * mut super :: wl_surface :: wl_surface , hotspot_x : i32 , hotspot_y : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_tablet_tool_v1 as _ , 0u32 , serial , surface , hotspot_x , hotspot_y , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "destroy the tool object\n\nThis destroys the client's resource for this tool object." ] pub unsafe fn zwp_tablet_tool_v1_destroy ( zwp_tablet_tool_v1 : * mut super :: zwp_tablet_tool_v1 :: zwp_tablet_tool_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_tablet_tool_v1 as _ , 1u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_tablet_tool_v1 as _ ) ; } } # [ doc = "graphics tablet device\n\nThe wp_tablet interface represents one graphics tablet device. The\ntablet interface itself does not generate events; all events are\ngenerated by wp_tablet_tool objects when in proximity above a tablet.\n\nA tablet has a number of static characteristics, e.g. device name and\npid/vid. These capabilities are sent in an event sequence after the\nwp_tablet_seat.tablet_added event. This initial event sequence is\nterminated by a wp_tablet.done event." ] pub mod zwp_tablet_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_tablet_v1 { } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_tablet_v1_requests : [ wl_message ; 1 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_tablet_v1_events : [ wl_message ; 5 ] = [ wl_message { name : b"name\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"id\0" as * const u8 as * const c_char , signature : b"uu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"path\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"removed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_tablet_v1_interface : wl_interface = wl_interface { name : b"zwp_tablet_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_tablet_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zwp_tablet_v1_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_tablet_v1_listener { # [ doc = "tablet device name\n\nThis event is sent in the initial burst of events before the\nwp_tablet.done event." ] fn name ( & mut self , object : * mut zwp_tablet_v1 , name : * mut c_char ) { } # [ doc = "tablet device USB vendor/product id\n\nThis event is sent in the initial burst of events before the\nwp_tablet.done event." ] fn id ( & mut self , object : * mut zwp_tablet_v1 , vid : u32 , pid : u32 ) { } # [ doc = "path to the device\n\nA system-specific device path that indicates which device is behind\nthis wp_tablet. This information may be used to gather additional\ninformation about the device, e.g. through libwacom.\n\nA device may have more than one device path. If so, multiple\nwp_tablet.path events are sent. A device may be emulated and not\nhave a device path, and in that case this event will not be sent.\n\nThe format of the path is unspecified, it may be a device node, a\nsysfs path, or some other identifier. It is up to the client to\nidentify the string provided.\n\nThis event is sent in the initial burst of events before the\nwp_tablet.done event." ] fn path ( & mut self , object : * mut zwp_tablet_v1 , path : * mut c_char ) { } # [ doc = "tablet description events sequence complete\n\nThis event is sent immediately to signal the end of the initial\nburst of descriptive events. A client may consider the static\ndescription of the tablet to be complete and finalize initialization\nof the tablet." ] fn done ( & mut self , object : * mut zwp_tablet_v1 , ) { } # [ doc = "tablet removed event\n\nSent when the tablet has been removed from the system. When a tablet\nis removed, some tools may be removed.\n\nWhen this event is received, the client must wp_tablet.destroy\nthe object." ] fn removed ( & mut self , object : * mut zwp_tablet_v1 , ) { } } pub unsafe fn zwp_tablet_v1_set_user_data ( zwp_tablet_v1 : * mut super :: zwp_tablet_v1 :: zwp_tablet_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_tablet_v1 as _ , user_data ) ; } pub unsafe fn zwp_tablet_v1_get_user_data ( zwp_tablet_v1 : * mut super :: zwp_tablet_v1 :: zwp_tablet_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_tablet_v1 as _ ) ; } pub unsafe fn zwp_tablet_v1_get_version ( zwp_tablet_v1 : * mut super :: zwp_tablet_v1 :: zwp_tablet_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_tablet_v1 as _ ) ; } pub unsafe fn zwp_tablet_v1_add_listener ( zwp_tablet_v1 : * mut super :: zwp_tablet_v1 :: zwp_tablet_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_tablet_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_tablet_v1_add_rust_listener ( zwp_tablet_v1 : * mut super :: zwp_tablet_v1 :: zwp_tablet_v1 , listener : & dyn zwp_tablet_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_tablet_v1_add_listener ( zwp_tablet_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the tablet object\n\nThis destroys the client's resource for this tablet object." ] pub unsafe fn zwp_tablet_v1_destroy ( zwp_tablet_v1 : * mut super :: zwp_tablet_v1 :: zwp_tablet_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_tablet_v1 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_tablet_v1 as _ ) ; } } } pub mod pointer_gestures_unstable_v1 { use super :: wayland :: * ; use super :: xdg_shell :: * ; # [ doc = "touchpad gestures\n\nA global interface to provide semantic touchpad gestures for a given\npointer.\n\nTwo gestures are currently supported: swipe and zoom/rotate.\nAll gestures follow a three-stage cycle: begin, update, end and\nare identified by a unique id.\n\nWarning! The protocol described in this file is experimental and\nbackward incompatible changes may be made. Backward compatible changes\nmay be added together with the corresponding interface version bump.\nBackward incompatible changes are done by bumping the version number in\nthe protocol and interface names and resetting the interface version.\nOnce the protocol is to be declared stable, the 'z' prefix and the\nversion number in the protocol and interface names are removed and the\ninterface version number is reset." ] pub mod zwp_pointer_gestures_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_pointer_gestures_v1 { } static mut zwp_pointer_gestures_v1_requests_get_swipe_gesture_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: zwp_pointer_gesture_swipe_v1 :: zwp_pointer_gesture_swipe_v1_interface as * const wl_interface } , unsafe { & super :: wl_pointer :: wl_pointer_interface as * const wl_interface } , ] ; static mut zwp_pointer_gestures_v1_requests_get_pinch_gesture_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: zwp_pointer_gesture_pinch_v1 :: zwp_pointer_gesture_pinch_v1_interface as * const wl_interface } , unsafe { & super :: wl_pointer :: wl_pointer_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_pointer_gestures_v1_requests : [ wl_message ; 3 ] = [ wl_message { name : b"get_swipe_gesture\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zwp_pointer_gestures_v1_requests_get_swipe_gesture_types as * const _ } , } , wl_message { name : b"get_pinch_gesture\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zwp_pointer_gestures_v1_requests_get_pinch_gesture_types as * const _ } , } , wl_message { name : b"release\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_pointer_gestures_v1_interface : wl_interface = wl_interface { name : b"zwp_pointer_gestures_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 3 , requests : unsafe { & zwp_pointer_gestures_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_pointer_gestures_v1_listener { } pub unsafe fn zwp_pointer_gestures_v1_set_user_data ( zwp_pointer_gestures_v1 : * mut super :: zwp_pointer_gestures_v1 :: zwp_pointer_gestures_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_pointer_gestures_v1 as _ , user_data ) ; } pub unsafe fn zwp_pointer_gestures_v1_get_user_data ( zwp_pointer_gestures_v1 : * mut super :: zwp_pointer_gestures_v1 :: zwp_pointer_gestures_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_pointer_gestures_v1 as _ ) ; } pub unsafe fn zwp_pointer_gestures_v1_get_version ( zwp_pointer_gestures_v1 : * mut super :: zwp_pointer_gestures_v1 :: zwp_pointer_gestures_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_pointer_gestures_v1 as _ ) ; } pub unsafe fn zwp_pointer_gestures_v1_add_listener ( zwp_pointer_gestures_v1 : * mut super :: zwp_pointer_gestures_v1 :: zwp_pointer_gestures_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_pointer_gestures_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_pointer_gestures_v1_add_rust_listener ( zwp_pointer_gestures_v1 : * mut super :: zwp_pointer_gestures_v1 :: zwp_pointer_gestures_v1 , listener : & dyn zwp_pointer_gestures_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_pointer_gestures_v1_add_listener ( zwp_pointer_gestures_v1 as _ , fp as _ , op as _ ) == 0 ; } pub unsafe fn zwp_pointer_gestures_v1_destroy ( zwp_pointer_gestures_v1 : * mut super :: zwp_pointer_gestures_v1 :: zwp_pointer_gestures_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_pointer_gestures_v1 as _ ) ; } # [ doc = "get swipe gesture\n\nCreate a swipe gesture object. See the\nwl_pointer_gesture_swipe interface for details." ] pub unsafe fn zwp_pointer_gestures_v1_get_swipe_gesture ( zwp_pointer_gestures_v1 : * mut super :: zwp_pointer_gestures_v1 :: zwp_pointer_gestures_v1 , pointer : * mut super :: wl_pointer :: wl_pointer ) -> * mut super :: zwp_pointer_gesture_swipe_v1 :: zwp_pointer_gesture_swipe_v1 { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zwp_pointer_gestures_v1 as _ , 0u32 , & super :: zwp_pointer_gesture_swipe_v1 :: zwp_pointer_gesture_swipe_v1_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , pointer ) ; return r as _ ; } # [ doc = "get pinch gesture\n\nCreate a pinch gesture object. See the\nwl_pointer_gesture_pinch interface for details." ] pub unsafe fn zwp_pointer_gestures_v1_get_pinch_gesture ( zwp_pointer_gestures_v1 : * mut super :: zwp_pointer_gestures_v1 :: zwp_pointer_gestures_v1 , pointer : * mut super :: wl_pointer :: wl_pointer ) -> * mut super :: zwp_pointer_gesture_pinch_v1 :: zwp_pointer_gesture_pinch_v1 { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zwp_pointer_gestures_v1 as _ , 1u32 , & super :: zwp_pointer_gesture_pinch_v1 :: zwp_pointer_gesture_pinch_v1_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , pointer ) ; return r as _ ; } # [ doc = "destroy the pointer gesture object\n\nDestroy the pointer gesture object. Swipe and pinch objects created via this\ngesture object remain valid." ] pub unsafe fn zwp_pointer_gestures_v1_release ( zwp_pointer_gestures_v1 : * mut super :: zwp_pointer_gestures_v1 :: zwp_pointer_gestures_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_pointer_gestures_v1 as _ , 2u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_pointer_gestures_v1 as _ ) ; } } # [ doc = "a swipe gesture object\n\nA swipe gesture object notifies a client about a multi-finger swipe\ngesture detected on an indirect input device such as a touchpad.\nThe gesture is usually initiated by multiple fingers moving in the\nsame direction but once initiated the direction may change.\nThe precise conditions of when such a gesture is detected are\nimplementation-dependent.\n\nA gesture consists of three stages: begin, update (optional) and end.\nThere cannot be multiple simultaneous pinch or swipe gestures on a\nsame pointer/seat, how compositors prevent these situations is\nimplementation-dependent.\n\nA gesture may be cancelled by the compositor or the hardware.\nClients should not consider performing permanent or irreversible\nactions until the end of a gesture has been received." ] pub mod zwp_pointer_gesture_swipe_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_pointer_gesture_swipe_v1 { } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_pointer_gesture_swipe_v1_requests : [ wl_message ; 1 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; static mut zwp_pointer_gesture_swipe_v1_events_begin_types : [ * const wl_interface ; 4 ] = [ NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_pointer_gesture_swipe_v1_events : [ wl_message ; 3 ] = [ wl_message { name : b"begin\0" as * const u8 as * const c_char , signature : b"uuou\0" as * const u8 as * const c_char , types : unsafe { & zwp_pointer_gesture_swipe_v1_events_begin_types as * const _ } , } , wl_message { name : b"update\0" as * const u8 as * const c_char , signature : b"uff\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"end\0" as * const u8 as * const c_char , signature : b"uui\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_pointer_gesture_swipe_v1_interface : wl_interface = wl_interface { name : b"zwp_pointer_gesture_swipe_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwp_pointer_gesture_swipe_v1_requests as * const _ } , event_count : 3 , events : unsafe { & zwp_pointer_gesture_swipe_v1_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_pointer_gesture_swipe_v1_listener { # [ doc = "multi-finger swipe begin\n\nThis event is sent when a multi-finger swipe gesture is detected\non the device." ] fn begin ( & mut self , object : * mut zwp_pointer_gesture_swipe_v1 , serial : u32 , time : u32 , surface : * mut super :: wl_surface :: wl_surface , fingers : u32 ) { } # [ doc = "multi-finger swipe motion\n\nThis event is sent when a multi-finger swipe gesture changes the\nposition of the logical center.\n\nThe dx and dy coordinates are relative coordinates of the logical\ncenter of the gesture compared to the previous event." ] fn update ( & mut self , object : * mut zwp_pointer_gesture_swipe_v1 , time : u32 , dx : wl_fixed_t , dy : wl_fixed_t ) { } # [ doc = "multi-finger swipe end\n\nThis event is sent when a multi-finger swipe gesture ceases to\nbe valid. This may happen when one or more fingers are lifted or\nthe gesture is cancelled.\n\nWhen a gesture is cancelled, the client should undo state changes\ncaused by this gesture. What causes a gesture to be cancelled is\nimplementation-dependent." ] fn end ( & mut self , object : * mut zwp_pointer_gesture_swipe_v1 , serial : u32 , time : u32 , cancelled : i32 ) { } } pub unsafe fn zwp_pointer_gesture_swipe_v1_set_user_data ( zwp_pointer_gesture_swipe_v1 : * mut super :: zwp_pointer_gesture_swipe_v1 :: zwp_pointer_gesture_swipe_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_pointer_gesture_swipe_v1 as _ , user_data ) ; } pub unsafe fn zwp_pointer_gesture_swipe_v1_get_user_data ( zwp_pointer_gesture_swipe_v1 : * mut super :: zwp_pointer_gesture_swipe_v1 :: zwp_pointer_gesture_swipe_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_pointer_gesture_swipe_v1 as _ ) ; } pub unsafe fn zwp_pointer_gesture_swipe_v1_get_version ( zwp_pointer_gesture_swipe_v1 : * mut super :: zwp_pointer_gesture_swipe_v1 :: zwp_pointer_gesture_swipe_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_pointer_gesture_swipe_v1 as _ ) ; } pub unsafe fn zwp_pointer_gesture_swipe_v1_add_listener ( zwp_pointer_gesture_swipe_v1 : * mut super :: zwp_pointer_gesture_swipe_v1 :: zwp_pointer_gesture_swipe_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_pointer_gesture_swipe_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_pointer_gesture_swipe_v1_add_rust_listener ( zwp_pointer_gesture_swipe_v1 : * mut super :: zwp_pointer_gesture_swipe_v1 :: zwp_pointer_gesture_swipe_v1 , listener : & dyn zwp_pointer_gesture_swipe_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_pointer_gesture_swipe_v1_add_listener ( zwp_pointer_gesture_swipe_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the pointer swipe gesture object" ] pub unsafe fn zwp_pointer_gesture_swipe_v1_destroy ( zwp_pointer_gesture_swipe_v1 : * mut super :: zwp_pointer_gesture_swipe_v1 :: zwp_pointer_gesture_swipe_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_pointer_gesture_swipe_v1 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_pointer_gesture_swipe_v1 as _ ) ; } } # [ doc = "a pinch gesture object\n\nA pinch gesture object notifies a client about a multi-finger pinch\ngesture detected on an indirect input device such as a touchpad.\nThe gesture is usually initiated by multiple fingers moving towards\neach other or away from each other, or by two or more fingers rotating\naround a logical center of gravity. The precise conditions of when\nsuch a gesture is detected are implementation-dependent.\n\nA gesture consists of three stages: begin, update (optional) and end.\nThere cannot be multiple simultaneous pinch or swipe gestures on a\nsame pointer/seat, how compositors prevent these situations is\nimplementation-dependent.\n\nA gesture may be cancelled by the compositor or the hardware.\nClients should not consider performing permanent or irreversible\nactions until the end of a gesture has been received." ] pub mod zwp_pointer_gesture_pinch_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_pointer_gesture_pinch_v1 { } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_pointer_gesture_pinch_v1_requests : [ wl_message ; 1 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; static mut zwp_pointer_gesture_pinch_v1_events_begin_types : [ * const wl_interface ; 4 ] = [ NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_pointer_gesture_pinch_v1_events : [ wl_message ; 3 ] = [ wl_message { name : b"begin\0" as * const u8 as * const c_char , signature : b"uuou\0" as * const u8 as * const c_char , types : unsafe { & zwp_pointer_gesture_pinch_v1_events_begin_types as * const _ } , } , wl_message { name : b"update\0" as * const u8 as * const c_char , signature : b"uffff\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"end\0" as * const u8 as * const c_char , signature : b"uui\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_pointer_gesture_pinch_v1_interface : wl_interface = wl_interface { name : b"zwp_pointer_gesture_pinch_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwp_pointer_gesture_pinch_v1_requests as * const _ } , event_count : 3 , events : unsafe { & zwp_pointer_gesture_pinch_v1_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_pointer_gesture_pinch_v1_listener { # [ doc = "multi-finger pinch begin\n\nThis event is sent when a multi-finger pinch gesture is detected\non the device." ] fn begin ( & mut self , object : * mut zwp_pointer_gesture_pinch_v1 , serial : u32 , time : u32 , surface : * mut super :: wl_surface :: wl_surface , fingers : u32 ) { } # [ doc = "multi-finger pinch motion\n\nThis event is sent when a multi-finger pinch gesture changes the\nposition of the logical center, the rotation or the relative scale.\n\nThe dx and dy coordinates are relative coordinates in the\nsurface coordinate space of the logical center of the gesture.\n\nThe scale factor is an absolute scale compared to the\npointer_gesture_pinch.begin event, e.g. a scale of 2 means the fingers\nare now twice as far apart as on pointer_gesture_pinch.begin.\n\nThe rotation is the relative angle in degrees clockwise compared to the previous\npointer_gesture_pinch.begin or pointer_gesture_pinch.update event." ] fn update ( & mut self , object : * mut zwp_pointer_gesture_pinch_v1 , time : u32 , dx : wl_fixed_t , dy : wl_fixed_t , scale : wl_fixed_t , rotation : wl_fixed_t ) { } # [ doc = "multi-finger pinch end\n\nThis event is sent when a multi-finger pinch gesture ceases to\nbe valid. This may happen when one or more fingers are lifted or\nthe gesture is cancelled.\n\nWhen a gesture is cancelled, the client should undo state changes\ncaused by this gesture. What causes a gesture to be cancelled is\nimplementation-dependent." ] fn end ( & mut self , object : * mut zwp_pointer_gesture_pinch_v1 , serial : u32 , time : u32 , cancelled : i32 ) { } } pub unsafe fn zwp_pointer_gesture_pinch_v1_set_user_data ( zwp_pointer_gesture_pinch_v1 : * mut super :: zwp_pointer_gesture_pinch_v1 :: zwp_pointer_gesture_pinch_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_pointer_gesture_pinch_v1 as _ , user_data ) ; } pub unsafe fn zwp_pointer_gesture_pinch_v1_get_user_data ( zwp_pointer_gesture_pinch_v1 : * mut super :: zwp_pointer_gesture_pinch_v1 :: zwp_pointer_gesture_pinch_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_pointer_gesture_pinch_v1 as _ ) ; } pub unsafe fn zwp_pointer_gesture_pinch_v1_get_version ( zwp_pointer_gesture_pinch_v1 : * mut super :: zwp_pointer_gesture_pinch_v1 :: zwp_pointer_gesture_pinch_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_pointer_gesture_pinch_v1 as _ ) ; } pub unsafe fn zwp_pointer_gesture_pinch_v1_add_listener ( zwp_pointer_gesture_pinch_v1 : * mut super :: zwp_pointer_gesture_pinch_v1 :: zwp_pointer_gesture_pinch_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_pointer_gesture_pinch_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_pointer_gesture_pinch_v1_add_rust_listener ( zwp_pointer_gesture_pinch_v1 : * mut super :: zwp_pointer_gesture_pinch_v1 :: zwp_pointer_gesture_pinch_v1 , listener : & dyn zwp_pointer_gesture_pinch_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_pointer_gesture_pinch_v1_add_listener ( zwp_pointer_gesture_pinch_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the pinch gesture object" ] pub unsafe fn zwp_pointer_gesture_pinch_v1_destroy ( zwp_pointer_gesture_pinch_v1 : * mut super :: zwp_pointer_gesture_pinch_v1 :: zwp_pointer_gesture_pinch_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_pointer_gesture_pinch_v1 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_pointer_gesture_pinch_v1 as _ ) ; } } } pub mod xdg_foreign_unstable_v1 { use super :: wayland :: * ; use super :: xdg_shell :: * ; # [ doc = "interface for exporting surfaces\n\nA global interface used for exporting surfaces that can later be imported\nusing xdg_importer." ] pub mod zxdg_exporter_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zxdg_exporter_v1 { } static mut zxdg_exporter_v1_requests_export_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: zxdg_exported_v1 :: zxdg_exported_v1_interface as * const wl_interface } , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zxdg_exporter_v1_requests : [ wl_message ; 2 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"export\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zxdg_exporter_v1_requests_export_types as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zxdg_exporter_v1_interface : wl_interface = wl_interface { name : b"zxdg_exporter_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & zxdg_exporter_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait zxdg_exporter_v1_listener { } pub unsafe fn zxdg_exporter_v1_set_user_data ( zxdg_exporter_v1 : * mut super :: zxdg_exporter_v1 :: zxdg_exporter_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zxdg_exporter_v1 as _ , user_data ) ; } pub unsafe fn zxdg_exporter_v1_get_user_data ( zxdg_exporter_v1 : * mut super :: zxdg_exporter_v1 :: zxdg_exporter_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zxdg_exporter_v1 as _ ) ; } pub unsafe fn zxdg_exporter_v1_get_version ( zxdg_exporter_v1 : * mut super :: zxdg_exporter_v1 :: zxdg_exporter_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zxdg_exporter_v1 as _ ) ; } pub unsafe fn zxdg_exporter_v1_add_listener ( zxdg_exporter_v1 : * mut super :: zxdg_exporter_v1 :: zxdg_exporter_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zxdg_exporter_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zxdg_exporter_v1_add_rust_listener ( zxdg_exporter_v1 : * mut super :: zxdg_exporter_v1 :: zxdg_exporter_v1 , listener : & dyn zxdg_exporter_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zxdg_exporter_v1_add_listener ( zxdg_exporter_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the xdg_exporter object\n\nNotify the compositor that the xdg_exporter object will no longer be\nused." ] pub unsafe fn zxdg_exporter_v1_destroy ( zxdg_exporter_v1 : * mut super :: zxdg_exporter_v1 :: zxdg_exporter_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_exporter_v1 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zxdg_exporter_v1 as _ ) ; } # [ doc = "export a surface\n\nThe export request exports the passed surface so that it can later be\nimported via xdg_importer. When called, a new xdg_exported object will\nbe created and xdg_exported.handle will be sent immediately. See the\ncorresponding interface and event for details.\n\nA surface may be exported multiple times, and each exported handle may\nbe used to create a xdg_imported multiple times. Only xdg_surface\nsurfaces may be exported." ] pub unsafe fn zxdg_exporter_v1_export ( zxdg_exporter_v1 : * mut super :: zxdg_exporter_v1 :: zxdg_exporter_v1 , surface : * mut super :: wl_surface :: wl_surface ) -> * mut super :: zxdg_exported_v1 :: zxdg_exported_v1 { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zxdg_exporter_v1 as _ , 1u32 , & super :: zxdg_exported_v1 :: zxdg_exported_v1_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , surface ) ; return r as _ ; } } # [ doc = "interface for importing surfaces\n\nA global interface used for importing surfaces exported by xdg_exporter.\nWith this interface, a client can create a reference to a surface of\nanother client." ] pub mod zxdg_importer_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zxdg_importer_v1 { } static mut zxdg_importer_v1_requests_import_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: zxdg_imported_v1 :: zxdg_imported_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zxdg_importer_v1_requests : [ wl_message ; 2 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"import\0" as * const u8 as * const c_char , signature : b"ns\0" as * const u8 as * const c_char , types : unsafe { & zxdg_importer_v1_requests_import_types as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zxdg_importer_v1_interface : wl_interface = wl_interface { name : b"zxdg_importer_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & zxdg_importer_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait zxdg_importer_v1_listener { } pub unsafe fn zxdg_importer_v1_set_user_data ( zxdg_importer_v1 : * mut super :: zxdg_importer_v1 :: zxdg_importer_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zxdg_importer_v1 as _ , user_data ) ; } pub unsafe fn zxdg_importer_v1_get_user_data ( zxdg_importer_v1 : * mut super :: zxdg_importer_v1 :: zxdg_importer_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zxdg_importer_v1 as _ ) ; } pub unsafe fn zxdg_importer_v1_get_version ( zxdg_importer_v1 : * mut super :: zxdg_importer_v1 :: zxdg_importer_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zxdg_importer_v1 as _ ) ; } pub unsafe fn zxdg_importer_v1_add_listener ( zxdg_importer_v1 : * mut super :: zxdg_importer_v1 :: zxdg_importer_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zxdg_importer_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zxdg_importer_v1_add_rust_listener ( zxdg_importer_v1 : * mut super :: zxdg_importer_v1 :: zxdg_importer_v1 , listener : & dyn zxdg_importer_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zxdg_importer_v1_add_listener ( zxdg_importer_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the xdg_importer object\n\nNotify the compositor that the xdg_importer object will no longer be\nused." ] pub unsafe fn zxdg_importer_v1_destroy ( zxdg_importer_v1 : * mut super :: zxdg_importer_v1 :: zxdg_importer_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_importer_v1 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zxdg_importer_v1 as _ ) ; } # [ doc = "import a surface\n\nThe import request imports a surface from any client given a handle\nretrieved by exporting said surface using xdg_exporter.export. When\ncalled, a new xdg_imported object will be created. This new object\nrepresents the imported surface, and the importing client can\nmanipulate its relationship using it. See xdg_imported for details." ] pub unsafe fn zxdg_importer_v1_import ( zxdg_importer_v1 : * mut super :: zxdg_importer_v1 :: zxdg_importer_v1 , handle : * mut c_char ) -> * mut super :: zxdg_imported_v1 :: zxdg_imported_v1 { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zxdg_importer_v1 as _ , 1u32 , & super :: zxdg_imported_v1 :: zxdg_imported_v1_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , handle ) ; return r as _ ; } } # [ doc = "an exported surface handle\n\nA xdg_exported object represents an exported reference to a surface. The\nexported surface may be referenced as long as the xdg_exported object not\ndestroyed. Destroying the xdg_exported invalidates any relationship the\nimporter may have established using xdg_imported." ] pub mod zxdg_exported_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zxdg_exported_v1 { } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zxdg_exported_v1_requests : [ wl_message ; 1 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zxdg_exported_v1_events : [ wl_message ; 1 ] = [ wl_message { name : b"handle\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zxdg_exported_v1_interface : wl_interface = wl_interface { name : b"zxdg_exported_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zxdg_exported_v1_requests as * const _ } , event_count : 1 , events : unsafe { & zxdg_exported_v1_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zxdg_exported_v1_listener { # [ doc = "the exported surface handle\n\nThe handle event contains the unique handle of this exported surface\nreference. It may be shared with any client, which then can use it to\nimport the surface by calling xdg_importer.import. A handle may be\nused to import the surface multiple times." ] fn handle ( & mut self , object : * mut zxdg_exported_v1 , handle : * mut c_char ) { } } pub unsafe fn zxdg_exported_v1_set_user_data ( zxdg_exported_v1 : * mut super :: zxdg_exported_v1 :: zxdg_exported_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zxdg_exported_v1 as _ , user_data ) ; } pub unsafe fn zxdg_exported_v1_get_user_data ( zxdg_exported_v1 : * mut super :: zxdg_exported_v1 :: zxdg_exported_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zxdg_exported_v1 as _ ) ; } pub unsafe fn zxdg_exported_v1_get_version ( zxdg_exported_v1 : * mut super :: zxdg_exported_v1 :: zxdg_exported_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zxdg_exported_v1 as _ ) ; } pub unsafe fn zxdg_exported_v1_add_listener ( zxdg_exported_v1 : * mut super :: zxdg_exported_v1 :: zxdg_exported_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zxdg_exported_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zxdg_exported_v1_add_rust_listener ( zxdg_exported_v1 : * mut super :: zxdg_exported_v1 :: zxdg_exported_v1 , listener : & dyn zxdg_exported_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zxdg_exported_v1_add_listener ( zxdg_exported_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "unexport the exported surface\n\nRevoke the previously exported surface. This invalidates any\nrelationship the importer may have set up using the xdg_imported created\ngiven the handle sent via xdg_exported.handle." ] pub unsafe fn zxdg_exported_v1_destroy ( zxdg_exported_v1 : * mut super :: zxdg_exported_v1 :: zxdg_exported_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_exported_v1 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zxdg_exported_v1 as _ ) ; } } # [ doc = "an imported surface handle\n\nA xdg_imported object represents an imported reference to surface exported\nby some client. A client can use this interface to manipulate\nrelationships between its own surfaces and the imported surface." ] pub mod zxdg_imported_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zxdg_imported_v1 { } static mut zxdg_imported_v1_requests_set_parent_of_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zxdg_imported_v1_requests : [ wl_message ; 2 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_parent_of\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zxdg_imported_v1_requests_set_parent_of_types as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zxdg_imported_v1_events : [ wl_message ; 1 ] = [ wl_message { name : b"destroyed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zxdg_imported_v1_interface : wl_interface = wl_interface { name : b"zxdg_imported_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & zxdg_imported_v1_requests as * const _ } , event_count : 1 , events : unsafe { & zxdg_imported_v1_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zxdg_imported_v1_listener { # [ doc = "the imported surface handle has been destroyed\n\nThe imported surface handle has been destroyed and any relationship set\nup has been invalidated. This may happen for various reasons, for\nexample if the exported surface or the exported surface handle has been\ndestroyed, if the handle used for importing was invalid." ] fn destroyed ( & mut self , object : * mut zxdg_imported_v1 , ) { } } pub unsafe fn zxdg_imported_v1_set_user_data ( zxdg_imported_v1 : * mut super :: zxdg_imported_v1 :: zxdg_imported_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zxdg_imported_v1 as _ , user_data ) ; } pub unsafe fn zxdg_imported_v1_get_user_data ( zxdg_imported_v1 : * mut super :: zxdg_imported_v1 :: zxdg_imported_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zxdg_imported_v1 as _ ) ; } pub unsafe fn zxdg_imported_v1_get_version ( zxdg_imported_v1 : * mut super :: zxdg_imported_v1 :: zxdg_imported_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zxdg_imported_v1 as _ ) ; } pub unsafe fn zxdg_imported_v1_add_listener ( zxdg_imported_v1 : * mut super :: zxdg_imported_v1 :: zxdg_imported_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zxdg_imported_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zxdg_imported_v1_add_rust_listener ( zxdg_imported_v1 : * mut super :: zxdg_imported_v1 :: zxdg_imported_v1 , listener : & dyn zxdg_imported_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zxdg_imported_v1_add_listener ( zxdg_imported_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the xdg_imported object\n\nNotify the compositor that it will no longer use the xdg_imported\nobject. Any relationship that may have been set up will at this point\nbe invalidated." ] pub unsafe fn zxdg_imported_v1_destroy ( zxdg_imported_v1 : * mut super :: zxdg_imported_v1 :: zxdg_imported_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_imported_v1 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zxdg_imported_v1 as _ ) ; } # [ doc = "set as the parent of some surface\n\nSet the imported surface as the parent of some surface of the client.\nThe passed surface must be a toplevel xdg_surface. Calling this function\nsets up a surface to surface relation with the same stacking and positioning\nsemantics as xdg_surface.set_parent." ] pub unsafe fn zxdg_imported_v1_set_parent_of ( zxdg_imported_v1 : * mut super :: zxdg_imported_v1 :: zxdg_imported_v1 , surface : * mut super :: wl_surface :: wl_surface ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_imported_v1 as _ , 1u32 , surface , std :: ptr :: null :: < c_void > ( ) ) ; } } } pub mod xdg_foreign_unstable_v2 { use super :: wayland :: * ; use super :: xdg_shell :: * ; # [ doc = "interface for exporting surfaces\n\nA global interface used for exporting surfaces that can later be imported\nusing xdg_importer." ] pub mod zxdg_exporter_v2 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zxdg_exporter_v2 { } static mut zxdg_exporter_v2_requests_export_toplevel_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: zxdg_exported_v2 :: zxdg_exported_v2_interface as * const wl_interface } , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zxdg_exporter_v2_requests : [ wl_message ; 2 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"export_toplevel\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zxdg_exporter_v2_requests_export_toplevel_types as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zxdg_exporter_v2_interface : wl_interface = wl_interface { name : b"zxdg_exporter_v2\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & zxdg_exporter_v2_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait zxdg_exporter_v2_listener { } pub unsafe fn zxdg_exporter_v2_set_user_data ( zxdg_exporter_v2 : * mut super :: zxdg_exporter_v2 :: zxdg_exporter_v2 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zxdg_exporter_v2 as _ , user_data ) ; } pub unsafe fn zxdg_exporter_v2_get_user_data ( zxdg_exporter_v2 : * mut super :: zxdg_exporter_v2 :: zxdg_exporter_v2 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zxdg_exporter_v2 as _ ) ; } pub unsafe fn zxdg_exporter_v2_get_version ( zxdg_exporter_v2 : * mut super :: zxdg_exporter_v2 :: zxdg_exporter_v2 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zxdg_exporter_v2 as _ ) ; } pub unsafe fn zxdg_exporter_v2_add_listener ( zxdg_exporter_v2 : * mut super :: zxdg_exporter_v2 :: zxdg_exporter_v2 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zxdg_exporter_v2 as _ , listener as _ , data as _ ) ; } pub unsafe fn zxdg_exporter_v2_add_rust_listener ( zxdg_exporter_v2 : * mut super :: zxdg_exporter_v2 :: zxdg_exporter_v2 , listener : & dyn zxdg_exporter_v2_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zxdg_exporter_v2_add_listener ( zxdg_exporter_v2 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the xdg_exporter object\n\nNotify the compositor that the xdg_exporter object will no longer be\nused." ] pub unsafe fn zxdg_exporter_v2_destroy ( zxdg_exporter_v2 : * mut super :: zxdg_exporter_v2 :: zxdg_exporter_v2 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_exporter_v2 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zxdg_exporter_v2 as _ ) ; } # [ doc = "export a toplevel surface\n\nThe export_toplevel request exports the passed surface so that it can later be\nimported via xdg_importer. When called, a new xdg_exported object will\nbe created and xdg_exported.handle will be sent immediately. See the\ncorresponding interface and event for details.\n\nA surface may be exported multiple times, and each exported handle may\nbe used to create a xdg_imported multiple times. Only xdg_toplevel\nequivalent surfaces may be exported." ] pub unsafe fn zxdg_exporter_v2_export_toplevel ( zxdg_exporter_v2 : * mut super :: zxdg_exporter_v2 :: zxdg_exporter_v2 , surface : * mut super :: wl_surface :: wl_surface ) -> * mut super :: zxdg_exported_v2 :: zxdg_exported_v2 { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zxdg_exporter_v2 as _ , 1u32 , & super :: zxdg_exported_v2 :: zxdg_exported_v2_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , surface ) ; return r as _ ; } } # [ doc = "interface for importing surfaces\n\nA global interface used for importing surfaces exported by xdg_exporter.\nWith this interface, a client can create a reference to a surface of\nanother client." ] pub mod zxdg_importer_v2 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zxdg_importer_v2 { } static mut zxdg_importer_v2_requests_import_toplevel_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: zxdg_imported_v2 :: zxdg_imported_v2_interface as * const wl_interface } , NULLPTR as * const wl_interface , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zxdg_importer_v2_requests : [ wl_message ; 2 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"import_toplevel\0" as * const u8 as * const c_char , signature : b"ns\0" as * const u8 as * const c_char , types : unsafe { & zxdg_importer_v2_requests_import_toplevel_types as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zxdg_importer_v2_interface : wl_interface = wl_interface { name : b"zxdg_importer_v2\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & zxdg_importer_v2_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait zxdg_importer_v2_listener { } pub unsafe fn zxdg_importer_v2_set_user_data ( zxdg_importer_v2 : * mut super :: zxdg_importer_v2 :: zxdg_importer_v2 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zxdg_importer_v2 as _ , user_data ) ; } pub unsafe fn zxdg_importer_v2_get_user_data ( zxdg_importer_v2 : * mut super :: zxdg_importer_v2 :: zxdg_importer_v2 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zxdg_importer_v2 as _ ) ; } pub unsafe fn zxdg_importer_v2_get_version ( zxdg_importer_v2 : * mut super :: zxdg_importer_v2 :: zxdg_importer_v2 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zxdg_importer_v2 as _ ) ; } pub unsafe fn zxdg_importer_v2_add_listener ( zxdg_importer_v2 : * mut super :: zxdg_importer_v2 :: zxdg_importer_v2 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zxdg_importer_v2 as _ , listener as _ , data as _ ) ; } pub unsafe fn zxdg_importer_v2_add_rust_listener ( zxdg_importer_v2 : * mut super :: zxdg_importer_v2 :: zxdg_importer_v2 , listener : & dyn zxdg_importer_v2_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zxdg_importer_v2_add_listener ( zxdg_importer_v2 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the xdg_importer object\n\nNotify the compositor that the xdg_importer object will no longer be\nused." ] pub unsafe fn zxdg_importer_v2_destroy ( zxdg_importer_v2 : * mut super :: zxdg_importer_v2 :: zxdg_importer_v2 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_importer_v2 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zxdg_importer_v2 as _ ) ; } # [ doc = "import a toplevel surface\n\nThe import_toplevel request imports a surface from any client given a handle\nretrieved by exporting said surface using xdg_exporter.export_toplevel.\nWhen called, a new xdg_imported object will be created. This new object\nrepresents the imported surface, and the importing client can\nmanipulate its relationship using it. See xdg_imported for details." ] pub unsafe fn zxdg_importer_v2_import_toplevel ( zxdg_importer_v2 : * mut super :: zxdg_importer_v2 :: zxdg_importer_v2 , handle : * mut c_char ) -> * mut super :: zxdg_imported_v2 :: zxdg_imported_v2 { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zxdg_importer_v2 as _ , 1u32 , & super :: zxdg_imported_v2 :: zxdg_imported_v2_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , handle ) ; return r as _ ; } } # [ doc = "an exported surface handle\n\nA xdg_exported object represents an exported reference to a surface. The\nexported surface may be referenced as long as the xdg_exported object not\ndestroyed. Destroying the xdg_exported invalidates any relationship the\nimporter may have established using xdg_imported." ] pub mod zxdg_exported_v2 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zxdg_exported_v2 { } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zxdg_exported_v2_requests : [ wl_message ; 1 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zxdg_exported_v2_events : [ wl_message ; 1 ] = [ wl_message { name : b"handle\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zxdg_exported_v2_interface : wl_interface = wl_interface { name : b"zxdg_exported_v2\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zxdg_exported_v2_requests as * const _ } , event_count : 1 , events : unsafe { & zxdg_exported_v2_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zxdg_exported_v2_listener { # [ doc = "the exported surface handle\n\nThe handle event contains the unique handle of this exported surface\nreference. It may be shared with any client, which then can use it to\nimport the surface by calling xdg_importer.import_toplevel. A handle\nmay be used to import the surface multiple times." ] fn handle ( & mut self , object : * mut zxdg_exported_v2 , handle : * mut c_char ) { } } pub unsafe fn zxdg_exported_v2_set_user_data ( zxdg_exported_v2 : * mut super :: zxdg_exported_v2 :: zxdg_exported_v2 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zxdg_exported_v2 as _ , user_data ) ; } pub unsafe fn zxdg_exported_v2_get_user_data ( zxdg_exported_v2 : * mut super :: zxdg_exported_v2 :: zxdg_exported_v2 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zxdg_exported_v2 as _ ) ; } pub unsafe fn zxdg_exported_v2_get_version ( zxdg_exported_v2 : * mut super :: zxdg_exported_v2 :: zxdg_exported_v2 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zxdg_exported_v2 as _ ) ; } pub unsafe fn zxdg_exported_v2_add_listener ( zxdg_exported_v2 : * mut super :: zxdg_exported_v2 :: zxdg_exported_v2 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zxdg_exported_v2 as _ , listener as _ , data as _ ) ; } pub unsafe fn zxdg_exported_v2_add_rust_listener ( zxdg_exported_v2 : * mut super :: zxdg_exported_v2 :: zxdg_exported_v2 , listener : & dyn zxdg_exported_v2_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zxdg_exported_v2_add_listener ( zxdg_exported_v2 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "unexport the exported surface\n\nRevoke the previously exported surface. This invalidates any\nrelationship the importer may have set up using the xdg_imported created\ngiven the handle sent via xdg_exported.handle." ] pub unsafe fn zxdg_exported_v2_destroy ( zxdg_exported_v2 : * mut super :: zxdg_exported_v2 :: zxdg_exported_v2 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_exported_v2 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zxdg_exported_v2 as _ ) ; } } # [ doc = "an imported surface handle\n\nA xdg_imported object represents an imported reference to surface exported\nby some client. A client can use this interface to manipulate\nrelationships between its own surfaces and the imported surface." ] pub mod zxdg_imported_v2 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zxdg_imported_v2 { } static mut zxdg_imported_v2_requests_set_parent_of_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zxdg_imported_v2_requests : [ wl_message ; 2 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_parent_of\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zxdg_imported_v2_requests_set_parent_of_types as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zxdg_imported_v2_events : [ wl_message ; 1 ] = [ wl_message { name : b"destroyed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zxdg_imported_v2_interface : wl_interface = wl_interface { name : b"zxdg_imported_v2\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & zxdg_imported_v2_requests as * const _ } , event_count : 1 , events : unsafe { & zxdg_imported_v2_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zxdg_imported_v2_listener { # [ doc = "the imported surface handle has been destroyed\n\nThe imported surface handle has been destroyed and any relationship set\nup has been invalidated. This may happen for various reasons, for\nexample if the exported surface or the exported surface handle has been\ndestroyed, if the handle used for importing was invalid." ] fn destroyed ( & mut self , object : * mut zxdg_imported_v2 , ) { } } pub unsafe fn zxdg_imported_v2_set_user_data ( zxdg_imported_v2 : * mut super :: zxdg_imported_v2 :: zxdg_imported_v2 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zxdg_imported_v2 as _ , user_data ) ; } pub unsafe fn zxdg_imported_v2_get_user_data ( zxdg_imported_v2 : * mut super :: zxdg_imported_v2 :: zxdg_imported_v2 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zxdg_imported_v2 as _ ) ; } pub unsafe fn zxdg_imported_v2_get_version ( zxdg_imported_v2 : * mut super :: zxdg_imported_v2 :: zxdg_imported_v2 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zxdg_imported_v2 as _ ) ; } pub unsafe fn zxdg_imported_v2_add_listener ( zxdg_imported_v2 : * mut super :: zxdg_imported_v2 :: zxdg_imported_v2 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zxdg_imported_v2 as _ , listener as _ , data as _ ) ; } pub unsafe fn zxdg_imported_v2_add_rust_listener ( zxdg_imported_v2 : * mut super :: zxdg_imported_v2 :: zxdg_imported_v2 , listener : & dyn zxdg_imported_v2_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zxdg_imported_v2_add_listener ( zxdg_imported_v2 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the xdg_imported object\n\nNotify the compositor that it will no longer use the xdg_imported\nobject. Any relationship that may have been set up will at this point\nbe invalidated." ] pub unsafe fn zxdg_imported_v2_destroy ( zxdg_imported_v2 : * mut super :: zxdg_imported_v2 :: zxdg_imported_v2 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_imported_v2 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zxdg_imported_v2 as _ ) ; } # [ doc = "set as the parent of some surface\n\nSet the imported surface as the parent of some surface of the client.\nThe passed surface must be a xdg_toplevel equivalent. Calling this\nfunction sets up a surface to surface relation with the same stacking\nand positioning semantics as xdg_toplevel.set_parent." ] pub unsafe fn zxdg_imported_v2_set_parent_of ( zxdg_imported_v2 : * mut super :: zxdg_imported_v2 :: zxdg_imported_v2 , surface : * mut super :: wl_surface :: wl_surface ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_imported_v2 as _ , 1u32 , surface , std :: ptr :: null :: < c_void > ( ) ) ; } } } pub mod input_method_unstable_v1 { use super :: wayland :: * ; use super :: xdg_shell :: * ; # [ doc = "input method context\n\nCorresponds to a text input on the input method side. An input method context\nis created on text input activation on the input method side. It allows\nreceiving information about the text input from the application via events.\nInput method contexts do not keep state after deactivation and should be\ndestroyed after deactivation is handled.\n\nText is generally UTF-8 encoded, indices and lengths are in bytes.\n\nSerials are used to synchronize the state between the text input and\nan input method. New serials are sent by the text input in the\ncommit_state request and are used by the input method to indicate\nthe known text input state in events like preedit_string, commit_string,\nand keysym. The text input can then ignore events from the input method\nwhich are based on an outdated state (for example after a reset).\n\nWarning! The protocol described in this file is experimental and\nbackward incompatible changes may be made. Backward compatible changes\nmay be added together with the corresponding interface version bump.\nBackward incompatible changes are done by bumping the version number in\nthe protocol and interface names and resetting the interface version.\nOnce the protocol is to be declared stable, the 'z' prefix and the\nversion number in the protocol and interface names are removed and the\ninterface version number is reset." ] pub mod zwp_input_method_context_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_input_method_context_v1 { } static mut zwp_input_method_context_v1_requests_grab_keyboard_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: wl_keyboard :: wl_keyboard_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_input_method_context_v1_requests : [ wl_message ; 14 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"commit_string\0" as * const u8 as * const c_char , signature : b"us\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"preedit_string\0" as * const u8 as * const c_char , signature : b"uss\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"preedit_styling\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"preedit_cursor\0" as * const u8 as * const c_char , signature : b"i\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"delete_surrounding_text\0" as * const u8 as * const c_char , signature : b"iu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"cursor_position\0" as * const u8 as * const c_char , signature : b"ii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers_map\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"keysym\0" as * const u8 as * const c_char , signature : b"uuuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"grab_keyboard\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwp_input_method_context_v1_requests_grab_keyboard_types as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"language\0" as * const u8 as * const c_char , signature : b"us\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"text_direction\0" as * const u8 as * const c_char , signature : b"uu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_input_method_context_v1_events : [ wl_message ; 6 ] = [ wl_message { name : b"surrounding_text\0" as * const u8 as * const c_char , signature : b"suu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"reset\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"content_type\0" as * const u8 as * const c_char , signature : b"uu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"invoke_action\0" as * const u8 as * const c_char , signature : b"uu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"commit_state\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"preferred_language\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_input_method_context_v1_interface : wl_interface = wl_interface { name : b"zwp_input_method_context_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 14 , requests : unsafe { & zwp_input_method_context_v1_requests as * const _ } , event_count : 6 , events : unsafe { & zwp_input_method_context_v1_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_input_method_context_v1_listener { # [ doc = "surrounding text event\n\nThe plain surrounding text around the input position. Cursor is the\nposition in bytes within the surrounding text relative to the beginning\nof the text. Anchor is the position in bytes of the selection anchor\nwithin the surrounding text relative to the beginning of the text. If\nthere is no selected text then anchor is the same as cursor." ] fn surrounding_text ( & mut self , object : * mut zwp_input_method_context_v1 , text : * mut c_char , cursor : u32 , anchor : u32 ) { } # [ doc = "" ] fn reset ( & mut self , object : * mut zwp_input_method_context_v1 , ) { } # [ doc = "" ] fn content_type ( & mut self , object : * mut zwp_input_method_context_v1 , hint : u32 , purpose : u32 ) { } # [ doc = "" ] fn invoke_action ( & mut self , object : * mut zwp_input_method_context_v1 , button : u32 , index : u32 ) { } # [ doc = "" ] fn commit_state ( & mut self , object : * mut zwp_input_method_context_v1 , serial : u32 ) { } # [ doc = "" ] fn preferred_language ( & mut self , object : * mut zwp_input_method_context_v1 , language : * mut c_char ) { } } pub unsafe fn zwp_input_method_context_v1_set_user_data ( zwp_input_method_context_v1 : * mut super :: zwp_input_method_context_v1 :: zwp_input_method_context_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_input_method_context_v1 as _ , user_data ) ; } pub unsafe fn zwp_input_method_context_v1_get_user_data ( zwp_input_method_context_v1 : * mut super :: zwp_input_method_context_v1 :: zwp_input_method_context_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_input_method_context_v1 as _ ) ; } pub unsafe fn zwp_input_method_context_v1_get_version ( zwp_input_method_context_v1 : * mut super :: zwp_input_method_context_v1 :: zwp_input_method_context_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_input_method_context_v1 as _ ) ; } pub unsafe fn zwp_input_method_context_v1_add_listener ( zwp_input_method_context_v1 : * mut super :: zwp_input_method_context_v1 :: zwp_input_method_context_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_input_method_context_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_input_method_context_v1_add_rust_listener ( zwp_input_method_context_v1 : * mut super :: zwp_input_method_context_v1 :: zwp_input_method_context_v1 , listener : & dyn zwp_input_method_context_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_input_method_context_v1_add_listener ( zwp_input_method_context_v1 as _ , fp as _ , op as _ ) == 0 ; } pub unsafe fn zwp_input_method_context_v1_destroy ( zwp_input_method_context_v1 : * mut super :: zwp_input_method_context_v1 :: zwp_input_method_context_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_input_method_context_v1 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_input_method_context_v1 as _ ) ; } # [ doc = "commit string\n\nSend the commit string text for insertion to the application.\n\nThe text to commit could be either just a single character after a key\npress or the result of some composing (pre-edit). It could be also an\nempty text when some text should be removed (see\ndelete_surrounding_text) or when the input cursor should be moved (see\ncursor_position).\n\nAny previously set composing text will be removed." ] pub unsafe fn zwp_input_method_context_v1_commit_string ( zwp_input_method_context_v1 : * mut super :: zwp_input_method_context_v1 :: zwp_input_method_context_v1 , serial : u32 , text : * mut c_char ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_input_method_context_v1 as _ , 1u32 , serial , text , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "pre-edit string\n\nSend the pre-edit string text to the application text input.\n\nThe commit text can be used to replace the pre-edit text on reset (for\nexample on unfocus).\n\nPreviously sent preedit_style and preedit_cursor requests are also\nprocessed by the text_input." ] pub unsafe fn zwp_input_method_context_v1_preedit_string ( zwp_input_method_context_v1 : * mut super :: zwp_input_method_context_v1 :: zwp_input_method_context_v1 , serial : u32 , text : * mut c_char , commit : * mut c_char ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_input_method_context_v1 as _ , 2u32 , serial , text , commit , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "pre-edit styling\n\nSet the styling information on composing text. The style is applied for\nlength in bytes from index relative to the beginning of\nthe composing text (as byte offset). Multiple styles can\nbe applied to a composing text.\n\nThis request should be sent before sending a preedit_string request." ] pub unsafe fn zwp_input_method_context_v1_preedit_styling ( zwp_input_method_context_v1 : * mut super :: zwp_input_method_context_v1 :: zwp_input_method_context_v1 , index : u32 , length : u32 , style : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_input_method_context_v1 as _ , 3u32 , index , length , style , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "pre-edit cursor\n\nSet the cursor position inside the composing text (as byte offset)\nrelative to the start of the composing text.\n\nWhen index is negative no cursor should be displayed.\n\nThis request should be sent before sending a preedit_string request." ] pub unsafe fn zwp_input_method_context_v1_preedit_cursor ( zwp_input_method_context_v1 : * mut super :: zwp_input_method_context_v1 :: zwp_input_method_context_v1 , index : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_input_method_context_v1 as _ , 4u32 , index , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "delete text\n\nRemove the surrounding text.\n\nThis request will be handled on the text_input side directly following\na commit_string request." ] pub unsafe fn zwp_input_method_context_v1_delete_surrounding_text ( zwp_input_method_context_v1 : * mut super :: zwp_input_method_context_v1 :: zwp_input_method_context_v1 , index : i32 , length : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_input_method_context_v1 as _ , 5u32 , index , length , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set cursor to a new position\n\nSet the cursor and anchor to a new position. Index is the new cursor\nposition in bytes (when >= 0 this is relative to the end of the inserted text,\notherwise it is relative to the beginning of the inserted text). Anchor is\nthe new anchor position in bytes (when >= 0 this is relative to the end of the\ninserted text, otherwise it is relative to the beginning of the inserted\ntext). When there should be no selected text, anchor should be the same\nas index.\n\nThis request will be handled on the text_input side directly following\na commit_string request." ] pub unsafe fn zwp_input_method_context_v1_cursor_position ( zwp_input_method_context_v1 : * mut super :: zwp_input_method_context_v1 :: zwp_input_method_context_v1 , index : i32 , anchor : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_input_method_context_v1 as _ , 6u32 , index , anchor , std :: ptr :: null :: < c_void > ( ) ) ; } pub unsafe fn zwp_input_method_context_v1_modifiers_map ( zwp_input_method_context_v1 : * mut super :: zwp_input_method_context_v1 :: zwp_input_method_context_v1 , map : * mut wl_array ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_input_method_context_v1 as _ , 7u32 , map , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "keysym\n\nNotify when a key event was sent. Key events should not be used for\nnormal text input operations, which should be done with commit_string,\ndelete_surrounding_text, etc. The key event follows the wl_keyboard key\nevent convention. Sym is an XKB keysym, state is a wl_keyboard key_state." ] pub unsafe fn zwp_input_method_context_v1_keysym ( zwp_input_method_context_v1 : * mut super :: zwp_input_method_context_v1 :: zwp_input_method_context_v1 , serial : u32 , time : u32 , sym : u32 , state : u32 , modifiers : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_input_method_context_v1 as _ , 8u32 , serial , time , sym , state , modifiers , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "grab hardware keyboard\n\nAllow an input method to receive hardware keyboard input and process\nkey events to generate text events (with pre-edit) over the wire. This\nallows input methods which compose multiple key events for inputting\ntext like it is done for CJK languages." ] pub unsafe fn zwp_input_method_context_v1_grab_keyboard ( zwp_input_method_context_v1 : * mut super :: zwp_input_method_context_v1 :: zwp_input_method_context_v1 ) -> * mut super :: wl_keyboard :: wl_keyboard { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zwp_input_method_context_v1 as _ , 9u32 , & super :: wl_keyboard :: wl_keyboard_interface as * const _ , std :: ptr :: null :: < c_void > ( ) ) ; return r as _ ; } # [ doc = "forward key event\n\nForward a wl_keyboard::key event to the client that was not processed\nby the input method itself. Should be used when filtering key events\nwith grab_keyboard.  The arguments should be the ones from the\nwl_keyboard::key event.\n\nFor generating custom key events use the keysym request instead." ] pub unsafe fn zwp_input_method_context_v1_key ( zwp_input_method_context_v1 : * mut super :: zwp_input_method_context_v1 :: zwp_input_method_context_v1 , serial : u32 , time : u32 , key : u32 , state : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_input_method_context_v1 as _ , 10u32 , serial , time , key , state , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "forward modifiers event\n\nForward a wl_keyboard::modifiers event to the client that was not\nprocessed by the input method itself.  Should be used when filtering\nkey events with grab_keyboard. The arguments should be the ones\nfrom the wl_keyboard::modifiers event." ] pub unsafe fn zwp_input_method_context_v1_modifiers ( zwp_input_method_context_v1 : * mut super :: zwp_input_method_context_v1 :: zwp_input_method_context_v1 , serial : u32 , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_input_method_context_v1 as _ , 11u32 , serial , mods_depressed , mods_latched , mods_locked , group , std :: ptr :: null :: < c_void > ( ) ) ; } pub unsafe fn zwp_input_method_context_v1_language ( zwp_input_method_context_v1 : * mut super :: zwp_input_method_context_v1 :: zwp_input_method_context_v1 , serial : u32 , language : * mut c_char ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_input_method_context_v1 as _ , 12u32 , serial , language , std :: ptr :: null :: < c_void > ( ) ) ; } pub unsafe fn zwp_input_method_context_v1_text_direction ( zwp_input_method_context_v1 : * mut super :: zwp_input_method_context_v1 :: zwp_input_method_context_v1 , serial : u32 , direction : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_input_method_context_v1 as _ , 13u32 , serial , direction , std :: ptr :: null :: < c_void > ( ) ) ; } } # [ doc = "input method\n\nAn input method object is responsible for composing text in response to\ninput from hardware or virtual keyboards. There is one input method\nobject per seat. On activate there is a new input method context object\ncreated which allows the input method to communicate with the text input." ] pub mod zwp_input_method_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_input_method_v1 { } static mut zwp_input_method_v1_events_activate_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: zwp_input_method_context_v1 :: zwp_input_method_context_v1_interface as * const wl_interface } , ] ; static mut zwp_input_method_v1_events_deactivate_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: zwp_input_method_context_v1 :: zwp_input_method_context_v1_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_input_method_v1_events : [ wl_message ; 2 ] = [ wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwp_input_method_v1_events_activate_types as * const _ } , } , wl_message { name : b"deactivate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwp_input_method_v1_events_deactivate_types as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_input_method_v1_interface : wl_interface = wl_interface { name : b"zwp_input_method_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 0 , requests : NULLPTR as * const wl_message , event_count : 2 , events : unsafe { & zwp_input_method_v1_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_input_method_v1_listener { # [ doc = "activate event\n\nA text input was activated. Creates an input method context object\nwhich allows communication with the text input." ] fn activate ( & mut self , object : * mut zwp_input_method_v1 , id : * mut super :: zwp_input_method_context_v1 :: zwp_input_method_context_v1 ) { } # [ doc = "deactivate event\n\nThe text input corresponding to the context argument was deactivated.\nThe input method context should be destroyed after deactivation is\nhandled." ] fn deactivate ( & mut self , object : * mut zwp_input_method_v1 , context : * mut super :: zwp_input_method_context_v1 :: zwp_input_method_context_v1 ) { } } pub unsafe fn zwp_input_method_v1_set_user_data ( zwp_input_method_v1 : * mut super :: zwp_input_method_v1 :: zwp_input_method_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_input_method_v1 as _ , user_data ) ; } pub unsafe fn zwp_input_method_v1_get_user_data ( zwp_input_method_v1 : * mut super :: zwp_input_method_v1 :: zwp_input_method_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_input_method_v1 as _ ) ; } pub unsafe fn zwp_input_method_v1_get_version ( zwp_input_method_v1 : * mut super :: zwp_input_method_v1 :: zwp_input_method_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_input_method_v1 as _ ) ; } pub unsafe fn zwp_input_method_v1_add_listener ( zwp_input_method_v1 : * mut super :: zwp_input_method_v1 :: zwp_input_method_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_input_method_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_input_method_v1_add_rust_listener ( zwp_input_method_v1 : * mut super :: zwp_input_method_v1 :: zwp_input_method_v1 , listener : & dyn zwp_input_method_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_input_method_v1_add_listener ( zwp_input_method_v1 as _ , fp as _ , op as _ ) == 0 ; } pub unsafe fn zwp_input_method_v1_destroy ( zwp_input_method_v1 : * mut super :: zwp_input_method_v1 :: zwp_input_method_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_input_method_v1 as _ ) ; } } # [ doc = "interface for implementing keyboards\n\nOnly one client can bind this interface at a time." ] pub mod zwp_input_panel_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_input_panel_v1 { } static mut zwp_input_panel_v1_requests_get_input_panel_surface_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: zwp_input_panel_surface_v1 :: zwp_input_panel_surface_v1_interface as * const wl_interface } , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_input_panel_v1_requests : [ wl_message ; 1 ] = [ wl_message { name : b"get_input_panel_surface\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zwp_input_panel_v1_requests_get_input_panel_surface_types as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_input_panel_v1_interface : wl_interface = wl_interface { name : b"zwp_input_panel_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_input_panel_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_input_panel_v1_listener { } pub unsafe fn zwp_input_panel_v1_set_user_data ( zwp_input_panel_v1 : * mut super :: zwp_input_panel_v1 :: zwp_input_panel_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_input_panel_v1 as _ , user_data ) ; } pub unsafe fn zwp_input_panel_v1_get_user_data ( zwp_input_panel_v1 : * mut super :: zwp_input_panel_v1 :: zwp_input_panel_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_input_panel_v1 as _ ) ; } pub unsafe fn zwp_input_panel_v1_get_version ( zwp_input_panel_v1 : * mut super :: zwp_input_panel_v1 :: zwp_input_panel_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_input_panel_v1 as _ ) ; } pub unsafe fn zwp_input_panel_v1_add_listener ( zwp_input_panel_v1 : * mut super :: zwp_input_panel_v1 :: zwp_input_panel_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_input_panel_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_input_panel_v1_add_rust_listener ( zwp_input_panel_v1 : * mut super :: zwp_input_panel_v1 :: zwp_input_panel_v1 , listener : & dyn zwp_input_panel_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_input_panel_v1_add_listener ( zwp_input_panel_v1 as _ , fp as _ , op as _ ) == 0 ; } pub unsafe fn zwp_input_panel_v1_destroy ( zwp_input_panel_v1 : * mut super :: zwp_input_panel_v1 :: zwp_input_panel_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_input_panel_v1 as _ ) ; } pub unsafe fn zwp_input_panel_v1_get_input_panel_surface ( zwp_input_panel_v1 : * mut super :: zwp_input_panel_v1 :: zwp_input_panel_v1 , surface : * mut super :: wl_surface :: wl_surface ) -> * mut super :: zwp_input_panel_surface_v1 :: zwp_input_panel_surface_v1 { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zwp_input_panel_v1 as _ , 0u32 , & super :: zwp_input_panel_surface_v1 :: zwp_input_panel_surface_v1_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , surface ) ; return r as _ ; } } pub mod zwp_input_panel_surface_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_input_panel_surface_v1 { } # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum position { center_bottom = 0 , # [ doc ( hidden ) ] __nonexhaustive , } impl position { pub fn from_raw ( n : u32 ) -> Option < position > { match n { 0 => Some ( position :: center_bottom ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } static mut zwp_input_panel_surface_v1_requests_set_toplevel_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } , NULLPTR as * const wl_interface , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_input_panel_surface_v1_requests : [ wl_message ; 2 ] = [ wl_message { name : b"set_toplevel\0" as * const u8 as * const c_char , signature : b"ou\0" as * const u8 as * const c_char , types : unsafe { & zwp_input_panel_surface_v1_requests_set_toplevel_types as * const _ } , } , wl_message { name : b"set_overlay_panel\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_input_panel_surface_v1_interface : wl_interface = wl_interface { name : b"zwp_input_panel_surface_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & zwp_input_panel_surface_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_input_panel_surface_v1_listener { } pub unsafe fn zwp_input_panel_surface_v1_set_user_data ( zwp_input_panel_surface_v1 : * mut super :: zwp_input_panel_surface_v1 :: zwp_input_panel_surface_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_input_panel_surface_v1 as _ , user_data ) ; } pub unsafe fn zwp_input_panel_surface_v1_get_user_data ( zwp_input_panel_surface_v1 : * mut super :: zwp_input_panel_surface_v1 :: zwp_input_panel_surface_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_input_panel_surface_v1 as _ ) ; } pub unsafe fn zwp_input_panel_surface_v1_get_version ( zwp_input_panel_surface_v1 : * mut super :: zwp_input_panel_surface_v1 :: zwp_input_panel_surface_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_input_panel_surface_v1 as _ ) ; } pub unsafe fn zwp_input_panel_surface_v1_add_listener ( zwp_input_panel_surface_v1 : * mut super :: zwp_input_panel_surface_v1 :: zwp_input_panel_surface_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_input_panel_surface_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_input_panel_surface_v1_add_rust_listener ( zwp_input_panel_surface_v1 : * mut super :: zwp_input_panel_surface_v1 :: zwp_input_panel_surface_v1 , listener : & dyn zwp_input_panel_surface_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_input_panel_surface_v1_add_listener ( zwp_input_panel_surface_v1 as _ , fp as _ , op as _ ) == 0 ; } pub unsafe fn zwp_input_panel_surface_v1_destroy ( zwp_input_panel_surface_v1 : * mut super :: zwp_input_panel_surface_v1 :: zwp_input_panel_surface_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_input_panel_surface_v1 as _ ) ; } # [ doc = "set the surface type as a keyboard\n\nSet the input_panel_surface type to keyboard.\n\nA keyboard surface is only shown when a text input is active." ] pub unsafe fn zwp_input_panel_surface_v1_set_toplevel ( zwp_input_panel_surface_v1 : * mut super :: zwp_input_panel_surface_v1 :: zwp_input_panel_surface_v1 , output : * mut super :: wl_output :: wl_output , position : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_input_panel_surface_v1 as _ , 0u32 , output , position , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set the surface type as an overlay panel\n\nSet the input_panel_surface to be an overlay panel.\n\nThis is shown near the input cursor above the application window when\na text input is active." ] pub unsafe fn zwp_input_panel_surface_v1_set_overlay_panel ( zwp_input_panel_surface_v1 : * mut super :: zwp_input_panel_surface_v1 :: zwp_input_panel_surface_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_input_panel_surface_v1 as _ , 1u32 , std :: ptr :: null :: < c_void > ( ) ) ; } } } pub mod xdg_shell_unstable_v5 { use super :: wayland :: * ; use super :: xdg_shell :: * ; # [ doc = "create desktop-style surfaces\n\nxdg_shell allows clients to turn a wl_surface into a \"real window\"\nwhich can be dragged, resized, stacked, and moved around by the\nuser. Everything about this interface is suited towards traditional\ndesktop environments." ] pub mod xdg_shell { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum xdg_shell { } # [ doc = "latest protocol version\n\nThe 'current' member of this enum gives the version of the\nprotocol.  Implementations can compare this to the version\nthey implement using static_assert to ensure the protocol and\nimplementation versions match." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum version { # [ doc = "Always the latest version" ] current = 5 , # [ doc ( hidden ) ] __nonexhaustive , } impl version { pub fn from_raw ( n : u32 ) -> Option < version > { match n { 5 => Some ( version :: current ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum error { # [ doc = "given wl_surface has another role" ] role = 0 , # [ doc = "xdg_shell was destroyed before children" ] defunct_surfaces = 1 , # [ doc = "the client tried to map or destroy a non-topmost popup" ] not_the_topmost_popup = 2 , # [ doc = "the client specified an invalid popup parent surface" ] invalid_popup_parent = 3 , # [ doc ( hidden ) ] __nonexhaustive , } impl error { pub fn from_raw ( n : u32 ) -> Option < error > { match n { 0 => Some ( error :: role ) , 1 => Some ( error :: defunct_surfaces ) , 2 => Some ( error :: not_the_topmost_popup ) , 3 => Some ( error :: invalid_popup_parent ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } static mut xdg_shell_requests_get_xdg_surface_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: xdg_surface :: xdg_surface_interface as * const wl_interface } , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , ] ; static mut xdg_shell_requests_get_xdg_popup_types : [ * const wl_interface ; 7 ] = [ unsafe { & super :: xdg_popup :: xdg_popup_interface as * const wl_interface } , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut xdg_shell_requests : [ wl_message ; 5 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"use_unstable_version\0" as * const u8 as * const c_char , signature : b"i\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_xdg_surface\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & xdg_shell_requests_get_xdg_surface_types as * const _ } , } , wl_message { name : b"get_xdg_popup\0" as * const u8 as * const c_char , signature : b"nooouii\0" as * const u8 as * const c_char , types : unsafe { & xdg_shell_requests_get_xdg_popup_types as * const _ } , } , wl_message { name : b"pong\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut xdg_shell_events : [ wl_message ; 1 ] = [ wl_message { name : b"ping\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut xdg_shell_interface : wl_interface = wl_interface { name : b"xdg_shell\0" as * const u8 as * const c_char , version : 1 , request_count : 5 , requests : unsafe { & xdg_shell_requests as * const _ } , event_count : 1 , events : unsafe { & xdg_shell_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait xdg_shell_listener { # [ doc = "check if the client is alive\n\nThe ping event asks the client if it's still alive. Pass the\nserial specified in the event back to the compositor by sending\na \"pong\" request back with the specified serial.\n\nCompositors can use this to determine if the client is still\nalive. It's unspecified what will happen if the client doesn't\nrespond to the ping request, or in what timeframe. Clients should\ntry to respond in a reasonable amount of time.\n\nA compositor is free to ping in any way it wants, but a client must\nalways respond to any xdg_shell object it created." ] fn ping ( & mut self , object : * mut xdg_shell , serial : u32 ) { } } pub unsafe fn xdg_shell_set_user_data ( xdg_shell : * mut super :: xdg_shell :: xdg_shell , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , xdg_shell as _ , user_data ) ; } pub unsafe fn xdg_shell_get_user_data ( xdg_shell : * mut super :: xdg_shell :: xdg_shell ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , xdg_shell as _ ) ; } pub unsafe fn xdg_shell_get_version ( xdg_shell : * mut super :: xdg_shell :: xdg_shell ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , xdg_shell as _ ) ; } pub unsafe fn xdg_shell_add_listener ( xdg_shell : * mut super :: xdg_shell :: xdg_shell , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , xdg_shell as _ , listener as _ , data as _ ) ; } pub unsafe fn xdg_shell_add_rust_listener ( xdg_shell : * mut super :: xdg_shell :: xdg_shell , listener : & dyn xdg_shell_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return xdg_shell_add_listener ( xdg_shell as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy xdg_shell\n\nDestroy this xdg_shell object.\n\nDestroying a bound xdg_shell object while there are surfaces\nstill alive created by this xdg_shell object instance is illegal\nand will result in a protocol error." ] pub unsafe fn xdg_shell_destroy ( xdg_shell : * mut super :: xdg_shell :: xdg_shell ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_shell as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , xdg_shell as _ ) ; } # [ doc = "enable use of this unstable version\n\nNegotiate the unstable version of the interface.  This\nmechanism is in place to ensure client and server agree on the\nunstable versions of the protocol that they speak or exit\ncleanly if they don't agree.  This request will go away once\nthe xdg-shell protocol is stable." ] pub unsafe fn xdg_shell_use_unstable_version ( xdg_shell : * mut super :: xdg_shell :: xdg_shell , version : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_shell as _ , 1u32 , version , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "create a shell surface from a surface\n\nThis creates an xdg_surface for the given surface and gives it the\nxdg_surface role. A wl_surface can only be given an xdg_surface role\nonce. If get_xdg_surface is called with a wl_surface that already has\nan active xdg_surface associated with it, or if it had any other role,\nan error is raised.\n\nSee the documentation of xdg_surface for more details about what an\nxdg_surface is and how it is used." ] pub unsafe fn xdg_shell_get_xdg_surface ( xdg_shell : * mut super :: xdg_shell :: xdg_shell , surface : * mut super :: wl_surface :: wl_surface ) -> * mut super :: xdg_surface :: xdg_surface { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , xdg_shell as _ , 2u32 , & super :: xdg_surface :: xdg_surface_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , surface ) ; return r as _ ; } # [ doc = "create a popup for a surface\n\nThis creates an xdg_popup for the given surface and gives it the\nxdg_popup role. A wl_surface can only be given an xdg_popup role\nonce. If get_xdg_popup is called with a wl_surface that already has\nan active xdg_popup associated with it, or if it had any other role,\nan error is raised.\n\nThis request must be used in response to some sort of user action\nlike a button press, key press, or touch down event.\n\nSee the documentation of xdg_popup for more details about what an\nxdg_popup is and how it is used." ] pub unsafe fn xdg_shell_get_xdg_popup ( xdg_shell : * mut super :: xdg_shell :: xdg_shell , surface : * mut super :: wl_surface :: wl_surface , parent : * mut super :: wl_surface :: wl_surface , seat : * mut super :: wl_seat :: wl_seat , serial : u32 , x : i32 , y : i32 ) -> * mut super :: xdg_popup :: xdg_popup { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , xdg_shell as _ , 3u32 , & super :: xdg_popup :: xdg_popup_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , surface , parent , seat , serial , x , y ) ; return r as _ ; } # [ doc = "respond to a ping event\n\nA client must respond to a ping event with a pong request or\nthe client may be deemed unresponsive." ] pub unsafe fn xdg_shell_pong ( xdg_shell : * mut super :: xdg_shell :: xdg_shell , serial : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_shell as _ , 4u32 , serial , std :: ptr :: null :: < c_void > ( ) ) ; } } # [ doc = "A desktop window\n\nAn interface that may be implemented by a wl_surface, for\nimplementations that provide a desktop-style user interface.\n\nIt provides requests to treat surfaces like windows, allowing to set\nproperties like maximized, fullscreen, minimized, and to move and resize\nthem, and associate metadata like title and app id.\n\nThe client must call wl_surface.commit on the corresponding wl_surface\nfor the xdg_surface state to take effect. Prior to committing the new\nstate, it can set up initial configuration, such as maximizing or setting\na window geometry.\n\nEven without attaching a buffer the compositor must respond to initial\ncommitted configuration, for instance sending a configure event with\nexpected window geometry if the client maximized its surface during\ninitialization.\n\nFor a surface to be mapped by the compositor the client must have\ncommitted both an xdg_surface state and a buffer." ] pub mod xdg_surface { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum xdg_surface { } # [ doc = "edge values for resizing\n\nThese values are used to indicate which edge of a surface\nis being dragged in a resize operation." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum resize_edge { none = 0 , top = 1 , bottom = 2 , left = 4 , top_left = 5 , bottom_left = 6 , right = 8 , top_right = 9 , bottom_right = 10 , # [ doc ( hidden ) ] __nonexhaustive , } impl resize_edge { pub fn from_raw ( n : u32 ) -> Option < resize_edge > { match n { 0 => Some ( resize_edge :: none ) , 1 => Some ( resize_edge :: top ) , 2 => Some ( resize_edge :: bottom ) , 4 => Some ( resize_edge :: left ) , 5 => Some ( resize_edge :: top_left ) , 6 => Some ( resize_edge :: bottom_left ) , 8 => Some ( resize_edge :: right ) , 9 => Some ( resize_edge :: top_right ) , 10 => Some ( resize_edge :: bottom_right ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ doc = "types of state on the surface\n\nThe different state values used on the surface. This is designed for\nstate values like maximized, fullscreen. It is paired with the\nconfigure event to ensure that both the client and the compositor\nsetting the state can be synchronized.\n\nStates set in this way are double-buffered. They will get applied on\nthe next commit.\n\nDesktop environments may extend this enum by taking up a range of\nvalues and documenting the range they chose in this description.\nThey are not required to document the values for the range that they\nchose. Ideally, any good extensions from a desktop environment should\nmake its way into standardization into this enum.\n\nThe current reserved ranges are:\n\n0x0000 - 0x0FFF: xdg-shell core values, documented below.\n0x1000 - 0x1FFF: GNOME\n0x2000 - 0x2FFF: EFL" ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum state { # [ doc = "the surface is maximized\n\nThe surface is maximized. The window geometry specified in the configure\nevent must be obeyed by the client." ] maximized = 1 , # [ doc = "the surface is fullscreen\n\nThe surface is fullscreen. The window geometry specified in the configure\nevent must be obeyed by the client." ] fullscreen = 2 , # [ doc = "the surface is being resized\n\nThe surface is being resized. The window geometry specified in the\nconfigure event is a maximum; the client cannot resize beyond it.\nClients that have aspect ratio or cell sizing configuration can use\na smaller size, however." ] resizing = 3 , # [ doc = "the surface is now activated\n\nClient window decorations should be painted as if the window is\nactive. Do not assume this means that the window actually has\nkeyboard or pointer focus." ] activated = 4 , # [ doc ( hidden ) ] __nonexhaustive , } impl state { pub fn from_raw ( n : u32 ) -> Option < state > { match n { 1 => Some ( state :: maximized ) , 2 => Some ( state :: fullscreen ) , 3 => Some ( state :: resizing ) , 4 => Some ( state :: activated ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } static mut xdg_surface_requests_set_parent_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: xdg_surface :: xdg_surface_interface as * const wl_interface } , ] ; static mut xdg_surface_requests_show_window_menu_types : [ * const wl_interface ; 4 ] = [ unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , ] ; static mut xdg_surface_requests_move_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface , ] ; static mut xdg_surface_requests_resize_types : [ * const wl_interface ; 3 ] = [ unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , ] ; static mut xdg_surface_requests_set_fullscreen_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut xdg_surface_requests : [ wl_message ; 14 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_parent\0" as * const u8 as * const c_char , signature : b"?o\0" as * const u8 as * const c_char , types : unsafe { & xdg_surface_requests_set_parent_types as * const _ } , } , wl_message { name : b"set_title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"show_window_menu\0" as * const u8 as * const c_char , signature : b"ouii\0" as * const u8 as * const c_char , types : unsafe { & xdg_surface_requests_show_window_menu_types as * const _ } , } , wl_message { name : b"move\0" as * const u8 as * const c_char , signature : b"ou\0" as * const u8 as * const c_char , types : unsafe { & xdg_surface_requests_move_types as * const _ } , } , wl_message { name : b"resize\0" as * const u8 as * const c_char , signature : b"ouu\0" as * const u8 as * const c_char , types : unsafe { & xdg_surface_requests_resize_types as * const _ } , } , wl_message { name : b"ack_configure\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_window_geometry\0" as * const u8 as * const c_char , signature : b"iiii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"?o\0" as * const u8 as * const c_char , types : unsafe { & xdg_surface_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut xdg_surface_events : [ wl_message ; 2 ] = [ wl_message { name : b"configure\0" as * const u8 as * const c_char , signature : b"iiau\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut xdg_surface_interface : wl_interface = wl_interface { name : b"xdg_surface\0" as * const u8 as * const c_char , version : 1 , request_count : 14 , requests : unsafe { & xdg_surface_requests as * const _ } , event_count : 2 , events : unsafe { & xdg_surface_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait xdg_surface_listener { # [ doc = "suggest a surface change\n\nThe configure event asks the client to resize its surface or to\nchange its state.\n\nThe width and height arguments specify a hint to the window\nabout how its surface should be resized in window geometry\ncoordinates. See set_window_geometry.\n\nIf the width or height arguments are zero, it means the client\nshould decide its own window dimension. This may happen when the\ncompositor need to configure the state of the surface but doesn't\nhave any information about any previous or expected dimension.\n\nThe states listed in the event specify how the width/height\narguments should be interpreted, and possibly how it should be\ndrawn.\n\nClients should arrange their surface for the new size and\nstates, and then send a ack_configure request with the serial\nsent in this configure event at some point before committing\nthe new surface.\n\nIf the client receives multiple configure events before it\ncan respond to one, it is free to discard all but the last\nevent it received." ] fn configure ( & mut self , object : * mut xdg_surface , width : i32 , height : i32 , states : * mut wl_array , serial : u32 ) { } # [ doc = "surface wants to be closed\n\nThe close event is sent by the compositor when the user\nwants the surface to be closed. This should be equivalent to\nthe user clicking the close button in client-side decorations,\nif your application has any...\n\nThis is only a request that the user intends to close your\nwindow. The client may choose to ignore this request, or show\na dialog to ask the user to save their data..." ] fn close ( & mut self , object : * mut xdg_surface , ) { } } pub unsafe fn xdg_surface_set_user_data ( xdg_surface : * mut super :: xdg_surface :: xdg_surface , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , xdg_surface as _ , user_data ) ; } pub unsafe fn xdg_surface_get_user_data ( xdg_surface : * mut super :: xdg_surface :: xdg_surface ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , xdg_surface as _ ) ; } pub unsafe fn xdg_surface_get_version ( xdg_surface : * mut super :: xdg_surface :: xdg_surface ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , xdg_surface as _ ) ; } pub unsafe fn xdg_surface_add_listener ( xdg_surface : * mut super :: xdg_surface :: xdg_surface , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , xdg_surface as _ , listener as _ , data as _ ) ; } pub unsafe fn xdg_surface_add_rust_listener ( xdg_surface : * mut super :: xdg_surface :: xdg_surface , listener : & dyn xdg_surface_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return xdg_surface_add_listener ( xdg_surface as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "Destroy the xdg_surface\n\nUnmap and destroy the window. The window will be effectively\nhidden from the user's point of view, and all state like\nmaximization, fullscreen, and so on, will be lost." ] pub unsafe fn xdg_surface_destroy ( xdg_surface : * mut super :: xdg_surface :: xdg_surface ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_surface as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , xdg_surface as _ ) ; } # [ doc = "set the parent of this surface\n\nSet the \"parent\" of this surface. This window should be stacked\nabove a parent. The parent surface must be mapped as long as this\nsurface is mapped.\n\nParent windows should be set on dialogs, toolboxes, or other\n\"auxiliary\" surfaces, so that the parent is raised when the dialog\nis raised." ] pub unsafe fn xdg_surface_set_parent ( xdg_surface : * mut super :: xdg_surface :: xdg_surface , parent : * mut super :: xdg_surface :: xdg_surface ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_surface as _ , 1u32 , parent , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set surface title\n\nSet a short title for the surface.\n\nThis string may be used to identify the surface in a task bar,\nwindow list, or other user interface elements provided by the\ncompositor.\n\nThe string must be encoded in UTF-8." ] pub unsafe fn xdg_surface_set_title ( xdg_surface : * mut super :: xdg_surface :: xdg_surface , title : * mut c_char ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_surface as _ , 2u32 , title , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set application ID\n\nSet an application identifier for the surface.\n\nThe app ID identifies the general class of applications to which\nthe surface belongs. The compositor can use this to group multiple\nsurfaces together, or to determine how to launch a new application.\n\nFor D-Bus activatable applications, the app ID is used as the D-Bus\nservice name.\n\nThe compositor shell will try to group application surfaces together\nby their app ID.  As a best practice, it is suggested to select app\nID's that match the basename of the application's .desktop file.\nFor example, \"org.freedesktop.FooViewer\" where the .desktop file is\n\"org.freedesktop.FooViewer.desktop\".\n\nSee the desktop-entry specification [0] for more details on\napplication identifiers and how they relate to well-known D-Bus\nnames and .desktop files.\n\n[0] http://standards.freedesktop.org/desktop-entry-spec/" ] pub unsafe fn xdg_surface_set_app_id ( xdg_surface : * mut super :: xdg_surface :: xdg_surface , app_id : * mut c_char ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_surface as _ , 3u32 , app_id , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "show the window menu\n\nClients implementing client-side decorations might want to show\na context menu when right-clicking on the decorations, giving the\nuser a menu that they can use to maximize or minimize the window.\n\nThis request asks the compositor to pop up such a window menu at\nthe given position, relative to the local surface coordinates of\nthe parent surface. There are no guarantees as to what menu items\nthe window menu contains.\n\nThis request must be used in response to some sort of user action\nlike a button press, key press, or touch down event." ] pub unsafe fn xdg_surface_show_window_menu ( xdg_surface : * mut super :: xdg_surface :: xdg_surface , seat : * mut super :: wl_seat :: wl_seat , serial : u32 , x : i32 , y : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_surface as _ , 4u32 , seat , serial , x , y , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "start an interactive move\n\nStart an interactive, user-driven move of the surface.\n\nThis request must be used in response to some sort of user action\nlike a button press, key press, or touch down event. The passed\nserial is used to determine the type of interactive move (touch,\npointer, etc).\n\nThe server may ignore move requests depending on the state of\nthe surface (e.g. fullscreen or maximized), or if the passed serial\nis no longer valid.\n\nIf triggered, the surface will lose the focus of the device\n(wl_pointer, wl_touch, etc) used for the move. It is up to the\ncompositor to visually indicate that the move is taking place, such as\nupdating a pointer cursor, during the move. There is no guarantee\nthat the device focus will return when the move is completed." ] pub unsafe fn xdg_surface_move ( xdg_surface : * mut super :: xdg_surface :: xdg_surface , seat : * mut super :: wl_seat :: wl_seat , serial : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_surface as _ , 5u32 , seat , serial , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "start an interactive resize\n\nStart a user-driven, interactive resize of the surface.\n\nThis request must be used in response to some sort of user action\nlike a button press, key press, or touch down event. The passed\nserial is used to determine the type of interactive resize (touch,\npointer, etc).\n\nThe server may ignore resize requests depending on the state of\nthe surface (e.g. fullscreen or maximized).\n\nIf triggered, the client will receive configure events with the\n\"resize\" state enum value and the expected sizes. See the \"resize\"\nenum value for more details about what is required. The client\nmust also acknowledge configure events using \"ack_configure\". After\nthe resize is completed, the client will receive another \"configure\"\nevent without the resize state.\n\nIf triggered, the surface also will lose the focus of the device\n(wl_pointer, wl_touch, etc) used for the resize. It is up to the\ncompositor to visually indicate that the resize is taking place,\nsuch as updating a pointer cursor, during the resize. There is no\nguarantee that the device focus will return when the resize is\ncompleted.\n\nThe edges parameter specifies how the surface should be resized,\nand is one of the values of the resize_edge enum. The compositor\nmay use this information to update the surface position for\nexample when dragging the top left corner. The compositor may also\nuse this information to adapt its behavior, e.g. choose an\nappropriate cursor image." ] pub unsafe fn xdg_surface_resize ( xdg_surface : * mut super :: xdg_surface :: xdg_surface , seat : * mut super :: wl_seat :: wl_seat , serial : u32 , edges : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_surface as _ , 6u32 , seat , serial , edges , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "ack a configure event\n\nWhen a configure event is received, if a client commits the\nsurface in response to the configure event, then the client\nmust make an ack_configure request sometime before the commit\nrequest, passing along the serial of the configure event.\n\nFor instance, the compositor might use this information to move\na surface to the top left only when the client has drawn itself\nfor the maximized or fullscreen state.\n\nIf the client receives multiple configure events before it\ncan respond to one, it only has to ack the last configure event.\n\nA client is not required to commit immediately after sending\nan ack_configure request - it may even ack_configure several times\nbefore its next surface commit.\n\nThe compositor expects that the most recently received\nack_configure request at the time of a commit indicates which\nconfigure event the client is responding to." ] pub unsafe fn xdg_surface_ack_configure ( xdg_surface : * mut super :: xdg_surface :: xdg_surface , serial : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_surface as _ , 7u32 , serial , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set the new window geometry\n\nThe window geometry of a window is its \"visible bounds\" from the\nuser's perspective. Client-side decorations often have invisible\nportions like drop-shadows which should be ignored for the\npurposes of aligning, placing and constraining windows.\n\nThe window geometry is double buffered, and will be applied at the\ntime wl_surface.commit of the corresponding wl_surface is called.\n\nOnce the window geometry of the surface is set once, it is not\npossible to unset it, and it will remain the same until\nset_window_geometry is called again, even if a new subsurface or\nbuffer is attached.\n\nIf never set, the value is the full bounds of the surface,\nincluding any subsurfaces. This updates dynamically on every\ncommit. This unset mode is meant for extremely simple clients.\n\nIf responding to a configure event, the window geometry in here\nmust respect the sizing negotiations specified by the states in\nthe configure event.\n\nThe arguments are given in the surface local coordinate space of\nthe wl_surface associated with this xdg_surface.\n\nThe width and height must be greater than zero." ] pub unsafe fn xdg_surface_set_window_geometry ( xdg_surface : * mut super :: xdg_surface :: xdg_surface , x : i32 , y : i32 , width : i32 , height : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_surface as _ , 8u32 , x , y , width , height , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "maximize the window\n\nMaximize the surface.\n\nAfter requesting that the surface should be maximized, the compositor\nwill respond by emitting a configure event with the \"maximized\" state\nand the required window geometry. The client should then update its\ncontent, drawing it in a maximized state, i.e. without shadow or other\ndecoration outside of the window geometry. The client must also\nacknowledge the configure when committing the new content (see\nack_configure).\n\nIt is up to the compositor to decide how and where to maximize the\nsurface, for example which output and what region of the screen should\nbe used.\n\nIf the surface was already maximized, the compositor will still emit\na configure event with the \"maximized\" state." ] pub unsafe fn xdg_surface_set_maximized ( xdg_surface : * mut super :: xdg_surface :: xdg_surface ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_surface as _ , 9u32 , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "unmaximize the window\n\nUnmaximize the surface.\n\nAfter requesting that the surface should be unmaximized, the compositor\nwill respond by emitting a configure event without the \"maximized\"\nstate. If available, the compositor will include the window geometry\ndimensions the window had prior to being maximized in the configure\nrequest. The client must then update its content, drawing it in a\nregular state, i.e. potentially with shadow, etc. The client must also\nacknowledge the configure when committing the new content (see\nack_configure).\n\nIt is up to the compositor to position the surface after it was\nunmaximized; usually the position the surface had before maximizing, if\napplicable.\n\nIf the surface was already not maximized, the compositor will still\nemit a configure event without the \"maximized\" state." ] pub unsafe fn xdg_surface_unset_maximized ( xdg_surface : * mut super :: xdg_surface :: xdg_surface ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_surface as _ , 10u32 , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set the window as fullscreen on a monitor\n\nMake the surface fullscreen.\n\nYou can specify an output that you would prefer to be fullscreen.\nIf this value is NULL, it's up to the compositor to choose which\ndisplay will be used to map this surface.\n\nIf the surface doesn't cover the whole output, the compositor will\nposition the surface in the center of the output and compensate with\nblack borders filling the rest of the output." ] pub unsafe fn xdg_surface_set_fullscreen ( xdg_surface : * mut super :: xdg_surface :: xdg_surface , output : * mut super :: wl_output :: wl_output ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_surface as _ , 11u32 , output , std :: ptr :: null :: < c_void > ( ) ) ; } pub unsafe fn xdg_surface_unset_fullscreen ( xdg_surface : * mut super :: xdg_surface :: xdg_surface ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_surface as _ , 12u32 , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set the window as minimized\n\nRequest that the compositor minimize your surface. There is no\nway to know if the surface is currently minimized, nor is there\nany way to unset minimization on this surface.\n\nIf you are looking to throttle redrawing when minimized, please\ninstead use the wl_surface.frame event for this, as this will\nalso work with live previews on windows in Alt-Tab, Expose or\nsimilar compositor features." ] pub unsafe fn xdg_surface_set_minimized ( xdg_surface : * mut super :: xdg_surface :: xdg_surface ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_surface as _ , 13u32 , std :: ptr :: null :: < c_void > ( ) ) ; } } # [ doc = "short-lived, popup surfaces for menus\n\nA popup surface is a short-lived, temporary surface that can be\nused to implement menus. It takes an explicit grab on the surface\nthat will be dismissed when the user dismisses the popup. This can\nbe done by the user clicking outside the surface, using the keyboard,\nor even locking the screen through closing the lid or a timeout.\n\nWhen the popup is dismissed, a popup_done event will be sent out,\nand at the same time the surface will be unmapped. The xdg_popup\nobject is now inert and cannot be reactivated, so clients should\ndestroy it. Explicitly destroying the xdg_popup object will also\ndismiss the popup and unmap the surface.\n\nClients will receive events for all their surfaces during this\ngrab (which is an \"owner-events\" grab in X11 parlance). This is\ndone so that users can navigate through submenus and other\n\"nested\" popup windows without having to dismiss the topmost\npopup.\n\nClients that want to dismiss the popup when another surface of\ntheir own is clicked should dismiss the popup using the destroy\nrequest.\n\nThe parent surface must have either an xdg_surface or xdg_popup\nrole.\n\nSpecifying an xdg_popup for the parent means that the popups are\nnested, with this popup now being the topmost popup. Nested\npopups must be destroyed in the reverse order they were created\nin, e.g. the only popup you are allowed to destroy at all times\nis the topmost one.\n\nIf there is an existing popup when creating a new popup, the\nparent must be the current topmost popup.\n\nA parent surface must be mapped before the new popup is mapped.\n\nWhen compositors choose to dismiss a popup, they will likely\ndismiss every nested popup as well. When a compositor dismisses\npopups, it will follow the same dismissing order as required\nfrom the client.\n\nThe x and y arguments passed when creating the popup object specify\nwhere the top left of the popup should be placed, relative to the\nlocal surface coordinates of the parent surface. See\nxdg_shell.get_xdg_popup.\n\nThe client must call wl_surface.commit on the corresponding wl_surface\nfor the xdg_popup state to take effect.\n\nFor a surface to be mapped by the compositor the client must have\ncommitted both the xdg_popup state and a buffer." ] pub mod xdg_popup { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum xdg_popup { } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut xdg_popup_requests : [ wl_message ; 1 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut xdg_popup_events : [ wl_message ; 1 ] = [ wl_message { name : b"popup_done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut xdg_popup_interface : wl_interface = wl_interface { name : b"xdg_popup\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & xdg_popup_requests as * const _ } , event_count : 1 , events : unsafe { & xdg_popup_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait xdg_popup_listener { # [ doc = "popup interaction is done\n\nThe popup_done event is sent out when a popup is dismissed by the\ncompositor. The client should destroy the xdg_popup object at this\npoint." ] fn popup_done ( & mut self , object : * mut xdg_popup , ) { } } pub unsafe fn xdg_popup_set_user_data ( xdg_popup : * mut super :: xdg_popup :: xdg_popup , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , xdg_popup as _ , user_data ) ; } pub unsafe fn xdg_popup_get_user_data ( xdg_popup : * mut super :: xdg_popup :: xdg_popup ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , xdg_popup as _ ) ; } pub unsafe fn xdg_popup_get_version ( xdg_popup : * mut super :: xdg_popup :: xdg_popup ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , xdg_popup as _ ) ; } pub unsafe fn xdg_popup_add_listener ( xdg_popup : * mut super :: xdg_popup :: xdg_popup , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , xdg_popup as _ , listener as _ , data as _ ) ; } pub unsafe fn xdg_popup_add_rust_listener ( xdg_popup : * mut super :: xdg_popup :: xdg_popup , listener : & dyn xdg_popup_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return xdg_popup_add_listener ( xdg_popup as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "remove xdg_popup interface\n\nThis destroys the popup. Explicitly destroying the xdg_popup\nobject will also dismiss the popup, and unmap the surface.\n\nIf this xdg_popup is not the \"topmost\" popup, a protocol error\nwill be sent." ] pub unsafe fn xdg_popup_destroy ( xdg_popup : * mut super :: xdg_popup :: xdg_popup ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , xdg_popup as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , xdg_popup as _ ) ; } } } pub mod xdg_shell_unstable_v6 { use super :: wayland :: * ; use super :: xdg_shell :: * ; # [ doc = "create desktop-style surfaces\n\nxdg_shell allows clients to turn a wl_surface into a \"real window\"\nwhich can be dragged, resized, stacked, and moved around by the\nuser. Everything about this interface is suited towards traditional\ndesktop environments." ] pub mod zxdg_shell_v6 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zxdg_shell_v6 { } # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum error { # [ doc = "given wl_surface has another role" ] role = 0 , # [ doc = "xdg_shell was destroyed before children" ] defunct_surfaces = 1 , # [ doc = "the client tried to map or destroy a non-topmost popup" ] not_the_topmost_popup = 2 , # [ doc = "the client specified an invalid popup parent surface" ] invalid_popup_parent = 3 , # [ doc = "the client provided an invalid surface state" ] invalid_surface_state = 4 , # [ doc = "the client provided an invalid positioner" ] invalid_positioner = 5 , # [ doc ( hidden ) ] __nonexhaustive , } impl error { pub fn from_raw ( n : u32 ) -> Option < error > { match n { 0 => Some ( error :: role ) , 1 => Some ( error :: defunct_surfaces ) , 2 => Some ( error :: not_the_topmost_popup ) , 3 => Some ( error :: invalid_popup_parent ) , 4 => Some ( error :: invalid_surface_state ) , 5 => Some ( error :: invalid_positioner ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } static mut zxdg_shell_v6_requests_create_positioner_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: zxdg_positioner_v6 :: zxdg_positioner_v6_interface as * const wl_interface } , ] ; static mut zxdg_shell_v6_requests_get_xdg_surface_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: zxdg_surface_v6 :: zxdg_surface_v6_interface as * const wl_interface } , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zxdg_shell_v6_requests : [ wl_message ; 4 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_positioner\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zxdg_shell_v6_requests_create_positioner_types as * const _ } , } , wl_message { name : b"get_xdg_surface\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zxdg_shell_v6_requests_get_xdg_surface_types as * const _ } , } , wl_message { name : b"pong\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zxdg_shell_v6_events : [ wl_message ; 1 ] = [ wl_message { name : b"ping\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zxdg_shell_v6_interface : wl_interface = wl_interface { name : b"zxdg_shell_v6\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zxdg_shell_v6_requests as * const _ } , event_count : 1 , events : unsafe { & zxdg_shell_v6_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zxdg_shell_v6_listener { # [ doc = "check if the client is alive\n\nThe ping event asks the client if it's still alive. Pass the\nserial specified in the event back to the compositor by sending\na \"pong\" request back with the specified serial. See xdg_shell.ping.\n\nCompositors can use this to determine if the client is still\nalive. It's unspecified what will happen if the client doesn't\nrespond to the ping request, or in what timeframe. Clients should\ntry to respond in a reasonable amount of time.\n\nA compositor is free to ping in any way it wants, but a client must\nalways respond to any xdg_shell object it created." ] fn ping ( & mut self , object : * mut zxdg_shell_v6 , serial : u32 ) { } } pub unsafe fn zxdg_shell_v6_set_user_data ( zxdg_shell_v6 : * mut super :: zxdg_shell_v6 :: zxdg_shell_v6 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zxdg_shell_v6 as _ , user_data ) ; } pub unsafe fn zxdg_shell_v6_get_user_data ( zxdg_shell_v6 : * mut super :: zxdg_shell_v6 :: zxdg_shell_v6 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zxdg_shell_v6 as _ ) ; } pub unsafe fn zxdg_shell_v6_get_version ( zxdg_shell_v6 : * mut super :: zxdg_shell_v6 :: zxdg_shell_v6 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zxdg_shell_v6 as _ ) ; } pub unsafe fn zxdg_shell_v6_add_listener ( zxdg_shell_v6 : * mut super :: zxdg_shell_v6 :: zxdg_shell_v6 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zxdg_shell_v6 as _ , listener as _ , data as _ ) ; } pub unsafe fn zxdg_shell_v6_add_rust_listener ( zxdg_shell_v6 : * mut super :: zxdg_shell_v6 :: zxdg_shell_v6 , listener : & dyn zxdg_shell_v6_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zxdg_shell_v6_add_listener ( zxdg_shell_v6 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy xdg_shell\n\nDestroy this xdg_shell object.\n\nDestroying a bound xdg_shell object while there are surfaces\nstill alive created by this xdg_shell object instance is illegal\nand will result in a protocol error." ] pub unsafe fn zxdg_shell_v6_destroy ( zxdg_shell_v6 : * mut super :: zxdg_shell_v6 :: zxdg_shell_v6 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_shell_v6 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zxdg_shell_v6 as _ ) ; } # [ doc = "create a positioner object\n\nCreate a positioner object. A positioner object is used to position\nsurfaces relative to some parent surface. See the interface description\nand xdg_surface.get_popup for details." ] pub unsafe fn zxdg_shell_v6_create_positioner ( zxdg_shell_v6 : * mut super :: zxdg_shell_v6 :: zxdg_shell_v6 ) -> * mut super :: zxdg_positioner_v6 :: zxdg_positioner_v6 { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zxdg_shell_v6 as _ , 1u32 , & super :: zxdg_positioner_v6 :: zxdg_positioner_v6_interface as * const _ , std :: ptr :: null :: < c_void > ( ) ) ; return r as _ ; } # [ doc = "create a shell surface from a surface\n\nThis creates an xdg_surface for the given surface. While xdg_surface\nitself is not a role, the corresponding surface may only be assigned\na role extending xdg_surface, such as xdg_toplevel or xdg_popup.\n\nThis creates an xdg_surface for the given surface. An xdg_surface is\nused as basis to define a role to a given surface, such as xdg_toplevel\nor xdg_popup. It also manages functionality shared between xdg_surface\nbased surface roles.\n\nSee the documentation of xdg_surface for more details about what an\nxdg_surface is and how it is used." ] pub unsafe fn zxdg_shell_v6_get_xdg_surface ( zxdg_shell_v6 : * mut super :: zxdg_shell_v6 :: zxdg_shell_v6 , surface : * mut super :: wl_surface :: wl_surface ) -> * mut super :: zxdg_surface_v6 :: zxdg_surface_v6 { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zxdg_shell_v6 as _ , 2u32 , & super :: zxdg_surface_v6 :: zxdg_surface_v6_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , surface ) ; return r as _ ; } # [ doc = "respond to a ping event\n\nA client must respond to a ping event with a pong request or\nthe client may be deemed unresponsive. See xdg_shell.ping." ] pub unsafe fn zxdg_shell_v6_pong ( zxdg_shell_v6 : * mut super :: zxdg_shell_v6 :: zxdg_shell_v6 , serial : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_shell_v6 as _ , 3u32 , serial , std :: ptr :: null :: < c_void > ( ) ) ; } } # [ doc = "child surface positioner\n\nThe xdg_positioner provides a collection of rules for the placement of a\nchild surface relative to a parent surface. Rules can be defined to ensure\nthe child surface remains within the visible area's borders, and to\nspecify how the child surface changes its position, such as sliding along\nan axis, or flipping around a rectangle. These positioner-created rules are\nconstrained by the requirement that a child surface must intersect with or\nbe at least partially adjacent to its parent surface.\n\nSee the various requests for details about possible rules.\n\nAt the time of the request, the compositor makes a copy of the rules\nspecified by the xdg_positioner. Thus, after the request is complete the\nxdg_positioner object can be destroyed or reused; further changes to the\nobject will have no effect on previous usages.\n\nFor an xdg_positioner object to be considered complete, it must have a\nnon-zero size set by set_size, and a non-zero anchor rectangle set by\nset_anchor_rect. Passing an incomplete xdg_positioner object when\npositioning a surface raises an error." ] pub mod zxdg_positioner_v6 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zxdg_positioner_v6 { } # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum error { # [ doc = "invalid input provided" ] invalid_input = 0 , # [ doc ( hidden ) ] __nonexhaustive , } impl error { pub fn from_raw ( n : u32 ) -> Option < error > { match n { 0 => Some ( error :: invalid_input ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } bitflags ! { pub struct anchor : u32 { # [ doc = "the center of the anchor rectangle" ] const none = 0 ; # [ doc = "the top edge of the anchor rectangle" ] const top = 1 ; # [ doc = "the bottom edge of the anchor rectangle" ] const bottom = 2 ; # [ doc = "the left edge of the anchor rectangle" ] const left = 4 ; # [ doc = "the right edge of the anchor rectangle" ] const right = 8 ; } } impl anchor { pub fn from_raw ( n : u32 ) -> Option < anchor > { Some ( anchor :: from_bits_truncate ( n ) ) } pub fn to_raw ( & self ) -> u32 { self . bits ( ) } } bitflags ! { pub struct gravity : u32 { # [ doc = "center over the anchor edge" ] const none = 0 ; # [ doc = "position above the anchor edge" ] const top = 1 ; # [ doc = "position below the anchor edge" ] const bottom = 2 ; # [ doc = "position to the left of the anchor edge" ] const left = 4 ; # [ doc = "position to the right of the anchor edge" ] const right = 8 ; } } impl gravity { pub fn from_raw ( n : u32 ) -> Option < gravity > { Some ( gravity :: from_bits_truncate ( n ) ) } pub fn to_raw ( & self ) -> u32 { self . bits ( ) } } bitflags ! { # [ doc = "constraint adjustments\n\nThe constraint adjustment value define ways the compositor will adjust\nthe position of the surface, if the unadjusted position would result\nin the surface being partly constrained.\n\nWhether a surface is considered 'constrained' is left to the compositor\nto determine. For example, the surface may be partly outside the\ncompositor's defined 'work area', thus necessitating the child surface's\nposition be adjusted until it is entirely inside the work area.\n\nThe adjustments can be combined, according to a defined precedence: 1)\nFlip, 2) Slide, 3) Resize." ] pub struct constraint_adjustment : u32 { # [ doc = "don't move the child surface when constrained\n\nDon't alter the surface position even if it is constrained on some\naxis, for example partially outside the edge of a monitor." ] const none = 0 ; # [ doc = "move along the x axis until unconstrained\n\nSlide the surface along the x axis until it is no longer constrained.\n\nFirst try to slide towards the direction of the gravity on the x axis\nuntil either the edge in the opposite direction of the gravity is\nunconstrained or the edge in the direction of the gravity is\nconstrained.\n\nThen try to slide towards the opposite direction of the gravity on the\nx axis until either the edge in the direction of the gravity is\nunconstrained or the edge in the opposite direction of the gravity is\nconstrained." ] const slide_x = 1 ; # [ doc = "move along the y axis until unconstrained\n\nSlide the surface along the y axis until it is no longer constrained.\n\nFirst try to slide towards the direction of the gravity on the y axis\nuntil either the edge in the opposite direction of the gravity is\nunconstrained or the edge in the direction of the gravity is\nconstrained.\n\nThen try to slide towards the opposite direction of the gravity on the\ny axis until either the edge in the direction of the gravity is\nunconstrained or the edge in the opposite direction of the gravity is\nconstrained." ] const slide_y = 2 ; # [ doc = "invert the anchor and gravity on the x axis\n\nInvert the anchor and gravity on the x axis if the surface is\nconstrained on the x axis. For example, if the left edge of the\nsurface is constrained, the gravity is 'left' and the anchor is\n'left', change the gravity to 'right' and the anchor to 'right'.\n\nIf the adjusted position also ends up being constrained, the resulting\nposition of the flip_x adjustment will be the one before the\nadjustment." ] const flip_x = 4 ; # [ doc = "invert the anchor and gravity on the y axis\n\nInvert the anchor and gravity on the y axis if the surface is\nconstrained on the y axis. For example, if the bottom edge of the\nsurface is constrained, the gravity is 'bottom' and the anchor is\n'bottom', change the gravity to 'top' and the anchor to 'top'.\n\nIf the adjusted position also ends up being constrained, the resulting\nposition of the flip_y adjustment will be the one before the\nadjustment." ] const flip_y = 8 ; # [ doc = "horizontally resize the surface\n\nResize the surface horizontally so that it is completely\nunconstrained." ] const resize_x = 16 ; # [ doc = "vertically resize the surface\n\nResize the surface vertically so that it is completely unconstrained." ] const resize_y = 32 ; } } impl constraint_adjustment { pub fn from_raw ( n : u32 ) -> Option < constraint_adjustment > { Some ( constraint_adjustment :: from_bits_truncate ( n ) ) } pub fn to_raw ( & self ) -> u32 { self . bits ( ) } } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zxdg_positioner_v6_requests : [ wl_message ; 7 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_size\0" as * const u8 as * const c_char , signature : b"ii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_anchor_rect\0" as * const u8 as * const c_char , signature : b"iiii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_anchor\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_gravity\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_constraint_adjustment\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_offset\0" as * const u8 as * const c_char , signature : b"ii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zxdg_positioner_v6_interface : wl_interface = wl_interface { name : b"zxdg_positioner_v6\0" as * const u8 as * const c_char , version : 1 , request_count : 7 , requests : unsafe { & zxdg_positioner_v6_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait zxdg_positioner_v6_listener { } pub unsafe fn zxdg_positioner_v6_set_user_data ( zxdg_positioner_v6 : * mut super :: zxdg_positioner_v6 :: zxdg_positioner_v6 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zxdg_positioner_v6 as _ , user_data ) ; } pub unsafe fn zxdg_positioner_v6_get_user_data ( zxdg_positioner_v6 : * mut super :: zxdg_positioner_v6 :: zxdg_positioner_v6 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zxdg_positioner_v6 as _ ) ; } pub unsafe fn zxdg_positioner_v6_get_version ( zxdg_positioner_v6 : * mut super :: zxdg_positioner_v6 :: zxdg_positioner_v6 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zxdg_positioner_v6 as _ ) ; } pub unsafe fn zxdg_positioner_v6_add_listener ( zxdg_positioner_v6 : * mut super :: zxdg_positioner_v6 :: zxdg_positioner_v6 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zxdg_positioner_v6 as _ , listener as _ , data as _ ) ; } pub unsafe fn zxdg_positioner_v6_add_rust_listener ( zxdg_positioner_v6 : * mut super :: zxdg_positioner_v6 :: zxdg_positioner_v6 , listener : & dyn zxdg_positioner_v6_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zxdg_positioner_v6_add_listener ( zxdg_positioner_v6 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the xdg_positioner object\n\nNotify the compositor that the xdg_positioner will no longer be used." ] pub unsafe fn zxdg_positioner_v6_destroy ( zxdg_positioner_v6 : * mut super :: zxdg_positioner_v6 :: zxdg_positioner_v6 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_positioner_v6 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zxdg_positioner_v6 as _ ) ; } # [ doc = "set the size of the to-be positioned rectangle\n\nSet the size of the surface that is to be positioned with the positioner\nobject. The size is in surface-local coordinates and corresponds to the\nwindow geometry. See xdg_surface.set_window_geometry.\n\nIf a zero or negative size is set the invalid_input error is raised." ] pub unsafe fn zxdg_positioner_v6_set_size ( zxdg_positioner_v6 : * mut super :: zxdg_positioner_v6 :: zxdg_positioner_v6 , width : i32 , height : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_positioner_v6 as _ , 1u32 , width , height , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set the anchor rectangle within the parent surface\n\nSpecify the anchor rectangle within the parent surface that the child\nsurface will be placed relative to. The rectangle is relative to the\nwindow geometry as defined by xdg_surface.set_window_geometry of the\nparent surface. The rectangle must be at least 1x1 large.\n\nWhen the xdg_positioner object is used to position a child surface, the\nanchor rectangle may not extend outside the window geometry of the\npositioned child's parent surface.\n\nIf a zero or negative size is set the invalid_input error is raised." ] pub unsafe fn zxdg_positioner_v6_set_anchor_rect ( zxdg_positioner_v6 : * mut super :: zxdg_positioner_v6 :: zxdg_positioner_v6 , x : i32 , y : i32 , width : i32 , height : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_positioner_v6 as _ , 2u32 , x , y , width , height , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set anchor rectangle anchor edges\n\nDefines a set of edges for the anchor rectangle. These are used to\nderive an anchor point that the child surface will be positioned\nrelative to. If two orthogonal edges are specified (e.g. 'top' and\n'left'), then the anchor point will be the intersection of the edges\n(e.g. the top left position of the rectangle); otherwise, the derived\nanchor point will be centered on the specified edge, or in the center of\nthe anchor rectangle if no edge is specified.\n\nIf two parallel anchor edges are specified (e.g. 'left' and 'right'),\nthe invalid_input error is raised." ] pub unsafe fn zxdg_positioner_v6_set_anchor ( zxdg_positioner_v6 : * mut super :: zxdg_positioner_v6 :: zxdg_positioner_v6 , anchor : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_positioner_v6 as _ , 3u32 , anchor , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set child surface gravity\n\nDefines in what direction a surface should be positioned, relative to\nthe anchor point of the parent surface. If two orthogonal gravities are\nspecified (e.g. 'bottom' and 'right'), then the child surface will be\nplaced in the specified direction; otherwise, the child surface will be\ncentered over the anchor point on any axis that had no gravity\nspecified.\n\nIf two parallel gravities are specified (e.g. 'left' and 'right'), the\ninvalid_input error is raised." ] pub unsafe fn zxdg_positioner_v6_set_gravity ( zxdg_positioner_v6 : * mut super :: zxdg_positioner_v6 :: zxdg_positioner_v6 , gravity : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_positioner_v6 as _ , 4u32 , gravity , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set the adjustment to be done when constrained\n\nSpecify how the window should be positioned if the originally intended\nposition caused the surface to be constrained, meaning at least\npartially outside positioning boundaries set by the compositor. The\nadjustment is set by constructing a bitmask describing the adjustment to\nbe made when the surface is constrained on that axis.\n\nIf no bit for one axis is set, the compositor will assume that the child\nsurface should not change its position on that axis when constrained.\n\nIf more than one bit for one axis is set, the order of how adjustments\nare applied is specified in the corresponding adjustment descriptions.\n\nThe default adjustment is none." ] pub unsafe fn zxdg_positioner_v6_set_constraint_adjustment ( zxdg_positioner_v6 : * mut super :: zxdg_positioner_v6 :: zxdg_positioner_v6 , constraint_adjustment : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_positioner_v6 as _ , 5u32 , constraint_adjustment , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set surface position offset\n\nSpecify the surface position offset relative to the position of the\nanchor on the anchor rectangle and the anchor on the surface. For\nexample if the anchor of the anchor rectangle is at (x, y), the surface\nhas the gravity bottom|right, and the offset is (ox, oy), the calculated\nsurface position will be (x + ox, y + oy). The offset position of the\nsurface is the one used for constraint testing. See\nset_constraint_adjustment.\n\nAn example use case is placing a popup menu on top of a user interface\nelement, while aligning the user interface element of the parent surface\nwith some user interface element placed somewhere in the popup surface." ] pub unsafe fn zxdg_positioner_v6_set_offset ( zxdg_positioner_v6 : * mut super :: zxdg_positioner_v6 :: zxdg_positioner_v6 , x : i32 , y : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_positioner_v6 as _ , 6u32 , x , y , std :: ptr :: null :: < c_void > ( ) ) ; } } # [ doc = "desktop user interface surface base interface\n\nAn interface that may be implemented by a wl_surface, for\nimplementations that provide a desktop-style user interface.\n\nIt provides a base set of functionality required to construct user\ninterface elements requiring management by the compositor, such as\ntoplevel windows, menus, etc. The types of functionality are split into\nxdg_surface roles.\n\nCreating an xdg_surface does not set the role for a wl_surface. In order\nto map an xdg_surface, the client must create a role-specific object\nusing, e.g., get_toplevel, get_popup. The wl_surface for any given\nxdg_surface can have at most one role, and may not be assigned any role\nnot based on xdg_surface.\n\nA role must be assigned before any other requests are made to the\nxdg_surface object.\n\nThe client must call wl_surface.commit on the corresponding wl_surface\nfor the xdg_surface state to take effect.\n\nCreating an xdg_surface from a wl_surface which has a buffer attached or\ncommitted is a client error, and any attempts by a client to attach or\nmanipulate a buffer prior to the first xdg_surface.configure call must\nalso be treated as errors.\n\nFor a surface to be mapped by the compositor, the following conditions\nmust be met: (1) the client has assigned a xdg_surface based role to the\nsurface, (2) the client has set and committed the xdg_surface state and\nthe role dependent state to the surface and (3) the client has committed a\nbuffer to the surface." ] pub mod zxdg_surface_v6 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zxdg_surface_v6 { } # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum error { not_constructed = 1 , already_constructed = 2 , unconfigured_buffer = 3 , # [ doc ( hidden ) ] __nonexhaustive , } impl error { pub fn from_raw ( n : u32 ) -> Option < error > { match n { 1 => Some ( error :: not_constructed ) , 2 => Some ( error :: already_constructed ) , 3 => Some ( error :: unconfigured_buffer ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } static mut zxdg_surface_v6_requests_get_toplevel_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: zxdg_toplevel_v6 :: zxdg_toplevel_v6_interface as * const wl_interface } , ] ; static mut zxdg_surface_v6_requests_get_popup_types : [ * const wl_interface ; 3 ] = [ unsafe { & super :: zxdg_popup_v6 :: zxdg_popup_v6_interface as * const wl_interface } , unsafe { & super :: zxdg_surface_v6 :: zxdg_surface_v6_interface as * const wl_interface } , unsafe { & super :: zxdg_positioner_v6 :: zxdg_positioner_v6_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zxdg_surface_v6_requests : [ wl_message ; 5 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zxdg_surface_v6_requests_get_toplevel_types as * const _ } , } , wl_message { name : b"get_popup\0" as * const u8 as * const c_char , signature : b"noo\0" as * const u8 as * const c_char , types : unsafe { & zxdg_surface_v6_requests_get_popup_types as * const _ } , } , wl_message { name : b"set_window_geometry\0" as * const u8 as * const c_char , signature : b"iiii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"ack_configure\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zxdg_surface_v6_events : [ wl_message ; 1 ] = [ wl_message { name : b"configure\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zxdg_surface_v6_interface : wl_interface = wl_interface { name : b"zxdg_surface_v6\0" as * const u8 as * const c_char , version : 1 , request_count : 5 , requests : unsafe { & zxdg_surface_v6_requests as * const _ } , event_count : 1 , events : unsafe { & zxdg_surface_v6_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zxdg_surface_v6_listener { # [ doc = "suggest a surface change\n\nThe configure event marks the end of a configure sequence. A configure\nsequence is a set of one or more events configuring the state of the\nxdg_surface, including the final xdg_surface.configure event.\n\nWhere applicable, xdg_surface surface roles will during a configure\nsequence extend this event as a latched state sent as events before the\nxdg_surface.configure event. Such events should be considered to make up\na set of atomically applied configuration states, where the\nxdg_surface.configure commits the accumulated state.\n\nClients should arrange their surface for the new states, and then send\nan ack_configure request with the serial sent in this configure event at\nsome point before committing the new surface.\n\nIf the client receives multiple configure events before it can respond\nto one, it is free to discard all but the last event it received." ] fn configure ( & mut self , object : * mut zxdg_surface_v6 , serial : u32 ) { } } pub unsafe fn zxdg_surface_v6_set_user_data ( zxdg_surface_v6 : * mut super :: zxdg_surface_v6 :: zxdg_surface_v6 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zxdg_surface_v6 as _ , user_data ) ; } pub unsafe fn zxdg_surface_v6_get_user_data ( zxdg_surface_v6 : * mut super :: zxdg_surface_v6 :: zxdg_surface_v6 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zxdg_surface_v6 as _ ) ; } pub unsafe fn zxdg_surface_v6_get_version ( zxdg_surface_v6 : * mut super :: zxdg_surface_v6 :: zxdg_surface_v6 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zxdg_surface_v6 as _ ) ; } pub unsafe fn zxdg_surface_v6_add_listener ( zxdg_surface_v6 : * mut super :: zxdg_surface_v6 :: zxdg_surface_v6 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zxdg_surface_v6 as _ , listener as _ , data as _ ) ; } pub unsafe fn zxdg_surface_v6_add_rust_listener ( zxdg_surface_v6 : * mut super :: zxdg_surface_v6 :: zxdg_surface_v6 , listener : & dyn zxdg_surface_v6_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zxdg_surface_v6_add_listener ( zxdg_surface_v6 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the xdg_surface\n\nDestroy the xdg_surface object. An xdg_surface must only be destroyed\nafter its role object has been destroyed." ] pub unsafe fn zxdg_surface_v6_destroy ( zxdg_surface_v6 : * mut super :: zxdg_surface_v6 :: zxdg_surface_v6 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_surface_v6 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zxdg_surface_v6 as _ ) ; } # [ doc = "assign the xdg_toplevel surface role\n\nThis creates an xdg_toplevel object for the given xdg_surface and gives\nthe associated wl_surface the xdg_toplevel role.\n\nSee the documentation of xdg_toplevel for more details about what an\nxdg_toplevel is and how it is used." ] pub unsafe fn zxdg_surface_v6_get_toplevel ( zxdg_surface_v6 : * mut super :: zxdg_surface_v6 :: zxdg_surface_v6 ) -> * mut super :: zxdg_toplevel_v6 :: zxdg_toplevel_v6 { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zxdg_surface_v6 as _ , 1u32 , & super :: zxdg_toplevel_v6 :: zxdg_toplevel_v6_interface as * const _ , std :: ptr :: null :: < c_void > ( ) ) ; return r as _ ; } # [ doc = "assign the xdg_popup surface role\n\nThis creates an xdg_popup object for the given xdg_surface and gives the\nassociated wl_surface the xdg_popup role.\n\nSee the documentation of xdg_popup for more details about what an\nxdg_popup is and how it is used." ] pub unsafe fn zxdg_surface_v6_get_popup ( zxdg_surface_v6 : * mut super :: zxdg_surface_v6 :: zxdg_surface_v6 , parent : * mut super :: zxdg_surface_v6 :: zxdg_surface_v6 , positioner : * mut super :: zxdg_positioner_v6 :: zxdg_positioner_v6 ) -> * mut super :: zxdg_popup_v6 :: zxdg_popup_v6 { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zxdg_surface_v6 as _ , 2u32 , & super :: zxdg_popup_v6 :: zxdg_popup_v6_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , parent , positioner ) ; return r as _ ; } # [ doc = "set the new window geometry\n\nThe window geometry of a surface is its \"visible bounds\" from the\nuser's perspective. Client-side decorations often have invisible\nportions like drop-shadows which should be ignored for the\npurposes of aligning, placing and constraining windows.\n\nThe window geometry is double buffered, and will be applied at the\ntime wl_surface.commit of the corresponding wl_surface is called.\n\nOnce the window geometry of the surface is set, it is not possible to\nunset it, and it will remain the same until set_window_geometry is\ncalled again, even if a new subsurface or buffer is attached.\n\nIf never set, the value is the full bounds of the surface,\nincluding any subsurfaces. This updates dynamically on every\ncommit. This unset is meant for extremely simple clients.\n\nThe arguments are given in the surface-local coordinate space of\nthe wl_surface associated with this xdg_surface.\n\nThe width and height must be greater than zero. Setting an invalid size\nwill raise an error. When applied, the effective window geometry will be\nthe set window geometry clamped to the bounding rectangle of the\ncombined geometry of the surface of the xdg_surface and the associated\nsubsurfaces." ] pub unsafe fn zxdg_surface_v6_set_window_geometry ( zxdg_surface_v6 : * mut super :: zxdg_surface_v6 :: zxdg_surface_v6 , x : i32 , y : i32 , width : i32 , height : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_surface_v6 as _ , 3u32 , x , y , width , height , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "ack a configure event\n\nWhen a configure event is received, if a client commits the\nsurface in response to the configure event, then the client\nmust make an ack_configure request sometime before the commit\nrequest, passing along the serial of the configure event.\n\nFor instance, for toplevel surfaces the compositor might use this\ninformation to move a surface to the top left only when the client has\ndrawn itself for the maximized or fullscreen state.\n\nIf the client receives multiple configure events before it\ncan respond to one, it only has to ack the last configure event.\n\nA client is not required to commit immediately after sending\nan ack_configure request - it may even ack_configure several times\nbefore its next surface commit.\n\nA client may send multiple ack_configure requests before committing, but\nonly the last request sent before a commit indicates which configure\nevent the client really is responding to." ] pub unsafe fn zxdg_surface_v6_ack_configure ( zxdg_surface_v6 : * mut super :: zxdg_surface_v6 :: zxdg_surface_v6 , serial : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_surface_v6 as _ , 4u32 , serial , std :: ptr :: null :: < c_void > ( ) ) ; } } # [ doc = "toplevel surface\n\nThis interface defines an xdg_surface role which allows a surface to,\namong other things, set window-like properties such as maximize,\nfullscreen, and minimize, set application-specific metadata like title and\nid, and well as trigger user interactive operations such as interactive\nresize and move." ] pub mod zxdg_toplevel_v6 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zxdg_toplevel_v6 { } # [ doc = "edge values for resizing\n\nThese values are used to indicate which edge of a surface\nis being dragged in a resize operation." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum resize_edge { none = 0 , top = 1 , bottom = 2 , left = 4 , top_left = 5 , bottom_left = 6 , right = 8 , top_right = 9 , bottom_right = 10 , # [ doc ( hidden ) ] __nonexhaustive , } impl resize_edge { pub fn from_raw ( n : u32 ) -> Option < resize_edge > { match n { 0 => Some ( resize_edge :: none ) , 1 => Some ( resize_edge :: top ) , 2 => Some ( resize_edge :: bottom ) , 4 => Some ( resize_edge :: left ) , 5 => Some ( resize_edge :: top_left ) , 6 => Some ( resize_edge :: bottom_left ) , 8 => Some ( resize_edge :: right ) , 9 => Some ( resize_edge :: top_right ) , 10 => Some ( resize_edge :: bottom_right ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ doc = "types of state on the surface\n\nThe different state values used on the surface. This is designed for\nstate values like maximized, fullscreen. It is paired with the\nconfigure event to ensure that both the client and the compositor\nsetting the state can be synchronized.\n\nStates set in this way are double-buffered. They will get applied on\nthe next commit." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum state { # [ doc = "the surface is maximized\n\nThe surface is maximized. The window geometry specified in the configure\nevent must be obeyed by the client." ] maximized = 1 , # [ doc = "the surface is fullscreen\n\nThe surface is fullscreen. The window geometry specified in the configure\nevent must be obeyed by the client." ] fullscreen = 2 , # [ doc = "the surface is being resized\n\nThe surface is being resized. The window geometry specified in the\nconfigure event is a maximum; the client cannot resize beyond it.\nClients that have aspect ratio or cell sizing configuration can use\na smaller size, however." ] resizing = 3 , # [ doc = "the surface is now activated\n\nClient window decorations should be painted as if the window is\nactive. Do not assume this means that the window actually has\nkeyboard or pointer focus." ] activated = 4 , # [ doc ( hidden ) ] __nonexhaustive , } impl state { pub fn from_raw ( n : u32 ) -> Option < state > { match n { 1 => Some ( state :: maximized ) , 2 => Some ( state :: fullscreen ) , 3 => Some ( state :: resizing ) , 4 => Some ( state :: activated ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } static mut zxdg_toplevel_v6_requests_set_parent_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: zxdg_toplevel_v6 :: zxdg_toplevel_v6_interface as * const wl_interface } , ] ; static mut zxdg_toplevel_v6_requests_show_window_menu_types : [ * const wl_interface ; 4 ] = [ unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , ] ; static mut zxdg_toplevel_v6_requests_move_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface , ] ; static mut zxdg_toplevel_v6_requests_resize_types : [ * const wl_interface ; 3 ] = [ unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , ] ; static mut zxdg_toplevel_v6_requests_set_fullscreen_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zxdg_toplevel_v6_requests : [ wl_message ; 14 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_parent\0" as * const u8 as * const c_char , signature : b"?o\0" as * const u8 as * const c_char , types : unsafe { & zxdg_toplevel_v6_requests_set_parent_types as * const _ } , } , wl_message { name : b"set_title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"show_window_menu\0" as * const u8 as * const c_char , signature : b"ouii\0" as * const u8 as * const c_char , types : unsafe { & zxdg_toplevel_v6_requests_show_window_menu_types as * const _ } , } , wl_message { name : b"move\0" as * const u8 as * const c_char , signature : b"ou\0" as * const u8 as * const c_char , types : unsafe { & zxdg_toplevel_v6_requests_move_types as * const _ } , } , wl_message { name : b"resize\0" as * const u8 as * const c_char , signature : b"ouu\0" as * const u8 as * const c_char , types : unsafe { & zxdg_toplevel_v6_requests_resize_types as * const _ } , } , wl_message { name : b"set_max_size\0" as * const u8 as * const c_char , signature : b"ii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_min_size\0" as * const u8 as * const c_char , signature : b"ii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"?o\0" as * const u8 as * const c_char , types : unsafe { & zxdg_toplevel_v6_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zxdg_toplevel_v6_events : [ wl_message ; 2 ] = [ wl_message { name : b"configure\0" as * const u8 as * const c_char , signature : b"iia\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zxdg_toplevel_v6_interface : wl_interface = wl_interface { name : b"zxdg_toplevel_v6\0" as * const u8 as * const c_char , version : 1 , request_count : 14 , requests : unsafe { & zxdg_toplevel_v6_requests as * const _ } , event_count : 2 , events : unsafe { & zxdg_toplevel_v6_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zxdg_toplevel_v6_listener { # [ doc = "suggest a surface change\n\nThis configure event asks the client to resize its toplevel surface or\nto change its state. The configured state should not be applied\nimmediately. See xdg_surface.configure for details.\n\nThe width and height arguments specify a hint to the window\nabout how its surface should be resized in window geometry\ncoordinates. See set_window_geometry.\n\nIf the width or height arguments are zero, it means the client\nshould decide its own window dimension. This may happen when the\ncompositor needs to configure the state of the surface but doesn't\nhave any information about any previous or expected dimension.\n\nThe states listed in the event specify how the width/height\narguments should be interpreted, and possibly how it should be\ndrawn.\n\nClients must send an ack_configure in response to this event. See\nxdg_surface.configure and xdg_surface.ack_configure for details." ] fn configure ( & mut self , object : * mut zxdg_toplevel_v6 , width : i32 , height : i32 , states : * mut wl_array ) { } # [ doc = "surface wants to be closed\n\nThe close event is sent by the compositor when the user\nwants the surface to be closed. This should be equivalent to\nthe user clicking the close button in client-side decorations,\nif your application has any.\n\nThis is only a request that the user intends to close the\nwindow. The client may choose to ignore this request, or show\na dialog to ask the user to save their data, etc." ] fn close ( & mut self , object : * mut zxdg_toplevel_v6 , ) { } } pub unsafe fn zxdg_toplevel_v6_set_user_data ( zxdg_toplevel_v6 : * mut super :: zxdg_toplevel_v6 :: zxdg_toplevel_v6 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zxdg_toplevel_v6 as _ , user_data ) ; } pub unsafe fn zxdg_toplevel_v6_get_user_data ( zxdg_toplevel_v6 : * mut super :: zxdg_toplevel_v6 :: zxdg_toplevel_v6 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zxdg_toplevel_v6 as _ ) ; } pub unsafe fn zxdg_toplevel_v6_get_version ( zxdg_toplevel_v6 : * mut super :: zxdg_toplevel_v6 :: zxdg_toplevel_v6 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zxdg_toplevel_v6 as _ ) ; } pub unsafe fn zxdg_toplevel_v6_add_listener ( zxdg_toplevel_v6 : * mut super :: zxdg_toplevel_v6 :: zxdg_toplevel_v6 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zxdg_toplevel_v6 as _ , listener as _ , data as _ ) ; } pub unsafe fn zxdg_toplevel_v6_add_rust_listener ( zxdg_toplevel_v6 : * mut super :: zxdg_toplevel_v6 :: zxdg_toplevel_v6 , listener : & dyn zxdg_toplevel_v6_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zxdg_toplevel_v6_add_listener ( zxdg_toplevel_v6 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the xdg_toplevel\n\nUnmap and destroy the window. The window will be effectively\nhidden from the user's point of view, and all state like\nmaximization, fullscreen, and so on, will be lost." ] pub unsafe fn zxdg_toplevel_v6_destroy ( zxdg_toplevel_v6 : * mut super :: zxdg_toplevel_v6 :: zxdg_toplevel_v6 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_toplevel_v6 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zxdg_toplevel_v6 as _ ) ; } # [ doc = "set the parent of this surface\n\nSet the \"parent\" of this surface. This window should be stacked\nabove a parent. The parent surface must be mapped as long as this\nsurface is mapped.\n\nParent windows should be set on dialogs, toolboxes, or other\n\"auxiliary\" surfaces, so that the parent is raised when the dialog\nis raised." ] pub unsafe fn zxdg_toplevel_v6_set_parent ( zxdg_toplevel_v6 : * mut super :: zxdg_toplevel_v6 :: zxdg_toplevel_v6 , parent : * mut super :: zxdg_toplevel_v6 :: zxdg_toplevel_v6 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_toplevel_v6 as _ , 1u32 , parent , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set surface title\n\nSet a short title for the surface.\n\nThis string may be used to identify the surface in a task bar,\nwindow list, or other user interface elements provided by the\ncompositor.\n\nThe string must be encoded in UTF-8." ] pub unsafe fn zxdg_toplevel_v6_set_title ( zxdg_toplevel_v6 : * mut super :: zxdg_toplevel_v6 :: zxdg_toplevel_v6 , title : * mut c_char ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_toplevel_v6 as _ , 2u32 , title , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set application ID\n\nSet an application identifier for the surface.\n\nThe app ID identifies the general class of applications to which\nthe surface belongs. The compositor can use this to group multiple\nsurfaces together, or to determine how to launch a new application.\n\nFor D-Bus activatable applications, the app ID is used as the D-Bus\nservice name.\n\nThe compositor shell will try to group application surfaces together\nby their app ID. As a best practice, it is suggested to select app\nID's that match the basename of the application's .desktop file.\nFor example, \"org.freedesktop.FooViewer\" where the .desktop file is\n\"org.freedesktop.FooViewer.desktop\".\n\nSee the desktop-entry specification [0] for more details on\napplication identifiers and how they relate to well-known D-Bus\nnames and .desktop files.\n\n[0] http://standards.freedesktop.org/desktop-entry-spec/" ] pub unsafe fn zxdg_toplevel_v6_set_app_id ( zxdg_toplevel_v6 : * mut super :: zxdg_toplevel_v6 :: zxdg_toplevel_v6 , app_id : * mut c_char ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_toplevel_v6 as _ , 3u32 , app_id , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "show the window menu\n\nClients implementing client-side decorations might want to show\na context menu when right-clicking on the decorations, giving the\nuser a menu that they can use to maximize or minimize the window.\n\nThis request asks the compositor to pop up such a window menu at\nthe given position, relative to the local surface coordinates of\nthe parent surface. There are no guarantees as to what menu items\nthe window menu contains.\n\nThis request must be used in response to some sort of user action\nlike a button press, key press, or touch down event." ] pub unsafe fn zxdg_toplevel_v6_show_window_menu ( zxdg_toplevel_v6 : * mut super :: zxdg_toplevel_v6 :: zxdg_toplevel_v6 , seat : * mut super :: wl_seat :: wl_seat , serial : u32 , x : i32 , y : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_toplevel_v6 as _ , 4u32 , seat , serial , x , y , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "start an interactive move\n\nStart an interactive, user-driven move of the surface.\n\nThis request must be used in response to some sort of user action\nlike a button press, key press, or touch down event. The passed\nserial is used to determine the type of interactive move (touch,\npointer, etc).\n\nThe server may ignore move requests depending on the state of\nthe surface (e.g. fullscreen or maximized), or if the passed serial\nis no longer valid.\n\nIf triggered, the surface will lose the focus of the device\n(wl_pointer, wl_touch, etc) used for the move. It is up to the\ncompositor to visually indicate that the move is taking place, such as\nupdating a pointer cursor, during the move. There is no guarantee\nthat the device focus will return when the move is completed." ] pub unsafe fn zxdg_toplevel_v6_move ( zxdg_toplevel_v6 : * mut super :: zxdg_toplevel_v6 :: zxdg_toplevel_v6 , seat : * mut super :: wl_seat :: wl_seat , serial : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_toplevel_v6 as _ , 5u32 , seat , serial , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "start an interactive resize\n\nStart a user-driven, interactive resize of the surface.\n\nThis request must be used in response to some sort of user action\nlike a button press, key press, or touch down event. The passed\nserial is used to determine the type of interactive resize (touch,\npointer, etc).\n\nThe server may ignore resize requests depending on the state of\nthe surface (e.g. fullscreen or maximized).\n\nIf triggered, the client will receive configure events with the\n\"resize\" state enum value and the expected sizes. See the \"resize\"\nenum value for more details about what is required. The client\nmust also acknowledge configure events using \"ack_configure\". After\nthe resize is completed, the client will receive another \"configure\"\nevent without the resize state.\n\nIf triggered, the surface also will lose the focus of the device\n(wl_pointer, wl_touch, etc) used for the resize. It is up to the\ncompositor to visually indicate that the resize is taking place,\nsuch as updating a pointer cursor, during the resize. There is no\nguarantee that the device focus will return when the resize is\ncompleted.\n\nThe edges parameter specifies how the surface should be resized,\nand is one of the values of the resize_edge enum. The compositor\nmay use this information to update the surface position for\nexample when dragging the top left corner. The compositor may also\nuse this information to adapt its behavior, e.g. choose an\nappropriate cursor image." ] pub unsafe fn zxdg_toplevel_v6_resize ( zxdg_toplevel_v6 : * mut super :: zxdg_toplevel_v6 :: zxdg_toplevel_v6 , seat : * mut super :: wl_seat :: wl_seat , serial : u32 , edges : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_toplevel_v6 as _ , 6u32 , seat , serial , edges , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set the maximum size\n\nSet a maximum size for the window.\n\nThe client can specify a maximum size so that the compositor does\nnot try to configure the window beyond this size.\n\nThe width and height arguments are in window geometry coordinates.\nSee xdg_surface.set_window_geometry.\n\nValues set in this way are double-buffered. They will get applied\non the next commit.\n\nThe compositor can use this information to allow or disallow\ndifferent states like maximize or fullscreen and draw accurate\nanimations.\n\nSimilarly, a tiling window manager may use this information to\nplace and resize client windows in a more effective way.\n\nThe client should not rely on the compositor to obey the maximum\nsize. The compositor may decide to ignore the values set by the\nclient and request a larger size.\n\nIf never set, or a value of zero in the request, means that the\nclient has no expected maximum size in the given dimension.\nAs a result, a client wishing to reset the maximum size\nto an unspecified state can use zero for width and height in the\nrequest.\n\nRequesting a maximum size to be smaller than the minimum size of\na surface is illegal and will result in a protocol error.\n\nThe width and height must be greater than or equal to zero. Using\nstrictly negative values for width and height will result in a\nprotocol error." ] pub unsafe fn zxdg_toplevel_v6_set_max_size ( zxdg_toplevel_v6 : * mut super :: zxdg_toplevel_v6 :: zxdg_toplevel_v6 , width : i32 , height : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_toplevel_v6 as _ , 7u32 , width , height , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set the minimum size\n\nSet a minimum size for the window.\n\nThe client can specify a minimum size so that the compositor does\nnot try to configure the window below this size.\n\nThe width and height arguments are in window geometry coordinates.\nSee xdg_surface.set_window_geometry.\n\nValues set in this way are double-buffered. They will get applied\non the next commit.\n\nThe compositor can use this information to allow or disallow\ndifferent states like maximize or fullscreen and draw accurate\nanimations.\n\nSimilarly, a tiling window manager may use this information to\nplace and resize client windows in a more effective way.\n\nThe client should not rely on the compositor to obey the minimum\nsize. The compositor may decide to ignore the values set by the\nclient and request a smaller size.\n\nIf never set, or a value of zero in the request, means that the\nclient has no expected minimum size in the given dimension.\nAs a result, a client wishing to reset the minimum size\nto an unspecified state can use zero for width and height in the\nrequest.\n\nRequesting a minimum size to be larger than the maximum size of\na surface is illegal and will result in a protocol error.\n\nThe width and height must be greater than or equal to zero. Using\nstrictly negative values for width and height will result in a\nprotocol error." ] pub unsafe fn zxdg_toplevel_v6_set_min_size ( zxdg_toplevel_v6 : * mut super :: zxdg_toplevel_v6 :: zxdg_toplevel_v6 , width : i32 , height : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_toplevel_v6 as _ , 8u32 , width , height , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "maximize the window\n\nMaximize the surface.\n\nAfter requesting that the surface should be maximized, the compositor\nwill respond by emitting a configure event with the \"maximized\" state\nand the required window geometry. The client should then update its\ncontent, drawing it in a maximized state, i.e. without shadow or other\ndecoration outside of the window geometry. The client must also\nacknowledge the configure when committing the new content (see\nack_configure).\n\nIt is up to the compositor to decide how and where to maximize the\nsurface, for example which output and what region of the screen should\nbe used.\n\nIf the surface was already maximized, the compositor will still emit\na configure event with the \"maximized\" state." ] pub unsafe fn zxdg_toplevel_v6_set_maximized ( zxdg_toplevel_v6 : * mut super :: zxdg_toplevel_v6 :: zxdg_toplevel_v6 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_toplevel_v6 as _ , 9u32 , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "unmaximize the window\n\nUnmaximize the surface.\n\nAfter requesting that the surface should be unmaximized, the compositor\nwill respond by emitting a configure event without the \"maximized\"\nstate. If available, the compositor will include the window geometry\ndimensions the window had prior to being maximized in the configure\nrequest. The client must then update its content, drawing it in a\nregular state, i.e. potentially with shadow, etc. The client must also\nacknowledge the configure when committing the new content (see\nack_configure).\n\nIt is up to the compositor to position the surface after it was\nunmaximized; usually the position the surface had before maximizing, if\napplicable.\n\nIf the surface was already not maximized, the compositor will still\nemit a configure event without the \"maximized\" state." ] pub unsafe fn zxdg_toplevel_v6_unset_maximized ( zxdg_toplevel_v6 : * mut super :: zxdg_toplevel_v6 :: zxdg_toplevel_v6 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_toplevel_v6 as _ , 10u32 , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set the window as fullscreen on a monitor\n\nMake the surface fullscreen.\n\nYou can specify an output that you would prefer to be fullscreen.\nIf this value is NULL, it's up to the compositor to choose which\ndisplay will be used to map this surface.\n\nIf the surface doesn't cover the whole output, the compositor will\nposition the surface in the center of the output and compensate with\nblack borders filling the rest of the output." ] pub unsafe fn zxdg_toplevel_v6_set_fullscreen ( zxdg_toplevel_v6 : * mut super :: zxdg_toplevel_v6 :: zxdg_toplevel_v6 , output : * mut super :: wl_output :: wl_output ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_toplevel_v6 as _ , 11u32 , output , std :: ptr :: null :: < c_void > ( ) ) ; } pub unsafe fn zxdg_toplevel_v6_unset_fullscreen ( zxdg_toplevel_v6 : * mut super :: zxdg_toplevel_v6 :: zxdg_toplevel_v6 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_toplevel_v6 as _ , 12u32 , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set the window as minimized\n\nRequest that the compositor minimize your surface. There is no\nway to know if the surface is currently minimized, nor is there\nany way to unset minimization on this surface.\n\nIf you are looking to throttle redrawing when minimized, please\ninstead use the wl_surface.frame event for this, as this will\nalso work with live previews on windows in Alt-Tab, Expose or\nsimilar compositor features." ] pub unsafe fn zxdg_toplevel_v6_set_minimized ( zxdg_toplevel_v6 : * mut super :: zxdg_toplevel_v6 :: zxdg_toplevel_v6 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_toplevel_v6 as _ , 13u32 , std :: ptr :: null :: < c_void > ( ) ) ; } } # [ doc = "short-lived, popup surfaces for menus\n\nA popup surface is a short-lived, temporary surface. It can be used to\nimplement for example menus, popovers, tooltips and other similar user\ninterface concepts.\n\nA popup can be made to take an explicit grab. See xdg_popup.grab for\ndetails.\n\nWhen the popup is dismissed, a popup_done event will be sent out, and at\nthe same time the surface will be unmapped. See the xdg_popup.popup_done\nevent for details.\n\nExplicitly destroying the xdg_popup object will also dismiss the popup and\nunmap the surface. Clients that want to dismiss the popup when another\nsurface of their own is clicked should dismiss the popup using the destroy\nrequest.\n\nThe parent surface must have either the xdg_toplevel or xdg_popup surface\nrole.\n\nA newly created xdg_popup will be stacked on top of all previously created\nxdg_popup surfaces associated with the same xdg_toplevel.\n\nThe parent of an xdg_popup must be mapped (see the xdg_surface\ndescription) before the xdg_popup itself.\n\nThe x and y arguments passed when creating the popup object specify\nwhere the top left of the popup should be placed, relative to the\nlocal surface coordinates of the parent surface. See\nxdg_surface.get_popup. An xdg_popup must intersect with or be at least\npartially adjacent to its parent surface.\n\nThe client must call wl_surface.commit on the corresponding wl_surface\nfor the xdg_popup state to take effect." ] pub mod zxdg_popup_v6 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zxdg_popup_v6 { } # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum error { # [ doc = "tried to grab after being mapped" ] invalid_grab = 0 , # [ doc ( hidden ) ] __nonexhaustive , } impl error { pub fn from_raw ( n : u32 ) -> Option < error > { match n { 0 => Some ( error :: invalid_grab ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } static mut zxdg_popup_v6_requests_grab_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zxdg_popup_v6_requests : [ wl_message ; 2 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"grab\0" as * const u8 as * const c_char , signature : b"ou\0" as * const u8 as * const c_char , types : unsafe { & zxdg_popup_v6_requests_grab_types as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zxdg_popup_v6_events : [ wl_message ; 2 ] = [ wl_message { name : b"configure\0" as * const u8 as * const c_char , signature : b"iiii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"popup_done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zxdg_popup_v6_interface : wl_interface = wl_interface { name : b"zxdg_popup_v6\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & zxdg_popup_v6_requests as * const _ } , event_count : 2 , events : unsafe { & zxdg_popup_v6_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zxdg_popup_v6_listener { # [ doc = "configure the popup surface\n\nThis event asks the popup surface to configure itself given the\nconfiguration. The configured state should not be applied immediately.\nSee xdg_surface.configure for details.\n\nThe x and y arguments represent the position the popup was placed at\ngiven the xdg_positioner rule, relative to the upper left corner of the\nwindow geometry of the parent surface." ] fn configure ( & mut self , object : * mut zxdg_popup_v6 , x : i32 , y : i32 , width : i32 , height : i32 ) { } # [ doc = "popup interaction is done\n\nThe popup_done event is sent out when a popup is dismissed by the\ncompositor. The client should destroy the xdg_popup object at this\npoint." ] fn popup_done ( & mut self , object : * mut zxdg_popup_v6 , ) { } } pub unsafe fn zxdg_popup_v6_set_user_data ( zxdg_popup_v6 : * mut super :: zxdg_popup_v6 :: zxdg_popup_v6 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zxdg_popup_v6 as _ , user_data ) ; } pub unsafe fn zxdg_popup_v6_get_user_data ( zxdg_popup_v6 : * mut super :: zxdg_popup_v6 :: zxdg_popup_v6 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zxdg_popup_v6 as _ ) ; } pub unsafe fn zxdg_popup_v6_get_version ( zxdg_popup_v6 : * mut super :: zxdg_popup_v6 :: zxdg_popup_v6 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zxdg_popup_v6 as _ ) ; } pub unsafe fn zxdg_popup_v6_add_listener ( zxdg_popup_v6 : * mut super :: zxdg_popup_v6 :: zxdg_popup_v6 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zxdg_popup_v6 as _ , listener as _ , data as _ ) ; } pub unsafe fn zxdg_popup_v6_add_rust_listener ( zxdg_popup_v6 : * mut super :: zxdg_popup_v6 :: zxdg_popup_v6 , listener : & dyn zxdg_popup_v6_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zxdg_popup_v6_add_listener ( zxdg_popup_v6 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "remove xdg_popup interface\n\nThis destroys the popup. Explicitly destroying the xdg_popup\nobject will also dismiss the popup, and unmap the surface.\n\nIf this xdg_popup is not the \"topmost\" popup, a protocol error\nwill be sent." ] pub unsafe fn zxdg_popup_v6_destroy ( zxdg_popup_v6 : * mut super :: zxdg_popup_v6 :: zxdg_popup_v6 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_popup_v6 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zxdg_popup_v6 as _ ) ; } # [ doc = "make the popup take an explicit grab\n\nThis request makes the created popup take an explicit grab. An explicit\ngrab will be dismissed when the user dismisses the popup, or when the\nclient destroys the xdg_popup. This can be done by the user clicking\noutside the surface, using the keyboard, or even locking the screen\nthrough closing the lid or a timeout.\n\nIf the compositor denies the grab, the popup will be immediately\ndismissed.\n\nThis request must be used in response to some sort of user action like a\nbutton press, key press, or touch down event. The serial number of the\nevent should be passed as 'serial'.\n\nThe parent of a grabbing popup must either be an xdg_toplevel surface or\nanother xdg_popup with an explicit grab. If the parent is another\nxdg_popup it means that the popups are nested, with this popup now being\nthe topmost popup.\n\nNested popups must be destroyed in the reverse order they were created\nin, e.g. the only popup you are allowed to destroy at all times is the\ntopmost one.\n\nWhen compositors choose to dismiss a popup, they may dismiss every\nnested grabbing popup as well. When a compositor dismisses popups, it\nwill follow the same dismissing order as required from the client.\n\nThe parent of a grabbing popup must either be another xdg_popup with an\nactive explicit grab, or an xdg_popup or xdg_toplevel, if there are no\nexplicit grabs already taken.\n\nIf the topmost grabbing popup is destroyed, the grab will be returned to\nthe parent of the popup, if that parent previously had an explicit grab.\n\nIf the parent is a grabbing popup which has already been dismissed, this\npopup will be immediately dismissed. If the parent is a popup that did\nnot take an explicit grab, an error will be raised.\n\nDuring a popup grab, the client owning the grab will receive pointer\nand touch events for all their surfaces as normal (similar to an\n\"owner-events\" grab in X11 parlance), while the top most grabbing popup\nwill always have keyboard focus." ] pub unsafe fn zxdg_popup_v6_grab ( zxdg_popup_v6 : * mut super :: zxdg_popup_v6 :: zxdg_popup_v6 , seat : * mut super :: wl_seat :: wl_seat , serial : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_popup_v6 as _ , 1u32 , seat , serial , std :: ptr :: null :: < c_void > ( ) ) ; } } } pub mod xdg_decoration_unstable_v1 { use super :: wayland :: * ; use super :: xdg_shell :: * ; # [ doc = "window decoration manager\n\nThis interface allows a compositor to announce support for server-side\ndecorations.\n\nA window decoration is a set of window controls as deemed appropriate by\nthe party managing them, such as user interface components used to move,\nresize and change a window's state.\n\nA client can use this protocol to request being decorated by a supporting\ncompositor.\n\nIf compositor and client do not negotiate the use of a server-side\ndecoration using this protocol, clients continue to self-decorate as they\nsee fit.\n\nWarning! The protocol described in this file is experimental and\nbackward incompatible changes may be made. Backward compatible changes\nmay be added together with the corresponding interface version bump.\nBackward incompatible changes are done by bumping the version number in\nthe protocol and interface names and resetting the interface version.\nOnce the protocol is to be declared stable, the 'z' prefix and the\nversion number in the protocol and interface names are removed and the\ninterface version number is reset." ] pub mod zxdg_decoration_manager_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zxdg_decoration_manager_v1 { } static mut zxdg_decoration_manager_v1_requests_get_toplevel_decoration_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: zxdg_toplevel_decoration_v1 :: zxdg_toplevel_decoration_v1_interface as * const wl_interface } , unsafe { & super :: xdg_toplevel :: xdg_toplevel_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zxdg_decoration_manager_v1_requests : [ wl_message ; 2 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_toplevel_decoration\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zxdg_decoration_manager_v1_requests_get_toplevel_decoration_types as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zxdg_decoration_manager_v1_interface : wl_interface = wl_interface { name : b"zxdg_decoration_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & zxdg_decoration_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait zxdg_decoration_manager_v1_listener { } pub unsafe fn zxdg_decoration_manager_v1_set_user_data ( zxdg_decoration_manager_v1 : * mut super :: zxdg_decoration_manager_v1 :: zxdg_decoration_manager_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zxdg_decoration_manager_v1 as _ , user_data ) ; } pub unsafe fn zxdg_decoration_manager_v1_get_user_data ( zxdg_decoration_manager_v1 : * mut super :: zxdg_decoration_manager_v1 :: zxdg_decoration_manager_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zxdg_decoration_manager_v1 as _ ) ; } pub unsafe fn zxdg_decoration_manager_v1_get_version ( zxdg_decoration_manager_v1 : * mut super :: zxdg_decoration_manager_v1 :: zxdg_decoration_manager_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zxdg_decoration_manager_v1 as _ ) ; } pub unsafe fn zxdg_decoration_manager_v1_add_listener ( zxdg_decoration_manager_v1 : * mut super :: zxdg_decoration_manager_v1 :: zxdg_decoration_manager_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zxdg_decoration_manager_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zxdg_decoration_manager_v1_add_rust_listener ( zxdg_decoration_manager_v1 : * mut super :: zxdg_decoration_manager_v1 :: zxdg_decoration_manager_v1 , listener : & dyn zxdg_decoration_manager_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zxdg_decoration_manager_v1_add_listener ( zxdg_decoration_manager_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the decoration manager object\n\nDestroy the decoration manager. This doesn't destroy objects created\nwith the manager." ] pub unsafe fn zxdg_decoration_manager_v1_destroy ( zxdg_decoration_manager_v1 : * mut super :: zxdg_decoration_manager_v1 :: zxdg_decoration_manager_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_decoration_manager_v1 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zxdg_decoration_manager_v1 as _ ) ; } # [ doc = "create a new toplevel decoration object\n\nCreate a new decoration object associated with the given toplevel.\n\nCreating an xdg_toplevel_decoration from an xdg_toplevel which has a\nbuffer attached or committed is a client error, and any attempts by a\nclient to attach or manipulate a buffer prior to the first\nxdg_toplevel_decoration.configure event must also be treated as\nerrors." ] pub unsafe fn zxdg_decoration_manager_v1_get_toplevel_decoration ( zxdg_decoration_manager_v1 : * mut super :: zxdg_decoration_manager_v1 :: zxdg_decoration_manager_v1 , toplevel : * mut super :: xdg_toplevel :: xdg_toplevel ) -> * mut super :: zxdg_toplevel_decoration_v1 :: zxdg_toplevel_decoration_v1 { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zxdg_decoration_manager_v1 as _ , 1u32 , & super :: zxdg_toplevel_decoration_v1 :: zxdg_toplevel_decoration_v1_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , toplevel ) ; return r as _ ; } } # [ doc = "decoration object for a toplevel surface\n\nThe decoration object allows the compositor to toggle server-side window\ndecorations for a toplevel surface. The client can request to switch to\nanother mode.\n\nThe xdg_toplevel_decoration object must be destroyed before its\nxdg_toplevel." ] pub mod zxdg_toplevel_decoration_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zxdg_toplevel_decoration_v1 { } # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum error { # [ doc = "xdg_toplevel has a buffer attached before configure" ] unconfigured_buffer = 0 , # [ doc = "xdg_toplevel already has a decoration object" ] already_constructed = 1 , # [ doc = "xdg_toplevel destroyed before the decoration object" ] orphaned = 2 , # [ doc ( hidden ) ] __nonexhaustive , } impl error { pub fn from_raw ( n : u32 ) -> Option < error > { match n { 0 => Some ( error :: unconfigured_buffer ) , 1 => Some ( error :: already_constructed ) , 2 => Some ( error :: orphaned ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ doc = "window decoration modes\n\nThese values describe window decoration modes." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum mode { # [ doc = "no server-side window decoration" ] client_side = 1 , # [ doc = "server-side window decoration" ] server_side = 2 , # [ doc ( hidden ) ] __nonexhaustive , } impl mode { pub fn from_raw ( n : u32 ) -> Option < mode > { match n { 1 => Some ( mode :: client_side ) , 2 => Some ( mode :: server_side ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zxdg_toplevel_decoration_v1_requests : [ wl_message ; 3 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_mode\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_mode\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zxdg_toplevel_decoration_v1_events : [ wl_message ; 1 ] = [ wl_message { name : b"configure\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zxdg_toplevel_decoration_v1_interface : wl_interface = wl_interface { name : b"zxdg_toplevel_decoration_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 3 , requests : unsafe { & zxdg_toplevel_decoration_v1_requests as * const _ } , event_count : 1 , events : unsafe { & zxdg_toplevel_decoration_v1_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zxdg_toplevel_decoration_v1_listener { # [ doc = "suggest a surface change\n\nThe configure event asks the client to change its decoration mode. The\nconfigured state should not be applied immediately. Clients must send an\nack_configure in response to this event. See xdg_surface.configure and\nxdg_surface.ack_configure for details.\n\nA configure event can be sent at any time. The specified mode must be\nobeyed by the client." ] fn configure ( & mut self , object : * mut zxdg_toplevel_decoration_v1 , mode : mode ) { } } pub unsafe fn zxdg_toplevel_decoration_v1_set_user_data ( zxdg_toplevel_decoration_v1 : * mut super :: zxdg_toplevel_decoration_v1 :: zxdg_toplevel_decoration_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zxdg_toplevel_decoration_v1 as _ , user_data ) ; } pub unsafe fn zxdg_toplevel_decoration_v1_get_user_data ( zxdg_toplevel_decoration_v1 : * mut super :: zxdg_toplevel_decoration_v1 :: zxdg_toplevel_decoration_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zxdg_toplevel_decoration_v1 as _ ) ; } pub unsafe fn zxdg_toplevel_decoration_v1_get_version ( zxdg_toplevel_decoration_v1 : * mut super :: zxdg_toplevel_decoration_v1 :: zxdg_toplevel_decoration_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zxdg_toplevel_decoration_v1 as _ ) ; } pub unsafe fn zxdg_toplevel_decoration_v1_add_listener ( zxdg_toplevel_decoration_v1 : * mut super :: zxdg_toplevel_decoration_v1 :: zxdg_toplevel_decoration_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zxdg_toplevel_decoration_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zxdg_toplevel_decoration_v1_add_rust_listener ( zxdg_toplevel_decoration_v1 : * mut super :: zxdg_toplevel_decoration_v1 :: zxdg_toplevel_decoration_v1 , listener : & dyn zxdg_toplevel_decoration_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zxdg_toplevel_decoration_v1_add_listener ( zxdg_toplevel_decoration_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the decoration object\n\nSwitch back to a mode without any server-side decorations at the next\ncommit." ] pub unsafe fn zxdg_toplevel_decoration_v1_destroy ( zxdg_toplevel_decoration_v1 : * mut super :: zxdg_toplevel_decoration_v1 :: zxdg_toplevel_decoration_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_toplevel_decoration_v1 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zxdg_toplevel_decoration_v1 as _ ) ; } # [ doc = "set the decoration mode\n\nSet the toplevel surface decoration mode. This informs the compositor\nthat the client prefers the provided decoration mode.\n\nAfter requesting a decoration mode, the compositor will respond by\nemitting a xdg_surface.configure event. The client should then update\nits content, drawing it without decorations if the received mode is\nserver-side decorations. The client must also acknowledge the configure\nwhen committing the new content (see xdg_surface.ack_configure).\n\nThe compositor can decide not to use the client's mode and enforce a\ndifferent mode instead.\n\nClients whose decoration mode depend on the xdg_toplevel state may send\na set_mode request in response to a xdg_surface.configure event and wait\nfor the next xdg_surface.configure event to prevent unwanted state.\nSuch clients are responsible for preventing configure loops and must\nmake sure not to send multiple successive set_mode requests with the\nsame decoration mode." ] pub unsafe fn zxdg_toplevel_decoration_v1_set_mode ( zxdg_toplevel_decoration_v1 : * mut super :: zxdg_toplevel_decoration_v1 :: zxdg_toplevel_decoration_v1 , mode : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_toplevel_decoration_v1 as _ , 1u32 , mode , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "unset the decoration mode\n\nUnset the toplevel surface decoration mode. This informs the compositor\nthat the client doesn't prefer a particular decoration mode.\n\nThis request has the same semantics as set_mode." ] pub unsafe fn zxdg_toplevel_decoration_v1_unset_mode ( zxdg_toplevel_decoration_v1 : * mut super :: zxdg_toplevel_decoration_v1 :: zxdg_toplevel_decoration_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_toplevel_decoration_v1 as _ , 2u32 , std :: ptr :: null :: < c_void > ( ) ) ; } } } pub mod fullscreen_shell_unstable_v1 { use super :: wayland :: * ; use super :: xdg_shell :: * ; # [ doc = "displays a single surface per output\n\nDisplays a single surface per output.\n\nThis interface provides a mechanism for a single client to display\nsimple full-screen surfaces.  While there technically may be multiple\nclients bound to this interface, only one of those clients should be\nshown at a time.\n\nTo present a surface, the client uses either the present_surface or\npresent_surface_for_mode requests.  Presenting a surface takes effect\non the next wl_surface.commit.  See the individual requests for\ndetails about scaling and mode switches.\n\nThe client can have at most one surface per output at any time.\nRequesting a surface to be presented on an output that already has a\nsurface replaces the previously presented surface.  Presenting a null\nsurface removes its content and effectively disables the output.\nExactly what happens when an output is \"disabled\" is\ncompositor-specific.  The same surface may be presented on multiple\noutputs simultaneously.\n\nOnce a surface is presented on an output, it stays on that output\nuntil either the client removes it or the compositor destroys the\noutput.  This way, the client can update the output's contents by\nsimply attaching a new buffer.\n\nWarning! The protocol described in this file is experimental and\nbackward incompatible changes may be made. Backward compatible changes\nmay be added together with the corresponding interface version bump.\nBackward incompatible changes are done by bumping the version number in\nthe protocol and interface names and resetting the interface version.\nOnce the protocol is to be declared stable, the 'z' prefix and the\nversion number in the protocol and interface names are removed and the\ninterface version number is reset." ] pub mod zwp_fullscreen_shell_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_fullscreen_shell_v1 { } # [ doc = "capabilities advertised by the compositor\n\nVarious capabilities that can be advertised by the compositor.  They\nare advertised one-at-a-time when the wl_fullscreen_shell interface is\nbound.  See the wl_fullscreen_shell.capability event for more details.\n\nARBITRARY_MODES:\nThis is a hint to the client that indicates that the compositor is\ncapable of setting practically any mode on its outputs.  If this\ncapability is provided, wl_fullscreen_shell.present_surface_for_mode\nwill almost never fail and clients should feel free to set whatever\nmode they like.  If the compositor does not advertise this, it may\nstill support some modes that are not advertised through wl_global.mode\nbut it is less likely.\n\nCURSOR_PLANE:\nThis is a hint to the client that indicates that the compositor can\nhandle a cursor surface from the client without actually compositing.\nThis may be because of a hardware cursor plane or some other mechanism.\nIf the compositor does not advertise this capability then setting\nwl_pointer.cursor may degrade performance or be ignored entirely.  If\nCURSOR_PLANE is not advertised, it is recommended that the client draw\nits own cursor and set wl_pointer.cursor(NULL)." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum capability { # [ doc = "compositor is capable of almost any output mode" ] arbitrary_modes = 1 , # [ doc = "compositor has a separate cursor plane" ] cursor_plane = 2 , # [ doc ( hidden ) ] __nonexhaustive , } impl capability { pub fn from_raw ( n : u32 ) -> Option < capability > { match n { 1 => Some ( capability :: arbitrary_modes ) , 2 => Some ( capability :: cursor_plane ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ doc = "different method to set the surface fullscreen\n\nHints to indicate to the compositor how to deal with a conflict\nbetween the dimensions of the surface and the dimensions of the\noutput. The compositor is free to ignore this parameter." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum present_method { # [ doc = "no preference, apply default policy" ] default = 0 , # [ doc = "center the surface on the output" ] center = 1 , # [ doc = "scale the surface, preserving aspect ratio, to the largest size that will fit on the output" ] zoom = 2 , # [ doc = "scale the surface, preserving aspect ratio, to fully fill the output cropping if needed" ] zoom_crop = 3 , # [ doc = "scale the surface to the size of the output ignoring aspect ratio" ] stretch = 4 , # [ doc ( hidden ) ] __nonexhaustive , } impl present_method { pub fn from_raw ( n : u32 ) -> Option < present_method > { match n { 0 => Some ( present_method :: default ) , 1 => Some ( present_method :: center ) , 2 => Some ( present_method :: zoom ) , 3 => Some ( present_method :: zoom_crop ) , 4 => Some ( present_method :: stretch ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ doc = "wl_fullscreen_shell error values\n\nThese errors can be emitted in response to wl_fullscreen_shell requests." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum error { # [ doc = "present_method is not known" ] invalid_method = 0 , # [ doc ( hidden ) ] __nonexhaustive , } impl error { pub fn from_raw ( n : u32 ) -> Option < error > { match n { 0 => Some ( error :: invalid_method ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } static mut zwp_fullscreen_shell_v1_requests_present_surface_types : [ * const wl_interface ; 3 ] = [ unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } , ] ; static mut zwp_fullscreen_shell_v1_requests_present_surface_for_mode_types : [ * const wl_interface ; 4 ] = [ unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: zwp_fullscreen_shell_mode_feedback_v1 :: zwp_fullscreen_shell_mode_feedback_v1_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_fullscreen_shell_v1_requests : [ wl_message ; 3 ] = [ wl_message { name : b"release\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"present_surface\0" as * const u8 as * const c_char , signature : b"?ou?o\0" as * const u8 as * const c_char , types : unsafe { & zwp_fullscreen_shell_v1_requests_present_surface_types as * const _ } , } , wl_message { name : b"present_surface_for_mode\0" as * const u8 as * const c_char , signature : b"ooin\0" as * const u8 as * const c_char , types : unsafe { & zwp_fullscreen_shell_v1_requests_present_surface_for_mode_types as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_fullscreen_shell_v1_events : [ wl_message ; 1 ] = [ wl_message { name : b"capability\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_fullscreen_shell_v1_interface : wl_interface = wl_interface { name : b"zwp_fullscreen_shell_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 3 , requests : unsafe { & zwp_fullscreen_shell_v1_requests as * const _ } , event_count : 1 , events : unsafe { & zwp_fullscreen_shell_v1_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_fullscreen_shell_v1_listener { # [ doc = "advertises a capability of the compositor\n\nAdvertises a single capability of the compositor.\n\nWhen the wl_fullscreen_shell interface is bound, this event is emitted\nonce for each capability advertised.  Valid capabilities are given by\nthe wl_fullscreen_shell.capability enum.  If clients want to take\nadvantage of any of these capabilities, they should use a\nwl_display.sync request immediately after binding to ensure that they\nreceive all the capability events." ] fn capability ( & mut self , object : * mut zwp_fullscreen_shell_v1 , capability : u32 ) { } } pub unsafe fn zwp_fullscreen_shell_v1_set_user_data ( zwp_fullscreen_shell_v1 : * mut super :: zwp_fullscreen_shell_v1 :: zwp_fullscreen_shell_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_fullscreen_shell_v1 as _ , user_data ) ; } pub unsafe fn zwp_fullscreen_shell_v1_get_user_data ( zwp_fullscreen_shell_v1 : * mut super :: zwp_fullscreen_shell_v1 :: zwp_fullscreen_shell_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_fullscreen_shell_v1 as _ ) ; } pub unsafe fn zwp_fullscreen_shell_v1_get_version ( zwp_fullscreen_shell_v1 : * mut super :: zwp_fullscreen_shell_v1 :: zwp_fullscreen_shell_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_fullscreen_shell_v1 as _ ) ; } pub unsafe fn zwp_fullscreen_shell_v1_add_listener ( zwp_fullscreen_shell_v1 : * mut super :: zwp_fullscreen_shell_v1 :: zwp_fullscreen_shell_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_fullscreen_shell_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_fullscreen_shell_v1_add_rust_listener ( zwp_fullscreen_shell_v1 : * mut super :: zwp_fullscreen_shell_v1 :: zwp_fullscreen_shell_v1 , listener : & dyn zwp_fullscreen_shell_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_fullscreen_shell_v1_add_listener ( zwp_fullscreen_shell_v1 as _ , fp as _ , op as _ ) == 0 ; } pub unsafe fn zwp_fullscreen_shell_v1_destroy ( zwp_fullscreen_shell_v1 : * mut super :: zwp_fullscreen_shell_v1 :: zwp_fullscreen_shell_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_fullscreen_shell_v1 as _ ) ; } # [ doc = "release the wl_fullscreen_shell interface\n\nRelease the binding from the wl_fullscreen_shell interface.\n\nThis destroys the server-side object and frees this binding.  If\nthe client binds to wl_fullscreen_shell multiple times, it may wish\nto free some of those bindings." ] pub unsafe fn zwp_fullscreen_shell_v1_release ( zwp_fullscreen_shell_v1 : * mut super :: zwp_fullscreen_shell_v1 :: zwp_fullscreen_shell_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_fullscreen_shell_v1 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_fullscreen_shell_v1 as _ ) ; } # [ doc = "present surface for display\n\nPresent a surface on the given output.\n\nIf the output is null, the compositor will present the surface on\nwhatever display (or displays) it thinks best.  In particular, this\nmay replace any or all surfaces currently presented so it should\nnot be used in combination with placing surfaces on specific\noutputs.\n\nThe method parameter is a hint to the compositor for how the surface\nis to be presented.  In particular, it tells the compositor how to\nhandle a size mismatch between the presented surface and the\noutput.  The compositor is free to ignore this parameter.\n\nThe \"zoom\", \"zoom_crop\", and \"stretch\" methods imply a scaling\noperation on the surface.  This will override any kind of output\nscaling, so the buffer_scale property of the surface is effectively\nignored." ] pub unsafe fn zwp_fullscreen_shell_v1_present_surface ( zwp_fullscreen_shell_v1 : * mut super :: zwp_fullscreen_shell_v1 :: zwp_fullscreen_shell_v1 , surface : * mut super :: wl_surface :: wl_surface , method : u32 , output : * mut super :: wl_output :: wl_output ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_fullscreen_shell_v1 as _ , 1u32 , surface , method , output , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "present surface for display at a particular mode\n\nPresents a surface on the given output for a particular mode.\n\nIf the current size of the output differs from that of the surface,\nthe compositor will attempt to change the size of the output to\nmatch the surface.  The result of the mode-switch operation will be\nreturned via the provided wl_fullscreen_shell_mode_feedback object.\n\nIf the current output mode matches the one requested or if the\ncompositor successfully switches the mode to match the surface,\nthen the mode_successful event will be sent and the output will\ncontain the contents of the given surface.  If the compositor\ncannot match the output size to the surface size, the mode_failed\nwill be sent and the output will contain the contents of the\npreviously presented surface (if any).  If another surface is\npresented on the given output before either of these has a chance\nto happen, the present_cancelled event will be sent.\n\nDue to race conditions and other issues unknown to the client, no\nmode-switch operation is guaranteed to succeed.  However, if the\nmode is one advertised by wl_output.mode or if the compositor\nadvertises the ARBITRARY_MODES capability, then the client should\nexpect that the mode-switch operation will usually succeed.\n\nIf the size of the presented surface changes, the resulting output\nis undefined.  The compositor may attempt to change the output mode\nto compensate.  However, there is no guarantee that a suitable mode\nwill be found and the client has no way to be notified of success\nor failure.\n\nThe framerate parameter specifies the desired framerate for the\noutput in mHz.  The compositor is free to ignore this parameter.  A\nvalue of 0 indicates that the client has no preference.\n\nIf the value of wl_output.scale differs from wl_surface.buffer_scale,\nthen the compositor may choose a mode that matches either the buffer\nsize or the surface size.  In either case, the surface will fill the\noutput." ] pub unsafe fn zwp_fullscreen_shell_v1_present_surface_for_mode ( zwp_fullscreen_shell_v1 : * mut super :: zwp_fullscreen_shell_v1 :: zwp_fullscreen_shell_v1 , surface : * mut super :: wl_surface :: wl_surface , output : * mut super :: wl_output :: wl_output , framerate : i32 ) -> * mut super :: zwp_fullscreen_shell_mode_feedback_v1 :: zwp_fullscreen_shell_mode_feedback_v1 { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zwp_fullscreen_shell_v1 as _ , 2u32 , & super :: zwp_fullscreen_shell_mode_feedback_v1 :: zwp_fullscreen_shell_mode_feedback_v1_interface as * const _ , surface , output , framerate , std :: ptr :: null :: < c_void > ( ) ) ; return r as _ ; } } pub mod zwp_fullscreen_shell_mode_feedback_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_fullscreen_shell_mode_feedback_v1 { } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_fullscreen_shell_mode_feedback_v1_events : [ wl_message ; 3 ] = [ wl_message { name : b"mode_successful\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode_failed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"present_cancelled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_fullscreen_shell_mode_feedback_v1_interface : wl_interface = wl_interface { name : b"zwp_fullscreen_shell_mode_feedback_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 0 , requests : NULLPTR as * const wl_message , event_count : 3 , events : unsafe { & zwp_fullscreen_shell_mode_feedback_v1_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_fullscreen_shell_mode_feedback_v1_listener { # [ doc = "mode switch succeeded\n\nThis event indicates that the attempted mode switch operation was\nsuccessful.  A surface of the size requested in the mode switch\nwill fill the output without scaling.\n\nUpon receiving this event, the client should destroy the\nwl_fullscreen_shell_mode_feedback object." ] fn mode_successful ( & mut self , object : * mut zwp_fullscreen_shell_mode_feedback_v1 , ) { } # [ doc = "mode switch failed\n\nThis event indicates that the attempted mode switch operation\nfailed.  This may be because the requested output mode is not\npossible or it may mean that the compositor does not want to allow it.\n\nUpon receiving this event, the client should destroy the\nwl_fullscreen_shell_mode_feedback object." ] fn mode_failed ( & mut self , object : * mut zwp_fullscreen_shell_mode_feedback_v1 , ) { } # [ doc = "mode switch cancelled\n\nThis event indicates that the attempted mode switch operation was\ncancelled.  Most likely this is because the client requested a\nsecond mode switch before the first one completed.\n\nUpon receiving this event, the client should destroy the\nwl_fullscreen_shell_mode_feedback object." ] fn present_cancelled ( & mut self , object : * mut zwp_fullscreen_shell_mode_feedback_v1 , ) { } } pub unsafe fn zwp_fullscreen_shell_mode_feedback_v1_set_user_data ( zwp_fullscreen_shell_mode_feedback_v1 : * mut super :: zwp_fullscreen_shell_mode_feedback_v1 :: zwp_fullscreen_shell_mode_feedback_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_fullscreen_shell_mode_feedback_v1 as _ , user_data ) ; } pub unsafe fn zwp_fullscreen_shell_mode_feedback_v1_get_user_data ( zwp_fullscreen_shell_mode_feedback_v1 : * mut super :: zwp_fullscreen_shell_mode_feedback_v1 :: zwp_fullscreen_shell_mode_feedback_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_fullscreen_shell_mode_feedback_v1 as _ ) ; } pub unsafe fn zwp_fullscreen_shell_mode_feedback_v1_get_version ( zwp_fullscreen_shell_mode_feedback_v1 : * mut super :: zwp_fullscreen_shell_mode_feedback_v1 :: zwp_fullscreen_shell_mode_feedback_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_fullscreen_shell_mode_feedback_v1 as _ ) ; } pub unsafe fn zwp_fullscreen_shell_mode_feedback_v1_add_listener ( zwp_fullscreen_shell_mode_feedback_v1 : * mut super :: zwp_fullscreen_shell_mode_feedback_v1 :: zwp_fullscreen_shell_mode_feedback_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_fullscreen_shell_mode_feedback_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_fullscreen_shell_mode_feedback_v1_add_rust_listener ( zwp_fullscreen_shell_mode_feedback_v1 : * mut super :: zwp_fullscreen_shell_mode_feedback_v1 :: zwp_fullscreen_shell_mode_feedback_v1 , listener : & dyn zwp_fullscreen_shell_mode_feedback_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_fullscreen_shell_mode_feedback_v1_add_listener ( zwp_fullscreen_shell_mode_feedback_v1 as _ , fp as _ , op as _ ) == 0 ; } pub unsafe fn zwp_fullscreen_shell_mode_feedback_v1_destroy ( zwp_fullscreen_shell_mode_feedback_v1 : * mut super :: zwp_fullscreen_shell_mode_feedback_v1 :: zwp_fullscreen_shell_mode_feedback_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_fullscreen_shell_mode_feedback_v1 as _ ) ; } } } pub mod text_input_unstable_v3 { use super :: wayland :: * ; use super :: xdg_shell :: * ; # [ doc = "text input\n\nThe zwp_text_input_v3 interface represents text input and input methods\nassociated with a seat. It provides enter/leave events to follow the\ntext input focus for a seat.\n\nRequests are used to enable/disable the text-input object and set\nstate information like surrounding and selected text or the content type.\nThe information about the entered text is sent to the text-input object\nvia the preedit_string and commit_string events.\n\nText is valid UTF-8 encoded, indices and lengths are in bytes. Indices\nmust not point to middle bytes inside a code point: they must either\npoint to the first byte of a code point or to the end of the buffer.\nLengths must be measured between two valid indices.\n\nFocus moving throughout surfaces will result in the emission of\nzwp_text_input_v3.enter and zwp_text_input_v3.leave events. The focused\nsurface must commit zwp_text_input_v3.enable and\nzwp_text_input_v3.disable requests as the keyboard focus moves across\neditable and non-editable elements of the UI. Those two requests are not\nexpected to be paired with each other, the compositor must be able to\nhandle consecutive series of the same request.\n\nState is sent by the state requests (set_surrounding_text,\nset_content_type and set_cursor_rectangle) and a commit request. After an\nenter event or disable request all state information is invalidated and\nneeds to be resent by the client." ] pub mod zwp_text_input_v3 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_text_input_v3 { } # [ doc = "text change reason\n\nReason for the change of surrounding text or cursor posision." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum change_cause { # [ doc = "input method caused the change" ] input_method = 0 , # [ doc = "something else than the input method caused the change" ] other = 1 , # [ doc ( hidden ) ] __nonexhaustive , } impl change_cause { pub fn from_raw ( n : u32 ) -> Option < change_cause > { match n { 0 => Some ( change_cause :: input_method ) , 1 => Some ( change_cause :: other ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } bitflags ! { # [ doc = "content hint\n\nContent hint is a bitmask to allow to modify the behavior of the text\ninput." ] pub struct content_hint : u32 { # [ doc = "no special behavior" ] const none = 0 ; # [ doc = "suggest word completions" ] const completion = 1 ; # [ doc = "suggest word corrections" ] const spellcheck = 2 ; # [ doc = "switch to uppercase letters at the start of a sentence" ] const auto_capitalization = 4 ; # [ doc = "prefer lowercase letters" ] const lowercase = 8 ; # [ doc = "prefer uppercase letters" ] const uppercase = 16 ; # [ doc = "prefer casing for titles and headings (can be language dependent)" ] const titlecase = 32 ; # [ doc = "characters should be hidden" ] const hidden_text = 64 ; # [ doc = "typed text should not be stored" ] const sensitive_data = 128 ; # [ doc = "just Latin characters should be entered" ] const latin = 256 ; # [ doc = "the text input is multiline" ] const multiline = 512 ; } } impl content_hint { pub fn from_raw ( n : u32 ) -> Option < content_hint > { Some ( content_hint :: from_bits_truncate ( n ) ) } pub fn to_raw ( & self ) -> u32 { self . bits ( ) } } # [ doc = "content purpose\n\nThe content purpose allows to specify the primary purpose of a text\ninput.\n\nThis allows an input method to show special purpose input panels with\nextra characters or to disallow some characters." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum content_purpose { # [ doc = "default input, allowing all characters" ] normal = 0 , # [ doc = "allow only alphabetic characters" ] alpha = 1 , # [ doc = "allow only digits" ] digits = 2 , # [ doc = "input a number (including decimal separator and sign)" ] number = 3 , # [ doc = "input a phone number" ] phone = 4 , # [ doc = "input an URL" ] url = 5 , # [ doc = "input an email address" ] email = 6 , # [ doc = "input a name of a person" ] name = 7 , # [ doc = "input a password (combine with sensitive_data hint)" ] password = 8 , # [ doc = "input is a numeric password (combine with sensitive_data hint)" ] pin = 9 , # [ doc = "input a date" ] date = 10 , # [ doc = "input a time" ] time = 11 , # [ doc = "input a date and time" ] datetime = 12 , # [ doc = "input for a terminal" ] terminal = 13 , # [ doc ( hidden ) ] __nonexhaustive , } impl content_purpose { pub fn from_raw ( n : u32 ) -> Option < content_purpose > { match n { 0 => Some ( content_purpose :: normal ) , 1 => Some ( content_purpose :: alpha ) , 2 => Some ( content_purpose :: digits ) , 3 => Some ( content_purpose :: number ) , 4 => Some ( content_purpose :: phone ) , 5 => Some ( content_purpose :: url ) , 6 => Some ( content_purpose :: email ) , 7 => Some ( content_purpose :: name ) , 8 => Some ( content_purpose :: password ) , 9 => Some ( content_purpose :: pin ) , 10 => Some ( content_purpose :: date ) , 11 => Some ( content_purpose :: time ) , 12 => Some ( content_purpose :: datetime ) , 13 => Some ( content_purpose :: terminal ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_text_input_v3_requests : [ wl_message ; 8 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"enable\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"disable\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_surrounding_text\0" as * const u8 as * const c_char , signature : b"sii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_text_change_cause\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_content_type\0" as * const u8 as * const c_char , signature : b"uu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_cursor_rectangle\0" as * const u8 as * const c_char , signature : b"iiii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"commit\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; static mut zwp_text_input_v3_events_enter_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , ] ; static mut zwp_text_input_v3_events_leave_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_text_input_v3_events : [ wl_message ; 6 ] = [ wl_message { name : b"enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwp_text_input_v3_events_enter_types as * const _ } , } , wl_message { name : b"leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwp_text_input_v3_events_leave_types as * const _ } , } , wl_message { name : b"preedit_string\0" as * const u8 as * const c_char , signature : b"?sii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"commit_string\0" as * const u8 as * const c_char , signature : b"?s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"delete_surrounding_text\0" as * const u8 as * const c_char , signature : b"uu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_text_input_v3_interface : wl_interface = wl_interface { name : b"zwp_text_input_v3\0" as * const u8 as * const c_char , version : 1 , request_count : 8 , requests : unsafe { & zwp_text_input_v3_requests as * const _ } , event_count : 6 , events : unsafe { & zwp_text_input_v3_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_text_input_v3_listener { # [ doc = "enter event\n\nNotification that this seat's text-input focus is on a certain surface.\n\nWhen the seat has the keyboard capability the text-input focus follows\nthe keyboard focus. This event sets the current surface for the\ntext-input object." ] fn enter ( & mut self , object : * mut zwp_text_input_v3 , surface : * mut super :: wl_surface :: wl_surface ) { } # [ doc = "leave event\n\nNotification that this seat's text-input focus is no longer on a\ncertain surface. The client should reset any preedit string previously\nset.\n\nThe leave notification clears the current surface. It is sent before\nthe enter notification for the new focus.\n\nWhen the seat has the keyboard capability the text-input focus follows\nthe keyboard focus." ] fn leave ( & mut self , object : * mut zwp_text_input_v3 , surface : * mut super :: wl_surface :: wl_surface ) { } # [ doc = "pre-edit\n\nNotify when a new composing text (pre-edit) should be set at the\ncurrent cursor position. Any previously set composing text must be\nremoved. Any previously existing selected text must be removed.\n\nThe argument text contains the pre-edit string buffer.\n\nThe parameters cursor_begin and cursor_end are counted in bytes\nrelative to the beginning of the submitted text buffer. Cursor should\nbe hidden when both are equal to -1.\n\nThey could be represented by the client as a line if both values are\nthe same, or as a text highlight otherwise.\n\nValues set with this event are double-buffered. They must be applied\nand reset to initial on the next zwp_text_input_v3.done event.\n\nThe initial value of text is an empty string, and cursor_begin,\ncursor_end and cursor_hidden are all 0." ] fn preedit_string ( & mut self , object : * mut zwp_text_input_v3 , text : Option < * mut c_char > , cursor_begin : i32 , cursor_end : i32 ) { } # [ doc = "text commit\n\nNotify when text should be inserted into the editor widget. The text to\ncommit could be either just a single character after a key press or the\nresult of some composing (pre-edit).\n\nValues set with this event are double-buffered. They must be applied\nand reset to initial on the next zwp_text_input_v3.done event.\n\nThe initial value of text is an empty string." ] fn commit_string ( & mut self , object : * mut zwp_text_input_v3 , text : Option < * mut c_char > ) { } # [ doc = "delete surrounding text\n\nNotify when the text around the current cursor position should be\ndeleted.\n\nBefore_length and after_length are the number of bytes before and after\nthe current cursor index (excluding the selection) to delete.\n\nIf a preedit text is present, in effect before_length is counted from\nthe beginning of it, and after_length from its end (see done event\nsequence).\n\nValues set with this event are double-buffered. They must be applied\nand reset to initial on the next zwp_text_input_v3.done event.\n\nThe initial values of both before_length and after_length are 0." ] fn delete_surrounding_text ( & mut self , object : * mut zwp_text_input_v3 , before_length : u32 , after_length : u32 ) { } # [ doc = "apply changes\n\nInstruct the application to apply changes to state requested by the\npreedit_string, commit_string and delete_surrounding_text events. The\nstate relating to these events is double-buffered, and each one\nmodifies the pending state. This event replaces the current state with\nthe pending state.\n\nThe application must proceed by evaluating the changes in the following\norder:\n\n1. Replace existing preedit string with the cursor.\n2. Delete requested surrounding text.\n3. Insert commit string with the cursor at its end.\n4. Calculate surrounding text to send.\n5. Insert new preedit text in cursor position.\n6. Place cursor inside preedit text.\n\nThe serial number reflects the last state of the zwp_text_input_v3\nobject known to the compositor. The value of the serial argument must\nbe equal to the number of commit requests already issued on that object.\nWhen the client receives a done event with a serial different than the\nnumber of past commit requests, it must proceed as normal, except it\nshould not change the current state of the zwp_text_input_v3 object." ] fn done ( & mut self , object : * mut zwp_text_input_v3 , serial : u32 ) { } } pub unsafe fn zwp_text_input_v3_set_user_data ( zwp_text_input_v3 : * mut super :: zwp_text_input_v3 :: zwp_text_input_v3 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_text_input_v3 as _ , user_data ) ; } pub unsafe fn zwp_text_input_v3_get_user_data ( zwp_text_input_v3 : * mut super :: zwp_text_input_v3 :: zwp_text_input_v3 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_text_input_v3 as _ ) ; } pub unsafe fn zwp_text_input_v3_get_version ( zwp_text_input_v3 : * mut super :: zwp_text_input_v3 :: zwp_text_input_v3 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_text_input_v3 as _ ) ; } pub unsafe fn zwp_text_input_v3_add_listener ( zwp_text_input_v3 : * mut super :: zwp_text_input_v3 :: zwp_text_input_v3 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_text_input_v3 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_text_input_v3_add_rust_listener ( zwp_text_input_v3 : * mut super :: zwp_text_input_v3 :: zwp_text_input_v3 , listener : & dyn zwp_text_input_v3_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_text_input_v3_add_listener ( zwp_text_input_v3 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "Destroy the wp_text_input\n\nDestroy the wp_text_input object. Also disables all surfaces enabled\nthrough this wp_text_input object." ] pub unsafe fn zwp_text_input_v3_destroy ( zwp_text_input_v3 : * mut super :: zwp_text_input_v3 :: zwp_text_input_v3 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_text_input_v3 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_text_input_v3 as _ ) ; } # [ doc = "Request text input to be enabled\n\nRequests text input on the surface previously obtained from the enter\nevent.\n\nThis request must be issued every time the active text input changes\nto a new one, including within the current surface. Use\nzwp_text_input_v3.disable when there is no longer any input focus on\nthe current surface.\n\nThis request resets all state associated with previous enable, disable,\nset_surrounding_text, set_text_change_cause, set_content_type, and\nset_cursor_rectangle requests, as well as the state associated with\npreedit_string, commit_string, and delete_surrounding_text events.\n\nThe set_surrounding_text, set_content_type and set_cursor_rectangle\nrequests must follow if the text input supports the necessary\nfunctionality.\n\nState set with this request is double-buffered. It will get applied on\nthe next zwp_text_input_v3.commit request, and stay valid until the\nnext committed enable or disable request.\n\nThe changes must be applied by the compositor after issuing a\nzwp_text_input_v3.commit request." ] pub unsafe fn zwp_text_input_v3_enable ( zwp_text_input_v3 : * mut super :: zwp_text_input_v3 :: zwp_text_input_v3 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_text_input_v3 as _ , 1u32 , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "Disable text input on a surface\n\nExplicitly disable text input on the current surface (typically when\nthere is no focus on any text entry inside the surface).\n\nState set with this request is double-buffered. It will get applied on\nthe next zwp_text_input_v3.commit request." ] pub unsafe fn zwp_text_input_v3_disable ( zwp_text_input_v3 : * mut super :: zwp_text_input_v3 :: zwp_text_input_v3 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_text_input_v3 as _ , 2u32 , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "sets the surrounding text\n\nSets the surrounding plain text around the input, excluding the preedit\ntext.\n\nThe client should notify the compositor of any changes in any of the\nvalues carried with this request, including changes caused by handling\nincoming text-input events as well as changes caused by other\nmechanisms like keyboard typing.\n\nIf the client is unaware of the text around the cursor, it should not\nissue this request, to signify lack of support to the compositor.\n\nText is UTF-8 encoded, and should include the cursor position, the\ncomplete selection and additional characters before and after them.\nThere is a maximum length of wayland messages, so text can not be\nlonger than 4000 bytes.\n\nCursor is the byte offset of the cursor within text buffer.\n\nAnchor is the byte offset of the selection anchor within text buffer.\nIf there is no selected text, anchor is the same as cursor.\n\nIf any preedit text is present, it is replaced with a cursor for the\npurpose of this event.\n\nValues set with this request are double-buffered. They will get applied\non the next zwp_text_input_v3.commit request, and stay valid until the\nnext committed enable or disable request.\n\nThe initial state for affected fields is empty, meaning that the text\ninput does not support sending surrounding text. If the empty values\nget applied, subsequent attempts to change them may have no effect." ] pub unsafe fn zwp_text_input_v3_set_surrounding_text ( zwp_text_input_v3 : * mut super :: zwp_text_input_v3 :: zwp_text_input_v3 , text : * mut c_char , cursor : i32 , anchor : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_text_input_v3 as _ , 3u32 , text , cursor , anchor , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "indicates the cause of surrounding text change\n\nTells the compositor why the text surrounding the cursor changed.\n\nWhenever the client detects an external change in text, cursor, or\nanchor posision, it must issue this request to the compositor. This\nrequest is intended to give the input method a chance to update the\npreedit text in an appropriate way, e.g. by removing it when the user\nstarts typing with a keyboard.\n\ncause describes the source of the change.\n\nThe value set with this request is double-buffered. It must be applied\nand reset to initial at the next zwp_text_input_v3.commit request.\n\nThe initial value of cause is input_method." ] pub unsafe fn zwp_text_input_v3_set_text_change_cause ( zwp_text_input_v3 : * mut super :: zwp_text_input_v3 :: zwp_text_input_v3 , cause : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_text_input_v3 as _ , 4u32 , cause , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set content purpose and hint\n\nSets the content purpose and content hint. While the purpose is the\nbasic purpose of an input field, the hint flags allow to modify some of\nthe behavior.\n\nValues set with this request are double-buffered. They will get applied\non the next zwp_text_input_v3.commit request.\nSubsequent attempts to update them may have no effect. The values\nremain valid until the next committed enable or disable request.\n\nThe initial value for hint is none, and the initial value for purpose\nis normal." ] pub unsafe fn zwp_text_input_v3_set_content_type ( zwp_text_input_v3 : * mut super :: zwp_text_input_v3 :: zwp_text_input_v3 , hint : u32 , purpose : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_text_input_v3 as _ , 5u32 , hint , purpose , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set cursor position\n\nMarks an area around the cursor as a x, y, width, height rectangle in\nsurface local coordinates.\n\nAllows the compositor to put a window with word suggestions near the\ncursor, without obstructing the text being input.\n\nIf the client is unaware of the position of edited text, it should not\nissue this request, to signify lack of support to the compositor.\n\nValues set with this request are double-buffered. They will get applied\non the next zwp_text_input_v3.commit request, and stay valid until the\nnext committed enable or disable request.\n\nThe initial values describing a cursor rectangle are empty. That means\nthe text input does not support describing the cursor area. If the\nempty values get applied, subsequent attempts to change them may have\nno effect." ] pub unsafe fn zwp_text_input_v3_set_cursor_rectangle ( zwp_text_input_v3 : * mut super :: zwp_text_input_v3 :: zwp_text_input_v3 , x : i32 , y : i32 , width : i32 , height : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_text_input_v3 as _ , 6u32 , x , y , width , height , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "commit state\n\nAtomically applies state changes recently sent to the compositor.\n\nThe commit request establishes and updates the state of the client, and\nmust be issued after any changes to apply them.\n\nText input state (enabled status, content purpose, content hint,\nsurrounding text and change cause, cursor rectangle) is conceptually\ndouble-buffered within the context of a text input, i.e. between a\ncommitted enable request and the following committed enable or disable\nrequest.\n\nProtocol requests modify the pending state, as opposed to the current\nstate in use by the input method. A commit request atomically applies\nall pending state, replacing the current state. After commit, the new\npending state is as documented for each related request.\n\nRequests are applied in the order of arrival.\n\nNeither current nor pending state are modified unless noted otherwise.\n\nThe compositor must count the number of commit requests coming from\neach zwp_text_input_v3 object and use the count as the serial in done\nevents." ] pub unsafe fn zwp_text_input_v3_commit ( zwp_text_input_v3 : * mut super :: zwp_text_input_v3 :: zwp_text_input_v3 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_text_input_v3 as _ , 7u32 , std :: ptr :: null :: < c_void > ( ) ) ; } } # [ doc = "text input manager\n\nA factory for text-input objects. This object is a global singleton." ] pub mod zwp_text_input_manager_v3 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_text_input_manager_v3 { } static mut zwp_text_input_manager_v3_requests_get_text_input_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: zwp_text_input_v3 :: zwp_text_input_v3_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_text_input_manager_v3_requests : [ wl_message ; 2 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_text_input\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zwp_text_input_manager_v3_requests_get_text_input_types as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_text_input_manager_v3_interface : wl_interface = wl_interface { name : b"zwp_text_input_manager_v3\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & zwp_text_input_manager_v3_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_text_input_manager_v3_listener { } pub unsafe fn zwp_text_input_manager_v3_set_user_data ( zwp_text_input_manager_v3 : * mut super :: zwp_text_input_manager_v3 :: zwp_text_input_manager_v3 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_text_input_manager_v3 as _ , user_data ) ; } pub unsafe fn zwp_text_input_manager_v3_get_user_data ( zwp_text_input_manager_v3 : * mut super :: zwp_text_input_manager_v3 :: zwp_text_input_manager_v3 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_text_input_manager_v3 as _ ) ; } pub unsafe fn zwp_text_input_manager_v3_get_version ( zwp_text_input_manager_v3 : * mut super :: zwp_text_input_manager_v3 :: zwp_text_input_manager_v3 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_text_input_manager_v3 as _ ) ; } pub unsafe fn zwp_text_input_manager_v3_add_listener ( zwp_text_input_manager_v3 : * mut super :: zwp_text_input_manager_v3 :: zwp_text_input_manager_v3 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_text_input_manager_v3 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_text_input_manager_v3_add_rust_listener ( zwp_text_input_manager_v3 : * mut super :: zwp_text_input_manager_v3 :: zwp_text_input_manager_v3 , listener : & dyn zwp_text_input_manager_v3_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_text_input_manager_v3_add_listener ( zwp_text_input_manager_v3 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "Destroy the wp_text_input_manager\n\nDestroy the wp_text_input_manager object." ] pub unsafe fn zwp_text_input_manager_v3_destroy ( zwp_text_input_manager_v3 : * mut super :: zwp_text_input_manager_v3 :: zwp_text_input_manager_v3 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_text_input_manager_v3 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_text_input_manager_v3 as _ ) ; } # [ doc = "create a new text input object\n\nCreates a new text-input object for a given seat." ] pub unsafe fn zwp_text_input_manager_v3_get_text_input ( zwp_text_input_manager_v3 : * mut super :: zwp_text_input_manager_v3 :: zwp_text_input_manager_v3 , seat : * mut super :: wl_seat :: wl_seat ) -> * mut super :: zwp_text_input_v3 :: zwp_text_input_v3 { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zwp_text_input_manager_v3 as _ , 1u32 , & super :: zwp_text_input_v3 :: zwp_text_input_v3_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , seat ) ; return r as _ ; } } } pub mod text_input_unstable_v1 { use super :: wayland :: * ; use super :: xdg_shell :: * ; # [ doc = "text input\n\nAn object used for text input. Adds support for text input and input\nmethods to applications. A text_input object is created from a\nwl_text_input_manager and corresponds typically to a text entry in an\napplication.\n\nRequests are used to activate/deactivate the text_input object and set\nstate information like surrounding and selected text or the content type.\nThe information about entered text is sent to the text_input object via\nthe pre-edit and commit events. Using this interface removes the need\nfor applications to directly process hardware key events and compose text\nout of them.\n\nText is generally UTF-8 encoded, indices and lengths are in bytes.\n\nSerials are used to synchronize the state between the text input and\nan input method. New serials are sent by the text input in the\ncommit_state request and are used by the input method to indicate\nthe known text input state in events like preedit_string, commit_string,\nand keysym. The text input can then ignore events from the input method\nwhich are based on an outdated state (for example after a reset).\n\nWarning! The protocol described in this file is experimental and\nbackward incompatible changes may be made. Backward compatible changes\nmay be added together with the corresponding interface version bump.\nBackward incompatible changes are done by bumping the version number in\nthe protocol and interface names and resetting the interface version.\nOnce the protocol is to be declared stable, the 'z' prefix and the\nversion number in the protocol and interface names are removed and the\ninterface version number is reset." ] pub mod zwp_text_input_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_text_input_v1 { } # [ doc = "content hint\n\nContent hint is a bitmask to allow to modify the behavior of the text\ninput." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum content_hint { # [ doc = "no special behaviour" ] none = 0 , # [ doc = "auto completion, correction and capitalization" ] default = 7 , # [ doc = "hidden and sensitive text" ] password = 192 , # [ doc = "suggest word completions" ] auto_completion = 1 , # [ doc = "suggest word corrections" ] auto_correction = 2 , # [ doc = "switch to uppercase letters at the start of a sentence" ] auto_capitalization = 4 , # [ doc = "prefer lowercase letters" ] lowercase = 8 , # [ doc = "prefer uppercase letters" ] uppercase = 16 , # [ doc = "prefer casing for titles and headings (can be language dependent)" ] titlecase = 32 , # [ doc = "characters should be hidden" ] hidden_text = 64 , # [ doc = "typed text should not be stored" ] sensitive_data = 128 , # [ doc = "just latin characters should be entered" ] latin = 256 , # [ doc = "the text input is multiline" ] multiline = 512 , # [ doc ( hidden ) ] __nonexhaustive , } impl content_hint { pub fn from_raw ( n : u32 ) -> Option < content_hint > { match n { 0 => Some ( content_hint :: none ) , 7 => Some ( content_hint :: default ) , 192 => Some ( content_hint :: password ) , 1 => Some ( content_hint :: auto_completion ) , 2 => Some ( content_hint :: auto_correction ) , 4 => Some ( content_hint :: auto_capitalization ) , 8 => Some ( content_hint :: lowercase ) , 16 => Some ( content_hint :: uppercase ) , 32 => Some ( content_hint :: titlecase ) , 64 => Some ( content_hint :: hidden_text ) , 128 => Some ( content_hint :: sensitive_data ) , 256 => Some ( content_hint :: latin ) , 512 => Some ( content_hint :: multiline ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ doc = "content purpose\n\nThe content purpose allows to specify the primary purpose of a text\ninput.\n\nThis allows an input method to show special purpose input panels with\nextra characters or to disallow some characters." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum content_purpose { # [ doc = "default input, allowing all characters" ] normal = 0 , # [ doc = "allow only alphabetic characters" ] alpha = 1 , # [ doc = "allow only digits" ] digits = 2 , # [ doc = "input a number (including decimal separator and sign)" ] number = 3 , # [ doc = "input a phone number" ] phone = 4 , # [ doc = "input an URL" ] url = 5 , # [ doc = "input an email address" ] email = 6 , # [ doc = "input a name of a person" ] name = 7 , # [ doc = "input a password (combine with password or sensitive_data hint)" ] password = 8 , # [ doc = "input a date" ] date = 9 , # [ doc = "input a time" ] time = 10 , # [ doc = "input a date and time" ] datetime = 11 , # [ doc = "input for a terminal" ] terminal = 12 , # [ doc ( hidden ) ] __nonexhaustive , } impl content_purpose { pub fn from_raw ( n : u32 ) -> Option < content_purpose > { match n { 0 => Some ( content_purpose :: normal ) , 1 => Some ( content_purpose :: alpha ) , 2 => Some ( content_purpose :: digits ) , 3 => Some ( content_purpose :: number ) , 4 => Some ( content_purpose :: phone ) , 5 => Some ( content_purpose :: url ) , 6 => Some ( content_purpose :: email ) , 7 => Some ( content_purpose :: name ) , 8 => Some ( content_purpose :: password ) , 9 => Some ( content_purpose :: date ) , 10 => Some ( content_purpose :: time ) , 11 => Some ( content_purpose :: datetime ) , 12 => Some ( content_purpose :: terminal ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum preedit_style { # [ doc = "default style for composing text" ] default = 0 , # [ doc = "style should be the same as in non-composing text" ] none = 1 , active = 2 , inactive = 3 , highlight = 4 , underline = 5 , selection = 6 , incorrect = 7 , # [ doc ( hidden ) ] __nonexhaustive , } impl preedit_style { pub fn from_raw ( n : u32 ) -> Option < preedit_style > { match n { 0 => Some ( preedit_style :: default ) , 1 => Some ( preedit_style :: none ) , 2 => Some ( preedit_style :: active ) , 3 => Some ( preedit_style :: inactive ) , 4 => Some ( preedit_style :: highlight ) , 5 => Some ( preedit_style :: underline ) , 6 => Some ( preedit_style :: selection ) , 7 => Some ( preedit_style :: incorrect ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum text_direction { # [ doc = "automatic text direction based on text and language" ] auto = 0 , # [ doc = "left-to-right" ] ltr = 1 , # [ doc = "right-to-left" ] rtl = 2 , # [ doc ( hidden ) ] __nonexhaustive , } impl text_direction { pub fn from_raw ( n : u32 ) -> Option < text_direction > { match n { 0 => Some ( text_direction :: auto ) , 1 => Some ( text_direction :: ltr ) , 2 => Some ( text_direction :: rtl ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } static mut zwp_text_input_v1_requests_activate_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , ] ; static mut zwp_text_input_v1_requests_deactivate_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_text_input_v1_requests : [ wl_message ; 11 ] = [ wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"oo\0" as * const u8 as * const c_char , types : unsafe { & zwp_text_input_v1_requests_activate_types as * const _ } , } , wl_message { name : b"deactivate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwp_text_input_v1_requests_deactivate_types as * const _ } , } , wl_message { name : b"show_input_panel\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"hide_input_panel\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"reset\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_surrounding_text\0" as * const u8 as * const c_char , signature : b"suu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_content_type\0" as * const u8 as * const c_char , signature : b"uu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_cursor_rectangle\0" as * const u8 as * const c_char , signature : b"iiii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_preferred_language\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"commit_state\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"invoke_action\0" as * const u8 as * const c_char , signature : b"uu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; static mut zwp_text_input_v1_events_enter_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_text_input_v1_events : [ wl_message ; 13 ] = [ wl_message { name : b"enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwp_text_input_v1_events_enter_types as * const _ } , } , wl_message { name : b"leave\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers_map\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"input_panel_state\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"preedit_string\0" as * const u8 as * const c_char , signature : b"uss\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"preedit_styling\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"preedit_cursor\0" as * const u8 as * const c_char , signature : b"i\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"commit_string\0" as * const u8 as * const c_char , signature : b"us\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"cursor_position\0" as * const u8 as * const c_char , signature : b"ii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"delete_surrounding_text\0" as * const u8 as * const c_char , signature : b"iu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"keysym\0" as * const u8 as * const c_char , signature : b"uuuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"language\0" as * const u8 as * const c_char , signature : b"us\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"text_direction\0" as * const u8 as * const c_char , signature : b"uu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_text_input_v1_interface : wl_interface = wl_interface { name : b"zwp_text_input_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 11 , requests : unsafe { & zwp_text_input_v1_requests as * const _ } , event_count : 13 , events : unsafe { & zwp_text_input_v1_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_text_input_v1_listener { # [ doc = "enter event\n\nNotify the text_input object when it received focus. Typically in\nresponse to an activate request." ] fn enter ( & mut self , object : * mut zwp_text_input_v1 , surface : * mut super :: wl_surface :: wl_surface ) { } # [ doc = "leave event\n\nNotify the text_input object when it lost focus. Either in response\nto a deactivate request or when the assigned surface lost focus or was\ndestroyed." ] fn leave ( & mut self , object : * mut zwp_text_input_v1 , ) { } # [ doc = "modifiers map\n\nTransfer an array of 0-terminated modifier names. The position in\nthe array is the index of the modifier as used in the modifiers\nbitmask in the keysym event." ] fn modifiers_map ( & mut self , object : * mut zwp_text_input_v1 , map : * mut wl_array ) { } # [ doc = "state of the input panel\n\nNotify when the visibility state of the input panel changed." ] fn input_panel_state ( & mut self , object : * mut zwp_text_input_v1 , state : u32 ) { } # [ doc = "pre-edit\n\nNotify when a new composing text (pre-edit) should be set around the\ncurrent cursor position. Any previously set composing text should\nbe removed.\n\nThe commit text can be used to replace the preedit text on reset\n(for example on unfocus).\n\nThe text input should also handle all preedit_style and preedit_cursor\nevents occurring directly before preedit_string." ] fn preedit_string ( & mut self , object : * mut zwp_text_input_v1 , serial : u32 , text : * mut c_char , commit : * mut c_char ) { } # [ doc = "pre-edit styling\n\nSets styling information on composing text. The style is applied for\nlength bytes from index relative to the beginning of the composing\ntext (as byte offset). Multiple styles can\nbe applied to a composing text by sending multiple preedit_styling\nevents.\n\nThis event is handled as part of a following preedit_string event." ] fn preedit_styling ( & mut self , object : * mut zwp_text_input_v1 , index : u32 , length : u32 , style : u32 ) { } # [ doc = "pre-edit cursor\n\nSets the cursor position inside the composing text (as byte\noffset) relative to the start of the composing text. When index is a\nnegative number no cursor is shown.\n\nThis event is handled as part of a following preedit_string event." ] fn preedit_cursor ( & mut self , object : * mut zwp_text_input_v1 , index : i32 ) { } # [ doc = "commit\n\nNotify when text should be inserted into the editor widget. The text to\ncommit could be either just a single character after a key press or the\nresult of some composing (pre-edit). It could also be an empty text\nwhen some text should be removed (see delete_surrounding_text) or when\nthe input cursor should be moved (see cursor_position).\n\nAny previously set composing text should be removed." ] fn commit_string ( & mut self , object : * mut zwp_text_input_v1 , serial : u32 , text : * mut c_char ) { } # [ doc = "set cursor to new position\n\nNotify when the cursor or anchor position should be modified.\n\nThis event should be handled as part of a following commit_string\nevent." ] fn cursor_position ( & mut self , object : * mut zwp_text_input_v1 , index : i32 , anchor : i32 ) { } # [ doc = "delete surrounding text\n\nNotify when the text around the current cursor position should be\ndeleted.\n\nIndex is relative to the current cursor (in bytes).\nLength is the length of deleted text (in bytes).\n\nThis event should be handled as part of a following commit_string\nevent." ] fn delete_surrounding_text ( & mut self , object : * mut zwp_text_input_v1 , index : i32 , length : u32 ) { } # [ doc = "keysym\n\nNotify when a key event was sent. Key events should not be used\nfor normal text input operations, which should be done with\ncommit_string, delete_surrounding_text, etc. The key event follows\nthe wl_keyboard key event convention. Sym is an XKB keysym, state a\nwl_keyboard key_state. Modifiers are a mask for effective modifiers\n(where the modifier indices are set by the modifiers_map event)" ] fn keysym ( & mut self , object : * mut zwp_text_input_v1 , serial : u32 , time : u32 , sym : u32 , state : u32 , modifiers : u32 ) { } # [ doc = "language\n\nSets the language of the input text. The \"language\" argument is an\nRFC-3066 format language tag." ] fn language ( & mut self , object : * mut zwp_text_input_v1 , serial : u32 , language : * mut c_char ) { } # [ doc = "text direction\n\nSets the text direction of input text.\n\nIt is mainly needed for showing an input cursor on the correct side of\nthe editor when there is no input done yet and making sure neutral\ndirection text is laid out properly." ] fn text_direction ( & mut self , object : * mut zwp_text_input_v1 , serial : u32 , direction : u32 ) { } } pub unsafe fn zwp_text_input_v1_set_user_data ( zwp_text_input_v1 : * mut super :: zwp_text_input_v1 :: zwp_text_input_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_text_input_v1 as _ , user_data ) ; } pub unsafe fn zwp_text_input_v1_get_user_data ( zwp_text_input_v1 : * mut super :: zwp_text_input_v1 :: zwp_text_input_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_text_input_v1 as _ ) ; } pub unsafe fn zwp_text_input_v1_get_version ( zwp_text_input_v1 : * mut super :: zwp_text_input_v1 :: zwp_text_input_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_text_input_v1 as _ ) ; } pub unsafe fn zwp_text_input_v1_add_listener ( zwp_text_input_v1 : * mut super :: zwp_text_input_v1 :: zwp_text_input_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_text_input_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_text_input_v1_add_rust_listener ( zwp_text_input_v1 : * mut super :: zwp_text_input_v1 :: zwp_text_input_v1 , listener : & dyn zwp_text_input_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_text_input_v1_add_listener ( zwp_text_input_v1 as _ , fp as _ , op as _ ) == 0 ; } pub unsafe fn zwp_text_input_v1_destroy ( zwp_text_input_v1 : * mut super :: zwp_text_input_v1 :: zwp_text_input_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_text_input_v1 as _ ) ; } # [ doc = "request activation\n\nRequests the text_input object to be activated (typically when the\ntext entry gets focus).\n\nThe seat argument is a wl_seat which maintains the focus for this\nactivation. The surface argument is a wl_surface assigned to the\ntext_input object and tracked for focus lost. The enter event\nis emitted on successful activation." ] pub unsafe fn zwp_text_input_v1_activate ( zwp_text_input_v1 : * mut super :: zwp_text_input_v1 :: zwp_text_input_v1 , seat : * mut super :: wl_seat :: wl_seat , surface : * mut super :: wl_surface :: wl_surface ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_text_input_v1 as _ , 0u32 , seat , surface , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "request deactivation\n\nRequests the text_input object to be deactivated (typically when the\ntext entry lost focus). The seat argument is a wl_seat which was used\nfor activation." ] pub unsafe fn zwp_text_input_v1_deactivate ( zwp_text_input_v1 : * mut super :: zwp_text_input_v1 :: zwp_text_input_v1 , seat : * mut super :: wl_seat :: wl_seat ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_text_input_v1 as _ , 1u32 , seat , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "show input panels\n\nRequests input panels (virtual keyboard) to show." ] pub unsafe fn zwp_text_input_v1_show_input_panel ( zwp_text_input_v1 : * mut super :: zwp_text_input_v1 :: zwp_text_input_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_text_input_v1 as _ , 2u32 , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "hide input panels\n\nRequests input panels (virtual keyboard) to hide." ] pub unsafe fn zwp_text_input_v1_hide_input_panel ( zwp_text_input_v1 : * mut super :: zwp_text_input_v1 :: zwp_text_input_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_text_input_v1 as _ , 3u32 , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "reset\n\nShould be called by an editor widget when the input state should be\nreset, for example after the text was changed outside of the normal\ninput method flow." ] pub unsafe fn zwp_text_input_v1_reset ( zwp_text_input_v1 : * mut super :: zwp_text_input_v1 :: zwp_text_input_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_text_input_v1 as _ , 4u32 , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "sets the surrounding text\n\nSets the plain surrounding text around the input position. Text is\nUTF-8 encoded. Cursor is the byte offset within the\nsurrounding text. Anchor is the byte offset of the\nselection anchor within the surrounding text. If there is no selected\ntext anchor, then it is the same as cursor." ] pub unsafe fn zwp_text_input_v1_set_surrounding_text ( zwp_text_input_v1 : * mut super :: zwp_text_input_v1 :: zwp_text_input_v1 , text : * mut c_char , cursor : u32 , anchor : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_text_input_v1 as _ , 5u32 , text , cursor , anchor , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set content purpose and hint\n\nSets the content purpose and content hint. While the purpose is the\nbasic purpose of an input field, the hint flags allow to modify some\nof the behavior.\n\nWhen no content type is explicitly set, a normal content purpose with\ndefault hints (auto completion, auto correction, auto capitalization)\nshould be assumed." ] pub unsafe fn zwp_text_input_v1_set_content_type ( zwp_text_input_v1 : * mut super :: zwp_text_input_v1 :: zwp_text_input_v1 , hint : u32 , purpose : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_text_input_v1 as _ , 6u32 , hint , purpose , std :: ptr :: null :: < c_void > ( ) ) ; } pub unsafe fn zwp_text_input_v1_set_cursor_rectangle ( zwp_text_input_v1 : * mut super :: zwp_text_input_v1 :: zwp_text_input_v1 , x : i32 , y : i32 , width : i32 , height : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_text_input_v1 as _ , 7u32 , x , y , width , height , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "sets preferred language\n\nSets a specific language. This allows for example a virtual keyboard to\nshow a language specific layout. The \"language\" argument is an RFC-3066\nformat language tag.\n\nIt could be used for example in a word processor to indicate the\nlanguage of the currently edited document or in an instant message\napplication which tracks languages of contacts." ] pub unsafe fn zwp_text_input_v1_set_preferred_language ( zwp_text_input_v1 : * mut super :: zwp_text_input_v1 :: zwp_text_input_v1 , language : * mut c_char ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_text_input_v1 as _ , 8u32 , language , std :: ptr :: null :: < c_void > ( ) ) ; } pub unsafe fn zwp_text_input_v1_commit_state ( zwp_text_input_v1 : * mut super :: zwp_text_input_v1 :: zwp_text_input_v1 , serial : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_text_input_v1 as _ , 9u32 , serial , std :: ptr :: null :: < c_void > ( ) ) ; } pub unsafe fn zwp_text_input_v1_invoke_action ( zwp_text_input_v1 : * mut super :: zwp_text_input_v1 :: zwp_text_input_v1 , button : u32 , index : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_text_input_v1 as _ , 10u32 , button , index , std :: ptr :: null :: < c_void > ( ) ) ; } } # [ doc = "text input manager\n\nA factory for text_input objects. This object is a global singleton." ] pub mod zwp_text_input_manager_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_text_input_manager_v1 { } static mut zwp_text_input_manager_v1_requests_create_text_input_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: zwp_text_input_v1 :: zwp_text_input_v1_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_text_input_manager_v1_requests : [ wl_message ; 1 ] = [ wl_message { name : b"create_text_input\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwp_text_input_manager_v1_requests_create_text_input_types as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_text_input_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_text_input_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_text_input_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_text_input_manager_v1_listener { } pub unsafe fn zwp_text_input_manager_v1_set_user_data ( zwp_text_input_manager_v1 : * mut super :: zwp_text_input_manager_v1 :: zwp_text_input_manager_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_text_input_manager_v1 as _ , user_data ) ; } pub unsafe fn zwp_text_input_manager_v1_get_user_data ( zwp_text_input_manager_v1 : * mut super :: zwp_text_input_manager_v1 :: zwp_text_input_manager_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_text_input_manager_v1 as _ ) ; } pub unsafe fn zwp_text_input_manager_v1_get_version ( zwp_text_input_manager_v1 : * mut super :: zwp_text_input_manager_v1 :: zwp_text_input_manager_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_text_input_manager_v1 as _ ) ; } pub unsafe fn zwp_text_input_manager_v1_add_listener ( zwp_text_input_manager_v1 : * mut super :: zwp_text_input_manager_v1 :: zwp_text_input_manager_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_text_input_manager_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_text_input_manager_v1_add_rust_listener ( zwp_text_input_manager_v1 : * mut super :: zwp_text_input_manager_v1 :: zwp_text_input_manager_v1 , listener : & dyn zwp_text_input_manager_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_text_input_manager_v1_add_listener ( zwp_text_input_manager_v1 as _ , fp as _ , op as _ ) == 0 ; } pub unsafe fn zwp_text_input_manager_v1_destroy ( zwp_text_input_manager_v1 : * mut super :: zwp_text_input_manager_v1 :: zwp_text_input_manager_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_text_input_manager_v1 as _ ) ; } # [ doc = "create text input\n\nCreates a new text_input object." ] pub unsafe fn zwp_text_input_manager_v1_create_text_input ( zwp_text_input_manager_v1 : * mut super :: zwp_text_input_manager_v1 :: zwp_text_input_manager_v1 ) -> * mut super :: zwp_text_input_v1 :: zwp_text_input_v1 { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zwp_text_input_manager_v1 as _ , 0u32 , & super :: zwp_text_input_v1 :: zwp_text_input_v1_interface as * const _ , std :: ptr :: null :: < c_void > ( ) ) ; return r as _ ; } } } pub mod relative_pointer_unstable_v1 { use super :: wayland :: * ; use super :: xdg_shell :: * ; # [ doc = "get relative pointer objects\n\nA global interface used for getting the relative pointer object for a\ngiven pointer." ] pub mod zwp_relative_pointer_manager_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_relative_pointer_manager_v1 { } static mut zwp_relative_pointer_manager_v1_requests_get_relative_pointer_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: zwp_relative_pointer_v1 :: zwp_relative_pointer_v1_interface as * const wl_interface } , unsafe { & super :: wl_pointer :: wl_pointer_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_relative_pointer_manager_v1_requests : [ wl_message ; 2 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_relative_pointer\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zwp_relative_pointer_manager_v1_requests_get_relative_pointer_types as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_relative_pointer_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_relative_pointer_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & zwp_relative_pointer_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_relative_pointer_manager_v1_listener { } pub unsafe fn zwp_relative_pointer_manager_v1_set_user_data ( zwp_relative_pointer_manager_v1 : * mut super :: zwp_relative_pointer_manager_v1 :: zwp_relative_pointer_manager_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_relative_pointer_manager_v1 as _ , user_data ) ; } pub unsafe fn zwp_relative_pointer_manager_v1_get_user_data ( zwp_relative_pointer_manager_v1 : * mut super :: zwp_relative_pointer_manager_v1 :: zwp_relative_pointer_manager_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_relative_pointer_manager_v1 as _ ) ; } pub unsafe fn zwp_relative_pointer_manager_v1_get_version ( zwp_relative_pointer_manager_v1 : * mut super :: zwp_relative_pointer_manager_v1 :: zwp_relative_pointer_manager_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_relative_pointer_manager_v1 as _ ) ; } pub unsafe fn zwp_relative_pointer_manager_v1_add_listener ( zwp_relative_pointer_manager_v1 : * mut super :: zwp_relative_pointer_manager_v1 :: zwp_relative_pointer_manager_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_relative_pointer_manager_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_relative_pointer_manager_v1_add_rust_listener ( zwp_relative_pointer_manager_v1 : * mut super :: zwp_relative_pointer_manager_v1 :: zwp_relative_pointer_manager_v1 , listener : & dyn zwp_relative_pointer_manager_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_relative_pointer_manager_v1_add_listener ( zwp_relative_pointer_manager_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the relative pointer manager object\n\nUsed by the client to notify the server that it will no longer use this\nrelative pointer manager object." ] pub unsafe fn zwp_relative_pointer_manager_v1_destroy ( zwp_relative_pointer_manager_v1 : * mut super :: zwp_relative_pointer_manager_v1 :: zwp_relative_pointer_manager_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_relative_pointer_manager_v1 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_relative_pointer_manager_v1 as _ ) ; } # [ doc = "get a relative pointer object\n\nCreate a relative pointer interface given a wl_pointer object. See the\nwp_relative_pointer interface for more details." ] pub unsafe fn zwp_relative_pointer_manager_v1_get_relative_pointer ( zwp_relative_pointer_manager_v1 : * mut super :: zwp_relative_pointer_manager_v1 :: zwp_relative_pointer_manager_v1 , pointer : * mut super :: wl_pointer :: wl_pointer ) -> * mut super :: zwp_relative_pointer_v1 :: zwp_relative_pointer_v1 { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zwp_relative_pointer_manager_v1 as _ , 1u32 , & super :: zwp_relative_pointer_v1 :: zwp_relative_pointer_v1_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , pointer ) ; return r as _ ; } } # [ doc = "relative pointer object\n\nA wp_relative_pointer object is an extension to the wl_pointer interface\nused for emitting relative pointer events. It shares the same focus as\nwl_pointer objects of the same seat and will only emit events when it has\nfocus." ] pub mod zwp_relative_pointer_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_relative_pointer_v1 { } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_relative_pointer_v1_requests : [ wl_message ; 1 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_relative_pointer_v1_events : [ wl_message ; 1 ] = [ wl_message { name : b"relative_motion\0" as * const u8 as * const c_char , signature : b"uuffff\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_relative_pointer_v1_interface : wl_interface = wl_interface { name : b"zwp_relative_pointer_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_relative_pointer_v1_requests as * const _ } , event_count : 1 , events : unsafe { & zwp_relative_pointer_v1_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_relative_pointer_v1_listener { # [ doc = "relative pointer motion\n\nRelative x/y pointer motion from the pointer of the seat associated with\nthis object.\n\nA relative motion is in the same dimension as regular wl_pointer motion\nevents, except they do not represent an absolute position. For example,\nmoving a pointer from (x, y) to (x', y') would have the equivalent\nrelative motion (x' - x, y' - y). If a pointer motion caused the\nabsolute pointer position to be clipped by for example the edge of the\nmonitor, the relative motion is unaffected by the clipping and will\nrepresent the unclipped motion.\n\nThis event also contains non-accelerated motion deltas. The\nnon-accelerated delta is, when applicable, the regular pointer motion\ndelta as it was before having applied motion acceleration and other\ntransformations such as normalization.\n\nNote that the non-accelerated delta does not represent 'raw' events as\nthey were read from some device. Pointer motion acceleration is device-\nand configuration-specific and non-accelerated deltas and accelerated\ndeltas may have the same value on some devices.\n\nRelative motions are not coupled to wl_pointer.motion events, and can be\nsent in combination with such events, but also independently. There may\nalso be scenarios where wl_pointer.motion is sent, but there is no\nrelative motion. The order of an absolute and relative motion event\noriginating from the same physical motion is not guaranteed.\n\nIf the client needs button events or focus state, it can receive them\nfrom a wl_pointer object of the same seat that the wp_relative_pointer\nobject is associated with." ] fn relative_motion ( & mut self , object : * mut zwp_relative_pointer_v1 , utime_hi : u32 , utime_lo : u32 , dx : wl_fixed_t , dy : wl_fixed_t , dx_unaccel : wl_fixed_t , dy_unaccel : wl_fixed_t ) { } } pub unsafe fn zwp_relative_pointer_v1_set_user_data ( zwp_relative_pointer_v1 : * mut super :: zwp_relative_pointer_v1 :: zwp_relative_pointer_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_relative_pointer_v1 as _ , user_data ) ; } pub unsafe fn zwp_relative_pointer_v1_get_user_data ( zwp_relative_pointer_v1 : * mut super :: zwp_relative_pointer_v1 :: zwp_relative_pointer_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_relative_pointer_v1 as _ ) ; } pub unsafe fn zwp_relative_pointer_v1_get_version ( zwp_relative_pointer_v1 : * mut super :: zwp_relative_pointer_v1 :: zwp_relative_pointer_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_relative_pointer_v1 as _ ) ; } pub unsafe fn zwp_relative_pointer_v1_add_listener ( zwp_relative_pointer_v1 : * mut super :: zwp_relative_pointer_v1 :: zwp_relative_pointer_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_relative_pointer_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_relative_pointer_v1_add_rust_listener ( zwp_relative_pointer_v1 : * mut super :: zwp_relative_pointer_v1 :: zwp_relative_pointer_v1 , listener : & dyn zwp_relative_pointer_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_relative_pointer_v1_add_listener ( zwp_relative_pointer_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "release the relative pointer object" ] pub unsafe fn zwp_relative_pointer_v1_destroy ( zwp_relative_pointer_v1 : * mut super :: zwp_relative_pointer_v1 :: zwp_relative_pointer_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_relative_pointer_v1 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_relative_pointer_v1 as _ ) ; } } } pub mod keyboard_shortcuts_inhibit_unstable_v1 { use super :: wayland :: * ; use super :: xdg_shell :: * ; # [ doc = "context object for keyboard grab_manager\n\nA global interface used for inhibiting the compositor keyboard shortcuts." ] pub mod zwp_keyboard_shortcuts_inhibit_manager_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_keyboard_shortcuts_inhibit_manager_v1 { } # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum error { # [ doc = "the shortcuts are already inhibited for this surface" ] already_inhibited = 0 , # [ doc ( hidden ) ] __nonexhaustive , } impl error { pub fn from_raw ( n : u32 ) -> Option < error > { match n { 0 => Some ( error :: already_inhibited ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } static mut zwp_keyboard_shortcuts_inhibit_manager_v1_requests_inhibit_shortcuts_types : [ * const wl_interface ; 3 ] = [ unsafe { & super :: zwp_keyboard_shortcuts_inhibitor_v1 :: zwp_keyboard_shortcuts_inhibitor_v1_interface as * const wl_interface } , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_keyboard_shortcuts_inhibit_manager_v1_requests : [ wl_message ; 2 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"inhibit_shortcuts\0" as * const u8 as * const c_char , signature : b"noo\0" as * const u8 as * const c_char , types : unsafe { & zwp_keyboard_shortcuts_inhibit_manager_v1_requests_inhibit_shortcuts_types as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_keyboard_shortcuts_inhibit_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_keyboard_shortcuts_inhibit_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & zwp_keyboard_shortcuts_inhibit_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_keyboard_shortcuts_inhibit_manager_v1_listener { } pub unsafe fn zwp_keyboard_shortcuts_inhibit_manager_v1_set_user_data ( zwp_keyboard_shortcuts_inhibit_manager_v1 : * mut super :: zwp_keyboard_shortcuts_inhibit_manager_v1 :: zwp_keyboard_shortcuts_inhibit_manager_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_keyboard_shortcuts_inhibit_manager_v1 as _ , user_data ) ; } pub unsafe fn zwp_keyboard_shortcuts_inhibit_manager_v1_get_user_data ( zwp_keyboard_shortcuts_inhibit_manager_v1 : * mut super :: zwp_keyboard_shortcuts_inhibit_manager_v1 :: zwp_keyboard_shortcuts_inhibit_manager_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_keyboard_shortcuts_inhibit_manager_v1 as _ ) ; } pub unsafe fn zwp_keyboard_shortcuts_inhibit_manager_v1_get_version ( zwp_keyboard_shortcuts_inhibit_manager_v1 : * mut super :: zwp_keyboard_shortcuts_inhibit_manager_v1 :: zwp_keyboard_shortcuts_inhibit_manager_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_keyboard_shortcuts_inhibit_manager_v1 as _ ) ; } pub unsafe fn zwp_keyboard_shortcuts_inhibit_manager_v1_add_listener ( zwp_keyboard_shortcuts_inhibit_manager_v1 : * mut super :: zwp_keyboard_shortcuts_inhibit_manager_v1 :: zwp_keyboard_shortcuts_inhibit_manager_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_keyboard_shortcuts_inhibit_manager_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_keyboard_shortcuts_inhibit_manager_v1_add_rust_listener ( zwp_keyboard_shortcuts_inhibit_manager_v1 : * mut super :: zwp_keyboard_shortcuts_inhibit_manager_v1 :: zwp_keyboard_shortcuts_inhibit_manager_v1 , listener : & dyn zwp_keyboard_shortcuts_inhibit_manager_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_keyboard_shortcuts_inhibit_manager_v1_add_listener ( zwp_keyboard_shortcuts_inhibit_manager_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the keyboard shortcuts inhibitor object\n\nDestroy the keyboard shortcuts inhibitor manager." ] pub unsafe fn zwp_keyboard_shortcuts_inhibit_manager_v1_destroy ( zwp_keyboard_shortcuts_inhibit_manager_v1 : * mut super :: zwp_keyboard_shortcuts_inhibit_manager_v1 :: zwp_keyboard_shortcuts_inhibit_manager_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_keyboard_shortcuts_inhibit_manager_v1 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_keyboard_shortcuts_inhibit_manager_v1 as _ ) ; } # [ doc = "create a new keyboard shortcuts inhibitor object\n\nCreate a new keyboard shortcuts inhibitor object associated with\nthe given surface for the given seat.\n\nIf shortcuts are already inhibited for the specified seat and surface,\na protocol error \"already_inhibited\" is raised by the compositor." ] pub unsafe fn zwp_keyboard_shortcuts_inhibit_manager_v1_inhibit_shortcuts ( zwp_keyboard_shortcuts_inhibit_manager_v1 : * mut super :: zwp_keyboard_shortcuts_inhibit_manager_v1 :: zwp_keyboard_shortcuts_inhibit_manager_v1 , surface : * mut super :: wl_surface :: wl_surface , seat : * mut super :: wl_seat :: wl_seat ) -> * mut super :: zwp_keyboard_shortcuts_inhibitor_v1 :: zwp_keyboard_shortcuts_inhibitor_v1 { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zwp_keyboard_shortcuts_inhibit_manager_v1 as _ , 1u32 , & super :: zwp_keyboard_shortcuts_inhibitor_v1 :: zwp_keyboard_shortcuts_inhibitor_v1_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , surface , seat ) ; return r as _ ; } } # [ doc = "context object for keyboard shortcuts inhibitor\n\nA keyboard shortcuts inhibitor instructs the compositor to ignore\nits own keyboard shortcuts when the associated surface has keyboard\nfocus. As a result, when the surface has keyboard focus on the given\nseat, it will receive all key events originating from the specified\nseat, even those which would normally be caught by the compositor for\nits own shortcuts.\n\nThe Wayland compositor is however under no obligation to disable\nall of its shortcuts, and may keep some special key combo for its own\nuse, including but not limited to one allowing the user to forcibly\nrestore normal keyboard events routing in the case of an unwilling\nclient. The compositor may also use the same key combo to reactivate\nan existing shortcut inhibitor that was previously deactivated on\nuser request.\n\nWhen the compositor restores its own keyboard shortcuts, an\n\"inactive\" event is emitted to notify the client that the keyboard\nshortcuts inhibitor is not effectively active for the surface and\nseat any more, and the client should not expect to receive all\nkeyboard events.\n\nWhen the keyboard shortcuts inhibitor is inactive, the client has\nno way to forcibly reactivate the keyboard shortcuts inhibitor.\n\nThe user can chose to re-enable a previously deactivated keyboard\nshortcuts inhibitor using any mechanism the compositor may offer,\nin which case the compositor will send an \"active\" event to notify\nthe client.\n\nIf the surface is destroyed, unmapped, or loses the seat's keyboard\nfocus, the keyboard shortcuts inhibitor becomes irrelevant and the\ncompositor will restore its own keyboard shortcuts but no \"inactive\"\nevent is emitted in this case." ] pub mod zwp_keyboard_shortcuts_inhibitor_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_keyboard_shortcuts_inhibitor_v1 { } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_keyboard_shortcuts_inhibitor_v1_requests : [ wl_message ; 1 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_keyboard_shortcuts_inhibitor_v1_events : [ wl_message ; 2 ] = [ wl_message { name : b"active\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"inactive\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_keyboard_shortcuts_inhibitor_v1_interface : wl_interface = wl_interface { name : b"zwp_keyboard_shortcuts_inhibitor_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_keyboard_shortcuts_inhibitor_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwp_keyboard_shortcuts_inhibitor_v1_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_keyboard_shortcuts_inhibitor_v1_listener { # [ doc = "shortcuts are inhibited\n\nThis event indicates that the shortcut inhibitor is active.\n\nThe compositor sends this event every time compositor shortcuts\nare inhibited on behalf of the surface. When active, the client\nmay receive input events normally reserved by the compositor\n(see zwp_keyboard_shortcuts_inhibitor_v1).\n\nThis occurs typically when the initial request \"inhibit_shortcuts\"\nfirst becomes active or when the user instructs the compositor to\nre-enable and existing shortcuts inhibitor using any mechanism\noffered by the compositor." ] fn active ( & mut self , object : * mut zwp_keyboard_shortcuts_inhibitor_v1 , ) { } # [ doc = "shortcuts are restored\n\nThis event indicates that the shortcuts inhibitor is inactive,\nnormal shortcuts processing is restored by the compositor." ] fn inactive ( & mut self , object : * mut zwp_keyboard_shortcuts_inhibitor_v1 , ) { } } pub unsafe fn zwp_keyboard_shortcuts_inhibitor_v1_set_user_data ( zwp_keyboard_shortcuts_inhibitor_v1 : * mut super :: zwp_keyboard_shortcuts_inhibitor_v1 :: zwp_keyboard_shortcuts_inhibitor_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_keyboard_shortcuts_inhibitor_v1 as _ , user_data ) ; } pub unsafe fn zwp_keyboard_shortcuts_inhibitor_v1_get_user_data ( zwp_keyboard_shortcuts_inhibitor_v1 : * mut super :: zwp_keyboard_shortcuts_inhibitor_v1 :: zwp_keyboard_shortcuts_inhibitor_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_keyboard_shortcuts_inhibitor_v1 as _ ) ; } pub unsafe fn zwp_keyboard_shortcuts_inhibitor_v1_get_version ( zwp_keyboard_shortcuts_inhibitor_v1 : * mut super :: zwp_keyboard_shortcuts_inhibitor_v1 :: zwp_keyboard_shortcuts_inhibitor_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_keyboard_shortcuts_inhibitor_v1 as _ ) ; } pub unsafe fn zwp_keyboard_shortcuts_inhibitor_v1_add_listener ( zwp_keyboard_shortcuts_inhibitor_v1 : * mut super :: zwp_keyboard_shortcuts_inhibitor_v1 :: zwp_keyboard_shortcuts_inhibitor_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_keyboard_shortcuts_inhibitor_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_keyboard_shortcuts_inhibitor_v1_add_rust_listener ( zwp_keyboard_shortcuts_inhibitor_v1 : * mut super :: zwp_keyboard_shortcuts_inhibitor_v1 :: zwp_keyboard_shortcuts_inhibitor_v1 , listener : & dyn zwp_keyboard_shortcuts_inhibitor_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_keyboard_shortcuts_inhibitor_v1_add_listener ( zwp_keyboard_shortcuts_inhibitor_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the keyboard shortcuts inhibitor object\n\nRemove the keyboard shortcuts inhibitor from the associated wl_surface." ] pub unsafe fn zwp_keyboard_shortcuts_inhibitor_v1_destroy ( zwp_keyboard_shortcuts_inhibitor_v1 : * mut super :: zwp_keyboard_shortcuts_inhibitor_v1 :: zwp_keyboard_shortcuts_inhibitor_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_keyboard_shortcuts_inhibitor_v1 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_keyboard_shortcuts_inhibitor_v1 as _ ) ; } } } pub mod wp_primary_selection_unstable_v1 { use super :: wayland :: * ; use super :: xdg_shell :: * ; # [ doc = "X primary selection emulation\n\nThe primary selection device manager is a singleton global object that\nprovides access to the primary selection. It allows to create\nwp_primary_selection_source objects, as well as retrieving the per-seat\nwp_primary_selection_device objects." ] pub mod zwp_primary_selection_device_manager_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_primary_selection_device_manager_v1 { } static mut zwp_primary_selection_device_manager_v1_requests_create_source_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: zwp_primary_selection_source_v1 :: zwp_primary_selection_source_v1_interface as * const wl_interface } , ] ; static mut zwp_primary_selection_device_manager_v1_requests_get_device_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: zwp_primary_selection_device_v1 :: zwp_primary_selection_device_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_primary_selection_device_manager_v1_requests : [ wl_message ; 3 ] = [ wl_message { name : b"create_source\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwp_primary_selection_device_manager_v1_requests_create_source_types as * const _ } , } , wl_message { name : b"get_device\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zwp_primary_selection_device_manager_v1_requests_get_device_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_primary_selection_device_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_primary_selection_device_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 3 , requests : unsafe { & zwp_primary_selection_device_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_primary_selection_device_manager_v1_listener { } pub unsafe fn zwp_primary_selection_device_manager_v1_set_user_data ( zwp_primary_selection_device_manager_v1 : * mut super :: zwp_primary_selection_device_manager_v1 :: zwp_primary_selection_device_manager_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_primary_selection_device_manager_v1 as _ , user_data ) ; } pub unsafe fn zwp_primary_selection_device_manager_v1_get_user_data ( zwp_primary_selection_device_manager_v1 : * mut super :: zwp_primary_selection_device_manager_v1 :: zwp_primary_selection_device_manager_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_primary_selection_device_manager_v1 as _ ) ; } pub unsafe fn zwp_primary_selection_device_manager_v1_get_version ( zwp_primary_selection_device_manager_v1 : * mut super :: zwp_primary_selection_device_manager_v1 :: zwp_primary_selection_device_manager_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_primary_selection_device_manager_v1 as _ ) ; } pub unsafe fn zwp_primary_selection_device_manager_v1_add_listener ( zwp_primary_selection_device_manager_v1 : * mut super :: zwp_primary_selection_device_manager_v1 :: zwp_primary_selection_device_manager_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_primary_selection_device_manager_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_primary_selection_device_manager_v1_add_rust_listener ( zwp_primary_selection_device_manager_v1 : * mut super :: zwp_primary_selection_device_manager_v1 :: zwp_primary_selection_device_manager_v1 , listener : & dyn zwp_primary_selection_device_manager_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_primary_selection_device_manager_v1_add_listener ( zwp_primary_selection_device_manager_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "create a new primary selection source\n\nCreate a new primary selection source." ] pub unsafe fn zwp_primary_selection_device_manager_v1_create_source ( zwp_primary_selection_device_manager_v1 : * mut super :: zwp_primary_selection_device_manager_v1 :: zwp_primary_selection_device_manager_v1 ) -> * mut super :: zwp_primary_selection_source_v1 :: zwp_primary_selection_source_v1 { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zwp_primary_selection_device_manager_v1 as _ , 0u32 , & super :: zwp_primary_selection_source_v1 :: zwp_primary_selection_source_v1_interface as * const _ , std :: ptr :: null :: < c_void > ( ) ) ; return r as _ ; } # [ doc = "create a new primary selection device\n\nCreate a new data device for a given seat." ] pub unsafe fn zwp_primary_selection_device_manager_v1_get_device ( zwp_primary_selection_device_manager_v1 : * mut super :: zwp_primary_selection_device_manager_v1 :: zwp_primary_selection_device_manager_v1 , seat : * mut super :: wl_seat :: wl_seat ) -> * mut super :: zwp_primary_selection_device_v1 :: zwp_primary_selection_device_v1 { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zwp_primary_selection_device_manager_v1 as _ , 1u32 , & super :: zwp_primary_selection_device_v1 :: zwp_primary_selection_device_v1_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , seat ) ; return r as _ ; } # [ doc = "destroy the primary selection device manager\n\nDestroy the primary selection device manager." ] pub unsafe fn zwp_primary_selection_device_manager_v1_destroy ( zwp_primary_selection_device_manager_v1 : * mut super :: zwp_primary_selection_device_manager_v1 :: zwp_primary_selection_device_manager_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_primary_selection_device_manager_v1 as _ , 2u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_primary_selection_device_manager_v1 as _ ) ; } } pub mod zwp_primary_selection_device_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_primary_selection_device_v1 { } static mut zwp_primary_selection_device_v1_requests_set_selection_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: zwp_primary_selection_source_v1 :: zwp_primary_selection_source_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_primary_selection_device_v1_requests : [ wl_message ; 2 ] = [ wl_message { name : b"set_selection\0" as * const u8 as * const c_char , signature : b"?ou\0" as * const u8 as * const c_char , types : unsafe { & zwp_primary_selection_device_v1_requests_set_selection_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; static mut zwp_primary_selection_device_v1_events_data_offer_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: zwp_primary_selection_offer_v1 :: zwp_primary_selection_offer_v1_interface as * const wl_interface } , ] ; static mut zwp_primary_selection_device_v1_events_selection_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: zwp_primary_selection_offer_v1 :: zwp_primary_selection_offer_v1_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_primary_selection_device_v1_events : [ wl_message ; 2 ] = [ wl_message { name : b"data_offer\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwp_primary_selection_device_v1_events_data_offer_types as * const _ } , } , wl_message { name : b"selection\0" as * const u8 as * const c_char , signature : b"?o\0" as * const u8 as * const c_char , types : unsafe { & zwp_primary_selection_device_v1_events_selection_types as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_primary_selection_device_v1_interface : wl_interface = wl_interface { name : b"zwp_primary_selection_device_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & zwp_primary_selection_device_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwp_primary_selection_device_v1_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_primary_selection_device_v1_listener { # [ doc = "introduce a new wp_primary_selection_offer\n\nIntroduces a new wp_primary_selection_offer object that may be used\nto receive the current primary selection. Immediately following this\nevent, the new wp_primary_selection_offer object will send\nwp_primary_selection_offer.offer events to describe the offered mime\ntypes." ] fn data_offer ( & mut self , object : * mut zwp_primary_selection_device_v1 , offer : * mut super :: zwp_primary_selection_offer_v1 :: zwp_primary_selection_offer_v1 ) { } # [ doc = "advertise a new primary selection\n\nThe wp_primary_selection_device.selection event is sent to notify the\nclient of a new primary selection. This event is sent after the\nwp_primary_selection.data_offer event introducing this object, and after\nthe offer has announced its mimetypes through\nwp_primary_selection_offer.offer.\n\nThe data_offer is valid until a new offer or NULL is received\nor until the client loses keyboard focus. The client must destroy the\nprevious selection data_offer, if any, upon receiving this event." ] fn selection ( & mut self , object : * mut zwp_primary_selection_device_v1 , id : Option < * mut super :: zwp_primary_selection_offer_v1 :: zwp_primary_selection_offer_v1 > ) { } } pub unsafe fn zwp_primary_selection_device_v1_set_user_data ( zwp_primary_selection_device_v1 : * mut super :: zwp_primary_selection_device_v1 :: zwp_primary_selection_device_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_primary_selection_device_v1 as _ , user_data ) ; } pub unsafe fn zwp_primary_selection_device_v1_get_user_data ( zwp_primary_selection_device_v1 : * mut super :: zwp_primary_selection_device_v1 :: zwp_primary_selection_device_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_primary_selection_device_v1 as _ ) ; } pub unsafe fn zwp_primary_selection_device_v1_get_version ( zwp_primary_selection_device_v1 : * mut super :: zwp_primary_selection_device_v1 :: zwp_primary_selection_device_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_primary_selection_device_v1 as _ ) ; } pub unsafe fn zwp_primary_selection_device_v1_add_listener ( zwp_primary_selection_device_v1 : * mut super :: zwp_primary_selection_device_v1 :: zwp_primary_selection_device_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_primary_selection_device_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_primary_selection_device_v1_add_rust_listener ( zwp_primary_selection_device_v1 : * mut super :: zwp_primary_selection_device_v1 :: zwp_primary_selection_device_v1 , listener : & dyn zwp_primary_selection_device_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_primary_selection_device_v1_add_listener ( zwp_primary_selection_device_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "set the primary selection\n\nReplaces the current selection. The previous owner of the primary\nselection will receive a wp_primary_selection_source.cancelled event.\n\nTo unset the selection, set the source to NULL." ] pub unsafe fn zwp_primary_selection_device_v1_set_selection ( zwp_primary_selection_device_v1 : * mut super :: zwp_primary_selection_device_v1 :: zwp_primary_selection_device_v1 , source : * mut super :: zwp_primary_selection_source_v1 :: zwp_primary_selection_source_v1 , serial : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_primary_selection_device_v1 as _ , 0u32 , source , serial , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "destroy the primary selection device\n\nDestroy the primary selection device." ] pub unsafe fn zwp_primary_selection_device_v1_destroy ( zwp_primary_selection_device_v1 : * mut super :: zwp_primary_selection_device_v1 :: zwp_primary_selection_device_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_primary_selection_device_v1 as _ , 1u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_primary_selection_device_v1 as _ ) ; } } # [ doc = "offer to transfer primary selection contents\n\nA wp_primary_selection_offer represents an offer to transfer the contents\nof the primary selection clipboard to the client. Similar to\nwl_data_offer, the offer also describes the mime types that the data can\nbe converted to and provides the mechanisms for transferring the data\ndirectly to the client." ] pub mod zwp_primary_selection_offer_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_primary_selection_offer_v1 { } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_primary_selection_offer_v1_requests : [ wl_message ; 2 ] = [ wl_message { name : b"receive\0" as * const u8 as * const c_char , signature : b"sh\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_primary_selection_offer_v1_events : [ wl_message ; 1 ] = [ wl_message { name : b"offer\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_primary_selection_offer_v1_interface : wl_interface = wl_interface { name : b"zwp_primary_selection_offer_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & zwp_primary_selection_offer_v1_requests as * const _ } , event_count : 1 , events : unsafe { & zwp_primary_selection_offer_v1_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_primary_selection_offer_v1_listener { # [ doc = "advertise offered mime type\n\nSent immediately after creating announcing the\nwp_primary_selection_offer through\nwp_primary_selection_device.data_offer. One event is sent per offered\nmime type." ] fn offer ( & mut self , object : * mut zwp_primary_selection_offer_v1 , mime_type : * mut c_char ) { } } pub unsafe fn zwp_primary_selection_offer_v1_set_user_data ( zwp_primary_selection_offer_v1 : * mut super :: zwp_primary_selection_offer_v1 :: zwp_primary_selection_offer_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_primary_selection_offer_v1 as _ , user_data ) ; } pub unsafe fn zwp_primary_selection_offer_v1_get_user_data ( zwp_primary_selection_offer_v1 : * mut super :: zwp_primary_selection_offer_v1 :: zwp_primary_selection_offer_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_primary_selection_offer_v1 as _ ) ; } pub unsafe fn zwp_primary_selection_offer_v1_get_version ( zwp_primary_selection_offer_v1 : * mut super :: zwp_primary_selection_offer_v1 :: zwp_primary_selection_offer_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_primary_selection_offer_v1 as _ ) ; } pub unsafe fn zwp_primary_selection_offer_v1_add_listener ( zwp_primary_selection_offer_v1 : * mut super :: zwp_primary_selection_offer_v1 :: zwp_primary_selection_offer_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_primary_selection_offer_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_primary_selection_offer_v1_add_rust_listener ( zwp_primary_selection_offer_v1 : * mut super :: zwp_primary_selection_offer_v1 :: zwp_primary_selection_offer_v1 , listener : & dyn zwp_primary_selection_offer_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_primary_selection_offer_v1_add_listener ( zwp_primary_selection_offer_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "request that the data is transferred\n\nTo transfer the contents of the primary selection clipboard, the client\nissues this request and indicates the mime type that it wants to\nreceive. The transfer happens through the passed file descriptor\n(typically created with the pipe system call). The source client writes\nthe data in the mime type representation requested and then closes the\nfile descriptor.\n\nThe receiving client reads from the read end of the pipe until EOF and\ncloses its end, at which point the transfer is complete." ] pub unsafe fn zwp_primary_selection_offer_v1_receive ( zwp_primary_selection_offer_v1 : * mut super :: zwp_primary_selection_offer_v1 :: zwp_primary_selection_offer_v1 , mime_type : * mut c_char , fd : :: std :: os :: unix :: io :: RawFd ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_primary_selection_offer_v1 as _ , 0u32 , mime_type , fd , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "destroy the primary selection offer\n\nDestroy the primary selection offer." ] pub unsafe fn zwp_primary_selection_offer_v1_destroy ( zwp_primary_selection_offer_v1 : * mut super :: zwp_primary_selection_offer_v1 :: zwp_primary_selection_offer_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_primary_selection_offer_v1 as _ , 1u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_primary_selection_offer_v1 as _ ) ; } } # [ doc = "offer to replace the contents of the primary selection\n\nThe source side of a wp_primary_selection_offer, it provides a way to\ndescribe the offered data and respond to requests to transfer the\nrequested contents of the primary selection clipboard." ] pub mod zwp_primary_selection_source_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_primary_selection_source_v1 { } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_primary_selection_source_v1_requests : [ wl_message ; 2 ] = [ wl_message { name : b"offer\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_primary_selection_source_v1_events : [ wl_message ; 2 ] = [ wl_message { name : b"send\0" as * const u8 as * const c_char , signature : b"sh\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"cancelled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_primary_selection_source_v1_interface : wl_interface = wl_interface { name : b"zwp_primary_selection_source_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & zwp_primary_selection_source_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwp_primary_selection_source_v1_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_primary_selection_source_v1_listener { # [ doc = "send the primary selection contents\n\nRequest for the current primary selection contents from the client.\nSend the specified mime type over the passed file descriptor, then\nclose it." ] fn send ( & mut self , object : * mut zwp_primary_selection_source_v1 , mime_type : * mut c_char , fd : :: std :: os :: unix :: io :: RawFd ) { } # [ doc = "request for primary selection contents was canceled\n\nThis primary selection source is no longer valid. The client should\nclean up and destroy this primary selection source." ] fn cancelled ( & mut self , object : * mut zwp_primary_selection_source_v1 , ) { } } pub unsafe fn zwp_primary_selection_source_v1_set_user_data ( zwp_primary_selection_source_v1 : * mut super :: zwp_primary_selection_source_v1 :: zwp_primary_selection_source_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_primary_selection_source_v1 as _ , user_data ) ; } pub unsafe fn zwp_primary_selection_source_v1_get_user_data ( zwp_primary_selection_source_v1 : * mut super :: zwp_primary_selection_source_v1 :: zwp_primary_selection_source_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_primary_selection_source_v1 as _ ) ; } pub unsafe fn zwp_primary_selection_source_v1_get_version ( zwp_primary_selection_source_v1 : * mut super :: zwp_primary_selection_source_v1 :: zwp_primary_selection_source_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_primary_selection_source_v1 as _ ) ; } pub unsafe fn zwp_primary_selection_source_v1_add_listener ( zwp_primary_selection_source_v1 : * mut super :: zwp_primary_selection_source_v1 :: zwp_primary_selection_source_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_primary_selection_source_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_primary_selection_source_v1_add_rust_listener ( zwp_primary_selection_source_v1 : * mut super :: zwp_primary_selection_source_v1 :: zwp_primary_selection_source_v1 , listener : & dyn zwp_primary_selection_source_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_primary_selection_source_v1_add_listener ( zwp_primary_selection_source_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "add an offered mime type\n\nThis request adds a mime type to the set of mime types advertised to\ntargets. Can be called several times to offer multiple types." ] pub unsafe fn zwp_primary_selection_source_v1_offer ( zwp_primary_selection_source_v1 : * mut super :: zwp_primary_selection_source_v1 :: zwp_primary_selection_source_v1 , mime_type : * mut c_char ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_primary_selection_source_v1 as _ , 0u32 , mime_type , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "destroy the primary selection source\n\nDestroy the primary selection source." ] pub unsafe fn zwp_primary_selection_source_v1_destroy ( zwp_primary_selection_source_v1 : * mut super :: zwp_primary_selection_source_v1 :: zwp_primary_selection_source_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_primary_selection_source_v1 as _ , 1u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_primary_selection_source_v1 as _ ) ; } } } pub mod idle_inhibit_unstable_v1 { use super :: wayland :: * ; use super :: xdg_shell :: * ; # [ doc = "control behavior when display idles\n\nThis interface permits inhibiting the idle behavior such as screen\nblanking, locking, and screensaving.  The client binds the idle manager\nglobally, then creates idle-inhibitor objects for each surface.\n\nWarning! The protocol described in this file is experimental and\nbackward incompatible changes may be made. Backward compatible changes\nmay be added together with the corresponding interface version bump.\nBackward incompatible changes are done by bumping the version number in\nthe protocol and interface names and resetting the interface version.\nOnce the protocol is to be declared stable, the 'z' prefix and the\nversion number in the protocol and interface names are removed and the\ninterface version number is reset." ] pub mod zwp_idle_inhibit_manager_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_idle_inhibit_manager_v1 { } static mut zwp_idle_inhibit_manager_v1_requests_create_inhibitor_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: zwp_idle_inhibitor_v1 :: zwp_idle_inhibitor_v1_interface as * const wl_interface } , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_idle_inhibit_manager_v1_requests : [ wl_message ; 2 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_inhibitor\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zwp_idle_inhibit_manager_v1_requests_create_inhibitor_types as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_idle_inhibit_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_idle_inhibit_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & zwp_idle_inhibit_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_idle_inhibit_manager_v1_listener { } pub unsafe fn zwp_idle_inhibit_manager_v1_set_user_data ( zwp_idle_inhibit_manager_v1 : * mut super :: zwp_idle_inhibit_manager_v1 :: zwp_idle_inhibit_manager_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_idle_inhibit_manager_v1 as _ , user_data ) ; } pub unsafe fn zwp_idle_inhibit_manager_v1_get_user_data ( zwp_idle_inhibit_manager_v1 : * mut super :: zwp_idle_inhibit_manager_v1 :: zwp_idle_inhibit_manager_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_idle_inhibit_manager_v1 as _ ) ; } pub unsafe fn zwp_idle_inhibit_manager_v1_get_version ( zwp_idle_inhibit_manager_v1 : * mut super :: zwp_idle_inhibit_manager_v1 :: zwp_idle_inhibit_manager_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_idle_inhibit_manager_v1 as _ ) ; } pub unsafe fn zwp_idle_inhibit_manager_v1_add_listener ( zwp_idle_inhibit_manager_v1 : * mut super :: zwp_idle_inhibit_manager_v1 :: zwp_idle_inhibit_manager_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_idle_inhibit_manager_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_idle_inhibit_manager_v1_add_rust_listener ( zwp_idle_inhibit_manager_v1 : * mut super :: zwp_idle_inhibit_manager_v1 :: zwp_idle_inhibit_manager_v1 , listener : & dyn zwp_idle_inhibit_manager_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_idle_inhibit_manager_v1_add_listener ( zwp_idle_inhibit_manager_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the idle inhibitor object\n\nDestroy the inhibit manager." ] pub unsafe fn zwp_idle_inhibit_manager_v1_destroy ( zwp_idle_inhibit_manager_v1 : * mut super :: zwp_idle_inhibit_manager_v1 :: zwp_idle_inhibit_manager_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_idle_inhibit_manager_v1 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_idle_inhibit_manager_v1 as _ ) ; } # [ doc = "create a new inhibitor object\n\nCreate a new inhibitor object associated with the given surface." ] pub unsafe fn zwp_idle_inhibit_manager_v1_create_inhibitor ( zwp_idle_inhibit_manager_v1 : * mut super :: zwp_idle_inhibit_manager_v1 :: zwp_idle_inhibit_manager_v1 , surface : * mut super :: wl_surface :: wl_surface ) -> * mut super :: zwp_idle_inhibitor_v1 :: zwp_idle_inhibitor_v1 { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zwp_idle_inhibit_manager_v1 as _ , 1u32 , & super :: zwp_idle_inhibitor_v1 :: zwp_idle_inhibitor_v1_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , surface ) ; return r as _ ; } } # [ doc = "context object for inhibiting idle behavior\n\nAn idle inhibitor prevents the output that the associated surface is\nvisible on from being set to a state where it is not visually usable due\nto lack of user interaction (e.g. blanked, dimmed, locked, set to power\nsave, etc.)  Any screensaver processes are also blocked from displaying.\n\nIf the surface is destroyed, unmapped, becomes occluded, loses\nvisibility, or otherwise becomes not visually relevant for the user, the\nidle inhibitor will not be honored by the compositor; if the surface\nsubsequently regains visibility the inhibitor takes effect once again.\nLikewise, the inhibitor isn't honored if the system was already idled at\nthe time the inhibitor was established, although if the system later\nde-idles and re-idles the inhibitor will take effect." ] pub mod zwp_idle_inhibitor_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_idle_inhibitor_v1 { } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_idle_inhibitor_v1_requests : [ wl_message ; 1 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_idle_inhibitor_v1_interface : wl_interface = wl_interface { name : b"zwp_idle_inhibitor_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_idle_inhibitor_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_idle_inhibitor_v1_listener { } pub unsafe fn zwp_idle_inhibitor_v1_set_user_data ( zwp_idle_inhibitor_v1 : * mut super :: zwp_idle_inhibitor_v1 :: zwp_idle_inhibitor_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_idle_inhibitor_v1 as _ , user_data ) ; } pub unsafe fn zwp_idle_inhibitor_v1_get_user_data ( zwp_idle_inhibitor_v1 : * mut super :: zwp_idle_inhibitor_v1 :: zwp_idle_inhibitor_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_idle_inhibitor_v1 as _ ) ; } pub unsafe fn zwp_idle_inhibitor_v1_get_version ( zwp_idle_inhibitor_v1 : * mut super :: zwp_idle_inhibitor_v1 :: zwp_idle_inhibitor_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_idle_inhibitor_v1 as _ ) ; } pub unsafe fn zwp_idle_inhibitor_v1_add_listener ( zwp_idle_inhibitor_v1 : * mut super :: zwp_idle_inhibitor_v1 :: zwp_idle_inhibitor_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_idle_inhibitor_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_idle_inhibitor_v1_add_rust_listener ( zwp_idle_inhibitor_v1 : * mut super :: zwp_idle_inhibitor_v1 :: zwp_idle_inhibitor_v1 , listener : & dyn zwp_idle_inhibitor_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_idle_inhibitor_v1_add_listener ( zwp_idle_inhibitor_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the idle inhibitor object\n\nRemove the inhibitor effect from the associated wl_surface." ] pub unsafe fn zwp_idle_inhibitor_v1_destroy ( zwp_idle_inhibitor_v1 : * mut super :: zwp_idle_inhibitor_v1 :: zwp_idle_inhibitor_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_idle_inhibitor_v1 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_idle_inhibitor_v1 as _ ) ; } } } pub mod xdg_output_unstable_v1 { use super :: wayland :: * ; use super :: xdg_shell :: * ; # [ doc = "manage xdg_output objects\n\nA global factory interface for xdg_output objects." ] pub mod zxdg_output_manager_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zxdg_output_manager_v1 { } static mut zxdg_output_manager_v1_requests_get_xdg_output_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: zxdg_output_v1 :: zxdg_output_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zxdg_output_manager_v1_requests : [ wl_message ; 2 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_xdg_output\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zxdg_output_manager_v1_requests_get_xdg_output_types as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zxdg_output_manager_v1_interface : wl_interface = wl_interface { name : b"zxdg_output_manager_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 2 , requests : unsafe { & zxdg_output_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait zxdg_output_manager_v1_listener { } pub unsafe fn zxdg_output_manager_v1_set_user_data ( zxdg_output_manager_v1 : * mut super :: zxdg_output_manager_v1 :: zxdg_output_manager_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zxdg_output_manager_v1 as _ , user_data ) ; } pub unsafe fn zxdg_output_manager_v1_get_user_data ( zxdg_output_manager_v1 : * mut super :: zxdg_output_manager_v1 :: zxdg_output_manager_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zxdg_output_manager_v1 as _ ) ; } pub unsafe fn zxdg_output_manager_v1_get_version ( zxdg_output_manager_v1 : * mut super :: zxdg_output_manager_v1 :: zxdg_output_manager_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zxdg_output_manager_v1 as _ ) ; } pub unsafe fn zxdg_output_manager_v1_add_listener ( zxdg_output_manager_v1 : * mut super :: zxdg_output_manager_v1 :: zxdg_output_manager_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zxdg_output_manager_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zxdg_output_manager_v1_add_rust_listener ( zxdg_output_manager_v1 : * mut super :: zxdg_output_manager_v1 :: zxdg_output_manager_v1 , listener : & dyn zxdg_output_manager_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zxdg_output_manager_v1_add_listener ( zxdg_output_manager_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the xdg_output_manager object\n\nUsing this request a client can tell the server that it is not\ngoing to use the xdg_output_manager object anymore.\n\nAny objects already created through this instance are not affected." ] pub unsafe fn zxdg_output_manager_v1_destroy ( zxdg_output_manager_v1 : * mut super :: zxdg_output_manager_v1 :: zxdg_output_manager_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_output_manager_v1 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zxdg_output_manager_v1 as _ ) ; } # [ doc = "create an xdg output from a wl_output\n\nThis creates a new xdg_output object for the given wl_output." ] pub unsafe fn zxdg_output_manager_v1_get_xdg_output ( zxdg_output_manager_v1 : * mut super :: zxdg_output_manager_v1 :: zxdg_output_manager_v1 , output : * mut super :: wl_output :: wl_output ) -> * mut super :: zxdg_output_v1 :: zxdg_output_v1 { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zxdg_output_manager_v1 as _ , 1u32 , & super :: zxdg_output_v1 :: zxdg_output_v1_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , output ) ; return r as _ ; } } # [ doc = "compositor logical output region\n\nAn xdg_output describes part of the compositor geometry.\n\nThis typically corresponds to a monitor that displays part of the\ncompositor space.\n\nFor objects version 3 onwards, after all xdg_output properties have been\nsent (when the object is created and when properties are updated), a\nwl_output.done event is sent. This allows changes to the output\nproperties to be seen as atomic, even if they happen via multiple events." ] pub mod zxdg_output_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zxdg_output_v1 { } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zxdg_output_v1_requests : [ wl_message ; 1 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zxdg_output_v1_events : [ wl_message ; 5 ] = [ wl_message { name : b"logical_position\0" as * const u8 as * const c_char , signature : b"ii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"logical_size\0" as * const u8 as * const c_char , signature : b"ii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"name\0" as * const u8 as * const c_char , signature : b"2s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"description\0" as * const u8 as * const c_char , signature : b"2s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zxdg_output_v1_interface : wl_interface = wl_interface { name : b"zxdg_output_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zxdg_output_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zxdg_output_v1_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zxdg_output_v1_listener { # [ doc = "position of the output within the global compositor space\n\nThe position event describes the location of the wl_output within\nthe global compositor space.\n\nThe logical_position event is sent after creating an xdg_output\n(see xdg_output_manager.get_xdg_output) and whenever the location\nof the output changes within the global compositor space." ] fn logical_position ( & mut self , object : * mut zxdg_output_v1 , x : i32 , y : i32 ) { } # [ doc = "size of the output in the global compositor space\n\nThe logical_size event describes the size of the output in the\nglobal compositor space.\n\nFor example, a surface without any buffer scale, transformation\nnor rotation set, with the size matching the logical_size will\nhave the same size as the corresponding output when displayed.\n\nMost regular Wayland clients should not pay attention to the\nlogical size and would rather rely on xdg_shell interfaces.\n\nSome clients such as Xwayland, however, need this to configure\ntheir surfaces in the global compositor space as the compositor\nmay apply a different scale from what is advertised by the output\nscaling property (to achieve fractional scaling, for example).\n\nFor example, for a wl_output mode 3840\u{d7}2160 and a scale factor 2:\n\n- A compositor not scaling the surface buffers will advertise a\nlogical size of 3840\u{d7}2160,\n\n- A compositor automatically scaling the surface buffers will\nadvertise a logical size of 1920\u{d7}1080,\n\n- A compositor using a fractional scale of 1.5 will advertise a\nlogical size to 2560\u{d7}1620.\n\nFor example, for a wl_output mode 1920\u{d7}1080 and a 90 degree rotation,\nthe compositor will advertise a logical size of 1080x1920.\n\nThe logical_size event is sent after creating an xdg_output\n(see xdg_output_manager.get_xdg_output) and whenever the logical\nsize of the output changes, either as a result of a change in the\napplied scale or because of a change in the corresponding output\nmode(see wl_output.mode) or transform (see wl_output.transform)." ] fn logical_size ( & mut self , object : * mut zxdg_output_v1 , width : i32 , height : i32 ) { } # [ doc = "all information about the output have been sent\n\nThis event is sent after all other properties of an xdg_output\nhave been sent.\n\nThis allows changes to the xdg_output properties to be seen as\natomic, even if they happen via multiple events.\n\nFor objects version 3 onwards, this event is deprecated. Compositors\nare not required to send it anymore and must send wl_output.done\ninstead." ] fn done ( & mut self , object : * mut zxdg_output_v1 , ) { } # [ doc = "name of this output\n\nMany compositors will assign names to their outputs, show them to the\nuser, allow them to be configured by name, etc. The client may wish to\nknow this name as well to offer the user similar behaviors.\n\nThe naming convention is compositor defined, but limited to\nalphanumeric characters and dashes (-). Each name is unique among all\nwl_output globals, but if a wl_output global is destroyed the same name\nmay be reused later. The names will also remain consistent across\nsessions with the same hardware and software configuration.\n\nExamples of names include 'HDMI-A-1', 'WL-1', 'X11-1', etc. However, do\nnot assume that the name is a reflection of an underlying DRM\nconnector, X11 connection, etc.\n\nThe name event is sent after creating an xdg_output (see\nxdg_output_manager.get_xdg_output). This event is only sent once per\nxdg_output, and the name does not change over the lifetime of the\nwl_output global.\n\nOnly available since version 2 of the interface." ] fn name ( & mut self , object : * mut zxdg_output_v1 , name : * mut c_char ) { } # [ doc = "human-readable description of this output\n\nMany compositors can produce human-readable descriptions of their\noutputs.  The client may wish to know this description as well, to\ncommunicate the user for various purposes.\n\nThe description is a UTF-8 string with no convention defined for its\ncontents. Examples might include 'Foocorp 11\" Display' or 'Virtual X11\noutput via :1'.\n\nThe description event is sent after creating an xdg_output (see\nxdg_output_manager.get_xdg_output) and whenever the description\nchanges. The description is optional, and may not be sent at all.\n\nFor objects of version 2 and lower, this event is only sent once per\nxdg_output, and the description does not change over the lifetime of\nthe wl_output global.\n\nOnly available since version 2 of the interface." ] fn description ( & mut self , object : * mut zxdg_output_v1 , description : * mut c_char ) { } } pub unsafe fn zxdg_output_v1_set_user_data ( zxdg_output_v1 : * mut super :: zxdg_output_v1 :: zxdg_output_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zxdg_output_v1 as _ , user_data ) ; } pub unsafe fn zxdg_output_v1_get_user_data ( zxdg_output_v1 : * mut super :: zxdg_output_v1 :: zxdg_output_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zxdg_output_v1 as _ ) ; } pub unsafe fn zxdg_output_v1_get_version ( zxdg_output_v1 : * mut super :: zxdg_output_v1 :: zxdg_output_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zxdg_output_v1 as _ ) ; } pub unsafe fn zxdg_output_v1_add_listener ( zxdg_output_v1 : * mut super :: zxdg_output_v1 :: zxdg_output_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zxdg_output_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zxdg_output_v1_add_rust_listener ( zxdg_output_v1 : * mut super :: zxdg_output_v1 :: zxdg_output_v1 , listener : & dyn zxdg_output_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zxdg_output_v1_add_listener ( zxdg_output_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy the xdg_output object\n\nUsing this request a client can tell the server that it is not\ngoing to use the xdg_output object anymore." ] pub unsafe fn zxdg_output_v1_destroy ( zxdg_output_v1 : * mut super :: zxdg_output_v1 :: zxdg_output_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zxdg_output_v1 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zxdg_output_v1 as _ ) ; } } } pub mod zwp_linux_explicit_synchronization_unstable_v1 { use super :: wayland :: * ; use super :: xdg_shell :: * ; # [ doc = "protocol for providing explicit synchronization\n\nThis global is a factory interface, allowing clients to request\nexplicit synchronization for buffers on a per-surface basis.\n\nSee zwp_linux_surface_synchronization_v1 for more information.\n\nThis interface is derived from Chromium's\nzcr_linux_explicit_synchronization_v1.\n\nWarning! The protocol described in this file is experimental and\nbackward incompatible changes may be made. Backward compatible changes\nmay be added together with the corresponding interface version bump.\nBackward incompatible changes are done by bumping the version number in\nthe protocol and interface names and resetting the interface version.\nOnce the protocol is to be declared stable, the 'z' prefix and the\nversion number in the protocol and interface names are removed and the\ninterface version number is reset." ] pub mod zwp_linux_explicit_synchronization_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_linux_explicit_synchronization_v1 { } # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum error { # [ doc = "the surface already has a synchronization object associated" ] synchronization_exists = 0 , # [ doc ( hidden ) ] __nonexhaustive , } impl error { pub fn from_raw ( n : u32 ) -> Option < error > { match n { 0 => Some ( error :: synchronization_exists ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } static mut zwp_linux_explicit_synchronization_v1_requests_get_synchronization_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: zwp_linux_surface_synchronization_v1 :: zwp_linux_surface_synchronization_v1_interface as * const wl_interface } , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_linux_explicit_synchronization_v1_requests : [ wl_message ; 2 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_synchronization\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zwp_linux_explicit_synchronization_v1_requests_get_synchronization_types as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_linux_explicit_synchronization_v1_interface : wl_interface = wl_interface { name : b"zwp_linux_explicit_synchronization_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 2 , requests : unsafe { & zwp_linux_explicit_synchronization_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_linux_explicit_synchronization_v1_listener { } pub unsafe fn zwp_linux_explicit_synchronization_v1_set_user_data ( zwp_linux_explicit_synchronization_v1 : * mut super :: zwp_linux_explicit_synchronization_v1 :: zwp_linux_explicit_synchronization_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_linux_explicit_synchronization_v1 as _ , user_data ) ; } pub unsafe fn zwp_linux_explicit_synchronization_v1_get_user_data ( zwp_linux_explicit_synchronization_v1 : * mut super :: zwp_linux_explicit_synchronization_v1 :: zwp_linux_explicit_synchronization_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_linux_explicit_synchronization_v1 as _ ) ; } pub unsafe fn zwp_linux_explicit_synchronization_v1_get_version ( zwp_linux_explicit_synchronization_v1 : * mut super :: zwp_linux_explicit_synchronization_v1 :: zwp_linux_explicit_synchronization_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_linux_explicit_synchronization_v1 as _ ) ; } pub unsafe fn zwp_linux_explicit_synchronization_v1_add_listener ( zwp_linux_explicit_synchronization_v1 : * mut super :: zwp_linux_explicit_synchronization_v1 :: zwp_linux_explicit_synchronization_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_linux_explicit_synchronization_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_linux_explicit_synchronization_v1_add_rust_listener ( zwp_linux_explicit_synchronization_v1 : * mut super :: zwp_linux_explicit_synchronization_v1 :: zwp_linux_explicit_synchronization_v1 , listener : & dyn zwp_linux_explicit_synchronization_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_linux_explicit_synchronization_v1_add_listener ( zwp_linux_explicit_synchronization_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy explicit synchronization factory object\n\nDestroy this explicit synchronization factory object. Other objects,\nincluding zwp_linux_surface_synchronization_v1 objects created by this\nfactory, shall not be affected by this request." ] pub unsafe fn zwp_linux_explicit_synchronization_v1_destroy ( zwp_linux_explicit_synchronization_v1 : * mut super :: zwp_linux_explicit_synchronization_v1 :: zwp_linux_explicit_synchronization_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_linux_explicit_synchronization_v1 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_linux_explicit_synchronization_v1 as _ ) ; } # [ doc = "extend surface interface for explicit synchronization\n\nInstantiate an interface extension for the given wl_surface to provide\nexplicit synchronization.\n\nIf the given wl_surface already has an explicit synchronization object\nassociated, the synchronization_exists protocol error is raised.\n\nGraphics APIs, like EGL or Vulkan, that manage the buffer queue and\ncommits of a wl_surface themselves, are likely to be using this\nextension internally. If a client is using such an API for a\nwl_surface, it should not directly use this extension on that surface,\nto avoid raising a synchronization_exists protocol error." ] pub unsafe fn zwp_linux_explicit_synchronization_v1_get_synchronization ( zwp_linux_explicit_synchronization_v1 : * mut super :: zwp_linux_explicit_synchronization_v1 :: zwp_linux_explicit_synchronization_v1 , surface : * mut super :: wl_surface :: wl_surface ) -> * mut super :: zwp_linux_surface_synchronization_v1 :: zwp_linux_surface_synchronization_v1 { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zwp_linux_explicit_synchronization_v1 as _ , 1u32 , & super :: zwp_linux_surface_synchronization_v1 :: zwp_linux_surface_synchronization_v1_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , surface ) ; return r as _ ; } } # [ doc = "per-surface explicit synchronization support\n\nThis object implements per-surface explicit synchronization.\n\nSynchronization refers to co-ordination of pipelined operations performed\non buffers. Most GPU clients will schedule an asynchronous operation to\nrender to the buffer, then immediately send the buffer to the compositor\nto be attached to a surface.\n\nIn implicit synchronization, ensuring that the rendering operation is\ncomplete before the compositor displays the buffer is an implementation\ndetail handled by either the kernel or userspace graphics driver.\n\nBy contrast, in explicit synchronization, dma_fence objects mark when the\nasynchronous operations are complete. When submitting a buffer, the\nclient provides an acquire fence which will be waited on before the\ncompositor accesses the buffer. The Wayland server, through a\nzwp_linux_buffer_release_v1 object, will inform the client with an event\nwhich may be accompanied by a release fence, when the compositor will no\nlonger access the buffer contents due to the specific commit that\nrequested the release event.\n\nEach surface can be associated with only one object of this interface at\nany time.\n\nIn version 1 of this interface, explicit synchronization is only\nguaranteed to be supported for buffers created with any version of the\nwp_linux_dmabuf buffer factory. Version 2 additionally guarantees\nexplicit synchronization support for opaque EGL buffers, which is a type\nof platform specific buffers described in the EGL_WL_bind_wayland_display\nextension. Compositors are free to support explicit synchronization for\nadditional buffer types." ] pub mod zwp_linux_surface_synchronization_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_linux_surface_synchronization_v1 { } # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum error { # [ doc = "the fence specified by the client could not be imported" ] invalid_fence = 0 , # [ doc = "multiple fences added for a single surface commit" ] duplicate_fence = 1 , # [ doc = "multiple releases added for a single surface commit" ] duplicate_release = 2 , # [ doc = "the associated wl_surface was destroyed" ] no_surface = 3 , # [ doc = "the buffer does not support explicit synchronization" ] unsupported_buffer = 4 , # [ doc = "no buffer was attached" ] no_buffer = 5 , # [ doc ( hidden ) ] __nonexhaustive , } impl error { pub fn from_raw ( n : u32 ) -> Option < error > { match n { 0 => Some ( error :: invalid_fence ) , 1 => Some ( error :: duplicate_fence ) , 2 => Some ( error :: duplicate_release ) , 3 => Some ( error :: no_surface ) , 4 => Some ( error :: unsupported_buffer ) , 5 => Some ( error :: no_buffer ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } static mut zwp_linux_surface_synchronization_v1_requests_get_release_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: zwp_linux_buffer_release_v1 :: zwp_linux_buffer_release_v1_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_linux_surface_synchronization_v1_requests : [ wl_message ; 3 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_acquire_fence\0" as * const u8 as * const c_char , signature : b"h\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_release\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwp_linux_surface_synchronization_v1_requests_get_release_types as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_linux_surface_synchronization_v1_interface : wl_interface = wl_interface { name : b"zwp_linux_surface_synchronization_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 3 , requests : unsafe { & zwp_linux_surface_synchronization_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_linux_surface_synchronization_v1_listener { } pub unsafe fn zwp_linux_surface_synchronization_v1_set_user_data ( zwp_linux_surface_synchronization_v1 : * mut super :: zwp_linux_surface_synchronization_v1 :: zwp_linux_surface_synchronization_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_linux_surface_synchronization_v1 as _ , user_data ) ; } pub unsafe fn zwp_linux_surface_synchronization_v1_get_user_data ( zwp_linux_surface_synchronization_v1 : * mut super :: zwp_linux_surface_synchronization_v1 :: zwp_linux_surface_synchronization_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_linux_surface_synchronization_v1 as _ ) ; } pub unsafe fn zwp_linux_surface_synchronization_v1_get_version ( zwp_linux_surface_synchronization_v1 : * mut super :: zwp_linux_surface_synchronization_v1 :: zwp_linux_surface_synchronization_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_linux_surface_synchronization_v1 as _ ) ; } pub unsafe fn zwp_linux_surface_synchronization_v1_add_listener ( zwp_linux_surface_synchronization_v1 : * mut super :: zwp_linux_surface_synchronization_v1 :: zwp_linux_surface_synchronization_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_linux_surface_synchronization_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_linux_surface_synchronization_v1_add_rust_listener ( zwp_linux_surface_synchronization_v1 : * mut super :: zwp_linux_surface_synchronization_v1 :: zwp_linux_surface_synchronization_v1 , listener : & dyn zwp_linux_surface_synchronization_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_linux_surface_synchronization_v1_add_listener ( zwp_linux_surface_synchronization_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy synchronization object\n\nDestroy this explicit synchronization object.\n\nAny fence set by this object with set_acquire_fence since the last\ncommit will be discarded by the server. Any fences set by this object\nbefore the last commit are not affected.\n\nzwp_linux_buffer_release_v1 objects created by this object are not\naffected by this request." ] pub unsafe fn zwp_linux_surface_synchronization_v1_destroy ( zwp_linux_surface_synchronization_v1 : * mut super :: zwp_linux_surface_synchronization_v1 :: zwp_linux_surface_synchronization_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_linux_surface_synchronization_v1 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_linux_surface_synchronization_v1 as _ ) ; } # [ doc = "set the acquire fence\n\nSet the acquire fence that must be signaled before the compositor\nmay sample from the buffer attached with wl_surface.attach. The fence\nis a dma_fence kernel object.\n\nThe acquire fence is double-buffered state, and will be applied on the\nnext wl_surface.commit request for the associated surface. Thus, it\napplies only to the buffer that is attached to the surface at commit\ntime.\n\nIf the provided fd is not a valid dma_fence fd, then an INVALID_FENCE\nerror is raised.\n\nIf a fence has already been attached during the same commit cycle, a\nDUPLICATE_FENCE error is raised.\n\nIf the associated wl_surface was destroyed, a NO_SURFACE error is\nraised.\n\nIf at surface commit time the attached buffer does not support explicit\nsynchronization, an UNSUPPORTED_BUFFER error is raised.\n\nIf at surface commit time there is no buffer attached, a NO_BUFFER\nerror is raised." ] pub unsafe fn zwp_linux_surface_synchronization_v1_set_acquire_fence ( zwp_linux_surface_synchronization_v1 : * mut super :: zwp_linux_surface_synchronization_v1 :: zwp_linux_surface_synchronization_v1 , fd : :: std :: os :: unix :: io :: RawFd ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_linux_surface_synchronization_v1 as _ , 1u32 , fd , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "release fence for last-attached buffer\n\nCreate a listener for the release of the buffer attached by the\nclient with wl_surface.attach. See zwp_linux_buffer_release_v1\ndocumentation for more information.\n\nThe release object is double-buffered state, and will be associated\nwith the buffer that is attached to the surface at wl_surface.commit\ntime.\n\nIf a zwp_linux_buffer_release_v1 object has already been requested for\nthe surface in the same commit cycle, a DUPLICATE_RELEASE error is\nraised.\n\nIf the associated wl_surface was destroyed, a NO_SURFACE error\nis raised.\n\nIf at surface commit time there is no buffer attached, a NO_BUFFER\nerror is raised." ] pub unsafe fn zwp_linux_surface_synchronization_v1_get_release ( zwp_linux_surface_synchronization_v1 : * mut super :: zwp_linux_surface_synchronization_v1 :: zwp_linux_surface_synchronization_v1 ) -> * mut super :: zwp_linux_buffer_release_v1 :: zwp_linux_buffer_release_v1 { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zwp_linux_surface_synchronization_v1 as _ , 2u32 , & super :: zwp_linux_buffer_release_v1 :: zwp_linux_buffer_release_v1_interface as * const _ , std :: ptr :: null :: < c_void > ( ) ) ; return r as _ ; } } # [ doc = "buffer release explicit synchronization\n\nThis object is instantiated in response to a\nzwp_linux_surface_synchronization_v1.get_release request.\n\nIt provides an alternative to wl_buffer.release events, providing a\nunique release from a single wl_surface.commit request. The release event\nalso supports explicit synchronization, providing a fence FD for the\nclient to synchronize against.\n\nExactly one event, either a fenced_release or an immediate_release, will\nbe emitted for the wl_surface.commit request. The compositor can choose\nrelease by release which event it uses.\n\nThis event does not replace wl_buffer.release events; servers are still\nrequired to send those events.\n\nOnce a buffer release object has delivered a 'fenced_release' or an\n'immediate_release' event it is automatically destroyed." ] pub mod zwp_linux_buffer_release_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_linux_buffer_release_v1 { } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_linux_buffer_release_v1_events : [ wl_message ; 2 ] = [ wl_message { name : b"fenced_release\0" as * const u8 as * const c_char , signature : b"h\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"immediate_release\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_linux_buffer_release_v1_interface : wl_interface = wl_interface { name : b"zwp_linux_buffer_release_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 0 , requests : NULLPTR as * const wl_message , event_count : 2 , events : unsafe { & zwp_linux_buffer_release_v1_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_linux_buffer_release_v1_listener { # [ doc = "release buffer with fence\n\nSent when the compositor has finalised its usage of the associated\nbuffer for the relevant commit, providing a dma_fence which will be\nsignaled when all operations by the compositor on that buffer for that\ncommit have finished.\n\nOnce the fence has signaled, and assuming the associated buffer is not\npending release from other wl_surface.commit requests, no additional\nexplicit or implicit synchronization is required to safely reuse or\ndestroy the buffer.\n\nThis event destroys the zwp_linux_buffer_release_v1 object." ] fn fenced_release ( & mut self , object : * mut zwp_linux_buffer_release_v1 , fence : :: std :: os :: unix :: io :: RawFd ) { } # [ doc = "release buffer immediately\n\nSent when the compositor has finalised its usage of the associated\nbuffer for the relevant commit, and either performed no operations\nusing it, or has a guarantee that all its operations on that buffer for\nthat commit have finished.\n\nOnce this event is received, and assuming the associated buffer is not\npending release from other wl_surface.commit requests, no additional\nexplicit or implicit synchronization is required to safely reuse or\ndestroy the buffer.\n\nThis event destroys the zwp_linux_buffer_release_v1 object." ] fn immediate_release ( & mut self , object : * mut zwp_linux_buffer_release_v1 , ) { } } pub unsafe fn zwp_linux_buffer_release_v1_set_user_data ( zwp_linux_buffer_release_v1 : * mut super :: zwp_linux_buffer_release_v1 :: zwp_linux_buffer_release_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_linux_buffer_release_v1 as _ , user_data ) ; } pub unsafe fn zwp_linux_buffer_release_v1_get_user_data ( zwp_linux_buffer_release_v1 : * mut super :: zwp_linux_buffer_release_v1 :: zwp_linux_buffer_release_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_linux_buffer_release_v1 as _ ) ; } pub unsafe fn zwp_linux_buffer_release_v1_get_version ( zwp_linux_buffer_release_v1 : * mut super :: zwp_linux_buffer_release_v1 :: zwp_linux_buffer_release_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_linux_buffer_release_v1 as _ ) ; } pub unsafe fn zwp_linux_buffer_release_v1_add_listener ( zwp_linux_buffer_release_v1 : * mut super :: zwp_linux_buffer_release_v1 :: zwp_linux_buffer_release_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_linux_buffer_release_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_linux_buffer_release_v1_add_rust_listener ( zwp_linux_buffer_release_v1 : * mut super :: zwp_linux_buffer_release_v1 :: zwp_linux_buffer_release_v1 , listener : & dyn zwp_linux_buffer_release_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_linux_buffer_release_v1_add_listener ( zwp_linux_buffer_release_v1 as _ , fp as _ , op as _ ) == 0 ; } pub unsafe fn zwp_linux_buffer_release_v1_destroy ( zwp_linux_buffer_release_v1 : * mut super :: zwp_linux_buffer_release_v1 :: zwp_linux_buffer_release_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_linux_buffer_release_v1 as _ ) ; } } } pub mod linux_dmabuf_unstable_v1 { use super :: wayland :: * ; use super :: xdg_shell :: * ; # [ doc = "factory for creating dmabuf-based wl_buffers\n\nFollowing the interfaces from:\nhttps://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import.txt\nhttps://www.khronos.org/registry/EGL/extensions/EXT/EGL_EXT_image_dma_buf_import_modifiers.txt\nand the Linux DRM sub-system's AddFb2 ioctl.\n\nThis interface offers ways to create generic dmabuf-based\nwl_buffers. Immediately after a client binds to this interface,\nthe set of supported formats and format modifiers is sent with\n'format' and 'modifier' events.\n\nThe following are required from clients:\n\n- Clients must ensure that either all data in the dma-buf is\ncoherent for all subsequent read access or that coherency is\ncorrectly handled by the underlying kernel-side dma-buf\nimplementation.\n\n- Don't make any more attachments after sending the buffer to the\ncompositor. Making more attachments later increases the risk of\nthe compositor not being able to use (re-import) an existing\ndmabuf-based wl_buffer.\n\nThe underlying graphics stack must ensure the following:\n\n- The dmabuf file descriptors relayed to the server will stay valid\nfor the whole lifetime of the wl_buffer. This means the server may\nat any time use those fds to import the dmabuf into any kernel\nsub-system that might accept it.\n\nTo create a wl_buffer from one or more dmabufs, a client creates a\nzwp_linux_dmabuf_params_v1 object with a zwp_linux_dmabuf_v1.create_params\nrequest. All planes required by the intended format are added with\nthe 'add' request. Finally, a 'create' or 'create_immed' request is\nissued, which has the following outcome depending on the import success.\n\nThe 'create' request,\n- on success, triggers a 'created' event which provides the final\nwl_buffer to the client.\n- on failure, triggers a 'failed' event to convey that the server\ncannot use the dmabufs received from the client.\n\nFor the 'create_immed' request,\n- on success, the server immediately imports the added dmabufs to\ncreate a wl_buffer. No event is sent from the server in this case.\n- on failure, the server can choose to either:\n- terminate the client by raising a fatal error.\n- mark the wl_buffer as failed, and send a 'failed' event to the\nclient. If the client uses a failed wl_buffer as an argument to any\nrequest, the behaviour is compositor implementation-defined.\n\nWarning! The protocol described in this file is experimental and\nbackward incompatible changes may be made. Backward compatible changes\nmay be added together with the corresponding interface version bump.\nBackward incompatible changes are done by bumping the version number in\nthe protocol and interface names and resetting the interface version.\nOnce the protocol is to be declared stable, the 'z' prefix and the\nversion number in the protocol and interface names are removed and the\ninterface version number is reset." ] pub mod zwp_linux_dmabuf_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_linux_dmabuf_v1 { } static mut zwp_linux_dmabuf_v1_requests_create_params_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: zwp_linux_buffer_params_v1 :: zwp_linux_buffer_params_v1_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_linux_dmabuf_v1_requests : [ wl_message ; 2 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_params\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwp_linux_dmabuf_v1_requests_create_params_types as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_linux_dmabuf_v1_events : [ wl_message ; 2 ] = [ wl_message { name : b"format\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifier\0" as * const u8 as * const c_char , signature : b"3uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_linux_dmabuf_v1_interface : wl_interface = wl_interface { name : b"zwp_linux_dmabuf_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 2 , requests : unsafe { & zwp_linux_dmabuf_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwp_linux_dmabuf_v1_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_linux_dmabuf_v1_listener { # [ doc = "supported buffer format\n\nThis event advertises one buffer format that the server supports.\nAll the supported formats are advertised once when the client\nbinds to this interface. A roundtrip after binding guarantees\nthat the client has received all supported formats.\n\nFor the definition of the format codes, see the\nzwp_linux_buffer_params_v1::create request.\n\nWarning: the 'format' event is likely to be deprecated and replaced\nwith the 'modifier' event introduced in zwp_linux_dmabuf_v1\nversion 3, described below. Please refrain from using the information\nreceived from this event." ] fn format ( & mut self , object : * mut zwp_linux_dmabuf_v1 , format : u32 ) { } # [ doc = "supported buffer format modifier\n\nThis event advertises the formats that the server supports, along with\nthe modifiers supported for each format. All the supported modifiers\nfor all the supported formats are advertised once when the client\nbinds to this interface. A roundtrip after binding guarantees that\nthe client has received all supported format-modifier pairs.\n\nFor legacy support, DRM_FORMAT_MOD_INVALID (that is, modifier_hi ==\n0x00ffffff and modifier_lo == 0xffffffff) is allowed in this event.\nIt indicates that the server can support the format with an implicit\nmodifier. When a plane has DRM_FORMAT_MOD_INVALID as its modifier, it\nis as if no explicit modifier is specified. The effective modifier\nwill be derived from the dmabuf.\n\nFor the definition of the format and modifier codes, see the\nzwp_linux_buffer_params_v1::create and zwp_linux_buffer_params_v1::add\nrequests.\n\nOnly available since version 3 of the interface." ] fn modifier ( & mut self , object : * mut zwp_linux_dmabuf_v1 , format : u32 , modifier_hi : u32 , modifier_lo : u32 ) { } } pub unsafe fn zwp_linux_dmabuf_v1_set_user_data ( zwp_linux_dmabuf_v1 : * mut super :: zwp_linux_dmabuf_v1 :: zwp_linux_dmabuf_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_linux_dmabuf_v1 as _ , user_data ) ; } pub unsafe fn zwp_linux_dmabuf_v1_get_user_data ( zwp_linux_dmabuf_v1 : * mut super :: zwp_linux_dmabuf_v1 :: zwp_linux_dmabuf_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_linux_dmabuf_v1 as _ ) ; } pub unsafe fn zwp_linux_dmabuf_v1_get_version ( zwp_linux_dmabuf_v1 : * mut super :: zwp_linux_dmabuf_v1 :: zwp_linux_dmabuf_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_linux_dmabuf_v1 as _ ) ; } pub unsafe fn zwp_linux_dmabuf_v1_add_listener ( zwp_linux_dmabuf_v1 : * mut super :: zwp_linux_dmabuf_v1 :: zwp_linux_dmabuf_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_linux_dmabuf_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_linux_dmabuf_v1_add_rust_listener ( zwp_linux_dmabuf_v1 : * mut super :: zwp_linux_dmabuf_v1 :: zwp_linux_dmabuf_v1 , listener : & dyn zwp_linux_dmabuf_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_linux_dmabuf_v1_add_listener ( zwp_linux_dmabuf_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "unbind the factory\n\nObjects created through this interface, especially wl_buffers, will\nremain valid." ] pub unsafe fn zwp_linux_dmabuf_v1_destroy ( zwp_linux_dmabuf_v1 : * mut super :: zwp_linux_dmabuf_v1 :: zwp_linux_dmabuf_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_linux_dmabuf_v1 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_linux_dmabuf_v1 as _ ) ; } # [ doc = "create a temporary object for buffer parameters\n\nThis temporary object is used to collect multiple dmabuf handles into\na single batch to create a wl_buffer. It can only be used once and\nshould be destroyed after a 'created' or 'failed' event has been\nreceived." ] pub unsafe fn zwp_linux_dmabuf_v1_create_params ( zwp_linux_dmabuf_v1 : * mut super :: zwp_linux_dmabuf_v1 :: zwp_linux_dmabuf_v1 ) -> * mut super :: zwp_linux_buffer_params_v1 :: zwp_linux_buffer_params_v1 { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zwp_linux_dmabuf_v1 as _ , 1u32 , & super :: zwp_linux_buffer_params_v1 :: zwp_linux_buffer_params_v1_interface as * const _ , std :: ptr :: null :: < c_void > ( ) ) ; return r as _ ; } } # [ doc = "parameters for creating a dmabuf-based wl_buffer\n\nThis temporary object is a collection of dmabufs and other\nparameters that together form a single logical buffer. The temporary\nobject may eventually create one wl_buffer unless cancelled by\ndestroying it before requesting 'create'.\n\nSingle-planar formats only require one dmabuf, however\nmulti-planar formats may require more than one dmabuf. For all\nformats, an 'add' request must be called once per plane (even if the\nunderlying dmabuf fd is identical).\n\nYou must use consecutive plane indices ('plane_idx' argument for 'add')\nfrom zero to the number of planes used by the drm_fourcc format code.\nAll planes required by the format must be given exactly once, but can\nbe given in any order. Each plane index can be set only once." ] pub mod zwp_linux_buffer_params_v1 { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum zwp_linux_buffer_params_v1 { } # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum error { # [ doc = "the dmabuf_batch object has already been used to create a wl_buffer" ] already_used = 0 , # [ doc = "plane index out of bounds" ] plane_idx = 1 , # [ doc = "the plane index was already set" ] plane_set = 2 , # [ doc = "missing or too many planes to create a buffer" ] incomplete = 3 , # [ doc = "format not supported" ] invalid_format = 4 , # [ doc = "invalid width or height" ] invalid_dimensions = 5 , # [ doc = "offset + stride * height goes out of dmabuf bounds" ] out_of_bounds = 6 , # [ doc = "invalid wl_buffer resulted from importing dmabufs via the create_immed request on given buffer_params" ] invalid_wl_buffer = 7 , # [ doc ( hidden ) ] __nonexhaustive , } impl error { pub fn from_raw ( n : u32 ) -> Option < error > { match n { 0 => Some ( error :: already_used ) , 1 => Some ( error :: plane_idx ) , 2 => Some ( error :: plane_set ) , 3 => Some ( error :: incomplete ) , 4 => Some ( error :: invalid_format ) , 5 => Some ( error :: invalid_dimensions ) , 6 => Some ( error :: out_of_bounds ) , 7 => Some ( error :: invalid_wl_buffer ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum flags { # [ doc = "contents are y-inverted" ] y_invert = 1 , # [ doc = "content is interlaced" ] interlaced = 2 , # [ doc = "bottom field first" ] bottom_first = 4 , # [ doc ( hidden ) ] __nonexhaustive , } impl flags { pub fn from_raw ( n : u32 ) -> Option < flags > { match n { 1 => Some ( flags :: y_invert ) , 2 => Some ( flags :: interlaced ) , 4 => Some ( flags :: bottom_first ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } static mut zwp_linux_buffer_params_v1_requests_create_immed_types : [ * const wl_interface ; 5 ] = [ unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_linux_buffer_params_v1_requests : [ wl_message ; 4 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"add\0" as * const u8 as * const c_char , signature : b"huuuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create\0" as * const u8 as * const c_char , signature : b"iiuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_immed\0" as * const u8 as * const c_char , signature : b"2niiuu\0" as * const u8 as * const c_char , types : unsafe { & zwp_linux_buffer_params_v1_requests_create_immed_types as * const _ } , } , ] ; static mut zwp_linux_buffer_params_v1_events_created_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut zwp_linux_buffer_params_v1_events : [ wl_message ; 2 ] = [ wl_message { name : b"created\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwp_linux_buffer_params_v1_events_created_types as * const _ } , } , wl_message { name : b"failed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut zwp_linux_buffer_params_v1_interface : wl_interface = wl_interface { name : b"zwp_linux_buffer_params_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 4 , requests : unsafe { & zwp_linux_buffer_params_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwp_linux_buffer_params_v1_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait zwp_linux_buffer_params_v1_listener { # [ doc = "buffer creation succeeded\n\nThis event indicates that the attempted buffer creation was\nsuccessful. It provides the new wl_buffer referencing the dmabuf(s).\n\nUpon receiving this event, the client should destroy the\nzlinux_dmabuf_params object." ] fn created ( & mut self , object : * mut zwp_linux_buffer_params_v1 , buffer : * mut super :: wl_buffer :: wl_buffer ) { } # [ doc = "buffer creation failed\n\nThis event indicates that the attempted buffer creation has\nfailed. It usually means that one of the dmabuf constraints\nhas not been fulfilled.\n\nUpon receiving this event, the client should destroy the\nzlinux_buffer_params object." ] fn failed ( & mut self , object : * mut zwp_linux_buffer_params_v1 , ) { } } pub unsafe fn zwp_linux_buffer_params_v1_set_user_data ( zwp_linux_buffer_params_v1 : * mut super :: zwp_linux_buffer_params_v1 :: zwp_linux_buffer_params_v1 , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , zwp_linux_buffer_params_v1 as _ , user_data ) ; } pub unsafe fn zwp_linux_buffer_params_v1_get_user_data ( zwp_linux_buffer_params_v1 : * mut super :: zwp_linux_buffer_params_v1 :: zwp_linux_buffer_params_v1 ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , zwp_linux_buffer_params_v1 as _ ) ; } pub unsafe fn zwp_linux_buffer_params_v1_get_version ( zwp_linux_buffer_params_v1 : * mut super :: zwp_linux_buffer_params_v1 :: zwp_linux_buffer_params_v1 ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , zwp_linux_buffer_params_v1 as _ ) ; } pub unsafe fn zwp_linux_buffer_params_v1_add_listener ( zwp_linux_buffer_params_v1 : * mut super :: zwp_linux_buffer_params_v1 :: zwp_linux_buffer_params_v1 , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , zwp_linux_buffer_params_v1 as _ , listener as _ , data as _ ) ; } pub unsafe fn zwp_linux_buffer_params_v1_add_rust_listener ( zwp_linux_buffer_params_v1 : * mut super :: zwp_linux_buffer_params_v1 :: zwp_linux_buffer_params_v1 , listener : & dyn zwp_linux_buffer_params_v1_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return zwp_linux_buffer_params_v1_add_listener ( zwp_linux_buffer_params_v1 as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "delete this object, used or not\n\nCleans up the temporary data sent to the server for dmabuf-based\nwl_buffer creation." ] pub unsafe fn zwp_linux_buffer_params_v1_destroy ( zwp_linux_buffer_params_v1 : * mut super :: zwp_linux_buffer_params_v1 :: zwp_linux_buffer_params_v1 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_linux_buffer_params_v1 as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , zwp_linux_buffer_params_v1 as _ ) ; } # [ doc = "add a dmabuf to the temporary set\n\nThis request adds one dmabuf to the set in this\nzwp_linux_buffer_params_v1.\n\nThe 64-bit unsigned value combined from modifier_hi and modifier_lo\nis the dmabuf layout modifier. DRM AddFB2 ioctl calls this the\nfb modifier, which is defined in drm_mode.h of Linux UAPI.\nThis is an opaque token. Drivers use this token to express tiling,\ncompression, etc. driver-specific modifications to the base format\ndefined by the DRM fourcc code.\n\nWarning: It should be an error if the format/modifier pair was not\nadvertised with the modifier event. This is not enforced yet because\nsome implementations always accept DRM_FORMAT_MOD_INVALID. Also\nversion 2 of this protocol does not have the modifier event.\n\nThis request raises the PLANE_IDX error if plane_idx is too large.\nThe error PLANE_SET is raised if attempting to set a plane that\nwas already set." ] pub unsafe fn zwp_linux_buffer_params_v1_add ( zwp_linux_buffer_params_v1 : * mut super :: zwp_linux_buffer_params_v1 :: zwp_linux_buffer_params_v1 , fd : :: std :: os :: unix :: io :: RawFd , plane_idx : u32 , offset : u32 , stride : u32 , modifier_hi : u32 , modifier_lo : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_linux_buffer_params_v1 as _ , 1u32 , fd , plane_idx , offset , stride , modifier_hi , modifier_lo , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "create a wl_buffer from the given dmabufs\n\nThis asks for creation of a wl_buffer from the added dmabuf\nbuffers. The wl_buffer is not created immediately but returned via\nthe 'created' event if the dmabuf sharing succeeds. The sharing\nmay fail at runtime for reasons a client cannot predict, in\nwhich case the 'failed' event is triggered.\n\nThe 'format' argument is a DRM_FORMAT code, as defined by the\nlibdrm's drm_fourcc.h. The Linux kernel's DRM sub-system is the\nauthoritative source on how the format codes should work.\n\nThe 'flags' is a bitfield of the flags defined in enum \"flags\".\n'y_invert' means the that the image needs to be y-flipped.\n\nFlag 'interlaced' means that the frame in the buffer is not\nprogressive as usual, but interlaced. An interlaced buffer as\nsupported here must always contain both top and bottom fields.\nThe top field always begins on the first pixel row. The temporal\nordering between the two fields is top field first, unless\n'bottom_first' is specified. It is undefined whether 'bottom_first'\nis ignored if 'interlaced' is not set.\n\nThis protocol does not convey any information about field rate,\nduration, or timing, other than the relative ordering between the\ntwo fields in one buffer. A compositor may have to estimate the\nintended field rate from the incoming buffer rate. It is undefined\nwhether the time of receiving wl_surface.commit with a new buffer\nattached, applying the wl_surface state, wl_surface.frame callback\ntrigger, presentation, or any other point in the compositor cycle\nis used to measure the frame or field times. There is no support\nfor detecting missed or late frames/fields/buffers either, and\nthere is no support whatsoever for cooperating with interlaced\ncompositor output.\n\nThe composited image quality resulting from the use of interlaced\nbuffers is explicitly undefined. A compositor may use elaborate\nhardware features or software to deinterlace and create progressive\noutput frames from a sequence of interlaced input buffers, or it\nmay produce substandard image quality. However, compositors that\ncannot guarantee reasonable image quality in all cases are recommended\nto just reject all interlaced buffers.\n\nAny argument errors, including non-positive width or height,\nmismatch between the number of planes and the format, bad\nformat, bad offset or stride, may be indicated by fatal protocol\nerrors: INCOMPLETE, INVALID_FORMAT, INVALID_DIMENSIONS,\nOUT_OF_BOUNDS.\n\nDmabuf import errors in the server that are not obvious client\nbugs are returned via the 'failed' event as non-fatal. This\nallows attempting dmabuf sharing and falling back in the client\nif it fails.\n\nThis request can be sent only once in the object's lifetime, after\nwhich the only legal request is destroy. This object should be\ndestroyed after issuing a 'create' request. Attempting to use this\nobject after issuing 'create' raises ALREADY_USED protocol error.\n\nIt is not mandatory to issue 'create'. If a client wants to\ncancel the buffer creation, it can just destroy this object." ] pub unsafe fn zwp_linux_buffer_params_v1_create ( zwp_linux_buffer_params_v1 : * mut super :: zwp_linux_buffer_params_v1 :: zwp_linux_buffer_params_v1 , width : i32 , height : i32 , format : u32 , flags : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , zwp_linux_buffer_params_v1 as _ , 2u32 , width , height , format , flags , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "immediately create a wl_buffer from the given dmabufs\n\nThis asks for immediate creation of a wl_buffer by importing the\nadded dmabufs.\n\nIn case of import success, no event is sent from the server, and the\nwl_buffer is ready to be used by the client.\n\nUpon import failure, either of the following may happen, as seen fit\nby the implementation:\n- the client is terminated with one of the following fatal protocol\nerrors:\n- INCOMPLETE, INVALID_FORMAT, INVALID_DIMENSIONS, OUT_OF_BOUNDS,\nin case of argument errors such as mismatch between the number\nof planes and the format, bad format, non-positive width or\nheight, or bad offset or stride.\n- INVALID_WL_BUFFER, in case the cause for failure is unknown or\nplaform specific.\n- the server creates an invalid wl_buffer, marks it as failed and\nsends a 'failed' event to the client. The result of using this\ninvalid wl_buffer as an argument in any request by the client is\ndefined by the compositor implementation.\n\nThis takes the same arguments as a 'create' request, and obeys the\nsame restrictions." ] pub unsafe fn zwp_linux_buffer_params_v1_create_immed ( zwp_linux_buffer_params_v1 : * mut super :: zwp_linux_buffer_params_v1 :: zwp_linux_buffer_params_v1 , width : i32 , height : i32 , format : u32 , flags : u32 ) -> * mut super :: wl_buffer :: wl_buffer { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , zwp_linux_buffer_params_v1 as _ , 3u32 , & super :: wl_buffer :: wl_buffer_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , width , height , format , flags ) ; return r as _ ; } } } pub mod wayland { # [ doc = "core global object\n\nThe core global object.  This is a special singleton object.  It\nis used for internal Wayland protocol features." ] pub mod wl_display { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum wl_display { } # [ doc = "global error values\n\nThese errors are global and can be emitted in response to any\nserver request." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum error { # [ doc = "server couldn't find object" ] invalid_object = 0 , # [ doc = "method doesn't exist on the specified interface" ] invalid_method = 1 , # [ doc = "server is out of memory" ] no_memory = 2 , # [ doc ( hidden ) ] __nonexhaustive , } impl error { pub fn from_raw ( n : u32 ) -> Option < error > { match n { 0 => Some ( error :: invalid_object ) , 1 => Some ( error :: invalid_method ) , 2 => Some ( error :: no_memory ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } static mut wl_display_requests_sync_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: wl_callback :: wl_callback_interface as * const wl_interface } , ] ; static mut wl_display_requests_get_registry_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: wl_registry :: wl_registry_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_display_requests : [ wl_message ; 2 ] = [ wl_message { name : b"sync\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & wl_display_requests_sync_types as * const _ } , } , wl_message { name : b"get_registry\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & wl_display_requests_get_registry_types as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_display_events : [ wl_message ; 2 ] = [ wl_message { name : b"error\0" as * const u8 as * const c_char , signature : b"ous\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"delete_id\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut wl_display_interface : wl_interface = wl_interface { name : b"wl_display\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & wl_display_requests as * const _ } , event_count : 2 , events : unsafe { & wl_display_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait wl_display_listener { # [ doc = "fatal error event\n\nThe error event is sent out when a fatal (non-recoverable)\nerror has occurred.  The object_id argument is the object\nwhere the error occurred, most often in response to a request\nto that object.  The code identifies the error and is defined\nby the object interface.  As such, each interface defines its\nown set of error codes.  The message is a brief description\nof the error, for (debugging) convenience." ] fn error ( & mut self , object : * mut wl_display , object_id : * mut wl_proxy , code : u32 , message : * mut c_char ) { } # [ doc = "acknowledge object ID deletion\n\nThis event is used internally by the object ID management\nlogic.  When a client deletes an object, the server will send\nthis event to acknowledge that it has seen the delete request.\nWhen the client receives this event, it will know that it can\nsafely reuse the object ID." ] fn delete_id ( & mut self , object : * mut wl_display , id : u32 ) { } } pub unsafe fn wl_display_set_user_data ( wl_display : * mut super :: wl_display :: wl_display , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , wl_display as _ , user_data ) ; } pub unsafe fn wl_display_get_user_data ( wl_display : * mut super :: wl_display :: wl_display ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , wl_display as _ ) ; } pub unsafe fn wl_display_get_version ( wl_display : * mut super :: wl_display :: wl_display ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , wl_display as _ ) ; } pub unsafe fn wl_display_add_listener ( wl_display : * mut super :: wl_display :: wl_display , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , wl_display as _ , listener as _ , data as _ ) ; } pub unsafe fn wl_display_add_rust_listener ( wl_display : * mut super :: wl_display :: wl_display , listener : & dyn wl_display_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return wl_display_add_listener ( wl_display as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "asynchronous roundtrip\n\nThe sync request asks the server to emit the 'done' event\non the returned wl_callback object.  Since requests are\nhandled in-order and events are delivered in-order, this can\nbe used as a barrier to ensure all previous requests and the\nresulting events have been handled.\n\nThe object returned by this request will be destroyed by the\ncompositor after the callback is fired and as such the client must not\nattempt to use it after that point.\n\nThe callback_data passed in the callback is the event serial." ] pub unsafe fn wl_display_sync ( wl_display : * mut super :: wl_display :: wl_display ) -> * mut super :: wl_callback :: wl_callback { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , wl_display as _ , 0u32 , & super :: wl_callback :: wl_callback_interface as * const _ , std :: ptr :: null :: < c_void > ( ) ) ; return r as _ ; } # [ doc = "get global registry object\n\nThis request creates a registry object that allows the client\nto list and bind the global objects available from the\ncompositor.\n\nIt should be noted that the server side resources consumed in\nresponse to a get_registry request can only be released when the\nclient disconnects, not when the client side proxy is destroyed.\nTherefore, clients should invoke get_registry as infrequently as\npossible to avoid wasting memory." ] pub unsafe fn wl_display_get_registry ( wl_display : * mut super :: wl_display :: wl_display ) -> * mut super :: wl_registry :: wl_registry { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , wl_display as _ , 1u32 , & super :: wl_registry :: wl_registry_interface as * const _ , std :: ptr :: null :: < c_void > ( ) ) ; return r as _ ; } } # [ doc = "global registry object\n\nThe singleton global registry object.  The server has a number of\nglobal objects that are available to all clients.  These objects\ntypically represent an actual object in the server (for example,\nan input device) or they are singleton objects that provide\nextension functionality.\n\nWhen a client creates a registry object, the registry object\nwill emit a global event for each global currently in the\nregistry.  Globals come and go as a result of device or\nmonitor hotplugs, reconfiguration or other events, and the\nregistry will send out global and global_remove events to\nkeep the client up to date with the changes.  To mark the end\nof the initial burst of events, the client can use the\nwl_display.sync request immediately after calling\nwl_display.get_registry.\n\nA client can bind to a global object by using the bind\nrequest.  This creates a client-side handle that lets the object\nemit events to the client and lets the client invoke requests on\nthe object." ] pub mod wl_registry { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum wl_registry { } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_registry_requests : [ wl_message ; 1 ] = [ wl_message { name : b"bind\0" as * const u8 as * const c_char , signature : b"usun\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_registry_events : [ wl_message ; 2 ] = [ wl_message { name : b"global\0" as * const u8 as * const c_char , signature : b"usu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"global_remove\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut wl_registry_interface : wl_interface = wl_interface { name : b"wl_registry\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & wl_registry_requests as * const _ } , event_count : 2 , events : unsafe { & wl_registry_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait wl_registry_listener { # [ doc = "announce global object\n\nNotify the client of global objects.\n\nThe event notifies the client that a global object with\nthe given name is now available, and it implements the\ngiven version of the given interface." ] fn global ( & mut self , object : * mut wl_registry , name : u32 , interface : * mut c_char , version : u32 ) { } # [ doc = "announce removal of global object\n\nNotify the client of removed global objects.\n\nThis event notifies the client that the global identified\nby name is no longer available.  If the client bound to\nthe global using the bind request, the client should now\ndestroy that object.\n\nThe object remains valid and requests to the object will be\nignored until the client destroys it, to avoid races between\nthe global going away and a client sending a request to it." ] fn global_remove ( & mut self , object : * mut wl_registry , name : u32 ) { } } pub unsafe fn wl_registry_set_user_data ( wl_registry : * mut super :: wl_registry :: wl_registry , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , wl_registry as _ , user_data ) ; } pub unsafe fn wl_registry_get_user_data ( wl_registry : * mut super :: wl_registry :: wl_registry ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , wl_registry as _ ) ; } pub unsafe fn wl_registry_get_version ( wl_registry : * mut super :: wl_registry :: wl_registry ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , wl_registry as _ ) ; } pub unsafe fn wl_registry_add_listener ( wl_registry : * mut super :: wl_registry :: wl_registry , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , wl_registry as _ , listener as _ , data as _ ) ; } pub unsafe fn wl_registry_add_rust_listener ( wl_registry : * mut super :: wl_registry :: wl_registry , listener : & dyn wl_registry_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return wl_registry_add_listener ( wl_registry as _ , fp as _ , op as _ ) == 0 ; } pub unsafe fn wl_registry_destroy ( wl_registry : * mut super :: wl_registry :: wl_registry ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , wl_registry as _ ) ; } # [ doc = "bind an object to the display\n\nBinds a new, client-created object to the server using the\nspecified name as the identifier." ] pub unsafe fn wl_registry_bind ( wl_registry : * mut super :: wl_registry :: wl_registry , name : u32 , interface : * mut wl_interface , version : u32 ) -> * mut wl_proxy { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor_versioned , wl_registry as _ , 0u32 , interface as _ , version , name , ( * interface ) . name , version , std :: ptr :: null :: < c_void > ( ) ) ; return r as _ ; } } # [ doc = "callback object\n\nClients can handle the 'done' event to get notified when\nthe related request is done." ] pub mod wl_callback { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum wl_callback { } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_callback_events : [ wl_message ; 1 ] = [ wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut wl_callback_interface : wl_interface = wl_interface { name : b"wl_callback\0" as * const u8 as * const c_char , version : 1 , request_count : 0 , requests : NULLPTR as * const wl_message , event_count : 1 , events : unsafe { & wl_callback_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait wl_callback_listener { # [ doc = "done event\n\nNotify the client when the related request is done." ] fn done ( & mut self , object : * mut wl_callback , callback_data : u32 ) { } } pub unsafe fn wl_callback_set_user_data ( wl_callback : * mut super :: wl_callback :: wl_callback , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , wl_callback as _ , user_data ) ; } pub unsafe fn wl_callback_get_user_data ( wl_callback : * mut super :: wl_callback :: wl_callback ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , wl_callback as _ ) ; } pub unsafe fn wl_callback_get_version ( wl_callback : * mut super :: wl_callback :: wl_callback ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , wl_callback as _ ) ; } pub unsafe fn wl_callback_add_listener ( wl_callback : * mut super :: wl_callback :: wl_callback , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , wl_callback as _ , listener as _ , data as _ ) ; } pub unsafe fn wl_callback_add_rust_listener ( wl_callback : * mut super :: wl_callback :: wl_callback , listener : & dyn wl_callback_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return wl_callback_add_listener ( wl_callback as _ , fp as _ , op as _ ) == 0 ; } pub unsafe fn wl_callback_destroy ( wl_callback : * mut super :: wl_callback :: wl_callback ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , wl_callback as _ ) ; } } # [ doc = "the compositor singleton\n\nA compositor.  This object is a singleton global.  The\ncompositor is in charge of combining the contents of multiple\nsurfaces into one displayable output." ] pub mod wl_compositor { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum wl_compositor { } static mut wl_compositor_requests_create_surface_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , ] ; static mut wl_compositor_requests_create_region_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: wl_region :: wl_region_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_compositor_requests : [ wl_message ; 2 ] = [ wl_message { name : b"create_surface\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & wl_compositor_requests_create_surface_types as * const _ } , } , wl_message { name : b"create_region\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & wl_compositor_requests_create_region_types as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut wl_compositor_interface : wl_interface = wl_interface { name : b"wl_compositor\0" as * const u8 as * const c_char , version : 4 , request_count : 2 , requests : unsafe { & wl_compositor_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait wl_compositor_listener { } pub unsafe fn wl_compositor_set_user_data ( wl_compositor : * mut super :: wl_compositor :: wl_compositor , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , wl_compositor as _ , user_data ) ; } pub unsafe fn wl_compositor_get_user_data ( wl_compositor : * mut super :: wl_compositor :: wl_compositor ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , wl_compositor as _ ) ; } pub unsafe fn wl_compositor_get_version ( wl_compositor : * mut super :: wl_compositor :: wl_compositor ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , wl_compositor as _ ) ; } pub unsafe fn wl_compositor_add_listener ( wl_compositor : * mut super :: wl_compositor :: wl_compositor , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , wl_compositor as _ , listener as _ , data as _ ) ; } pub unsafe fn wl_compositor_add_rust_listener ( wl_compositor : * mut super :: wl_compositor :: wl_compositor , listener : & dyn wl_compositor_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return wl_compositor_add_listener ( wl_compositor as _ , fp as _ , op as _ ) == 0 ; } pub unsafe fn wl_compositor_destroy ( wl_compositor : * mut super :: wl_compositor :: wl_compositor ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , wl_compositor as _ ) ; } # [ doc = "create new surface\n\nAsk the compositor to create a new surface." ] pub unsafe fn wl_compositor_create_surface ( wl_compositor : * mut super :: wl_compositor :: wl_compositor ) -> * mut super :: wl_surface :: wl_surface { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , wl_compositor as _ , 0u32 , & super :: wl_surface :: wl_surface_interface as * const _ , std :: ptr :: null :: < c_void > ( ) ) ; return r as _ ; } # [ doc = "create new region\n\nAsk the compositor to create a new region." ] pub unsafe fn wl_compositor_create_region ( wl_compositor : * mut super :: wl_compositor :: wl_compositor ) -> * mut super :: wl_region :: wl_region { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , wl_compositor as _ , 1u32 , & super :: wl_region :: wl_region_interface as * const _ , std :: ptr :: null :: < c_void > ( ) ) ; return r as _ ; } } # [ doc = "a shared memory pool\n\nThe wl_shm_pool object encapsulates a piece of memory shared\nbetween the compositor and client.  Through the wl_shm_pool\nobject, the client can allocate shared memory wl_buffer objects.\nAll objects created through the same pool share the same\nunderlying mapped memory. Reusing the mapped memory avoids the\nsetup/teardown overhead and is useful when interactively resizing\na surface or for many small buffers." ] pub mod wl_shm_pool { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum wl_shm_pool { } static mut wl_shm_pool_requests_create_buffer_types : [ * const wl_interface ; 6 ] = [ unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_shm_pool_requests : [ wl_message ; 3 ] = [ wl_message { name : b"create_buffer\0" as * const u8 as * const c_char , signature : b"niiiiu\0" as * const u8 as * const c_char , types : unsafe { & wl_shm_pool_requests_create_buffer_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resize\0" as * const u8 as * const c_char , signature : b"i\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut wl_shm_pool_interface : wl_interface = wl_interface { name : b"wl_shm_pool\0" as * const u8 as * const c_char , version : 1 , request_count : 3 , requests : unsafe { & wl_shm_pool_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait wl_shm_pool_listener { } pub unsafe fn wl_shm_pool_set_user_data ( wl_shm_pool : * mut super :: wl_shm_pool :: wl_shm_pool , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , wl_shm_pool as _ , user_data ) ; } pub unsafe fn wl_shm_pool_get_user_data ( wl_shm_pool : * mut super :: wl_shm_pool :: wl_shm_pool ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , wl_shm_pool as _ ) ; } pub unsafe fn wl_shm_pool_get_version ( wl_shm_pool : * mut super :: wl_shm_pool :: wl_shm_pool ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , wl_shm_pool as _ ) ; } pub unsafe fn wl_shm_pool_add_listener ( wl_shm_pool : * mut super :: wl_shm_pool :: wl_shm_pool , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , wl_shm_pool as _ , listener as _ , data as _ ) ; } pub unsafe fn wl_shm_pool_add_rust_listener ( wl_shm_pool : * mut super :: wl_shm_pool :: wl_shm_pool , listener : & dyn wl_shm_pool_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return wl_shm_pool_add_listener ( wl_shm_pool as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "create a buffer from the pool\n\nCreate a wl_buffer object from the pool.\n\nThe buffer is created offset bytes into the pool and has\nwidth and height as specified.  The stride argument specifies\nthe number of bytes from the beginning of one row to the beginning\nof the next.  The format is the pixel format of the buffer and\nmust be one of those advertised through the wl_shm.format event.\n\nA buffer will keep a reference to the pool it was created from\nso it is valid to destroy the pool immediately after creating\na buffer from it." ] pub unsafe fn wl_shm_pool_create_buffer ( wl_shm_pool : * mut super :: wl_shm_pool :: wl_shm_pool , offset : i32 , width : i32 , height : i32 , stride : i32 , format : u32 ) -> * mut super :: wl_buffer :: wl_buffer { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , wl_shm_pool as _ , 0u32 , & super :: wl_buffer :: wl_buffer_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , offset , width , height , stride , format ) ; return r as _ ; } # [ doc = "destroy the pool\n\nDestroy the shared memory pool.\n\nThe mmapped memory will be released when all\nbuffers that have been created from this pool\nare gone." ] pub unsafe fn wl_shm_pool_destroy ( wl_shm_pool : * mut super :: wl_shm_pool :: wl_shm_pool ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_shm_pool as _ , 1u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , wl_shm_pool as _ ) ; } # [ doc = "change the size of the pool mapping\n\nThis request will cause the server to remap the backing memory\nfor the pool from the file descriptor passed when the pool was\ncreated, but using the new size.  This request can only be\nused to make the pool bigger." ] pub unsafe fn wl_shm_pool_resize ( wl_shm_pool : * mut super :: wl_shm_pool :: wl_shm_pool , size : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_shm_pool as _ , 2u32 , size , std :: ptr :: null :: < c_void > ( ) ) ; } } # [ doc = "shared memory support\n\nA singleton global object that provides support for shared\nmemory.\n\nClients can create wl_shm_pool objects using the create_pool\nrequest.\n\nAt connection setup time, the wl_shm object emits one or more\nformat events to inform clients about the valid pixel formats\nthat can be used for buffers." ] pub mod wl_shm { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum wl_shm { } # [ doc = "wl_shm error values\n\nThese errors can be emitted in response to wl_shm requests." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum error { # [ doc = "buffer format is not known" ] invalid_format = 0 , # [ doc = "invalid size or stride during pool or buffer creation" ] invalid_stride = 1 , # [ doc = "mmapping the file descriptor failed" ] invalid_fd = 2 , # [ doc ( hidden ) ] __nonexhaustive , } impl error { pub fn from_raw ( n : u32 ) -> Option < error > { match n { 0 => Some ( error :: invalid_format ) , 1 => Some ( error :: invalid_stride ) , 2 => Some ( error :: invalid_fd ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ doc = "pixel formats\n\nThis describes the memory layout of an individual pixel.\n\nAll renderers should support argb8888 and xrgb8888 but any other\nformats are optional and may not be supported by the particular\nrenderer in use.\n\nThe drm format codes match the macros defined in drm_fourcc.h.\nThe formats actually supported by the compositor will be\nreported by the format event." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum format { # [ doc = "32-bit ARGB format, [31:0] A:R:G:B 8:8:8:8 little endian" ] argb8888 = 0 , # [ doc = "32-bit RGB format, [31:0] x:R:G:B 8:8:8:8 little endian" ] xrgb8888 = 1 , # [ doc = "8-bit color index format, [7:0] C" ] c8 = 538982467 , # [ doc = "8-bit RGB format, [7:0] R:G:B 3:3:2" ] rgb332 = 943867730 , # [ doc = "8-bit BGR format, [7:0] B:G:R 2:3:3" ] bgr233 = 944916290 , # [ doc = "16-bit xRGB format, [15:0] x:R:G:B 4:4:4:4 little endian" ] xrgb4444 = 842093144 , # [ doc = "16-bit xBGR format, [15:0] x:B:G:R 4:4:4:4 little endian" ] xbgr4444 = 842089048 , # [ doc = "16-bit RGBx format, [15:0] R:G:B:x 4:4:4:4 little endian" ] rgbx4444 = 842094674 , # [ doc = "16-bit BGRx format, [15:0] B:G:R:x 4:4:4:4 little endian" ] bgrx4444 = 842094658 , # [ doc = "16-bit ARGB format, [15:0] A:R:G:B 4:4:4:4 little endian" ] argb4444 = 842093121 , # [ doc = "16-bit ABGR format, [15:0] A:B:G:R 4:4:4:4 little endian" ] abgr4444 = 842089025 , # [ doc = "16-bit RBGA format, [15:0] R:G:B:A 4:4:4:4 little endian" ] rgba4444 = 842088786 , # [ doc = "16-bit BGRA format, [15:0] B:G:R:A 4:4:4:4 little endian" ] bgra4444 = 842088770 , # [ doc = "16-bit xRGB format, [15:0] x:R:G:B 1:5:5:5 little endian" ] xrgb1555 = 892424792 , # [ doc = "16-bit xBGR 1555 format, [15:0] x:B:G:R 1:5:5:5 little endian" ] xbgr1555 = 892420696 , # [ doc = "16-bit RGBx 5551 format, [15:0] R:G:B:x 5:5:5:1 little endian" ] rgbx5551 = 892426322 , # [ doc = "16-bit BGRx 5551 format, [15:0] B:G:R:x 5:5:5:1 little endian" ] bgrx5551 = 892426306 , # [ doc = "16-bit ARGB 1555 format, [15:0] A:R:G:B 1:5:5:5 little endian" ] argb1555 = 892424769 , # [ doc = "16-bit ABGR 1555 format, [15:0] A:B:G:R 1:5:5:5 little endian" ] abgr1555 = 892420673 , # [ doc = "16-bit RGBA 5551 format, [15:0] R:G:B:A 5:5:5:1 little endian" ] rgba5551 = 892420434 , # [ doc = "16-bit BGRA 5551 format, [15:0] B:G:R:A 5:5:5:1 little endian" ] bgra5551 = 892420418 , # [ doc = "16-bit RGB 565 format, [15:0] R:G:B 5:6:5 little endian" ] rgb565 = 909199186 , # [ doc = "16-bit BGR 565 format, [15:0] B:G:R 5:6:5 little endian" ] bgr565 = 909199170 , # [ doc = "24-bit RGB format, [23:0] R:G:B little endian" ] rgb888 = 875710290 , # [ doc = "24-bit BGR format, [23:0] B:G:R little endian" ] bgr888 = 875710274 , # [ doc = "32-bit xBGR format, [31:0] x:B:G:R 8:8:8:8 little endian" ] xbgr8888 = 875709016 , # [ doc = "32-bit RGBx format, [31:0] R:G:B:x 8:8:8:8 little endian" ] rgbx8888 = 875714642 , # [ doc = "32-bit BGRx format, [31:0] B:G:R:x 8:8:8:8 little endian" ] bgrx8888 = 875714626 , # [ doc = "32-bit ABGR format, [31:0] A:B:G:R 8:8:8:8 little endian" ] abgr8888 = 875708993 , # [ doc = "32-bit RGBA format, [31:0] R:G:B:A 8:8:8:8 little endian" ] rgba8888 = 875708754 , # [ doc = "32-bit BGRA format, [31:0] B:G:R:A 8:8:8:8 little endian" ] bgra8888 = 875708738 , # [ doc = "32-bit xRGB format, [31:0] x:R:G:B 2:10:10:10 little endian" ] xrgb2101010 = 808669784 , # [ doc = "32-bit xBGR format, [31:0] x:B:G:R 2:10:10:10 little endian" ] xbgr2101010 = 808665688 , # [ doc = "32-bit RGBx format, [31:0] R:G:B:x 10:10:10:2 little endian" ] rgbx1010102 = 808671314 , # [ doc = "32-bit BGRx format, [31:0] B:G:R:x 10:10:10:2 little endian" ] bgrx1010102 = 808671298 , # [ doc = "32-bit ARGB format, [31:0] A:R:G:B 2:10:10:10 little endian" ] argb2101010 = 808669761 , # [ doc = "32-bit ABGR format, [31:0] A:B:G:R 2:10:10:10 little endian" ] abgr2101010 = 808665665 , # [ doc = "32-bit RGBA format, [31:0] R:G:B:A 10:10:10:2 little endian" ] rgba1010102 = 808665426 , # [ doc = "32-bit BGRA format, [31:0] B:G:R:A 10:10:10:2 little endian" ] bgra1010102 = 808665410 , # [ doc = "packed YCbCr format, [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian" ] yuyv = 1448695129 , # [ doc = "packed YCbCr format, [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian" ] yvyu = 1431918169 , # [ doc = "packed YCbCr format, [31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian" ] uyvy = 1498831189 , # [ doc = "packed YCbCr format, [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian" ] vyuy = 1498765654 , # [ doc = "packed AYCbCr format, [31:0] A:Y:Cb:Cr 8:8:8:8 little endian" ] ayuv = 1448433985 , # [ doc = "2 plane YCbCr Cr:Cb format, 2x2 subsampled Cr:Cb plane" ] nv12 = 842094158 , # [ doc = "2 plane YCbCr Cb:Cr format, 2x2 subsampled Cb:Cr plane" ] nv21 = 825382478 , # [ doc = "2 plane YCbCr Cr:Cb format, 2x1 subsampled Cr:Cb plane" ] nv16 = 909203022 , # [ doc = "2 plane YCbCr Cb:Cr format, 2x1 subsampled Cb:Cr plane" ] nv61 = 825644622 , # [ doc = "3 plane YCbCr format, 4x4 subsampled Cb (1) and Cr (2) planes" ] yuv410 = 961959257 , # [ doc = "3 plane YCbCr format, 4x4 subsampled Cr (1) and Cb (2) planes" ] yvu410 = 961893977 , # [ doc = "3 plane YCbCr format, 4x1 subsampled Cb (1) and Cr (2) planes" ] yuv411 = 825316697 , # [ doc = "3 plane YCbCr format, 4x1 subsampled Cr (1) and Cb (2) planes" ] yvu411 = 825316953 , # [ doc = "3 plane YCbCr format, 2x2 subsampled Cb (1) and Cr (2) planes" ] yuv420 = 842093913 , # [ doc = "3 plane YCbCr format, 2x2 subsampled Cr (1) and Cb (2) planes" ] yvu420 = 842094169 , # [ doc = "3 plane YCbCr format, 2x1 subsampled Cb (1) and Cr (2) planes" ] yuv422 = 909202777 , # [ doc = "3 plane YCbCr format, 2x1 subsampled Cr (1) and Cb (2) planes" ] yvu422 = 909203033 , # [ doc = "3 plane YCbCr format, non-subsampled Cb (1) and Cr (2) planes" ] yuv444 = 875713881 , # [ doc = "3 plane YCbCr format, non-subsampled Cr (1) and Cb (2) planes" ] yvu444 = 875714137 , # [ doc ( hidden ) ] __nonexhaustive , } impl format { pub fn from_raw ( n : u32 ) -> Option < format > { match n { 0 => Some ( format :: argb8888 ) , 1 => Some ( format :: xrgb8888 ) , 538982467 => Some ( format :: c8 ) , 943867730 => Some ( format :: rgb332 ) , 944916290 => Some ( format :: bgr233 ) , 842093144 => Some ( format :: xrgb4444 ) , 842089048 => Some ( format :: xbgr4444 ) , 842094674 => Some ( format :: rgbx4444 ) , 842094658 => Some ( format :: bgrx4444 ) , 842093121 => Some ( format :: argb4444 ) , 842089025 => Some ( format :: abgr4444 ) , 842088786 => Some ( format :: rgba4444 ) , 842088770 => Some ( format :: bgra4444 ) , 892424792 => Some ( format :: xrgb1555 ) , 892420696 => Some ( format :: xbgr1555 ) , 892426322 => Some ( format :: rgbx5551 ) , 892426306 => Some ( format :: bgrx5551 ) , 892424769 => Some ( format :: argb1555 ) , 892420673 => Some ( format :: abgr1555 ) , 892420434 => Some ( format :: rgba5551 ) , 892420418 => Some ( format :: bgra5551 ) , 909199186 => Some ( format :: rgb565 ) , 909199170 => Some ( format :: bgr565 ) , 875710290 => Some ( format :: rgb888 ) , 875710274 => Some ( format :: bgr888 ) , 875709016 => Some ( format :: xbgr8888 ) , 875714642 => Some ( format :: rgbx8888 ) , 875714626 => Some ( format :: bgrx8888 ) , 875708993 => Some ( format :: abgr8888 ) , 875708754 => Some ( format :: rgba8888 ) , 875708738 => Some ( format :: bgra8888 ) , 808669784 => Some ( format :: xrgb2101010 ) , 808665688 => Some ( format :: xbgr2101010 ) , 808671314 => Some ( format :: rgbx1010102 ) , 808671298 => Some ( format :: bgrx1010102 ) , 808669761 => Some ( format :: argb2101010 ) , 808665665 => Some ( format :: abgr2101010 ) , 808665426 => Some ( format :: rgba1010102 ) , 808665410 => Some ( format :: bgra1010102 ) , 1448695129 => Some ( format :: yuyv ) , 1431918169 => Some ( format :: yvyu ) , 1498831189 => Some ( format :: uyvy ) , 1498765654 => Some ( format :: vyuy ) , 1448433985 => Some ( format :: ayuv ) , 842094158 => Some ( format :: nv12 ) , 825382478 => Some ( format :: nv21 ) , 909203022 => Some ( format :: nv16 ) , 825644622 => Some ( format :: nv61 ) , 961959257 => Some ( format :: yuv410 ) , 961893977 => Some ( format :: yvu410 ) , 825316697 => Some ( format :: yuv411 ) , 825316953 => Some ( format :: yvu411 ) , 842093913 => Some ( format :: yuv420 ) , 842094169 => Some ( format :: yvu420 ) , 909202777 => Some ( format :: yuv422 ) , 909203033 => Some ( format :: yvu422 ) , 875713881 => Some ( format :: yuv444 ) , 875714137 => Some ( format :: yvu444 ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } static mut wl_shm_requests_create_pool_types : [ * const wl_interface ; 3 ] = [ unsafe { & super :: wl_shm_pool :: wl_shm_pool_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_shm_requests : [ wl_message ; 1 ] = [ wl_message { name : b"create_pool\0" as * const u8 as * const c_char , signature : b"nhi\0" as * const u8 as * const c_char , types : unsafe { & wl_shm_requests_create_pool_types as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_shm_events : [ wl_message ; 1 ] = [ wl_message { name : b"format\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut wl_shm_interface : wl_interface = wl_interface { name : b"wl_shm\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & wl_shm_requests as * const _ } , event_count : 1 , events : unsafe { & wl_shm_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait wl_shm_listener { # [ doc = "pixel format description\n\nInforms the client about a valid pixel format that\ncan be used for buffers. Known formats include\nargb8888 and xrgb8888." ] fn format ( & mut self , object : * mut wl_shm , format : format ) { } } pub unsafe fn wl_shm_set_user_data ( wl_shm : * mut super :: wl_shm :: wl_shm , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , wl_shm as _ , user_data ) ; } pub unsafe fn wl_shm_get_user_data ( wl_shm : * mut super :: wl_shm :: wl_shm ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , wl_shm as _ ) ; } pub unsafe fn wl_shm_get_version ( wl_shm : * mut super :: wl_shm :: wl_shm ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , wl_shm as _ ) ; } pub unsafe fn wl_shm_add_listener ( wl_shm : * mut super :: wl_shm :: wl_shm , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , wl_shm as _ , listener as _ , data as _ ) ; } pub unsafe fn wl_shm_add_rust_listener ( wl_shm : * mut super :: wl_shm :: wl_shm , listener : & dyn wl_shm_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return wl_shm_add_listener ( wl_shm as _ , fp as _ , op as _ ) == 0 ; } pub unsafe fn wl_shm_destroy ( wl_shm : * mut super :: wl_shm :: wl_shm ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , wl_shm as _ ) ; } # [ doc = "create a shm pool\n\nCreate a new wl_shm_pool object.\n\nThe pool can be used to create shared memory based buffer\nobjects.  The server will mmap size bytes of the passed file\ndescriptor, to use as backing memory for the pool." ] pub unsafe fn wl_shm_create_pool ( wl_shm : * mut super :: wl_shm :: wl_shm , fd : :: std :: os :: unix :: io :: RawFd , size : i32 ) -> * mut super :: wl_shm_pool :: wl_shm_pool { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , wl_shm as _ , 0u32 , & super :: wl_shm_pool :: wl_shm_pool_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , fd , size ) ; return r as _ ; } } # [ doc = "content for a wl_surface\n\nA buffer provides the content for a wl_surface. Buffers are\ncreated through factory interfaces such as wl_drm, wl_shm or\nsimilar. It has a width and a height and can be attached to a\nwl_surface, but the mechanism by which a client provides and\nupdates the contents is defined by the buffer factory interface." ] pub mod wl_buffer { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum wl_buffer { } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_buffer_requests : [ wl_message ; 1 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_buffer_events : [ wl_message ; 1 ] = [ wl_message { name : b"release\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut wl_buffer_interface : wl_interface = wl_interface { name : b"wl_buffer\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & wl_buffer_requests as * const _ } , event_count : 1 , events : unsafe { & wl_buffer_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait wl_buffer_listener { # [ doc = "compositor releases buffer\n\nSent when this wl_buffer is no longer used by the compositor.\nThe client is now free to reuse or destroy this buffer and its\nbacking storage.\n\nIf a client receives a release event before the frame callback\nrequested in the same wl_surface.commit that attaches this\nwl_buffer to a surface, then the client is immediately free to\nreuse the buffer and its backing storage, and does not need a\nsecond buffer for the next surface content update. Typically\nthis is possible, when the compositor maintains a copy of the\nwl_surface contents, e.g. as a GL texture. This is an important\noptimization for GL(ES) compositors with wl_shm clients." ] fn release ( & mut self , object : * mut wl_buffer , ) { } } pub unsafe fn wl_buffer_set_user_data ( wl_buffer : * mut super :: wl_buffer :: wl_buffer , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , wl_buffer as _ , user_data ) ; } pub unsafe fn wl_buffer_get_user_data ( wl_buffer : * mut super :: wl_buffer :: wl_buffer ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , wl_buffer as _ ) ; } pub unsafe fn wl_buffer_get_version ( wl_buffer : * mut super :: wl_buffer :: wl_buffer ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , wl_buffer as _ ) ; } pub unsafe fn wl_buffer_add_listener ( wl_buffer : * mut super :: wl_buffer :: wl_buffer , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , wl_buffer as _ , listener as _ , data as _ ) ; } pub unsafe fn wl_buffer_add_rust_listener ( wl_buffer : * mut super :: wl_buffer :: wl_buffer , listener : & dyn wl_buffer_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return wl_buffer_add_listener ( wl_buffer as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy a buffer\n\nDestroy a buffer. If and how you need to release the backing\nstorage is defined by the buffer factory interface.\n\nFor possible side-effects to a surface, see wl_surface.attach." ] pub unsafe fn wl_buffer_destroy ( wl_buffer : * mut super :: wl_buffer :: wl_buffer ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_buffer as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , wl_buffer as _ ) ; } } # [ doc = "offer to transfer data\n\nA wl_data_offer represents a piece of data offered for transfer\nby another client (the source client).  It is used by the\ncopy-and-paste and drag-and-drop mechanisms.  The offer\ndescribes the different mime types that the data can be\nconverted to and provides the mechanism for transferring the\ndata directly from the source client." ] pub mod wl_data_offer { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum wl_data_offer { } # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum error { # [ doc = "finish request was called untimely" ] invalid_finish = 0 , # [ doc = "action mask contains invalid values" ] invalid_action_mask = 1 , # [ doc = "action argument has an invalid value" ] invalid_action = 2 , # [ doc = "offer doesn't accept this request" ] invalid_offer = 3 , # [ doc ( hidden ) ] __nonexhaustive , } impl error { pub fn from_raw ( n : u32 ) -> Option < error > { match n { 0 => Some ( error :: invalid_finish ) , 1 => Some ( error :: invalid_action_mask ) , 2 => Some ( error :: invalid_action ) , 3 => Some ( error :: invalid_offer ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_data_offer_requests : [ wl_message ; 5 ] = [ wl_message { name : b"accept\0" as * const u8 as * const c_char , signature : b"u?s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"receive\0" as * const u8 as * const c_char , signature : b"sh\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"finish\0" as * const u8 as * const c_char , signature : b"3\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_actions\0" as * const u8 as * const c_char , signature : b"3uu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_data_offer_events : [ wl_message ; 3 ] = [ wl_message { name : b"offer\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"source_actions\0" as * const u8 as * const c_char , signature : b"3u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"action\0" as * const u8 as * const c_char , signature : b"3u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut wl_data_offer_interface : wl_interface = wl_interface { name : b"wl_data_offer\0" as * const u8 as * const c_char , version : 3 , request_count : 5 , requests : unsafe { & wl_data_offer_requests as * const _ } , event_count : 3 , events : unsafe { & wl_data_offer_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait wl_data_offer_listener { # [ doc = "advertise offered mime type\n\nSent immediately after creating the wl_data_offer object.  One\nevent per offered mime type." ] fn offer ( & mut self , object : * mut wl_data_offer , mime_type : * mut c_char ) { } # [ doc = "notify the source-side available actions\n\nThis event indicates the actions offered by the data source. It\nwill be sent right after wl_data_device.enter, or anytime the source\nside changes its offered actions through wl_data_source.set_actions.\n\nOnly available since version 3 of the interface." ] fn source_actions ( & mut self , object : * mut wl_data_offer , source_actions : u32 ) { } # [ doc = "notify the selected action\n\nThis event indicates the action selected by the compositor after\nmatching the source/destination side actions. Only one action (or\nnone) will be offered here.\n\nThis event can be emitted multiple times during the drag-and-drop\noperation in response to destination side action changes through\nwl_data_offer.set_actions.\n\nThis event will no longer be emitted after wl_data_device.drop\nhappened on the drag-and-drop destination, the client must\nhonor the last action received, or the last preferred one set\nthrough wl_data_offer.set_actions when handling an \"ask\" action.\n\nCompositors may also change the selected action on the fly, mainly\nin response to keyboard modifier changes during the drag-and-drop\noperation.\n\nThe most recent action received is always the valid one. Prior to\nreceiving wl_data_device.drop, the chosen action may change (e.g.\ndue to keyboard modifiers being pressed). At the time of receiving\nwl_data_device.drop the drag-and-drop destination must honor the\nlast action received.\n\nAction changes may still happen after wl_data_device.drop,\nespecially on \"ask\" actions, where the drag-and-drop destination\nmay choose another action afterwards. Action changes happening\nat this stage are always the result of inter-client negotiation, the\ncompositor shall no longer be able to induce a different action.\n\nUpon \"ask\" actions, it is expected that the drag-and-drop destination\nmay potentially choose a different action and/or mime type,\nbased on wl_data_offer.source_actions and finally chosen by the\nuser (e.g. popping up a menu with the available options). The\nfinal wl_data_offer.set_actions and wl_data_offer.accept requests\nmust happen before the call to wl_data_offer.finish.\n\nOnly available since version 3 of the interface." ] fn action ( & mut self , object : * mut wl_data_offer , dnd_action : u32 ) { } } pub unsafe fn wl_data_offer_set_user_data ( wl_data_offer : * mut super :: wl_data_offer :: wl_data_offer , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , wl_data_offer as _ , user_data ) ; } pub unsafe fn wl_data_offer_get_user_data ( wl_data_offer : * mut super :: wl_data_offer :: wl_data_offer ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , wl_data_offer as _ ) ; } pub unsafe fn wl_data_offer_get_version ( wl_data_offer : * mut super :: wl_data_offer :: wl_data_offer ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , wl_data_offer as _ ) ; } pub unsafe fn wl_data_offer_add_listener ( wl_data_offer : * mut super :: wl_data_offer :: wl_data_offer , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , wl_data_offer as _ , listener as _ , data as _ ) ; } pub unsafe fn wl_data_offer_add_rust_listener ( wl_data_offer : * mut super :: wl_data_offer :: wl_data_offer , listener : & dyn wl_data_offer_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return wl_data_offer_add_listener ( wl_data_offer as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "accept one of the offered mime types\n\nIndicate that the client can accept the given mime type, or\nNULL for not accepted.\n\nFor objects of version 2 or older, this request is used by the\nclient to give feedback whether the client can receive the given\nmime type, or NULL if none is accepted; the feedback does not\ndetermine whether the drag-and-drop operation succeeds or not.\n\nFor objects of version 3 or newer, this request determines the\nfinal result of the drag-and-drop operation. If the end result\nis that no mime types were accepted, the drag-and-drop operation\nwill be cancelled and the corresponding drag source will receive\nwl_data_source.cancelled. Clients may still use this event in\nconjunction with wl_data_source.action for feedback." ] pub unsafe fn wl_data_offer_accept ( wl_data_offer : * mut super :: wl_data_offer :: wl_data_offer , serial : u32 , mime_type : * mut c_char ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_data_offer as _ , 0u32 , serial , mime_type , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "request that the data is transferred\n\nTo transfer the offered data, the client issues this request\nand indicates the mime type it wants to receive.  The transfer\nhappens through the passed file descriptor (typically created\nwith the pipe system call).  The source client writes the data\nin the mime type representation requested and then closes the\nfile descriptor.\n\nThe receiving client reads from the read end of the pipe until\nEOF and then closes its end, at which point the transfer is\ncomplete.\n\nThis request may happen multiple times for different mime types,\nboth before and after wl_data_device.drop. Drag-and-drop destination\nclients may preemptively fetch data or examine it more closely to\ndetermine acceptance." ] pub unsafe fn wl_data_offer_receive ( wl_data_offer : * mut super :: wl_data_offer :: wl_data_offer , mime_type : * mut c_char , fd : :: std :: os :: unix :: io :: RawFd ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_data_offer as _ , 1u32 , mime_type , fd , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "destroy data offer\n\nDestroy the data offer." ] pub unsafe fn wl_data_offer_destroy ( wl_data_offer : * mut super :: wl_data_offer :: wl_data_offer ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_data_offer as _ , 2u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , wl_data_offer as _ ) ; } # [ doc = "the offer will no longer be used\n\nNotifies the compositor that the drag destination successfully\nfinished the drag-and-drop operation.\n\nUpon receiving this request, the compositor will emit\nwl_data_source.dnd_finished on the drag source client.\n\nIt is a client error to perform other requests than\nwl_data_offer.destroy after this one. It is also an error to perform\nthis request after a NULL mime type has been set in\nwl_data_offer.accept or no action was received through\nwl_data_offer.action." ] pub unsafe fn wl_data_offer_finish ( wl_data_offer : * mut super :: wl_data_offer :: wl_data_offer ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_data_offer as _ , 3u32 , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set the available/preferred drag-and-drop actions\n\nSets the actions that the destination side client supports for\nthis operation. This request may trigger the emission of\nwl_data_source.action and wl_data_offer.action events if the compositor\nneeds to change the selected action.\n\nThis request can be called multiple times throughout the\ndrag-and-drop operation, typically in response to wl_data_device.enter\nor wl_data_device.motion events.\n\nThis request determines the final result of the drag-and-drop\noperation. If the end result is that no action is accepted,\nthe drag source will receive wl_drag_source.cancelled.\n\nThe dnd_actions argument must contain only values expressed in the\nwl_data_device_manager.dnd_actions enum, and the preferred_action\nargument must only contain one of those values set, otherwise it\nwill result in a protocol error.\n\nWhile managing an \"ask\" action, the destination drag-and-drop client\nmay perform further wl_data_offer.receive requests, and is expected\nto perform one last wl_data_offer.set_actions request with a preferred\naction other than \"ask\" (and optionally wl_data_offer.accept) before\nrequesting wl_data_offer.finish, in order to convey the action selected\nby the user. If the preferred action is not in the\nwl_data_offer.source_actions mask, an error will be raised.\n\nIf the \"ask\" action is dismissed (e.g. user cancellation), the client\nis expected to perform wl_data_offer.destroy right away.\n\nThis request can only be made on drag-and-drop offers, a protocol error\nwill be raised otherwise." ] pub unsafe fn wl_data_offer_set_actions ( wl_data_offer : * mut super :: wl_data_offer :: wl_data_offer , dnd_actions : u32 , preferred_action : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_data_offer as _ , 4u32 , dnd_actions , preferred_action , std :: ptr :: null :: < c_void > ( ) ) ; } } # [ doc = "offer to transfer data\n\nThe wl_data_source object is the source side of a wl_data_offer.\nIt is created by the source client in a data transfer and\nprovides a way to describe the offered data and a way to respond\nto requests to transfer the data." ] pub mod wl_data_source { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum wl_data_source { } # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum error { # [ doc = "action mask contains invalid values" ] invalid_action_mask = 0 , # [ doc = "source doesn't accept this request" ] invalid_source = 1 , # [ doc ( hidden ) ] __nonexhaustive , } impl error { pub fn from_raw ( n : u32 ) -> Option < error > { match n { 0 => Some ( error :: invalid_action_mask ) , 1 => Some ( error :: invalid_source ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_data_source_requests : [ wl_message ; 3 ] = [ wl_message { name : b"offer\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_actions\0" as * const u8 as * const c_char , signature : b"3u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_data_source_events : [ wl_message ; 6 ] = [ wl_message { name : b"target\0" as * const u8 as * const c_char , signature : b"?s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"send\0" as * const u8 as * const c_char , signature : b"sh\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"cancelled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"dnd_drop_performed\0" as * const u8 as * const c_char , signature : b"3\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"dnd_finished\0" as * const u8 as * const c_char , signature : b"3\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"action\0" as * const u8 as * const c_char , signature : b"3u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut wl_data_source_interface : wl_interface = wl_interface { name : b"wl_data_source\0" as * const u8 as * const c_char , version : 3 , request_count : 3 , requests : unsafe { & wl_data_source_requests as * const _ } , event_count : 6 , events : unsafe { & wl_data_source_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait wl_data_source_listener { # [ doc = "a target accepts an offered mime type\n\nSent when a target accepts pointer_focus or motion events.  If\na target does not accept any of the offered types, type is NULL.\n\nUsed for feedback during drag-and-drop." ] fn target ( & mut self , object : * mut wl_data_source , mime_type : Option < * mut c_char > ) { } # [ doc = "send the data\n\nRequest for data from the client.  Send the data as the\nspecified mime type over the passed file descriptor, then\nclose it." ] fn send ( & mut self , object : * mut wl_data_source , mime_type : * mut c_char , fd : :: std :: os :: unix :: io :: RawFd ) { } # [ doc = "selection was cancelled\n\nThis data source is no longer valid. There are several reasons why\nthis could happen:\n\n- The data source has been replaced by another data source.\n- The drag-and-drop operation was performed, but the drop destination\ndid not accept any of the mime types offered through\nwl_data_source.target.\n- The drag-and-drop operation was performed, but the drop destination\ndid not select any of the actions present in the mask offered through\nwl_data_source.action.\n- The drag-and-drop operation was performed but didn't happen over a\nsurface.\n- The compositor cancelled the drag-and-drop operation (e.g. compositor\ndependent timeouts to avoid stale drag-and-drop transfers).\n\nThe client should clean up and destroy this data source.\n\nFor objects of version 2 or older, wl_data_source.cancelled will\nonly be emitted if the data source was replaced by another data\nsource." ] fn cancelled ( & mut self , object : * mut wl_data_source , ) { } # [ doc = "the drag-and-drop operation physically finished\n\nThe user performed the drop action. This event does not indicate\nacceptance, wl_data_source.cancelled may still be emitted afterwards\nif the drop destination does not accept any mime type.\n\nHowever, this event might however not be received if the compositor\ncancelled the drag-and-drop operation before this event could happen.\n\nNote that the data_source may still be used in the future and should\nnot be destroyed here.\n\nOnly available since version 3 of the interface." ] fn dnd_drop_performed ( & mut self , object : * mut wl_data_source , ) { } # [ doc = "the drag-and-drop operation concluded\n\nThe drop destination finished interoperating with this data\nsource, so the client is now free to destroy this data source and\nfree all associated data.\n\nIf the action used to perform the operation was \"move\", the\nsource can now delete the transferred data.\n\nOnly available since version 3 of the interface." ] fn dnd_finished ( & mut self , object : * mut wl_data_source , ) { } # [ doc = "notify the selected action\n\nThis event indicates the action selected by the compositor after\nmatching the source/destination side actions. Only one action (or\nnone) will be offered here.\n\nThis event can be emitted multiple times during the drag-and-drop\noperation, mainly in response to destination side changes through\nwl_data_offer.set_actions, and as the data device enters/leaves\nsurfaces.\n\nIt is only possible to receive this event after\nwl_data_source.dnd_drop_performed if the drag-and-drop operation\nended in an \"ask\" action, in which case the final wl_data_source.action\nevent will happen immediately before wl_data_source.dnd_finished.\n\nCompositors may also change the selected action on the fly, mainly\nin response to keyboard modifier changes during the drag-and-drop\noperation.\n\nThe most recent action received is always the valid one. The chosen\naction may change alongside negotiation (e.g. an \"ask\" action can turn\ninto a \"move\" operation), so the effects of the final action must\nalways be applied in wl_data_offer.dnd_finished.\n\nClients can trigger cursor surface changes from this point, so\nthey reflect the current action.\n\nOnly available since version 3 of the interface." ] fn action ( & mut self , object : * mut wl_data_source , dnd_action : u32 ) { } } pub unsafe fn wl_data_source_set_user_data ( wl_data_source : * mut super :: wl_data_source :: wl_data_source , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , wl_data_source as _ , user_data ) ; } pub unsafe fn wl_data_source_get_user_data ( wl_data_source : * mut super :: wl_data_source :: wl_data_source ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , wl_data_source as _ ) ; } pub unsafe fn wl_data_source_get_version ( wl_data_source : * mut super :: wl_data_source :: wl_data_source ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , wl_data_source as _ ) ; } pub unsafe fn wl_data_source_add_listener ( wl_data_source : * mut super :: wl_data_source :: wl_data_source , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , wl_data_source as _ , listener as _ , data as _ ) ; } pub unsafe fn wl_data_source_add_rust_listener ( wl_data_source : * mut super :: wl_data_source :: wl_data_source , listener : & dyn wl_data_source_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return wl_data_source_add_listener ( wl_data_source as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "add an offered mime type\n\nThis request adds a mime type to the set of mime types\nadvertised to targets.  Can be called several times to offer\nmultiple types." ] pub unsafe fn wl_data_source_offer ( wl_data_source : * mut super :: wl_data_source :: wl_data_source , mime_type : * mut c_char ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_data_source as _ , 0u32 , mime_type , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "destroy the data source\n\nDestroy the data source." ] pub unsafe fn wl_data_source_destroy ( wl_data_source : * mut super :: wl_data_source :: wl_data_source ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_data_source as _ , 1u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , wl_data_source as _ ) ; } # [ doc = "set the available drag-and-drop actions\n\nSets the actions that the source side client supports for this\noperation. This request may trigger wl_data_source.action and\nwl_data_offer.action events if the compositor needs to change the\nselected action.\n\nThe dnd_actions argument must contain only values expressed in the\nwl_data_device_manager.dnd_actions enum, otherwise it will result\nin a protocol error.\n\nThis request must be made once only, and can only be made on sources\nused in drag-and-drop, so it must be performed before\nwl_data_device.start_drag. Attempting to use the source other than\nfor drag-and-drop will raise a protocol error." ] pub unsafe fn wl_data_source_set_actions ( wl_data_source : * mut super :: wl_data_source :: wl_data_source , dnd_actions : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_data_source as _ , 2u32 , dnd_actions , std :: ptr :: null :: < c_void > ( ) ) ; } } # [ doc = "data transfer device\n\nThere is one wl_data_device per seat which can be obtained\nfrom the global wl_data_device_manager singleton.\n\nA wl_data_device provides access to inter-client data transfer\nmechanisms such as copy-and-paste and drag-and-drop." ] pub mod wl_data_device { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum wl_data_device { } # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum error { # [ doc = "given wl_surface has another role" ] role = 0 , # [ doc ( hidden ) ] __nonexhaustive , } impl error { pub fn from_raw ( n : u32 ) -> Option < error > { match n { 0 => Some ( error :: role ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } static mut wl_data_device_requests_start_drag_types : [ * const wl_interface ; 4 ] = [ unsafe { & super :: wl_data_source :: wl_data_source_interface as * const wl_interface } , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , ] ; static mut wl_data_device_requests_set_selection_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: wl_data_source :: wl_data_source_interface as * const wl_interface } , NULLPTR as * const wl_interface , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_data_device_requests : [ wl_message ; 3 ] = [ wl_message { name : b"start_drag\0" as * const u8 as * const c_char , signature : b"?oo?ou\0" as * const u8 as * const c_char , types : unsafe { & wl_data_device_requests_start_drag_types as * const _ } , } , wl_message { name : b"set_selection\0" as * const u8 as * const c_char , signature : b"?ou\0" as * const u8 as * const c_char , types : unsafe { & wl_data_device_requests_set_selection_types as * const _ } , } , wl_message { name : b"release\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; static mut wl_data_device_events_data_offer_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: wl_data_offer :: wl_data_offer_interface as * const wl_interface } , ] ; static mut wl_data_device_events_enter_types : [ * const wl_interface ; 5 ] = [ NULLPTR as * const wl_interface , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , unsafe { & super :: wl_data_offer :: wl_data_offer_interface as * const wl_interface } , ] ; static mut wl_data_device_events_selection_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: wl_data_offer :: wl_data_offer_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_data_device_events : [ wl_message ; 6 ] = [ wl_message { name : b"data_offer\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & wl_data_device_events_data_offer_types as * const _ } , } , wl_message { name : b"enter\0" as * const u8 as * const c_char , signature : b"uoff?o\0" as * const u8 as * const c_char , types : unsafe { & wl_data_device_events_enter_types as * const _ } , } , wl_message { name : b"leave\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"motion\0" as * const u8 as * const c_char , signature : b"uff\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"drop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"selection\0" as * const u8 as * const c_char , signature : b"?o\0" as * const u8 as * const c_char , types : unsafe { & wl_data_device_events_selection_types as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut wl_data_device_interface : wl_interface = wl_interface { name : b"wl_data_device\0" as * const u8 as * const c_char , version : 3 , request_count : 3 , requests : unsafe { & wl_data_device_requests as * const _ } , event_count : 6 , events : unsafe { & wl_data_device_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait wl_data_device_listener { # [ doc = "introduce a new wl_data_offer\n\nThe data_offer event introduces a new wl_data_offer object,\nwhich will subsequently be used in either the\ndata_device.enter event (for drag-and-drop) or the\ndata_device.selection event (for selections).  Immediately\nfollowing the data_device_data_offer event, the new data_offer\nobject will send out data_offer.offer events to describe the\nmime types it offers." ] fn data_offer ( & mut self , object : * mut wl_data_device , id : * mut super :: wl_data_offer :: wl_data_offer ) { } # [ doc = "initiate drag-and-drop session\n\nThis event is sent when an active drag-and-drop pointer enters\na surface owned by the client.  The position of the pointer at\nenter time is provided by the x and y arguments, in surface-local\ncoordinates." ] fn enter ( & mut self , object : * mut wl_data_device , serial : u32 , surface : * mut super :: wl_surface :: wl_surface , x : wl_fixed_t , y : wl_fixed_t , id : Option < * mut super :: wl_data_offer :: wl_data_offer > ) { } # [ doc = "end drag-and-drop session\n\nThis event is sent when the drag-and-drop pointer leaves the\nsurface and the session ends.  The client must destroy the\nwl_data_offer introduced at enter time at this point." ] fn leave ( & mut self , object : * mut wl_data_device , ) { } # [ doc = "drag-and-drop session motion\n\nThis event is sent when the drag-and-drop pointer moves within\nthe currently focused surface. The new position of the pointer\nis provided by the x and y arguments, in surface-local\ncoordinates." ] fn motion ( & mut self , object : * mut wl_data_device , time : u32 , x : wl_fixed_t , y : wl_fixed_t ) { } # [ doc = "end drag-and-drop session successfully\n\nThe event is sent when a drag-and-drop operation is ended\nbecause the implicit grab is removed.\n\nThe drag-and-drop destination is expected to honor the last action\nreceived through wl_data_offer.action, if the resulting action is\n\"copy\" or \"move\", the destination can still perform\nwl_data_offer.receive requests, and is expected to end all\ntransfers with a wl_data_offer.finish request.\n\nIf the resulting action is \"ask\", the action will not be considered\nfinal. The drag-and-drop destination is expected to perform one last\nwl_data_offer.set_actions request, or wl_data_offer.destroy in order\nto cancel the operation." ] fn drop ( & mut self , object : * mut wl_data_device , ) { } # [ doc = "advertise new selection\n\nThe selection event is sent out to notify the client of a new\nwl_data_offer for the selection for this device.  The\ndata_device.data_offer and the data_offer.offer events are\nsent out immediately before this event to introduce the data\noffer object.  The selection event is sent to a client\nimmediately before receiving keyboard focus and when a new\nselection is set while the client has keyboard focus.  The\ndata_offer is valid until a new data_offer or NULL is received\nor until the client loses keyboard focus.  The client must\ndestroy the previous selection data_offer, if any, upon receiving\nthis event." ] fn selection ( & mut self , object : * mut wl_data_device , id : Option < * mut super :: wl_data_offer :: wl_data_offer > ) { } } pub unsafe fn wl_data_device_set_user_data ( wl_data_device : * mut super :: wl_data_device :: wl_data_device , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , wl_data_device as _ , user_data ) ; } pub unsafe fn wl_data_device_get_user_data ( wl_data_device : * mut super :: wl_data_device :: wl_data_device ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , wl_data_device as _ ) ; } pub unsafe fn wl_data_device_get_version ( wl_data_device : * mut super :: wl_data_device :: wl_data_device ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , wl_data_device as _ ) ; } pub unsafe fn wl_data_device_add_listener ( wl_data_device : * mut super :: wl_data_device :: wl_data_device , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , wl_data_device as _ , listener as _ , data as _ ) ; } pub unsafe fn wl_data_device_add_rust_listener ( wl_data_device : * mut super :: wl_data_device :: wl_data_device , listener : & dyn wl_data_device_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return wl_data_device_add_listener ( wl_data_device as _ , fp as _ , op as _ ) == 0 ; } pub unsafe fn wl_data_device_destroy ( wl_data_device : * mut super :: wl_data_device :: wl_data_device ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , wl_data_device as _ ) ; } # [ doc = "start drag-and-drop operation\n\nThis request asks the compositor to start a drag-and-drop\noperation on behalf of the client.\n\nThe source argument is the data source that provides the data\nfor the eventual data transfer. If source is NULL, enter, leave\nand motion events are sent only to the client that initiated the\ndrag and the client is expected to handle the data passing\ninternally.\n\nThe origin surface is the surface where the drag originates and\nthe client must have an active implicit grab that matches the\nserial.\n\nThe icon surface is an optional (can be NULL) surface that\nprovides an icon to be moved around with the cursor.  Initially,\nthe top-left corner of the icon surface is placed at the cursor\nhotspot, but subsequent wl_surface.attach request can move the\nrelative position. Attach requests must be confirmed with\nwl_surface.commit as usual. The icon surface is given the role of\na drag-and-drop icon. If the icon surface already has another role,\nit raises a protocol error.\n\nThe current and pending input regions of the icon wl_surface are\ncleared, and wl_surface.set_input_region is ignored until the\nwl_surface is no longer used as the icon surface. When the use\nas an icon ends, the current and pending input regions become\nundefined, and the wl_surface is unmapped." ] pub unsafe fn wl_data_device_start_drag ( wl_data_device : * mut super :: wl_data_device :: wl_data_device , source : * mut super :: wl_data_source :: wl_data_source , origin : * mut super :: wl_surface :: wl_surface , icon : * mut super :: wl_surface :: wl_surface , serial : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_data_device as _ , 0u32 , source , origin , icon , serial , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "copy data to the selection\n\nThis request asks the compositor to set the selection\nto the data from the source on behalf of the client.\n\nTo unset the selection, set the source to NULL." ] pub unsafe fn wl_data_device_set_selection ( wl_data_device : * mut super :: wl_data_device :: wl_data_device , source : * mut super :: wl_data_source :: wl_data_source , serial : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_data_device as _ , 1u32 , source , serial , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "destroy data device\n\nThis request destroys the data device." ] pub unsafe fn wl_data_device_release ( wl_data_device : * mut super :: wl_data_device :: wl_data_device ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_data_device as _ , 2u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , wl_data_device as _ ) ; } } # [ doc = "data transfer interface\n\nThe wl_data_device_manager is a singleton global object that\nprovides access to inter-client data transfer mechanisms such as\ncopy-and-paste and drag-and-drop.  These mechanisms are tied to\na wl_seat and this interface lets a client get a wl_data_device\ncorresponding to a wl_seat.\n\nDepending on the version bound, the objects created from the bound\nwl_data_device_manager object will have different requirements for\nfunctioning properly. See wl_data_source.set_actions,\nwl_data_offer.accept and wl_data_offer.finish for details." ] pub mod wl_data_device_manager { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum wl_data_device_manager { } bitflags ! { # [ doc = "drag and drop actions\n\nThis is a bitmask of the available/preferred actions in a\ndrag-and-drop operation.\n\nIn the compositor, the selected action is a result of matching the\nactions offered by the source and destination sides.  \"action\" events\nwith a \"none\" action will be sent to both source and destination if\nthere is no match. All further checks will effectively happen on\n(source actions \u{2229} destination actions).\n\nIn addition, compositors may also pick different actions in\nreaction to key modifiers being pressed. One common design that\nis used in major toolkits (and the behavior recommended for\ncompositors) is:\n\n- If no modifiers are pressed, the first match (in bit order)\nwill be used.\n- Pressing Shift selects \"move\", if enabled in the mask.\n- Pressing Control selects \"copy\", if enabled in the mask.\n\nBehavior beyond that is considered implementation-dependent.\nCompositors may for example bind other modifiers (like Alt/Meta)\nor drags initiated with other buttons than BTN_LEFT to specific\nactions (e.g. \"ask\")." ] pub struct dnd_action : u32 { # [ doc = "no action" ] const none = 0 ; # [ doc = "copy action" ] const copy = 1 ; # [ doc = "move action" ] const _move = 2 ; # [ doc = "ask action" ] const ask = 4 ; } } impl dnd_action { pub fn from_raw ( n : u32 ) -> Option < dnd_action > { Some ( dnd_action :: from_bits_truncate ( n ) ) } pub fn to_raw ( & self ) -> u32 { self . bits ( ) } } static mut wl_data_device_manager_requests_create_data_source_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: wl_data_source :: wl_data_source_interface as * const wl_interface } , ] ; static mut wl_data_device_manager_requests_get_data_device_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: wl_data_device :: wl_data_device_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_data_device_manager_requests : [ wl_message ; 2 ] = [ wl_message { name : b"create_data_source\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & wl_data_device_manager_requests_create_data_source_types as * const _ } , } , wl_message { name : b"get_data_device\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & wl_data_device_manager_requests_get_data_device_types as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut wl_data_device_manager_interface : wl_interface = wl_interface { name : b"wl_data_device_manager\0" as * const u8 as * const c_char , version : 3 , request_count : 2 , requests : unsafe { & wl_data_device_manager_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait wl_data_device_manager_listener { } pub unsafe fn wl_data_device_manager_set_user_data ( wl_data_device_manager : * mut super :: wl_data_device_manager :: wl_data_device_manager , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , wl_data_device_manager as _ , user_data ) ; } pub unsafe fn wl_data_device_manager_get_user_data ( wl_data_device_manager : * mut super :: wl_data_device_manager :: wl_data_device_manager ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , wl_data_device_manager as _ ) ; } pub unsafe fn wl_data_device_manager_get_version ( wl_data_device_manager : * mut super :: wl_data_device_manager :: wl_data_device_manager ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , wl_data_device_manager as _ ) ; } pub unsafe fn wl_data_device_manager_add_listener ( wl_data_device_manager : * mut super :: wl_data_device_manager :: wl_data_device_manager , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , wl_data_device_manager as _ , listener as _ , data as _ ) ; } pub unsafe fn wl_data_device_manager_add_rust_listener ( wl_data_device_manager : * mut super :: wl_data_device_manager :: wl_data_device_manager , listener : & dyn wl_data_device_manager_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return wl_data_device_manager_add_listener ( wl_data_device_manager as _ , fp as _ , op as _ ) == 0 ; } pub unsafe fn wl_data_device_manager_destroy ( wl_data_device_manager : * mut super :: wl_data_device_manager :: wl_data_device_manager ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , wl_data_device_manager as _ ) ; } # [ doc = "create a new data source\n\nCreate a new data source." ] pub unsafe fn wl_data_device_manager_create_data_source ( wl_data_device_manager : * mut super :: wl_data_device_manager :: wl_data_device_manager ) -> * mut super :: wl_data_source :: wl_data_source { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , wl_data_device_manager as _ , 0u32 , & super :: wl_data_source :: wl_data_source_interface as * const _ , std :: ptr :: null :: < c_void > ( ) ) ; return r as _ ; } # [ doc = "create a new data device\n\nCreate a new data device for a given seat." ] pub unsafe fn wl_data_device_manager_get_data_device ( wl_data_device_manager : * mut super :: wl_data_device_manager :: wl_data_device_manager , seat : * mut super :: wl_seat :: wl_seat ) -> * mut super :: wl_data_device :: wl_data_device { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , wl_data_device_manager as _ , 1u32 , & super :: wl_data_device :: wl_data_device_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , seat ) ; return r as _ ; } } # [ doc = "create desktop-style surfaces\n\nThis interface is implemented by servers that provide\ndesktop-style user interfaces.\n\nIt allows clients to associate a wl_shell_surface with\na basic surface.\n\nNote! This protocol is deprecated and not intended for production use.\nFor desktop-style user interfaces, use xdg_shell." ] pub mod wl_shell { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum wl_shell { } # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum error { # [ doc = "given wl_surface has another role" ] role = 0 , # [ doc ( hidden ) ] __nonexhaustive , } impl error { pub fn from_raw ( n : u32 ) -> Option < error > { match n { 0 => Some ( error :: role ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } static mut wl_shell_requests_get_shell_surface_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: wl_shell_surface :: wl_shell_surface_interface as * const wl_interface } , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_shell_requests : [ wl_message ; 1 ] = [ wl_message { name : b"get_shell_surface\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & wl_shell_requests_get_shell_surface_types as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut wl_shell_interface : wl_interface = wl_interface { name : b"wl_shell\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & wl_shell_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait wl_shell_listener { } pub unsafe fn wl_shell_set_user_data ( wl_shell : * mut super :: wl_shell :: wl_shell , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , wl_shell as _ , user_data ) ; } pub unsafe fn wl_shell_get_user_data ( wl_shell : * mut super :: wl_shell :: wl_shell ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , wl_shell as _ ) ; } pub unsafe fn wl_shell_get_version ( wl_shell : * mut super :: wl_shell :: wl_shell ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , wl_shell as _ ) ; } pub unsafe fn wl_shell_add_listener ( wl_shell : * mut super :: wl_shell :: wl_shell , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , wl_shell as _ , listener as _ , data as _ ) ; } pub unsafe fn wl_shell_add_rust_listener ( wl_shell : * mut super :: wl_shell :: wl_shell , listener : & dyn wl_shell_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return wl_shell_add_listener ( wl_shell as _ , fp as _ , op as _ ) == 0 ; } pub unsafe fn wl_shell_destroy ( wl_shell : * mut super :: wl_shell :: wl_shell ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , wl_shell as _ ) ; } # [ doc = "create a shell surface from a surface\n\nCreate a shell surface for an existing surface. This gives\nthe wl_surface the role of a shell surface. If the wl_surface\nalready has another role, it raises a protocol error.\n\nOnly one shell surface can be associated with a given surface." ] pub unsafe fn wl_shell_get_shell_surface ( wl_shell : * mut super :: wl_shell :: wl_shell , surface : * mut super :: wl_surface :: wl_surface ) -> * mut super :: wl_shell_surface :: wl_shell_surface { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , wl_shell as _ , 0u32 , & super :: wl_shell_surface :: wl_shell_surface_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , surface ) ; return r as _ ; } } # [ doc = "desktop-style metadata interface\n\nAn interface that may be implemented by a wl_surface, for\nimplementations that provide a desktop-style user interface.\n\nIt provides requests to treat surfaces like toplevel, fullscreen\nor popup windows, move, resize or maximize them, associate\nmetadata like title and class, etc.\n\nOn the server side the object is automatically destroyed when\nthe related wl_surface is destroyed. On the client side,\nwl_shell_surface_destroy() must be called before destroying\nthe wl_surface object." ] pub mod wl_shell_surface { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum wl_shell_surface { } bitflags ! { # [ doc = "edge values for resizing\n\nThese values are used to indicate which edge of a surface\nis being dragged in a resize operation. The server may\nuse this information to adapt its behavior, e.g. choose\nan appropriate cursor image." ] pub struct resize : u32 { # [ doc = "no edge" ] const none = 0 ; # [ doc = "top edge" ] const top = 1 ; # [ doc = "bottom edge" ] const bottom = 2 ; # [ doc = "left edge" ] const left = 4 ; # [ doc = "top and left edges" ] const top_left = 5 ; # [ doc = "bottom and left edges" ] const bottom_left = 6 ; # [ doc = "right edge" ] const right = 8 ; # [ doc = "top and right edges" ] const top_right = 9 ; # [ doc = "bottom and right edges" ] const bottom_right = 10 ; } } impl resize { pub fn from_raw ( n : u32 ) -> Option < resize > { Some ( resize :: from_bits_truncate ( n ) ) } pub fn to_raw ( & self ) -> u32 { self . bits ( ) } } bitflags ! { # [ doc = "details of transient behaviour\n\nThese flags specify details of the expected behaviour\nof transient surfaces. Used in the set_transient request." ] pub struct transient : u32 { # [ doc = "do not set keyboard focus" ] const inactive = 1 ; } } impl transient { pub fn from_raw ( n : u32 ) -> Option < transient > { Some ( transient :: from_bits_truncate ( n ) ) } pub fn to_raw ( & self ) -> u32 { self . bits ( ) } } # [ doc = "different method to set the surface fullscreen\n\nHints to indicate to the compositor how to deal with a conflict\nbetween the dimensions of the surface and the dimensions of the\noutput. The compositor is free to ignore this parameter." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum fullscreen_method { # [ doc = "no preference, apply default policy" ] default = 0 , # [ doc = "scale, preserve the surface's aspect ratio and center on output" ] scale = 1 , # [ doc = "switch output mode to the smallest mode that can fit the surface, add black borders to compensate size mismatch" ] driver = 2 , # [ doc = "no upscaling, center on output and add black borders to compensate size mismatch" ] fill = 3 , # [ doc ( hidden ) ] __nonexhaustive , } impl fullscreen_method { pub fn from_raw ( n : u32 ) -> Option < fullscreen_method > { match n { 0 => Some ( fullscreen_method :: default ) , 1 => Some ( fullscreen_method :: scale ) , 2 => Some ( fullscreen_method :: driver ) , 3 => Some ( fullscreen_method :: fill ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } static mut wl_shell_surface_requests_move_types : [ * const wl_interface ; 2 ] = [ unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface , ] ; static mut wl_shell_surface_requests_resize_types : [ * const wl_interface ; 3 ] = [ unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , ] ; static mut wl_shell_surface_requests_set_transient_types : [ * const wl_interface ; 4 ] = [ unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , ] ; static mut wl_shell_surface_requests_set_fullscreen_types : [ * const wl_interface ; 3 ] = [ NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } , ] ; static mut wl_shell_surface_requests_set_popup_types : [ * const wl_interface ; 6 ] = [ unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , ] ; static mut wl_shell_surface_requests_set_maximized_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_shell_surface_requests : [ wl_message ; 10 ] = [ wl_message { name : b"pong\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"move\0" as * const u8 as * const c_char , signature : b"ou\0" as * const u8 as * const c_char , types : unsafe { & wl_shell_surface_requests_move_types as * const _ } , } , wl_message { name : b"resize\0" as * const u8 as * const c_char , signature : b"ouu\0" as * const u8 as * const c_char , types : unsafe { & wl_shell_surface_requests_resize_types as * const _ } , } , wl_message { name : b"set_toplevel\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_transient\0" as * const u8 as * const c_char , signature : b"oiiu\0" as * const u8 as * const c_char , types : unsafe { & wl_shell_surface_requests_set_transient_types as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"uu?o\0" as * const u8 as * const c_char , types : unsafe { & wl_shell_surface_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"set_popup\0" as * const u8 as * const c_char , signature : b"ouoiiu\0" as * const u8 as * const c_char , types : unsafe { & wl_shell_surface_requests_set_popup_types as * const _ } , } , wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"?o\0" as * const u8 as * const c_char , types : unsafe { & wl_shell_surface_requests_set_maximized_types as * const _ } , } , wl_message { name : b"set_title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_class\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_shell_surface_events : [ wl_message ; 3 ] = [ wl_message { name : b"ping\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"configure\0" as * const u8 as * const c_char , signature : b"uii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"popup_done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut wl_shell_surface_interface : wl_interface = wl_interface { name : b"wl_shell_surface\0" as * const u8 as * const c_char , version : 1 , request_count : 10 , requests : unsafe { & wl_shell_surface_requests as * const _ } , event_count : 3 , events : unsafe { & wl_shell_surface_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait wl_shell_surface_listener { # [ doc = "ping client\n\nPing a client to check if it is receiving events and sending\nrequests. A client is expected to reply with a pong request." ] fn ping ( & mut self , object : * mut wl_shell_surface , serial : u32 ) { } # [ doc = "suggest resize\n\nThe configure event asks the client to resize its surface.\n\nThe size is a hint, in the sense that the client is free to\nignore it if it doesn't resize, pick a smaller size (to\nsatisfy aspect ratio or resize in steps of NxM pixels).\n\nThe edges parameter provides a hint about how the surface\nwas resized. The client may use this information to decide\nhow to adjust its content to the new size (e.g. a scrolling\narea might adjust its content position to leave the viewable\ncontent unmoved).\n\nThe client is free to dismiss all but the last configure\nevent it received.\n\nThe width and height arguments specify the size of the window\nin surface-local coordinates." ] fn configure ( & mut self , object : * mut wl_shell_surface , edges : resize , width : i32 , height : i32 ) { } # [ doc = "popup interaction is done\n\nThe popup_done event is sent out when a popup grab is broken,\nthat is, when the user clicks a surface that doesn't belong\nto the client owning the popup surface." ] fn popup_done ( & mut self , object : * mut wl_shell_surface , ) { } } pub unsafe fn wl_shell_surface_set_user_data ( wl_shell_surface : * mut super :: wl_shell_surface :: wl_shell_surface , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , wl_shell_surface as _ , user_data ) ; } pub unsafe fn wl_shell_surface_get_user_data ( wl_shell_surface : * mut super :: wl_shell_surface :: wl_shell_surface ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , wl_shell_surface as _ ) ; } pub unsafe fn wl_shell_surface_get_version ( wl_shell_surface : * mut super :: wl_shell_surface :: wl_shell_surface ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , wl_shell_surface as _ ) ; } pub unsafe fn wl_shell_surface_add_listener ( wl_shell_surface : * mut super :: wl_shell_surface :: wl_shell_surface , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , wl_shell_surface as _ , listener as _ , data as _ ) ; } pub unsafe fn wl_shell_surface_add_rust_listener ( wl_shell_surface : * mut super :: wl_shell_surface :: wl_shell_surface , listener : & dyn wl_shell_surface_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return wl_shell_surface_add_listener ( wl_shell_surface as _ , fp as _ , op as _ ) == 0 ; } pub unsafe fn wl_shell_surface_destroy ( wl_shell_surface : * mut super :: wl_shell_surface :: wl_shell_surface ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , wl_shell_surface as _ ) ; } # [ doc = "respond to a ping event\n\nA client must respond to a ping event with a pong request or\nthe client may be deemed unresponsive." ] pub unsafe fn wl_shell_surface_pong ( wl_shell_surface : * mut super :: wl_shell_surface :: wl_shell_surface , serial : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_shell_surface as _ , 0u32 , serial , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "start an interactive move\n\nStart a pointer-driven move of the surface.\n\nThis request must be used in response to a button press event.\nThe server may ignore move requests depending on the state of\nthe surface (e.g. fullscreen or maximized)." ] pub unsafe fn wl_shell_surface_move ( wl_shell_surface : * mut super :: wl_shell_surface :: wl_shell_surface , seat : * mut super :: wl_seat :: wl_seat , serial : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_shell_surface as _ , 1u32 , seat , serial , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "start an interactive resize\n\nStart a pointer-driven resizing of the surface.\n\nThis request must be used in response to a button press event.\nThe server may ignore resize requests depending on the state of\nthe surface (e.g. fullscreen or maximized)." ] pub unsafe fn wl_shell_surface_resize ( wl_shell_surface : * mut super :: wl_shell_surface :: wl_shell_surface , seat : * mut super :: wl_seat :: wl_seat , serial : u32 , edges : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_shell_surface as _ , 2u32 , seat , serial , edges , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "make the surface a toplevel surface\n\nMap the surface as a toplevel surface.\n\nA toplevel surface is not fullscreen, maximized or transient." ] pub unsafe fn wl_shell_surface_set_toplevel ( wl_shell_surface : * mut super :: wl_shell_surface :: wl_shell_surface ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_shell_surface as _ , 3u32 , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "make the surface a transient surface\n\nMap the surface relative to an existing surface.\n\nThe x and y arguments specify the location of the upper left\ncorner of the surface relative to the upper left corner of the\nparent surface, in surface-local coordinates.\n\nThe flags argument controls details of the transient behaviour." ] pub unsafe fn wl_shell_surface_set_transient ( wl_shell_surface : * mut super :: wl_shell_surface :: wl_shell_surface , parent : * mut super :: wl_surface :: wl_surface , x : i32 , y : i32 , flags : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_shell_surface as _ , 4u32 , parent , x , y , flags , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "make the surface a fullscreen surface\n\nMap the surface as a fullscreen surface.\n\nIf an output parameter is given then the surface will be made\nfullscreen on that output. If the client does not specify the\noutput then the compositor will apply its policy - usually\nchoosing the output on which the surface has the biggest surface\narea.\n\nThe client may specify a method to resolve a size conflict\nbetween the output size and the surface size - this is provided\nthrough the method parameter.\n\nThe framerate parameter is used only when the method is set\nto \"driver\", to indicate the preferred framerate. A value of 0\nindicates that the client does not care about framerate.  The\nframerate is specified in mHz, that is framerate of 60000 is 60Hz.\n\nA method of \"scale\" or \"driver\" implies a scaling operation of\nthe surface, either via a direct scaling operation or a change of\nthe output mode. This will override any kind of output scaling, so\nthat mapping a surface with a buffer size equal to the mode can\nfill the screen independent of buffer_scale.\n\nA method of \"fill\" means we don't scale up the buffer, however\nany output scale is applied. This means that you may run into\nan edge case where the application maps a buffer with the same\nsize of the output mode but buffer_scale 1 (thus making a\nsurface larger than the output). In this case it is allowed to\ndownscale the results to fit the screen.\n\nThe compositor must reply to this request with a configure event\nwith the dimensions for the output on which the surface will\nbe made fullscreen." ] pub unsafe fn wl_shell_surface_set_fullscreen ( wl_shell_surface : * mut super :: wl_shell_surface :: wl_shell_surface , method : u32 , framerate : u32 , output : * mut super :: wl_output :: wl_output ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_shell_surface as _ , 5u32 , method , framerate , output , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "make the surface a popup surface\n\nMap the surface as a popup.\n\nA popup surface is a transient surface with an added pointer\ngrab.\n\nAn existing implicit grab will be changed to owner-events mode,\nand the popup grab will continue after the implicit grab ends\n(i.e. releasing the mouse button does not cause the popup to\nbe unmapped).\n\nThe popup grab continues until the window is destroyed or a\nmouse button is pressed in any other client's window. A click\nin any of the client's surfaces is reported as normal, however,\nclicks in other clients' surfaces will be discarded and trigger\nthe callback.\n\nThe x and y arguments specify the location of the upper left\ncorner of the surface relative to the upper left corner of the\nparent surface, in surface-local coordinates." ] pub unsafe fn wl_shell_surface_set_popup ( wl_shell_surface : * mut super :: wl_shell_surface :: wl_shell_surface , seat : * mut super :: wl_seat :: wl_seat , serial : u32 , parent : * mut super :: wl_surface :: wl_surface , x : i32 , y : i32 , flags : u32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_shell_surface as _ , 6u32 , seat , serial , parent , x , y , flags , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "make the surface a maximized surface\n\nMap the surface as a maximized surface.\n\nIf an output parameter is given then the surface will be\nmaximized on that output. If the client does not specify the\noutput then the compositor will apply its policy - usually\nchoosing the output on which the surface has the biggest surface\narea.\n\nThe compositor will reply with a configure event telling\nthe expected new surface size. The operation is completed\non the next buffer attach to this surface.\n\nA maximized surface typically fills the entire output it is\nbound to, except for desktop elements such as panels. This is\nthe main difference between a maximized shell surface and a\nfullscreen shell surface.\n\nThe details depend on the compositor implementation." ] pub unsafe fn wl_shell_surface_set_maximized ( wl_shell_surface : * mut super :: wl_shell_surface :: wl_shell_surface , output : * mut super :: wl_output :: wl_output ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_shell_surface as _ , 7u32 , output , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set surface title\n\nSet a short title for the surface.\n\nThis string may be used to identify the surface in a task bar,\nwindow list, or other user interface elements provided by the\ncompositor.\n\nThe string must be encoded in UTF-8." ] pub unsafe fn wl_shell_surface_set_title ( wl_shell_surface : * mut super :: wl_shell_surface :: wl_shell_surface , title : * mut c_char ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_shell_surface as _ , 8u32 , title , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set surface class\n\nSet a class for the surface.\n\nThe surface class identifies the general class of applications\nto which the surface belongs. A common convention is to use the\nfile name (or the full path if it is a non-standard location) of\nthe application's .desktop file as the class." ] pub unsafe fn wl_shell_surface_set_class ( wl_shell_surface : * mut super :: wl_shell_surface :: wl_shell_surface , class_ : * mut c_char ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_shell_surface as _ , 9u32 , class_ , std :: ptr :: null :: < c_void > ( ) ) ; } } # [ doc = "an onscreen surface\n\nA surface is a rectangular area that is displayed on the screen.\nIt has a location, size and pixel contents.\n\nThe size of a surface (and relative positions on it) is described\nin surface-local coordinates, which may differ from the buffer\ncoordinates of the pixel content, in case a buffer_transform\nor a buffer_scale is used.\n\nA surface without a \"role\" is fairly useless: a compositor does\nnot know where, when or how to present it. The role is the\npurpose of a wl_surface. Examples of roles are a cursor for a\npointer (as set by wl_pointer.set_cursor), a drag icon\n(wl_data_device.start_drag), a sub-surface\n(wl_subcompositor.get_subsurface), and a window as defined by a\nshell protocol (e.g. wl_shell.get_shell_surface).\n\nA surface can have only one role at a time. Initially a\nwl_surface does not have a role. Once a wl_surface is given a\nrole, it is set permanently for the whole lifetime of the\nwl_surface object. Giving the current role again is allowed,\nunless explicitly forbidden by the relevant interface\nspecification.\n\nSurface roles are given by requests in other interfaces such as\nwl_pointer.set_cursor. The request should explicitly mention\nthat this request gives a role to a wl_surface. Often, this\nrequest also creates a new protocol object that represents the\nrole and adds additional functionality to wl_surface. When a\nclient wants to destroy a wl_surface, they must destroy this 'role\nobject' before the wl_surface.\n\nDestroying the role object does not remove the role from the\nwl_surface, but it may stop the wl_surface from \"playing the role\".\nFor instance, if a wl_subsurface object is destroyed, the wl_surface\nit was created for will be unmapped and forget its position and\nz-order. It is allowed to create a wl_subsurface for the same\nwl_surface again, but it is not allowed to use the wl_surface as\na cursor (cursor is a different role than sub-surface, and role\nswitching is not allowed)." ] pub mod wl_surface { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum wl_surface { } # [ doc = "wl_surface error values\n\nThese errors can be emitted in response to wl_surface requests." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum error { # [ doc = "buffer scale value is invalid" ] invalid_scale = 0 , # [ doc = "buffer transform value is invalid" ] invalid_transform = 1 , # [ doc ( hidden ) ] __nonexhaustive , } impl error { pub fn from_raw ( n : u32 ) -> Option < error > { match n { 0 => Some ( error :: invalid_scale ) , 1 => Some ( error :: invalid_transform ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } static mut wl_surface_requests_attach_types : [ * const wl_interface ; 3 ] = [ unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , ] ; static mut wl_surface_requests_frame_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: wl_callback :: wl_callback_interface as * const wl_interface } , ] ; static mut wl_surface_requests_set_opaque_region_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: wl_region :: wl_region_interface as * const wl_interface } , ] ; static mut wl_surface_requests_set_input_region_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: wl_region :: wl_region_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_surface_requests : [ wl_message ; 10 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"attach\0" as * const u8 as * const c_char , signature : b"?oii\0" as * const u8 as * const c_char , types : unsafe { & wl_surface_requests_attach_types as * const _ } , } , wl_message { name : b"damage\0" as * const u8 as * const c_char , signature : b"iiii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"frame\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & wl_surface_requests_frame_types as * const _ } , } , wl_message { name : b"set_opaque_region\0" as * const u8 as * const c_char , signature : b"?o\0" as * const u8 as * const c_char , types : unsafe { & wl_surface_requests_set_opaque_region_types as * const _ } , } , wl_message { name : b"set_input_region\0" as * const u8 as * const c_char , signature : b"?o\0" as * const u8 as * const c_char , types : unsafe { & wl_surface_requests_set_input_region_types as * const _ } , } , wl_message { name : b"commit\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_buffer_transform\0" as * const u8 as * const c_char , signature : b"2i\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_buffer_scale\0" as * const u8 as * const c_char , signature : b"3i\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"damage_buffer\0" as * const u8 as * const c_char , signature : b"4iiii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; static mut wl_surface_events_enter_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } , ] ; static mut wl_surface_events_leave_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_surface_events : [ wl_message ; 2 ] = [ wl_message { name : b"enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & wl_surface_events_enter_types as * const _ } , } , wl_message { name : b"leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & wl_surface_events_leave_types as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut wl_surface_interface : wl_interface = wl_interface { name : b"wl_surface\0" as * const u8 as * const c_char , version : 4 , request_count : 10 , requests : unsafe { & wl_surface_requests as * const _ } , event_count : 2 , events : unsafe { & wl_surface_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait wl_surface_listener { # [ doc = "surface enters an output\n\nThis is emitted whenever a surface's creation, movement, or resizing\nresults in some part of it being within the scanout region of an\noutput.\n\nNote that a surface may be overlapping with zero or more outputs." ] fn enter ( & mut self , object : * mut wl_surface , output : * mut super :: wl_output :: wl_output ) { } # [ doc = "surface leaves an output\n\nThis is emitted whenever a surface's creation, movement, or resizing\nresults in it no longer having any part of it within the scanout region\nof an output." ] fn leave ( & mut self , object : * mut wl_surface , output : * mut super :: wl_output :: wl_output ) { } } pub unsafe fn wl_surface_set_user_data ( wl_surface : * mut super :: wl_surface :: wl_surface , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , wl_surface as _ , user_data ) ; } pub unsafe fn wl_surface_get_user_data ( wl_surface : * mut super :: wl_surface :: wl_surface ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , wl_surface as _ ) ; } pub unsafe fn wl_surface_get_version ( wl_surface : * mut super :: wl_surface :: wl_surface ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , wl_surface as _ ) ; } pub unsafe fn wl_surface_add_listener ( wl_surface : * mut super :: wl_surface :: wl_surface , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , wl_surface as _ , listener as _ , data as _ ) ; } pub unsafe fn wl_surface_add_rust_listener ( wl_surface : * mut super :: wl_surface :: wl_surface , listener : & dyn wl_surface_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return wl_surface_add_listener ( wl_surface as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "delete surface\n\nDeletes the surface and invalidates its object ID." ] pub unsafe fn wl_surface_destroy ( wl_surface : * mut super :: wl_surface :: wl_surface ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_surface as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , wl_surface as _ ) ; } # [ doc = "set the surface contents\n\nSet a buffer as the content of this surface.\n\nThe new size of the surface is calculated based on the buffer\nsize transformed by the inverse buffer_transform and the\ninverse buffer_scale. This means that the supplied buffer\nmust be an integer multiple of the buffer_scale.\n\nThe x and y arguments specify the location of the new pending\nbuffer's upper left corner, relative to the current buffer's upper\nleft corner, in surface-local coordinates. In other words, the\nx and y, combined with the new surface size define in which\ndirections the surface's size changes.\n\nSurface contents are double-buffered state, see wl_surface.commit.\n\nThe initial surface contents are void; there is no content.\nwl_surface.attach assigns the given wl_buffer as the pending\nwl_buffer. wl_surface.commit makes the pending wl_buffer the new\nsurface contents, and the size of the surface becomes the size\ncalculated from the wl_buffer, as described above. After commit,\nthere is no pending buffer until the next attach.\n\nCommitting a pending wl_buffer allows the compositor to read the\npixels in the wl_buffer. The compositor may access the pixels at\nany time after the wl_surface.commit request. When the compositor\nwill not access the pixels anymore, it will send the\nwl_buffer.release event. Only after receiving wl_buffer.release,\nthe client may reuse the wl_buffer. A wl_buffer that has been\nattached and then replaced by another attach instead of committed\nwill not receive a release event, and is not used by the\ncompositor.\n\nDestroying the wl_buffer after wl_buffer.release does not change\nthe surface contents. However, if the client destroys the\nwl_buffer before receiving the wl_buffer.release event, the surface\ncontents become undefined immediately.\n\nIf wl_surface.attach is sent with a NULL wl_buffer, the\nfollowing wl_surface.commit will remove the surface content." ] pub unsafe fn wl_surface_attach ( wl_surface : * mut super :: wl_surface :: wl_surface , buffer : * mut super :: wl_buffer :: wl_buffer , x : i32 , y : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_surface as _ , 1u32 , buffer , x , y , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "mark part of the surface damaged\n\nThis request is used to describe the regions where the pending\nbuffer is different from the current surface contents, and where\nthe surface therefore needs to be repainted. The compositor\nignores the parts of the damage that fall outside of the surface.\n\nDamage is double-buffered state, see wl_surface.commit.\n\nThe damage rectangle is specified in surface-local coordinates,\nwhere x and y specify the upper left corner of the damage rectangle.\n\nThe initial value for pending damage is empty: no damage.\nwl_surface.damage adds pending damage: the new pending damage\nis the union of old pending damage and the given rectangle.\n\nwl_surface.commit assigns pending damage as the current damage,\nand clears pending damage. The server will clear the current\ndamage as it repaints the surface.\n\nAlternatively, damage can be posted with wl_surface.damage_buffer\nwhich uses buffer coordinates instead of surface coordinates,\nand is probably the preferred and intuitive way of doing this." ] pub unsafe fn wl_surface_damage ( wl_surface : * mut super :: wl_surface :: wl_surface , x : i32 , y : i32 , width : i32 , height : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_surface as _ , 2u32 , x , y , width , height , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "request a frame throttling hint\n\nRequest a notification when it is a good time to start drawing a new\nframe, by creating a frame callback. This is useful for throttling\nredrawing operations, and driving animations.\n\nWhen a client is animating on a wl_surface, it can use the 'frame'\nrequest to get notified when it is a good time to draw and commit the\nnext frame of animation. If the client commits an update earlier than\nthat, it is likely that some updates will not make it to the display,\nand the client is wasting resources by drawing too often.\n\nThe frame request will take effect on the next wl_surface.commit.\nThe notification will only be posted for one frame unless\nrequested again. For a wl_surface, the notifications are posted in\nthe order the frame requests were committed.\n\nThe server must send the notifications so that a client\nwill not send excessive updates, while still allowing\nthe highest possible update rate for clients that wait for the reply\nbefore drawing again. The server should give some time for the client\nto draw and commit after sending the frame callback events to let it\nhit the next output refresh.\n\nA server should avoid signaling the frame callbacks if the\nsurface is not visible in any way, e.g. the surface is off-screen,\nor completely obscured by other opaque surfaces.\n\nThe object returned by this request will be destroyed by the\ncompositor after the callback is fired and as such the client must not\nattempt to use it after that point.\n\nThe callback_data passed in the callback is the current time, in\nmilliseconds, with an undefined base." ] pub unsafe fn wl_surface_frame ( wl_surface : * mut super :: wl_surface :: wl_surface ) -> * mut super :: wl_callback :: wl_callback { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , wl_surface as _ , 3u32 , & super :: wl_callback :: wl_callback_interface as * const _ , std :: ptr :: null :: < c_void > ( ) ) ; return r as _ ; } # [ doc = "set opaque region\n\nThis request sets the region of the surface that contains\nopaque content.\n\nThe opaque region is an optimization hint for the compositor\nthat lets it optimize the redrawing of content behind opaque\nregions.  Setting an opaque region is not required for correct\nbehaviour, but marking transparent content as opaque will result\nin repaint artifacts.\n\nThe opaque region is specified in surface-local coordinates.\n\nThe compositor ignores the parts of the opaque region that fall\noutside of the surface.\n\nOpaque region is double-buffered state, see wl_surface.commit.\n\nwl_surface.set_opaque_region changes the pending opaque region.\nwl_surface.commit copies the pending region to the current region.\nOtherwise, the pending and current regions are never changed.\n\nThe initial value for an opaque region is empty. Setting the pending\nopaque region has copy semantics, and the wl_region object can be\ndestroyed immediately. A NULL wl_region causes the pending opaque\nregion to be set to empty." ] pub unsafe fn wl_surface_set_opaque_region ( wl_surface : * mut super :: wl_surface :: wl_surface , region : * mut super :: wl_region :: wl_region ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_surface as _ , 4u32 , region , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set input region\n\nThis request sets the region of the surface that can receive\npointer and touch events.\n\nInput events happening outside of this region will try the next\nsurface in the server surface stack. The compositor ignores the\nparts of the input region that fall outside of the surface.\n\nThe input region is specified in surface-local coordinates.\n\nInput region is double-buffered state, see wl_surface.commit.\n\nwl_surface.set_input_region changes the pending input region.\nwl_surface.commit copies the pending region to the current region.\nOtherwise the pending and current regions are never changed,\nexcept cursor and icon surfaces are special cases, see\nwl_pointer.set_cursor and wl_data_device.start_drag.\n\nThe initial value for an input region is infinite. That means the\nwhole surface will accept input. Setting the pending input region\nhas copy semantics, and the wl_region object can be destroyed\nimmediately. A NULL wl_region causes the input region to be set\nto infinite." ] pub unsafe fn wl_surface_set_input_region ( wl_surface : * mut super :: wl_surface :: wl_surface , region : * mut super :: wl_region :: wl_region ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_surface as _ , 5u32 , region , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "commit pending surface state\n\nSurface state (input, opaque, and damage regions, attached buffers,\netc.) is double-buffered. Protocol requests modify the pending state,\nas opposed to the current state in use by the compositor. A commit\nrequest atomically applies all pending state, replacing the current\nstate. After commit, the new pending state is as documented for each\nrelated request.\n\nOn commit, a pending wl_buffer is applied first, and all other state\nsecond. This means that all coordinates in double-buffered state are\nrelative to the new wl_buffer coming into use, except for\nwl_surface.attach itself. If there is no pending wl_buffer, the\ncoordinates are relative to the current surface contents.\n\nAll requests that need a commit to become effective are documented\nto affect double-buffered state.\n\nOther interfaces may add further double-buffered surface state." ] pub unsafe fn wl_surface_commit ( wl_surface : * mut super :: wl_surface :: wl_surface ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_surface as _ , 6u32 , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "sets the buffer transformation\n\nThis request sets an optional transformation on how the compositor\ninterprets the contents of the buffer attached to the surface. The\naccepted values for the transform parameter are the values for\nwl_output.transform.\n\nBuffer transform is double-buffered state, see wl_surface.commit.\n\nA newly created surface has its buffer transformation set to normal.\n\nwl_surface.set_buffer_transform changes the pending buffer\ntransformation. wl_surface.commit copies the pending buffer\ntransformation to the current one. Otherwise, the pending and current\nvalues are never changed.\n\nThe purpose of this request is to allow clients to render content\naccording to the output transform, thus permitting the compositor to\nuse certain optimizations even if the display is rotated. Using\nhardware overlays and scanning out a client buffer for fullscreen\nsurfaces are examples of such optimizations. Those optimizations are\nhighly dependent on the compositor implementation, so the use of this\nrequest should be considered on a case-by-case basis.\n\nNote that if the transform value includes 90 or 270 degree rotation,\nthe width of the buffer will become the surface height and the height\nof the buffer will become the surface width.\n\nIf transform is not one of the values from the\nwl_output.transform enum the invalid_transform protocol error\nis raised." ] pub unsafe fn wl_surface_set_buffer_transform ( wl_surface : * mut super :: wl_surface :: wl_surface , transform : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_surface as _ , 7u32 , transform , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "sets the buffer scaling factor\n\nThis request sets an optional scaling factor on how the compositor\ninterprets the contents of the buffer attached to the window.\n\nBuffer scale is double-buffered state, see wl_surface.commit.\n\nA newly created surface has its buffer scale set to 1.\n\nwl_surface.set_buffer_scale changes the pending buffer scale.\nwl_surface.commit copies the pending buffer scale to the current one.\nOtherwise, the pending and current values are never changed.\n\nThe purpose of this request is to allow clients to supply higher\nresolution buffer data for use on high resolution outputs. It is\nintended that you pick the same buffer scale as the scale of the\noutput that the surface is displayed on. This means the compositor\ncan avoid scaling when rendering the surface on that output.\n\nNote that if the scale is larger than 1, then you have to attach\na buffer that is larger (by a factor of scale in each dimension)\nthan the desired surface size.\n\nIf scale is not positive the invalid_scale protocol error is\nraised." ] pub unsafe fn wl_surface_set_buffer_scale ( wl_surface : * mut super :: wl_surface :: wl_surface , scale : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_surface as _ , 8u32 , scale , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "mark part of the surface damaged using buffer coordinates\n\nThis request is used to describe the regions where the pending\nbuffer is different from the current surface contents, and where\nthe surface therefore needs to be repainted. The compositor\nignores the parts of the damage that fall outside of the surface.\n\nDamage is double-buffered state, see wl_surface.commit.\n\nThe damage rectangle is specified in buffer coordinates,\nwhere x and y specify the upper left corner of the damage rectangle.\n\nThe initial value for pending damage is empty: no damage.\nwl_surface.damage_buffer adds pending damage: the new pending\ndamage is the union of old pending damage and the given rectangle.\n\nwl_surface.commit assigns pending damage as the current damage,\nand clears pending damage. The server will clear the current\ndamage as it repaints the surface.\n\nThis request differs from wl_surface.damage in only one way - it\ntakes damage in buffer coordinates instead of surface-local\ncoordinates. While this generally is more intuitive than surface\ncoordinates, it is especially desirable when using wp_viewport\nor when a drawing library (like EGL) is unaware of buffer scale\nand buffer transform.\n\nNote: Because buffer transformation changes and damage requests may\nbe interleaved in the protocol stream, it is impossible to determine\nthe actual mapping between surface and buffer damage until\nwl_surface.commit time. Therefore, compositors wishing to take both\nkinds of damage into account will have to accumulate damage from the\ntwo requests separately and only transform from one to the other\nafter receiving the wl_surface.commit." ] pub unsafe fn wl_surface_damage_buffer ( wl_surface : * mut super :: wl_surface :: wl_surface , x : i32 , y : i32 , width : i32 , height : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_surface as _ , 9u32 , x , y , width , height , std :: ptr :: null :: < c_void > ( ) ) ; } } # [ doc = "group of input devices\n\nA seat is a group of keyboards, pointer and touch devices. This\nobject is published as a global during start up, or when such a\ndevice is hot plugged.  A seat typically has a pointer and\nmaintains a keyboard focus and a pointer focus." ] pub mod wl_seat { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum wl_seat { } bitflags ! { # [ doc = "seat capability bitmask\n\nThis is a bitmask of capabilities this seat has; if a member is\nset, then it is present on the seat." ] pub struct capability : u32 { # [ doc = "the seat has pointer devices" ] const pointer = 1 ; # [ doc = "the seat has one or more keyboards" ] const keyboard = 2 ; # [ doc = "the seat has touch devices" ] const touch = 4 ; } } impl capability { pub fn from_raw ( n : u32 ) -> Option < capability > { Some ( capability :: from_bits_truncate ( n ) ) } pub fn to_raw ( & self ) -> u32 { self . bits ( ) } } static mut wl_seat_requests_get_pointer_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: wl_pointer :: wl_pointer_interface as * const wl_interface } , ] ; static mut wl_seat_requests_get_keyboard_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: wl_keyboard :: wl_keyboard_interface as * const wl_interface } , ] ; static mut wl_seat_requests_get_touch_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: wl_touch :: wl_touch_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_seat_requests : [ wl_message ; 4 ] = [ wl_message { name : b"get_pointer\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & wl_seat_requests_get_pointer_types as * const _ } , } , wl_message { name : b"get_keyboard\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & wl_seat_requests_get_keyboard_types as * const _ } , } , wl_message { name : b"get_touch\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & wl_seat_requests_get_touch_types as * const _ } , } , wl_message { name : b"release\0" as * const u8 as * const c_char , signature : b"5\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_seat_events : [ wl_message ; 2 ] = [ wl_message { name : b"capabilities\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"name\0" as * const u8 as * const c_char , signature : b"2s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut wl_seat_interface : wl_interface = wl_interface { name : b"wl_seat\0" as * const u8 as * const c_char , version : 6 , request_count : 4 , requests : unsafe { & wl_seat_requests as * const _ } , event_count : 2 , events : unsafe { & wl_seat_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait wl_seat_listener { # [ doc = "seat capabilities changed\n\nThis is emitted whenever a seat gains or loses the pointer,\nkeyboard or touch capabilities.  The argument is a capability\nenum containing the complete set of capabilities this seat has.\n\nWhen the pointer capability is added, a client may create a\nwl_pointer object using the wl_seat.get_pointer request. This object\nwill receive pointer events until the capability is removed in the\nfuture.\n\nWhen the pointer capability is removed, a client should destroy the\nwl_pointer objects associated with the seat where the capability was\nremoved, using the wl_pointer.release request. No further pointer\nevents will be received on these objects.\n\nIn some compositors, if a seat regains the pointer capability and a\nclient has a previously obtained wl_pointer object of version 4 or\nless, that object may start sending pointer events again. This\nbehavior is considered a misinterpretation of the intended behavior\nand must not be relied upon by the client. wl_pointer objects of\nversion 5 or later must not send events if created before the most\nrecent event notifying the client of an added pointer capability.\n\nThe above behavior also applies to wl_keyboard and wl_touch with the\nkeyboard and touch capabilities, respectively." ] fn capabilities ( & mut self , object : * mut wl_seat , capabilities : capability ) { } # [ doc = "unique identifier for this seat\n\nIn a multiseat configuration this can be used by the client to help\nidentify which physical devices the seat represents. Based on\nthe seat configuration used by the compositor.\n\nOnly available since version 2 of the interface." ] fn name ( & mut self , object : * mut wl_seat , name : * mut c_char ) { } } pub unsafe fn wl_seat_set_user_data ( wl_seat : * mut super :: wl_seat :: wl_seat , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , wl_seat as _ , user_data ) ; } pub unsafe fn wl_seat_get_user_data ( wl_seat : * mut super :: wl_seat :: wl_seat ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , wl_seat as _ ) ; } pub unsafe fn wl_seat_get_version ( wl_seat : * mut super :: wl_seat :: wl_seat ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , wl_seat as _ ) ; } pub unsafe fn wl_seat_add_listener ( wl_seat : * mut super :: wl_seat :: wl_seat , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , wl_seat as _ , listener as _ , data as _ ) ; } pub unsafe fn wl_seat_add_rust_listener ( wl_seat : * mut super :: wl_seat :: wl_seat , listener : & dyn wl_seat_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return wl_seat_add_listener ( wl_seat as _ , fp as _ , op as _ ) == 0 ; } pub unsafe fn wl_seat_destroy ( wl_seat : * mut super :: wl_seat :: wl_seat ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , wl_seat as _ ) ; } # [ doc = "return pointer object\n\nThe ID provided will be initialized to the wl_pointer interface\nfor this seat.\n\nThis request only takes effect if the seat has the pointer\ncapability, or has had the pointer capability in the past.\nIt is a protocol violation to issue this request on a seat that has\nnever had the pointer capability." ] pub unsafe fn wl_seat_get_pointer ( wl_seat : * mut super :: wl_seat :: wl_seat ) -> * mut super :: wl_pointer :: wl_pointer { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , wl_seat as _ , 0u32 , & super :: wl_pointer :: wl_pointer_interface as * const _ , std :: ptr :: null :: < c_void > ( ) ) ; return r as _ ; } # [ doc = "return keyboard object\n\nThe ID provided will be initialized to the wl_keyboard interface\nfor this seat.\n\nThis request only takes effect if the seat has the keyboard\ncapability, or has had the keyboard capability in the past.\nIt is a protocol violation to issue this request on a seat that has\nnever had the keyboard capability." ] pub unsafe fn wl_seat_get_keyboard ( wl_seat : * mut super :: wl_seat :: wl_seat ) -> * mut super :: wl_keyboard :: wl_keyboard { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , wl_seat as _ , 1u32 , & super :: wl_keyboard :: wl_keyboard_interface as * const _ , std :: ptr :: null :: < c_void > ( ) ) ; return r as _ ; } # [ doc = "return touch object\n\nThe ID provided will be initialized to the wl_touch interface\nfor this seat.\n\nThis request only takes effect if the seat has the touch\ncapability, or has had the touch capability in the past.\nIt is a protocol violation to issue this request on a seat that has\nnever had the touch capability." ] pub unsafe fn wl_seat_get_touch ( wl_seat : * mut super :: wl_seat :: wl_seat ) -> * mut super :: wl_touch :: wl_touch { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , wl_seat as _ , 2u32 , & super :: wl_touch :: wl_touch_interface as * const _ , std :: ptr :: null :: < c_void > ( ) ) ; return r as _ ; } # [ doc = "release the seat object\n\nUsing this request a client can tell the server that it is not going to\nuse the seat object anymore." ] pub unsafe fn wl_seat_release ( wl_seat : * mut super :: wl_seat :: wl_seat ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_seat as _ , 3u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , wl_seat as _ ) ; } } # [ doc = "pointer input device\n\nThe wl_pointer interface represents one or more input devices,\nsuch as mice, which control the pointer location and pointer_focus\nof a seat.\n\nThe wl_pointer interface generates motion, enter and leave\nevents for the surfaces that the pointer is located over,\nand button and axis events for button presses, button releases\nand scrolling." ] pub mod wl_pointer { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum wl_pointer { } # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum error { # [ doc = "given wl_surface has another role" ] role = 0 , # [ doc ( hidden ) ] __nonexhaustive , } impl error { pub fn from_raw ( n : u32 ) -> Option < error > { match n { 0 => Some ( error :: role ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ doc = "physical button state\n\nDescribes the physical state of a button that produced the button\nevent." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum button_state { # [ doc = "the button is not pressed" ] released = 0 , # [ doc = "the button is pressed" ] pressed = 1 , # [ doc ( hidden ) ] __nonexhaustive , } impl button_state { pub fn from_raw ( n : u32 ) -> Option < button_state > { match n { 0 => Some ( button_state :: released ) , 1 => Some ( button_state :: pressed ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ doc = "axis types\n\nDescribes the axis types of scroll events." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum axis { # [ doc = "vertical axis" ] vertical_scroll = 0 , # [ doc = "horizontal axis" ] horizontal_scroll = 1 , # [ doc ( hidden ) ] __nonexhaustive , } impl axis { pub fn from_raw ( n : u32 ) -> Option < axis > { match n { 0 => Some ( axis :: vertical_scroll ) , 1 => Some ( axis :: horizontal_scroll ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ doc = "axis source types\n\nDescribes the source types for axis events. This indicates to the\nclient how an axis event was physically generated; a client may\nadjust the user interface accordingly. For example, scroll events\nfrom a \"finger\" source may be in a smooth coordinate space with\nkinetic scrolling whereas a \"wheel\" source may be in discrete steps\nof a number of lines.\n\nThe \"continuous\" axis source is a device generating events in a\ncontinuous coordinate space, but using something other than a\nfinger. One example for this source is button-based scrolling where\nthe vertical motion of a device is converted to scroll events while\na button is held down.\n\nThe \"wheel tilt\" axis source indicates that the actual device is a\nwheel but the scroll event is not caused by a rotation but a\n(usually sideways) tilt of the wheel." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum axis_source { # [ doc = "a physical wheel rotation" ] wheel = 0 , # [ doc = "finger on a touch surface" ] finger = 1 , # [ doc = "continuous coordinate space" ] continuous = 2 , # [ doc = "a physical wheel tilt" ] wheel_tilt = 3 , # [ doc ( hidden ) ] __nonexhaustive , } impl axis_source { pub fn from_raw ( n : u32 ) -> Option < axis_source > { match n { 0 => Some ( axis_source :: wheel ) , 1 => Some ( axis_source :: finger ) , 2 => Some ( axis_source :: continuous ) , 3 => Some ( axis_source :: wheel_tilt ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } static mut wl_pointer_requests_set_cursor_types : [ * const wl_interface ; 4 ] = [ NULLPTR as * const wl_interface , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_pointer_requests : [ wl_message ; 2 ] = [ wl_message { name : b"set_cursor\0" as * const u8 as * const c_char , signature : b"u?oii\0" as * const u8 as * const c_char , types : unsafe { & wl_pointer_requests_set_cursor_types as * const _ } , } , wl_message { name : b"release\0" as * const u8 as * const c_char , signature : b"3\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; static mut wl_pointer_events_enter_types : [ * const wl_interface ; 4 ] = [ NULLPTR as * const wl_interface , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , ] ; static mut wl_pointer_events_leave_types : [ * const wl_interface ; 2 ] = [ NULLPTR as * const wl_interface , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_pointer_events : [ wl_message ; 9 ] = [ wl_message { name : b"enter\0" as * const u8 as * const c_char , signature : b"uoff\0" as * const u8 as * const c_char , types : unsafe { & wl_pointer_events_enter_types as * const _ } , } , wl_message { name : b"leave\0" as * const u8 as * const c_char , signature : b"uo\0" as * const u8 as * const c_char , types : unsafe { & wl_pointer_events_leave_types as * const _ } , } , wl_message { name : b"motion\0" as * const u8 as * const c_char , signature : b"uff\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"button\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"axis\0" as * const u8 as * const c_char , signature : b"uuf\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"frame\0" as * const u8 as * const c_char , signature : b"5\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"axis_source\0" as * const u8 as * const c_char , signature : b"5u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"axis_stop\0" as * const u8 as * const c_char , signature : b"5uu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"axis_discrete\0" as * const u8 as * const c_char , signature : b"5ui\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut wl_pointer_interface : wl_interface = wl_interface { name : b"wl_pointer\0" as * const u8 as * const c_char , version : 6 , request_count : 2 , requests : unsafe { & wl_pointer_requests as * const _ } , event_count : 9 , events : unsafe { & wl_pointer_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait wl_pointer_listener { # [ doc = "enter event\n\nNotification that this seat's pointer is focused on a certain\nsurface.\n\nWhen a seat's focus enters a surface, the pointer image\nis undefined and a client should respond to this event by setting\nan appropriate pointer image with the set_cursor request." ] fn enter ( & mut self , object : * mut wl_pointer , serial : u32 , surface : * mut super :: wl_surface :: wl_surface , surface_x : wl_fixed_t , surface_y : wl_fixed_t ) { } # [ doc = "leave event\n\nNotification that this seat's pointer is no longer focused on\na certain surface.\n\nThe leave notification is sent before the enter notification\nfor the new focus." ] fn leave ( & mut self , object : * mut wl_pointer , serial : u32 , surface : * mut super :: wl_surface :: wl_surface ) { } # [ doc = "pointer motion event\n\nNotification of pointer location change. The arguments\nsurface_x and surface_y are the location relative to the\nfocused surface." ] fn motion ( & mut self , object : * mut wl_pointer , time : u32 , surface_x : wl_fixed_t , surface_y : wl_fixed_t ) { } # [ doc = "pointer button event\n\nMouse button click and release notifications.\n\nThe location of the click is given by the last motion or\nenter event.\nThe time argument is a timestamp with millisecond\ngranularity, with an undefined base.\n\nThe button is a button code as defined in the Linux kernel's\nlinux/input-event-codes.h header file, e.g. BTN_LEFT.\n\nAny 16-bit button code value is reserved for future additions to the\nkernel's event code list. All other button codes above 0xFFFF are\ncurrently undefined but may be used in future versions of this\nprotocol." ] fn button ( & mut self , object : * mut wl_pointer , serial : u32 , time : u32 , button : u32 , state : button_state ) { } # [ doc = "axis event\n\nScroll and other axis notifications.\n\nFor scroll events (vertical and horizontal scroll axes), the\nvalue parameter is the length of a vector along the specified\naxis in a coordinate space identical to those of motion events,\nrepresenting a relative movement along the specified axis.\n\nFor devices that support movements non-parallel to axes multiple\naxis events will be emitted.\n\nWhen applicable, for example for touch pads, the server can\nchoose to emit scroll events where the motion vector is\nequivalent to a motion event vector.\n\nWhen applicable, a client can transform its content relative to the\nscroll distance." ] fn axis ( & mut self , object : * mut wl_pointer , time : u32 , axis : axis , value : wl_fixed_t ) { } # [ doc = "end of a pointer event sequence\n\nIndicates the end of a set of events that logically belong together.\nA client is expected to accumulate the data in all events within the\nframe before proceeding.\n\nAll wl_pointer events before a wl_pointer.frame event belong\nlogically together. For example, in a diagonal scroll motion the\ncompositor will send an optional wl_pointer.axis_source event, two\nwl_pointer.axis events (horizontal and vertical) and finally a\nwl_pointer.frame event. The client may use this information to\ncalculate a diagonal vector for scrolling.\n\nWhen multiple wl_pointer.axis events occur within the same frame,\nthe motion vector is the combined motion of all events.\nWhen a wl_pointer.axis and a wl_pointer.axis_stop event occur within\nthe same frame, this indicates that axis movement in one axis has\nstopped but continues in the other axis.\nWhen multiple wl_pointer.axis_stop events occur within the same\nframe, this indicates that these axes stopped in the same instance.\n\nA wl_pointer.frame event is sent for every logical event group,\neven if the group only contains a single wl_pointer event.\nSpecifically, a client may get a sequence: motion, frame, button,\nframe, axis, frame, axis_stop, frame.\n\nThe wl_pointer.enter and wl_pointer.leave events are logical events\ngenerated by the compositor and not the hardware. These events are\nalso grouped by a wl_pointer.frame. When a pointer moves from one\nsurface to another, a compositor should group the\nwl_pointer.leave event within the same wl_pointer.frame.\nHowever, a client must not rely on wl_pointer.leave and\nwl_pointer.enter being in the same wl_pointer.frame.\nCompositor-specific policies may require the wl_pointer.leave and\nwl_pointer.enter event being split across multiple wl_pointer.frame\ngroups.\n\nOnly available since version 5 of the interface." ] fn frame ( & mut self , object : * mut wl_pointer , ) { } # [ doc = "axis source event\n\nSource information for scroll and other axes.\n\nThis event does not occur on its own. It is sent before a\nwl_pointer.frame event and carries the source information for\nall events within that frame.\n\nThe source specifies how this event was generated. If the source is\nwl_pointer.axis_source.finger, a wl_pointer.axis_stop event will be\nsent when the user lifts the finger off the device.\n\nIf the source is wl_pointer.axis_source.wheel,\nwl_pointer.axis_source.wheel_tilt or\nwl_pointer.axis_source.continuous, a wl_pointer.axis_stop event may\nor may not be sent. Whether a compositor sends an axis_stop event\nfor these sources is hardware-specific and implementation-dependent;\nclients must not rely on receiving an axis_stop event for these\nscroll sources and should treat scroll sequences from these scroll\nsources as unterminated by default.\n\nThis event is optional. If the source is unknown for a particular\naxis event sequence, no event is sent.\nOnly one wl_pointer.axis_source event is permitted per frame.\n\nThe order of wl_pointer.axis_discrete and wl_pointer.axis_source is\nnot guaranteed.\n\nOnly available since version 5 of the interface." ] fn axis_source ( & mut self , object : * mut wl_pointer , axis_source : axis_source ) { } # [ doc = "axis stop event\n\nStop notification for scroll and other axes.\n\nFor some wl_pointer.axis_source types, a wl_pointer.axis_stop event\nis sent to notify a client that the axis sequence has terminated.\nThis enables the client to implement kinetic scrolling.\nSee the wl_pointer.axis_source documentation for information on when\nthis event may be generated.\n\nAny wl_pointer.axis events with the same axis_source after this\nevent should be considered as the start of a new axis motion.\n\nThe timestamp is to be interpreted identical to the timestamp in the\nwl_pointer.axis event. The timestamp value may be the same as a\npreceding wl_pointer.axis event.\n\nOnly available since version 5 of the interface." ] fn axis_stop ( & mut self , object : * mut wl_pointer , time : u32 , axis : axis ) { } # [ doc = "axis click event\n\nDiscrete step information for scroll and other axes.\n\nThis event carries the axis value of the wl_pointer.axis event in\ndiscrete steps (e.g. mouse wheel clicks).\n\nThis event does not occur on its own, it is coupled with a\nwl_pointer.axis event that represents this axis value on a\ncontinuous scale. The protocol guarantees that each axis_discrete\nevent is always followed by exactly one axis event with the same\naxis number within the same wl_pointer.frame. Note that the protocol\nallows for other events to occur between the axis_discrete and\nits coupled axis event, including other axis_discrete or axis\nevents.\n\nThis event is optional; continuous scrolling devices\nlike two-finger scrolling on touchpads do not have discrete\nsteps and do not generate this event.\n\nThe discrete value carries the directional information. e.g. a value\nof -2 is two steps towards the negative direction of this axis.\n\nThe axis number is identical to the axis number in the associated\naxis event.\n\nThe order of wl_pointer.axis_discrete and wl_pointer.axis_source is\nnot guaranteed.\n\nOnly available since version 5 of the interface." ] fn axis_discrete ( & mut self , object : * mut wl_pointer , axis : axis , discrete : i32 ) { } } pub unsafe fn wl_pointer_set_user_data ( wl_pointer : * mut super :: wl_pointer :: wl_pointer , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , wl_pointer as _ , user_data ) ; } pub unsafe fn wl_pointer_get_user_data ( wl_pointer : * mut super :: wl_pointer :: wl_pointer ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , wl_pointer as _ ) ; } pub unsafe fn wl_pointer_get_version ( wl_pointer : * mut super :: wl_pointer :: wl_pointer ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , wl_pointer as _ ) ; } pub unsafe fn wl_pointer_add_listener ( wl_pointer : * mut super :: wl_pointer :: wl_pointer , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , wl_pointer as _ , listener as _ , data as _ ) ; } pub unsafe fn wl_pointer_add_rust_listener ( wl_pointer : * mut super :: wl_pointer :: wl_pointer , listener : & dyn wl_pointer_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return wl_pointer_add_listener ( wl_pointer as _ , fp as _ , op as _ ) == 0 ; } pub unsafe fn wl_pointer_destroy ( wl_pointer : * mut super :: wl_pointer :: wl_pointer ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , wl_pointer as _ ) ; } # [ doc = "set the pointer surface\n\nSet the pointer surface, i.e., the surface that contains the\npointer image (cursor). This request gives the surface the role\nof a cursor. If the surface already has another role, it raises\na protocol error.\n\nThe cursor actually changes only if the pointer\nfocus for this device is one of the requesting client's surfaces\nor the surface parameter is the current pointer surface. If\nthere was a previous surface set with this request it is\nreplaced. If surface is NULL, the pointer image is hidden.\n\nThe parameters hotspot_x and hotspot_y define the position of\nthe pointer surface relative to the pointer location. Its\ntop-left corner is always at (x, y) - (hotspot_x, hotspot_y),\nwhere (x, y) are the coordinates of the pointer location, in\nsurface-local coordinates.\n\nOn surface.attach requests to the pointer surface, hotspot_x\nand hotspot_y are decremented by the x and y parameters\npassed to the request. Attach must be confirmed by\nwl_surface.commit as usual.\n\nThe hotspot can also be updated by passing the currently set\npointer surface to this request with new values for hotspot_x\nand hotspot_y.\n\nThe current and pending input regions of the wl_surface are\ncleared, and wl_surface.set_input_region is ignored until the\nwl_surface is no longer used as the cursor. When the use as a\ncursor ends, the current and pending input regions become\nundefined, and the wl_surface is unmapped." ] pub unsafe fn wl_pointer_set_cursor ( wl_pointer : * mut super :: wl_pointer :: wl_pointer , serial : u32 , surface : * mut super :: wl_surface :: wl_surface , hotspot_x : i32 , hotspot_y : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_pointer as _ , 0u32 , serial , surface , hotspot_x , hotspot_y , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "release the pointer object\n\nUsing this request a client can tell the server that it is not going to\nuse the pointer object anymore.\n\nThis request destroys the pointer proxy object, so clients must not call\nwl_pointer_destroy() after using this request." ] pub unsafe fn wl_pointer_release ( wl_pointer : * mut super :: wl_pointer :: wl_pointer ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_pointer as _ , 1u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , wl_pointer as _ ) ; } } # [ doc = "keyboard input device\n\nThe wl_keyboard interface represents one or more keyboards\nassociated with a seat." ] pub mod wl_keyboard { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum wl_keyboard { } # [ doc = "keyboard mapping format\n\nThis specifies the format of the keymap provided to the\nclient with the wl_keyboard.keymap event." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum keymap_format { # [ doc = "no keymap; client must understand how to interpret the raw keycode" ] no_keymap = 0 , # [ doc = "libxkbcommon compatible; to determine the xkb keycode, clients must add 8 to the key event keycode" ] xkb_v1 = 1 , # [ doc ( hidden ) ] __nonexhaustive , } impl keymap_format { pub fn from_raw ( n : u32 ) -> Option < keymap_format > { match n { 0 => Some ( keymap_format :: no_keymap ) , 1 => Some ( keymap_format :: xkb_v1 ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ doc = "physical key state\n\nDescribes the physical state of a key that produced the key event." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum key_state { # [ doc = "key is not pressed" ] released = 0 , # [ doc = "key is pressed" ] pressed = 1 , # [ doc ( hidden ) ] __nonexhaustive , } impl key_state { pub fn from_raw ( n : u32 ) -> Option < key_state > { match n { 0 => Some ( key_state :: released ) , 1 => Some ( key_state :: pressed ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_keyboard_requests : [ wl_message ; 1 ] = [ wl_message { name : b"release\0" as * const u8 as * const c_char , signature : b"3\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; static mut wl_keyboard_events_enter_types : [ * const wl_interface ; 3 ] = [ NULLPTR as * const wl_interface , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , ] ; static mut wl_keyboard_events_leave_types : [ * const wl_interface ; 2 ] = [ NULLPTR as * const wl_interface , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_keyboard_events : [ wl_message ; 6 ] = [ wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"enter\0" as * const u8 as * const c_char , signature : b"uoa\0" as * const u8 as * const c_char , types : unsafe { & wl_keyboard_events_enter_types as * const _ } , } , wl_message { name : b"leave\0" as * const u8 as * const c_char , signature : b"uo\0" as * const u8 as * const c_char , types : unsafe { & wl_keyboard_events_leave_types as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"repeat_info\0" as * const u8 as * const c_char , signature : b"4ii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut wl_keyboard_interface : wl_interface = wl_interface { name : b"wl_keyboard\0" as * const u8 as * const c_char , version : 6 , request_count : 1 , requests : unsafe { & wl_keyboard_requests as * const _ } , event_count : 6 , events : unsafe { & wl_keyboard_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait wl_keyboard_listener { # [ doc = "keyboard mapping\n\nThis event provides a file descriptor to the client which can be\nmemory-mapped to provide a keyboard mapping description." ] fn keymap ( & mut self , object : * mut wl_keyboard , format : keymap_format , fd : :: std :: os :: unix :: io :: RawFd , size : u32 ) { } # [ doc = "enter event\n\nNotification that this seat's keyboard focus is on a certain\nsurface." ] fn enter ( & mut self , object : * mut wl_keyboard , serial : u32 , surface : * mut super :: wl_surface :: wl_surface , keys : * mut wl_array ) { } # [ doc = "leave event\n\nNotification that this seat's keyboard focus is no longer on\na certain surface.\n\nThe leave notification is sent before the enter notification\nfor the new focus." ] fn leave ( & mut self , object : * mut wl_keyboard , serial : u32 , surface : * mut super :: wl_surface :: wl_surface ) { } # [ doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond\ngranularity, with an undefined base." ] fn key ( & mut self , object : * mut wl_keyboard , serial : u32 , time : u32 , key : u32 , state : key_state ) { } # [ doc = "modifier and group state\n\nNotifies clients that the modifier and/or group state has\nchanged, and it should update its local state." ] fn modifiers ( & mut self , object : * mut wl_keyboard , serial : u32 , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 ) { } # [ doc = "repeat rate and delay\n\nInforms the client about the keyboard's repeat rate and delay.\n\nThis event is sent as soon as the wl_keyboard object has been created,\nand is guaranteed to be received by the client before any key press\nevent.\n\nNegative values for either rate or delay are illegal. A rate of zero\nwill disable any repeating (regardless of the value of delay).\n\nThis event can be sent later on as well with a new value if necessary,\nso clients should continue listening for the event past the creation\nof wl_keyboard.\n\nOnly available since version 4 of the interface." ] fn repeat_info ( & mut self , object : * mut wl_keyboard , rate : i32 , delay : i32 ) { } } pub unsafe fn wl_keyboard_set_user_data ( wl_keyboard : * mut super :: wl_keyboard :: wl_keyboard , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , wl_keyboard as _ , user_data ) ; } pub unsafe fn wl_keyboard_get_user_data ( wl_keyboard : * mut super :: wl_keyboard :: wl_keyboard ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , wl_keyboard as _ ) ; } pub unsafe fn wl_keyboard_get_version ( wl_keyboard : * mut super :: wl_keyboard :: wl_keyboard ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , wl_keyboard as _ ) ; } pub unsafe fn wl_keyboard_add_listener ( wl_keyboard : * mut super :: wl_keyboard :: wl_keyboard , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , wl_keyboard as _ , listener as _ , data as _ ) ; } pub unsafe fn wl_keyboard_add_rust_listener ( wl_keyboard : * mut super :: wl_keyboard :: wl_keyboard , listener : & dyn wl_keyboard_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return wl_keyboard_add_listener ( wl_keyboard as _ , fp as _ , op as _ ) == 0 ; } pub unsafe fn wl_keyboard_destroy ( wl_keyboard : * mut super :: wl_keyboard :: wl_keyboard ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , wl_keyboard as _ ) ; } # [ doc = "release the keyboard object" ] pub unsafe fn wl_keyboard_release ( wl_keyboard : * mut super :: wl_keyboard :: wl_keyboard ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_keyboard as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , wl_keyboard as _ ) ; } } # [ doc = "touchscreen input device\n\nThe wl_touch interface represents a touchscreen\nassociated with a seat.\n\nTouch interactions can consist of one or more contacts.\nFor each contact, a series of events is generated, starting\nwith a down event, followed by zero or more motion events,\nand ending with an up event. Events relating to the same\ncontact point can be identified by the ID of the sequence." ] pub mod wl_touch { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum wl_touch { } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_touch_requests : [ wl_message ; 1 ] = [ wl_message { name : b"release\0" as * const u8 as * const c_char , signature : b"3\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; static mut wl_touch_events_down_types : [ * const wl_interface ; 6 ] = [ NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_touch_events : [ wl_message ; 7 ] = [ wl_message { name : b"down\0" as * const u8 as * const c_char , signature : b"uuoiff\0" as * const u8 as * const c_char , types : unsafe { & wl_touch_events_down_types as * const _ } , } , wl_message { name : b"up\0" as * const u8 as * const c_char , signature : b"uui\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"motion\0" as * const u8 as * const c_char , signature : b"uiff\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"frame\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"cancel\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"shape\0" as * const u8 as * const c_char , signature : b"6iff\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"orientation\0" as * const u8 as * const c_char , signature : b"6if\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut wl_touch_interface : wl_interface = wl_interface { name : b"wl_touch\0" as * const u8 as * const c_char , version : 6 , request_count : 1 , requests : unsafe { & wl_touch_requests as * const _ } , event_count : 7 , events : unsafe { & wl_touch_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait wl_touch_listener { # [ doc = "touch down event and beginning of a touch sequence\n\nA new touch point has appeared on the surface. This touch point is\nassigned a unique ID. Future events from this touch point reference\nthis ID. The ID ceases to be valid after a touch up event and may be\nreused in the future." ] fn down ( & mut self , object : * mut wl_touch , serial : u32 , time : u32 , surface : * mut super :: wl_surface :: wl_surface , id : i32 , x : wl_fixed_t , y : wl_fixed_t ) { } # [ doc = "end of a touch event sequence\n\nThe touch point has disappeared. No further events will be sent for\nthis touch point and the touch point's ID is released and may be\nreused in a future touch down event." ] fn up ( & mut self , object : * mut wl_touch , serial : u32 , time : u32 , id : i32 ) { } # [ doc = "update of touch point coordinates\n\nA touch point has changed coordinates." ] fn motion ( & mut self , object : * mut wl_touch , time : u32 , id : i32 , x : wl_fixed_t , y : wl_fixed_t ) { } # [ doc = "end of touch frame event\n\nIndicates the end of a set of events that logically belong together.\nA client is expected to accumulate the data in all events within the\nframe before proceeding.\n\nA wl_touch.frame terminates at least one event but otherwise no\nguarantee is provided about the set of events within a frame. A client\nmust assume that any state not updated in a frame is unchanged from the\npreviously known state." ] fn frame ( & mut self , object : * mut wl_touch , ) { } # [ doc = "touch session cancelled\n\nSent if the compositor decides the touch stream is a global\ngesture. No further events are sent to the clients from that\nparticular gesture. Touch cancellation applies to all touch points\ncurrently active on this client's surface. The client is\nresponsible for finalizing the touch points, future touch points on\nthis surface may reuse the touch point ID." ] fn cancel ( & mut self , object : * mut wl_touch , ) { } # [ doc = "update shape of touch point\n\nSent when a touchpoint has changed its shape.\n\nThis event does not occur on its own. It is sent before a\nwl_touch.frame event and carries the new shape information for\nany previously reported, or new touch points of that frame.\n\nOther events describing the touch point such as wl_touch.down,\nwl_touch.motion or wl_touch.orientation may be sent within the\nsame wl_touch.frame. A client should treat these events as a single\nlogical touch point update. The order of wl_touch.shape,\nwl_touch.orientation and wl_touch.motion is not guaranteed.\nA wl_touch.down event is guaranteed to occur before the first\nwl_touch.shape event for this touch ID but both events may occur within\nthe same wl_touch.frame.\n\nA touchpoint shape is approximated by an ellipse through the major and\nminor axis length. The major axis length describes the longer diameter\nof the ellipse, while the minor axis length describes the shorter\ndiameter. Major and minor are orthogonal and both are specified in\nsurface-local coordinates. The center of the ellipse is always at the\ntouchpoint location as reported by wl_touch.down or wl_touch.move.\n\nThis event is only sent by the compositor if the touch device supports\nshape reports. The client has to make reasonable assumptions about the\nshape if it did not receive this event.\n\nOnly available since version 6 of the interface." ] fn shape ( & mut self , object : * mut wl_touch , id : i32 , major : wl_fixed_t , minor : wl_fixed_t ) { } # [ doc = "update orientation of touch point\n\nSent when a touchpoint has changed its orientation.\n\nThis event does not occur on its own. It is sent before a\nwl_touch.frame event and carries the new shape information for\nany previously reported, or new touch points of that frame.\n\nOther events describing the touch point such as wl_touch.down,\nwl_touch.motion or wl_touch.shape may be sent within the\nsame wl_touch.frame. A client should treat these events as a single\nlogical touch point update. The order of wl_touch.shape,\nwl_touch.orientation and wl_touch.motion is not guaranteed.\nA wl_touch.down event is guaranteed to occur before the first\nwl_touch.orientation event for this touch ID but both events may occur\nwithin the same wl_touch.frame.\n\nThe orientation describes the clockwise angle of a touchpoint's major\naxis to the positive surface y-axis and is normalized to the -180 to\n+180 degree range. The granularity of orientation depends on the touch\ndevice, some devices only support binary rotation values between 0 and\n90 degrees.\n\nThis event is only sent by the compositor if the touch device supports\norientation reports.\n\nOnly available since version 6 of the interface." ] fn orientation ( & mut self , object : * mut wl_touch , id : i32 , orientation : wl_fixed_t ) { } } pub unsafe fn wl_touch_set_user_data ( wl_touch : * mut super :: wl_touch :: wl_touch , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , wl_touch as _ , user_data ) ; } pub unsafe fn wl_touch_get_user_data ( wl_touch : * mut super :: wl_touch :: wl_touch ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , wl_touch as _ ) ; } pub unsafe fn wl_touch_get_version ( wl_touch : * mut super :: wl_touch :: wl_touch ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , wl_touch as _ ) ; } pub unsafe fn wl_touch_add_listener ( wl_touch : * mut super :: wl_touch :: wl_touch , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , wl_touch as _ , listener as _ , data as _ ) ; } pub unsafe fn wl_touch_add_rust_listener ( wl_touch : * mut super :: wl_touch :: wl_touch , listener : & dyn wl_touch_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return wl_touch_add_listener ( wl_touch as _ , fp as _ , op as _ ) == 0 ; } pub unsafe fn wl_touch_destroy ( wl_touch : * mut super :: wl_touch :: wl_touch ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , wl_touch as _ ) ; } # [ doc = "release the touch object" ] pub unsafe fn wl_touch_release ( wl_touch : * mut super :: wl_touch :: wl_touch ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_touch as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , wl_touch as _ ) ; } } # [ doc = "compositor output region\n\nAn output describes part of the compositor geometry.  The\ncompositor works in the 'compositor coordinate system' and an\noutput corresponds to a rectangular area in that space that is\nactually visible.  This typically corresponds to a monitor that\ndisplays part of the compositor space.  This object is published\nas global during start up, or when a monitor is hotplugged." ] pub mod wl_output { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum wl_output { } # [ doc = "subpixel geometry information\n\nThis enumeration describes how the physical\npixels on an output are laid out." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum subpixel { # [ doc = "unknown geometry" ] unknown = 0 , # [ doc = "no geometry" ] none = 1 , # [ doc = "horizontal RGB" ] horizontal_rgb = 2 , # [ doc = "horizontal BGR" ] horizontal_bgr = 3 , # [ doc = "vertical RGB" ] vertical_rgb = 4 , # [ doc = "vertical BGR" ] vertical_bgr = 5 , # [ doc ( hidden ) ] __nonexhaustive , } impl subpixel { pub fn from_raw ( n : u32 ) -> Option < subpixel > { match n { 0 => Some ( subpixel :: unknown ) , 1 => Some ( subpixel :: none ) , 2 => Some ( subpixel :: horizontal_rgb ) , 3 => Some ( subpixel :: horizontal_bgr ) , 4 => Some ( subpixel :: vertical_rgb ) , 5 => Some ( subpixel :: vertical_bgr ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } # [ doc = "transform from framebuffer to output\n\nThis describes the transform that a compositor will apply to a\nsurface to compensate for the rotation or mirroring of an\noutput device.\n\nThe flipped values correspond to an initial flip around a\nvertical axis followed by rotation.\n\nThe purpose is mainly to allow clients to render accordingly and\ntell the compositor, so that for fullscreen surfaces, the\ncompositor will still be able to scan out directly from client\nsurfaces." ] # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum transform { # [ doc = "no transform" ] normal = 0 , # [ doc = "90 degrees counter-clockwise" ] _90 = 1 , # [ doc = "180 degrees counter-clockwise" ] _180 = 2 , # [ doc = "270 degrees counter-clockwise" ] _270 = 3 , # [ doc = "180 degree flip around a vertical axis" ] flipped = 4 , # [ doc = "flip and rotate 90 degrees counter-clockwise" ] flipped_90 = 5 , # [ doc = "flip and rotate 180 degrees counter-clockwise" ] flipped_180 = 6 , # [ doc = "flip and rotate 270 degrees counter-clockwise" ] flipped_270 = 7 , # [ doc ( hidden ) ] __nonexhaustive , } impl transform { pub fn from_raw ( n : u32 ) -> Option < transform > { match n { 0 => Some ( transform :: normal ) , 1 => Some ( transform :: _90 ) , 2 => Some ( transform :: _180 ) , 3 => Some ( transform :: _270 ) , 4 => Some ( transform :: flipped ) , 5 => Some ( transform :: flipped_90 ) , 6 => Some ( transform :: flipped_180 ) , 7 => Some ( transform :: flipped_270 ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } bitflags ! { # [ doc = "mode information\n\nThese flags describe properties of an output mode.\nThey are used in the flags bitfield of the mode event." ] pub struct mode : u32 { # [ doc = "indicates this is the current mode" ] const current = 1 ; # [ doc = "indicates this is the preferred mode" ] const preferred = 2 ; } } impl mode { pub fn from_raw ( n : u32 ) -> Option < mode > { Some ( mode :: from_bits_truncate ( n ) ) } pub fn to_raw ( & self ) -> u32 { self . bits ( ) } } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_output_requests : [ wl_message ; 1 ] = [ wl_message { name : b"release\0" as * const u8 as * const c_char , signature : b"3\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_output_events : [ wl_message ; 4 ] = [ wl_message { name : b"geometry\0" as * const u8 as * const c_char , signature : b"iiiiissi\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"uiii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"scale\0" as * const u8 as * const c_char , signature : b"2i\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut wl_output_interface : wl_interface = wl_interface { name : b"wl_output\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & wl_output_requests as * const _ } , event_count : 4 , events : unsafe { & wl_output_events as * const _ } , } ; # [ doc = r" An interface for handling events." ] pub trait wl_output_listener { # [ doc = "properties of the output\n\nThe geometry event describes geometric properties of the output.\nThe event is sent when binding to the output object and whenever\nany of the properties change.\n\nThe physical size can be set to zero if it doesn't make sense for this\noutput (e.g. for projectors or virtual outputs)." ] fn geometry ( & mut self , object : * mut wl_output , x : i32 , y : i32 , physical_width : i32 , physical_height : i32 , subpixel : subpixel , make : * mut c_char , model : * mut c_char , transform : transform ) { } # [ doc = "advertise available modes for the output\n\nThe mode event describes an available mode for the output.\n\nThe event is sent when binding to the output object and there\nwill always be one mode, the current mode.  The event is sent\nagain if an output changes mode, for the mode that is now\ncurrent.  In other words, the current mode is always the last\nmode that was received with the current flag set.\n\nThe size of a mode is given in physical hardware units of\nthe output device. This is not necessarily the same as\nthe output size in the global compositor space. For instance,\nthe output may be scaled, as described in wl_output.scale,\nor transformed, as described in wl_output.transform." ] fn mode ( & mut self , object : * mut wl_output , flags : mode , width : i32 , height : i32 , refresh : i32 ) { } # [ doc = "sent all information about output\n\nThis event is sent after all other properties have been\nsent after binding to the output object and after any\nother property changes done after that. This allows\nchanges to the output properties to be seen as\natomic, even if they happen via multiple events.\n\nOnly available since version 2 of the interface." ] fn done ( & mut self , object : * mut wl_output , ) { } # [ doc = "output scaling properties\n\nThis event contains scaling geometry information\nthat is not in the geometry event. It may be sent after\nbinding the output object or if the output scale changes\nlater. If it is not sent, the client should assume a\nscale of 1.\n\nA scale larger than 1 means that the compositor will\nautomatically scale surface buffers by this amount\nwhen rendering. This is used for very high resolution\ndisplays where applications rendering at the native\nresolution would be too small to be legible.\n\nIt is intended that scaling aware clients track the\ncurrent output of a surface, and if it is on a scaled\noutput it should use wl_surface.set_buffer_scale with\nthe scale of the output. That way the compositor can\navoid scaling the surface, and the client can supply\na higher detail image.\n\nOnly available since version 2 of the interface." ] fn scale ( & mut self , object : * mut wl_output , factor : i32 ) { } } pub unsafe fn wl_output_set_user_data ( wl_output : * mut super :: wl_output :: wl_output , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , wl_output as _ , user_data ) ; } pub unsafe fn wl_output_get_user_data ( wl_output : * mut super :: wl_output :: wl_output ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , wl_output as _ ) ; } pub unsafe fn wl_output_get_version ( wl_output : * mut super :: wl_output :: wl_output ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , wl_output as _ ) ; } pub unsafe fn wl_output_add_listener ( wl_output : * mut super :: wl_output :: wl_output , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , wl_output as _ , listener as _ , data as _ ) ; } pub unsafe fn wl_output_add_rust_listener ( wl_output : * mut super :: wl_output :: wl_output , listener : & dyn wl_output_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return wl_output_add_listener ( wl_output as _ , fp as _ , op as _ ) == 0 ; } pub unsafe fn wl_output_destroy ( wl_output : * mut super :: wl_output :: wl_output ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , wl_output as _ ) ; } # [ doc = "release the output object\n\nUsing this request a client can tell the server that it is not going to\nuse the output object anymore." ] pub unsafe fn wl_output_release ( wl_output : * mut super :: wl_output :: wl_output ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_output as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , wl_output as _ ) ; } } # [ doc = "region interface\n\nA region object describes an area.\n\nRegion objects are used to describe the opaque and input\nregions of a surface." ] pub mod wl_region { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum wl_region { } # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_region_requests : [ wl_message ; 3 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"add\0" as * const u8 as * const c_char , signature : b"iiii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"subtract\0" as * const u8 as * const c_char , signature : b"iiii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut wl_region_interface : wl_interface = wl_interface { name : b"wl_region\0" as * const u8 as * const c_char , version : 1 , request_count : 3 , requests : unsafe { & wl_region_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait wl_region_listener { } pub unsafe fn wl_region_set_user_data ( wl_region : * mut super :: wl_region :: wl_region , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , wl_region as _ , user_data ) ; } pub unsafe fn wl_region_get_user_data ( wl_region : * mut super :: wl_region :: wl_region ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , wl_region as _ ) ; } pub unsafe fn wl_region_get_version ( wl_region : * mut super :: wl_region :: wl_region ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , wl_region as _ ) ; } pub unsafe fn wl_region_add_listener ( wl_region : * mut super :: wl_region :: wl_region , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , wl_region as _ , listener as _ , data as _ ) ; } pub unsafe fn wl_region_add_rust_listener ( wl_region : * mut super :: wl_region :: wl_region , listener : & dyn wl_region_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return wl_region_add_listener ( wl_region as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "destroy region\n\nDestroy the region.  This will invalidate the object ID." ] pub unsafe fn wl_region_destroy ( wl_region : * mut super :: wl_region :: wl_region ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_region as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , wl_region as _ ) ; } # [ doc = "add rectangle to region\n\nAdd the specified rectangle to the region." ] pub unsafe fn wl_region_add ( wl_region : * mut super :: wl_region :: wl_region , x : i32 , y : i32 , width : i32 , height : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_region as _ , 1u32 , x , y , width , height , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "subtract rectangle from region\n\nSubtract the specified rectangle from the region." ] pub unsafe fn wl_region_subtract ( wl_region : * mut super :: wl_region :: wl_region , x : i32 , y : i32 , width : i32 , height : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_region as _ , 2u32 , x , y , width , height , std :: ptr :: null :: < c_void > ( ) ) ; } } # [ doc = "sub-surface compositing\n\nThe global interface exposing sub-surface compositing capabilities.\nA wl_surface, that has sub-surfaces associated, is called the\nparent surface. Sub-surfaces can be arbitrarily nested and create\na tree of sub-surfaces.\n\nThe root surface in a tree of sub-surfaces is the main\nsurface. The main surface cannot be a sub-surface, because\nsub-surfaces must always have a parent.\n\nA main surface with its sub-surfaces forms a (compound) window.\nFor window management purposes, this set of wl_surface objects is\nto be considered as a single window, and it should also behave as\nsuch.\n\nThe aim of sub-surfaces is to offload some of the compositing work\nwithin a window from clients to the compositor. A prime example is\na video player with decorations and video in separate wl_surface\nobjects. This should allow the compositor to pass YUV video buffer\nprocessing to dedicated overlay hardware when possible." ] pub mod wl_subcompositor { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum wl_subcompositor { } # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum error { # [ doc = "the to-be sub-surface is invalid" ] bad_surface = 0 , # [ doc ( hidden ) ] __nonexhaustive , } impl error { pub fn from_raw ( n : u32 ) -> Option < error > { match n { 0 => Some ( error :: bad_surface ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } static mut wl_subcompositor_requests_get_subsurface_types : [ * const wl_interface ; 3 ] = [ unsafe { & super :: wl_subsurface :: wl_subsurface_interface as * const wl_interface } , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_subcompositor_requests : [ wl_message ; 2 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_subsurface\0" as * const u8 as * const c_char , signature : b"noo\0" as * const u8 as * const c_char , types : unsafe { & wl_subcompositor_requests_get_subsurface_types as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut wl_subcompositor_interface : wl_interface = wl_interface { name : b"wl_subcompositor\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & wl_subcompositor_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait wl_subcompositor_listener { } pub unsafe fn wl_subcompositor_set_user_data ( wl_subcompositor : * mut super :: wl_subcompositor :: wl_subcompositor , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , wl_subcompositor as _ , user_data ) ; } pub unsafe fn wl_subcompositor_get_user_data ( wl_subcompositor : * mut super :: wl_subcompositor :: wl_subcompositor ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , wl_subcompositor as _ ) ; } pub unsafe fn wl_subcompositor_get_version ( wl_subcompositor : * mut super :: wl_subcompositor :: wl_subcompositor ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , wl_subcompositor as _ ) ; } pub unsafe fn wl_subcompositor_add_listener ( wl_subcompositor : * mut super :: wl_subcompositor :: wl_subcompositor , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , wl_subcompositor as _ , listener as _ , data as _ ) ; } pub unsafe fn wl_subcompositor_add_rust_listener ( wl_subcompositor : * mut super :: wl_subcompositor :: wl_subcompositor , listener : & dyn wl_subcompositor_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return wl_subcompositor_add_listener ( wl_subcompositor as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "unbind from the subcompositor interface\n\nInforms the server that the client will not be using this\nprotocol object anymore. This does not affect any other\nobjects, wl_subsurface objects included." ] pub unsafe fn wl_subcompositor_destroy ( wl_subcompositor : * mut super :: wl_subcompositor :: wl_subcompositor ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_subcompositor as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , wl_subcompositor as _ ) ; } # [ doc = "give a surface the role sub-surface\n\nCreate a sub-surface interface for the given surface, and\nassociate it with the given parent surface. This turns a\nplain wl_surface into a sub-surface.\n\nThe to-be sub-surface must not already have another role, and it\nmust not have an existing wl_subsurface object. Otherwise a protocol\nerror is raised.\n\nAdding sub-surfaces to a parent is a double-buffered operation on the\nparent (see wl_surface.commit). The effect of adding a sub-surface\nbecomes visible on the next time the state of the parent surface is\napplied.\n\nThis request modifies the behaviour of wl_surface.commit request on\nthe sub-surface, see the documentation on wl_subsurface interface." ] pub unsafe fn wl_subcompositor_get_subsurface ( wl_subcompositor : * mut super :: wl_subcompositor :: wl_subcompositor , surface : * mut super :: wl_surface :: wl_surface , parent : * mut super :: wl_surface :: wl_surface ) -> * mut super :: wl_subsurface :: wl_subsurface { let r = ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal_constructor , wl_subcompositor as _ , 1u32 , & super :: wl_subsurface :: wl_subsurface_interface as * const _ , std :: ptr :: null :: < c_void > ( ) , surface , parent ) ; return r as _ ; } } # [ doc = "sub-surface interface to a wl_surface\n\nAn additional interface to a wl_surface object, which has been\nmade a sub-surface. A sub-surface has one parent surface. A\nsub-surface's size and position are not limited to that of the parent.\nParticularly, a sub-surface is not automatically clipped to its\nparent's area.\n\nA sub-surface becomes mapped, when a non-NULL wl_buffer is applied\nand the parent surface is mapped. The order of which one happens\nfirst is irrelevant. A sub-surface is hidden if the parent becomes\nhidden, or if a NULL wl_buffer is applied. These rules apply\nrecursively through the tree of surfaces.\n\nThe behaviour of a wl_surface.commit request on a sub-surface\ndepends on the sub-surface's mode. The possible modes are\nsynchronized and desynchronized, see methods\nwl_subsurface.set_sync and wl_subsurface.set_desync. Synchronized\nmode caches the wl_surface state to be applied when the parent's\nstate gets applied, and desynchronized mode applies the pending\nwl_surface state directly. A sub-surface is initially in the\nsynchronized mode.\n\nSub-surfaces have also other kind of state, which is managed by\nwl_subsurface requests, as opposed to wl_surface requests. This\nstate includes the sub-surface position relative to the parent\nsurface (wl_subsurface.set_position), and the stacking order of\nthe parent and its sub-surfaces (wl_subsurface.place_above and\n.place_below). This state is applied when the parent surface's\nwl_surface state is applied, regardless of the sub-surface's mode.\nAs the exception, set_sync and set_desync are effective immediately.\n\nThe main surface can be thought to be always in desynchronized mode,\nsince it does not have a parent in the sub-surfaces sense.\n\nEven if a sub-surface is in desynchronized mode, it will behave as\nin synchronized mode, if its parent surface behaves as in\nsynchronized mode. This rule is applied recursively throughout the\ntree of surfaces. This means, that one can set a sub-surface into\nsynchronized mode, and then assume that all its child and grand-child\nsub-surfaces are synchronized, too, without explicitly setting them.\n\nIf the wl_surface associated with the wl_subsurface is destroyed, the\nwl_subsurface object becomes inert. Note, that destroying either object\ntakes effect immediately. If you need to synchronize the removal\nof a sub-surface to the parent surface update, unmap the sub-surface\nfirst by attaching a NULL wl_buffer, update parent, and then destroy\nthe sub-surface.\n\nIf the parent wl_surface object is destroyed, the sub-surface is\nunmapped." ] pub mod wl_subsurface { use std :: os :: raw :: { c_char , c_void , c_int } ; use super :: super :: { types_null , NULLPTR } ; use super :: super :: super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message , wl_fixed_t } ; use super :: super :: super :: sys :: client :: * ; pub enum wl_subsurface { } # [ repr ( u32 ) ] # [ derive ( Copy , Clone , Debug , PartialEq ) ] pub enum error { # [ doc = "wl_surface is not a sibling or the parent" ] bad_surface = 0 , # [ doc ( hidden ) ] __nonexhaustive , } impl error { pub fn from_raw ( n : u32 ) -> Option < error > { match n { 0 => Some ( error :: bad_surface ) , _ => Option :: None } } pub fn to_raw ( & self ) -> u32 { * self as u32 } } static mut wl_subsurface_requests_place_above_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , ] ; static mut wl_subsurface_requests_place_below_types : [ * const wl_interface ; 1 ] = [ unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , ] ; # [ doc = r" C-representation of the messages of this interface, for interop" ] pub static mut wl_subsurface_requests : [ wl_message ; 6 ] = [ wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_position\0" as * const u8 as * const c_char , signature : b"ii\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"place_above\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & wl_subsurface_requests_place_above_types as * const _ } , } , wl_message { name : b"place_below\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & wl_subsurface_requests_place_below_types as * const _ } , } , wl_message { name : b"set_sync\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_desync\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , ] ; # [ doc = r" C representation of this interface, for interop" ] pub static mut wl_subsurface_interface : wl_interface = wl_interface { name : b"wl_subsurface\0" as * const u8 as * const c_char , version : 1 , request_count : 6 , requests : unsafe { & wl_subsurface_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; # [ doc = r" An interface for handling events." ] pub trait wl_subsurface_listener { } pub unsafe fn wl_subsurface_set_user_data ( wl_subsurface : * mut super :: wl_subsurface :: wl_subsurface , user_data : * mut c_void ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_set_user_data , wl_subsurface as _ , user_data ) ; } pub unsafe fn wl_subsurface_get_user_data ( wl_subsurface : * mut super :: wl_subsurface :: wl_subsurface ) -> * mut c_void { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_user_data , wl_subsurface as _ ) ; } pub unsafe fn wl_subsurface_get_version ( wl_subsurface : * mut super :: wl_subsurface :: wl_subsurface ) -> u32 { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_get_version , wl_subsurface as _ ) ; } pub unsafe fn wl_subsurface_add_listener ( wl_subsurface : * mut super :: wl_subsurface :: wl_subsurface , listener : * mut c_void , data : * mut c_void ) -> c_int { return ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_add_listener , wl_subsurface as _ , listener as _ , data as _ ) ; } pub unsafe fn wl_subsurface_add_rust_listener ( wl_subsurface : * mut super :: wl_subsurface :: wl_subsurface , listener : & dyn wl_subsurface_listener ) -> bool { let to : std :: raw :: TraitObject = std :: mem :: transmute ( listener ) ; let op = to . data ; let fp = std :: mem :: transmute :: < _ , * mut c_void > ( std :: mem :: transmute :: < _ , usize > ( to . vtable ) + ( 3 * std :: mem :: size_of :: < usize > ( ) ) ) ; return wl_subsurface_add_listener ( wl_subsurface as _ , fp as _ , op as _ ) == 0 ; } # [ doc = "remove sub-surface interface\n\nThe sub-surface interface is removed from the wl_surface object\nthat was turned into a sub-surface with a\nwl_subcompositor.get_subsurface request. The wl_surface's association\nto the parent is deleted, and the wl_surface loses its role as\na sub-surface. The wl_surface is unmapped immediately." ] pub unsafe fn wl_subsurface_destroy ( wl_subsurface : * mut super :: wl_subsurface :: wl_subsurface ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_subsurface as _ , 0u32 , std :: ptr :: null :: < c_void > ( ) ) ; ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_destroy , wl_subsurface as _ ) ; } # [ doc = "reposition the sub-surface\n\nThis schedules a sub-surface position change.\nThe sub-surface will be moved so that its origin (top left\ncorner pixel) will be at the location x, y of the parent surface\ncoordinate system. The coordinates are not restricted to the parent\nsurface area. Negative values are allowed.\n\nThe scheduled coordinates will take effect whenever the state of the\nparent surface is applied. When this happens depends on whether the\nparent surface is in synchronized mode or not. See\nwl_subsurface.set_sync and wl_subsurface.set_desync for details.\n\nIf more than one set_position request is invoked by the client before\nthe commit of the parent surface, the position of a new request always\nreplaces the scheduled position from any previous request.\n\nThe initial position is 0, 0." ] pub unsafe fn wl_subsurface_set_position ( wl_subsurface : * mut super :: wl_subsurface :: wl_subsurface , x : i32 , y : i32 ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_subsurface as _ , 1u32 , x , y , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "restack the sub-surface\n\nThis sub-surface is taken from the stack, and put back just\nabove the reference surface, changing the z-order of the sub-surfaces.\nThe reference surface must be one of the sibling surfaces, or the\nparent surface. Using any other surface, including this sub-surface,\nwill cause a protocol error.\n\nThe z-order is double-buffered. Requests are handled in order and\napplied immediately to a pending state. The final pending state is\ncopied to the active state the next time the state of the parent\nsurface is applied. When this happens depends on whether the parent\nsurface is in synchronized mode or not. See wl_subsurface.set_sync and\nwl_subsurface.set_desync for details.\n\nA new sub-surface is initially added as the top-most in the stack\nof its siblings and parent." ] pub unsafe fn wl_subsurface_place_above ( wl_subsurface : * mut super :: wl_subsurface :: wl_subsurface , sibling : * mut super :: wl_surface :: wl_surface ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_subsurface as _ , 2u32 , sibling , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "restack the sub-surface\n\nThe sub-surface is placed just below the reference surface.\nSee wl_subsurface.place_above." ] pub unsafe fn wl_subsurface_place_below ( wl_subsurface : * mut super :: wl_subsurface :: wl_subsurface , sibling : * mut super :: wl_surface :: wl_surface ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_subsurface as _ , 3u32 , sibling , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set sub-surface to synchronized mode\n\nChange the commit behaviour of the sub-surface to synchronized\nmode, also described as the parent dependent mode.\n\nIn synchronized mode, wl_surface.commit on a sub-surface will\naccumulate the committed state in a cache, but the state will\nnot be applied and hence will not change the compositor output.\nThe cached state is applied to the sub-surface immediately after\nthe parent surface's state is applied. This ensures atomic\nupdates of the parent and all its synchronized sub-surfaces.\nApplying the cached state will invalidate the cache, so further\nparent surface commits do not (re-)apply old state.\n\nSee wl_subsurface for the recursive effect of this mode." ] pub unsafe fn wl_subsurface_set_sync ( wl_subsurface : * mut super :: wl_subsurface :: wl_subsurface ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_subsurface as _ , 4u32 , std :: ptr :: null :: < c_void > ( ) ) ; } # [ doc = "set sub-surface to desynchronized mode\n\nChange the commit behaviour of the sub-surface to desynchronized\nmode, also described as independent or freely running mode.\n\nIn desynchronized mode, wl_surface.commit on a sub-surface will\napply the pending state directly, without caching, as happens\nnormally with a wl_surface. Calling wl_surface.commit on the\nparent surface has no effect on the sub-surface's wl_surface\nstate. This mode allows a sub-surface to be updated on its own.\n\nIf cached state exists when wl_surface.commit is called in\ndesynchronized mode, the pending state is added to the cached\nstate, and applied as a whole. This invalidates the cache.\n\nNote: even if a sub-surface is set to desynchronized, a parent\nsub-surface may override it to behave as synchronized. For details,\nsee wl_subsurface.\n\nIf a surface's parent surface behaves as desynchronized, then\nthe cached state is applied on set_desync." ] pub unsafe fn wl_subsurface_set_desync ( wl_subsurface : * mut super :: wl_subsurface :: wl_subsurface ) { ffi_dispatch ! ( WAYLAND_CLIENT_HANDLE , wl_proxy_marshal , wl_subsurface as _ , 5u32 , std :: ptr :: null :: < c_void > ( ) ) ; } } }