113 行
3.9 KiB

  1. #ifndef _CUCUL_PP_H
  2. #define _CUCUL_PP_H
  3. #include "cucul.h"
  4. class Cucul {
  5. friend class Caca;
  6. public:
  7. Cucul();
  8. Cucul(int width, int height);
  9. ~Cucul();
  10. /* Ugly, I know */
  11. class Font {
  12. friend class Cucul;
  13. protected:
  14. cucul_font *font;
  15. };
  16. class Sprite {
  17. friend class Cucul;
  18. protected:
  19. cucul_sprite *sprite;
  20. };
  21. class Dither {
  22. friend class Cucul;
  23. protected:
  24. cucul_dither *dither;
  25. };
  26. class Buffer {
  27. friend class Cucul;
  28. protected:
  29. cucul_buffer *buffer;
  30. };
  31. void set_size(unsigned int w, unsigned int h);
  32. unsigned int get_width(void);
  33. unsigned int get_height(void);
  34. void set_color(unsigned int f, unsigned int b);
  35. char const * get_color_name (unsigned int color);
  36. void putchar (int x, int y, char c);
  37. void putstr (int x, int y, char *str);
  38. void clear ();
  39. void blit ( int, int, Cucul* c1, Cucul* c2);
  40. void invert ();
  41. void flip ();
  42. void flop ();
  43. void rotate ();
  44. void draw_line ( int, int, int, int, char const *);
  45. void draw_polyline ( int const x[], int const y[], int, char const *);
  46. void draw_thin_line ( int, int, int, int);
  47. void draw_thin_polyline ( int const x[], int const y[], int);
  48. void draw_circle ( int, int, int, char const *);
  49. void draw_ellipse ( int, int, int, int, char const *);
  50. void draw_thin_ellipse ( int, int, int, int);
  51. void fill_ellipse ( int, int, int, int, char const *);
  52. void draw_box ( int, int, int, int, char const *);
  53. void draw_thin_box ( int, int, int, int);
  54. void fill_box ( int, int, int, int, char const *);
  55. void draw_triangle ( int, int, int, int, int, int, char const *);
  56. void draw_thin_triangle ( int, int, int, int, int, int);
  57. void fill_triangle ( int, int, int, int, int, int, char const *);
  58. int rand (int, int);
  59. unsigned int sqrt (unsigned int);
  60. Sprite * load_sprite (char const *);
  61. int get_sprite_frames (Cucul::Sprite const *);
  62. int get_sprite_width (Cucul::Sprite const *, int);
  63. int get_sprite_height (Cucul::Sprite const *, int);
  64. int get_sprite_dx (Cucul::Sprite const *, int);
  65. int get_sprite_dy (Cucul::Sprite const *, int);
  66. void draw_sprite ( int, int, Cucul::Sprite const *, int);
  67. void free_sprite (Cucul::Sprite*);
  68. Dither * create_dither (unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int);
  69. void set_dither_palette (Cucul::Dither *, unsigned int r[], unsigned int g[], unsigned int b[], unsigned int a[]);
  70. void set_dither_brightness (Cucul::Dither *, float);
  71. void set_dither_gamma (Cucul::Dither *, float);
  72. void set_dither_contrast (Cucul::Dither *, float);
  73. void set_dither_invert (Cucul::Dither *, int);
  74. void set_dither_antialias (Cucul::Dither *, char const *);
  75. char const *const * get_dither_antialias_list (Cucul::Dither const *);
  76. void set_dither_color (Cucul::Dither *, char const *);
  77. char const *const * get_dither_color_list (Cucul::Dither const *);
  78. void set_dither_charset (Cucul::Dither *, char const *);
  79. char const *const * get_dither_charset_list (Cucul::Dither const *);
  80. void set_dither_mode (Cucul::Dither *, char const *);
  81. char const *const * get_dither_mode_list (Cucul::Dither const *);
  82. void dither_bitmap ( int, int, int, int, Cucul::Dither const *, void *);
  83. void free_dither (Cucul::Dither *);
  84. Font * load_font (void const *, unsigned int);
  85. char const *const * get_font_list (void);
  86. unsigned int get_font_width (Font *);
  87. unsigned int get_font_height (Font *);
  88. void render_canvas ( Font *, unsigned char *, unsigned int, unsigned int, unsigned int);
  89. void free_font (Font *);
  90. Buffer * create_export ( char const *);
  91. char const *const * get_export_list (void);
  92. protected:
  93. cucul_t *get_cucul_t();
  94. private:
  95. cucul_t *qq;
  96. };
  97. #endif /* _CUCUL_PP_H */