aboutsummaryrefslogtreecommitdiffstats
path: root/android/framebuffer-core.h
blob: 6738d0eaed109e53d7f4003874d834400d3edd0f (plain)
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
/* 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_FRAMEBUFFER_CORE_H
#define _ANDROID_FRAMEBUFFER_CORE_H

/* Descriptor for a framebuffer core service instance */
typedef struct CoreFramebuffer CoreFramebuffer;

/*
 * 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.
 * Return:
 *  Framebuffer service descriptor.
 */
CoreFramebuffer* corefb_create(int sock, const char* protocol);

/*
 * Destroys framebuffer service created with corefb_create.
 * Param:
 *  core_fb - Framebuffer service descriptor created with corefb_create
 */
void corefb_destroy(CoreFramebuffer* core_fb);

/*
 * Notifies framebuffer client about changes in framebuffer.
 * Param:
 *  core_fb - Framebuffer service descriptor created with corefb_create
 *  ds - Display state for the framebuffer.
 *  fb Framebuffer containing pixels.
 *  x, y, w, and h identify the rectangle that has benn changed.
 */
void corefb_update(CoreFramebuffer* core_fb, struct DisplayState* ds,
                   struct QFrameBuffer* fb, int x, int y, int w, int h);

#endif /* _ANDROID_FRAMEBUFFER_CORE_H */