mask.h 620 B

12345678910111213141516171819202122232425
  1. #include <Python.h>
  2. #include "bitmask.h"
  3. #define PYGAMEAPI_MASK_FIRSTSLOT 0
  4. #define PYGAMEAPI_MASK_NUMSLOTS 1
  5. #define PYGAMEAPI_LOCAL_ENTRY "_PYGAME_C_API"
  6. typedef struct {
  7. PyObject_HEAD
  8. bitmask_t *mask;
  9. } pgMaskObject;
  10. #define pgMask_AsBitmap(x) (((pgMaskObject*)x)->mask)
  11. #ifndef PYGAMEAPI_MASK_INTERNAL
  12. #define pgMask_Type (*(PyTypeObject*)PyMASK_C_API[0])
  13. #define pgMask_Check(x) ((x)->ob_type == &pgMask_Type)
  14. #define import_pygame_mask() \
  15. _IMPORT_PYGAME_MODULE(mask, MASK, PyMASK_C_API)
  16. static void* PyMASK_C_API[PYGAMEAPI_MASK_NUMSLOTS] = {NULL};
  17. #endif /* #ifndef PYGAMEAPI_MASK_INTERNAL */