summaryrefslogtreecommitdiff
path: root/xen-client.h
blob: 0eba9676dfde72919ed09e2334fb8f967abfec15 (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
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
//File:       xen-client.h
//Written by: Mark Rader
//Version:    1.0
//Date:       Mon Mar 17 2008
//Copyright (c) 2008 by Mark Rader.  All rights reserved.
// $Header$
// $Log$
//

#ifndef _XEN_CLIENT_h
#define _XEN_CLIENT_h

#include <stdbool.h>

#include "fbif.h"

int nitpicker_init_ipc();

// ??? Returns 1 if alive. This is a bogus function, primarily to
// simply test the commo infrastructure.
long nitpicker_alive_call();
long nitpicker_kill_graphics_call();

/*** DONATE MEMORY ***
 *
 * Donate memory for the storage of client-specific data structures
 * inside nitpicker. When called a second time, nitpicker discards
 * the previous donation including all views and buffers. If a client
 * has to increase max_views or max_buffers later on, the client has
 * to recover the old state by itself.
 *
 * To calculate the needed size for the dataspace to donate, use:
 * size = sizeof(client)
 *      + sizeof(view)   * max_views
 *      + sizeof(buffer) * max_buffers
 *
 * \return  0 on success, or
 *         -1 if supplied memory block is too small to store the
 *            requested number of views and buffers, or
 *         -2 dataspace is invalid
 */
long nitpicker_initialize_client_call(uint8_t max_views, uint8_t max_buffers);

/*** REQUEST INFORMATION ABOUT PHYSICAL SCREEN ***/
void nitpicker_get_screen_info_call(uint16_t *width, uint16_t *height,
                  uint8_t *depth, uint8_t *mode);


/*** INJECT NEW BUFFER ***/
long nitpicker_import_buffer_call(uint16_t width, uint16_t height);


/*** REMOVE BUFFER ***/
void nitpicker_remove_buffer_call(uint8_t buf_id);


/*** REFRESH GRAPHICAL REPRESENTATION OF THE NEW BUFFER ***/
void nitpicker_refresh_call(uint8_t buf_id, uint16_t x, uint16_t y,
                            uint16_t width, uint16_t height);


/*** CREATE A NEW VIEW AT A BUFFER ***
 *
 * \param buf_id    buffer that is displayed by the view
 */
long nitpicker_new_view_call(uint8_t buf_id);


/*** CLOSE VIEW ***/
void nitpicker_destroy_view_call(uint8_t view_id);


/*** DEFINE VIEWPORT ON THE BUFFER ***/
long nitpicker_set_view_port_call(uint8_t view_id,
          uint16_t buf_x, uint16_t buf_y,
          uint16_t x, uint16_t y, uint16_t width, uint16_t height,
          bool do_redraw);

/*** POSITION VIEW IN VIEW STACK ***
 *
 * \param neighbor  neighbor view id or
 *                 -1  top or bottom of view stack
 * \param behind    0  insert view in front or
 *                  1  behind the specified neightbor
 *
 * To insert a view at the top of the view stack, specify
 * neighbor = -1 and behind = 1. To insert a view at the
 * bottom of the view stack, specify neighbor = -1 and
 * behind = 0.
 */
long nitpicker_stack_view_call(uint8_t view_id, int8_t neighbor_id,
                         bool behind, bool do_redraw);

/*** SET TITLE INFORMATION OF A VIEW ***/
long nitpicker_set_view_title_call(uint8_t view_id, char *title);

/*** DEFINE VIEW THAT IS USED AS DESKTOP BACKGROUND ***/
long nitpicker_set_background_call(uint8_t view_id);

/*** CONFIGURE MOUSE BEHAVIOUR FOR A VIEW ***/
long nitpicker_set_mousemode_call(uint8_t view_id, uint8_t mode);



#endif