summaryrefslogtreecommitdiff
path: root/src/bin/ecore_buffer/bq_mgr_protocol.c
diff options
context:
space:
mode:
authorSeunghun Lee <beauty.positive3@gmail.com>2015-06-22 10:23:54 -0400
committerChris Michael <cp.michael@samsung.com>2015-06-22 10:31:42 -0400
commit8b621775619b9959fe952b095b3baaa7aaa99572 (patch)
tree99059a841a79729cac4687ea41f3abf672e6e455 /src/bin/ecore_buffer/bq_mgr_protocol.c
parent3671506ad39d2a956e388e151bd20f1b9ffd62a5 (diff)
ecore-buffer: Add ecore_buffer library to EFL.
Summary: Ecore_Buffer is abstraction of graphic buffer. it supports backend of shm, x11_dri2 and x11_dri3 for now, and this library also provides method to share buffers between processes. Ecore_Buffer_Provider and Ecore_Buffer_Consumer is for this, sharing buffer. provider draws something in to Ecore_Buffer, and consumer receives and displays it. the binary, bq_mgr is a connection maker for buffer provider and consumer. it can be included Enlightenment as a deamon later. @feature Test Plan: 1. Configure with --enable-ecore-buffer and --enable-always-build-examples to build examples. 2. Run bq_mgr, it connects consumer and provider. 3. Run ecore_buffer_provider_example and ecore_buffer_consumer_example Reviewers: lsj119, gwanglim, cedric, zmike, jpeg, raster, devilhorns Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2197
Diffstat (limited to 'src/bin/ecore_buffer/bq_mgr_protocol.c')
-rw-r--r--src/bin/ecore_buffer/bq_mgr_protocol.c131
1 files changed, 131 insertions, 0 deletions
diff --git a/src/bin/ecore_buffer/bq_mgr_protocol.c b/src/bin/ecore_buffer/bq_mgr_protocol.c
new file mode 100644
index 0000000000..fe8b98c9bc
--- /dev/null
+++ b/src/bin/ecore_buffer/bq_mgr_protocol.c
@@ -0,0 +1,131 @@
1#include <stdlib.h>
2#include <stdint.h>
3#include "wayland-util.h"
4
5extern const struct wl_interface bq_buffer_interface;
6extern const struct wl_interface bq_consumer_interface;
7extern const struct wl_interface bq_provider_interface;
8
9static const struct wl_interface *types[] = {
10 NULL,
11 NULL,
12 NULL,
13 &bq_consumer_interface,
14 NULL,
15 NULL,
16 NULL,
17 NULL,
18 &bq_provider_interface,
19 NULL,
20 &bq_buffer_interface,
21 &bq_buffer_interface,
22 NULL,
23 NULL,
24 NULL,
25 NULL,
26 NULL,
27 &bq_buffer_interface,
28 NULL,
29 NULL,
30 NULL,
31 NULL,
32 NULL,
33 NULL,
34 NULL,
35 &bq_buffer_interface,
36 NULL,
37 NULL,
38 NULL,
39 NULL,
40 NULL,
41 NULL,
42 NULL,
43 &bq_buffer_interface,
44 &bq_buffer_interface,
45 NULL,
46 &bq_buffer_interface,
47 NULL,
48 NULL,
49 NULL,
50 NULL,
51 NULL,
52 &bq_buffer_interface,
53 NULL,
54 NULL,
55 NULL,
56 NULL,
57 NULL,
58 NULL,
59 NULL,
60 &bq_buffer_interface,
61 NULL,
62 NULL,
63 NULL,
64 NULL,
65 NULL,
66 NULL,
67 NULL,
68 &bq_buffer_interface,
69 &bq_buffer_interface,
70 NULL,
71 &bq_buffer_interface,
72 NULL,
73};
74
75static const struct wl_message bq_mgr_requests[] = {
76 { "create_consumer", "nsiii", types + 3 },
77 { "create_provider", "ns", types + 8 },
78};
79
80WL_EXPORT const struct wl_interface bq_mgr_interface = {
81 "bq_mgr", 1,
82 2, bq_mgr_requests,
83 0, NULL,
84};
85
86static const struct wl_message bq_consumer_requests[] = {
87 { "release_buffer", "o", types + 10 },
88};
89
90static const struct wl_message bq_consumer_events[] = {
91 { "connected", "", types + 0 },
92 { "disconnected", "", types + 0 },
93 { "buffer_attached", "nsiiiu", types + 11 },
94 { "set_buffer_id", "oiiiiiii", types + 17 },
95 { "set_buffer_fd", "ohiiiiii", types + 25 },
96 { "buffer_detached", "o", types + 33 },
97 { "add_buffer", "ou", types + 34 },
98};
99
100WL_EXPORT const struct wl_interface bq_consumer_interface = {
101 "bq_consumer", 1,
102 1, bq_consumer_requests,
103 7, bq_consumer_events,
104};
105
106static const struct wl_message bq_provider_requests[] = {
107 { "attach_buffer", "nsiiiu", types + 36 },
108 { "set_buffer_id", "oiiiiiii", types + 42 },
109 { "set_buffer_fd", "ohiiiiii", types + 50 },
110 { "detach_buffer", "o", types + 58 },
111 { "enqueue_buffer", "ou", types + 59 },
112};
113
114static const struct wl_message bq_provider_events[] = {
115 { "connected", "iii", types + 0 },
116 { "disconnected", "", types + 0 },
117 { "add_buffer", "ou", types + 61 },
118};
119
120WL_EXPORT const struct wl_interface bq_provider_interface = {
121 "bq_provider", 1,
122 5, bq_provider_requests,
123 3, bq_provider_events,
124};
125
126WL_EXPORT const struct wl_interface bq_buffer_interface = {
127 "bq_buffer", 1,
128 0, NULL,
129 0, NULL,
130};
131