ADDED: GetClipboardText(), SetClipboardText()
This commit is contained in:
parent
6dbec47488
commit
e996fe2ff5
3 changed files with 21 additions and 3 deletions
17
src/core.c
17
src/core.c
|
@ -984,6 +984,23 @@ const char *GetMonitorName(int monitor)
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get clipboard text content
|
||||||
|
// NOTE: returned string is allocated and freed by GLFW
|
||||||
|
const char *GetClipboardText(void)
|
||||||
|
{
|
||||||
|
#if defined(PLATFORM_DESKTOP)
|
||||||
|
return glfwGetClipboardString(window);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set clipboard text content
|
||||||
|
void SetClipboardText(const char *text)
|
||||||
|
{
|
||||||
|
#if defined(PLATFORM_DESKTOP)
|
||||||
|
glfwSetClipboardString(window, text);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
// Show mouse cursor
|
// Show mouse cursor
|
||||||
void ShowCursor(void)
|
void ShowCursor(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -884,6 +884,8 @@ RLAPI int GetMonitorHeight(int monitor); // Get primary
|
||||||
RLAPI int GetMonitorPhysicalWidth(int monitor); // Get primary monitor physical width in millimetres
|
RLAPI int GetMonitorPhysicalWidth(int monitor); // Get primary monitor physical width in millimetres
|
||||||
RLAPI int GetMonitorPhysicalHeight(int monitor); // Get primary monitor physical height in millimetres
|
RLAPI int GetMonitorPhysicalHeight(int monitor); // Get primary monitor physical height in millimetres
|
||||||
RLAPI const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the primary monitor
|
RLAPI const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the primary monitor
|
||||||
|
RLAPI const char *GetClipboardText(void); // Get clipboard text content
|
||||||
|
RLAPI void SetClipboardText(const char *text); // Set clipboard text content
|
||||||
|
|
||||||
// Cursor-related functions
|
// Cursor-related functions
|
||||||
RLAPI void ShowCursor(void); // Shows cursor
|
RLAPI void ShowCursor(void); // Shows cursor
|
||||||
|
@ -1176,8 +1178,7 @@ RLAPI const char *TextSubtext(const char *text, int position, int length);
|
||||||
RLAPI const char *TextReplace(char *text, const char *replace, const char *by); // Replace text string (memory should be freed!)
|
RLAPI const char *TextReplace(char *text, const char *replace, const char *by); // Replace text string (memory should be freed!)
|
||||||
RLAPI const char *TextInsert(const char *text, const char *insert, int position); // Insert text in a position (memory should be freed!)
|
RLAPI const char *TextInsert(const char *text, const char *insert, int position); // Insert text in a position (memory should be freed!)
|
||||||
RLAPI const char *TextJoin(const char **textList, int count, const char *delimiter); // Join text strings with delimiter
|
RLAPI const char *TextJoin(const char **textList, int count, const char *delimiter); // Join text strings with delimiter
|
||||||
RLAPI char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings (memory should be freed!)
|
RLAPI const char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings
|
||||||
RLAPI void TextSplitEx(const char *text, char delimiter, int *count, const char **ptrs, int *lengths); // Get pointers to substrings separated by delimiter
|
|
||||||
RLAPI void TextAppend(char *text, const char *append, int *position); // Append text at specific position and move cursor!
|
RLAPI void TextAppend(char *text, const char *append, int *position); // Append text at specific position and move cursor!
|
||||||
RLAPI int TextFindIndex(const char *text, const char *find); // Find first text occurrence within a string
|
RLAPI int TextFindIndex(const char *text, const char *find); // Find first text occurrence within a string
|
||||||
RLAPI const char *TextToUpper(const char *text); // Get upper case version of provided string
|
RLAPI const char *TextToUpper(const char *text); // Get upper case version of provided string
|
||||||
|
|
|
@ -871,7 +871,7 @@ void ExportImageAsCode(Image image, const char *fileName)
|
||||||
|
|
||||||
// Get file name from path and convert variable name to uppercase
|
// Get file name from path and convert variable name to uppercase
|
||||||
strcpy(varFileName, GetFileNameWithoutExt(fileName));
|
strcpy(varFileName, GetFileNameWithoutExt(fileName));
|
||||||
for (int i = 0; varFileName[i] != '\0'; i++) if (varFileName[i] >= 'a' && varFileName[i] <= 'z') { varFileName[i] = varFileName[i] - 32; }
|
for (int i = 0; varFileName[i] != '\0'; i++) if ((varFileName[i] >= 'a') && (varFileName[i] <= 'z')) { varFileName[i] = varFileName[i] - 32; }
|
||||||
|
|
||||||
// Add image information
|
// Add image information
|
||||||
fprintf(txtFile, "// Image data information\n");
|
fprintf(txtFile, "// Image data information\n");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue