package wayland

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file relative_pointer_unstable_v1_client.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
(* This file was generated automatically by wayland-scanner-ocaml *)

[@@@ocaml.warning "-27"]
open struct
  module Imports = struct
    include Relative_pointer_unstable_v1_proto
    include Wayland.Wayland_proto
  end
  
  module Proxy = Wayland.Proxy
  module Msg = Wayland.Msg
  module Fixed = Wayland.Fixed
  module Iface_reg = Wayland.Iface_reg
  module S = Wayland.S
end


(** Get relative pointer objects.
    
    A global interface used for getting the relative pointer object for a
    given pointer. *)
module Zwp_relative_pointer_manager_v1 = struct
  type 'v t = ([`Zwp_relative_pointer_manager_v1], 'v, [`Client]) Proxy.t
  
  (** {2 Version 1} *)
  
  (** Get a relative pointer object.
      
      Create a relative pointer interface given a wl_pointer object. See the
      wp_relative_pointer interface for more details. *)
  let get_relative_pointer (_t:([< `V1] as 'v) t) (id:([`Zwp_relative_pointer_v1], 'v, [`Client]) #Proxy.Handler.t) ~(pointer:([`Wl_pointer], _, [`Client]) Proxy.t) =
    let __id = Proxy.spawn _t id in
    let _msg = Proxy.alloc _t ~op:1 ~ints:2 ~strings:[] ~arrays:[] in
    Msg.add_int _msg (Proxy.id __id);
    Msg.add_int _msg (Proxy.id pointer);
    Proxy.send _t _msg;
    __id
  
  (** Destroy the relative pointer manager object.
      
      Used by the client to notify the server that it will no longer use this
      relative pointer manager object. *)
  let destroy (_t:([< `V1] as 'v) t)  =
    let _msg = Proxy.alloc _t ~op:0 ~ints:0 ~strings:[] ~arrays:[] in
    Proxy.send _t _msg;
    Proxy.shutdown_send _t
  
  (**/**)
  class ['v] _handlers_unsafe = object (_self : (_, 'v, _) #Proxy.Handler.t)
    method user_data = S.No_data
    method metadata = (module Relative_pointer_unstable_v1_proto.Zwp_relative_pointer_manager_v1)
    method max_version = 1l
    
    
    method dispatch (_proxy : 'v t) _msg =
      let _proxy = Proxy.cast_version _proxy in
      match Msg.op _msg with
      | _ -> assert false
  end
  (**/**)
  
  (** {2 Handlers}
      Note: Servers will always want to use [v1].
   *)
  
  
  (** Handler for a proxy with version >= 1. *)
  class ['v] v1 = object (_ : (_, 'v, _) #Proxy.Service_handler.t)
    (**/**)
    inherit [[< `V1] as 'v] _handlers_unsafe
    (**/**)
    method min_version = 1l
    method bind_version : [`V1] = `V1
  end
end

(** Relative pointer object.
    
    A wp_relative_pointer object is an extension to the wl_pointer interface
    used for emitting relative pointer events. It shares the same focus as
    wl_pointer objects of the same seat and will only emit events when it has
    focus. *)
module Zwp_relative_pointer_v1 = struct
  type 'v t = ([`Zwp_relative_pointer_v1], 'v, [`Client]) Proxy.t
  
  (** {2 Version 1} *)
  
  (** Release the relative pointer object.
      
       *)
  let destroy (_t:([< `V1] as 'v) t)  =
    let _msg = Proxy.alloc _t ~op:0 ~ints:0 ~strings:[] ~arrays:[] in
    Proxy.send _t _msg;
    Proxy.shutdown_send _t
  
  (**/**)
  class virtual ['v] _handlers_unsafe = object (_self : (_, 'v, _) #Proxy.Handler.t)
    method user_data = S.No_data
    method metadata = (module Relative_pointer_unstable_v1_proto.Zwp_relative_pointer_v1)
    method max_version = 1l
    
    method private virtual on_relative_motion : [> ] t -> utime_hi:int32 -> utime_lo:int32 -> dx:Fixed.t ->
                                                dy:Fixed.t -> dx_unaccel:Fixed.t -> dy_unaccel:Fixed.t -> unit
    
    
    method dispatch (_proxy : 'v t) _msg =
      let _proxy = Proxy.cast_version _proxy in
      match Msg.op _msg with
      | 0 ->
        let utime_hi = Msg.get_int _msg in
        let utime_lo = Msg.get_int _msg in
        let dx = Msg.get_fixed _msg in
        let dy = Msg.get_fixed _msg in
        let dx_unaccel = Msg.get_fixed _msg in
        let dy_unaccel = Msg.get_fixed _msg in
        _self#on_relative_motion _proxy ~utime_hi ~utime_lo ~dx ~dy ~dx_unaccel ~dy_unaccel
      | _ -> assert false
  end
  (**/**)
  
  (** {2 Handlers}
      Note: Servers will always want to use [v1].
   *)
  
  
  (** Handler for a proxy with version >= 1. *)
  class virtual ['v] v1 = object (_ : (_, 'v, _) #Proxy.Service_handler.t)
    (**/**)
    inherit [[< `V1] as 'v] _handlers_unsafe
    (**/**)
    method private virtual on_relative_motion : [> `V1] t -> utime_hi:int32 -> utime_lo:int32 -> dx:Fixed.t ->
                                                dy:Fixed.t -> dx_unaccel:Fixed.t -> dy_unaccel:Fixed.t -> unit
    
    (** Relative pointer motion.
        
        Relative x/y pointer motion from the pointer of the seat associated with
        this object.
        
        A relative motion is in the same dimension as regular wl_pointer motion
        events, except they do not represent an absolute position. For example,
        moving a pointer from (x, y) to (x', y') would have the equivalent
        relative motion (x' - x, y' - y). If a pointer motion caused the
        absolute pointer position to be clipped by for example the edge of the
        monitor, the relative motion is unaffected by the clipping and will
        represent the unclipped motion.
        
        This event also contains non-accelerated motion deltas. The
        non-accelerated delta is, when applicable, the regular pointer motion
        delta as it was before having applied motion acceleration and other
        transformations such as normalization.
        
        Note that the non-accelerated delta does not represent 'raw' events as
        they were read from some device. Pointer motion acceleration is device-
        and configuration-specific and non-accelerated deltas and accelerated
        deltas may have the same value on some devices.
        
        Relative motions are not coupled to wl_pointer.motion events, and can be
        sent in combination with such events, but also independently. There may
        also be scenarios where wl_pointer.motion is sent, but there is no
        relative motion. The order of an absolute and relative motion event
        originating from the same physical motion is not guaranteed.
        
        If the client needs button events or focus state, it can receive them
        from a wl_pointer object of the same seat that the wp_relative_pointer
        object is associated with. *)
    
    method min_version = 1l
  end
end
OCaml

Innovation. Community. Security.