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

Last change on this file since 897 was 897, checked in by Jean-Yves Lamoureux, 14 years ago
  • Updated libcaca c++ bindings
  • Property svn:keywords set to Id
File size: 3.6 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 897 2006-04-26 11:57:30Z 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 897 2006-04-26 11:57:30Z 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
26#include <cucul.h>
27
28
29class Cucul;
30
31/* Ugly, I know */
32class Font
33{
34 public:
35    ~Font();
36    Font(void const *, unsigned int);
37    char const *const * getList(void);
38    unsigned int getWidth();
39    unsigned int getHeight();
40    void renderCanvas(Cucul *, unsigned char *, unsigned int, unsigned int, unsigned int);
41
42 private:
43    cucul_font *font;
44
45};
46
47class Dither
48{
49 public:
50    Dither(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int);
51    ~Dither();
52
53    void setPalette(unsigned int r[], unsigned int g[], unsigned int b[], unsigned int a[]);
54    void setBrightness(float);
55    void setGamma(float);
56    void setContrast(float);
57    void setInvert(int);
58    void setAntialias(char const *);
59    char const *const * getAntialiasList();
60    void setColor(char const *);
61    char const *const * getColorList();
62    void setCharset(char const *);
63    char const *const * getCharsetList();
64    void setMode(char const *);
65    char const *const * getModeList();
66    void Bitmap(Cucul *, int, int, int, int, void *);
67
68 private:
69    cucul_dither *dither;
70
71};
72
73class Buffer
74{
75 public:
76    Buffer(Cucul *cv, char const *);
77    ~Buffer();
78    char const *const * getExportList(void);
79
80 private:
81    cucul_buffer *buffer;
82};
83
84
85class Cucul
86{
87    friend class Caca;
88    friend class Dither;
89    friend class Font;
90    friend class Buffer;
91  public:
92    Cucul();
93    Cucul(int width, int height);
94    Cucul(void const *, unsigned int, char const *);
95    ~Cucul();
96
97    void setSize(unsigned int w, unsigned int h);
98    unsigned int getWidth(void);
99    unsigned int getHeight(void);
100    void setColor(unsigned int f, unsigned int b);
101    char const * getColorName(unsigned int color);
102    void Printf(int x , int y , char const * format,...);
103    void putChar(int x, int y, char ch);
104    void putStr(int x, int y, char *str);
105    void Clear(void);
106    void Blit(int, int, Cucul* c1, Cucul* c2);
107    void Invert();
108    void Flip();
109    void Flop();
110    void Rotate();
111    void drawLine(int, int, int, int, char const *);
112    void drawPolyline(int const x[], int const y[], int, char const *);
113    void drawThinLine(int, int, int, int);
114    void drawThinPolyline(int const x[], int const y[], int);
115    void drawCircle(int, int, int, char const *);
116    void drawEllipse(int, int, int, int, char const *);
117    void drawThinEllipse(int, int, int, int);
118    void fillEllipse(int, int, int, int, char const *);
119    void drawBox(int, int, int, int, char const *);
120    void drawThinBox(int, int, int, int);
121    void fillBox(int, int, int, int, char const *);
122    void drawTriangle(int, int, int, int, int, int, char const *);
123    void drawThinTriangle(int, int, int, int, int, int);
124    void fillTriangle(int, int, int, int, int, int, char const *);
125    int Rand(int, int);
126
127  protected:
128    cucul_canvas_t *get_cucul_canvas_t();
129
130  private:
131    cucul_canvas_t *cv;
132};
133
134
135#endif /* _CUCUL_PP_H */
Note: See TracBrowser for help on using the repository browser.