Bug 920377 part.16 Get rid of nsAlternativeCharCode r=roc
authorMasayuki Nakano <masayuki@d-toybox.com>
Tue, 01 Oct 2013 16:22:57 +0900
changeset 163240 4665d96e7f1a75a7830c8ccd2cc22a4dfa21b0e2
parent 163239 eedf61cab3fa8be11c865eddb39fb0d952234027
child 163241 d2f6e4dd2f91616436be308f81309a9f69eff073
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs920377
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 920377 part.16 Get rid of nsAlternativeCharCode r=roc
widget/EventForwards.h
widget/TextEvents.h
widget/cocoa/TextInputHandler.mm
widget/gtk/nsGtkKeyUtils.cpp
widget/qt/nsWindow.cpp
widget/windows/KeyboardLayout.cpp
--- a/widget/EventForwards.h
+++ b/widget/EventForwards.h
@@ -102,17 +102,16 @@ class WidgetPluginEvent;
 class InternalMutationEvent;
 } // namespace mozilla
 
 // TODO: Remove following typedefs
 typedef mozilla::WidgetEvent               nsEvent;
 typedef mozilla::WidgetGUIEvent            nsGUIEvent;
 typedef mozilla::WidgetInputEvent          nsInputEvent;
 typedef mozilla::InternalUIEvent           nsUIEvent;
-typedef mozilla::AlternativeCharCode       nsAlternativeCharCode;
 typedef mozilla::WidgetKeyboardEvent       nsKeyEvent;
 typedef mozilla::TextRangeStyle            nsTextRangeStyle;
 typedef mozilla::TextRange                 nsTextRange;
 typedef mozilla::TextRangeArray            nsTextRangeArray;
 typedef mozilla::WidgetTextEvent           nsTextEvent;
 typedef mozilla::WidgetCompositionEvent    nsCompositionEvent;
 typedef mozilla::WidgetQueryContentEvent   nsQueryContentEvent;
 typedef mozilla::WidgetSelectionEvent      nsSelectionEvent;
--- a/widget/TextEvents.h
+++ b/widget/TextEvents.h
@@ -529,17 +529,16 @@ public:
   bool mExpandToClusterBoundary;
   // true if setting selection succeeded.
   bool mSucceeded;
 };
 
 } // namespace mozilla
 
 // TODO: Remove following typedefs
-typedef mozilla::AlternativeCharCode     nsAlternativeCharCode;
 typedef mozilla::WidgetKeyboardEvent     nsKeyEvent;
 typedef mozilla::TextRangeStyle          nsTextRangeStyle;
 typedef mozilla::TextRange               nsTextRange;
 typedef mozilla::TextRangeArray          nsTextRangeArray;
 typedef mozilla::WidgetTextEvent         nsTextEvent;
 typedef mozilla::WidgetCompositionEvent  nsCompositionEvent;
 typedef mozilla::WidgetQueryContentEvent nsQueryContentEvent;
 typedef mozilla::WidgetSelectionEvent    nsSelectionEvent;
--- a/widget/cocoa/TextInputHandler.mm
+++ b/widget/cocoa/TextInputHandler.mm
@@ -1066,17 +1066,17 @@ TISInputSourceWrapper::InitKeyPressEvent
   bool isDvorakQWERTY = isCmdSwitchLayout && isRomanKeyboardLayout;
 
   // If the current keyboard is not Dvorak-QWERTY or Cmd is not pressed,
   // we should append unshiftedChar and shiftedChar for handling the
   // normal characters.  These are the characters that the user is most
   // likely to associate with this key.
   if ((unshiftedChar || shiftedChar) &&
       (!aKeyEvent.IsMeta() || !isDvorakQWERTY)) {
-    nsAlternativeCharCode altCharCodes(unshiftedChar, shiftedChar);
+    AlternativeCharCode altCharCodes(unshiftedChar, shiftedChar);
     aKeyEvent.alternativeCharCodes.AppendElement(altCharCodes);
   }
   PR_LOG(gLog, PR_LOG_ALWAYS,
     ("%p TISInputSourceWrapper::InitKeyPressEvent, "
      "aKeyEvent.isMeta=%s, isDvorakQWERTY=%s, "
      "unshiftedChar=U+%X, shiftedChar=U+%X",
      this, OnOrOff(aKeyEvent.IsMeta()), TrueOrFalse(isDvorakQWERTY),
      unshiftedChar, shiftedChar));
