1 | /* |
---|
2 | * libcucul++ C++ bindings for libcucul |
---|
3 | * Copyright (c) 2006 Jean-Yves Lamoureux <jylam@lnxscene.org> |
---|
4 | * All Rights Reserved |
---|
5 | * |
---|
6 | * $Id: cucul++.h 814 2006-04-18 16:04:01Z sam $ |
---|
7 | * |
---|
8 | * This library is free software; you can redistribute it and/or |
---|
9 | * modify it under the terms of the Do What The Fuck You Want To |
---|
10 | * Public License, Version 2, as published by Sam Hocevar. See |
---|
11 | * http://sam.zoy.org/wtfpl/COPYING for more details. |
---|
12 | */ |
---|
13 | |
---|
14 | /** \file cucul++.h |
---|
15 | * \version \$Id: cucul++.h 814 2006-04-18 16:04:01Z sam $ |
---|
16 | * \author Jean-Yves Lamoureux <jylam@lnxscene.org> |
---|
17 | * \brief The \e libcucul++ public header. |
---|
18 | * |
---|
19 | * This header contains the public types and functions that applications |
---|
20 | * using \e libcucul++ may use. |
---|
21 | */ |
---|
22 | |
---|
23 | #ifndef _CUCUL_PP_H |
---|
24 | #define _CUCUL_PP_H |
---|
25 | #include <stdio.h> // BUFSIZ |
---|
26 | #include <stdarg.h> // va_* |
---|
27 | #include "config.h" |
---|
28 | #include "cucul.h" |
---|
29 | |
---|
30 | |
---|
31 | class Cucul { |
---|
32 | friend class Caca; |
---|
33 | public: |
---|
34 | Cucul(); |
---|
35 | Cucul(int width, int height); |
---|
36 | ~Cucul(); |
---|
37 | |
---|
38 | /* Ugly, I know */ |
---|
39 | class Font { |
---|
40 | friend class Cucul; |
---|
41 | protected: |
---|
42 | cucul_font *font; |
---|
43 | }; |
---|
44 | class Sprite { |
---|
45 | friend class Cucul; |
---|
46 | protected: |
---|
47 | cucul_sprite *sprite; |
---|
48 | }; |
---|
49 | class Dither { |
---|
50 | friend class Cucul; |
---|
51 | protected: |
---|
52 | cucul_dither *dither; |
---|
53 | }; |
---|
54 | class Buffer { |
---|
55 | friend class Cucul; |
---|
56 | protected: |
---|
57 | cucul_buffer *buffer; |
---|
58 | }; |
---|
59 | |
---|
60 | |
---|
61 | |
---|
62 | void set_size(unsigned int w, unsigned int h); |
---|
63 | unsigned int get_width(void); |
---|
64 | unsigned int get_height(void); |
---|
65 | void set_color(unsigned int f, unsigned int b); |
---|
66 | char const * get_color_name (unsigned int color); |
---|
67 | void printf ( int x , int y , char const * format,...); |
---|
68 | void putchar (int x, int y, char ch); |
---|
69 | void putstr (int x, int y, char *str); |
---|
70 | void clear (unsigned char bg); |
---|
71 | void blit ( int, int, Cucul* c1, Cucul* c2); |
---|
72 | void invert (); |
---|
73 | void flip (); |
---|
74 | void flop (); |
---|
75 | void rotate (); |
---|
76 | void draw_line ( int, int, int, int, char const *); |
---|
77 | void draw_polyline ( int const x[], int const y[], int, char const *); |
---|
78 | void draw_thin_line ( int, int, int, int); |
---|
79 | void draw_thin_polyline ( int const x[], int const y[], int); |
---|
80 | void draw_circle ( int, int, int, char const *); |
---|
81 | void draw_ellipse ( int, int, int, int, char const *); |
---|
82 | void draw_thin_ellipse ( int, int, int, int); |
---|
83 | void fill_ellipse ( int, int, int, int, char const *); |
---|
84 | void draw_box ( int, int, int, int, char const *); |
---|
85 | void draw_thin_box ( int, int, int, int); |
---|
86 | void fill_box ( int, int, int, int, char const *); |
---|
87 | void draw_triangle ( int, int, int, int, int, int, char const *); |
---|
88 | void draw_thin_triangle ( int, int, int, int, int, int); |
---|
89 | void fill_triangle ( int, int, int, int, int, int, char const *); |
---|
90 | int rand (int, int); |
---|
91 | Sprite * load_sprite (char const *); |
---|
92 | int get_sprite_frames (Cucul::Sprite const *); |
---|
93 | int get_sprite_width (Cucul::Sprite const *, int); |
---|
94 | int get_sprite_height (Cucul::Sprite const *, int); |
---|
95 | int get_sprite_dx (Cucul::Sprite const *, int); |
---|
96 | int get_sprite_dy (Cucul::Sprite const *, int); |
---|
97 | void draw_sprite ( int, int, Cucul::Sprite const *, int); |
---|
98 | void free_sprite (Cucul::Sprite*); |
---|
99 | Dither * create_dither (unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int); |
---|
100 | void set_dither_palette (Cucul::Dither *, unsigned int r[], unsigned int g[], unsigned int b[], unsigned int a[]); |
---|
101 | void set_dither_brightness (Cucul::Dither *, float); |
---|
102 | void set_dither_gamma (Cucul::Dither *, float); |
---|
103 | void set_dither_contrast (Cucul::Dither *, float); |
---|
104 | void set_dither_invert (Cucul::Dither *, int); |
---|
105 | void set_dither_antialias (Cucul::Dither *, char const *); |
---|
106 | char const *const * get_dither_antialias_list (Cucul::Dither const *); |
---|
107 | void set_dither_color (Cucul::Dither *, char const *); |
---|
108 | char const *const * get_dither_color_list (Cucul::Dither const *); |
---|
109 | void set_dither_charset (Cucul::Dither *, char const *); |
---|
110 | char const *const * get_dither_charset_list (Cucul::Dither const *); |
---|
111 | void set_dither_mode (Cucul::Dither *, char const *); |
---|
112 | char const *const * get_dither_mode_list (Cucul::Dither const *); |
---|
113 | void dither_bitmap ( int, int, int, int, Cucul::Dither const *, void *); |
---|
114 | void free_dither (Cucul::Dither *); |
---|
115 | Font * load_font (void const *, unsigned int); |
---|
116 | char const *const * get_font_list (void); |
---|
117 | unsigned int get_font_width (Font *); |
---|
118 | unsigned int get_font_height (Font *); |
---|
119 | void render_canvas ( Font *, unsigned char *, unsigned int, unsigned int, unsigned int); |
---|
120 | void free_font (Font *); |
---|
121 | Buffer * create_export ( char const *); |
---|
122 | char const *const * get_export_list (void); |
---|
123 | |
---|
124 | |
---|
125 | protected: |
---|
126 | cucul_canvas_t *get_cucul_canvas_t(); |
---|
127 | |
---|
128 | private: |
---|
129 | cucul_canvas_t *cv; |
---|
130 | |
---|
131 | |
---|
132 | }; |
---|
133 | |
---|
134 | |
---|
135 | #endif /* _CUCUL_PP_H */ |
---|