keyboard: tiToolBar 100%
This commit is contained in:
5
.clangd
5
.clangd
@@ -1,2 +1,7 @@
|
||||
Diagnostics:
|
||||
UnusedIncludes: None
|
||||
|
||||
CompileFlags:
|
||||
Add: [
|
||||
"-Wno-c++11-extensions",
|
||||
]
|
||||
|
||||
@@ -998,7 +998,7 @@ src/keyboard/tiInputForm.cpp:
|
||||
src/keyboard/tiCandidateBox.cpp:
|
||||
.text start:0x81428150 end:0x8142DF10
|
||||
.ctors start:0x8160D1F8 end:0x8160D1FC
|
||||
.rodata start:0x816152E0 end:0x81615658
|
||||
.rodata start:0x816152E0 end:0x816156F8
|
||||
.data start:0x8165D2D0 end:0x8165E070
|
||||
.sdata2 start:0x81694D90 end:0x81694DE0
|
||||
.sdata start:0x816973C0 end:0x816973E0
|
||||
@@ -1006,7 +1006,7 @@ src/keyboard/tiCandidateBox.cpp:
|
||||
src/keyboard/tiToolBar.cpp:
|
||||
.text start:0x8142DF10 end:0x8142F468
|
||||
.ctors start:0x8160D1FC end:0x8160D200
|
||||
.rodata start:0x81615658 end:0x816158D8
|
||||
.rodata start:0x816156F8 end:0x816158D8
|
||||
.data start:0x8165E070 end:0x8165E420
|
||||
.sdata start:0x816973E0 end:0x816973F8
|
||||
|
||||
|
||||
@@ -13934,7 +13934,8 @@ csLanguageDependencyDataCHN__Q29textinput9inputform = .rodata:0x81615298; // typ
|
||||
pppURLCheck = .rodata:0x816152A8; // type:object size:0x28 scope:local
|
||||
lbl_816152D0 = .rodata:0x816152D0; // type:object size:0x10 scope:local data:4byte
|
||||
csAninationFile__Q29textinput12candidatebox = .rodata:0x816152E0; // type:object size:0x378 scope:local
|
||||
csAninationFile__Q29textinput7toolbar = .rodata:0x81615658; // type:object size:0x280 scope:local data:4byte
|
||||
lbl_81615658 = .rodata:0x81615658; // type:object size:0xA0 scope:local data:4byte
|
||||
csAninationFile__Q29textinput7toolbar = .rodata:0x816156F8; // type:object size:0x1E0 scope:local data:4byte
|
||||
csAninationFile__Q29textinput11predictlang = .rodata:0x816158D8; // type:object size:0x268 scope:local
|
||||
csAninationFileForSign__Q39textinput8keyboard10signwindow = .rodata:0x81615B40; // type:object size:0x268 scope:local
|
||||
csPaneNameToControlKey__Q39textinput8keyboard10signwindow = .rodata:0x81615DA8; // type:object size:0x48 scope:local
|
||||
@@ -16856,7 +16857,7 @@ lbl_8165E070 = .data:0x8165E070; // type:object size:0xC data:string
|
||||
lbl_8165E080 = .data:0x8165E080; // type:object size:0x10 data:string
|
||||
lbl_8165E090 = .data:0x8165E090; // type:object size:0xD data:string
|
||||
lbl_8165E0A0 = .data:0x8165E0A0; // type:object size:0xC data:string
|
||||
lbl_8165E0B0 = .data:0x8165E0B0; // type:object size:0x100
|
||||
csPaneToAnimation__Q29textinput7toolbar = .data:0x8165E0B0; // type:object size:0x100
|
||||
lbl_8165E1B0 = .data:0x8165E1B0; // type:object size:0xD data:string
|
||||
lbl_8165E1C0 = .data:0x8165E1C0; // type:object size:0xC data:string
|
||||
lbl_8165E1CC = .data:0x8165E1CC; // type:object size:0xD data:string
|
||||
@@ -16864,13 +16865,14 @@ lbl_8165E1DC = .data:0x8165E1DC; // type:object size:0xC data:string
|
||||
lbl_8165E1E8 = .data:0x8165E1E8; // type:object size:0xC data:string
|
||||
lbl_8165E1F8 = .data:0x8165E1F8; // type:object size:0x10 data:string
|
||||
jumptable_8165E208 = .data:0x8165E208; // type:object size:0x30 scope:local
|
||||
lbl_8165E238 = .data:0x8165E238; // type:object size:0xC data:string
|
||||
jumptable_8165E244 = .data:0x8165E244; // type:object size:0x1C scope:local
|
||||
__vt__Q39textinput7toolbar19ToggleButtonAnmPane = .data:0x8165E260; // type:object size:0x2C
|
||||
__vt__Q39textinput7toolbar19NormalButtonAnmPane = .data:0x8165E28C; // type:object size:0x2C
|
||||
__vt__Q39textinput7toolbar7AnmPane = .data:0x8165E2B8; // type:object size:0x30
|
||||
__vt__Q39textinput7toolbar7AnmPane = .data:0x8165E2B8; // type:object size:0x2C
|
||||
__vt__Q39textinput7toolbar12EventHandler = .data:0x8165E2E8; // type:object size:0x20
|
||||
__vt__Q39textinput7toolbar12LayoutByNW4R = .data:0x8165E308; // type:object size:0xD0
|
||||
__vt__Q39textinput7toolbar4Base = .data:0x8165E3D8; // type:object size:0x44
|
||||
__vt__Q39textinput7toolbar4Base = .data:0x8165E3D8; // type:object size:0x20
|
||||
lbl_8165E420 = .data:0x8165E420; // type:object size:0xD data:string
|
||||
lbl_8165E430 = .data:0x8165E430; // type:object size:0x280
|
||||
lbl_8165E6B0 = .data:0x8165E6B0; // type:object size:0xE data:string
|
||||
@@ -22819,8 +22821,8 @@ sSysPauseFlag__19AxAdpcmSimplePlayer = .sbss:0x81698CE5; // type:object size:0x1
|
||||
sPlayingFlag__19AxAdpcmSimplePlayer = .sbss:0x81698CE6; // type:object size:0x2 data:byte
|
||||
sCallback__19AxAdpcmSimplePlayer = .sbss:0x81698CE8; // type:object size:0x4 data:4byte
|
||||
pBSWaveBuffer = .sbss:0x81698CF0; // type:object size:0x4 data:4byte
|
||||
lbl_81698CF8 = .sbss:0x81698CF8; // type:object size:0x1 data:byte
|
||||
lbl_81698CFC = .sbss:0x81698CFC; // type:object size:0x1 data:byte
|
||||
@GUARD@getInstance__Q39textinput12LayoutGather9SingletonFv@sGather = .sbss:0x81698CF8; // type:object size:0x1 data:byte
|
||||
@LOCAL@getInstance__Q39textinput12LayoutGather9SingletonFv@sGather = .sbss:0x81698CFC; // type:object size:0x1 data:byte
|
||||
csUnInputedWCharColor__Q29textinput9inputform = .sbss:0x81698D00; // type:object size:0x1 data:byte
|
||||
csCharColor__Q29textinput9inputform = .sbss:0x81698D04; // type:object size:0x1 data:byte
|
||||
csZiStringColorLeft__Q29textinput9inputform = .sbss:0x81698D08; // type:object size:0x1 data:byte
|
||||
|
||||
@@ -20,6 +20,10 @@
|
||||
#define ADDRESS(addr)
|
||||
#endif
|
||||
|
||||
#ifdef __MWERKS__
|
||||
#define override
|
||||
#endif
|
||||
|
||||
/* Macros for Matching */
|
||||
|
||||
#ifndef NON_MATCHING
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef TEXTINPUT_CANDIDATE_BOX_H
|
||||
#define TEXTINPUT_CANDIDATE_BOX_H
|
||||
|
||||
#include "tiNw4rManager.h"
|
||||
#include "tiTextInputBase.h"
|
||||
#include "tiHKBManager.h"
|
||||
|
||||
@@ -18,7 +19,50 @@ namespace textinput {
|
||||
private:
|
||||
candidatebox::Base* mpCandidateBox; // 0x04
|
||||
};
|
||||
}
|
||||
|
||||
class Base : public CommandSender {
|
||||
public:
|
||||
virtual ~Base();
|
||||
virtual void create(MEMAllocator* allocator);
|
||||
virtual void init();
|
||||
virtual void setCommandReceiver(textinput::CommandReceiver*);
|
||||
virtual void updateFromReceiver(u32, void*);
|
||||
virtual void resetCandidate();
|
||||
virtual void addCandiate(const wchar_t *);
|
||||
virtual void updateCandidate();
|
||||
virtual void draw();
|
||||
virtual void turnOn();
|
||||
virtual void turnOff();
|
||||
virtual void makeEmpty();
|
||||
virtual bool isOn() const;
|
||||
virtual void onClose();
|
||||
virtual void setOnOff(bool);
|
||||
virtual void setInvalid(bool);
|
||||
virtual bool isInvalid() const;
|
||||
virtual void setLanguage(Language);
|
||||
};
|
||||
|
||||
// TODO
|
||||
class LayoutByNW4R : public Base, public nw4rmanager::Layout {
|
||||
public:
|
||||
virtual void create(MEMAllocator* allocator);
|
||||
virtual void init();
|
||||
virtual void updateCandidate();
|
||||
virtual void draw();
|
||||
virtual void turnOn();
|
||||
virtual void turnOff();
|
||||
virtual void makeEmpty();
|
||||
virtual void onClose();
|
||||
virtual void setOnOff(bool);
|
||||
virtual void setInvalid(bool);
|
||||
virtual void setLanguage(Language);
|
||||
|
||||
// TODO
|
||||
|
||||
void onPressedShift(bool shift);
|
||||
void onReleasedShift();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // TEXTINPUT_CANDIDATE_BOX_H
|
||||
|
||||
55
include/keyboard/tiCellPhone.h
Normal file
55
include/keyboard/tiCellPhone.h
Normal file
@@ -0,0 +1,55 @@
|
||||
#ifndef TEXTINPUT_CELL_PHONE_H
|
||||
#define TEXTINPUT_CELL_PHONE_H
|
||||
|
||||
#include "tiNw4rManager.h"
|
||||
|
||||
namespace textinput {
|
||||
namespace keyboard {
|
||||
namespace cellphonetype {
|
||||
class Base {
|
||||
public:
|
||||
// TODO
|
||||
virtual void vt_0x08();
|
||||
virtual void vt_0x0C();
|
||||
virtual void vt_0x10();
|
||||
virtual void vt_0x14();
|
||||
virtual void vt_0x18();
|
||||
virtual void vt_0x1C();
|
||||
virtual void vt_0x20();
|
||||
virtual void vt_0x24();
|
||||
virtual void vt_0x28();
|
||||
virtual void vt_0x2C();
|
||||
virtual void vt_0x30();
|
||||
virtual void vt_0x34();
|
||||
virtual void vt_0x38();
|
||||
virtual void vt_0x3C();
|
||||
virtual void vt_0x40();
|
||||
virtual void vt_0x44();
|
||||
|
||||
virtual bool isNumeric() const;
|
||||
|
||||
virtual void vt_0x4C();
|
||||
virtual void vt_0x50();
|
||||
virtual void vt_0x54();
|
||||
virtual void vt_0x58();
|
||||
virtual void vt_0x5C();
|
||||
virtual void vt_0x60();
|
||||
virtual void vt_0x64();
|
||||
virtual void vt_0x68();
|
||||
|
||||
virtual bool onClose();
|
||||
};
|
||||
|
||||
class LayoutByNW4R : public Base, public nw4rmanager::Layout {
|
||||
public:
|
||||
virtual bool onClose();
|
||||
|
||||
void onPressedShift(bool shift);
|
||||
void onReleasedShift();
|
||||
};
|
||||
|
||||
} // namespace cellphonetype
|
||||
} // namespace keyboard
|
||||
} // namespace textinput
|
||||
|
||||
#endif // TEXTINPUT_CELL_PHONE_H
|
||||
@@ -5,21 +5,34 @@
|
||||
|
||||
#include <revolution/mem/allocator.h>
|
||||
|
||||
#include "keyboard/tiCpData.h"
|
||||
|
||||
namespace textinput {
|
||||
namespace input {
|
||||
class HKBManager {
|
||||
public:
|
||||
static HKBManager& getInstance() { return sInstance; }
|
||||
public:
|
||||
static HKBManager& getInstance() { return sInstance; }
|
||||
|
||||
void Initialize();
|
||||
void Update();
|
||||
void Initialize();
|
||||
void Update();
|
||||
|
||||
u32 GetModifierState() const;
|
||||
void SetModifierState(u32, u32);
|
||||
|
||||
class KeySet {
|
||||
private:
|
||||
u8 unk_0x00[0xFC];
|
||||
keyboard::cellphonetype::PaneNameToCharCode* pPaneNameToCharCode; // 0x00
|
||||
wchar_t szKeySetName[17]; // 0x04
|
||||
u16 uNum; // 0x26
|
||||
u16 uType; // 0x28
|
||||
};
|
||||
|
||||
static HKBManager sInstance;
|
||||
private:
|
||||
u8 unk_0x00[0xFC];
|
||||
|
||||
static HKBManager sInstance;
|
||||
};
|
||||
}
|
||||
}
|
||||
} // namespace input
|
||||
} // namespace textinput
|
||||
|
||||
#endif // TEXTINPUT_HKB_MANAGER_H
|
||||
#endif // TEXTINPUT_HKB_MANAGER_H
|
||||
|
||||
@@ -10,6 +10,7 @@ namespace textinput {
|
||||
namespace hwkey {
|
||||
class HWKeyboard : CommandSender {
|
||||
public:
|
||||
HWKeyboard(Manager *);
|
||||
~HWKeyboard();
|
||||
|
||||
virtual void init();
|
||||
@@ -17,8 +18,18 @@ namespace textinput {
|
||||
virtual bool updateInput(input::HKBManager& hkbManager);
|
||||
|
||||
private:
|
||||
Manager* mpManager; // 0x00
|
||||
void updateShift(input::HKBManager& hkbManager);
|
||||
void controlKeyTriggeredHandler(input::HKBManager);
|
||||
|
||||
Manager *mgr() { return mpManager; }
|
||||
|
||||
Manager* mpManager; // 0x10
|
||||
u8 field_0x14; // 0x14
|
||||
u8 field_0x15; // 0x15
|
||||
u8 field_0x16; // 0x16
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,6 +92,8 @@ namespace textinput {
|
||||
void initZiString();
|
||||
void resetContextPredict_();
|
||||
|
||||
void notifyChangeMode();
|
||||
|
||||
virtual void enableSpaceByRight(bool rightWithSpace);
|
||||
virtual void onClose();
|
||||
virtual bool canConvert();
|
||||
|
||||
41
include/keyboard/tiLayoutGather.h
Normal file
41
include/keyboard/tiLayoutGather.h
Normal file
@@ -0,0 +1,41 @@
|
||||
#ifndef TEXTINPUT_LAYOUT_GATHER_H
|
||||
#define TEXTINPUT_LAYOUT_GATHER_H
|
||||
|
||||
#include <revolution/types.h>
|
||||
|
||||
#include <nw4r/lyt/animation.h>
|
||||
#include <nw4r/lyt/layout.h>
|
||||
|
||||
#include <nw4r/lyt/textbox.h>
|
||||
|
||||
namespace textinput {
|
||||
class LayoutGather {
|
||||
public:
|
||||
LayoutGather();
|
||||
~LayoutGather();
|
||||
|
||||
void changeCapsLock(const u8& arg);
|
||||
|
||||
bool isHoldingShift() const {
|
||||
return isHWPressedShift() || isPressedShiftB();
|
||||
}
|
||||
u8 isHWPressedShift() const { return mbPressedShift; }
|
||||
u8 isPressedShiftB() const { return mbPressedShiftB; }
|
||||
void setHWPressedShift(const u8& arg) { mbPressedShift = arg; }
|
||||
|
||||
class Singleton {
|
||||
public:
|
||||
static LayoutGather& getInstance() {
|
||||
static LayoutGather sGather;
|
||||
return sGather;
|
||||
}
|
||||
};
|
||||
|
||||
private:
|
||||
u8 mbCpasLock : 1; // 0x00
|
||||
u8 mbPressedShift : 1; // 0x00
|
||||
u8 mbPressedShiftB : 1; // 0x00
|
||||
};
|
||||
} // namespace textinput
|
||||
|
||||
#endif // TEXTINPUT_LAYOUT_GATHER_H
|
||||
@@ -6,6 +6,9 @@
|
||||
#include "tiSaveData.h"
|
||||
#include "tiHKBManager.h"
|
||||
#include "tiHWKeyboard.h"
|
||||
#include "tiToolBar.h"
|
||||
#include "tiPcKeyboard.h"
|
||||
#include "tiCellPhone.h"
|
||||
|
||||
#include <nw4r/lyt/pane.h>
|
||||
#include <nw4r/lyt/arcResourceAccessor.h>
|
||||
@@ -79,20 +82,20 @@ namespace textinput {
|
||||
virtual keyboard::hwkey::HWKeyboard* getHWKeyboard() { return mpHWKeyboard; }
|
||||
virtual const keyboard::hwkey::HWKeyboard* getHWKeyboard() const { return mpHWKeyboard; }
|
||||
|
||||
virtual void* getPCKeyboard() { return mpPCKeyboard; }
|
||||
virtual const void* getPCKeyboard() const { return mpPCKeyboard; }
|
||||
virtual keyboard::pctype::LayoutByNW4R* getPCKeyboard() { return mpPCKeyboard; }
|
||||
virtual const keyboard::pctype::LayoutByNW4R* getPCKeyboard() const { return mpPCKeyboard; }
|
||||
|
||||
virtual void* getCellPhoneKeyboard() { return mpCellPhoneKeyboard; }
|
||||
virtual const void* getCellPhoneKeyboard() const { return mpCellPhoneKeyboard; }
|
||||
virtual keyboard::cellphonetype::LayoutByNW4R* getCellPhoneKeyboard() { return mpCellPhoneKeyboard; }
|
||||
virtual const keyboard::cellphonetype::LayoutByNW4R* getCellPhoneKeyboard() const { return mpCellPhoneKeyboard; }
|
||||
|
||||
virtual void* getSignKeyboard() { return mpSignWindow; }
|
||||
virtual const void* getSignKeyboard() const { return mpSignWindow; }
|
||||
|
||||
virtual void* getCandidateBox() { return mpCandidateBox; }
|
||||
virtual const void* getCandidateBox() const { return mpCandidateBox; }
|
||||
virtual candidatebox::LayoutByNW4R* getCandidateBox() { return mpCandidateBox; }
|
||||
virtual const candidatebox::LayoutByNW4R* getCandidateBox() const { return mpCandidateBox; }
|
||||
|
||||
virtual void* getToolBar() { return mpToolBar; }
|
||||
virtual const void* getToolBar() const { return mpToolBar; }
|
||||
virtual toolbar::LayoutByNW4R* getToolBar() { return mpToolBar; }
|
||||
virtual const toolbar::LayoutByNW4R* getToolBar() const { return mpToolBar; }
|
||||
|
||||
virtual void* getPredictLanguageSelectDialog() { return mpPredictLanguageDialog; }
|
||||
virtual const void* getPredictLanguageSelectDialog() const { return mpPredictLanguageDialog; }
|
||||
@@ -119,11 +122,11 @@ namespace textinput {
|
||||
inputform::EditBuffer* mpEditBuffer; // 0x0C
|
||||
|
||||
keyboard::hwkey::HWKeyboard* mpHWKeyboard; // 0x10
|
||||
void* mpPCKeyboard; // 0x14
|
||||
void* mpCellPhoneKeyboard; // 0x18
|
||||
keyboard::pctype::LayoutByNW4R* mpPCKeyboard; // 0x14
|
||||
keyboard::cellphonetype::LayoutByNW4R* mpCellPhoneKeyboard; // 0x18
|
||||
InputForm* mpInputForm; // 0x1C
|
||||
void* mpCandidateBox; // 0x20
|
||||
void* mpToolBar; // 0x24
|
||||
candidatebox::LayoutByNW4R* mpCandidateBox; // 0x20
|
||||
toolbar::LayoutByNW4R* mpToolBar; // 0x24
|
||||
void* mpPredictLanguageDialog; // 0x28
|
||||
void* mpSignWindow; // 0x2C
|
||||
|
||||
|
||||
@@ -15,7 +15,9 @@ namespace textinput {
|
||||
public:
|
||||
typedef struct Input {
|
||||
// todo
|
||||
u8 dummy[32];
|
||||
u8 dummy[12];
|
||||
u32 field_0x0C; // 0x0C
|
||||
u8 dummy2[16];
|
||||
} Input;
|
||||
|
||||
virtual void onEvent(gui::GUIComponent& comp, u32 event, void* data); // 0x0C
|
||||
@@ -24,8 +26,8 @@ namespace textinput {
|
||||
|
||||
virtual void setEventObserver(EventObserver *event) { mpEventObserver = event; } // 0x1C
|
||||
|
||||
private:
|
||||
EventObserver* mpEventObserver; // 0x04
|
||||
protected:
|
||||
EventObserver* mpEventObserver; // 0x08
|
||||
};
|
||||
|
||||
class Anim {
|
||||
@@ -87,6 +89,10 @@ namespace textinput {
|
||||
|
||||
virtual ~AnmPane(); // 0x20
|
||||
|
||||
AnmPane(nw4r::lyt::Pane *pane, AnmObserver *observer) : mpPane(pane), mpCurrentAnim(NULL), mpObserver(observer) {
|
||||
nw4r::ut::List_Init(&mAnms, offsetof(Anim, mLink));
|
||||
}
|
||||
|
||||
nw4r::lyt::Pane* getPane() { return mpPane; }
|
||||
|
||||
typedef struct AnmState {
|
||||
|
||||
71
include/keyboard/tiPcKeyboard.h
Normal file
71
include/keyboard/tiPcKeyboard.h
Normal file
@@ -0,0 +1,71 @@
|
||||
#ifndef TEXTINPUT_PC_KEYBOARD_H
|
||||
#define TEXTINPUT_PC_KEYBOARD_H
|
||||
|
||||
#include "tiNw4rManager.h"
|
||||
#include "tiTextInputBase.h"
|
||||
|
||||
namespace textinput {
|
||||
class Manager;
|
||||
|
||||
namespace keyboard {
|
||||
|
||||
namespace pctype {
|
||||
|
||||
// TODO
|
||||
class Base : public CommandSender {
|
||||
public:
|
||||
virtual ~Base();
|
||||
virtual void create(MEMAllocator* allocator);
|
||||
virtual void init();
|
||||
virtual void setCommandReceiver(textinput::CommandReceiver*);
|
||||
virtual void updateFromReceiver(u32, void*);
|
||||
virtual void onKey();
|
||||
virtual void getType();
|
||||
virtual void setLanguage();
|
||||
virtual void getLanguage();
|
||||
virtual void update();
|
||||
virtual void onActive();
|
||||
virtual void inputCharCode();
|
||||
virtual void getState();
|
||||
virtual void isShiftOn();
|
||||
virtual void isCapsOn();
|
||||
virtual void isABC();
|
||||
virtual void setABC();
|
||||
virtual void getABCInputMode();
|
||||
virtual void getAIUInputMode();
|
||||
virtual void getTranslateMode();
|
||||
virtual void setTranslateMode();
|
||||
virtual void onlyQwerty();
|
||||
virtual void setLangKeyActive();
|
||||
virtual void setInputModeJP();
|
||||
virtual void setInputModeCK();
|
||||
virtual void refreshState();
|
||||
virtual void changeABCInputMode();
|
||||
virtual void changeAIUInputMode();
|
||||
virtual void onClose();
|
||||
virtual void getWCCode();
|
||||
virtual void getControlKey();
|
||||
virtual void sendInputWChar();
|
||||
virtual void goSignInputMode();
|
||||
virtual void changePredictLanguage();
|
||||
virtual void updateFixMode();
|
||||
};
|
||||
|
||||
// TODO
|
||||
class LayoutByNW4R : public Base, public nw4rmanager::Layout {
|
||||
public:
|
||||
// TODO - ...
|
||||
|
||||
virtual void onClose();
|
||||
|
||||
void onPressedShift(bool shift);
|
||||
void onReleasedShift();
|
||||
};
|
||||
|
||||
} // namespace pctype
|
||||
|
||||
} // namespace keyboard
|
||||
|
||||
} // namespace textinput
|
||||
|
||||
#endif // TEXTINPUT_HW_KEYBOARD_H
|
||||
@@ -65,6 +65,8 @@ namespace textinput {
|
||||
|
||||
class CommandSender : public Base {
|
||||
public:
|
||||
CommandSender() : mpCommandReceiver(NULL) {}
|
||||
|
||||
virtual void setCommandReceiver(CommandReceiver* cmdRecv);
|
||||
virtual void sendCommand(u32, void*);
|
||||
virtual void updateFromReceiver(u32, void*);
|
||||
|
||||
138
include/keyboard/tiToolBar.h
Normal file
138
include/keyboard/tiToolBar.h
Normal file
@@ -0,0 +1,138 @@
|
||||
#ifndef TEXTINPUT_TOOLBAR_H
|
||||
#define TEXTINPUT_TOOLBAR_H
|
||||
|
||||
#include "tiNw4rManager.h"
|
||||
#include "tiTextInputBase.h"
|
||||
|
||||
namespace textinput {
|
||||
class Manager;
|
||||
|
||||
namespace toolbar {
|
||||
class Base {
|
||||
public:
|
||||
virtual void create(MEMAllocator* allocator) { mpAllocator = allocator; }
|
||||
virtual void init() {}
|
||||
virtual bool isQwerty() const { return mQwerty; }
|
||||
virtual void setQwerty(bool qwerty);
|
||||
virtual void setLanguage(Language language) { meLanguage = language; }
|
||||
virtual Language getLanguage() const { return meLanguage; }
|
||||
|
||||
protected:
|
||||
Manager* mgr() { return mpManager; }
|
||||
|
||||
bool mQwerty; // 0x04
|
||||
Language meLanguage; // 0x08
|
||||
MEMAllocator* mpAllocator; // 0x0C
|
||||
Manager* mpManager; // 0x10
|
||||
};
|
||||
|
||||
class AnmPane;
|
||||
class EventHandler;
|
||||
|
||||
class LayoutByNW4R : public Base, public nw4rmanager::Layout {
|
||||
public:
|
||||
virtual ~LayoutByNW4R();
|
||||
virtual void create(MEMAllocator* allocator) override;
|
||||
virtual void init() override;
|
||||
virtual void draw() override;
|
||||
|
||||
virtual void setQwerty(bool qwerty) override;
|
||||
virtual void setLanguage(Language language) override;
|
||||
|
||||
virtual void onOK();
|
||||
virtual void onCancel();
|
||||
virtual void setQwertyWithSE(bool qwerty);
|
||||
virtual bool isEnableKeytopChange() const;
|
||||
virtual void enableKeytopChange(bool enable);
|
||||
virtual nw4r::lyt::Pane* getUpArea();
|
||||
virtual nw4r::lyt::Pane* getDownArea();
|
||||
virtual void setOKButtonVisible(bool visible);
|
||||
virtual void setCancelButtonVisible(bool visible);
|
||||
virtual void setOKButtonCaption(const wchar_t* caption);
|
||||
virtual void setCancelButtonCaption(const wchar_t* caption);
|
||||
virtual void cancelStateFocusIn();
|
||||
|
||||
private:
|
||||
EventHandler* mpEventHandler; // 0xBC
|
||||
bool mbIsEnableQwertyChg; // 0xC0
|
||||
};
|
||||
|
||||
class EventHandler : public nw4rmanager::TiEventHandler {
|
||||
public:
|
||||
EventHandler(LayoutByNW4R* layout) : mpLayoutByNW4R(layout) {}
|
||||
virtual void onTiEvent(gui::PaneComponent* paneComponent, u32 event, Input* input) override;
|
||||
|
||||
private:
|
||||
LayoutByNW4R* mpLayoutByNW4R; // 0xC
|
||||
};
|
||||
|
||||
// TODO better location?
|
||||
enum Animation {
|
||||
ANM_Normal,
|
||||
ANM_FocusIn,
|
||||
ANM_FocusOut,
|
||||
ANM_RollOver,
|
||||
ANM_Pushed,
|
||||
ANM_ToggleOn,
|
||||
ANM_ToggleOff,
|
||||
ANM_TargetOn,
|
||||
ANM_ToggleOnFocusIn,
|
||||
ANM_ToggleOnFocusOut,
|
||||
ANM_NormalToggleOn,
|
||||
ANM_ToggleOnPushed,
|
||||
ANM_ActiveOn,
|
||||
ANM_ActiveOff,
|
||||
ANM_ActiveNormal,
|
||||
ANM_NotActiveNormal,
|
||||
ANM_PushedOnIdle,
|
||||
|
||||
ANM_Last,
|
||||
};
|
||||
|
||||
enum KeyType {
|
||||
KT_NormalButton,
|
||||
KT_ShiftCaps,
|
||||
KT_ToggleButton,
|
||||
KT_OnOffButton,
|
||||
KT_Last,
|
||||
};
|
||||
|
||||
class AnmPane : public nw4rmanager::AnmPane {
|
||||
public:
|
||||
AnmPane(nw4r::lyt::Pane* pane, nw4rmanager::AnmObserver* observer) : nw4rmanager::AnmPane(pane, observer), meState(ANM_Normal) {}
|
||||
|
||||
virtual void changeAnimation(u32 id) override {
|
||||
meState = static_cast<Animation>(id);
|
||||
nw4rmanager::AnmPane::changeAnimation(id);
|
||||
}
|
||||
virtual void init() override { meState = ANM_Normal; }
|
||||
virtual enum KeyType getKeyType() const { return meKeyType; }
|
||||
virtual enum Animation getState() { return meState; }
|
||||
|
||||
protected:
|
||||
Animation meState; // 0x2C
|
||||
KeyType meKeyType; // 0x30
|
||||
};
|
||||
|
||||
class Sample {};
|
||||
|
||||
class NormalButtonAnmPane : public AnmPane {
|
||||
public:
|
||||
NormalButtonAnmPane(nw4r::lyt::Pane* pane, nw4rmanager::AnmObserver* observer) : AnmPane(pane, observer) { meKeyType = KT_NormalButton; }
|
||||
virtual ~NormalButtonAnmPane() {}
|
||||
|
||||
virtual void onAnmEvent(AnmPaneEvent paneEvent) override; // 0x10
|
||||
};
|
||||
|
||||
class ToggleButtonAnmPane : public AnmPane {
|
||||
public:
|
||||
ToggleButtonAnmPane(nw4r::lyt::Pane* pane, nw4rmanager::AnmObserver* observer) : AnmPane(pane, observer) { meKeyType = KT_ShiftCaps; }
|
||||
virtual ~ToggleButtonAnmPane() {}
|
||||
|
||||
virtual void onAnmEvent(AnmPaneEvent paneEvent) override; // 0x10
|
||||
};
|
||||
|
||||
} // namespace toolbar
|
||||
} // namespace textinput
|
||||
|
||||
#endif
|
||||
61
src/keyboard/tiHwKeyboard.cpp
Normal file
61
src/keyboard/tiHwKeyboard.cpp
Normal file
@@ -0,0 +1,61 @@
|
||||
#include "keyboard/tiHwKeyboard.h"
|
||||
|
||||
#include "keyboard/tiManager.h"
|
||||
#include "keyboard/tiHKBManager.h"
|
||||
#include "keyboard/tiLayoutGather.h"
|
||||
|
||||
namespace textinput {
|
||||
|
||||
namespace keyboard {
|
||||
|
||||
namespace hwkey {
|
||||
HWKeyboard::HWKeyboard(Manager* manager) : mpManager(manager), field_0x14(0), field_0x15(0), field_0x16(0) {
|
||||
}
|
||||
|
||||
void HWKeyboard::init() {
|
||||
LayoutGather::Singleton::getInstance().setHWPressedShift(false);
|
||||
|
||||
u32 state = input::HKBManager::getInstance().GetModifierState();
|
||||
input::HKBManager::getInstance().SetModifierState(state | 0x100, 0x700);
|
||||
field_0x15 = 0;
|
||||
field_0x16 = 0;
|
||||
}
|
||||
|
||||
void HWKeyboard::updateShift(input::HKBManager& hkbManager) {
|
||||
LayoutGather &gather = LayoutGather::Singleton::getInstance();
|
||||
|
||||
u32 state = hkbManager.GetModifierState();
|
||||
|
||||
if (!mgr()->getToolBar()->isQwerty() && !mgr()->getToolBar()->isEnableKeytopChange()) {
|
||||
return;
|
||||
}
|
||||
|
||||
bool previousShift = gather.isHoldingShift();
|
||||
|
||||
if (state & 0x2) {
|
||||
gather.setHWPressedShift(true);
|
||||
if (!previousShift) {
|
||||
mgr()->getPCKeyboard()->onPressedShift(true);
|
||||
}
|
||||
} else {
|
||||
gather.setHWPressedShift(false);
|
||||
if (previousShift) {
|
||||
if (!gather.isHoldingShift()) {
|
||||
mgr()->getPCKeyboard()->onReleasedShift();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool HWKeyboard::updateInput(input::HKBManager &hkbManager) {
|
||||
cellphonetype::KeySet set;
|
||||
mgr()->getSignKeyboard();
|
||||
// TODO
|
||||
|
||||
return true;
|
||||
}
|
||||
} // namespace hwkey
|
||||
|
||||
} // namespace keyboard
|
||||
|
||||
} // namespace textinput
|
||||
25
src/keyboard/tiLayoutGather.cpp
Normal file
25
src/keyboard/tiLayoutGather.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
#include "keyboard/tiLayoutGather.h"
|
||||
|
||||
#include "keyboard/tiHKBManager.h"
|
||||
|
||||
namespace textinput {
|
||||
LayoutGather::LayoutGather() {
|
||||
mbCpasLock = 0;
|
||||
mbPressedShift = 0;
|
||||
mbPressedShiftB = 0;
|
||||
}
|
||||
|
||||
LayoutGather::~LayoutGather() {
|
||||
}
|
||||
|
||||
void LayoutGather::changeCapsLock(const u8& arg) {
|
||||
mbCpasLock = arg;
|
||||
if (mbCpasLock) {
|
||||
input::HKBManager::getInstance().SetModifierState(0x200, 0x200);
|
||||
} else {
|
||||
input::HKBManager::getInstance().SetModifierState(0x0, 0x200);
|
||||
}
|
||||
}
|
||||
|
||||
}; // namespace textinput
|
||||
422
src/keyboard/tiToolBar.cpp
Normal file
422
src/keyboard/tiToolBar.cpp
Normal file
@@ -0,0 +1,422 @@
|
||||
#include "keyboard/tiToolBar.h"
|
||||
|
||||
#include "keyboard/tiHKBManager.h"
|
||||
#include "keyboard/tiLanguageIndependentData.h"
|
||||
#include "keyboard/tiLayoutGather.h"
|
||||
#include "keyboard/tiManager.h"
|
||||
#include "keyboard/tiUtil.h"
|
||||
|
||||
#include <new>
|
||||
|
||||
namespace textinput {
|
||||
|
||||
namespace toolbar {
|
||||
|
||||
static const char* COMMON_BUTTON_ANIM = "P_BT_cancel";
|
||||
static const char* COMMON_CHG_ANIM = "P_kyChng_QWERTY";
|
||||
|
||||
// name made up, no dwarf (?)
|
||||
struct AnimationFile {
|
||||
u32 id;
|
||||
char fileName[0x40];
|
||||
};
|
||||
|
||||
// name made up, no dwarf (?)
|
||||
struct PaneToAnimation {
|
||||
s32 type;
|
||||
const char* paneName;
|
||||
u32 count;
|
||||
const char* forceAddName;
|
||||
const AnimationFile* pAnims[12];
|
||||
};
|
||||
|
||||
static const AnimationFile csAninationFile[] = {
|
||||
{0, "fs_VK_toolbar_a_normal.brlan"}, {1, "fs_VK_toolbar_a_Focus-IN.brlan"}, {2, "fs_VK_toolbar_a_Focus-OUT.brlan"},
|
||||
{3, "fs_VK_toolbar_a_Roll_over.brlan"}, {4, "fs_VK_toolbar_a_Pushed.brlan"}, {5, "fs_VK_toolbar_a_toggle-ON.brlan"},
|
||||
{6, "fs_VK_toolbar_a_toggle-OFF.brlan"},
|
||||
};
|
||||
|
||||
// @bug: Are the [7]s not out of bounds? The counts are 7 too so it's probably fine...
|
||||
static const PaneToAnimation csPaneToAnimation[] = {
|
||||
{0, "P_BT_cancel", 5, NULL, {&csAninationFile[0], &csAninationFile[1], &csAninationFile[2], &csAninationFile[3], &csAninationFile[4]}},
|
||||
{0,
|
||||
"P_BT_confirm",
|
||||
5,
|
||||
COMMON_BUTTON_ANIM,
|
||||
{&csAninationFile[0], &csAninationFile[1], &csAninationFile[2], &csAninationFile[3], &csAninationFile[4]}},
|
||||
{1,
|
||||
"P_kyChng_QWERTY",
|
||||
7,
|
||||
NULL,
|
||||
{&csAninationFile[0], &csAninationFile[1], &csAninationFile[2], &csAninationFile[3], &csAninationFile[4], &csAninationFile[5],
|
||||
&csAninationFile[6], &csAninationFile[7]}},
|
||||
{1,
|
||||
"P_kyChng_CP",
|
||||
7,
|
||||
COMMON_CHG_ANIM,
|
||||
{&csAninationFile[0], &csAninationFile[1], &csAninationFile[2], &csAninationFile[3], &csAninationFile[4], &csAninationFile[5],
|
||||
&csAninationFile[6], &csAninationFile[7]}},
|
||||
};
|
||||
|
||||
void Base::setQwerty(bool qwerty) {
|
||||
if (getLanguage() == KR && mgr()->getCellPhoneKeyboard() != NULL && !mgr()->getCellPhoneKeyboard()->isNumeric()) {
|
||||
qwerty = true;
|
||||
}
|
||||
mQwerty = qwerty;
|
||||
if (mgr()->getInputForm() != NULL) {
|
||||
mgr()->getInputForm()->notifyChangeMode();
|
||||
}
|
||||
}
|
||||
|
||||
LayoutByNW4R::~LayoutByNW4R() {
|
||||
mpEventHandler->~EventHandler();
|
||||
MEMFreeToAllocator(mpAllocator, mpEventHandler);
|
||||
AnmPane* it = static_cast<AnmPane*>(nw4r::ut::List_GetFirst(&mAnmPanes));
|
||||
while (it != NULL) {
|
||||
nw4r::ut::List_Remove(&mAnmPanes, it);
|
||||
it->destroy(mpAllocator);
|
||||
it = static_cast<AnmPane*>(nw4r::ut::List_GetFirst(&mAnmPanes));
|
||||
}
|
||||
}
|
||||
|
||||
void LayoutByNW4R::create(MEMAllocator* allocator) {
|
||||
Base::create(allocator);
|
||||
void* eventBuf = MEMAllocFromAllocator(allocator, sizeof(EventHandler));
|
||||
mpEventHandler = new (eventBuf) EventHandler(this);
|
||||
Layout::createWithEventHandler(allocator, mpEventHandler);
|
||||
mpPaneManager->setAllComponentTriggerTarget(false);
|
||||
mpPaneManager->setAllBoundingBoxComponentTriggerTarget(true);
|
||||
|
||||
for (u16 i = 0; i < ARRAY_LENGTH(csPaneToAnimation); i++) {
|
||||
const PaneToAnimation &p = csPaneToAnimation[i];
|
||||
AnmPane* pane = NULL;
|
||||
switch (p.type) {
|
||||
case 0: {
|
||||
void* pBtnBuf = MEMAllocFromAllocator(allocator, sizeof(NormalButtonAnmPane));
|
||||
pane = new (pBtnBuf) NormalButtonAnmPane(getPane(p.paneName), NULL);
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
void* pBtnBuf = MEMAllocFromAllocator(allocator, sizeof(ToggleButtonAnmPane));
|
||||
pane = new (pBtnBuf) ToggleButtonAnmPane(getPane(p.paneName), NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
nw4r::ut::List_Append(&mAnmPanes, pane);
|
||||
|
||||
for (u16 j = 0; j < p.count; j++) {
|
||||
void* pResource = mpMultiArcResourceAccessor->GetResource(0, p.pAnims[j]->fileName);
|
||||
AnimTransformPane* transform =
|
||||
static_cast<AnimTransformPane*>(getLayout()->CreateAnimTransform(pResource, mpMultiArcResourceAccessor));
|
||||
|
||||
if (p.forceAddName == NULL) {
|
||||
pane->addAnimation(allocator, p.pAnims[j]->id, transform, false, true);
|
||||
} else {
|
||||
pane->forceAddAnimation(allocator, p.pAnims[j]->id, transform, p.forceAddName, false, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
init();
|
||||
}
|
||||
|
||||
void LayoutByNW4R::setOKButtonVisible(bool visible) {
|
||||
setVisible("P_BT_confirm", visible);
|
||||
}
|
||||
|
||||
void LayoutByNW4R::setCancelButtonVisible(bool visible) {
|
||||
setVisible("P_BT_cancel", visible);
|
||||
}
|
||||
|
||||
void LayoutByNW4R::setOKButtonCaption(const wchar_t* caption) {
|
||||
setString("T_BT_confirm", caption);
|
||||
}
|
||||
|
||||
void LayoutByNW4R::setCancelButtonCaption(const wchar_t* caption) {
|
||||
setString("T_BT_cancel", caption);
|
||||
}
|
||||
|
||||
void LayoutByNW4R::init() {
|
||||
Base::init();
|
||||
Layout::init();
|
||||
searchAnmPane("P_kyChng_CP")->changeAnimation(0);
|
||||
searchAnmPane("P_kyChng_QWERTY")->changeAnimation(0);
|
||||
enableKeytopChange(true);
|
||||
setQwerty(isQwerty()); // okay
|
||||
searchAnmPane("P_BT_confirm")->changeAnimation(0);
|
||||
searchAnmPane("P_BT_cancel")->changeAnimation(0);
|
||||
setOKButtonCaption(langindependent::cLanguageIndependentString[langindependent::LANG_STRID_OK][getLanguage()]);
|
||||
setCancelButtonCaption(langindependent::cLanguageIndependentString[langindependent::LANG_STRID_CANCEL][getLanguage()]);
|
||||
setCancelButtonVisible(true);
|
||||
setOKButtonVisible(true);
|
||||
initPaneLastDrawReceived();
|
||||
mpLayout->Animate(0);
|
||||
mpLayout->CalculateMtx(mDrawInfo);
|
||||
}
|
||||
|
||||
void LayoutByNW4R::cancelStateFocusIn() {
|
||||
for (int i = 0; i < ARRAY_LENGTH(csPaneToAnimation); i++) {
|
||||
AnmPane* pane = static_cast<AnmPane*>(searchAnmPane(csPaneToAnimation[i].paneName));
|
||||
if (pane != NULL) {
|
||||
switch (pane->getState()) {
|
||||
case ANM_FocusIn:
|
||||
case ANM_RollOver: {
|
||||
pane->changeAnimation(ANM_FocusOut);
|
||||
break;
|
||||
}
|
||||
case ANM_Pushed: {
|
||||
switch (pane->getKeyType()) {
|
||||
case KT_NormalButton: {
|
||||
pane->changeAnimation(ANM_FocusOut);
|
||||
break;
|
||||
}
|
||||
case KT_ShiftCaps: {
|
||||
pane->changeAnimation(ANM_ToggleOn);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ANM_ToggleOnFocusIn:
|
||||
case ANM_ToggleOnPushed: {
|
||||
pane->changeAnimation(ANM_ToggleOnFocusOut);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LayoutByNW4R::onOK() {
|
||||
mpEventObserver->onOK();
|
||||
mpEventObserver->onSE(sound::SE_CHAR_DECIDE);
|
||||
cancelStateFocusIn();
|
||||
mpPaneManager->init();
|
||||
initPaneLastDrawReceived();
|
||||
mgr()->getPCKeyboard()->onClose();
|
||||
mgr()->getCellPhoneKeyboard()->onClose();
|
||||
mgr()->getCandidateBox()->onClose();
|
||||
}
|
||||
|
||||
void LayoutByNW4R::onCancel() {
|
||||
mpEventObserver->onCancel();
|
||||
mpEventObserver->onSE(sound::SE_CHAR_DECIDE);
|
||||
cancelStateFocusIn();
|
||||
mpPaneManager->init();
|
||||
initPaneLastDrawReceived();
|
||||
mgr()->getPCKeyboard()->onClose();
|
||||
mgr()->getCellPhoneKeyboard()->onClose();
|
||||
mgr()->getCandidateBox()->onClose();
|
||||
}
|
||||
|
||||
void LayoutByNW4R::setLanguage(Language language) {
|
||||
Base::setLanguage(language);
|
||||
init();
|
||||
}
|
||||
|
||||
void LayoutByNW4R::setQwertyWithSE(bool qwerty) {
|
||||
if (qwerty != isQwerty()) {
|
||||
if (qwerty) {
|
||||
mpEventObserver->onSE(sound::SWITCH_TO_KEYBOARD);
|
||||
} else {
|
||||
mpEventObserver->onSE(sound::SWITCH_TO_KETAI);
|
||||
}
|
||||
}
|
||||
setQwerty(qwerty);
|
||||
}
|
||||
|
||||
void LayoutByNW4R::setQwerty(bool qwerty) {
|
||||
if (qwerty) {
|
||||
Animation state = static_cast<AnmPane*>(searchAnmPane("P_kyChng_CP"))->getState();
|
||||
if (state != ANM_Normal && state != ANM_ToggleOff) {
|
||||
searchAnmPane("P_kyChng_CP")->changeAnimation(ANM_ToggleOff);
|
||||
}
|
||||
searchAnmPane("P_kyChng_QWERTY")->onAnmEvent(nw4rmanager::AnmPane::PE_0);
|
||||
} else {
|
||||
Animation state = static_cast<AnmPane*>(searchAnmPane("P_kyChng_QWERTY"))->getState();
|
||||
if (state != ANM_Normal && state != ANM_ToggleOff) {
|
||||
searchAnmPane("P_kyChng_QWERTY")->changeAnimation(ANM_ToggleOff);
|
||||
}
|
||||
searchAnmPane("P_kyChng_CP")->onAnmEvent(nw4rmanager::AnmPane::PE_0);
|
||||
}
|
||||
|
||||
if (getLanguage() == KR && mgr()->getCellPhoneKeyboard() != NULL && !mgr()->getCellPhoneKeyboard()->isNumeric()) {
|
||||
qwerty = true;
|
||||
}
|
||||
mQwerty = qwerty;
|
||||
if (mgr()->getInputForm() != NULL) {
|
||||
mgr()->getInputForm()->notifyChangeMode();
|
||||
}
|
||||
}
|
||||
|
||||
void LayoutByNW4R::enableKeytopChange(bool enable) {
|
||||
if (meLanguage == KR) {
|
||||
enable = false;
|
||||
}
|
||||
mbIsEnableQwertyChg = enable;
|
||||
setVisible("P_kyChng_QWERTY", enable);
|
||||
setVisible("P_kyChng_CP", enable);
|
||||
setVisible("P_keyChange", enable);
|
||||
}
|
||||
|
||||
nw4r::lyt::Pane* LayoutByNW4R::getUpArea() {
|
||||
return mpLayout->GetRootPane()->FindPaneByName("N_UP");
|
||||
}
|
||||
|
||||
nw4r::lyt::Pane* LayoutByNW4R::getDownArea() {
|
||||
return mpLayout->GetRootPane()->FindPaneByName("N_DOWN");
|
||||
}
|
||||
|
||||
void NormalButtonAnmPane::onAnmEvent(AnmPaneEvent paneEvent) {
|
||||
if (paneEvent == PE_0) {
|
||||
changeAnimation(ANM_Pushed);
|
||||
}
|
||||
switch (meState) {
|
||||
case ANM_Normal: {
|
||||
if (paneEvent == PE_1) {
|
||||
changeAnimation(ANM_FocusIn);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ANM_FocusIn: {
|
||||
if (paneEvent == PE_4) {
|
||||
changeAnimation(ANM_RollOver);
|
||||
}
|
||||
if (paneEvent == PE_2) {
|
||||
changeAnimation(ANM_FocusOut);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ANM_RollOver: {
|
||||
if (paneEvent == PE_2) {
|
||||
changeAnimation(ANM_FocusOut);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ANM_FocusOut: {
|
||||
if (paneEvent == PE_4) {
|
||||
changeAnimation(ANM_Normal);
|
||||
}
|
||||
if (paneEvent == PE_1) {
|
||||
changeAnimation(ANM_FocusIn);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ANM_Pushed: {
|
||||
if (paneEvent == PE_4) {
|
||||
changeAnimation(ANM_RollOver);
|
||||
}
|
||||
if (paneEvent == PE_2) {
|
||||
changeAnimation(ANM_FocusOut);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ToggleButtonAnmPane::onAnmEvent(AnmPaneEvent paneEvent) {
|
||||
if (paneEvent == PE_0 && (meState != ANM_ToggleOn && meState != ANM_Pushed)) {
|
||||
changeAnimation(ANM_Pushed);
|
||||
}
|
||||
switch (meState) {
|
||||
case ANM_Normal: {
|
||||
if (paneEvent == PE_1) {
|
||||
changeAnimation(ANM_FocusIn);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ANM_FocusIn: {
|
||||
if (paneEvent == PE_4) {
|
||||
changeAnimation(ANM_RollOver);
|
||||
}
|
||||
if (paneEvent == PE_2) {
|
||||
changeAnimation(ANM_FocusOut);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ANM_RollOver: {
|
||||
if (paneEvent == PE_2) {
|
||||
changeAnimation(ANM_FocusOut);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ANM_FocusOut: {
|
||||
if (paneEvent == PE_4) {
|
||||
changeAnimation(ANM_Normal);
|
||||
}
|
||||
if (paneEvent == PE_1) {
|
||||
changeAnimation(ANM_FocusIn);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ANM_Pushed: {
|
||||
if (paneEvent == PE_4) {
|
||||
changeAnimation(ANM_ToggleOn);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ANM_ToggleOff: {
|
||||
if (paneEvent == PE_4) {
|
||||
changeAnimation(ANM_Normal);
|
||||
}
|
||||
if (paneEvent == PE_1) {
|
||||
changeAnimation(ANM_FocusIn);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EventHandler::onTiEvent(gui::PaneComponent* paneComponent, u32 event, Input* input) {
|
||||
const char* name = paneComponent->getPane()->GetName();
|
||||
if (name[0] == 'B') {
|
||||
char tmp[17];
|
||||
util::replaceChar(tmp, sizeof(tmp), name, 0, 'P');
|
||||
AnmPane* pane = static_cast<AnmPane*>(mpLayoutByNW4R->searchAnmPane(tmp));
|
||||
if (pane != NULL) {
|
||||
switch (event) {
|
||||
case ON_TRIG: {
|
||||
if ((input->field_0x0C & 0x800)) {
|
||||
pane->onAnmEvent(nw4rmanager::AnmPane::PE_0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ON_LEFT: {
|
||||
pane->onAnmEvent(nw4rmanager::AnmPane::PE_2);
|
||||
break;
|
||||
}
|
||||
case ON_POINT: {
|
||||
mpEventObserver->onSE(sound::SE_SELECT);
|
||||
mpLayoutByNW4R->setPaneLastDrawReceived(pane->getPane());
|
||||
pane->onAnmEvent(nw4rmanager::AnmPane::PE_1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (event == ON_TRIG && (input->field_0x0C & 0x800)) {
|
||||
if (util::strcmp(tmp, "P_BT_confirm")) {
|
||||
mpLayoutByNW4R->onOK();
|
||||
} else if (util::strcmp(tmp, "P_BT_cancel")) {
|
||||
mpLayoutByNW4R->onCancel();
|
||||
} else if (util::strcmp(tmp, "P_kyChng_QWERTY")) {
|
||||
if (!mpLayoutByNW4R->isQwerty()) {
|
||||
mpLayoutByNW4R->searchAnmPane("P_kyChng_CP")->changeAnimation(6);
|
||||
}
|
||||
mpLayoutByNW4R->setQwertyWithSE(true);
|
||||
} else if (util::strcmp(tmp, "P_kyChng_CP")) {
|
||||
if (mpLayoutByNW4R->isQwerty()) {
|
||||
mpLayoutByNW4R->searchAnmPane("P_kyChng_QWERTY")->changeAnimation(6);
|
||||
}
|
||||
mpLayoutByNW4R->setQwertyWithSE(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LayoutByNW4R::draw() {
|
||||
Layout::draw();
|
||||
}
|
||||
|
||||
} // namespace toolbar
|
||||
|
||||
} // namespace textinput
|
||||
Reference in New Issue
Block a user