SDL_shape_internals.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. Simple DirectMedia Layer
  3. Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
  4. This software is provided 'as-is', without any express or implied
  5. warranty. In no event will the authors be held liable for any damages
  6. arising from the use of this software.
  7. Permission is granted to anyone to use this software for any purpose,
  8. including commercial applications, and to alter it and redistribute it
  9. freely, subject to the following restrictions:
  10. 1. The origin of this software must not be misrepresented; you must not
  11. claim that you wrote the original software. If you use this software
  12. in a product, an acknowledgment in the product documentation would be
  13. appreciated but is not required.
  14. 2. Altered source versions must be plainly marked as such, and must not be
  15. misrepresented as being the original software.
  16. 3. This notice may not be removed or altered from any source distribution.
  17. */
  18. #include "../SDL_internal.h"
  19. #ifndef SDL_shape_internals_h_
  20. #define SDL_shape_internals_h_
  21. #include "SDL_rect.h"
  22. #include "SDL_shape.h"
  23. #include "SDL_surface.h"
  24. #include "begin_code.h"
  25. /* Set up for C function definitions, even when using C++ */
  26. #ifdef __cplusplus
  27. /* *INDENT-OFF* */
  28. extern "C" {
  29. /* *INDENT-ON* */
  30. #endif
  31. struct SDL_ShapeTree;
  32. typedef struct {
  33. struct SDL_ShapeTree *upleft,*upright,*downleft,*downright;
  34. } SDL_QuadTreeChildren;
  35. typedef union {
  36. SDL_QuadTreeChildren children;
  37. SDL_Rect shape;
  38. } SDL_ShapeUnion;
  39. typedef enum { QuadShape,TransparentShape,OpaqueShape } SDL_ShapeKind;
  40. typedef struct SDL_ShapeTree {
  41. SDL_ShapeKind kind;
  42. SDL_ShapeUnion data;
  43. } SDL_ShapeTree;
  44. typedef void(*SDL_TraversalFunction)(SDL_ShapeTree*,void*);
  45. extern void SDL_CalculateShapeBitmap(SDL_WindowShapeMode mode,SDL_Surface *shape,Uint8* bitmap,Uint8 ppb);
  46. extern SDL_ShapeTree* SDL_CalculateShapeTree(SDL_WindowShapeMode mode,SDL_Surface* shape);
  47. extern void SDL_TraverseShapeTree(SDL_ShapeTree *tree,SDL_TraversalFunction function,void* closure);
  48. extern void SDL_FreeShapeTree(SDL_ShapeTree** shape_tree);
  49. /* Ends C function definitions when using C++ */
  50. #ifdef __cplusplus
  51. /* *INDENT-OFF* */
  52. }
  53. /* *INDENT-ON* */
  54. #endif
  55. #include "close_code.h"
  56. #endif