summaryrefslogtreecommitdiff
path: root/utils/wpseditor/libwps/src/api.h
diff options
context:
space:
mode:
Diffstat (limited to 'utils/wpseditor/libwps/src/api.h')
-rw-r--r--utils/wpseditor/libwps/src/api.h85
1 files changed, 85 insertions, 0 deletions
diff --git a/utils/wpseditor/libwps/src/api.h b/utils/wpseditor/libwps/src/api.h
new file mode 100644
index 0000000000..86bb1a6597
--- /dev/null
+++ b/utils/wpseditor/libwps/src/api.h
@@ -0,0 +1,85 @@
1#ifndef API_H_INCLUDED
2#define API_H_INCLUDED
3#include <stdbool.h>
4#include <stddef.h>
5#include "defs.h"
6#include "wpsstate.h"
7#ifdef __PCTOOL__
8#include "dummies.h"
9#endif
10
11struct viewport_api {
12 int x;
13 int y;
14 int width;
15 int height;
16 int font;
17 int drawmode;
18 unsigned fg_pattern;
19 unsigned bg_pattern;
20 unsigned lss_pattern;
21 unsigned lse_pattern;
22 unsigned lst_pattern;
23
24 //TODO: ??
25 int fontheight;
26 int fontwidth;
27};
28
29struct proxy_api
30{
31 bool (*load_remote_wps_backdrop)(char* file_name);
32 bool (*load_wps_backdrop)(char* file_name);
33
34 unsigned (*get_foreground)(void);
35 unsigned (*get_background)(void);
36 int (*getwidth)(void);
37 int (*getheight)(void);
38
39 void (*puts_scroll)(int x, int y, const unsigned char *string);
40 void (*putsxy)(int x, int y, const unsigned char *str);
41 int (*getfont)();
42 int (*getstringsize)(const unsigned char *str, int *w, int *h);
43 void (*stop_scroll)();
44
45 void (*transparent_bitmap_part)(const void *src, int src_x, int src_y,
46 int stride, int x, int y, int width, int height);
47 void (*bitmap_part)(const void *src, int src_x, int src_y,
48 int stride, int x, int y, int width, int height);
49 void (*hline)(int x1, int x2, int y);
50 void (*vline)(int x, int y1, int y2);
51 void (*drawpixel)(int x, int y);
52 void (*set_drawmode)(int mode);
53 void (*fillrect)(int x, int y, int width, int height);
54
55
56 void (*update)();
57 void (*set_viewport)(struct viewport* vp);
58 void (*clear_display)(void);
59 void (*clear_viewport)(int x,int y,int w,int h, int color);
60
61 void* (*plugin_get_buffer)(size_t *buffer_size);
62 int (*read_bmp_file)(const char* filename,int *width, int *height);
63 void (*set_wpsstate)(struct wpsstate state);
64 void (*set_trackstate)(struct trackstate state);
65 void (*set_next_trackstate)(struct trackstate state);
66 void (*set_audio_status)(int status);
67
68 pfdebugf debugf;
69 int verbose;
70
71
72/**************************
73* OUT *
74**************************/
75 const char* (*get_model_name)();
76 void (*get_current_vp)(struct viewport_api *avp);
77
78
79};
80
81extern struct proxy_api *xapi;
82
83EXPORT int set_api(struct proxy_api* api);
84
85#endif // API_H_INCLUDED