comparison include/SDL_shape.h @ 4781:fc4c775b468a

Added Andreas's fixes to the header and stub file for SDL_shape.
author Eli Gottlieb <eligottlieb@gmail.com>
date Mon, 21 Jun 2010 23:08:10 -0400
parents 4f915a47b995
children b6930aefd008
comparison
equal deleted inserted replaced
4780:4f915a47b995 4781:fc4c775b468a
37 /* *INDENT-ON* */ 37 /* *INDENT-ON* */
38 #endif 38 #endif
39 39
40 /** \file SDL_shape.h 40 /** \file SDL_shape.h
41 * 41 *
42 * Header file for shaped windows. 42 * Header file for the shaped window API.
43 */ 43 */
44 44
45 /** 45 /**
46 * \brief Create a shaped window with the specified position, dimensions, and flags. 46 * \brief Create a window that can be shaped with the specified position, dimensions, and flags.
47 * 47 *
48 * \param title The title of the window, in UTF-8 encoding. 48 * \param title The title of the window, in UTF-8 encoding.
49 * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or 49 * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or
50 * ::SDL_WINDOWPOS_UNDEFINED. 50 * ::SDL_WINDOWPOS_UNDEFINED.
51 * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or 51 * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or
67 /** 67 /**
68 * \brief Return whether the given window is a shaped window. 68 * \brief Return whether the given window is a shaped window.
69 * 69 *
70 * \param window The window to query for being shaped. 70 * \param window The window to query for being shaped.
71 * 71 *
72 * \return SDL_TRUE if the window is a shaped window and SDL_FALSE otherwise. 72 * \return SDL_TRUE if the window is a window that can be shaped, SDL_FALSE if the window is unshaped or NULL.
73 * \sa SDL_CreateShapedWindow 73 * \sa SDL_CreateShapedWindow
74 */ 74 */
75 extern DECLSPEC SDL_bool SDLCALL SDL_WindowIsShaped(const SDL_Window *window); 75 extern DECLSPEC SDL_bool SDLCALL SDL_IsShapedWindow(const SDL_Window *window);
76 76
77 /** \brief An enum denoting the specific type of contents present in an SDL_WindowShapeParams union. */ 77 /** \brief An enum denoting the specific type of contents present in an SDL_WindowShapeParams union. */
78 typedef enum {ShapeModeDefault, ShapeModeBinarizeAlpha} WindowShapeMode; 78 typedef enum {
79 /** \brief The default mode, a binarized alpha cutoff of 1. */
80 ShapeModeDefault,
81 /** \brief A binarized alpha cutoff with a given integer value. */
82 ShapeModeBinarizeAlpha
83 } WindowShapeMode;
79 /** \brief A union containing parameters for shaped windows. */ 84 /** \brief A union containing parameters for shaped windows. */
80 typedef union { 85 typedef union {
81 /** \brief a cutoff alpha value for binarization of the window shape's alpha channel. */ 86 /** \brief a cutoff alpha value for binarization of the window shape's alpha channel. */
82 Uint8 binarizationCutoff; 87 Uint8 binarizationCutoff;
83 } SDL_WindowShapeParams; 88 } SDL_WindowShapeParams;
92 97
93 /** 98 /**
94 * \brief Set the shape and parameters of a shaped window. 99 * \brief Set the shape and parameters of a shaped window.
95 * 100 *
96 * \param window The shaped window whose parameters should be set. 101 * \param window The shaped window whose parameters should be set.
97 * \param shape A surface encoding the desired shape for the window as a bitmap mask. 102 * \param shape A surface encoding the desired shape for the window.
98 * \param parameters The parameters to set for the shaped window. 103 * \param shapeMode The parameters to set for the shaped window.
99 * 104 *
100 * \return 0 on success, -1 on invalid an invalid shape argument, or -2 if the SDL_Window* given does not reference 105 * \return 0 on success, -1 on invalid an invalid shape argument, or -2 if the SDL_Window* given does not reference
101 * a valid shaped window. 106 * a valid shaped window.
102 * 107 *
103 * \sa SDL_WindowShapeMode 108 * \sa SDL_WindowShapeMode
104 * \sa SDL_GetShapeParameters. 109 * \sa SDL_GetShapedWindowMode.
105 */ 110 */
106 extern DECLSPEC int SDLCALL SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode parameters); 111 extern DECLSPEC int SDLCALL SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *shapeMode);
107 112
108 /** 113 /**
109 * \brief Set the shape parameters of a shaped window. 114 * \brief Get the shape parameters of a shaped window.
110 * 115 *
111 * \param window The shaped window whose parameters should be retrieved. 116 * \param window The shaped window whose parameters should be retrieved.
112 * \param shapeMode An empty shape-parameters structure to fill. 117 * \param shapeMode An empty shape-parameters structure to fill.
113 * 118 *
114 * \return 0 on success, -1 on a null shapeMode, or -2 if the SDL_Window given is not a shaped window. 119 * \return 0 on success, -1 on a null shapeMode, or -2 if the SDL_Window given is not a shaped window, or -3 if the
120 * SDL_Window given is a window that can be shaped but isn't.
115 * 121 *
116 * \sa SDL_WindowShapeMode 122 * \sa SDL_WindowShapeMode
117 * \sa SDL_SetShapeParameters 123 * \sa SDL_SetWindowShape
118 */ 124 */
119 extern DECLSPEC int SDLCALL SDL_GetShapeParameters(SDL_Window *window,SDL_WindowShapeMode *shapeMode); 125 extern DECLSPEC int SDLCALL SDL_GetShapedWindowMode(SDL_Window *window,SDL_WindowShapeMode *shapeMode);
120 126
121 /* Ends C function definitions when using C++ */ 127 /* Ends C function definitions when using C++ */
122 #ifdef __cplusplus 128 #ifdef __cplusplus
123 /* *INDENT-OFF* */ 129 /* *INDENT-OFF* */
124 } 130 }