source: libcaca/trunk/cpp/cucul++.h @ 781

Last change on this file since 781 was 781, checked in by Jean-Yves Lamoureux, 14 years ago
  • Added preliminary C++ bindings
  • Property svn:keywords set to Id
File size: 3.9 KB
RevLine 
[781]1#ifndef _CUCUL_PP_H
2#define _CUCUL_PP_H
3
4
5#include "cucul.h"
6
7
8class Cucul {
9    friend class Caca;
10 public:
11    Cucul();
12    Cucul(int width, int height);
13    ~Cucul();
14
15    /* Ugly, I know */
16    class Font {
17        friend class Cucul;
18    protected:
19        cucul_font *font;
20    };
21    class Sprite {
22        friend class Cucul;
23    protected:
24        cucul_sprite *sprite;
25    };
26    class Dither {
27        friend class Cucul;
28    protected:
29        cucul_dither *dither;
30    };
31    class Buffer {
32        friend class Cucul;
33    protected:
34        cucul_buffer *buffer;
35    };
36
37
38
39    void set_size(unsigned int w, unsigned int h);
40    unsigned int get_width(void);
41    unsigned int get_height(void);
42    void set_color(unsigned int f, unsigned int b);
43    char const * get_color_name (unsigned int color);
44    void putchar (int x, int y, char c);
45    void putstr (int x, int y, char *str);
46    void        clear ();
47    void        blit ( int, int, Cucul* c1, Cucul* c2);
48    void        invert ();
49    void        flip ();
50    void        flop ();
51    void        rotate ();
52    void        draw_line ( int, int, int, int, char const *);
53    void        draw_polyline ( int const x[], int const y[], int, char const *);
54    void        draw_thin_line ( int, int, int, int);
55    void        draw_thin_polyline ( int const x[], int const y[], int);
56    void        draw_circle ( int, int, int, char const *);
57    void        draw_ellipse ( int, int, int, int, char const *);
58    void        draw_thin_ellipse ( int, int, int, int);
59    void        fill_ellipse ( int, int, int, int, char const *);
60    void        draw_box ( int, int, int, int, char const *);
61    void        draw_thin_box ( int, int, int, int);
62    void        fill_box ( int, int, int, int, char const *);
63    void        draw_triangle ( int, int, int, int, int, int, char const *);
64    void        draw_thin_triangle ( int, int, int, int, int, int);
65    void        fill_triangle ( int, int, int, int, int, int, char const *);
66    int         rand (int, int);
67    unsigned int        sqrt (unsigned int);
68    Sprite *    load_sprite (char const *);
69    int         get_sprite_frames (Cucul::Sprite const *);
70    int         get_sprite_width (Cucul::Sprite const *, int);
71    int         get_sprite_height (Cucul::Sprite const *, int);
72    int         get_sprite_dx (Cucul::Sprite const *, int);
73    int         get_sprite_dy (Cucul::Sprite const *, int);
74    void        draw_sprite ( int, int, Cucul::Sprite const *, int);
75    void        free_sprite (Cucul::Sprite*);
76    Dither *    create_dither (unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int);
77    void        set_dither_palette (Cucul::Dither *, unsigned int r[], unsigned int g[], unsigned int b[], unsigned int a[]);
78    void        set_dither_brightness (Cucul::Dither *, float);
79    void        set_dither_gamma (Cucul::Dither *, float);
80    void        set_dither_contrast (Cucul::Dither *, float);
81    void        set_dither_invert (Cucul::Dither *, int);
82    void        set_dither_antialias (Cucul::Dither *, char const *);
83    char const *const *         get_dither_antialias_list (Cucul::Dither const *);
84    void        set_dither_color (Cucul::Dither *, char const *);
85    char const *const *         get_dither_color_list (Cucul::Dither const *);
86    void        set_dither_charset (Cucul::Dither *, char const *);
87    char const *const *         get_dither_charset_list (Cucul::Dither const *);
88    void        set_dither_mode (Cucul::Dither *, char const *);
89    char const *const *         get_dither_mode_list (Cucul::Dither const *);
90    void        dither_bitmap ( int, int, int, int, Cucul::Dither const *, void *);
91    void        free_dither (Cucul::Dither *);
92    Font *      load_font (void const *, unsigned int);
93    char const *const *         get_font_list (void);
94    unsigned int        get_font_width (Font *);
95    unsigned int        get_font_height (Font *);
96    void        render_canvas ( Font *, unsigned char *, unsigned int, unsigned int, unsigned int);
97    void        free_font (Font *);
98    Buffer *    create_export ( char const *);
99    char const *const *         get_export_list (void);
100
101
102 protected:
103    cucul_t *get_cucul_t();
104
105 private:
106    cucul_t *qq;
107
108
109};
110
111
112#endif /* _CUCUL_PP_H */
Note: See TracBrowser for help on using the repository browser.