mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-09-10 12:02:53 +02:00
Change Input::getClipboardText()
to return std::string
instead of const char *
This commit is contained in:
parent
38c122a08c
commit
f1cb1fc533
3 changed files with 5 additions and 7 deletions
|
@ -519,7 +519,7 @@ RB_METHOD(inputGets) {
|
|||
|
||||
RB_METHOD_GUARD(inputGetClipboard) {
|
||||
RB_UNUSED_PARAM;
|
||||
return rb_utf8_str_new_cstr(shState->input().getClipboardText());
|
||||
return rb_utf8_str_new_cstr(shState->input().getClipboardText().c_str());
|
||||
}
|
||||
RB_METHOD_GUARD_END
|
||||
|
||||
|
|
|
@ -678,8 +678,6 @@ struct InputPrivate
|
|||
/* Collective binding array */
|
||||
std::vector<Binding*> bindings;
|
||||
|
||||
std::string clipboardText;
|
||||
|
||||
ButtonState stateArray[BUTTON_CODE_COUNT*2];
|
||||
|
||||
ButtonState *states;
|
||||
|
@ -1514,12 +1512,12 @@ void Input::clearText()
|
|||
shState->eThread().textInputBuffer.clear();
|
||||
}
|
||||
|
||||
const char *Input::getClipboardText()
|
||||
std::string Input::getClipboardText()
|
||||
{
|
||||
const char *tx = SDL_GetClipboardText();
|
||||
p->clipboardText = tx;
|
||||
std::string str(tx);
|
||||
SDL_free((void *)tx);
|
||||
return p->clipboardText.c_str();
|
||||
return str;
|
||||
}
|
||||
|
||||
void Input::setClipboardText(const char *text)
|
||||
|
|
|
@ -110,7 +110,7 @@ public:
|
|||
const char *getText();
|
||||
void clearText();
|
||||
|
||||
const char *getClipboardText();
|
||||
std::string getClipboardText();
|
||||
void setClipboardText(const char *text);
|
||||
|
||||
const char *getAxisName(SDL_GameControllerAxis axis);
|
||||
|
|
Loading…
Add table
Reference in a new issue