25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 
 

136 satır
4.5 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 <cucul.h>
  24. class Cucul
  25. {
  26. friend class Caca;
  27. public:
  28. Cucul();
  29. Cucul(int width, int height);
  30. ~Cucul();
  31. /* Ugly, I know */
  32. class Font
  33. {
  34. friend class Cucul;
  35. protected:
  36. cucul_font *font;
  37. };
  38. class Sprite
  39. {
  40. friend class Cucul;
  41. protected:
  42. cucul_sprite *sprite;
  43. };
  44. class Dither
  45. {
  46. friend class Cucul;
  47. protected:
  48. cucul_dither *dither;
  49. };
  50. class Buffer
  51. {
  52. friend class Cucul;
  53. protected:
  54. cucul_buffer *buffer;
  55. };
  56. void set_size(unsigned int w, unsigned int h);
  57. unsigned int get_width(void);
  58. unsigned int get_height(void);
  59. void set_color(unsigned int f, unsigned int b);
  60. char const * get_color_name(unsigned int color);
  61. void printf(int x , int y , char const * format,...);
  62. void putchar(int x, int y, char ch);
  63. void putstr(int x, int y, char *str);
  64. void clear(unsigned char bg);
  65. void blit(int, int, Cucul* c1, Cucul* c2);
  66. void invert();
  67. void flip();
  68. void flop();
  69. void rotate();
  70. void draw_line(int, int, int, int, char const *);
  71. void draw_polyline(int const x[], int const y[], int, char const *);
  72. void draw_thin_line(int, int, int, int);
  73. void draw_thin_polyline(int const x[], int const y[], int);
  74. void draw_circle(int, int, int, char const *);
  75. void draw_ellipse(int, int, int, int, char const *);
  76. void draw_thin_ellipse(int, int, int, int);
  77. void fill_ellipse(int, int, int, int, char const *);
  78. void draw_box(int, int, int, int, char const *);
  79. void draw_thin_box(int, int, int, int);
  80. void fill_box(int, int, int, int, char const *);
  81. void draw_triangle(int, int, int, int, int, int, char const *);
  82. void draw_thin_triangle(int, int, int, int, int, int);
  83. void fill_triangle(int, int, int, int, int, int, char const *);
  84. int rand(int, int);
  85. Sprite * load_sprite(char const *);
  86. int get_sprite_frames(Cucul::Sprite const *);
  87. int get_sprite_width(Cucul::Sprite const *, int);
  88. int get_sprite_height(Cucul::Sprite const *, int);
  89. int get_sprite_dx(Cucul::Sprite const *, int);
  90. int get_sprite_dy(Cucul::Sprite const *, int);
  91. void draw_sprite(int, int, Cucul::Sprite const *, int);
  92. void free_sprite(Cucul::Sprite*);
  93. Dither * create_dither(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int);
  94. void set_dither_palette(Cucul::Dither *, unsigned int r[], unsigned int g[], unsigned int b[], unsigned int a[]);
  95. void set_dither_brightness(Cucul::Dither *, float);
  96. void set_dither_gamma(Cucul::Dither *, float);
  97. void set_dither_contrast(Cucul::Dither *, float);
  98. void set_dither_invert(Cucul::Dither *, int);
  99. void set_dither_antialias(Cucul::Dither *, char const *);
  100. char const *const * get_dither_antialias_list(Cucul::Dither const *);
  101. void set_dither_color(Cucul::Dither *, char const *);
  102. char const *const * get_dither_color_list(Cucul::Dither const *);
  103. void set_dither_charset(Cucul::Dither *, char const *);
  104. char const *const * get_dither_charset_list(Cucul::Dither const *);
  105. void set_dither_mode(Cucul::Dither *, char const *);
  106. char const *const * get_dither_mode_list(Cucul::Dither const *);
  107. void dither_bitmap(int, int, int, int, Cucul::Dither const *, void *);
  108. void free_dither(Cucul::Dither *);
  109. Font * load_font(void const *, unsigned int);
  110. char const *const * get_font_list(void);
  111. unsigned int get_font_width(Font *);
  112. unsigned int get_font_height(Font *);
  113. void render_canvas(Font *, unsigned char *, unsigned int, unsigned int, unsigned int);
  114. void free_font(Font *);
  115. Buffer * export_canvas(char const *);
  116. char const *const * get_export_list(void);
  117. protected:
  118. cucul_canvas_t *get_cucul_canvas_t();
  119. private:
  120. cucul_canvas_t *cv;
  121. };
  122. #endif /* _CUCUL_PP_H */