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
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <orbit/orbit.h>
#include <ORBitservices/CosNaming.h>
//#include <poa/poa.h>
#include <unistd.h>
//#include <directfb.h>
#include "./nitpicker.h"
#include "./nitpicker-skelimpl.c"
#include "./nitevent.h"
#include "examples-toolkit.h"
#include "view.h"
#include "client.h"
//#include "buffer.h"
/*** LOOK UP BUFFER STRUCT BY CLIENT ID AND BUFFER ID ***/
buffer *lookup_buffer(CORBA_Object tid, int buf_id) {
client *c;
if ((c = find_client(tid)) && (VALID_ID(tid, buf_id, c->buffers, c->max_buffers)))
return &c->buffers[buf_id];
return NULL;
}
/*** INTERFACE: IMPORT NEW BUFFER INTO NITPICKER ***/
int nitpicker_import_buffer(CORBA_Object _obj,const shared_buffer_info_t *ds, int w, int h, CORBA_Environment *env) {
int id;
client *c;
//really need to understand what _dice_corba_obj is as opposed to object.
/* look up client data structure */
if (!(c = find_client(_obj))) return -1;
TRY((id = ALLOC_ID(c->buffers, c->max_buffers)) < 0, "Unable to allocate new buffer id");
/* set initial values for the buffer */
memset(&c->buffers[id], 0, sizeof(buffer));
c->buffers[id].state = STATE_ALLOCATED;
// c->buffers[id].owner = *_obj;
c->buffers[id].w = w;
c->buffers[id].h = h;
if (!ds) return id;
c->buffers[id].ds = *ds;
/*TRY(l4rm_attach(ds, w*h*scr_depth/8, 0, L4DM_RW, &c->buffers[id].data),
"Cannot attach dataspace");*/
//need to fix screen depth
TRY(attach_buffer(ds, w*h*scr_depth/8, 0, &(c->buffers[id].data)),
"Cannot import buffer: attach failed");
return id;
}
/*** INTERFACE: REMOVE BUFFER FROM NITPICKER ***/
void nitpicker_remove_buffer(CORBA_Object _obj,
int buf_id,
CORBA_Environment *env) {
}
/*** INTERFACE: REFRESH BUFFER AREA ***/
void nitpicker_refresh(CORBA_Object _obj,
int buf_id, int x, int y, int w, int h,CORBA_Environment *env){
}
|