Skip to content

Commit b3ba1c1

Browse files
LordOfXenslouken
authored andcommitted
Update SDL_clipboard.h
Typo fixes and a small addition to SDL_SetClipboardData about mime_type list usage clarity.
1 parent 30f0aeb commit b3ba1c1

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

include/SDL3/SDL_clipboard.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetClipboardText(const char *text);
106106
/**
107107
* Get UTF-8 text from the clipboard.
108108
*
109-
* This functions returns an empty string if there was not enough memory left
109+
* This function returns an empty string if there is not enough memory left
110110
* for a copy of the clipboard's content.
111111
*
112112
* \returns the clipboard text on success or an empty string on failure; call
@@ -155,7 +155,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetPrimarySelectionText(const char *text);
155155
/**
156156
* Get UTF-8 text from the primary selection.
157157
*
158-
* This functions returns an empty string if there was not enough memory left
158+
* This function returns an empty string if there is not enough memory left
159159
* for a copy of the primary selection's content.
160160
*
161161
* \returns the primary selection text on success or an empty string on
@@ -194,15 +194,15 @@ extern SDL_DECLSPEC bool SDLCALL SDL_HasPrimarySelectionText(void);
194194
* clipboard is cleared or new data is set. The clipboard is automatically
195195
* cleared in SDL_Quit().
196196
*
197-
* \param userdata a pointer to provided user data.
197+
* \param userdata a pointer to the provided user data.
198198
* \param mime_type the requested mime-type.
199199
* \param size a pointer filled in with the length of the returned data.
200200
* \returns a pointer to the data for the provided mime-type. Returning NULL
201-
* or setting length to 0 will cause no data to be sent to the
201+
* or setting the length to 0 will cause no data to be sent to the
202202
* "receiver". It is up to the receiver to handle this. Essentially
203203
* returning no data is more or less undefined behavior and may cause
204204
* breakage in receiving applications. The returned data will not be
205-
* freed so it needs to be retained and dealt with internally.
205+
* freed, so it needs to be retained and dealt with internally.
206206
*
207207
* \since This function is available since SDL 3.2.0.
208208
*
@@ -211,10 +211,10 @@ extern SDL_DECLSPEC bool SDLCALL SDL_HasPrimarySelectionText(void);
211211
typedef const void *(SDLCALL *SDL_ClipboardDataCallback)(void *userdata, const char *mime_type, size_t *size);
212212

213213
/**
214-
* Callback function that will be called when the clipboard is cleared, or new
214+
* Callback function that will be called when the clipboard is cleared, or when new
215215
* data is set.
216216
*
217-
* \param userdata a pointer to provided user data.
217+
* \param userdata a pointer to the provided user data.
218218
*
219219
* \since This function is available since SDL 3.2.0.
220220
*
@@ -231,15 +231,15 @@ typedef void (SDLCALL *SDL_ClipboardCleanupCallback)(void *userdata);
231231
* respond with the data for the requested mime-type.
232232
*
233233
* The size of text data does not include any terminator, and the text does
234-
* not need to be null terminated (e.g. you can directly copy a portion of a
234+
* not need to be null-terminated (e.g., you can directly copy a portion of a
235235
* document).
236236
*
237237
* \param callback a function pointer to the function that provides the
238238
* clipboard data.
239239
* \param cleanup a function pointer to the function that cleans up the
240240
* clipboard data.
241241
* \param userdata an opaque pointer that will be forwarded to the callbacks.
242-
* \param mime_types a list of mime-types that are being offered.
242+
* \param mime_types a list of mime-types that are being offered. SDL copies the given list.
243243
* \param num_mime_types the number of mime-types in the mime_types list.
244244
* \returns true on success or false on failure; call SDL_GetError() for more
245245
* information.
@@ -269,10 +269,10 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetClipboardData(SDL_ClipboardDataCallback
269269
extern SDL_DECLSPEC bool SDLCALL SDL_ClearClipboardData(void);
270270

271271
/**
272-
* Get the data from clipboard for a given mime type.
272+
* Get the data from the clipboard for a given mime type.
273273
*
274274
* The size of text data does not include the terminator, but the text is
275-
* guaranteed to be null terminated.
275+
* guaranteed to be null-terminated.
276276
*
277277
* \param mime_type the mime type to read from the clipboard.
278278
* \param size a pointer filled in with the length of the returned data.
@@ -292,8 +292,8 @@ extern SDL_DECLSPEC void * SDLCALL SDL_GetClipboardData(const char *mime_type, s
292292
/**
293293
* Query whether there is data in the clipboard for the provided mime type.
294294
*
295-
* \param mime_type the mime type to check for data for.
296-
* \returns true if there exists data in clipboard for the provided mime type,
295+
* \param mime_type the mime type to check for data.
296+
* \returns true if data exists in the clipboard for the provided mime type,
297297
* false if it does not.
298298
*
299299
* \threadsafety This function should only be called on the main thread.
@@ -310,7 +310,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_HasClipboardData(const char *mime_type);
310310
*
311311
* \param num_mime_types a pointer filled with the number of mime types, may
312312
* be NULL.
313-
* \returns a null terminated array of strings with mime types, or NULL on
313+
* \returns a null-terminated array of strings with mime types, or NULL on
314314
* failure; call SDL_GetError() for more information. This should be
315315
* freed with SDL_free() when it is no longer needed.
316316
*

0 commit comments

Comments
 (0)