-
Notifications
You must be signed in to change notification settings - Fork 279
/
clipboard.c
79 lines (58 loc) · 1.68 KB
/
clipboard.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/* ______ ___ ___
* /\ _ \ /\_ \ /\_ \
* \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___
* \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\
* \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \
* \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/
* \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/
* /\____/
* \_/__/
*
* Clipboard handling.
*
* By Beoran.
*
* See readme.txt for copyright information.
*/
/* Title: Event sources
*/
#include "allegro5/allegro.h"
#include "allegro5/internal/aintern.h"
#include "allegro5/internal/aintern_display.h"
/* Function: al_get_clipboard_text
*/
char *al_get_clipboard_text(ALLEGRO_DISPLAY *display)
{
if (!display)
display = al_get_current_display();
if (!display)
return NULL;
if (!display->vt->get_clipboard_text)
return NULL;
return display->vt->get_clipboard_text(display);
}
/* Function: al_set_clipboard_text
*/
bool al_set_clipboard_text(ALLEGRO_DISPLAY *display, const char *text)
{
if (!display)
display = al_get_current_display();
if (!display)
return false;
if (!display->vt->set_clipboard_text)
return false;
return display->vt->set_clipboard_text(display, text);
}
/* Function: al_clipboard_has_text
*/
bool al_clipboard_has_text(ALLEGRO_DISPLAY *display)
{
if (!display)
display = al_get_current_display();
if (!display)
return false;
if (!display->vt->has_clipboard_text)
return false;
return display->vt->has_clipboard_text(display);
}
/* vim: set sts=3 sw=3 et: */