added NODFB mode
[physik/nlsop.git] / dfbapi.h
1 /* 
2  * scientific visualization api for direct framebuffer
3  *
4  * author: hackbard@hackdaworld.dyndns.org
5  *
6  */
7
8 #ifndef DFBAPI_H
9 #define DFBAPI_H
10
11 #include <directfb.h>
12
13 /* two dimensional lattice */
14
15 #define X_GAP 5
16 #define Y_GAP X_GAP
17 #define RED 1
18
19 typedef struct __d2_lattice
20 {
21  int max_x,max_y;
22  int s_height,s_width;
23  int fakt_x,fakt_y;
24  int info_x,info_y;
25  int info_w,info_h;
26  int font_h;
27  unsigned char *status; /* status&1 -> red, else blue */
28  int *extra; /* store extra values */
29  void *v_ptr; /* void ptr, for any use */
30 #ifdef USE_DFB_API
31  IDirectFB *dfb;
32  IDirectFBSurface *p_surface;
33  IDirectFBFont *font;
34  IDirectFBInputDevice *keyboard;
35  IDirectFBEventBuffer *k_buffer;
36 #else
37  char *foo1,*foo2,foo3,foo4;
38 #endif
39 } d2_lattice;
40
41 typedef struct __d3_lattice
42 {
43  int max_x,max_y,max_z;
44  int s_height,s_width;
45  int fakt_x,fakt_y;
46  int info_x,info_y;
47  int info_w,info_h;
48  int font_h;
49  unsigned char *status; /* status&1 -> red, else blue */
50  int *extra; /* store extra values */
51  void *v_ptr; /* void ptr, for any use */
52 #ifdef USE_DFB_API
53  IDirectFB *dfb;
54  IDirectFBSurface *p_surface;
55  IDirectFBFont *font;
56  IDirectFBInputDevice *keyboard;
57  IDirectFBEventBuffer *k_buffer;
58 #else
59  char *foo1,*foo2,foo3,foo4;
60 #endif
61 } d3_lattice;
62
63 /* function prototypes */
64 int d2_lattice_init(int *argc,char **argv,d2_lattice *d2_l);
65 int d2_lattice_release(d2_lattice *d2_l);
66 int d2_lattice_draw(d2_lattice *d2_l,int x,int y,int arg_c,char **arg_v);
67 int d3_lattice_init(int *argc,char **argv,d3_lattice *d3_l);
68 int d3_lattice_release(d3_lattice *d3_l);
69 int d3_lattice_draw(d3_lattice *d3_l,int x,int y,int z,int arg_c,char **arg_v);
70 int d2_event_init(d2_lattice *d2_l);
71 int d3_event_init(d3_lattice *d3_l);
72 int scan_event(d3_lattice *d3_l,int *x,int *y,int *z,int *q,int *esc);
73 int dx_lattice_get_color(unsigned char *status,unsigned char *r,unsigned char *g,unsigned char *b);
74
75 #endif /* DFBAPI_H */