mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Bug 1254755 part.3 Rename WidgetKeyboardEvent::alternativeCharCodes to WidgetKeyboardEvent::mAlternativeCharCodes r=smaug
MozReview-Commit-ID: 26K8ZxzavfB --HG-- extra : rebase_source : 5f74e58a784bae2ed626c0c9f7c992228dcff1be
This commit is contained in:
parent
8a70a17c6a
commit
7bfa8a21fa
@ -498,7 +498,7 @@ TextEventDispatcher::DispatchKeyboardEventInternal(
|
||||
// eKeyDown also needs alternative char codes because nsXBLWindowKeyHandler
|
||||
// needs to check if a following keypress event is reserved by chrome for
|
||||
// stopping propagation of its preceding keydown event.
|
||||
keyEvent.alternativeCharCodes.Clear();
|
||||
keyEvent.mAlternativeCharCodes.Clear();
|
||||
if ((WidgetKeyboardEvent::IsKeyDownOrKeyDownOnPlugin(aMessage) ||
|
||||
aMessage == eKeyPress) &&
|
||||
(keyEvent.IsControl() || keyEvent.IsAlt() ||
|
||||
|
@ -209,7 +209,7 @@ public:
|
||||
uint32_t location;
|
||||
// OS translated Unicode chars which are used for accesskey and accelkey
|
||||
// handling. The handlers will try from first character to last character.
|
||||
nsTArray<AlternativeCharCode> alternativeCharCodes;
|
||||
nsTArray<AlternativeCharCode> mAlternativeCharCodes;
|
||||
// Indicates whether the event signifies a printable character
|
||||
bool isChar;
|
||||
// Indicates whether the event is generated by auto repeat or not.
|
||||
@ -376,7 +376,7 @@ public:
|
||||
mCharCode = aEvent.mCharCode;
|
||||
mPseudoCharCode = aEvent.mPseudoCharCode;
|
||||
location = aEvent.location;
|
||||
alternativeCharCodes = aEvent.alternativeCharCodes;
|
||||
mAlternativeCharCodes = aEvent.mAlternativeCharCodes;
|
||||
isChar = aEvent.isChar;
|
||||
mIsRepeat = aEvent.mIsRepeat;
|
||||
mIsComposing = aEvent.mIsComposing;
|
||||
|
@ -503,10 +503,10 @@ WidgetKeyboardEvent::GetShortcutKeyCandidates(
|
||||
aCandidates.AppendElement(key);
|
||||
}
|
||||
|
||||
uint32_t len = alternativeCharCodes.Length();
|
||||
uint32_t len = mAlternativeCharCodes.Length();
|
||||
if (!IsShift()) {
|
||||
for (uint32_t i = 0; i < len; ++i) {
|
||||
uint32_t ch = alternativeCharCodes[i].mUnshiftedCharCode;
|
||||
uint32_t ch = mAlternativeCharCodes[i].mUnshiftedCharCode;
|
||||
if (!ch || ch == pseudoCharCode) {
|
||||
continue;
|
||||
}
|
||||
@ -519,7 +519,7 @@ WidgetKeyboardEvent::GetShortcutKeyCandidates(
|
||||
// However, the priority should be lowest.
|
||||
if (!HasASCIIDigit(aCandidates)) {
|
||||
for (uint32_t i = 0; i < len; ++i) {
|
||||
uint32_t ch = alternativeCharCodes[i].mShiftedCharCode;
|
||||
uint32_t ch = mAlternativeCharCodes[i].mShiftedCharCode;
|
||||
if (ch >= '0' && ch <= '9') {
|
||||
ShortcutKeyCandidate key(ch, false);
|
||||
aCandidates.AppendElement(key);
|
||||
@ -529,7 +529,7 @@ WidgetKeyboardEvent::GetShortcutKeyCandidates(
|
||||
}
|
||||
} else {
|
||||
for (uint32_t i = 0; i < len; ++i) {
|
||||
uint32_t ch = alternativeCharCodes[i].mShiftedCharCode;
|
||||
uint32_t ch = mAlternativeCharCodes[i].mShiftedCharCode;
|
||||
if (!ch) {
|
||||
continue;
|
||||
}
|
||||
@ -544,7 +544,7 @@ WidgetKeyboardEvent::GetShortcutKeyCandidates(
|
||||
|
||||
// And checking the charCode is same as unshiftedCharCode too.
|
||||
// E.g., for Ctrl+Shift+(Plus of Numpad) should not run Ctrl+Plus.
|
||||
uint32_t unshiftCh = alternativeCharCodes[i].mUnshiftedCharCode;
|
||||
uint32_t unshiftCh = mAlternativeCharCodes[i].mUnshiftedCharCode;
|
||||
if (CharsCaseInsensitiveEqual(ch, unshiftCh)) {
|
||||
continue;
|
||||
}
|
||||
@ -591,10 +591,10 @@ WidgetKeyboardEvent::GetAccessKeyCandidates(nsTArray<uint32_t>& aCandidates)
|
||||
}
|
||||
aCandidates.AppendElement(ch);
|
||||
}
|
||||
for (uint32_t i = 0; i < alternativeCharCodes.Length(); ++i) {
|
||||
for (uint32_t i = 0; i < mAlternativeCharCodes.Length(); ++i) {
|
||||
uint32_t ch[2] =
|
||||
{ alternativeCharCodes[i].mUnshiftedCharCode,
|
||||
alternativeCharCodes[i].mShiftedCharCode };
|
||||
{ mAlternativeCharCodes[i].mUnshiftedCharCode,
|
||||
mAlternativeCharCodes[i].mShiftedCharCode };
|
||||
for (uint32_t j = 0; j < 2; ++j) {
|
||||
if (!ch[j]) {
|
||||
continue;
|
||||
|
@ -227,7 +227,7 @@ public:
|
||||
const nsAString *aInsertString = nullptr);
|
||||
|
||||
/**
|
||||
* WillDispatchKeyboardEvent() computes aKeyEvent.alternativeCharCodes and
|
||||
* WillDispatchKeyboardEvent() computes aKeyEvent.mAlternativeCharCodes and
|
||||
* recompute aKeyEvent.mCharCode if it's necessary.
|
||||
*
|
||||
* @param aNativeKeyEvent A native key event for which you want to
|
||||
|
@ -1157,7 +1157,7 @@ TISInputSourceWrapper::WillDispatchKeyboardEvent(
|
||||
if ((unshiftedChar || shiftedChar) &&
|
||||
(!aKeyEvent.IsMeta() || !isDvorakQWERTY)) {
|
||||
AlternativeCharCode altCharCodes(unshiftedChar, shiftedChar);
|
||||
aKeyEvent.alternativeCharCodes.AppendElement(altCharCodes);
|
||||
aKeyEvent.mAlternativeCharCodes.AppendElement(altCharCodes);
|
||||
}
|
||||
MOZ_LOG(gLog, LogLevel::Info,
|
||||
("%p TISInputSourceWrapper::WillDispatchKeyboardEvent, "
|
||||
@ -1219,7 +1219,7 @@ TISInputSourceWrapper::WillDispatchKeyboardEvent(
|
||||
if ((cmdedChar || cmdedShiftChar) && isCmdSwitchLayout &&
|
||||
(aKeyEvent.IsMeta() || !isDvorakQWERTY)) {
|
||||
AlternativeCharCode altCharCodes(cmdedChar, cmdedShiftChar);
|
||||
aKeyEvent.alternativeCharCodes.AppendElement(altCharCodes);
|
||||
aKeyEvent.mAlternativeCharCodes.AppendElement(altCharCodes);
|
||||
}
|
||||
MOZ_LOG(gLog, LogLevel::Info,
|
||||
("%p TISInputSourceWrapper::WillDispatchKeyboardEvent, "
|
||||
@ -1231,7 +1231,7 @@ TISInputSourceWrapper::WillDispatchKeyboardEvent(
|
||||
// hasCmdShiftOnlyChar definition for the detail.
|
||||
if (hasCmdShiftOnlyChar && originalCmdedShiftChar) {
|
||||
AlternativeCharCode altCharCodes(0, originalCmdedShiftChar);
|
||||
aKeyEvent.alternativeCharCodes.AppendElement(altCharCodes);
|
||||
aKeyEvent.mAlternativeCharCodes.AppendElement(altCharCodes);
|
||||
}
|
||||
MOZ_LOG(gLog, LogLevel::Info,
|
||||
("%p TISInputSourceWrapper::WillDispatchKeyboardEvent, "
|
||||
|
@ -314,10 +314,10 @@ NativeKeyBindings::Execute(const WidgetKeyboardEvent& aEvent,
|
||||
return true;
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < aEvent.alternativeCharCodes.Length(); ++i) {
|
||||
for (uint32_t i = 0; i < aEvent.mAlternativeCharCodes.Length(); ++i) {
|
||||
uint32_t ch = aEvent.IsShift() ?
|
||||
aEvent.alternativeCharCodes[i].mShiftedCharCode :
|
||||
aEvent.alternativeCharCodes[i].mUnshiftedCharCode;
|
||||
aEvent.mAlternativeCharCodes[i].mShiftedCharCode :
|
||||
aEvent.mAlternativeCharCodes[i].mUnshiftedCharCode;
|
||||
if (ch && ch != aEvent.mCharCode) {
|
||||
keyval = gdk_unicode_to_keyval(ch);
|
||||
if (ExecuteInternal(aEvent, aCallback, aCallbackData, keyval)) {
|
||||
|
@ -1376,7 +1376,7 @@ KeymapWrapper::WillDispatchKeyboardEventInternal(WidgetKeyboardEvent& aKeyEvent,
|
||||
aGdkKeyEvent->group);
|
||||
isLatin = isLatin && (altCharCodes.mShiftedCharCode <= 0xFF);
|
||||
if (altCharCodes.mUnshiftedCharCode || altCharCodes.mShiftedCharCode) {
|
||||
aKeyEvent.alternativeCharCodes.AppendElement(altCharCodes);
|
||||
aKeyEvent.mAlternativeCharCodes.AppendElement(altCharCodes);
|
||||
}
|
||||
|
||||
bool needLatinKeyCodes = !isLatin;
|
||||
@ -1429,7 +1429,7 @@ KeymapWrapper::WillDispatchKeyboardEventInternal(WidgetKeyboardEvent& aKeyEvent,
|
||||
IsBasicLatinLetterOrNumeral(ch) ? ch : 0;
|
||||
if (altLatinCharCodes.mUnshiftedCharCode ||
|
||||
altLatinCharCodes.mShiftedCharCode) {
|
||||
aKeyEvent.alternativeCharCodes.AppendElement(altLatinCharCodes);
|
||||
aKeyEvent.mAlternativeCharCodes.AppendElement(altLatinCharCodes);
|
||||
}
|
||||
// If the mCharCode is not Latin, and the level is 0 or 1, we should
|
||||
// replace the mCharCode to Latin char if Alt and Meta keys are not
|
||||
|
@ -397,7 +397,7 @@ struct ParamTraits<mozilla::WidgetKeyboardEvent>
|
||||
WriteParam(aMsg, aParam.mKeyCode);
|
||||
WriteParam(aMsg, aParam.mCharCode);
|
||||
WriteParam(aMsg, aParam.mPseudoCharCode);
|
||||
WriteParam(aMsg, aParam.alternativeCharCodes);
|
||||
WriteParam(aMsg, aParam.mAlternativeCharCodes);
|
||||
WriteParam(aMsg, aParam.isChar);
|
||||
WriteParam(aMsg, aParam.mIsRepeat);
|
||||
WriteParam(aMsg, aParam.mIsReserved);
|
||||
@ -433,7 +433,7 @@ struct ParamTraits<mozilla::WidgetKeyboardEvent>
|
||||
ReadParam(aMsg, aIter, &aResult->mKeyCode) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mCharCode) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mPseudoCharCode) &&
|
||||
ReadParam(aMsg, aIter, &aResult->alternativeCharCodes) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mAlternativeCharCodes) &&
|
||||
ReadParam(aMsg, aIter, &aResult->isChar) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mIsRepeat) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mIsReserved) &&
|
||||
|
@ -895,7 +895,7 @@ NativeKey::NativeKey(nsWindowBase* aWidget,
|
||||
if (IsKeyDownMessage()) {
|
||||
// Compute some strings which may be inputted by the key with various
|
||||
// modifier state if this key event won't cause text input actually.
|
||||
// They will be used for setting alternativeCharCodes in the callback
|
||||
// They will be used for setting mAlternativeCharCodes in the callback
|
||||
// method which will be called by TextEventDispatcher.
|
||||
if (NeedsToHandleWithoutFollowingCharMessages()) {
|
||||
ComputeInputtingStringWithKeyboardLayout();
|
||||
@ -2314,7 +2314,8 @@ NativeKey::WillDispatchKeyboardEvent(WidgetKeyboardEvent& aKeyboardEvent,
|
||||
return;
|
||||
}
|
||||
|
||||
nsTArray<AlternativeCharCode>& altArray = aKeyboardEvent.alternativeCharCodes;
|
||||
nsTArray<AlternativeCharCode>& altArray =
|
||||
aKeyboardEvent.mAlternativeCharCodes;
|
||||
|
||||
uint16_t shiftedChar = 0, unshiftedChar = 0;
|
||||
if (skipUniChars <= aIndex) {
|
||||
|
Loading…
Reference in New Issue
Block a user