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

Last change on this file since 784 was 784, checked in by Jean-Yves Lamoureux, 14 years ago
  • Added license in C++ files.
  • Property svn:keywords set to Id
File size: 4.7 KB
Line 
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 784 2006-04-17 11:06:48Z jylam $
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 784 2006-04-17 11:06:48Z jylam $
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
31class 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 c);
69    void putstr (int x, int y, char *str);
70    void        clear ();
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    unsigned int        sqrt (unsigned int);
92    Sprite *    load_sprite (char const *);
93    int         get_sprite_frames (Cucul::Sprite const *);
94    int         get_sprite_width (Cucul::Sprite const *, int);
95    int         get_sprite_height (Cucul::Sprite const *, int);
96    int         get_sprite_dx (Cucul::Sprite const *, int);
97    int         get_sprite_dy (Cucul::Sprite const *, int);
98    void        draw_sprite ( int, int, Cucul::Sprite const *, int);
99    void        free_sprite (Cucul::Sprite*);
100    Dither *    create_dither (unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int);
101    void        set_dither_palette (Cucul::Dither *, unsigned int r[], unsigned int g[], unsigned int b[], unsigned int a[]);
102    void        set_dither_brightness (Cucul::Dither *, float);
103    void        set_dither_gamma (Cucul::Dither *, float);
104    void        set_dither_contrast (Cucul::Dither *, float);
105    void        set_dither_invert (Cucul::Dither *, int);
106    void        set_dither_antialias (Cucul::Dither *, char const *);
107    char const *const *         get_dither_antialias_list (Cucul::Dither const *);
108    void        set_dither_color (Cucul::Dither *, char const *);
109    char const *const *         get_dither_color_list (Cucul::Dither const *);
110    void        set_dither_charset (Cucul::Dither *, char const *);
111    char const *const *         get_dither_charset_list (Cucul::Dither const *);
112    void        set_dither_mode (Cucul::Dither *, char const *);
113    char const *const *         get_dither_mode_list (Cucul::Dither const *);
114    void        dither_bitmap ( int, int, int, int, Cucul::Dither const *, void *);
115    void        free_dither (Cucul::Dither *);
116    Font *      load_font (void const *, unsigned int);
117    char const *const *         get_font_list (void);
118    unsigned int        get_font_width (Font *);
119    unsigned int        get_font_height (Font *);
120    void        render_canvas ( Font *, unsigned char *, unsigned int, unsigned int, unsigned int);
121    void        free_font (Font *);
122    Buffer *    create_export ( char const *);
123    char const *const *         get_export_list (void);
124
125
126 protected:
127    cucul_t *get_cucul_t();
128
129 private:
130    cucul_t *qq;
131
132
133};
134
135
136#endif /* _CUCUL_PP_H */
Note: See TracBrowser for help on using the repository browser.