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

Last change on this file since 861 was 838, checked in by Sam Hocevar, 14 years ago
  • Removed soon-to-be-thrown-away sprite stuff from the C++ bindings.
  • Property svn:keywords set to Id
File size: 4.0 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 838 2006-04-22 19:00:14Z 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 838 2006-04-22 19:00:14Z 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
26#include <cucul.h>
27
28class Cucul
29{
30    friend class Caca;
31  public:
32    Cucul();
33    Cucul(int width, int height);
34    ~Cucul();
35
36    /* Ugly, I know */
37    class Font
38    {
39        friend class Cucul;
40      protected:
41        cucul_font *font;
42    };
43
44    class Dither
45    {
46        friend class Cucul;
47      protected:
48        cucul_dither *dither;
49    };
50
51    class Buffer
52    {
53        friend class Cucul;
54      protected:
55        cucul_buffer *buffer;
56    };
57
58    void set_size(unsigned int w, unsigned int h);
59    unsigned int get_width(void);
60    unsigned int get_height(void);
61    void set_color(unsigned int f, unsigned int b);
62    char const * get_color_name(unsigned int color);
63    void printf(int x , int y , char const * format,...);
64    void putchar(int x, int y, char ch);
65    void putstr(int x, int y, char *str);
66    void clear(void);
67    void blit(int, int, Cucul* c1, Cucul* c2);
68    void invert();
69    void flip();
70    void flop();
71    void rotate();
72    void draw_line(int, int, int, int, char const *);
73    void draw_polyline(int const x[], int const y[], int, char const *);
74    void draw_thin_line(int, int, int, int);
75    void draw_thin_polyline(int const x[], int const y[], int);
76    void draw_circle(int, int, int, char const *);
77    void draw_ellipse(int, int, int, int, char const *);
78    void draw_thin_ellipse(int, int, int, int);
79    void fill_ellipse(int, int, int, int, char const *);
80    void draw_box(int, int, int, int, char const *);
81    void draw_thin_box(int, int, int, int);
82    void fill_box(int, int, int, int, char const *);
83    void draw_triangle(int, int, int, int, int, int, char const *);
84    void draw_thin_triangle(int, int, int, int, int, int);
85    void fill_triangle(int, int, int, int, int, int, char const *);
86    int rand(int, int);
87    Dither * create_dither(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int);
88    void set_dither_palette(Cucul::Dither *, unsigned int r[], unsigned int g[], unsigned int b[], unsigned int a[]);
89    void set_dither_brightness(Cucul::Dither *, float);
90    void set_dither_gamma(Cucul::Dither *, float);
91    void set_dither_contrast(Cucul::Dither *, float);
92    void set_dither_invert(Cucul::Dither *, int);
93    void set_dither_antialias(Cucul::Dither *, char const *);
94    char const *const * get_dither_antialias_list(Cucul::Dither const *);
95    void set_dither_color(Cucul::Dither *, char const *);
96    char const *const * get_dither_color_list(Cucul::Dither const *);
97    void set_dither_charset(Cucul::Dither *, char const *);
98    char const *const * get_dither_charset_list(Cucul::Dither const *);
99    void set_dither_mode(Cucul::Dither *, char const *);
100    char const *const * get_dither_mode_list(Cucul::Dither const *);
101    void dither_bitmap(int, int, int, int, Cucul::Dither const *, void *);
102    void free_dither(Cucul::Dither *);
103    Font * load_font(void const *, unsigned int);
104    char const *const * get_font_list(void);
105    unsigned int get_font_width(Font *);
106    unsigned int get_font_height(Font *);
107    void render_canvas(Font *, unsigned char *, unsigned int, unsigned int, unsigned int);
108    void free_font(Font *);
109    Buffer * export_canvas(char const *);
110    char const *const * get_export_list(void);
111
112  protected:
113    cucul_canvas_t *get_cucul_canvas_t();
114
115  private:
116    cucul_canvas_t *cv;
117};
118
119
120#endif /* _CUCUL_PP_H */
Note: See TracBrowser for help on using the repository browser.