.gitignore added
[dotfiles/.git] / .local / include / python3.9 / pygame / include / pygame_bufferproxy.h
1 /*
2   pygame - Python Game Library
3   Copyright (C) 2000-2001  Pete Shinners
4   Copyright (C) 2007  Rene Dudfield, Richard Goedeken
5
6   This library is free software; you can redistribute it and/or
7   modify it under the terms of the GNU Library General Public
8   License as published by the Free Software Foundation; either
9   version 2 of the License, or (at your option) any later version.
10
11   This library is distributed in the hope that it will be useful,
12   but WITHOUT ANY WARRANTY; without even the implied warranty of
13   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14   Library General Public License for more details.
15
16   You should have received a copy of the GNU Library General Public
17   License along with this library; if not, write to the Free
18   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
20   Pete Shinners
21   pete@shinners.org
22 */
23
24 /* Bufferproxy module C api. */
25 #if !defined(PG_BUFPROXY_HEADER)
26 #define PG_BUFPROXY_HEADER
27
28 #include <Python.h>
29
30 typedef PyObject *(*_pgbufproxy_new_t)(PyObject *, getbufferproc);
31 typedef PyObject *(*_pgbufproxy_get_obj_t)(PyObject *);
32 typedef int (*_pgbufproxy_trip_t)(PyObject *);
33
34 #ifndef PYGAMEAPI_BUFPROXY_INTERNAL
35
36 #include "pgimport.h"
37
38 PYGAMEAPI_DEFINE_SLOTS(bufferproxy);
39
40 #define pgBufproxy_Type (*(PyTypeObject*) \
41     PYGAMEAPI_GET_SLOT(bufferproxy, 0) )
42
43 #define pgBufproxy_Check(x) ((x)->ob_type == &pgBufproxy_Type)
44
45 #define pgBufproxy_New (*(_pgbufproxy_new_t) \
46     PYGAMEAPI_GET_SLOT(bufferproxy, 1))
47
48 #define pgBufproxy_GetParent \
49     (*(_pgbufproxy_get_obj_t) \
50         PYGAMEAPI_GET_SLOT(bufferproxy, 2))
51
52 #define pgBufproxy_Trip (*(_pgbufproxy_trip_t) \
53     PYGAMEAPI_GET_SLOT(bufferproxy, 3))
54
55 #define import_pygame_bufferproxy() _IMPORT_PYGAME_MODULE(bufferproxy)
56
57 #endif /* ~PYGAMEAPI_BUFPROXY_INTERNAL */
58
59 #endif /* ~defined(PG_BUFPROXY_HEADER) */