tb_clipboard_dummy.cpp 931 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // ================================================================================
  2. // == This file is a part of Turbo Badger. (C) 2011-2014, Emil Segerås ==
  3. // == See tb_core.h for more information. ==
  4. // ================================================================================
  5. #include "tb_system.h"
  6. #ifdef TB_CLIPBOARD_DUMMY
  7. #include <sys/time.h>
  8. #include <stdio.h>
  9. #include "SDL.h"
  10. namespace tb {
  11. // == TBClipboard =====================================
  12. void TBClipboard::Empty()
  13. {
  14. SDL_SetClipboardText("");
  15. }
  16. bool TBClipboard::HasText()
  17. {
  18. return SDL_HasClipboardText();
  19. }
  20. bool TBClipboard::SetText(const char *text)
  21. {
  22. SDL_SetClipboardText(text);
  23. return true;
  24. }
  25. bool TBClipboard::GetText(TBStr &text)
  26. {
  27. const char* _text = SDL_GetClipboardText();
  28. return text.Set(_text ? _text : "");
  29. }
  30. }; // namespace tb
  31. #endif // TB_CLIPBOARD_DUMMY