Mercurial > pygame
annotate src/pgview.h @ 3172:d1b367fc08bc tests-returncode
Use a return code of 1 when the tests fail.
| author | Thomas Kluyver <takowl@gmail.com> |
|---|---|
| date | Wed, 09 Jan 2013 10:13:57 +0000 |
| parents | 841b902f3d15 |
| children |
| rev | line source |
|---|---|
|
2131
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
1 /* |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
2 pygame - Python Game Library |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
3 Copyright (C) 2000-2001 Pete Shinners |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
4 Copyright (C) 2007 Rene Dudfield, Richard Goedeken |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
5 |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
6 This library is free software; you can redistribute it and/or |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
7 modify it under the terms of the GNU Library General Public |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
8 License as published by the Free Software Foundation; either |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
9 version 2 of the License, or (at your option) any later version. |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
10 |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
11 This library is distributed in the hope that it will be useful, |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
12 but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
14 Library General Public License for more details. |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
15 |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
16 You should have received a copy of the GNU Library General Public |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
17 License along with this library; if not, write to the Free |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
19 |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
20 Pete Shinners |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
21 pete@shinners.org |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
22 */ |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
23 |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
24 /* View module C api. |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
25 Depends on pygame.h being included first. |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
26 */ |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
27 #if !defined(PG_VIEW_HEADER) |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
28 |
|
3014
841b902f3d15
Centralize common array struct interface operations in the _view module
Lenard Lindstrom <len-l@telus.net>
parents:
2131
diff
changeset
|
29 #include "pgarrinter.h" |
|
841b902f3d15
Centralize common array struct interface operations in the _view module
Lenard Lindstrom <len-l@telus.net>
parents:
2131
diff
changeset
|
30 |
|
2131
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
31 typedef void (*PgView_Destructor)(PyObject *view); |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
32 |
|
3014
841b902f3d15
Centralize common array struct interface operations in the _view module
Lenard Lindstrom <len-l@telus.net>
parents:
2131
diff
changeset
|
33 #define PYGAMEAPI_VIEW_NUMSLOTS 6 |
|
2131
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
34 #define PYGAMEAPI_VIEW_FIRSTSLOT 0 |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
35 |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
36 #if !(defined(PYGAMEAPI_VIEW_INTERNAL) || defined(NO_PYGAME_C_API)) |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
37 static void *PgVIEW_C_API[PYGAMEAPI_VIEW_NUMSLOTS]; |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
38 |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
39 typedef PyObject *(*_pgview_new_t)(PyObject *capsule, |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
40 PyObject *parent, |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
41 PgView_Destructor dest); |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
42 typedef PyObject *(*_pgview_get_t)(PyObject *view); |
|
3014
841b902f3d15
Centralize common array struct interface operations in the _view module
Lenard Lindstrom <len-l@telus.net>
parents:
2131
diff
changeset
|
43 typedef int *(*_pg_getarrayinterface_t)(PyObject *obj, |
|
841b902f3d15
Centralize common array struct interface operations in the _view module
Lenard Lindstrom <len-l@telus.net>
parents:
2131
diff
changeset
|
44 PyObject **cobj_p, |
|
841b902f3d15
Centralize common array struct interface operations in the _view module
Lenard Lindstrom <len-l@telus.net>
parents:
2131
diff
changeset
|
45 PyArrayInterface **inter_p); |
|
841b902f3d15
Centralize common array struct interface operations in the _view module
Lenard Lindstrom <len-l@telus.net>
parents:
2131
diff
changeset
|
46 typedef PyObject *(*_pg_arraystructasdict_t)(PyArrayInterface *inter_p); |
|
2131
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
47 |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
48 #define PgView_Type (*(PyTypeObject*)PgVIEW_C_API[0]) |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
49 #define PgView_New (*(_pgview_new_t)PgVIEW_C_API[1]) |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
50 #define PgView_GetCapsule (*(_pgview_get_t)PgVIEW_C_API[2]) |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
51 #define PgView_GetParent (*(_pgview_get_t)PgVIEW_C_API[3]) |
|
3014
841b902f3d15
Centralize common array struct interface operations in the _view module
Lenard Lindstrom <len-l@telus.net>
parents:
2131
diff
changeset
|
52 #define Pg_GetArrayInterface (*(_pg_getarrayinterface_t)PgVIEW_C_API[4]) |
|
841b902f3d15
Centralize common array struct interface operations in the _view module
Lenard Lindstrom <len-l@telus.net>
parents:
2131
diff
changeset
|
53 #define Pg_ArrayStructAsDict (*(_pg_arraystructasdict_t)PgVIEW_C_API[5]) |
|
2131
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
54 #define PgView_Check(x) ((x)->ob_type == (PgView_Type)) |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
55 #define import_pygame_view() \ |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
56 _IMPORT_PYGAME_MODULE(_view, VIEW, PgVIEW_C_API) |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
57 |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
58 #endif /* #if !(defined(PYGAMEAPI_VIEW_INTERNAL) || ... */ |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
59 |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
60 #define PG_VIEW_HEADER |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
61 |
|
018779fb04f5
Merge the buffer branch back into trunk.
Lenard Lindstrom <len-l@telus.net>
parents:
diff
changeset
|
62 #endif /* #if !defined(PG_VIEW_HEADER) */ |
