aboutsummaryrefslogtreecommitdiffstats
path: root/android/protocol/fb-updates-proxy.h
diff options
context:
space:
mode:
authorVladimir Chtchetkine <vchtchetkine@google.com>2011-01-31 10:49:06 -0800
committerVladimir Chtchetkine <vchtchetkine@google.com>2011-01-31 10:49:06 -0800
commit94a2fba98924c6684650d66409934358cb0c9d09 (patch)
tree61438a0563eb274091cf81fe6136a35973495e8f /android/protocol/fb-updates-proxy.h
parentf988ac730fecefbd7590d3a8068c9e80fc53e026 (diff)
downloadexternal_qemu-94a2fba98924c6684650d66409934358cb0c9d09.zip
external_qemu-94a2fba98924c6684650d66409934358cb0c9d09.tar.gz
external_qemu-94a2fba98924c6684650d66409934358cb0c9d09.tar.bz2
Refactor the framebuffer service
Change-Id: I8ac4580af65b8d58976c97b77b309dd202e75003
Diffstat (limited to 'android/protocol/fb-updates-proxy.h')
-rw-r--r--android/protocol/fb-updates-proxy.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/android/protocol/fb-updates-proxy.h b/android/protocol/fb-updates-proxy.h
new file mode 100644
index 0000000..e750f1a
--- /dev/null
+++ b/android/protocol/fb-updates-proxy.h
@@ -0,0 +1,64 @@
+/* Copyright (C) 2010 The Android Open Source Project
+**
+** This software is licensed under the terms of the GNU General Public
+** License version 2, as published by the Free Software Foundation, and
+** may be copied, distributed, and modified under those terms.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+*/
+
+/*
+ * Contains core-side framebuffer service that sends framebuffer updates
+ * to the UI connected to the core.
+ */
+
+#ifndef _ANDROID_PROTOCOL_FB_UPDATES_PROXY_H
+#define _ANDROID_PROTOCOL_FB_UPDATES_PROXY_H
+
+/* Descriptor for a framebuffer core service instance */
+typedef struct ProxyFramebuffer ProxyFramebuffer;
+
+/*
+ * Creates framebuffer service.
+ * Param:
+ * sock - Socket descriptor for the service
+ * protocol - Defines protocol to use when sending FB updates to the UI. The
+ * supported values ar:
+ * -raw Transfers the updating rectangle buffer over the socket.
+ * -shared Used a shared memory to transfer the updating rectangle buffer.
+ * fb - Framebuffer descriptor for this service.
+ * Return:
+ * Framebuffer service descriptor.
+ */
+ProxyFramebuffer* proxyFb_create(int sock, const char* protocol, struct QFrameBuffer* fb);
+
+/*
+ * Destroys framebuffer service created with proxyFb_create.
+ * Param:
+ * core_fb - Framebuffer service descriptor created with proxyFb_create
+ */
+void proxyFb_destroy(ProxyFramebuffer* core_fb);
+
+/*
+ * Notifies framebuffer client about changes in framebuffer.
+ * Param:
+ * core_fb - Framebuffer service descriptor created with proxyFb_create
+ * fb Framebuffer containing pixels.
+ * x, y, w, and h identify the rectangle that has benn changed.
+ */
+void proxyFb_update(ProxyFramebuffer* core_fb, struct QFrameBuffer* fb,
+ int x, int y, int w, int h);
+
+/*
+ * Gets number of bits used to encode a single pixel.
+ * Param:
+ * core_fb - Framebuffer service descriptor created with proxyFb_create
+ * Return:
+ * Number of bits used to encode a single pixel.
+ */
+int proxyFb_get_bits_per_pixel(ProxyFramebuffer* core_fb);
+
+#endif /* _ANDROID_PROTOCOL_FB_UPDATES_PROXY_H */