package wayland

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

Source file server_decoration_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
(* This file was generated automatically by wayland-scanner-ocaml *)

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


(** Server side window decoration manager.
    
    This interface allows to coordinate whether the server should create
    a server-side window decoration around a wl_surface representing a
    shell surface (wl_shell_surface or similar). By announcing support
    for this interface the server indicates that it supports server
    side decorations. *)
module Org_kde_kwin_server_decoration_manager = struct
  type 'v t = ([`Org_kde_kwin_server_decoration_manager], 'v, [`Client]) Proxy.t
  module Mode = Server_decoration_proto.Org_kde_kwin_server_decoration_manager.Mode
  
  (** {2 Version 1} *)
  
  (** Create a server-side decoration object for a given surface.
      
      When a client creates a server-side decoration object it indicates
      that it supports the protocol. The client is supposed to tell the
      server whether it wants server-side decorations or will provide
      client-side decorations.
      
      If the client does not create a server-side decoration object for
      a surface the server interprets this as lack of support for this
      protocol and considers it as client-side decorated. Nevertheless a
      client-side decorated surface should use this protocol to indicate
      to the server that it does not want a server-side deco. *)
  let create (_t:([< `V1] as 'v) t) (id:([`Org_kde_kwin_server_decoration], 'v, [`Client]) #Proxy.Handler.t) ~(surface:([`Wl_surface], _, [`Client]) Proxy.t) =
    let __id = Proxy.spawn _t id in
    let _msg = Proxy.alloc _t ~op:0 ~ints:2 ~strings:[] ~arrays:[] in
    Msg.add_int _msg (Proxy.id __id);
    Msg.add_int _msg (Proxy.id surface);
    Proxy.send _t _msg;
    __id
  
  (**/**)
  class virtual ['v] _handlers_unsafe = object (_self : (_, 'v, _) #Proxy.Handler.t)
    method user_data = S.No_data
    method metadata = (module Server_decoration_proto.Org_kde_kwin_server_decoration_manager)
    method max_version = 1l
    
    method private virtual on_default_mode : [> ] t -> mode:int32 -> unit
    
    
    method dispatch (_proxy : 'v t) _msg =
      let _proxy = Proxy.cast_version _proxy in
      match Msg.op _msg with
      | 0 ->
        let mode = Msg.get_int _msg in
        _self#on_default_mode _proxy ~mode
      | _ -> 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_default_mode : [> `V1] t -> mode:int32 -> unit
    
    (** The default mode used on the server.
        
        This event is emitted directly after binding the interface. It contains
        the default mode for the decoration. When a new server decoration object
        is created this new object will be in the default mode until the first
        request_mode is requested.
        
        The server may change the default mode at any time. *)
    
    method min_version = 1l
    method bind_version : [`V1] = `V1
  end
end

module Org_kde_kwin_server_decoration = struct
  type 'v t = ([`Org_kde_kwin_server_decoration], 'v, [`Client]) Proxy.t
  module Mode = Server_decoration_proto.Org_kde_kwin_server_decoration.Mode
  
  (** {2 Version 1} *)
  
  (** The decoration mode the surface wants to use..
      
       *)
  let request_mode (_t:([< `V1] as 'v) t) ~mode =
    let _msg = Proxy.alloc _t ~op:1 ~ints:1 ~strings:[] ~arrays:[] in
    Msg.add_int _msg mode;
    Proxy.send _t _msg
  
  (** Release the server decoration object.
      
       *)
  let release (_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 Server_decoration_proto.Org_kde_kwin_server_decoration)
    method max_version = 1l
    
    method private virtual on_mode : [> ] t -> mode:int32 -> unit
    
    
    method dispatch (_proxy : 'v t) _msg =
      let _proxy = Proxy.cast_version _proxy in
      match Msg.op _msg with
      | 0 ->
        let mode = Msg.get_int _msg in
        _self#on_mode _proxy ~mode
      | _ -> 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_mode : [> `V1] t -> mode:int32 -> unit
    
    (** The new decoration mode applied by the server.
        
        This event is emitted directly after the decoration is created and
        represents the base decoration policy by the server. E.g. a server
        which wants all surfaces to be client-side decorated will send Client,
        a server which wants server-side decoration will send Server.
        
        The client can request a different mode through the decoration request.
        The server will acknowledge this by another event with the same mode. So
        even if a server prefers server-side decoration it's possible to force a
        client-side decoration.
        
        The server may emit this event at any time. In this case the client can
        again request a different mode. It's the responsibility of the server to
        prevent a feedback loop. *)
    
    method min_version = 1l
  end
end
OCaml

Innovation. Community. Security.