Send out coordinates with pointer_focus event
[profile/ivi/wayland.git] / connection.h
1 /*
2  * Copyright © 2008 Kristian Høgsberg
3  *
4  * Permission to use, copy, modify, distribute, and sell this software and its
5  * documentation for any purpose is hereby granted without fee, provided that
6  * the above copyright notice appear in all copies and that both that copyright
7  * notice and this permission notice appear in supporting documentation, and
8  * that the name of the copyright holders not be used in advertising or
9  * publicity pertaining to distribution of the software without specific,
10  * written prior permission.  The copyright holders make no representations
11  * about the suitability of this software for any purpose.  It is provided "as
12  * is" without express or implied warranty.
13  *
14  * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16  * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
20  * OF THIS SOFTWARE.
21  */
22
23 #ifndef _CONNECTION_H_
24 #define _CONNECTION_H_
25
26 #include <stdarg.h>
27 #include "wayland-util.h"
28
29 struct wl_connection;
30
31 #define WL_CONNECTION_READABLE 0x01
32 #define WL_CONNECTION_WRITABLE 0x02
33
34 typedef int (*wl_connection_update_func_t)(struct wl_connection *connection,
35                                            uint32_t mask, void *data);
36
37 struct wl_connection *wl_connection_create(int fd,
38                                            wl_connection_update_func_t update,
39                                            void *data);
40 void wl_connection_destroy(struct wl_connection *connection);
41 void wl_connection_copy(struct wl_connection *connection, void *data, size_t size);
42 void wl_connection_consume(struct wl_connection *connection, size_t size);
43 int wl_connection_data(struct wl_connection *connection, uint32_t mask);
44 void wl_connection_write(struct wl_connection *connection, const void *data, size_t count);
45
46 void wl_connection_vmarshal(struct wl_connection *connection,
47                             struct wl_object *sender,
48                             uint32_t opcode, va_list ap,
49                             const struct wl_message *message);
50
51 void wl_connection_demarshal(struct wl_connection *connection,
52                              uint32_t size,
53                              struct wl_hash_table *objects,
54                              void (*func)(void),
55                              void *data, struct wl_object *target,
56                              const struct wl_message *message);
57
58 #endif