Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 
 
 

154 Zeilen
4.6 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. It comes without any warranty, to
  9. * the extent permitted by applicable law. You can redistribute it
  10. * and/or modify it under the terms of the Do What The Fuck You Want
  11. * To Public License, Version 2, as published by Sam Hocevar. See
  12. * http://sam.zoy.org/wtfpl/COPYING for more details.
  13. */
  14. /** \file cucul++.h
  15. * \version \$Id$
  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. #ifndef _CUCUL_PP_H
  23. #define _CUCUL_PP_H
  24. #include <cucul.h>
  25. #undef __class
  26. #if defined(_WIN32) && defined(__LIBCUCUL_PP__)
  27. # define __class class __declspec(dllexport)
  28. #else
  29. # define __class class
  30. #endif
  31. class Cucul;
  32. __class Charset
  33. {
  34. public:
  35. unsigned long int utf8ToUtf32(char const *, unsigned int *);
  36. unsigned int utf32ToUtf8(char *, unsigned long int);
  37. unsigned char utf32ToCp437(unsigned long int);
  38. unsigned long int cp437ToUtf32(unsigned char);
  39. };
  40. /* Ugly, I know */
  41. __class Font
  42. {
  43. public:
  44. ~Font();
  45. Font(void const *, unsigned int);
  46. char const *const * getList(void);
  47. unsigned int getWidth();
  48. unsigned int getHeight();
  49. void renderCanvas(Cucul *, unsigned char *, unsigned int,
  50. unsigned int, unsigned int);
  51. unsigned long int const *getBlocks();
  52. private:
  53. cucul_font *font;
  54. };
  55. __class Dither
  56. {
  57. public:
  58. Dither(unsigned int, unsigned int, unsigned int, unsigned int,
  59. unsigned int, unsigned int, unsigned int, unsigned int);
  60. ~Dither();
  61. void setPalette(unsigned int r[], unsigned int g[],
  62. unsigned int b[], unsigned int a[]);
  63. void setBrightness(float);
  64. void setGamma(float);
  65. void setContrast(float);
  66. void setAntialias(char const *);
  67. char const *const * getAntialiasList();
  68. void setColor(char const *);
  69. char const *const * getColorList();
  70. void setCharset(char const *);
  71. char const *const * getCharsetList();
  72. void setMode(char const *);
  73. char const *const * getModeList();
  74. void Bitmap(Cucul *, int, int, int, int, void *);
  75. private:
  76. cucul_dither *dither;
  77. };
  78. __class Cucul
  79. {
  80. friend class Caca;
  81. friend class Dither;
  82. friend class Font;
  83. public:
  84. Cucul();
  85. Cucul(int width, int height);
  86. ~Cucul();
  87. void setSize(unsigned int w, unsigned int h);
  88. unsigned int getWidth(void);
  89. unsigned int getHeight(void);
  90. unsigned long int getAttr(int, int);
  91. int setAttr(unsigned long int);
  92. int setColorANSI(unsigned char f, unsigned char b);
  93. int setColorARGB(unsigned int f, unsigned int b);
  94. void Printf(int x, int y , char const * format, ...);
  95. void putChar(int x, int y, unsigned long int ch);
  96. unsigned long int getChar(int, int);
  97. void putStr(int x, int y, char *str);
  98. void Clear(void);
  99. void Blit(int, int, Cucul* c1, Cucul* c2);
  100. void Invert();
  101. void Flip();
  102. void Flop();
  103. void Rotate();
  104. void drawLine(int, int, int, int, unsigned long int);
  105. void drawPolyline(int const x[], int const y[], int, unsigned long int);
  106. void drawThinLine(int, int, int, int);
  107. void drawThinPolyline(int const x[], int const y[], int);
  108. void drawCircle(int, int, int, unsigned long int);
  109. void drawEllipse(int, int, int, int, unsigned long int);
  110. void drawThinEllipse(int, int, int, int);
  111. void fillEllipse(int, int, int, int, unsigned long int);
  112. void drawBox(int, int, int, int, unsigned long int);
  113. void drawThinBox(int, int, int, int);
  114. void drawCP437Box(int, int, int, int);
  115. void fillBox(int, int, int, int, unsigned long int);
  116. void drawTriangle(int, int, int, int, int, int, unsigned long int);
  117. void drawThinTriangle(int, int, int, int, int, int);
  118. void fillTriangle(int, int, int, int, int, int, unsigned long int);
  119. int setBoundaries(cucul_canvas_t *, int, int, unsigned int, unsigned int);
  120. unsigned int getFrameCount();
  121. int setFrame(unsigned int);
  122. int createFrame(unsigned int);
  123. int freeFrame(unsigned int);
  124. char const * const * getImportList(void);
  125. long int importMemory(void const *, unsigned long int, char const *);
  126. long int importFile(char const *, char const *);
  127. char const * const * getExportList(void);
  128. void *exportMemory(char const *, unsigned long int *);
  129. static int Rand(int, int);
  130. static char const * getVersion();
  131. protected:
  132. cucul_canvas_t *get_cucul_canvas_t();
  133. private:
  134. cucul_canvas_t *cv;
  135. };
  136. #endif /* _CUCUL_PP_H */