Rename TextInputBuffer -> CLanguage, TraditionalKeyInput -> CLanguageTC (DHXJ); files -> Language.{h,cpp}, LanguageTC.{h,cpp}. Pure rename, codegen unchanged (382/382 functions identical with includers).

This commit is contained in:
ragnarok-clanker 2026-10-29 12:21:53 +01:00
commit e67abcb458
19 changed files with 61 additions and 61 deletions

View file

@ -1,6 +1,6 @@
#include "Client/Application/ApplicationMessages.h"
#include "Client/Application/ApplicationWindow.h"
#include "Client/Input/TraditionalKeyInput.h"
#include "Client/Input/LanguageTC.h"
#include "Contents/Configuration/ServiceOptions.h"
#include <cstdint>

View file

@ -3,7 +3,7 @@
#include <windows.h>
struct TraditionalKeyInput;
struct CLanguageTC;
struct ServiceOptions;
struct ApplicationMessages {
@ -11,7 +11,7 @@ struct ApplicationMessages {
unsigned char& dragging;
POINT& dragStart;
RECT& dragRectangle;
TraditionalKeyInput* const& traditional;
CLanguageTC* const& traditional;
ServiceOptions& service;
void Pump();

View file

@ -1,5 +1,5 @@
#include "Client/Input/ImeInput.h"
#include "Client/Input/TraditionalKeyInput.h"
#include "Client/Input/LanguageTC.h"
#include "Utility/Text/LanguageCharset.h"
#include <algorithm>

View file

@ -7,7 +7,7 @@
#include <imm.h>
#include <vector>
struct TraditionalKeyInput;
struct CLanguageTC;
struct ImeInput {
TextInputBuffer& input;
@ -20,7 +20,7 @@ struct ImeInput {
unsigned& selection;
unsigned& pageSize;
int& compositionCursor;
TraditionalKeyInput* traditional;
CLanguageTC* traditional;
LRESULT Message(HWND unused, UINT message, WPARAM value, LPARAM flags, std::uint8_t& handled);

View file

@ -1,4 +1,4 @@
#include "Client/Input/TextInputBuffer.h"
#include "Client/Input/Language.h"
#include "UI/Window/UIWindow.h"
#include "UI/Window/WindowManagerWindows.h"
@ -9,7 +9,7 @@
// OFFSET: 0x00ACF2A0
// FUNCTION: fn_17794
void TextInputBuffer::ResetInput() {
void CLanguage::ResetInput() {
HIMC context = ImmGetContext(this->window);
if (context) {
@ -27,7 +27,7 @@ void TextInputBuffer::ResetInput() {
// OFFSET: 0x00ACD700
// FUNCTION: fn_17767
void TextInputBuffer::DeleteSelection() {
void CLanguage::DeleteSelection() {
if (this->cursor == this->anchor) {
return;
}
@ -45,7 +45,7 @@ void TextInputBuffer::DeleteSelection() {
// OFFSET: 0x00ACD360
// FUNCTION: fn_17760
void TextInputBuffer::Insert(const char* value) {
void CLanguage::Insert(const char* value) {
this->DeleteSelection();
this->text.insert(static_cast<std::size_t>(this->cursor), value, std::strlen(value));
this->anchor = this->cursor + static_cast<int>(std::strlen(value));
@ -58,7 +58,7 @@ void TextInputBuffer::Insert(const char* value) {
// OFFSET: 0x00ACF590
// FUNCTION: fn_17797
void TextInputBuffer::Select(int anchor, int cursor) {
void CLanguage::Select(int anchor, int cursor) {
this->anchor = anchor;
this->cursor = cursor;
this->anchor = std::clamp(this->anchor, 0, static_cast<int>(this->text.size()));
@ -67,7 +67,7 @@ void TextInputBuffer::Select(int anchor, int cursor) {
// OFFSET: 0x00ACE3C0
// FUNCTION: fn_17782
void TextInputBuffer::CopyDisplayText(std::string& output) const {
void CLanguage::CopyDisplayText(std::string& output) const {
if (&output != &this->text) {
output = this->text;
}
@ -79,7 +79,7 @@ void TextInputBuffer::CopyDisplayText(std::string& output) const {
// OFFSET: 0x00ACE420
// FUNCTION: fn_17783
void TextInputBuffer::Selection(int& anchor, int& cursor) const {
void CLanguage::Selection(int& anchor, int& cursor) const {
anchor = this->anchor;
cursor = this->cursor;
}
@ -91,7 +91,7 @@ void __stdcall SubACDD10() {
// OFFSET: 0x00ACDD20
// FUNCTION: fn_17775
void TextInputBuffer::RefreshComposition(unsigned codePage) {
void CLanguage::RefreshComposition(unsigned codePage) {
HIMC context = ImmGetContext(this->window);
if (!context) {
this->candidate.clear();
@ -119,7 +119,7 @@ void TextInputBuffer::RefreshComposition(unsigned codePage) {
// OFFSET: 0x00ACD5C0
// FUNCTION: fn_17765
void TextInputBuffer::CopySelection(bool password) {
void CLanguage::CopySelection(bool password) {
const int length = std::max(this->cursor, this->anchor) - std::min(this->cursor, this->anchor);
if (!length || !OpenClipboard(this->window)) {
return;
@ -148,7 +148,7 @@ void TextInputBuffer::CopySelection(bool password) {
// OFFSET: 0x00ACD540
// FUNCTION: fn_17764
void TextInputBuffer::Paste(UIWindow* blockedFocus, WindowManagerWindows& windows) {
void CLanguage::Paste(UIWindow* blockedFocus, WindowManagerWindows& windows) {
if (this->focused == blockedFocus || windows.LookupWindow(278) || windows.LookupWindow(128)) {
return;
}
@ -171,7 +171,7 @@ void TextInputBuffer::Paste(UIWindow* blockedFocus, WindowManagerWindows& window
// OFFSET: 0x00ACD6B0
// FUNCTION: fn_17766
void TextInputBuffer::MoveBack(unsigned codePage) {
void CLanguage::MoveBack(unsigned codePage) {
if (this->cursor < 0) {
this->cursor = 0;
} else if (this->cursor != 0) {
@ -182,7 +182,7 @@ void TextInputBuffer::MoveBack(unsigned codePage) {
// OFFSET: 0x00ACE440
// FUNCTION: fn_45441
void TextInputBuffer::SelectionRange(int& begin, int& end) const {
void CLanguage::SelectionRange(int& begin, int& end) const {
if (this->anchor < this->cursor) {
begin = this->anchor;
end = this->cursor;
@ -194,12 +194,12 @@ void TextInputBuffer::SelectionRange(int& begin, int& end) const {
// OFFSET: 0x00ACE4B0
// FUNCTION: fn_17786
void TextInputBuffer::SetFlag8C(unsigned char value) {
void CLanguage::SetFlag8C(unsigned char value) {
reinterpret_cast<unsigned char*>(this)[0x8C] = value;
}
// OFFSET: 0x00ACE4C0
// FUNCTION: fn_17787
void TextInputBuffer::IncreaseSelection(unsigned codePage) {
void CLanguage::IncreaseSelection(unsigned codePage) {
const auto length = static_cast<std::uint32_t>(this->text.size());
const auto position = static_cast<std::uint32_t>(this->cursor);
if (position > length) {
@ -211,7 +211,7 @@ void TextInputBuffer::IncreaseSelection(unsigned codePage) {
}
// OFFSET: 0x00ACE5E0
// FUNCTION: fn_17789
void TextInputBuffer::AdvanceCursor(int delta) {
void CLanguage::AdvanceCursor(int delta) {
const unsigned length = static_cast<unsigned>(this->text.size());
unsigned cursor = static_cast<unsigned>(this->cursor);
if (cursor == length) {
@ -232,7 +232,7 @@ void TextInputBuffer::AdvanceCursor(int delta) {
// OFFSET: 0x00ACE620
// FUNCTION: fn_17790
void TextInputBuffer::RetreatCursor(int delta) {
void CLanguage::RetreatCursor(int delta) {
if (this->cursor == 0) {
return;
}
@ -251,7 +251,7 @@ void TextInputBuffer::RetreatCursor(int delta) {
// OFFSET: 0x00ACE660
// FUNCTION: fn_17791
void TextInputBuffer::Character(unsigned value, LPARAM, unsigned codePage) {
void CLanguage::Character(unsigned value, LPARAM, unsigned codePage) {
if (value == 8) {
if (this->cursor == this->anchor) {
this->MoveBack(codePage);
@ -272,7 +272,7 @@ void TextInputBuffer::Character(unsigned value, LPARAM, unsigned codePage) {
// OFFSET: 0x00ACE880
// FUNCTION: fn_17792
void TextInputBuffer::KeyDown(
void CLanguage::KeyDown(
unsigned key, LPARAM, unsigned codePage, bool password, UIWindow* blockedPasteFocus, WindowManagerWindows& windows, UIWindow* const& chatArrows
) {
const auto cut = [&]() {

View file

@ -1,5 +1,5 @@
#ifndef RAGNAROK_SOURCE_CLIENT_INPUT_TEXTINPUTBUFFER_H
#define RAGNAROK_SOURCE_CLIENT_INPUT_TEXTINPUTBUFFER_H
#ifndef RAGNAROK_SOURCE_CLIENT_INPUT_LANGUAGE_H
#define RAGNAROK_SOURCE_CLIENT_INPUT_LANGUAGE_H
#include <string>
#include <windows.h>
@ -15,7 +15,7 @@ protected:
~TextInputSuggestions() = default;
};
struct TextInputBuffer {
struct CLanguage {
std::string& text;
int& cursor;
int& anchor;

View file

@ -1,10 +1,10 @@
#include "Client/Input/TraditionalKeyInput.h"
#include "Client/Input/LanguageTC.h"
#include "Network/TextEncoding.h"
#include <windows.h>
// OFFSET: 0x00ACCD30
// FUNCTION: fn_17752
void TraditionalKeyInput::InitializeMappings() {
void CLanguageTC::InitializeMappings() {
// STATIC: 0x011594E0
// GLOBAL: gl_13427
static constexpr std::uint8_t zhuyinBig5[] = {0xA3, 0x74, 0xA3, 0x78, 0xA3, 0xBE, 0xA3, 0xBF, 0xA3, 0xA4, 0xA3, 0xBD, 0xA3, 0xBB, 0xA3, 0xAB, 0xA3,
@ -40,12 +40,12 @@ void TraditionalKeyInput::InitializeMappings() {
// OFFSET: 0x00ACF330
// FUNCTION: fn_17795
void TraditionalKeyInput::DefaultKey(int) {
void CLanguageTC::DefaultKey(int) {
}
// OFFSET: 0x00ACF340
// FUNCTION: fn_17796
void TraditionalKeyInput::Key(int virtualKey) {
void CLanguageTC::Key(int virtualKey) {
const auto key = static_cast<std::uint8_t>(virtualKey);
if (key == 8) {
if (!this->keys.empty()) {
@ -67,13 +67,13 @@ void TraditionalKeyInput::Key(int virtualKey) {
// OFFSET: 0x00ACE270
// FUNCTION: fn_17777
const char* TraditionalKeyInput::DisplayText() const {
const char* CLanguageTC::DisplayText() const {
return this->display.c_str();
}
// OFFSET: 0x00ACE280
// FUNCTION: fn_17778
const char* TraditionalKeyInput::Display() {
const char* CLanguageTC::Display() {
char bytes[8] = {};
for (std::uint8_t key : this->keys) {
@ -90,13 +90,13 @@ const char* TraditionalKeyInput::Display() {
// OFFSET: 0x00ACE320
// FUNCTION: fn_17779
int TraditionalKeyInput::DisplayLength() const {
int CLanguageTC::DisplayLength() const {
return static_cast<int>(this->display.size());
}
// OFFSET: 0x00ACE330
// FUNCTION: fn_17780
int TraditionalKeyInput::GetKeyStrokeSize() const {
int CLanguageTC::GetKeyStrokeSize() const {
if (this->keys.size() == 1 && this->mappings[this->keys.back()].category == 4) {
return 0;
}
@ -106,13 +106,13 @@ int TraditionalKeyInput::GetKeyStrokeSize() const {
// OFFSET: 0x00ACE470
// FUNCTION: fn_17784
const char* TraditionalKeyInput::NextChar(const char* current, int) {
const char* CLanguageTC::NextChar(const char* current, int) {
return CharNextExA(static_cast<WORD>(g_textCodePage), current, 0);
}
// OFFSET: 0x00ACE490
// FUNCTION: fn_17785
const char* TraditionalKeyInput::NextCharArabic(const char* current, int) {
const char* CLanguageTC::NextCharArabic(const char* current, int) {
return CharNextExA(static_cast<WORD>(g_textCodePage), current, 0);
}
@ -122,23 +122,23 @@ void TraditionalKeyInputNoop() {}
// OFFSET: 0x00ACD7E0
// FUNCTION: fn_17769
void TraditionalKeyInput::ClearKeys() {
void CLanguageTC::ClearKeys() {
this->keys.clear();
}
// OFFSET: 0x00ACD4A0
// FUNCTION: fn_17761
void TraditionalKeyInput::ResetState() {
void CLanguageTC::ResetState() {
}
// OFFSET: 0x00ACD4E0
// FUNCTION: fn_17762
void TraditionalKeyInput::ResetCandidate() {
void CLanguageTC::ResetCandidate() {
}
// OFFSET: 0x00ACD4F0
// FUNCTION: fn_17763
void TraditionalKeyInput::RetainSingleKey() {
void CLanguageTC::RetainSingleKey() {
if (!this->keys.empty()) {
const auto key = this->keys.back();
this->keys.clear();
@ -150,7 +150,7 @@ void TraditionalKeyInput::RetainSingleKey() {
// OFFSET: 0x00ACE000
// FUNCTION: fn_17776
void TraditionalKeyInput::FilterCandidate(std::string& candidate) {
void CLanguageTC::FilterCandidate(std::string& candidate) {
if (candidate.size() > 2 && std::strcmp(candidate.c_str() + candidate.size() - 2, "?") == 0) {
candidate.resize(candidate.size() - 2);
}

View file

@ -1,5 +1,5 @@
#ifndef RAGNAROK_SOURCE_CLIENT_INPUT_TRADITIONALKEYINPUT_H
#define RAGNAROK_SOURCE_CLIENT_INPUT_TRADITIONALKEYINPUT_H
#ifndef RAGNAROK_SOURCE_CLIENT_INPUT_LANGUAGETC_H
#define RAGNAROK_SOURCE_CLIENT_INPUT_LANGUAGETC_H
#include <array>
#include <cstdint>
@ -11,7 +11,7 @@ struct TraditionalKeyMapping {
/* 0001 */ std::uint8_t bytes[3];
};
struct TraditionalKeyInput {
struct CLanguageTC {
std::list<std::uint8_t>& keys;
std::array<TraditionalKeyMapping, 256>& mappings;
std::string& display;

View file

@ -1,4 +1,4 @@
#include "Client/Input/TextInputBuffer.h"
#include "Client/Input/Language.h"
#include "UI/Edit/EditTextState.h"
#include <cstring>

View file

@ -4,7 +4,7 @@
#include <string>
#include <windows.h>
struct TextInputBuffer;
struct CLanguage;
struct EditTextState {
std::string& text;
@ -12,7 +12,7 @@ struct EditTextState {
int& cursor;
const int& maximum;
const bool& focused;
TextInputBuffer& input;
CLanguage& input;
const UINT& codePage;
void SetText(const char* value);

View file

@ -1,4 +1,4 @@
#include "Client/Input/TextInputBuffer.h"
#include "Client/Input/Language.h"
#include "Render/Text/TextContext.h"
#include "UI/Edit/EditTextState.h"
#include "UI/Edit/EditViewport.h"

View file

@ -7,7 +7,7 @@
class CDC;
class FontCache;
struct TextLocale;
struct TextInputBuffer;
struct CLanguage;
struct EditTextState;
struct EditViewport {
@ -17,7 +17,7 @@ struct EditViewport {
int& firstVisible;
const int& width;
const UINT& codePage;
TextInputBuffer& input;
CLanguage& input;
EditTextState& state;
CDC& surface;
FontCache& fonts;

View file

@ -1,5 +1,5 @@
#include "Client/Input/InputCharset.h"
#include "Client/Input/TextInputBuffer.h"
#include "Client/Input/Language.h"
#include "Network/TextEncoding.h"
#include "Render/DeviceContext/DeviceContext.h"
#include "Render/Text/TextContext.h"
@ -68,7 +68,7 @@ struct EditPainting {
const int& height;
const int& screenWidth;
const int& screenHeight;
TextInputBuffer& input;
CLanguage& input;
const InputCharset& charset;
EditViewport& viewport;
CDC& surface;

View file

@ -8,7 +8,7 @@
#include <vector>
struct InputFocus;
struct TextInputBuffer;
struct CLanguage;
struct InputCharset;
struct UIButtonContext;
struct BitmapImage;
@ -18,7 +18,7 @@ class UINaviLinkButton;
struct UIEditContext {
InputFocus& focus;
TextInputBuffer& input;
CLanguage& input;
unsigned char& password;
const InputCharset& charset;
UIButtonContext& buttons;

View file

@ -1,4 +1,4 @@
#include "Client/Input/TextInputBuffer.h"
#include "Client/Input/Language.h"
#include "UI/Window/InputFocus.h"
#include "UI/Text/NavigationLink.h"
#include "UI/Text/TextFitting.h"

View file

@ -1,4 +1,4 @@
#include "Client/Input/TextInputBuffer.h"
#include "Client/Input/Language.h"
#include "UI/Window/InputFocus.h"
#include "UI/Edit/UIEditCtrl.h"

View file

@ -1,4 +1,4 @@
#include "Client/Input/TextInputBuffer.h"
#include "Client/Input/Language.h"
#include "Contents/Party/AdventurerAgencyMgr.h"
#include "Contents/Party/AgencyRequestContext.h"
#include "Render/DeviceContext/DeviceContext.h"

View file

@ -1,4 +1,4 @@
#include "Client/Input/TextInputBuffer.h"
#include "Client/Input/Language.h"
#include "Contents/Party/AdventurerAgencyMgr.h"
#include "Contents/Party/AgencyRequestContext.h"
#include "Contents/ForbiddenWords.h"

View file

@ -251,8 +251,8 @@
"Source/Client/Input/ImeInput.cpp": 0,
"Source/Client/Input/InputCharset.cpp": 0,
"Source/Client/Input/Mouse.cpp": 0,
"Source/Client/Input/TextInputBuffer.cpp": 0,
"Source/Client/Input/TraditionalKeyInput.cpp": 0,
"Source/Client/Input/Language.cpp": 0,
"Source/Client/Input/LanguageTC.cpp": 0,
"Source/Client/Mode/ActiveGameMode.cpp": 0,
"Source/Client/Mode/ModeCursor.cpp": 0,
"Source/Client/Mode/ModeDragState.cpp": 2,