1
0

pgbufferproxy.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. pygame - Python Game Library
  3. Copyright (C) 2000-2001 Pete Shinners
  4. Copyright (C) 2007 Rene Dudfield, Richard Goedeken
  5. This library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Library General Public
  7. License as published by the Free Software Foundation; either
  8. version 2 of the License, or (at your option) any later version.
  9. This library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. Library General Public License for more details.
  13. You should have received a copy of the GNU Library General Public
  14. License along with this library; if not, write to the Free
  15. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. Pete Shinners
  17. pete@shinners.org
  18. */
  19. /* Bufferproxy module C api.
  20. Depends on pygame.h being included first.
  21. */
  22. #if !defined(PG_BUFPROXY_HEADER)
  23. #define PYGAMEAPI_BUFPROXY_NUMSLOTS 4
  24. #define PYGAMEAPI_BUFPROXY_FIRSTSLOT 0
  25. #if !(defined(PYGAMEAPI_BUFPROXY_INTERNAL) || defined(NO_PYGAME_C_API))
  26. static void *PgBUFPROXY_C_API[PYGAMEAPI_BUFPROXY_NUMSLOTS];
  27. typedef PyObject *(*_pgbufproxy_new_t)(PyObject *, getbufferproc);
  28. typedef PyObject *(*_pgbufproxy_get_obj_t)(PyObject *);
  29. typedef int (*_pgbufproxy_trip_t)(PyObject *);
  30. #define pgBufproxy_Type (*(PyTypeObject*)PgBUFPROXY_C_API[0])
  31. #define pgBufproxy_New (*(_pgbufproxy_new_t)PgBUFPROXY_C_API[1])
  32. #define pgBufproxy_GetParent \
  33. (*(_pgbufproxy_get_obj_t)PgBUFPROXY_C_API[2])
  34. #define pgBufproxy_Trip (*(_pgbufproxy_trip_t)PgBUFPROXY_C_API[3])
  35. #define pgBufproxy_Check(x) ((x)->ob_type == (pgBufproxy_Type))
  36. #define import_pygame_bufferproxy() \
  37. _IMPORT_PYGAME_MODULE(bufferproxy, BUFPROXY, PgBUFPROXY_C_API)
  38. #endif /* #if !(defined(PYGAMEAPI_BUFPROXY_INTERNAL) || ... */
  39. #define PG_BUFPROXY_HEADER
  40. #endif /* #if !defined(PG_BUFPROXY_HEADER) */