Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

168 linhas
5.1 KiB

  1. /*
  2. * PypyCaca libcaca Python bindings
  3. * Copyright (c) 2006 Jean-Yves Lamoureux <jylam@lnxscene.org>
  4. * All Rights Reserved
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the Do What The Fuck You Want To
  8. * Public License, Version 2, as published by Sam Hocevar. See
  9. * http://sam.zoy.org/wtfpl/COPYING for more details.
  10. */
  11. /** \file pycaca.h
  12. * \version \$Id:
  13. * \author Jean-Yves Lamoureux <jylam@lnxscene.org>
  14. * \brief Main \e pypycaca bindings definitions
  15. *
  16. * This file contains functions prototypes for python bindings
  17. */
  18. #include <Python.h>
  19. #include <caca.h>
  20. #define SET_INTCONSTANT(dict, value) \
  21. PyDict_SetItemString(dict, #value, PyInt_FromLong((long) value))
  22. PyMODINIT_FUNC initcaca(void);
  23. /* Basic functions */
  24. static PyObject *
  25. pycaca_init(PyObject *self, PyObject *args);
  26. static PyObject *
  27. pycaca_set_delay(PyObject *self, PyObject *args);
  28. static PyObject *
  29. pycaca_get_rendertime(PyObject *self, PyObject *args);
  30. static PyObject *
  31. pycaca_get_width(PyObject *self, PyObject *args);
  32. static PyObject *
  33. pycaca_get_height(PyObject *self, PyObject *args);
  34. static PyObject *
  35. pycaca_set_size(PyObject *self, PyObject *args);
  36. static PyObject *
  37. pycaca_set_width(PyObject *self, PyObject *args);
  38. static PyObject *
  39. pycaca_set_height(PyObject *self, PyObject *args);
  40. static PyObject *
  41. pycaca_set_window_title(PyObject *self, PyObject *args);
  42. static PyObject *
  43. pycaca_get_window_width(PyObject *self, PyObject *args);
  44. static PyObject *
  45. pycaca_get_window_height(PyObject *self, PyObject *args);
  46. static PyObject *
  47. pycaca_refresh(PyObject *self, PyObject *args);
  48. static PyObject *
  49. pycaca_end(PyObject *self, PyObject *args);
  50. static PyObject *
  51. pycaca_get_feature(PyObject *self, PyObject *args);
  52. static PyObject *
  53. pycaca_set_feature(PyObject *self, PyObject *args);
  54. static PyObject *
  55. pycaca_get_feature_name(PyObject *self, PyObject *args);
  56. /* Event handling */
  57. static PyObject *
  58. pycaca_get_event(PyObject *self, PyObject *args);
  59. static PyObject *
  60. pycaca_wait_event(PyObject *self, PyObject *args);
  61. static PyObject *
  62. pycaca_get_mouse_x(PyObject *self, PyObject *args);
  63. static PyObject *
  64. pycaca_get_mouse_y(PyObject *self, PyObject *args);
  65. /* Primitives drawing */
  66. static PyObject *
  67. pycaca_draw_line(PyObject *self, PyObject *args);
  68. static PyObject *
  69. pycaca_draw_polyline(PyObject *self, PyObject *args);
  70. static PyObject *
  71. pycaca_draw_thin_polyline(PyObject *self, PyObject *args);
  72. static PyObject *
  73. pycaca_draw_thin_line(PyObject *self, PyObject *args);
  74. static PyObject *
  75. pycaca_draw_circle(PyObject *self, PyObject *args);
  76. static PyObject *
  77. pycaca_draw_ellipse(PyObject *self, PyObject *args);
  78. static PyObject *
  79. pycaca_draw_thin_ellipse(PyObject *self, PyObject *args);
  80. static PyObject *
  81. pycaca_fill_ellipse(PyObject *self, PyObject *args);
  82. static PyObject *
  83. pycaca_draw_box(PyObject *self, PyObject *args);
  84. static PyObject *
  85. pycaca_fill_box(PyObject *self, PyObject *args);
  86. static PyObject *
  87. pycaca_draw_thin_box(PyObject *self, PyObject *args);
  88. static PyObject *
  89. pycaca_draw_triangle(PyObject *self, PyObject *args);
  90. static PyObject *
  91. pycaca_draw_thin_triangle(PyObject *self, PyObject *args);
  92. static PyObject *
  93. pycaca_fill_triangle(PyObject *self, PyObject *args);
  94. /* Charactere drawing */
  95. static PyObject *
  96. pycaca_set_color(PyObject *self, PyObject *args);
  97. static PyObject *
  98. pycaca_get_fg_color(PyObject *self, PyObject *args);
  99. static PyObject *
  100. pycaca_get_bg_color(PyObject *self, PyObject *args);
  101. static PyObject *
  102. pycaca_get_color_name(PyObject *self, PyObject *args);
  103. static PyObject *
  104. pycaca_putchar(PyObject *self, PyObject *args);
  105. static PyObject *
  106. pycaca_putstr(PyObject *self, PyObject *args);
  107. static PyObject *
  108. pycaca_printf(PyObject *self, PyObject *args);
  109. /*static PyObject *
  110. pycaca_get_screen(PyObject *self, PyObject *args);*/
  111. static PyObject *
  112. pycaca_clear(PyObject *self, PyObject *args);
  113. /* Sprites functions */
  114. static PyObject *
  115. pycaca_load_sprite(PyObject *self, PyObject *args);
  116. static PyObject *
  117. pycaca_draw_sprite(PyObject *self, PyObject *args);
  118. static PyObject *
  119. pycaca_get_sprite_frames(PyObject *self, PyObject *args);
  120. static PyObject *
  121. pycaca_get_sprite_width(PyObject *self, PyObject *args);
  122. static PyObject *
  123. pycaca_get_sprite_height(PyObject *self, PyObject *args);
  124. static PyObject *
  125. pycaca_get_sprite_dx(PyObject *self, PyObject *args);
  126. static PyObject *
  127. pycaca_get_sprite_dy(PyObject *self, PyObject *args);
  128. static PyObject *
  129. pycaca_free_sprite(PyObject *self, PyObject *args);
  130. /* Exporters */
  131. static PyObject *
  132. pycaca_get_html(PyObject *self, PyObject *args);
  133. static PyObject *
  134. pycaca_get_html3(PyObject *self, PyObject *args);
  135. static PyObject *
  136. pycaca_get_irc(PyObject *self, PyObject *args);
  137. static PyObject *
  138. pycaca_get_ansi(PyObject *self, PyObject *args);
  139. /* Bitmap functions */
  140. static PyObject *
  141. pycaca_create_bitmap(PyObject *self, PyObject *args);
  142. static PyObject *
  143. pycaca_set_bitmap_palette(PyObject *self, PyObject *args);
  144. static PyObject *
  145. pycaca_set_bitmap_gamma(PyObject *self, PyObject *args);
  146. static PyObject *
  147. pycaca_draw_bitmap(PyObject *self, PyObject *args);
  148. static PyObject *
  149. pycaca_free_bitmap(PyObject *self, PyObject *args);