@@ -1128,29 +1128,29 @@ TISInputSourceWrapper::InitKeyPressEvent
   // If the current keyboard layout is switched by the Cmd key,
   // we should append cmdedChar and shiftedCmdChar that are
   // Latin char for the key.
   // If the keyboard layout is Dvorak-QWERTY, we should append them only when
   // command key is pressed because when command key isn't pressed, uncmded
   // chars have been appended already.
   if ((cmdedChar || cmdedShiftChar) && isCmdSwitchLayout &&
       (aKeyEvent.IsMeta() || !isDvorakQWERTY)) {
-    nsAlternativeCharCode altCharCodes(cmdedChar, cmdedShiftChar);
+    AlternativeCharCode altCharCodes(cmdedChar, cmdedShiftChar);
     aKeyEvent.alternativeCharCodes.AppendElement(altCharCodes);
   }
   PR_LOG(gLog, PR_LOG_ALWAYS,
     ("%p TISInputSourceWrapper::InitKeyPressEvent, "
      "hasCmdShiftOnlyChar=%s, isCmdSwitchLayout=%s, isDvorakQWERTY=%s, "
      "cmdedChar=U+%X, cmdedShiftChar=U+%X",
      this, TrueOrFalse(hasCmdShiftOnlyChar), TrueOrFalse(isDvorakQWERTY),
      TrueOrFalse(isDvorakQWERTY), cmdedChar, cmdedShiftChar));
   // Special case for 'SS' key of German layout. See the comment of
   // hasCmdShiftOnlyChar definition for the detail.
   if (hasCmdShiftOnlyChar && originalCmdedShiftChar) {
-    nsAlternativeCharCode altCharCodes(0, originalCmdedShiftChar);
+    AlternativeCharCode altCharCodes(0, originalCmdedShiftChar);
     aKeyEvent.alternativeCharCodes.AppendElement(altCharCodes);
   }
   PR_LOG(gLog, PR_LOG_ALWAYS,
     ("%p TISInputSourceWrapper::InitKeyPressEvent, "
      "hasCmdShiftOnlyChar=%s, originalCmdedShiftChar=U+%X",
      this, TrueOrFalse(hasCmdShiftOnlyChar), originalCmdedShiftChar));
 
   NS_OBJC_END_TRY_ABORT_BLOCK
--- a/widget/gtk/nsGtkKeyUtils.cpp
+++ b/widget/gtk/nsGtkKeyUtils.cpp
@@ -1206,17 +1206,17 @@ KeymapWrapper::InitKeypressEvent(nsKeyEv
     guint baseState = aGdkKeyEvent->state &
         ~(GetModifierMask(SHIFT) | GetModifierMask(CTRL) |
           GetModifierMask(ALT) | GetModifierMask(META) |
           GetModifierMask(SUPER) | GetModifierMask(HYPER));
 
     // We shold send both shifted char and unshifted char, all keyboard layout
     // users can use all keys.  Don't change event.charCode. On some keyboard
     // layouts, Ctrl/Alt/Meta keys are used for inputting some characters.
-    nsAlternativeCharCode altCharCodes(0, 0);
+    AlternativeCharCode altCharCodes(0, 0);
     // unshifted charcode of current keyboard layout.
     altCharCodes.mUnshiftedCharCode =
         GetCharCodeFor(aGdkKeyEvent, baseState, aGdkKeyEvent->group);
     bool isLatin = (altCharCodes.mUnshiftedCharCode <= 0xFF);
     // shifted charcode of current keyboard layout.
     altCharCodes.mShiftedCharCode =
         GetCharCodeFor(aGdkKeyEvent,
                        baseState | GetModifierMask(SHIFT),
@@ -1254,17 +1254,17 @@ KeymapWrapper::InitKeypressEvent(nsKeyEv
              "keyCode=0x%02X, charCode=0x%08X, level=%d, "
              "altCharCodes={ mUnshiftedCharCode=0x%08X, "
              "mShiftedCharCode=0x%08X }",
              this, aKeyEvent.keyCode, aKeyEvent.charCode, level,
              altCharCodes.mUnshiftedCharCode, altCharCodes.mShiftedCharCode));
         return;
     }
 
-    nsAlternativeCharCode altLatinCharCodes(0, 0);
+    AlternativeCharCode altLatinCharCodes(0, 0);
     uint32_t unmodifiedCh =
         aKeyEvent.IsShift() ? altCharCodes.mShiftedCharCode :
                               altCharCodes.mUnshiftedCharCode;
 
     // unshifted charcode of found keyboard layout.
     uint32_t ch = GetCharCodeFor(aGdkKeyEvent, baseState, minGroup);
     altLatinCharCodes.mUnshiftedCharCode =
         IsBasicLatinLetterOrNumeral(ch) ? ch : 0;
