clipboard.go 505 B

1234567891011121314151617181920212223
  1. // clipboard support
  2. package al
  3. /*
  4. #include <stdlib.h>
  5. #include <allegro5/allegro.h>
  6. #include "helpers.h"
  7. */
  8. import "C"
  9. func (disp * Display) ClipboardText() string {
  10. return C.GoString(C.al_get_clipboard_text(disp.toC()))
  11. }
  12. func (disp * Display) ClipboardHasText() bool {
  13. return bool(C.al_clipboard_has_text(disp.toC()))
  14. }
  15. func (disp * Display) SetClipboardText(text string) bool {
  16. ctext := cstr(text) ; defer cstrFree(ctext)
  17. return bool(C.al_set_clipboard_text(disp.toC(), ctext))
  18. }