[518] | 1 | /* |
---|
| 2 | * PypyCaca libcaca Python bindings |
---|
| 3 | * Copyright (c) 2006 Jean-Yves Lamoureux <jylam@lnxscene.org> |
---|
| 4 | * All Rights Reserved |
---|
| 5 | * |
---|
[769] | 6 | * $Id: pypycaca.h 1462 2006-12-12 01:53:54Z sam $ |
---|
| 7 | * |
---|
[1462] | 8 | * This library is free software. It comes without any warranty, to |
---|
[1452] | 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 |
---|
[522] | 12 | * http://sam.zoy.org/wtfpl/COPYING for more details. |
---|
[518] | 13 | */ |
---|
| 14 | |
---|
| 15 | #include <Python.h> |
---|
| 16 | #include <caca.h> |
---|
| 17 | #define SET_INTCONSTANT(dict, value) \ |
---|
| 18 | PyDict_SetItemString(dict, #value, PyInt_FromLong((long) value)) |
---|
| 19 | |
---|
| 20 | |
---|
| 21 | PyMODINIT_FUNC initcaca(void); |
---|
| 22 | |
---|
| 23 | /* Basic functions */ |
---|
| 24 | |
---|
| 25 | static PyObject * |
---|
| 26 | pycaca_init(PyObject *self, PyObject *args); |
---|
| 27 | static PyObject * |
---|
[964] | 28 | pycaca_set_display_time(PyObject *self, PyObject *args); |
---|
[518] | 29 | static PyObject * |
---|
[964] | 30 | pycaca_get_display_time(PyObject *self, PyObject *args); |
---|
[518] | 31 | static PyObject * |
---|
| 32 | pycaca_get_width(PyObject *self, PyObject *args); |
---|
| 33 | static PyObject * |
---|
| 34 | pycaca_get_height(PyObject *self, PyObject *args); |
---|
| 35 | static PyObject * |
---|
| 36 | pycaca_set_size(PyObject *self, PyObject *args); |
---|
| 37 | static PyObject * |
---|
| 38 | pycaca_set_width(PyObject *self, PyObject *args); |
---|
| 39 | static PyObject * |
---|
| 40 | pycaca_set_height(PyObject *self, PyObject *args); |
---|
| 41 | static PyObject * |
---|
[819] | 42 | pycaca_set_display_title(PyObject *self, PyObject *args); |
---|
[518] | 43 | static PyObject * |
---|
[819] | 44 | pycaca_get_display_width(PyObject *self, PyObject *args); |
---|
[518] | 45 | static PyObject * |
---|
[819] | 46 | pycaca_get_display_height(PyObject *self, PyObject *args); |
---|
[518] | 47 | static PyObject * |
---|
| 48 | pycaca_refresh(PyObject *self, PyObject *args); |
---|
| 49 | static PyObject * |
---|
| 50 | pycaca_end(PyObject *self, PyObject *args); |
---|
| 51 | static PyObject * |
---|
| 52 | pycaca_get_feature(PyObject *self, PyObject *args); |
---|
| 53 | static PyObject * |
---|
| 54 | pycaca_set_feature(PyObject *self, PyObject *args); |
---|
| 55 | static PyObject * |
---|
| 56 | pycaca_get_feature_name(PyObject *self, PyObject *args); |
---|
| 57 | |
---|
| 58 | /* Event handling */ |
---|
| 59 | static PyObject * |
---|
| 60 | pycaca_get_event(PyObject *self, PyObject *args); |
---|
| 61 | static PyObject * |
---|
| 62 | pycaca_wait_event(PyObject *self, PyObject *args); |
---|
| 63 | static PyObject * |
---|
| 64 | pycaca_get_mouse_x(PyObject *self, PyObject *args); |
---|
| 65 | static PyObject * |
---|
| 66 | pycaca_get_mouse_y(PyObject *self, PyObject *args); |
---|
| 67 | |
---|
| 68 | |
---|
| 69 | /* Primitives drawing */ |
---|
| 70 | static PyObject * |
---|
| 71 | pycaca_draw_line(PyObject *self, PyObject *args); |
---|
| 72 | static PyObject * |
---|
| 73 | pycaca_draw_polyline(PyObject *self, PyObject *args); |
---|
| 74 | static PyObject * |
---|
| 75 | pycaca_draw_thin_polyline(PyObject *self, PyObject *args); |
---|
| 76 | static PyObject * |
---|
| 77 | pycaca_draw_thin_line(PyObject *self, PyObject *args); |
---|
| 78 | static PyObject * |
---|
| 79 | pycaca_draw_circle(PyObject *self, PyObject *args); |
---|
| 80 | static PyObject * |
---|
| 81 | pycaca_draw_ellipse(PyObject *self, PyObject *args); |
---|
| 82 | static PyObject * |
---|
| 83 | pycaca_draw_thin_ellipse(PyObject *self, PyObject *args); |
---|
| 84 | static PyObject * |
---|
| 85 | pycaca_fill_ellipse(PyObject *self, PyObject *args); |
---|
| 86 | static PyObject * |
---|
| 87 | pycaca_draw_box(PyObject *self, PyObject *args); |
---|
| 88 | static PyObject * |
---|
| 89 | pycaca_fill_box(PyObject *self, PyObject *args); |
---|
| 90 | static PyObject * |
---|
| 91 | pycaca_draw_thin_box(PyObject *self, PyObject *args); |
---|
| 92 | static PyObject * |
---|
| 93 | pycaca_draw_triangle(PyObject *self, PyObject *args); |
---|
| 94 | static PyObject * |
---|
| 95 | pycaca_draw_thin_triangle(PyObject *self, PyObject *args); |
---|
| 96 | static PyObject * |
---|
| 97 | pycaca_fill_triangle(PyObject *self, PyObject *args); |
---|
| 98 | |
---|
| 99 | /* Charactere drawing */ |
---|
| 100 | static PyObject * |
---|
| 101 | pycaca_set_color(PyObject *self, PyObject *args); |
---|
| 102 | static PyObject * |
---|
| 103 | pycaca_get_fg_color(PyObject *self, PyObject *args); |
---|
| 104 | static PyObject * |
---|
| 105 | pycaca_get_bg_color(PyObject *self, PyObject *args); |
---|
| 106 | static PyObject * |
---|
| 107 | pycaca_get_color_name(PyObject *self, PyObject *args); |
---|
| 108 | static PyObject * |
---|
| 109 | pycaca_putchar(PyObject *self, PyObject *args); |
---|
| 110 | static PyObject * |
---|
| 111 | pycaca_putstr(PyObject *self, PyObject *args); |
---|
| 112 | static PyObject * |
---|
| 113 | pycaca_printf(PyObject *self, PyObject *args); |
---|
| 114 | /*static PyObject * |
---|
| 115 | pycaca_get_screen(PyObject *self, PyObject *args);*/ |
---|
| 116 | static PyObject * |
---|
| 117 | pycaca_clear(PyObject *self, PyObject *args); |
---|
| 118 | |
---|
| 119 | |
---|
| 120 | /* Sprites functions */ |
---|
| 121 | static PyObject * |
---|
| 122 | pycaca_load_sprite(PyObject *self, PyObject *args); |
---|
| 123 | static PyObject * |
---|
| 124 | pycaca_draw_sprite(PyObject *self, PyObject *args); |
---|
| 125 | static PyObject * |
---|
| 126 | pycaca_get_sprite_frames(PyObject *self, PyObject *args); |
---|
| 127 | static PyObject * |
---|
| 128 | pycaca_get_sprite_width(PyObject *self, PyObject *args); |
---|
| 129 | static PyObject * |
---|
| 130 | pycaca_get_sprite_height(PyObject *self, PyObject *args); |
---|
| 131 | static PyObject * |
---|
| 132 | pycaca_get_sprite_dx(PyObject *self, PyObject *args); |
---|
| 133 | static PyObject * |
---|
| 134 | pycaca_get_sprite_dy(PyObject *self, PyObject *args); |
---|
| 135 | static PyObject * |
---|
| 136 | pycaca_free_sprite(PyObject *self, PyObject *args); |
---|
| 137 | |
---|
| 138 | |
---|
| 139 | |
---|
| 140 | /* Exporters */ |
---|
| 141 | static PyObject * |
---|
| 142 | pycaca_get_html(PyObject *self, PyObject *args); |
---|
| 143 | static PyObject * |
---|
| 144 | pycaca_get_html3(PyObject *self, PyObject *args); |
---|
| 145 | static PyObject * |
---|
| 146 | pycaca_get_irc(PyObject *self, PyObject *args); |
---|
| 147 | static PyObject * |
---|
| 148 | pycaca_get_ansi(PyObject *self, PyObject *args); |
---|
| 149 | |
---|
| 150 | |
---|
| 151 | /* Bitmap functions */ |
---|
| 152 | static PyObject * |
---|
| 153 | pycaca_create_bitmap(PyObject *self, PyObject *args); |
---|
| 154 | static PyObject * |
---|
| 155 | pycaca_set_bitmap_palette(PyObject *self, PyObject *args); |
---|
| 156 | static PyObject * |
---|
| 157 | pycaca_set_bitmap_gamma(PyObject *self, PyObject *args); |
---|
| 158 | static PyObject * |
---|
| 159 | pycaca_draw_bitmap(PyObject *self, PyObject *args); |
---|
| 160 | static PyObject * |
---|
| 161 | pycaca_free_bitmap(PyObject *self, PyObject *args); |
---|