--- a/widget/qt/nsWindow.cpp
+++ b/widget/qt/nsWindow.cpp
@@ -1718,17 +1718,17 @@ nsWindow::OnKeyPressEvent(QKeyEvent *aEv
     // append an additional alternativeCharCodes if domCharCode is not a Latin character
     // and if one of these modifiers is pressed (i.e. Ctrl, Alt, Meta)
     if (domCharCode &&
         (QApplication::keyboardModifiers() &
         (Qt::ControlModifier | Qt::AltModifier | Qt::MetaModifier))) {
 
         event.charCode = domCharCode;
         event.keyCode = 0;
-        nsAlternativeCharCode altCharCode(0, 0);
+        AlternativeCharCode altCharCode(0, 0);
         // if character has a lower and upper representation
         if ((unshiftedChar.isUpper() || unshiftedChar.isLower()) &&
             unshiftedChar.toLower() == shiftedChar.toLower()) {
             if (shift_state ^ capslock_state) {
                 altCharCode.mUnshiftedCharCode = (uint32_t) QChar::toUpper((uint)domCharCode);
                 altCharCode.mShiftedCharCode = (uint32_t) QChar::toLower((uint)domCharCode);
             } else {
                 altCharCode.mUnshiftedCharCode = (uint32_t) QChar::toLower((uint)domCharCode);
--- a/widget/windows/KeyboardLayout.cpp
+++ b/widget/windows/KeyboardLayout.cpp
@@ -1306,25 +1306,25 @@ NativeKey::DispatchKeyPressEventsWithKey
         modKeyState.Set(inputtingChars.mModifiers[cnt - skipUniChars]);
       }
       uniChar = inputtingChars.mChars[cnt - skipUniChars];
     }
     if (skipShiftedChars <= cnt)
       shiftedChar = shiftedChars.mChars[cnt - skipShiftedChars];
     if (skipUnshiftedChars <= cnt)
       unshiftedChar = unshiftedChars.mChars[cnt - skipUnshiftedChars];
-    nsAutoTArray<nsAlternativeCharCode, 5> altArray;
+    nsAutoTArray<AlternativeCharCode, 5> altArray;
 
     if (shiftedChar || unshiftedChar) {
-      nsAlternativeCharCode chars(unshiftedChar, shiftedChar);
+      AlternativeCharCode chars(unshiftedChar, shiftedChar);
       altArray.AppendElement(chars);
     }
     if (cnt == longestLength - 1) {
       if (unshiftedLatinChar || shiftedLatinChar) {
-        nsAlternativeCharCode chars(unshiftedLatinChar, shiftedLatinChar);
+        AlternativeCharCode chars(unshiftedLatinChar, shiftedLatinChar);
         altArray.AppendElement(chars);
       }
 
       // Typically, following virtual keycodes are used for a key which can
       // input the character.  However, these keycodes are also used for
       // other keys on some keyboard layout.  E.g., in spite of Shift+'1'
       // inputs '+' on Thai keyboard layout, a key which is at '=/+'
       // key on ANSI keyboard layout is VK_OEM_PLUS.  Native applications
@@ -1336,17 +1336,17 @@ NativeKey::DispatchKeyPressEventsWithKey
         case VK_OEM_MINUS:  charForOEMKeyCode = '-'; break;
         case VK_OEM_PERIOD: charForOEMKeyCode = '.'; break;
       }
       if (charForOEMKeyCode &&
           charForOEMKeyCode != unshiftedChars.mChars[0] &&
           charForOEMKeyCode != shiftedChars.mChars[0] &&
           charForOEMKeyCode != unshiftedLatinChar &&
           charForOEMKeyCode != shiftedLatinChar) {
-        nsAlternativeCharCode OEMChars(charForOEMKeyCode, charForOEMKeyCode);
+        AlternativeCharCode OEMChars(charForOEMKeyCode, charForOEMKeyCode);
         altArray.AppendElement(OEMChars);
       }
     }
 
     nsKeyEvent keypressEvent(true, NS_KEY_PRESS, mWidget);
     keypressEvent.charCode = uniChar;
     keypressEvent.alternativeCharCodes.AppendElements(altArray);
     InitKeyEvent(keypressEvent, modKeyState);