Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 
 

136 рядки
4.7 KiB

  1. /*
  2. * libcucul++ C++ bindings for libcucul
  3. * Copyright (c) 2006 Jean-Yves Lamoureux <jylam@lnxscene.org>
  4. * All Rights Reserved
  5. *
  6. * $Id$
  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. /** \file cucul++.h
  14. * \version \$Id$
  15. * \author Jean-Yves Lamoureux <jylam@lnxscene.org>
  16. * \brief The \e libcucul++ public header.
  17. *
  18. * This header contains the public types and functions that applications
  19. * using \e libcucul++ may use.
  20. */
  21. #ifndef _CUCUL_PP_H
  22. #define _CUCUL_PP_H
  23. #include <stdio.h> // BUFSIZ
  24. #include <stdarg.h> // va_*
  25. #include "config.h"
  26. #include "cucul.h"
  27. class Cucul {
  28. friend class Caca;
  29. public:
  30. Cucul();
  31. Cucul(int width, int height);
  32. ~Cucul();
  33. /* Ugly, I know */
  34. class Font {
  35. friend class Cucul;
  36. protected:
  37. cucul_font *font;
  38. };
  39. class Sprite {
  40. friend class Cucul;
  41. protected:
  42. cucul_sprite *sprite;
  43. };
  44. class Dither {
  45. friend class Cucul;
  46. protected:
  47. cucul_dither *dither;
  48. };
  49. class Buffer {
  50. friend class Cucul;
  51. protected:
  52. cucul_buffer *buffer;
  53. };
  54. void set_size(unsigned int w, unsigned int h);
  55. unsigned int get_width(void);
  56. unsigned int get_height(void);
  57. void set_color(unsigned int f, unsigned int b);
  58. char const * get_color_name (unsigned int color);
  59. void printf ( int x , int y , char const * format,...);
  60. void putchar (int x, int y, char c);
  61. void putstr (int x, int y, char *str);
  62. void clear ();
  63. void blit ( int, int, Cucul* c1, Cucul* c2);
  64. void invert ();
  65. void flip ();
  66. void flop ();
  67. void rotate ();
  68. void draw_line ( int, int, int, int, char const *);
  69. void draw_polyline ( int const x[], int const y[], int, char const *);
  70. void draw_thin_line ( int, int, int, int);
  71. void draw_thin_polyline ( int const x[], int const y[], int);
  72. void draw_circle ( int, int, int, char const *);
  73. void draw_ellipse ( int, int, int, int, char const *);
  74. void draw_thin_ellipse ( int, int, int, int);
  75. void fill_ellipse ( int, int, int, int, char const *);
  76. void draw_box ( int, int, int, int, char const *);
  77. void draw_thin_box ( int, int, int, int);
  78. void fill_box ( int, int, int, int, char const *);
  79. void draw_triangle ( int, int, int, int, int, int, char const *);
  80. void draw_thin_triangle ( int, int, int, int, int, int);
  81. void fill_triangle ( int, int, int, int, int, int, char const *);
  82. int rand (int, int);
  83. Sprite * load_sprite (char const *);
  84. int get_sprite_frames (Cucul::Sprite const *);
  85. int get_sprite_width (Cucul::Sprite const *, int);
  86. int get_sprite_height (Cucul::Sprite const *, int);
  87. int get_sprite_dx (Cucul::Sprite const *, int);
  88. int get_sprite_dy (Cucul::Sprite const *, int);
  89. void draw_sprite ( int, int, Cucul::Sprite const *, int);
  90. void free_sprite (Cucul::Sprite*);
  91. Dither * create_dither (unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int);
  92. void set_dither_palette (Cucul::Dither *, unsigned int r[], unsigned int g[], unsigned int b[], unsigned int a[]);
  93. void set_dither_brightness (Cucul::Dither *, float);
  94. void set_dither_gamma (Cucul::Dither *, float);
  95. void set_dither_contrast (Cucul::Dither *, float);
  96. void set_dither_invert (Cucul::Dither *, int);
  97. void set_dither_antialias (Cucul::Dither *, char const *);
  98. char const *const * get_dither_antialias_list (Cucul::Dither const *);
  99. void set_dither_color (Cucul::Dither *, char const *);
  100. char const *const * get_dither_color_list (Cucul::Dither const *);
  101. void set_dither_charset (Cucul::Dither *, char const *);
  102. char const *const * get_dither_charset_list (Cucul::Dither const *);
  103. void set_dither_mode (Cucul::Dither *, char const *);
  104. char const *const * get_dither_mode_list (Cucul::Dither const *);
  105. void dither_bitmap ( int, int, int, int, Cucul::Dither const *, void *);
  106. void free_dither (Cucul::Dither *);
  107. Font * load_font (void const *, unsigned int);
  108. char const *const * get_font_list (void);
  109. unsigned int get_font_width (Font *);
  110. unsigned int get_font_height (Font *);
  111. void render_canvas ( Font *, unsigned char *, unsigned int, unsigned int, unsigned int);
  112. void free_font (Font *);
  113. Buffer * create_export ( char const *);
  114. char const *const * get_export_list (void);
  115. protected:
  116. cucul_t *get_cucul_t();
  117. private:
  118. cucul_t *qq;
  119. };
  120. #endif /* _CUCUL_PP_H */