Compare commits
1 Commits
main
...
agent/w092
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e19f15cef5 |
@@ -53,9 +53,9 @@ Progress
|
||||
<!-- progress:start -->
|
||||
| Decompiled | Matched | Linked | Data |
|
||||
|:---:|:---:|:---:|:---:|
|
||||
| 83.59% | 74.20% | 56.76% | 86.51% |
|
||||
| 83.87% | 74.48% | 56.76% | 86.51% |
|
||||
|
||||
units 748/1027 complete, functions 10798/12563 matched.
|
||||
units 748/1027 complete, functions 10859/12563 matched.
|
||||
|
||||
decompiled = code with a C/C++ implementation (objdiff fuzzy), matched = byte-exact code, linked = code actually linked into the DOL, data = byte-exact data
|
||||
<!-- progress:end -->
|
||||
|
||||
@@ -77,6 +77,9 @@ namespace textinput {
|
||||
|
||||
class Base : public CommandSender {
|
||||
public:
|
||||
#ifdef TIMANAGER_IMPLEMENTATION
|
||||
Base(Manager* manager) : mpCandidates(NULL), mpAllocator(NULL), mbOn(false), mbInvalid(true), meLanguage(USA), mpManager(manager) {}
|
||||
#endif
|
||||
virtual ~Base();
|
||||
virtual void create(MEMAllocator* allocator) override;
|
||||
virtual void init() override {}
|
||||
@@ -111,6 +114,9 @@ namespace textinput {
|
||||
|
||||
class EventHandler : public nw4rmanager::TiEventHandler {
|
||||
public:
|
||||
#ifdef TIMANAGER_IMPLEMENTATION
|
||||
EventHandler(LayoutByNW4R* layout) : mpLayoutByNW4R(layout) {}
|
||||
#endif
|
||||
virtual void onTiEvent(gui::PaneComponent* paneComponent, u32 event, Input* input) override; // 0x18
|
||||
|
||||
LayoutByNW4R* mpLayoutByNW4R; // 0xC
|
||||
@@ -284,6 +290,13 @@ namespace textinput {
|
||||
// TODO
|
||||
class LayoutByNW4R : public Base, public nw4rmanager::Layout, public UIObj::Listener {
|
||||
public:
|
||||
#ifdef TIMANAGER_IMPLEMENTATION
|
||||
LayoutByNW4R(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* accessor, EventObserver* observer, const char* layoutName)
|
||||
: Base(manager), nw4rmanager::Layout(accessor, layoutName, observer), mEventHandler(this), mpTiString(NULL),
|
||||
mTextArea(0, this, this), mLeftScroll(1, this, this), mRightScroll(2, this, this), mOnOffButton(3, this, this),
|
||||
mTextWindow(4, this, this), mbActive(true) {}
|
||||
const UIOnOffButton& getOnOffButton() const { return mOnOffButton; }
|
||||
#endif
|
||||
virtual ~LayoutByNW4R();
|
||||
virtual void create(MEMAllocator* allocator) override;
|
||||
virtual void init() override;
|
||||
|
||||
@@ -2,20 +2,20 @@
|
||||
#define TEXTINPUT_CELL_PHONE_H
|
||||
|
||||
#include "tiNw4rManager.h"
|
||||
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION)
|
||||
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
#include "tiKeyboard.h"
|
||||
#endif
|
||||
|
||||
namespace textinput {
|
||||
namespace keyboard {
|
||||
namespace cellphonetype {
|
||||
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION)
|
||||
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
class Base : public textinput::keyboard::KeyboardBase {
|
||||
#else
|
||||
class Base {
|
||||
#endif
|
||||
public:
|
||||
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION)
|
||||
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
enum InputMode {
|
||||
IM_00,
|
||||
IM_01,
|
||||
@@ -29,7 +29,12 @@ namespace textinput {
|
||||
virtual void init() override;
|
||||
virtual void updateFromReceiver(u32, void*) override;
|
||||
virtual void onKey(u32, void*) override;
|
||||
#ifdef TIMANAGER_IMPLEMENTATION
|
||||
Base(Manager* manager) : mpManager(manager) {}
|
||||
virtual int getType() override;
|
||||
#else
|
||||
virtual void getType() override;
|
||||
#endif
|
||||
virtual void onActive() override;
|
||||
virtual void calc();
|
||||
virtual void draw();
|
||||
@@ -74,7 +79,7 @@ namespace textinput {
|
||||
|
||||
virtual void vt_0x4C();
|
||||
virtual void vt_0x50();
|
||||
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION)
|
||||
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
virtual void doNumericMode(bool);
|
||||
#else
|
||||
virtual void vt_0x54();
|
||||
@@ -90,11 +95,11 @@ namespace textinput {
|
||||
|
||||
// TODO enum?
|
||||
int getInputType() const;
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
void resetHoldingButton();
|
||||
#endif
|
||||
|
||||
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION)
|
||||
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
private:
|
||||
u32 mPreviousInputMode;
|
||||
u32 mCurrentInputMode;
|
||||
@@ -107,17 +112,47 @@ namespace textinput {
|
||||
u32 mHoldingButton;
|
||||
void* mpInputModeTable;
|
||||
MEMAllocator* mpAllocator;
|
||||
#ifdef TIMANAGER_IMPLEMENTATION
|
||||
Manager* mpManager;
|
||||
#else
|
||||
void* mpInputSettings;
|
||||
#endif
|
||||
u32 mInputState;
|
||||
#endif
|
||||
};
|
||||
|
||||
class LayoutByNW4R : public Base, public nw4rmanager::Layout {
|
||||
public:
|
||||
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION)
|
||||
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
#ifdef TIMANAGER_IMPLEMENTATION
|
||||
LayoutByNW4R(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* accessor, EventObserver* observer, const char* layoutName)
|
||||
: Base(manager), nw4rmanager::Layout(accessor, layoutName, observer), mpEventHandler(NULL) {}
|
||||
virtual ~LayoutByNW4R();
|
||||
virtual void create(MEMAllocator* allocator);
|
||||
virtual void init();
|
||||
virtual void setCommandReceiver(CommandReceiver* receiver);
|
||||
virtual void updateFromReceiver(u32 command, void* data);
|
||||
virtual void onKey(u32 event, void* data);
|
||||
virtual void setLanguage(Language language);
|
||||
virtual void update();
|
||||
virtual void onActive();
|
||||
virtual void calc();
|
||||
virtual void draw();
|
||||
virtual void changeInputMode(InputMode mode);
|
||||
virtual void setInputMode(InputMode mode);
|
||||
virtual void setUpperCaseJP(bool upper);
|
||||
virtual void setLangKeyActive(bool active);
|
||||
virtual void goSignInputMode();
|
||||
virtual void changePredictLanguage();
|
||||
virtual void setAbcMode(bool abc);
|
||||
virtual void doNumericMode(bool);
|
||||
virtual void setPredictLanguageDialog(predictlang::LayoutByNW4R* dialog);
|
||||
virtual void setSignWindow(signwindow::LayoutByNW4R* window);
|
||||
#else
|
||||
virtual void doNumericMode(bool);
|
||||
virtual void setPredictLanguageDialog(void*);
|
||||
virtual void setSignWindow(void*);
|
||||
#endif
|
||||
virtual void doNumericWithDotMode(bool);
|
||||
virtual void setLineFeedButton(bool);
|
||||
virtual void setPredictLanguageButton(bool);
|
||||
@@ -127,15 +162,31 @@ namespace textinput {
|
||||
|
||||
void onPressedShift(bool shift);
|
||||
void onReleasedShift();
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
bool hasLineFeedButton() const { return mbLineFeedButton; }
|
||||
private:
|
||||
bool mbLineFeedButton;
|
||||
#ifdef TIMANAGER_IMPLEMENTATION
|
||||
GXTexObj mSpaceTexture;
|
||||
GXTexObj mSpaceTextureCN;
|
||||
GXTexObj mSpaceTextureKR;
|
||||
nw4rmanager::TiEventHandler* mpEventHandler;
|
||||
predictlang::LayoutByNW4R* mpPredictDialog;
|
||||
signwindow::LayoutByNW4R* mpSignWindow;
|
||||
#endif
|
||||
public:
|
||||
#endif
|
||||
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION)
|
||||
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
virtual bool updateInput(int chan, f32 x, f32 y, u32 trig, u32 hold, u32 release, void* data) override;
|
||||
virtual bool updateInput(input::HKBManager& hkbManager) override;
|
||||
#endif
|
||||
#ifdef TIMANAGER_IMPLEMENTATION
|
||||
virtual nw4rmanager::AnmPane* getAnmPane(InputMode mode);
|
||||
virtual void throwReleaseForAll();
|
||||
virtual void changeAnimationAllToNormal();
|
||||
virtual void updatePredictLanguage(CommandReceiver::ChangePredictMode* mode);
|
||||
virtual void changeKeyTop(const struct PaneNameToCharCode* table);
|
||||
virtual void changeSpaceKeyTop(const struct PaneNameToCharCode* table);
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -11,6 +11,9 @@ namespace textinput {
|
||||
namespace input {
|
||||
class HKBManager {
|
||||
public:
|
||||
#ifdef TIMANAGER_IMPLEMENTATION
|
||||
void ClearState();
|
||||
#endif
|
||||
static HKBManager& getInstance() { return sInstance; }
|
||||
|
||||
void Initialize();
|
||||
|
||||
@@ -8,17 +8,28 @@ namespace textinput {
|
||||
class Manager;
|
||||
namespace keyboard {
|
||||
namespace hwkey {
|
||||
#ifdef TIMANAGER_IMPLEMENTATION
|
||||
class HWKeyboard : public CommandSender {
|
||||
#else
|
||||
class HWKeyboard : CommandSender {
|
||||
#endif
|
||||
public:
|
||||
HWKeyboard(Manager *);
|
||||
#ifdef TIMANAGER_IMPLEMENTATION
|
||||
inline ~HWKeyboard();
|
||||
#else
|
||||
~HWKeyboard();
|
||||
#endif
|
||||
#ifdef TIMANAGER_IMPLEMENTATION
|
||||
void setLanguage(Destination destination, Language language);
|
||||
#endif
|
||||
|
||||
virtual void init();
|
||||
#ifdef TI_PC_KEYBOARD_IMPLEMENTATION
|
||||
wchar_t convertWCCode(wchar_t code) const;
|
||||
#endif
|
||||
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
void updateInput(int chan, f32 x, f32 y, u32 trig, u32 hold, u32 release, void* data);
|
||||
#else
|
||||
virtual void updateInput(int chan, f32 x, f32 y, u32 trig, u32 hold, u32 release, void* data);
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "tiZiString.h"
|
||||
#include "tiSEId.h"
|
||||
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
extern "C" wchar_t KPRGetChar(KPRQueue* queue);
|
||||
extern "C" void KPRPutChar(KPRQueue* queue, wchar_t character);
|
||||
extern "C" void KPRClearQueue(KPRQueue* queue);
|
||||
@@ -22,22 +22,30 @@ extern "C" u8 KPRLookAhead(KPRQueue* queue, wchar_t* character, wchar_t* combini
|
||||
#endif
|
||||
|
||||
namespace textinput {
|
||||
#ifdef TIMANAGER_IMPLEMENTATION
|
||||
class Manager;
|
||||
#endif
|
||||
namespace inputform {
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
class Base;
|
||||
class EventHandler;
|
||||
class LayoutByNW4R;
|
||||
#endif
|
||||
class EditBuffer {
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#ifdef TIMANAGER_IMPLEMENTATION
|
||||
friend class textinput::Manager;
|
||||
public:
|
||||
EditBuffer() : mpString(NULL), mpUnfixString(NULL), mpZiString(NULL), mpAllocator(NULL) {}
|
||||
#endif
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
friend class LayoutByNW4R;
|
||||
friend class Base;
|
||||
#endif
|
||||
public:
|
||||
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION)
|
||||
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
void create(MEMAllocator* allocator);
|
||||
#endif
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
virtual ~EditBuffer();
|
||||
#else
|
||||
~EditBuffer();
|
||||
@@ -51,7 +59,7 @@ namespace textinput {
|
||||
};
|
||||
|
||||
class DeadKeyStream {
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION)
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
public:
|
||||
DeadKeyStream() { KPRInitRegionUS(); init(); }
|
||||
static wchar_t ToCombineClass(Language language, wchar_t code);
|
||||
@@ -63,6 +71,9 @@ namespace textinput {
|
||||
bool isEmpty() const { return mKPRQueue.oCount == 0; }
|
||||
void clear() { KPRClearQueue(&mKPRQueue); }
|
||||
private:
|
||||
#ifdef TIMANAGER_IMPLEMENTATION
|
||||
friend class textinput::Manager;
|
||||
#endif
|
||||
static bool sbCompatibleFilterEnabled;
|
||||
static inline bool isCompatible(wchar_t character);
|
||||
#elif defined(TI_PC_KEYBOARD_IMPLEMENTATION)
|
||||
@@ -117,7 +128,7 @@ namespace textinput {
|
||||
|
||||
// TODO - location
|
||||
class RowInfoManager {
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
friend class LayoutByNW4R;
|
||||
friend class Base;
|
||||
public:
|
||||
@@ -132,7 +143,7 @@ namespace textinput {
|
||||
};
|
||||
|
||||
virtual ~Base();
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
Base(Manager* manager);
|
||||
virtual void create(MEMAllocator* allocator);
|
||||
virtual void init();
|
||||
@@ -270,9 +281,9 @@ namespace textinput {
|
||||
|
||||
virtual void makeUpCursorPos(CursorPos* cursorPos, u32 pos, s32 startLine, s32 endLine);
|
||||
|
||||
#if defined(MYTIINPUTFORM_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION)
|
||||
#if defined(MYTIINPUTFORM_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
protected:
|
||||
#ifndef TIINPUTFORM_IMPLEMENTATION
|
||||
#if !defined(TIINPUTFORM_IMPLEMENTATION) && !defined(TIMANAGER_IMPLEMENTATION)
|
||||
void setCursorPos(tistring::Decolated* string, u32 pos);
|
||||
void calcCursorTimer();
|
||||
#endif
|
||||
@@ -280,7 +291,7 @@ namespace textinput {
|
||||
#else
|
||||
private:
|
||||
#endif
|
||||
#if defined(MYTIINPUTFORM_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION)
|
||||
#if defined(MYTIINPUTFORM_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
nw4r::ut::Rect mRect;
|
||||
#else
|
||||
Rect mRect;
|
||||
@@ -292,6 +303,9 @@ namespace textinput {
|
||||
tistring::WithZi* mpZiString; // 0x16C
|
||||
InputMode meInputMode; // 0x170
|
||||
PredictMode mePredictMode; // 0x174
|
||||
#ifdef TIMANAGER_IMPLEMENTATION
|
||||
friend class textinput::Manager;
|
||||
#endif
|
||||
bool mbPredictOn; // 0x178
|
||||
bool mbDoWordWrap; // 0x179
|
||||
bool mbRightWithSpace; // 0x17A
|
||||
@@ -327,12 +341,12 @@ namespace textinput {
|
||||
};
|
||||
|
||||
class LayoutByNW4R : public Base, public nw4rmanager::Layout {
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
friend class EventHandler;
|
||||
inline const nw4r::lyt::Pane* getLanguageTextPane() const;
|
||||
#endif
|
||||
public:
|
||||
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION)
|
||||
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
LayoutByNW4R(textinput::Manager*, nw4r::lyt::MultiArcResourceAccessor*, const char*, EventObserver*, const char*);
|
||||
#endif
|
||||
~LayoutByNW4R();
|
||||
@@ -349,7 +363,7 @@ namespace textinput {
|
||||
|
||||
virtual nw4r::math::VEC2 getScale() const;
|
||||
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
void updateRepeatInput(u32 trig, u32 hold);
|
||||
#endif
|
||||
virtual void updateInputCommon(int chan, u32 trig, u32 hold, u32 release, void* data);
|
||||
@@ -362,13 +376,13 @@ namespace textinput {
|
||||
virtual void setRootPaneScaleFor16x9();
|
||||
virtual void setRootPaneScaleFor4x3();
|
||||
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
virtual void onSE(sound::SE seId);
|
||||
#endif
|
||||
|
||||
virtual void visibleSeparator(bool flag);
|
||||
|
||||
#if defined(MYTIINPUTFORM_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION)
|
||||
#if defined(MYTIINPUTFORM_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
protected:
|
||||
const void* mpLayoutData;
|
||||
const void* mpLanguageData;
|
||||
|
||||
@@ -8,26 +8,31 @@ namespace textinput {
|
||||
|
||||
class KeyboardBase : public CommandSender {
|
||||
public:
|
||||
#ifdef TIMANAGER_IMPLEMENTATION
|
||||
KeyboardBase() : meLanguage(JP) {}
|
||||
#endif
|
||||
virtual ~KeyboardBase() {}
|
||||
#ifndef TI_PC_KEYBOARD_IMPLEMENTATION
|
||||
#if !defined(TI_PC_KEYBOARD_IMPLEMENTATION) && !defined(TIMANAGER_IMPLEMENTATION)
|
||||
virtual void create(MEMAllocator* alloc) override;
|
||||
virtual void init() override;
|
||||
virtual void setCommandReceiver(CommandReceiver* receiver) override;
|
||||
virtual void sendCommand(u32 command, void*) override;
|
||||
#endif
|
||||
#ifndef TIMANAGER_IMPLEMENTATION
|
||||
virtual void updateFromReceiver(u32, void*) override;
|
||||
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION) || defined(TI_PC_KEYBOARD_IMPLEMENTATION)
|
||||
#endif
|
||||
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION) || defined(TI_PC_KEYBOARD_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
virtual void onKey(u32, void*);
|
||||
#else
|
||||
virtual void onKey(u32);
|
||||
#endif
|
||||
#ifdef TI_PC_KEYBOARD_IMPLEMENTATION
|
||||
#if defined(TI_PC_KEYBOARD_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
virtual int getType();
|
||||
#else
|
||||
virtual void getType();
|
||||
#endif
|
||||
virtual void setLanguage(Language language);
|
||||
#ifdef TI_PC_KEYBOARD_IMPLEMENTATION
|
||||
#if defined(TI_PC_KEYBOARD_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
virtual Language getLanguage() const { return meLanguage; }
|
||||
virtual void update() {}
|
||||
#else
|
||||
|
||||
@@ -28,11 +28,20 @@ namespace textinput {
|
||||
virtual void onEvent(nw4r::lyt::Pane* pane, u32 event) {} // 0x10
|
||||
|
||||
virtual void onSE(sound::SE seId) {}
|
||||
#ifdef TIMANAGER_IMPLEMENTATION
|
||||
virtual void onOK();
|
||||
virtual void onCancel();
|
||||
virtual void onOutOfLength();
|
||||
#else
|
||||
virtual void onOK() { printf("OK!\n"); }
|
||||
virtual void onCancel() { printf("Cancel!\n"); }
|
||||
virtual void onOutOfLength() { printf("OutOfLength\n"); }
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef TIMANAGER_IMPLEMENTATION
|
||||
namespace predictlang { class LayoutByNW4R; }
|
||||
#endif
|
||||
class Manager : public Base {
|
||||
public:
|
||||
Manager(MEMAllocator* allocator, nw4r::lyt::MultiArcResourceAccessor* multiArc, textinput::EventObserver* event);
|
||||
@@ -94,14 +103,19 @@ namespace textinput {
|
||||
#endif
|
||||
|
||||
virtual void setSecretInputMode(bool secretInputMode) { mpInputForm->setSecretModeOn(secretInputMode); }
|
||||
#ifdef IPL_ADDRESS_EDIT_CPP
|
||||
#if defined(IPL_ADDRESS_EDIT_CPP) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
void enableKSXFilter(bool compatibleFilter);
|
||||
#endif
|
||||
|
||||
virtual void setDefaultPredictionJP(int num, const char** predicts);
|
||||
virtual void setFixedPredictionJP(int num, const char** predicts);
|
||||
|
||||
#ifdef TIMANAGER_IMPLEMENTATION
|
||||
virtual void setTitleText(wchar_t* titleText);
|
||||
void initAspect();
|
||||
#else
|
||||
virtual void setTitleText(const wchar_t* titleText);
|
||||
#endif
|
||||
|
||||
virtual void start() {}
|
||||
virtual void end() {}
|
||||
@@ -146,7 +160,7 @@ namespace textinput {
|
||||
void enableCompatibleFilter(bool compatibleFilter);
|
||||
|
||||
bool isVacancy() const;
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
bool isPredictTurning() const;
|
||||
void startPredictTurnOn(bool enabled);
|
||||
#endif
|
||||
@@ -163,9 +177,14 @@ namespace textinput {
|
||||
InputForm* mpInputForm; // 0x1C
|
||||
candidatebox::LayoutByNW4R* mpCandidateBox; // 0x20
|
||||
toolbar::LayoutByNW4R* mpToolBar; // 0x24
|
||||
#ifdef TIMANAGER_IMPLEMENTATION
|
||||
predictlang::LayoutByNW4R* mpPredictLanguageDialog;
|
||||
keyboard::signwindow::LayoutByNW4R* mpSignWindow;
|
||||
#else
|
||||
void* mpPredictLanguageDialog; // 0x28
|
||||
void* mpSignWindow; // 0x2C
|
||||
|
||||
#endif
|
||||
EventObserver* mpEventObserver; // 0x30
|
||||
|
||||
Destination meDestination; // 0x34
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace textinput {
|
||||
class TiEventHandler : public gui::EventHandler {
|
||||
public:
|
||||
typedef struct Input {
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
u32 controller;
|
||||
f32 x;
|
||||
f32 y;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef TEXTINPUT_PC_KEYBOARD_H
|
||||
#define TEXTINPUT_PC_KEYBOARD_H
|
||||
|
||||
#ifdef TI_PC_KEYBOARD_IMPLEMENTATION
|
||||
#if defined(TI_PC_KEYBOARD_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
#include "tiPcKeyboardImpl.h"
|
||||
#else
|
||||
|
||||
|
||||
@@ -17,6 +17,61 @@ namespace textinput {
|
||||
}
|
||||
namespace keyboard {
|
||||
namespace signwindow {
|
||||
#ifdef TIMANAGER_IMPLEMENTATION
|
||||
struct LanguageDependencyData;
|
||||
class Base : public KeyboardBase {
|
||||
public:
|
||||
Base(Manager* manager) : mpAllocator(NULL), mpManager(manager) {}
|
||||
virtual ~Base();
|
||||
virtual void create(MEMAllocator* allocator);
|
||||
virtual void init();
|
||||
virtual int getType();
|
||||
virtual void setLanguage(Language language);
|
||||
virtual bool isLocked();
|
||||
virtual void setPage(u8 page);
|
||||
virtual u8 getPage();
|
||||
virtual void movePrevSignPage();
|
||||
virtual void moveNextSignPage();
|
||||
virtual void close();
|
||||
private:
|
||||
u32 mInputState;
|
||||
const LanguageDependencyData* mpLanguageData;
|
||||
MEMAllocator* mpAllocator;
|
||||
Manager* mpManager;
|
||||
};
|
||||
class EventHandler;
|
||||
class LayoutByNW4R : public Base, public nw4rmanager::Layout, public nw4rmanager::AnmObserver {
|
||||
public:
|
||||
LayoutByNW4R(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* accessor, EventObserver* observer, const char* layoutName)
|
||||
: Base(manager), nw4rmanager::Layout(accessor, layoutName, observer), mbActive(false), mbInput(false), mpEventHandler(NULL), mpCaller(NULL) {}
|
||||
virtual ~LayoutByNW4R();
|
||||
virtual void create(MEMAllocator* allocator);
|
||||
virtual void init();
|
||||
virtual void onKey(u32 event, void* data);
|
||||
virtual void movePrevSignPage();
|
||||
virtual void moveNextSignPage();
|
||||
virtual void close();
|
||||
virtual void draw();
|
||||
virtual void open(KeyboardBase* keyboard, bool repeat);
|
||||
virtual bool isActive();
|
||||
virtual void onChangeAnmState(AnmEvent event, nw4rmanager::AnmPane* pane, nw4rmanager::Anim* animation);
|
||||
virtual bool updateInput(int chan, f32 x, f32 y, u32 trig, u32 hold, u32 release, void* data);
|
||||
virtual bool updateInput(input::HKBManager& hkb);
|
||||
virtual void throwReleaseForAll();
|
||||
virtual void resetAnmSignWindow();
|
||||
virtual void setSignKeyTop(u16 first, u16 count);
|
||||
virtual void setPageNumber(u16 page);
|
||||
virtual void endToClose();
|
||||
virtual void startToInput();
|
||||
virtual void movePrevSignWindow();
|
||||
virtual void moveNextSignWindow();
|
||||
private:
|
||||
bool mbActive;
|
||||
bool mbInput;
|
||||
EventHandler* mpEventHandler;
|
||||
KeyboardBase* mpCaller;
|
||||
};
|
||||
#else
|
||||
class Base : public KeyboardBase {
|
||||
public:
|
||||
virtual bool isLocked();
|
||||
@@ -32,7 +87,9 @@ namespace textinput {
|
||||
virtual void open(KeyboardBase* keyboard, bool repeat);
|
||||
virtual bool isActive();
|
||||
};
|
||||
#endif
|
||||
}
|
||||
|
||||
namespace pctype {
|
||||
|
||||
struct GridKey {
|
||||
@@ -117,6 +174,19 @@ namespace textinput {
|
||||
const LanguageData* data;
|
||||
Base* owner;
|
||||
};
|
||||
#ifdef TIMANAGER_IMPLEMENTATION
|
||||
Base(Manager* manager) {
|
||||
mKeyState.abcFlags = 0;
|
||||
mKeyState.inputType = 0;
|
||||
mKeyState.aiuFlags = 0;
|
||||
mKeyState.language = USA;
|
||||
mKeyState.data = NULL;
|
||||
mKeyState.owner = this;
|
||||
mpAllocator = NULL;
|
||||
mbOnlyQwerty = false;
|
||||
mpManager = manager;
|
||||
}
|
||||
#endif
|
||||
virtual ~Base();
|
||||
virtual void create(MEMAllocator* allocator);
|
||||
virtual inline void init();
|
||||
@@ -219,6 +289,11 @@ namespace textinput {
|
||||
};
|
||||
class LayoutByNW4R : public Base, public nw4rmanager::Layout, public UIObj::Listener {
|
||||
public:
|
||||
#ifdef TIMANAGER_IMPLEMENTATION
|
||||
LayoutByNW4R(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* accessor, EventObserver* observer, const char* layoutName)
|
||||
: Base(manager), nw4rmanager::Layout(accessor, layoutName, observer), mpKeyboardEventHandler(NULL),
|
||||
mShiftButton(1, this, this), mCapsButton(0, this, this), mModePanel(2, this, this) {}
|
||||
#endif
|
||||
virtual ~LayoutByNW4R();
|
||||
virtual void create(MEMAllocator* allocator);
|
||||
virtual void init();
|
||||
|
||||
@@ -14,11 +14,17 @@ namespace textinput {
|
||||
|
||||
class Base : public CommandSender {
|
||||
public:
|
||||
#ifdef TI_PREDICTLANG_SAMPLE_CLASS
|
||||
#if defined(TI_PREDICTLANG_SAMPLE_CLASS) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
Base(Manager* manager) : mePredictMode(inputform::Base::PM_USEn), mpAllocator(NULL), mpManager(manager) {}
|
||||
#endif
|
||||
|
||||
#ifdef TIMANAGER_IMPLEMENTATION
|
||||
virtual ~Base();
|
||||
virtual void init();
|
||||
virtual void create(MEMAllocator* allocator) override;
|
||||
#else
|
||||
virtual void create(MEMAllocator* allocator) override { mpAllocator = allocator; }
|
||||
#endif
|
||||
virtual void setPredictMode(inputform::Base::PredictMode mode) { mePredictMode = mode; }
|
||||
|
||||
protected:
|
||||
@@ -32,7 +38,11 @@ namespace textinput {
|
||||
|
||||
class LayoutByNW4R : public Base, public nw4rmanager::Layout, public nw4rmanager::AnmObserver {
|
||||
public:
|
||||
#ifdef TI_PREDICTLANG_SAMPLE_CLASS
|
||||
#ifdef TIMANAGER_IMPLEMENTATION
|
||||
LayoutByNW4R(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, EventObserver* observer, const char* layoutName)
|
||||
: Base(manager), nw4rmanager::Layout(resAccessor, layoutName, observer), mbActive(false), mbInput(false),
|
||||
mpEventHandler(NULL), meDestination(DST_US), mpCaller(NULL) {}
|
||||
#elif defined(TI_PREDICTLANG_SAMPLE_CLASS)
|
||||
LayoutByNW4R(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, EventObserver* observer)
|
||||
: Base(manager), nw4rmanager::Layout(resAccessor, "fs_prdicSelWidw_a.brlyt", observer), mbActive(false), mbInput(false),
|
||||
mpEventHandler(NULL), meDestination(DST_US), mpCaller(NULL) {}
|
||||
@@ -68,12 +78,21 @@ namespace textinput {
|
||||
keyboard::KeyboardBase* mpCaller; // 0xD4
|
||||
};
|
||||
|
||||
#ifdef TI_PREDICTLANG_SAMPLE_CLASS
|
||||
#if defined(TI_PREDICTLANG_SAMPLE_CLASS) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
class Sample : public LayoutByNW4R {
|
||||
public:
|
||||
#ifdef TIMANAGER_IMPLEMENTATION
|
||||
Sample(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, EventObserver* observer, const char* layoutName)
|
||||
: LayoutByNW4R(manager, resAccessor, observer, layoutName) {}
|
||||
#else
|
||||
Sample(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, EventObserver* observer)
|
||||
: LayoutByNW4R(manager, resAccessor, observer) {}
|
||||
#endif
|
||||
#ifdef TIMANAGER_IMPLEMENTATION
|
||||
virtual ~Sample();
|
||||
#else
|
||||
virtual ~Sample() {}
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <revolution/types.h>
|
||||
#include <revolution/mem/allocator.h>
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
#include <revolution/kpr.h>
|
||||
#endif
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace textinput {
|
||||
virtual wchar_t* getWCString() const { return mpszString; }
|
||||
|
||||
virtual void setCandidate(wchar_t candidate) { mwcCandidate = candidate; }
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
virtual wchar_t getCandidate() const { return mwcCandidate; }
|
||||
#else
|
||||
virtual wchar_t getCandidate() { return mwcCandidate; }
|
||||
@@ -61,7 +61,7 @@ namespace textinput {
|
||||
};
|
||||
|
||||
class KanaStream {
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
public:
|
||||
KPRQueue mQueue;
|
||||
wchar_t mPending;
|
||||
@@ -74,13 +74,13 @@ namespace textinput {
|
||||
|
||||
class Decolated : public StringBase {
|
||||
public:
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
Decolated(u16 maxLen) : StringBase(maxLen), mCursorStart(0), mCursorEnd(0), mbSustain(false), mTranslateMode(0) { initKanaConverter(); }
|
||||
#else
|
||||
Decolated(u16 maxLen) : StringBase(maxLen), field_0x18(0), field_0x1C(0), field_0x20(0), field_0x24(0) { initKanaConverter(); }
|
||||
#endif
|
||||
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
virtual ~Decolated();
|
||||
enum TranslateMode { TM_Direct, TM_Kana, TM_Roman, TM_Hangul };
|
||||
virtual void clear();
|
||||
@@ -103,7 +103,7 @@ namespace textinput {
|
||||
virtual u32 getCursorPos() const;
|
||||
virtual void getCursorPos(u32* start, u32* end);
|
||||
virtual bool canBackSpace();
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
virtual bool deleteForward();
|
||||
#else
|
||||
virtual void deleteForward();
|
||||
@@ -162,7 +162,7 @@ namespace textinput {
|
||||
#endif
|
||||
|
||||
private:
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
u32 mCursorStart;
|
||||
u32 mCursorEnd;
|
||||
bool mbSustain;
|
||||
@@ -176,7 +176,7 @@ namespace textinput {
|
||||
KanaStream mKanaStream; // 0x28
|
||||
};
|
||||
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
class WithAtok : public Decolated {
|
||||
public:
|
||||
WithAtok(u16 maxLength) : Decolated(maxLength) {}
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
|
||||
#include <nw4r/ut/CharWriter.h>
|
||||
#include <nw4r/ut/Rect.h>
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
namespace textinput {
|
||||
namespace textdrawer {
|
||||
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(MYTIINPUTFORM_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION)
|
||||
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(MYTIINPUTFORM_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
class Base : public nw4r::ut::CharWriter {
|
||||
#else
|
||||
class Base : nw4r::ut::CharWriter {
|
||||
@@ -34,7 +34,7 @@ namespace textinput {
|
||||
} CursorPos;
|
||||
|
||||
typedef struct DrawInfo {
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
nw4r::ut::Rect rect;
|
||||
wchar_t character;
|
||||
#else
|
||||
@@ -42,7 +42,7 @@ namespace textinput {
|
||||
#endif
|
||||
} DrawInfo;
|
||||
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
Base() : mpDrawAllocator(NULL), mfViewX(0.0f), mfViewY(0.0f), mfViewWidth(0.0f), mfViewHeight(0.0f),
|
||||
mfVIWidth(640.0f), mbAspect4x3(false), mbDrawClipped(false), muLine(0), mfLineSpacing(0.0f),
|
||||
mfCharacterSpacing(0.0f), mfFontWidth(0.0f), mfFontHeight(0.0f), mfModifyStartY(0.0f), mfMinScrollY(0.0f),
|
||||
@@ -94,7 +94,7 @@ namespace textinput {
|
||||
virtual u32 getEndPos() const;
|
||||
|
||||
// todo
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
virtual void setDrawModifyScopeLine(s32 startLine, s32 endLine);
|
||||
virtual void setDrawCacheScopeLine(s32 startLine, s32 endLine);
|
||||
virtual void modifyCursorCache(s32 line, u32 position, f32 x, f32 y, f32 width, f32 height);
|
||||
@@ -103,12 +103,12 @@ namespace textinput {
|
||||
virtual void setDrawCacheScopeLine();
|
||||
virtual void modifyCursorCache();
|
||||
#endif
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
virtual bool isEnableCursorCache() const;
|
||||
#else
|
||||
virtual void isEnableCursorCache();
|
||||
#endif
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
virtual u32 getDrawModifyStartLine() const;
|
||||
virtual u32 getDrawModifyEndLine() const;
|
||||
#else
|
||||
@@ -119,7 +119,7 @@ namespace textinput {
|
||||
virtual void dirtyDrawCache();
|
||||
virtual void dirtyCursorCache();
|
||||
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
protected:
|
||||
MEMAllocator* mpDrawAllocator;
|
||||
u8 mDrawConfiguration[0x34];
|
||||
@@ -145,7 +145,7 @@ namespace textinput {
|
||||
u8 unk_0x50[0x78];
|
||||
#endif
|
||||
bool mbSecretMode; // 0xC8
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
u32 muDrawModifyStartLine;
|
||||
u32 muDrawModifyEndLine;
|
||||
u32 muDrawModifyStartPos;
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace textinput {
|
||||
f32 y; // 0x08
|
||||
} Scroll;
|
||||
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
enum HVKCode { HVK_None = 0 };
|
||||
#endif
|
||||
|
||||
@@ -54,11 +54,11 @@ namespace textinput {
|
||||
class CommandSender;
|
||||
class CommandReceiver : public Base {
|
||||
public:
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
CommandReceiver() { clearSender(); }
|
||||
virtual ~CommandReceiver();
|
||||
#endif
|
||||
#if defined(MYTIINPUTFORM_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION)
|
||||
#if defined(MYTIINPUTFORM_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
struct Scroll {
|
||||
bool absY;
|
||||
f32 x;
|
||||
@@ -70,7 +70,7 @@ namespace textinput {
|
||||
INPUT_COMMAND_37 = 37,
|
||||
} INPUT_COMMAND;
|
||||
|
||||
#ifdef TI_PC_KEYBOARD_IMPLEMENTATION
|
||||
#if defined(TI_PC_KEYBOARD_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
struct ChangePredictMode { u32 mode; bool enabled; };
|
||||
#endif
|
||||
virtual void clearSender();
|
||||
@@ -86,7 +86,7 @@ namespace textinput {
|
||||
CommandSender() : mpCommandReceiver(NULL) {}
|
||||
|
||||
virtual void setCommandReceiver(CommandReceiver* cmdRecv);
|
||||
#ifdef TI_PC_KEYBOARD_IMPLEMENTATION
|
||||
#if defined(TI_PC_KEYBOARD_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
virtual void sendCommand(u32 command, void* data) {
|
||||
if (mpCommandReceiver != NULL) mpCommandReceiver->onCommand(static_cast<CommandReceiver::INPUT_COMMAND>(command), data);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace textinput {
|
||||
namespace toolbar {
|
||||
class Base {
|
||||
public:
|
||||
#ifdef TI_TOOLBAR_SAMPLE_CLASS
|
||||
#if defined(TI_TOOLBAR_SAMPLE_CLASS) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
Base(Manager* manager) : mQwerty(true), meLanguage(USA), mpAllocator(NULL), mpManager(manager) {}
|
||||
#endif
|
||||
|
||||
@@ -35,7 +35,11 @@ namespace textinput {
|
||||
|
||||
class LayoutByNW4R : public Base, public nw4rmanager::Layout {
|
||||
public:
|
||||
#ifdef TI_TOOLBAR_SAMPLE_CLASS
|
||||
#ifdef TIMANAGER_IMPLEMENTATION
|
||||
LayoutByNW4R(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, EventObserver* observer, const char* layoutName)
|
||||
: Base(manager), nw4rmanager::Layout(resAccessor, layoutName, observer), mpEventHandler(NULL),
|
||||
mbIsEnableQwertyChg(false) {}
|
||||
#elif defined(TI_TOOLBAR_SAMPLE_CLASS)
|
||||
LayoutByNW4R(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, EventObserver* observer)
|
||||
: Base(manager), nw4rmanager::Layout(resAccessor, "fs_VK_toolbar_a.brlyt", observer), mpEventHandler(NULL),
|
||||
mbIsEnableQwertyChg(false) {}
|
||||
@@ -117,12 +121,21 @@ namespace textinput {
|
||||
KeyType meKeyType; // 0x30
|
||||
};
|
||||
|
||||
#ifdef TI_TOOLBAR_SAMPLE_CLASS
|
||||
#if defined(TI_TOOLBAR_SAMPLE_CLASS) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
class Sample : public LayoutByNW4R {
|
||||
public:
|
||||
#ifdef TIMANAGER_IMPLEMENTATION
|
||||
Sample(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, EventObserver* observer, const char* layoutName)
|
||||
: LayoutByNW4R(manager, resAccessor, observer, layoutName) {}
|
||||
#else
|
||||
Sample(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, EventObserver* observer)
|
||||
: LayoutByNW4R(manager, resAccessor, observer) {}
|
||||
#endif
|
||||
#ifdef TIMANAGER_IMPLEMENTATION
|
||||
virtual ~Sample();
|
||||
#else
|
||||
virtual ~Sample() {}
|
||||
#endif
|
||||
};
|
||||
#else
|
||||
class Sample {};
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#ifndef TEXTINPUT_ZI_STRING_H
|
||||
#define TEXTINPUT_ZI_STRING_H
|
||||
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
#include "tiString.h"
|
||||
#include <eztx.h>
|
||||
#endif
|
||||
|
||||
namespace textinput {
|
||||
namespace tistring {
|
||||
#ifdef TIINPUTFORM_IMPLEMENTATION
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
class WithZi : public Decolated {
|
||||
public:
|
||||
enum PredictLanguage { PL_Default };
|
||||
|
||||
327
src/keyboard/tiManager.cpp
Normal file
327
src/keyboard/tiManager.cpp
Normal file
@@ -0,0 +1,327 @@
|
||||
#define TIMANAGER_IMPLEMENTATION
|
||||
#include "keyboard/tiPcKeyboard.h"
|
||||
#include "keyboard/tiCellPhone.h"
|
||||
#include "keyboard/tiInputForm.h"
|
||||
#include <revolution/sc.h>
|
||||
#include <new>
|
||||
|
||||
namespace textinput {
|
||||
namespace keyboard {
|
||||
namespace pctype {
|
||||
class Sample : public LayoutByNW4R {
|
||||
public:
|
||||
Sample(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* accessor, EventObserver* observer, const char* layoutName)
|
||||
: LayoutByNW4R(manager, accessor, observer, layoutName) {}
|
||||
virtual ~Sample();
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
namespace textinput {
|
||||
namespace keyboard {
|
||||
namespace cellphonetype {
|
||||
class Sample : public LayoutByNW4R {
|
||||
public:
|
||||
Sample(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* accessor, EventObserver* observer, const char* layoutName)
|
||||
: LayoutByNW4R(manager, accessor, observer, layoutName) {}
|
||||
virtual ~Sample();
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
namespace textinput {
|
||||
namespace candidatebox {
|
||||
class Sample : public LayoutByNW4R {
|
||||
public:
|
||||
Sample(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* accessor, EventObserver* observer, const char* layoutName)
|
||||
: LayoutByNW4R(manager, accessor, observer, layoutName) {}
|
||||
virtual ~Sample();
|
||||
};
|
||||
}
|
||||
}
|
||||
namespace textinput {
|
||||
namespace inputform {
|
||||
class Sample : public LayoutByNW4R {
|
||||
public:
|
||||
Sample(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* accessor, EventObserver* observer, const char* layoutName)
|
||||
: LayoutByNW4R(manager, accessor, layoutName, observer, NULL) {}
|
||||
virtual ~Sample();
|
||||
};
|
||||
}
|
||||
}
|
||||
#include "keyboard/tiToolBar.h"
|
||||
#include "keyboard/tiPredictLang.h"
|
||||
namespace textinput { namespace keyboard {
|
||||
namespace signwindow {
|
||||
class Sample : public LayoutByNW4R {
|
||||
public:
|
||||
Sample(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* accessor, EventObserver* observer, const char* layoutName)
|
||||
: LayoutByNW4R(manager, accessor, observer, layoutName) {}
|
||||
virtual ~Sample();
|
||||
};
|
||||
}
|
||||
}}
|
||||
#include "keyboard/tiManager.h"
|
||||
namespace textinput {
|
||||
static EventObserver defaultEventObserver;
|
||||
|
||||
Manager::Manager(MEMAllocator* allocator, nw4r::lyt::MultiArcResourceAccessor* accessor, EventObserver* observer)
|
||||
: mpAllocator(allocator), mpMultiArcResourceAccessor(accessor), mpEditBuffer(NULL), mpHWKeyboard(NULL), mpPCKeyboard(NULL),
|
||||
mpCellPhoneKeyboard(NULL), mpInputForm(NULL), mpCandidateBox(NULL), mpToolBar(NULL), mpPredictLanguageDialog(NULL),
|
||||
mpSignWindow(NULL), mpEventObserver(observer), meDestination(DST_JP), meLanguage(JP), mbAspectRatio4x3(true) {
|
||||
if (observer == NULL) mpEventObserver = &defaultEventObserver;
|
||||
}
|
||||
|
||||
Manager::~Manager() {
|
||||
if (mpPCKeyboard) { mpPCKeyboard->~LayoutByNW4R(); MEMFreeToAllocator(mpAllocator, mpPCKeyboard); }
|
||||
if (mpCellPhoneKeyboard) { mpCellPhoneKeyboard->~LayoutByNW4R(); MEMFreeToAllocator(mpAllocator, mpCellPhoneKeyboard); }
|
||||
if (mpInputForm) { mpInputForm->~LayoutByNW4R(); MEMFreeToAllocator(mpAllocator, mpInputForm); }
|
||||
if (mpCandidateBox) { mpCandidateBox->~LayoutByNW4R(); MEMFreeToAllocator(mpAllocator, mpCandidateBox); }
|
||||
if (mpToolBar) { mpToolBar->~LayoutByNW4R(); MEMFreeToAllocator(mpAllocator, mpToolBar); }
|
||||
if (mpPredictLanguageDialog) { mpPredictLanguageDialog->~LayoutByNW4R(); MEMFreeToAllocator(mpAllocator, mpPredictLanguageDialog); }
|
||||
if (mpSignWindow) { mpSignWindow->~LayoutByNW4R(); MEMFreeToAllocator(mpAllocator, mpSignWindow); }
|
||||
if (mpHWKeyboard) { mpHWKeyboard->~HWKeyboard(); MEMFreeToAllocator(mpAllocator, mpHWKeyboard); }
|
||||
if (mpEditBuffer) { mpEditBuffer->~EditBuffer(); MEMFreeToAllocator(mpAllocator, mpEditBuffer); }
|
||||
|
||||
}
|
||||
|
||||
keyboard::hwkey::HWKeyboard::~HWKeyboard() {}
|
||||
|
||||
void Manager::create(MEMAllocator*) {
|
||||
mpEditBuffer = createEditBuffer();
|
||||
mpEditBuffer->create(mpAllocator);
|
||||
mpHWKeyboard = createHWKeyboard();
|
||||
mpPCKeyboard = static_cast<keyboard::pctype::LayoutByNW4R*>(createPCTypeKeyboard());
|
||||
mpPCKeyboard->create(mpAllocator);
|
||||
mpCellPhoneKeyboard = static_cast<keyboard::cellphonetype::LayoutByNW4R*>(createCellPhoneTypeKeyboard());
|
||||
mpCellPhoneKeyboard->create(mpAllocator);
|
||||
mpInputForm = createInputForm();
|
||||
mpInputForm->create(mpAllocator, mpEditBuffer);
|
||||
mpCandidateBox = static_cast<candidatebox::LayoutByNW4R*>(createCandidateBox());
|
||||
mpCandidateBox->create(mpAllocator);
|
||||
mpToolBar = static_cast<toolbar::LayoutByNW4R*>(createToolBar());
|
||||
mpToolBar->create(mpAllocator);
|
||||
mpPredictLanguageDialog = static_cast<predictlang::LayoutByNW4R*>(createPredictLanguageDialog());
|
||||
mpPredictLanguageDialog->create(mpAllocator);
|
||||
mpSignWindow = static_cast<keyboard::signwindow::LayoutByNW4R*>(createSignWindow());
|
||||
mpSignWindow->create(mpAllocator);
|
||||
if (SCGetAspectRatio() == 1) { setLayoutScaleFor16x9(); mbAspectRatio4x3 = false; }
|
||||
else { setLayoutScaleFor4x3(); mbAspectRatio4x3 = true; }
|
||||
init();
|
||||
}
|
||||
|
||||
void Manager::initAspect() {
|
||||
if (SCGetAspectRatio() == 1) { setLayoutScaleFor16x9(); mbAspectRatio4x3 = false; }
|
||||
else { setLayoutScaleFor4x3(); mbAspectRatio4x3 = true; }
|
||||
}
|
||||
|
||||
void Manager::init() {
|
||||
input::HKBManager::getInstance().ClearState();
|
||||
mpInputForm->clearSender();
|
||||
mpHWKeyboard->setCommandReceiver(mpInputForm);
|
||||
mpPCKeyboard->setCommandReceiver(mpInputForm);
|
||||
mpCellPhoneKeyboard->setCommandReceiver(mpInputForm);
|
||||
mpCandidateBox->setCommandReceiver(mpInputForm);
|
||||
mpPredictLanguageDialog->setCommandReceiver(mpInputForm);
|
||||
mpSignWindow->setCommandReceiver(mpInputForm);
|
||||
mpInputForm->setCandidateBox(mpCandidateBox);
|
||||
mpPCKeyboard->setPredictLanguageDialog(mpPredictLanguageDialog);
|
||||
mpPCKeyboard->setSignWindow(mpSignWindow);
|
||||
mpCellPhoneKeyboard->setPredictLanguageDialog(mpPredictLanguageDialog);
|
||||
mpCellPhoneKeyboard->setSignWindow(mpSignWindow);
|
||||
if (mbAspectRatio4x3 == true) setLayoutScaleFor4x3();
|
||||
else setLayoutScaleFor16x9();
|
||||
mpPredictLanguageDialog->setDestination(meDestination);
|
||||
mpInputForm->setDestination(meDestination);
|
||||
mpInputForm->setLanguage(meLanguage);
|
||||
mpPCKeyboard->setLanguage(meLanguage);
|
||||
mpCellPhoneKeyboard->setLanguage(meLanguage);
|
||||
mpSignWindow->setLanguage(meLanguage);
|
||||
mpCandidateBox->setLanguage(meLanguage);
|
||||
mpToolBar->setLanguage(meLanguage);
|
||||
mpPredictLanguageDialog->setLanguage(meLanguage);
|
||||
mpHWKeyboard->setLanguage(meDestination, meLanguage);
|
||||
mpHWKeyboard->init();
|
||||
mpPCKeyboard->init();
|
||||
mpCellPhoneKeyboard->init();
|
||||
mpInputForm->init();
|
||||
mpCandidateBox->init();
|
||||
mpToolBar->init();
|
||||
mpPredictLanguageDialog->init();
|
||||
mpSignWindow->init();
|
||||
setFixedPredictionJP(0, NULL);
|
||||
setSecretInputMode(false);
|
||||
}
|
||||
|
||||
void Manager::setFixedPredictionJP(int count, const char** predictions) {
|
||||
static_cast<tistring::WithAtok*>(getInputForm()->getAtokString())->setFixPrediction(count, predictions);
|
||||
}
|
||||
|
||||
void Manager::calc() {
|
||||
if (mpToolBar->isQwerty()) mpPCKeyboard->calc();
|
||||
else mpCellPhoneKeyboard->calc();
|
||||
static_cast<nw4rmanager::Layout&>(*mpToolBar).calc();
|
||||
mpCandidateBox->calc();
|
||||
mpInputForm->calc();
|
||||
if (mpPredictLanguageDialog->isActive()) static_cast<nw4rmanager::Layout&>(*mpPredictLanguageDialog).calc();
|
||||
if (mpSignWindow->isActive()) static_cast<nw4rmanager::Layout&>(*mpSignWindow).calc();
|
||||
}
|
||||
|
||||
void Manager::draw() {
|
||||
GXSetZMode(GX_TRUE, GX_LEQUAL, GX_TRUE);
|
||||
mpToolBar->draw();
|
||||
mpInputForm->draw();
|
||||
if (mpToolBar->isQwerty()) mpPCKeyboard->draw();
|
||||
else mpCellPhoneKeyboard->draw();
|
||||
mpCandidateBox->draw();
|
||||
if (mpPredictLanguageDialog->isActive()) mpPredictLanguageDialog->draw();
|
||||
if (mpSignWindow->isActive()) mpSignWindow->draw();
|
||||
}
|
||||
|
||||
bool Manager::updateInput(int channel, f32 x, f32 y, u32 trigger, u32 hold, u32 release) {
|
||||
bool wasQwerty = mpToolBar->isQwerty();
|
||||
nw4rmanager::TiEventHandler::Input input;
|
||||
input.controller = channel;
|
||||
input.x = x;
|
||||
input.y = y;
|
||||
input.trigger = trigger;
|
||||
input.hold = hold;
|
||||
input.release = release;
|
||||
mpHWKeyboard->updateInput(channel, x, y, trigger, hold, release, &input);
|
||||
bool handled;
|
||||
if (mpPredictLanguageDialog->isActive()) {
|
||||
return static_cast<nw4rmanager::Layout&>(*mpPredictLanguageDialog).updateInput(channel, x, y, trigger, hold, release, &input);
|
||||
}
|
||||
mpInputForm->updateInputCommon(channel, trigger, hold, release, &input);
|
||||
if (mpSignWindow->isActive()) {
|
||||
return mpSignWindow->updateInput(channel, x, y, trigger, hold, release, &input);
|
||||
} else {
|
||||
bool keyboardHandled;
|
||||
if (wasQwerty) keyboardHandled = mpPCKeyboard->updateInput(channel, x, y, trigger, hold, release, &input);
|
||||
else keyboardHandled = mpCellPhoneKeyboard->updateInput(channel, x, y, trigger, hold, release, &input);
|
||||
bool toolbarHandled = static_cast<nw4rmanager::Layout&>(*mpToolBar).updateInput(channel, x, y, trigger, hold, release, &input);
|
||||
bool candidateHandled = static_cast<nw4rmanager::Layout&>(*mpCandidateBox).updateInput(channel, x, y, trigger, hold, release, &input);
|
||||
bool formHandled = mpInputForm->updateInput(channel, x, y, trigger, hold, release, &input);
|
||||
handled = (keyboardHandled | candidateHandled) | (formHandled | toolbarHandled);
|
||||
}
|
||||
if (wasQwerty != mpToolBar->isQwerty()) {
|
||||
getInputForm()->onCommand(static_cast<CommandReceiver::INPUT_COMMAND>(6), NULL);
|
||||
mpCandidateBox->checkValidation();
|
||||
if (mpToolBar->isQwerty()) mpPCKeyboard->onActive();
|
||||
else mpCellPhoneKeyboard->onActive();
|
||||
}
|
||||
return handled;
|
||||
}
|
||||
|
||||
bool Manager::updateInput(input::HKBManager& keyboard) {
|
||||
bool wasQwerty = mpToolBar->isQwerty();
|
||||
bool handled;
|
||||
if (mpPredictLanguageDialog->isActive()) return static_cast<nw4rmanager::Layout&>(*mpPredictLanguageDialog).updateInput(keyboard);
|
||||
else if (mpSignWindow->isActive()) return mpSignWindow->updateInput(keyboard);
|
||||
else {
|
||||
bool keyboardHandled;
|
||||
if (wasQwerty) keyboardHandled = mpPCKeyboard->updateInput(keyboard);
|
||||
else keyboardHandled = mpCellPhoneKeyboard->updateInput(keyboard);
|
||||
bool toolbarHandled = static_cast<nw4rmanager::Layout&>(*mpToolBar).updateInput(keyboard);
|
||||
bool candidateHandled = static_cast<nw4rmanager::Layout&>(*mpCandidateBox).updateInput(keyboard);
|
||||
bool formHandled = mpInputForm->updateInput(keyboard);
|
||||
handled = (keyboardHandled | candidateHandled) | (formHandled | toolbarHandled);
|
||||
}
|
||||
if (wasQwerty != mpToolBar->isQwerty()) {
|
||||
getInputForm()->onCommand(static_cast<CommandReceiver::INPUT_COMMAND>(6), NULL);
|
||||
mpCandidateBox->checkValidation();
|
||||
if (mpToolBar->isQwerty()) mpPCKeyboard->onActive();
|
||||
else mpCellPhoneKeyboard->onActive();
|
||||
}
|
||||
return handled;
|
||||
}
|
||||
|
||||
wchar_t* Manager::getWCString() const { return mpInputForm->getWCString(); }
|
||||
void Manager::setWCString(const wchar_t* string) { mpInputForm->inputform::Base::setString(string); }
|
||||
void Manager::setLanguage(Language language) { meLanguage = language; }
|
||||
void Manager::setDestination(Destination destination) { meDestination = destination; }
|
||||
void Manager::limitStringLength(u32 length) { mpInputForm->limitStringLength(length); }
|
||||
void Manager::limitRowNum(u32 rows) { mpInputForm->limitRowNum(rows); }
|
||||
|
||||
void Manager::setAnimationOn(bool enabled) {
|
||||
static_cast<nw4rmanager::Layout&>(*mpPCKeyboard).setAnimOn(enabled);
|
||||
static_cast<nw4rmanager::Layout&>(*mpCellPhoneKeyboard).setAnimOn(enabled);
|
||||
static_cast<nw4rmanager::Layout&>(*mpInputForm).setAnimOn(enabled);
|
||||
static_cast<nw4rmanager::Layout&>(*mpCandidateBox).setAnimOn(enabled);
|
||||
static_cast<nw4rmanager::Layout&>(*mpToolBar).setAnimOn(enabled);
|
||||
static_cast<nw4rmanager::Layout&>(*mpPredictLanguageDialog).setAnimOn(enabled);
|
||||
static_cast<nw4rmanager::Layout&>(*mpSignWindow).setAnimOn(enabled);
|
||||
}
|
||||
void Manager::setAspectRatio(bool standard) {
|
||||
mbAspectRatio4x3 = standard;
|
||||
if (static_cast<u8>(standard) == true) setLayoutScaleFor4x3();
|
||||
else setLayoutScaleFor16x9();
|
||||
}
|
||||
void Manager::setTitleText(wchar_t* title) {
|
||||
nw4r::lyt::TextBox* text = nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(static_cast<nw4rmanager::Layout&>(*mpInputForm).getPane("T_title_text"));
|
||||
if (text != NULL) text->SetString(title, 0);
|
||||
}
|
||||
void Manager::setLayoutScaleFor16x9() {
|
||||
static_cast<nw4rmanager::Layout&>(*mpPCKeyboard).setRootPaneScaleFor16x9();
|
||||
static_cast<nw4rmanager::Layout&>(*mpCellPhoneKeyboard).setRootPaneScaleFor16x9();
|
||||
mpInputForm->setRootPaneScaleFor16x9();
|
||||
mpCandidateBox->setRootPaneScaleFor16x9();
|
||||
static_cast<nw4rmanager::Layout&>(*mpToolBar).setRootPaneScaleFor16x9();
|
||||
static_cast<nw4rmanager::Layout&>(*mpPredictLanguageDialog).setRootPaneScaleFor16x9();
|
||||
static_cast<nw4rmanager::Layout&>(*mpSignWindow).setRootPaneScaleFor16x9();
|
||||
}
|
||||
void Manager::setLayoutScaleFor4x3() {
|
||||
static_cast<nw4rmanager::Layout&>(*mpPCKeyboard).setRootPaneScaleFor4x3();
|
||||
static_cast<nw4rmanager::Layout&>(*mpCellPhoneKeyboard).setRootPaneScaleFor4x3();
|
||||
mpInputForm->setRootPaneScaleFor4x3();
|
||||
mpCandidateBox->setRootPaneScaleFor4x3();
|
||||
static_cast<nw4rmanager::Layout&>(*mpToolBar).setRootPaneScaleFor4x3();
|
||||
static_cast<nw4rmanager::Layout&>(*mpPredictLanguageDialog).setRootPaneScaleFor4x3();
|
||||
static_cast<nw4rmanager::Layout&>(*mpSignWindow).setRootPaneScaleFor4x3();
|
||||
}
|
||||
inputform::EditBuffer* Manager::createEditBuffer() { return new (MEMAllocFromAllocator(mpAllocator, sizeof(inputform::EditBuffer))) inputform::EditBuffer; }
|
||||
keyboard::hwkey::HWKeyboard* Manager::createHWKeyboard() { return new (MEMAllocFromAllocator(mpAllocator, sizeof(keyboard::hwkey::HWKeyboard))) keyboard::hwkey::HWKeyboard(this); }
|
||||
void* Manager::createPCTypeKeyboard() { return new (MEMAllocFromAllocator(mpAllocator, sizeof(keyboard::pctype::Sample))) keyboard::pctype::Sample(this, mpMultiArcResourceAccessor, mpEventObserver, "fs_VK_ascii_keytop_a.brlyt"); }
|
||||
void* Manager::createCellPhoneTypeKeyboard() { return new (MEMAllocFromAllocator(mpAllocator, sizeof(keyboard::cellphonetype::Sample))) keyboard::cellphonetype::Sample(this, mpMultiArcResourceAccessor, mpEventObserver, "fs_VK_cellPhone_a.brlyt"); }
|
||||
InputForm* Manager::createInputForm() { return new (MEMAllocFromAllocator(mpAllocator, sizeof(inputform::Sample))) inputform::Sample(this, mpMultiArcResourceAccessor, mpEventObserver, "fs_VK_textBox_a.brlyt"); }
|
||||
void* Manager::createCandidateBox() { return new (MEMAllocFromAllocator(mpAllocator, sizeof(candidatebox::Sample))) candidatebox::Sample(this, mpMultiArcResourceAccessor, mpEventObserver, "fs_VK_predictInput_a.brlyt"); }
|
||||
void* Manager::createToolBar() { return new (MEMAllocFromAllocator(mpAllocator, sizeof(toolbar::Sample))) toolbar::Sample(this, mpMultiArcResourceAccessor, mpEventObserver, "fs_VK_toolbar_a.brlyt"); }
|
||||
void* Manager::createPredictLanguageDialog() { return new (MEMAllocFromAllocator(mpAllocator, sizeof(predictlang::Sample))) predictlang::Sample(this, mpMultiArcResourceAccessor, mpEventObserver, "fs_prdicSelWidw_a.brlyt"); }
|
||||
predictlang::Base::~Base() {}
|
||||
void* Manager::createSignWindow() { return new (MEMAllocFromAllocator(mpAllocator, sizeof(keyboard::signwindow::Sample))) keyboard::signwindow::Sample(this, mpMultiArcResourceAccessor, mpEventObserver, "fs_signWindow_a.brlyt"); }
|
||||
void Manager::startPredictTurnOn(bool enabled) {
|
||||
if (getInputForm()->mbPredictOn != enabled) getCandidateBox()->startTurnOn(enabled);
|
||||
}
|
||||
bool Manager::isPredictTurning() const { return getCandidateBox()->getOnOffButton().IsTurning(); }
|
||||
void Manager::enableCompatibleFilter(bool enabled) { inputform::DeadKeyStream::sbCompatibleFilterEnabled = enabled; }
|
||||
void Manager::enableKSXFilter(bool enabled) {
|
||||
static_cast<tistring::Decolated*>(mpEditBuffer->mpString)->EnableKSXFilter(enabled);
|
||||
static_cast<tistring::Decolated*>(mpEditBuffer->mpZiString)->EnableKSXFilter(enabled);
|
||||
}
|
||||
bool Manager::isVacancy() const {
|
||||
if (!getInputForm() || !getToolBar()) return true;
|
||||
if (!getToolBar()->isQwerty() && getCellPhoneKeyboard()->isHoldingButton()) return false;
|
||||
return getInputForm()->inputform::Base::isVacancy();
|
||||
}
|
||||
void Manager::SetFont(nw4r::lyt::FontRefLink* link) {
|
||||
nw4r::ut::Font* font = link->GetFont();
|
||||
if (mpToolBar) static_cast<nw4rmanager::Layout&>(*mpToolBar).SetFontForce(font);
|
||||
if (mpPCKeyboard) static_cast<nw4rmanager::Layout&>(*mpPCKeyboard).SetFontForce(font);
|
||||
if (mpCandidateBox) static_cast<nw4rmanager::Layout&>(*mpCandidateBox).SetFontForce(font);
|
||||
if (mpSignWindow) static_cast<nw4rmanager::Layout&>(*mpSignWindow).SetFontForce(font);
|
||||
if (mpInputForm) mpInputForm->nw4r::ut::CharWriter::SetFont(*font);
|
||||
if (mpCellPhoneKeyboard) static_cast<nw4rmanager::Layout&>(*mpCellPhoneKeyboard).SetFontForce(font);
|
||||
}
|
||||
void Manager::setDefaultPredictionJP(int count, const char** predictions) {
|
||||
static_cast<tistring::WithAtok*>(getInputForm()->getAtokString())->setDefaultPrediction(count, predictions);
|
||||
}
|
||||
void predictlang::Base::init() {}
|
||||
void predictlang::Base::create(MEMAllocator* allocator) { mpAllocator = allocator; }
|
||||
keyboard::pctype::Sample::~Sample() {}
|
||||
keyboard::cellphonetype::Sample::~Sample() {}
|
||||
candidatebox::Sample::~Sample() {}
|
||||
inputform::Sample::~Sample() {}
|
||||
toolbar::Sample::~Sample() {}
|
||||
predictlang::Sample::~Sample() {}
|
||||
keyboard::signwindow::Sample::~Sample() {}
|
||||
}
|
||||
55
tools/decomp-assist/tiManager.attempts.md
Normal file
55
tools/decomp-assist/tiManager.attempts.md
Normal file
@@ -0,0 +1,55 @@
|
||||
# tiManager matching attempts
|
||||
|
||||
Baseline: source absent; 0/62 functions, 0/8368 code bytes. The implementation uses only C++, existing keyboard interfaces, and constructors for the seven concrete Sample layouts. Shared declarations are enabled only by TIMANAGER_IMPLEMENTATION.
|
||||
|
||||
## Pool and data
|
||||
|
||||
1. Initial Sample constructors contained their layout literals. Deferred inline expansion placed these after the vtables and emitted them in constructor order. Pool diverged at string 1. Passing ordinary layout-name literals from the factories restored all eight strings and their offsets.
|
||||
2. Sample declarations initially followed input includes and the factory order. The vtable contents mostly matched but table addresses differed. Declaring the Samples in reverse emission order, with the manager header last, restored the target's table order.
|
||||
3. The out-of-line HWKeyboard destructor emitted a strong HWKeyboard vtable absent from the target. Declaring its C++ destructor inline made that table weak and restored every strong table's offset. The destructor still matches all 16 instructions.
|
||||
4. Enabled the actual inherited CommandReceiver::Scroll and inherited CommandSender::updateFromReceiver declarations for this unit. This corrected the inputform and signwindow vtable relocation names without affecting other units.
|
||||
|
||||
A word-by-word comparison of .data now finds exactly two relocation-name differences, at 0x520 and 0xa44. The original names are `isEnableCursorCache__Q39textinput10textdrawer4BaseCFvgetStartPos__Q39textinput10textdrawer4BaseCFv` and `@236@onEvent__Q49textinput8keyboard6pctype12LayoutByNW4RFPQ49textinput8keyboard6pctype5`. The compiler produces the ordinary complete C++ names. All other .data bytes and relocations agree within the target's 2696-byte extent. The compiler additionally emits 48 bytes of weak vtables for pctype::UIObj::Listener, nw4rmanager::AnmObserver, and gui::EventHandler; these are absent from the extracted target object. No symbol aliases, forced labels, or edits to target symbol names were attempted. Objdiff nevertheless reports .data below 100%; automatic string symbols, the weak tables, and those malformed target names remain unresolved.
|
||||
|
||||
## Functions
|
||||
|
||||
- Constructor, create, initAspect, draw, prediction wrappers, string/length wrappers, factories, filters, isVacancy, and Sample destructors matched from the first implementation or after correcting header types and string placement.
|
||||
- Destructor: initial implementation cleared seven members after freeing them (131 instructions versus 123). Removing those unsupported stores gave 123/123, zero diffs.
|
||||
- init: 209/209 with three diffs. Comparing the aspect flag to true corrected branch direction; calling setSecretInputMode(false), as the target slot 0x4c specifies, corrected the last virtual call. Zero diffs.
|
||||
- calc, setAnimationOn, scale functions, SetFont: pointer-to-secondary-base conversions added null checks. Casting dereferenced objects to Layout references removed those checks. All matched.
|
||||
- createPCTypeKeyboard: 82/82, nine ordering diffs. Initializing KeyState before allocator, qwerty flag, and manager in the Base constructor gave zero diffs.
|
||||
- updateInput(HKBManager&): initial 137/130 instructions. Returning immediately from modal dialog/window branches, selecting the keyboard using the saved qwerty state, and grouping the four boolean results as (keyboard | candidates) | (form | toolbar) produced 130/130, zero diffs.
|
||||
- updateInput(Wii): initial 206/206 with 25 diffs after the preceding changes. Moving updateInputCommon before the sign-window activity check reproduced the target's call order, 206/206, zero diffs.
|
||||
- setAspectRatio: initial 11/12 instructions; converting the bool to u8 before comparing with true restored the target's byte extension, 12/12, zero diffs.
|
||||
- setTitleText: a separate pane temporary followed by DynamicCast gave 49/49 with seven register differences. Nesting the getPane call directly in DynamicCast gave 49/49, zero diffs.
|
||||
|
||||
## Remaining generated initializer
|
||||
|
||||
`__sinit_\tiKeyboard_cpp` is not emitted under that name because the required source file is tiManager.cpp.
|
||||
|
||||
1. A namespace-scope static default observer with its implicit constructor emits `__sinit_\tiManager_cpp`, four instructions: lis, addi, stw, blr, matching the target initializer's instruction sequence.
|
||||
2. An anonymous-namespace default observer changes its object linkage name but still emits the same four instructions under the tiManager initializer name. Reverted for simpler source.
|
||||
3. An explicitly empty EventObserver constructor also emits the same four instructions and unchanged initializer name. Reverted because the implicit constructor suffices.
|
||||
|
||||
The name mismatch remains. No generated-function rename, assembler alias, or filename override was introduced.
|
||||
|
||||
## Changed files
|
||||
|
||||
- src/keyboard/tiManager.cpp
|
||||
- include/keyboard/tiCandidateBox.h
|
||||
- include/keyboard/tiCellPhone.h
|
||||
- include/keyboard/tiHKBManager.h
|
||||
- include/keyboard/tiHwKeyboard.h
|
||||
- include/keyboard/tiInputForm.h
|
||||
- include/keyboard/tiKeyboard.h
|
||||
- include/keyboard/tiManager.h
|
||||
- include/keyboard/tiNw4rManager.h
|
||||
- include/keyboard/tiPcKeyboard.h
|
||||
- include/keyboard/tiPcKeyboardImpl.h
|
||||
- include/keyboard/tiPredictLang.h
|
||||
- include/keyboard/tiString.h
|
||||
- include/keyboard/tiTextDrawer.h
|
||||
- include/keyboard/tiTextInputBase.h
|
||||
- include/keyboard/tiToolBar.h
|
||||
- include/keyboard/tiZiString.h
|
||||
- tools/decomp-assist/tiManager.attempts.md
|
||||
Reference in New Issue
Block a user