new profiles
[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 #ifdef USE_DFB_API
12 #include <directfb.h>
13 #endif
14
15 /* two dimensional lattice */
16
17 #define X_GAP 5
18 #define Y_GAP X_GAP
19 #define RED 1
20
21 #ifndef _U32
22 #define _U32
23 typedef unsigned int u32;
24 #endif
25
26 typedef struct __d2_lattice
27 {
28  int max_x,max_y;
29  int s_height,s_width;
30  int fakt_x,fakt_y;
31  int info_x,info_y;
32  int info_w,info_h;
33  int font_h;
34  unsigned char *status; /* status&1 -> red, else blue */
35  int *extra; /* store extra values */
36  void *v_ptr; /* void ptr, for any use */
37 #ifdef USE_DFB_API
38  IDirectFB *dfb;
39  IDirectFBSurface *p_surface;
40  IDirectFBFont *font;
41  IDirectFBInputDevice *keyboard;
42  IDirectFBEventBuffer *k_buffer;
43 #else
44  char *foo1,*foo2,*foo3,*foo4,*foo5;
45 #endif
46 } d2_lattice;
47
48 typedef struct __d3_lattice
49 {
50  int max_x,max_y,max_z;
51  int s_height,s_width;
52  int fakt_x,fakt_y;
53  int info_x,info_y;
54  int o_x;
55  int info_w,info_h;
56  int font_h;
57  unsigned char *status; /* status&1 -> red, else blue */
58  int *extra; /* store extra values */
59  void *v_ptr; /* void ptr, for any use */
60 #ifdef USE_DFB_API
61  IDirectFB *dfb;
62  IDirectFBSurface *p_surface;
63  IDirectFBFont *font;
64  IDirectFBInputDevice *keyboard;
65  IDirectFBEventBuffer *k_buffer;
66 #else
67  char *foo1,*foo2,*foo3,*foo4,*foo5;
68 #endif
69 } d3_lattice;
70
71 /* function prototypes */
72 int d2_lattice_init(int *argc,char **argv,d2_lattice *d2_l);
73 int d2_lattice_release(d2_lattice *d2_l);
74 int d2_lattice_draw(d2_lattice *d2_l,int x,int y,int arg_c,char **arg_v,unsigned char mode,int max_extra);
75 int d3_lattice_init(int *argc,char **argv,d3_lattice *d3_l);
76 int d3_lattice_release(d3_lattice *d3_l);
77 int d3_lattice_draw(d3_lattice *d3_l,int x,int y,int z,int arg_c,char **arg_v,unsigned char mode,int max_extra,u32 *p1,u32 max1,u32 *p2,u32 max2);
78 int d2_event_init(d2_lattice *d2_l);
79 int d3_event_init(d3_lattice *d3_l);
80 int scan_event(d3_lattice *d3_l,int *x,int *y,int *z,int *q,int *esc,int *switchmode,int *bmp,int *ac_distr);
81 int dx_lattice_get_color(unsigned char *status,unsigned char *r,unsigned char *g,unsigned char *b,unsigned char mode);
82
83 #endif /* DFBAPI_H */