1 | /* |
---|
2 | * PypyCaca libcaca Python bindings |
---|
3 | * Copyright (c) 2006 Jean-Yves Lamoureux <jylam@lnxscene.org> |
---|
4 | * All Rights Reserved |
---|
5 | * |
---|
6 | * $Id: pypycaca.h 819 2006-04-19 10:10:58Z sam $ |
---|
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 | |
---|
14 | #include <Python.h> |
---|
15 | #include <caca.h> |
---|
16 | #define SET_INTCONSTANT(dict, value) \ |
---|
17 | PyDict_SetItemString(dict, #value, PyInt_FromLong((long) value)) |
---|
18 | |
---|
19 | |
---|
20 | PyMODINIT_FUNC initcaca(void); |
---|
21 | |
---|
22 | /* Basic functions */ |
---|
23 | |
---|
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_display_title(PyObject *self, PyObject *args); |
---|
42 | static PyObject * |
---|
43 | pycaca_get_display_width(PyObject *self, PyObject *args); |
---|
44 | static PyObject * |
---|
45 | pycaca_get_display_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 | |
---|
57 | /* Event handling */ |
---|
58 | static PyObject * |
---|
59 | pycaca_get_event(PyObject *self, PyObject *args); |
---|
60 | static PyObject * |
---|
61 | pycaca_wait_event(PyObject *self, PyObject *args); |
---|
62 | static PyObject * |
---|
63 | pycaca_get_mouse_x(PyObject *self, PyObject *args); |
---|
64 | static PyObject * |
---|
65 | pycaca_get_mouse_y(PyObject *self, PyObject *args); |
---|
66 | |
---|
67 | |
---|
68 | /* Primitives drawing */ |
---|
69 | static PyObject * |
---|
70 | pycaca_draw_line(PyObject *self, PyObject *args); |
---|
71 | static PyObject * |
---|
72 | pycaca_draw_polyline(PyObject *self, PyObject *args); |
---|
73 | static PyObject * |
---|
74 | pycaca_draw_thin_polyline(PyObject *self, PyObject *args); |
---|
75 | static PyObject * |
---|
76 | pycaca_draw_thin_line(PyObject *self, PyObject *args); |
---|
77 | static PyObject * |
---|
78 | pycaca_draw_circle(PyObject *self, PyObject *args); |
---|
79 | static PyObject * |
---|
80 | pycaca_draw_ellipse(PyObject *self, PyObject *args); |
---|
81 | static PyObject * |
---|
82 | pycaca_draw_thin_ellipse(PyObject *self, PyObject *args); |
---|
83 | static PyObject * |
---|
84 | pycaca_fill_ellipse(PyObject *self, PyObject *args); |
---|
85 | static PyObject * |
---|
86 | pycaca_draw_box(PyObject *self, PyObject *args); |
---|
87 | static PyObject * |
---|
88 | pycaca_fill_box(PyObject *self, PyObject *args); |
---|
89 | static PyObject * |
---|
90 | pycaca_draw_thin_box(PyObject *self, PyObject *args); |
---|
91 | static PyObject * |
---|
92 | pycaca_draw_triangle(PyObject *self, PyObject *args); |
---|
93 | static PyObject * |
---|
94 | pycaca_draw_thin_triangle(PyObject *self, PyObject *args); |
---|
95 | static PyObject * |
---|
96 | pycaca_fill_triangle(PyObject *self, PyObject *args); |
---|
97 | |
---|
98 | /* Charactere drawing */ |
---|
99 | static PyObject * |
---|
100 | pycaca_set_color(PyObject *self, PyObject *args); |
---|
101 | static PyObject * |
---|
102 | pycaca_get_fg_color(PyObject *self, PyObject *args); |
---|
103 | static PyObject * |
---|
104 | pycaca_get_bg_color(PyObject *self, PyObject *args); |
---|
105 | static PyObject * |
---|
106 | pycaca_get_color_name(PyObject *self, PyObject *args); |
---|
107 | static PyObject * |
---|
108 | pycaca_putchar(PyObject *self, PyObject *args); |
---|
109 | static PyObject * |
---|
110 | pycaca_putstr(PyObject *self, PyObject *args); |
---|
111 | static PyObject * |
---|
112 | pycaca_printf(PyObject *self, PyObject *args); |
---|
113 | /*static PyObject * |
---|
114 | pycaca_get_screen(PyObject *self, PyObject *args);*/ |
---|
115 | static PyObject * |
---|
116 | pycaca_clear(PyObject *self, PyObject *args); |
---|
117 | |
---|
118 | |
---|
119 | /* Sprites functions */ |
---|
120 | static PyObject * |
---|
121 | pycaca_load_sprite(PyObject *self, PyObject *args); |
---|
122 | static PyObject * |
---|
123 | pycaca_draw_sprite(PyObject *self, PyObject *args); |
---|
124 | static PyObject * |
---|
125 | pycaca_get_sprite_frames(PyObject *self, PyObject *args); |
---|
126 | static PyObject * |
---|
127 | pycaca_get_sprite_width(PyObject *self, PyObject *args); |
---|
128 | static PyObject * |
---|
129 | pycaca_get_sprite_height(PyObject *self, PyObject *args); |
---|
130 | static PyObject * |
---|
131 | pycaca_get_sprite_dx(PyObject *self, PyObject *args); |
---|
132 | static PyObject * |
---|
133 | pycaca_get_sprite_dy(PyObject *self, PyObject *args); |
---|
134 | static PyObject * |
---|
135 | pycaca_free_sprite(PyObject *self, PyObject *args); |
---|
136 | |
---|
137 | |
---|
138 | |
---|
139 | /* Exporters */ |
---|
140 | static PyObject * |
---|
141 | pycaca_get_html(PyObject *self, PyObject *args); |
---|
142 | static PyObject * |
---|
143 | pycaca_get_html3(PyObject *self, PyObject *args); |
---|
144 | static PyObject * |
---|
145 | pycaca_get_irc(PyObject *self, PyObject *args); |
---|
146 | static PyObject * |
---|
147 | pycaca_get_ansi(PyObject *self, PyObject *args); |
---|
148 | |
---|
149 | |
---|
150 | /* Bitmap functions */ |
---|
151 | static PyObject * |
---|
152 | pycaca_create_bitmap(PyObject *self, PyObject *args); |
---|
153 | static PyObject * |
---|
154 | pycaca_set_bitmap_palette(PyObject *self, PyObject *args); |
---|
155 | static PyObject * |
---|
156 | pycaca_set_bitmap_gamma(PyObject *self, PyObject *args); |
---|
157 | static PyObject * |
---|
158 | pycaca_draw_bitmap(PyObject *self, PyObject *args); |
---|
159 | static PyObject * |
---|
160 | pycaca_free_bitmap(PyObject *self, PyObject *args); |
---|