mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-29 19:20:09 +00:00
Move jclipboard functions to gui::clipboard namespace.
This commit is contained in:
parent
7d0bed8341
commit
f2f6ba9fca
@ -6,6 +6,8 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gui/clipboard.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
|
||||
@ -23,7 +25,7 @@ static void lowlevel_set_clipboard_text(const char *text)
|
||||
clipboard_text = text ? text: "";
|
||||
}
|
||||
|
||||
const char* jclipboard_get_text()
|
||||
const char* gui::clipboard::get_text()
|
||||
{
|
||||
#ifdef WIN32
|
||||
if (IsClipboardFormatAvailable(CF_TEXT)) {
|
||||
@ -44,7 +46,7 @@ const char* jclipboard_get_text()
|
||||
return clipboard_text.c_str();
|
||||
}
|
||||
|
||||
void jclipboard_set_text(const char *text)
|
||||
void gui::clipboard::set_text(const char *text)
|
||||
{
|
||||
lowlevel_set_clipboard_text(text);
|
||||
|
||||
|
@ -9,7 +9,13 @@
|
||||
|
||||
#include "gui/base.h"
|
||||
|
||||
const char* jclipboard_get_text();
|
||||
void jclipboard_set_text(const char* text);
|
||||
namespace gui {
|
||||
namespace clipboard {
|
||||
|
||||
const char* get_text();
|
||||
void set_text(const char* text);
|
||||
|
||||
} // namespace clipboard
|
||||
} // namespace gui
|
||||
|
||||
#endif // ASE_JINETE_JCLIPBOARD_H
|
||||
|
@ -516,7 +516,7 @@ void Entry::executeCmd(EntryCmd::Type cmd, int ascii, bool shift_pressed)
|
||||
// *cut* text!
|
||||
if (cmd == EntryCmd::Cut) {
|
||||
base::string buf = text.substr(selbeg, selend - selbeg + 1);
|
||||
jclipboard_set_text(buf.c_str());
|
||||
gui::clipboard::set_text(buf.c_str());
|
||||
}
|
||||
|
||||
// remove text
|
||||
@ -536,7 +536,7 @@ void Entry::executeCmd(EntryCmd::Type cmd, int ascii, bool shift_pressed)
|
||||
case EntryCmd::Paste: {
|
||||
const char *clipboard;
|
||||
|
||||
if ((clipboard = jclipboard_get_text())) {
|
||||
if ((clipboard = gui::clipboard::get_text())) {
|
||||
// delete the entire selection
|
||||
if (selbeg >= 0) {
|
||||
text.erase(selbeg, selend-selbeg+1);
|
||||
@ -560,7 +560,7 @@ void Entry::executeCmd(EntryCmd::Type cmd, int ascii, bool shift_pressed)
|
||||
case EntryCmd::Copy:
|
||||
if (selbeg >= 0) {
|
||||
base::string buf = text.substr(selbeg, selend - selbeg + 1);
|
||||
jclipboard_set_text(buf.c_str());
|
||||
gui::clipboard::set_text(buf.c_str());
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -36,7 +36,7 @@ Jinete::~Jinete()
|
||||
CurrentTheme::set(NULL);
|
||||
|
||||
// destroy clipboard
|
||||
jclipboard_set_text(NULL);
|
||||
gui::clipboard::set_text(NULL);
|
||||
|
||||
// shutdown system
|
||||
_ji_widgets_exit();
|
||||
|
Loading…
x
Reference in New Issue
Block a user