rodecomp/Source/Client/Input/Language.h
ragnarok-clanker d6bc9836d7 Maintenance: [forced, admin decision] Collapse the WindowManagerWindows adapter into UIWindowMgr, stage 1 of 2 (project decision: por
Batch #10019 by ragnarok-clanker: forced by an admin (23 lower score(s), 187 changed function(s)); checked with 447 compiled unit(s), including every includer of Source/Client/Input/Language.h, Source/Client/Mode/ModeDragState.h, Source/Contents/Async/AsyncWorkMgr.h, Source/Contents/Emblems/EmblemCache.h, Source/Contents/Party/AdventurerAgencyMgr.h, Source/Contents/Party/AgencyRequestContext.h, Source/Contents/Party/ChangePartyMasterAsyncWork.h, Source/Contents/Party/LoadMyPartyAsyncWork.h, Source/Contents/Party/LoadPartyInfoAsyncWork.h, Source/Contents/Party/LoadPartyListAsyncWork.h, Source/Contents/Party/PartyInvitation.h, Source/Contents/Party/RegisterPartyAsyncWork.h, Source/Contents/Party/StopRecruitingAsyncWork.h, Source/Contents/Skills/PlayerSkillBundle.h, Source/Contents/UserData/CharacterConfigLoad.h, Source/Network/Packets/PartyJoinPacket.h, Source/UI/Chat/ChatSuggestions.h, Source/UI/Dialogs/UIWaitDBSaveWnd.h, Source/UI/Edit/UIEditCtrl.h, Source/UI/Lists/UIListBox.h, Source/UI/Party/UIRequestJoinPartyMgr.h, Source/UI/Shortcuts/NormalItemSlotLoad.h, Source/UI/Shortcuts/ShortcutDetails.h, Source/UI/Shortcuts/ShortcutPress.h, Source/UI/UIBasicCtrl.h, Source/UI/UIStaticItem.h, Source/UI/Window/FrameFocus.h, Source/UI/Window/UIFrameWnd.h, Source/UI/Window/UIVideoWnd.h, Source/UI/Window/WindowManagerWindows.h, Source/UI/Window/WindowMouseHit.h, Source/UI/Window/WindowOrdering.h.
2026-11-02 14:09:20 +00:00

127 lines
3.6 KiB
C++

#ifndef RAGNAROK_SOURCE_CLIENT_INPUT_LANGUAGE_H
#define RAGNAROK_SOURCE_CLIENT_INPUT_LANGUAGE_H
#include <cstdint>
#include <deque>
#include <string>
#include <vector>
#include <windows.h>
class UIWindow;
#include "UI/Window/WindowManagerWindows.h"
class TextInputSuggestions {
public:
virtual void Update(const char* text) = 0;
protected:
~TextInputSuggestions() = default;
};
struct CLanguage {
std::string& text;
int& cursor;
int& anchor;
std::string& composition;
std::string& candidate;
int& compositionState;
HWND& window;
const bool& suggestionsEnabled;
UIWindow* const& focused;
UIWindow* const& chatInput;
const bool& chatOpen;
TextInputSuggestions& suggestions;
void ResetInput();
void DeleteSelection();
void Insert(const char* value);
void Select(int anchor, int cursor);
void CopyDisplayText(std::string& output) const;
void Selection(int& anchor, int& cursor) const;
void SelectionRange(int& begin, int& end) const;
void RefreshComposition(unsigned codePage);
void CopySelection(bool password);
void Paste(UIWindow* blockedFocus, WindowManagerWindows& windows);
void MoveBack(unsigned codePage);
void IncreaseSelection(unsigned codePage);
void SetFlag8C(unsigned char value);
void AdvanceCursor(int delta);
void RetreatCursor(int delta);
void Character(unsigned value, LPARAM unused, unsigned codePage);
void KeyDown(
unsigned key, LPARAM unused, unsigned codePage, bool password, UIWindow* blockedPasteFocus, WindowManagerWindows& windows, UIWindow* const& chatArrows
);
};
// VTABLE: vt_01604
struct CLanguageBase {
virtual ~CLanguageBase() = default;
/* 0004 */ std::deque<unsigned int> unknown_0004;
/* 0018 */ void* candidateList;
/* 001C */ int candidateCount;
/* 0020 */ int pageSize;
/* 0024 */ int selection;
/* 0028 */ std::vector<unsigned char> candidateStorage;
/* 0034 */ std::string text;
/* 004C */ int unknown_004C;
/* 0050 */ int cursor;
/* 0054 */ int anchor;
/* 0058 */ std::string composition;
/* 0070 */ std::string candidate;
/* 0088 */ unsigned char unknown_0088[6];
/* 008E */ std::uint16_t language;
/* 0090 */ unsigned codePage;
/* 0094 */ int unknown_0094;
/* 0098 */ int unknown_0098;
/* 009C */ std::string servicePrefix;
/* 00B4 */ std::uint16_t alternateLanguage;
/* 00B6 */ unsigned char unknown_00B6[2];
CLanguageBase();
};
// VTABLE: vt_01607
struct CLanguageArabic : CLanguageBase {
/* 00B8 */ bool lexiconLoaded;
CLanguageArabic();
};
// VTABLE: vt_01606
struct CLanguageTH : CLanguageBase {
/* 00B8 */ bool lexiconLoaded;
CLanguageTH();
};
#if defined(_WIN32) && !defined(_WIN64)
static_assert(offsetof(CLanguageBase, unknown_0004) == 0x0004);
static_assert(offsetof(CLanguageBase, candidateList) == 0x0018);
static_assert(offsetof(CLanguageBase, candidateStorage) == 0x0028);
static_assert(offsetof(CLanguageBase, text) == 0x0034);
static_assert(offsetof(CLanguageBase, cursor) == 0x0050);
static_assert(offsetof(CLanguageBase, anchor) == 0x0054);
static_assert(offsetof(CLanguageBase, composition) == 0x0058);
static_assert(offsetof(CLanguageBase, candidate) == 0x0070);
static_assert(offsetof(CLanguageBase, language) == 0x008E);
static_assert(offsetof(CLanguageBase, codePage) == 0x0090);
static_assert(offsetof(CLanguageBase, servicePrefix) == 0x009C);
static_assert(offsetof(CLanguageBase, alternateLanguage) == 0x00B4);
static_assert(sizeof(CLanguageBase) == 0x00B8);
static_assert(sizeof(CLanguageArabic) == 0x00BC);
static_assert(sizeof(CLanguageTH) == 0x00BC);
#endif
void __stdcall SubACDD10();
void SuggestChatCommand(const char* text);
int SubACFCE0();
#endif