package wayland

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

Source file drm_server.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
169
170
171
172
173
174
175
176
177
178
179
180
(* This file was generated automatically by wayland-scanner-ocaml *)

[@@@ocaml.warning "-27"]
open struct
  module Imports = struct
    include Drm_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


module Wl_drm = struct
  type 'v t = ([`Wl_drm], 'v, [`Server]) Proxy.t
  module Error = Drm_proto.Wl_drm.Error
  
  module Format = Drm_proto.Wl_drm.Format
  
  module Capability = Drm_proto.Wl_drm.Capability
  
  (** {2 Version 1} *)
  
  let capabilities (_t:([< `V1 | `V2] as 'v) t) ~value =
    let _msg = Proxy.alloc _t ~op:3 ~ints:1 ~strings:[] ~arrays:[] in
    Msg.add_int _msg value;
    Proxy.send _t _msg
  
  let authenticated (_t:([< `V1 | `V2] as 'v) t)  =
    let _msg = Proxy.alloc _t ~op:2 ~ints:0 ~strings:[] ~arrays:[] in
    Proxy.send _t _msg
  
  let format (_t:([< `V1 | `V2] as 'v) t) ~format =
    let _msg = Proxy.alloc _t ~op:1 ~ints:1 ~strings:[] ~arrays:[] in
    Msg.add_int _msg format;
    Proxy.send _t _msg
  
  let device (_t:([< `V1 | `V2] as 'v) t) ~name =
    let _msg = Proxy.alloc _t ~op:0 ~ints:1 ~strings:[(Some name)] ~arrays:[] in
    Msg.add_string _msg name;
    Proxy.send _t _msg
  
  
  (** {2 Version 2} *)
  
  (**/**)
  class virtual ['v] _handlers_unsafe = object (_self : (_, 'v, _) #Proxy.Handler.t)
    method user_data = S.No_data
    method metadata = (module Drm_proto.Wl_drm)
    method max_version = 2l
    
    method private virtual on_authenticate : [> ] t -> id:int32 -> unit
    
    method private virtual on_create_buffer : [> ] t -> ([`Wl_buffer], 'v, [`Server]) Proxy.t -> name:int32 ->
                                              width:int32 -> height:int32 -> stride:int32 -> format:int32 -> unit
    
    method private virtual on_create_planar_buffer : [> ] t -> ([`Wl_buffer], 'v, [`Server]) Proxy.t -> name:int32 ->
                                                     width:int32 -> height:int32 -> format:int32 -> offset0:int32 ->
                                                     stride0:int32 -> offset1:int32 -> stride1:int32 ->
                                                     offset2:int32 -> stride2:int32 -> unit
    
    method private virtual on_create_prime_buffer : [> ] t -> ([`Wl_buffer], 'v, [`Server]) Proxy.t ->
                                                    name:Unix.file_descr -> width:int32 -> height:int32 ->
                                                    format:int32 -> offset0:int32 -> stride0:int32 -> offset1:int32 ->
                                                    stride1:int32 -> offset2:int32 -> stride2:int32 -> unit
    
    
    method dispatch (_proxy : 'v t) _msg =
      let _proxy = Proxy.cast_version _proxy in
      match Msg.op _msg with
      | 0 ->
        let id = Msg.get_int _msg in
        _self#on_authenticate _proxy ~id
      | 1 ->
        let id : ([`Wl_buffer], _, _) Proxy.t =
          Msg.get_int _msg |> Proxy.Handler.accept_new _proxy (module Imports.Wl_buffer) in
        let name = Msg.get_int _msg in
        let width = Msg.get_int _msg in
        let height = Msg.get_int _msg in
        let stride = Msg.get_int _msg in
        let format = Msg.get_int _msg in
        _self#on_create_buffer _proxy id ~name ~width ~height ~stride ~format
      | 2 ->
        let id : ([`Wl_buffer], _, _) Proxy.t =
          Msg.get_int _msg |> Proxy.Handler.accept_new _proxy (module Imports.Wl_buffer) in
        let name = Msg.get_int _msg in
        let width = Msg.get_int _msg in
        let height = Msg.get_int _msg in
        let format = Msg.get_int _msg in
        let offset0 = Msg.get_int _msg in
        let stride0 = Msg.get_int _msg in
        let offset1 = Msg.get_int _msg in
        let stride1 = Msg.get_int _msg in
        let offset2 = Msg.get_int _msg in
        let stride2 = Msg.get_int _msg in
        _self#on_create_planar_buffer _proxy id ~name ~width ~height ~format ~offset0 ~stride0 ~offset1 ~stride1
                                             ~offset2 ~stride2
      | 3 ->
        let id : ([`Wl_buffer], _, _) Proxy.t =
          Msg.get_int _msg |> Proxy.Handler.accept_new _proxy (module Imports.Wl_buffer) in
        let name = Msg.get_fd _msg in
        let width = Msg.get_int _msg in
        let height = Msg.get_int _msg in
        let format = Msg.get_int _msg in
        let offset0 = Msg.get_int _msg in
        let stride0 = Msg.get_int _msg in
        let offset1 = Msg.get_int _msg in
        let stride1 = Msg.get_int _msg in
        let offset2 = Msg.get_int _msg in
        let stride2 = Msg.get_int _msg in
        _self#on_create_prime_buffer _proxy id ~name ~width ~height ~format ~offset0 ~stride0 ~offset1 ~stride1
                                            ~offset2 ~stride2
      | _ -> 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 | `V2] as 'v] _handlers_unsafe
    (**/**)
    method private virtual on_authenticate : [> `V1 | `V2] t -> id:int32 -> unit
    
    
    method private virtual on_create_buffer : [> `V1 | `V2] t -> ([`Wl_buffer], 'v, [`Server]) Proxy.t -> name:int32 ->
                                              width:int32 -> height:int32 -> stride:int32 -> format:int32 -> unit
    
    
    method private virtual on_create_planar_buffer : [> `V1 | `V2] t -> ([`Wl_buffer], 'v, [`Server]) Proxy.t ->
                                                     name:int32 -> width:int32 -> height:int32 -> format:int32 ->
                                                     offset0:int32 -> stride0:int32 -> offset1:int32 ->
                                                     stride1:int32 -> offset2:int32 -> stride2:int32 -> unit
    
    
    method private virtual on_create_prime_buffer : [> `V2] t -> ([`Wl_buffer], 'v, [`Server]) Proxy.t ->
                                                    name:Unix.file_descr -> width:int32 -> height:int32 ->
                                                    format:int32 -> offset0:int32 -> stride0:int32 -> offset1:int32 ->
                                                    stride1:int32 -> offset2:int32 -> stride2:int32 -> unit
    
    
    method min_version = 1l
    method bind_version : [`V1] = `V1
  end
  
  (** Handler for a proxy with version >= 2. *)
  class virtual ['v] v2 = object (_ : (_, 'v, _) #Proxy.Service_handler.t)
    (**/**)
    inherit [[< `V2] as 'v] _handlers_unsafe
    (**/**)
    method private virtual on_authenticate : [> `V2] t -> id:int32 -> unit
    
    
    method private virtual on_create_buffer : [> `V2] t -> ([`Wl_buffer], 'v, [`Server]) Proxy.t -> name:int32 ->
                                              width:int32 -> height:int32 -> stride:int32 -> format:int32 -> unit
    
    
    method private virtual on_create_planar_buffer : [> `V2] t -> ([`Wl_buffer], 'v, [`Server]) Proxy.t ->
                                                     name:int32 -> width:int32 -> height:int32 -> format:int32 ->
                                                     offset0:int32 -> stride0:int32 -> offset1:int32 ->
                                                     stride1:int32 -> offset2:int32 -> stride2:int32 -> unit
    
    
    method private virtual on_create_prime_buffer : [> `V2] t -> ([`Wl_buffer], 'v, [`Server]) Proxy.t ->
                                                    name:Unix.file_descr -> width:int32 -> height:int32 ->
                                                    format:int32 -> offset0:int32 -> stride0:int32 -> offset1:int32 ->
                                                    stride1:int32 -> offset2:int32 -> stride2:int32 -> unit
    
    
    method min_version = 2l
    method bind_version : [`V2] = `V2
  end
end
OCaml

Innovation. Community. Security.