Bug 1254755 part.5 Rename WidgetKeyboardEvent::isChar to WidgetKeyboardEvent::mIsChar r?smaug draft
authorMasayuki Nakano <masayuki@d-toybox.com>
Thu, 12 May 2016 18:31:05 +0900
changeset 367295 ba3a791629b5b2eeabfe92474d3413389f6bae76
parent 367294 be42b431f18af58f26062f401ddf4b843f700895
child 367296 3a738d585b06cd4c10bb2136f601d27215935146
push id18190
push usermasayuki@d-toybox.com
push dateMon, 16 May 2016 08:16:10 +0000
reviewerssmaug
bugs1254755
milestone49.0a1
Bug 1254755 part.5 Rename WidgetKeyboardEvent::isChar to WidgetKeyboardEvent::mIsChar r?smaug MozReview-Commit-ID: 58mri5IP3dV
dom/events/UIEvent.cpp
widget/TextEvents.h
widget/android/nsWindow.cpp
widget/cocoa/TextInputHandler.mm
widget/gonk/nsAppShell.cpp
widget/nsGUIEventIPC.h
--- a/dom/events/UIEvent.cpp
+++ b/dom/events/UIEvent.cpp
@@ -347,17 +347,17 @@ UIEvent::GetIsChar(bool* aIsChar)
   *aIsChar = IsChar();
   return NS_OK;
 }
 
 bool
 UIEvent::IsChar() const
 {
   WidgetKeyboardEvent* keyEvent = mEvent->AsKeyboardEvent();
-  return keyEvent ? keyEvent->isChar : false;
+  return keyEvent ? keyEvent->mIsChar : false;
 }
 
 mozilla::dom::Event*
 UIEvent::AsEvent(void)
 {
   return this;
 }
 
--- a/widget/TextEvents.h
+++ b/widget/TextEvents.h
@@ -101,17 +101,17 @@ private:
   friend class dom::PBrowserChild;
 
 protected:
   WidgetKeyboardEvent()
     : mKeyCode(0)
     , mCharCode(0)
     , mPseudoCharCode(0)
     , mLocation(nsIDOMKeyEvent::DOM_KEY_LOCATION_STANDARD)
-    , isChar(false)
+    , mIsChar(false)
     , mIsRepeat(false)
     , mIsComposing(false)
     , mIsReserved(false)
     , mAccessKeyForwardedToChild(false)
     , mKeyNameIndex(mozilla::KEY_NAME_INDEX_Unidentified)
     , mCodeNameIndex(CODE_NAME_INDEX_UNKNOWN)
     , mNativeKeyEvent(nullptr)
     , mUniqueId(0)
@@ -130,17 +130,17 @@ public:
   WidgetKeyboardEvent(bool aIsTrusted, EventMessage aMessage,
                       nsIWidget* aWidget,
                       EventClassID aEventClassID = eKeyboardEventClass)
     : WidgetInputEvent(aIsTrusted, aMessage, aWidget, aEventClassID)
     , mKeyCode(0)
     , mCharCode(0)
     , mPseudoCharCode(0)
     , mLocation(nsIDOMKeyEvent::DOM_KEY_LOCATION_STANDARD)
-    , isChar(false)
+    , mIsChar(false)
     , mIsRepeat(false)
     , mIsComposing(false)
     , mIsReserved(false)
     , mAccessKeyForwardedToChild(false)
     , mKeyNameIndex(mozilla::KEY_NAME_INDEX_Unidentified)
     , mCodeNameIndex(CODE_NAME_INDEX_UNKNOWN)
     , mNativeKeyEvent(nullptr)
     , mUniqueId(0)
@@ -206,17 +206,17 @@ public:
   // key value and same modifier state.
   uint32_t mPseudoCharCode;
   // One of nsIDOMKeyEvent::DOM_KEY_LOCATION_*
   uint32_t mLocation;
   // OS translated Unicode chars which are used for accesskey and accelkey
   // handling. The handlers will try from first character to last character.
   nsTArray<AlternativeCharCode> mAlternativeCharCodes;
   // Indicates whether the event signifies a printable character
-  bool isChar;
+  bool mIsChar;
   // Indicates whether the event is generated by auto repeat or not.
   // if this is keyup event, always false.
   bool mIsRepeat;
   // Indicates whether the event is generated during IME (or deadkey)
   // composition.  This is initialized by EventStateManager.  So, key event
   // dispatchers don't need to initialize this.
   bool mIsComposing;
   // Indicates if the key combination is reserved by chrome.  This is set by
@@ -372,17 +372,17 @@ public:
   {
     AssignInputEventData(aEvent, aCopyTargets);
 
     mKeyCode = aEvent.mKeyCode;
     mCharCode = aEvent.mCharCode;
     mPseudoCharCode = aEvent.mPseudoCharCode;
     mLocation = aEvent.mLocation;
     mAlternativeCharCodes = aEvent.mAlternativeCharCodes;
-    isChar = aEvent.isChar;
+    mIsChar = aEvent.mIsChar;
     mIsRepeat = aEvent.mIsRepeat;
     mIsComposing = aEvent.mIsComposing;
     mIsReserved = aEvent.mIsReserved;
     mAccessKeyForwardedToChild = aEvent.mAccessKeyForwardedToChild;
     mKeyNameIndex = aEvent.mKeyNameIndex;
     mCodeNameIndex = aEvent.mCodeNameIndex;
     mKeyValue = aEvent.mKeyValue;
     mCodeValue = aEvent.mCodeValue;
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -2456,34 +2456,34 @@ InitKeyEvent(WidgetKeyboardEvent& event,
 {
     const uint32_t domKeyCode = ConvertAndroidKeyCodeToDOMKeyCode(keyCode);
     const int32_t charCode = unicodeChar ? unicodeChar : baseUnicodeChar;
 
     event.mModifiers = GetModifiers(metaState);
 
     if (event.mMessage == eKeyPress) {
         // Android gives us \n, so filter out some control characters.
-        event.isChar = (charCode >= ' ');
-        event.mCharCode = event.isChar ? charCode : 0;
-        event.mKeyCode = event.isChar ? 0 : domKeyCode;
+        event.mIsChar = (charCode >= ' ');
+        event.mCharCode = event.mIsChar ? charCode : 0;
+        event.mKeyCode = event.mIsChar ? 0 : domKeyCode;
         event.mPluginEvent.Clear();
 
         // For keypress, if the unicode char already has modifiers applied, we
         // don't specify extra modifiers. If UnicodeChar() != BaseUnicodeChar()
         // it means UnicodeChar() already has modifiers applied.
         // Note that on Android 4.x, Alt modifier isn't set when the key input
         // causes text input even while right Alt key is pressed.  However,
         // this is necessary for Android 2.3 compatibility.
         if (unicodeChar && unicodeChar != baseUnicodeChar) {
             event.mModifiers &= ~(MODIFIER_ALT | MODIFIER_CONTROL
                                                | MODIFIER_META);
         }
 
     } else {
-        event.isChar = false;
+        event.mIsChar = false;
         event.mCharCode = 0;
         event.mKeyCode = domKeyCode;
 
         ANPEvent pluginEvent;
         pluginEvent.inSize = sizeof(pluginEvent);
         pluginEvent.eventType = kKey_ANPEventType;
         pluginEvent.data.key.action = event.mMessage == eKeyDown
                 ? kDown_ANPKeyAction : kUp_ANPKeyAction;
--- a/widget/cocoa/TextInputHandler.mm
+++ b/widget/cocoa/TextInputHandler.mm
@@ -909,17 +909,17 @@ TISInputSourceWrapper::InitKeyEvent(NSEv
     nsCocoaUtils::GetStringForNSString([aNativeKeyEvent charactersIgnoringModifiers], nativeCharsIgnoringModifiers);
     aKeyEvent.mNativeCharactersIgnoringModifiers.Assign(nativeCharsIgnoringModifiers);
   } else if ([aNativeKeyEvent type] == NSFlagsChanged) {
     aKeyEvent.mNativeKeyCode = [aNativeKeyEvent keyCode];
     aKeyEvent.mNativeModifierFlags = [aNativeKeyEvent modifierFlags];
   }
 
   aKeyEvent.mRefPoint = LayoutDeviceIntPoint(0, 0);
-  aKeyEvent.isChar = false; // XXX not used in XP level
+  aKeyEvent.mIsChar = false; // XXX not used in XP level
 
   UInt32 kbType = GetKbdType();
   UInt32 nativeKeyCode = [aNativeKeyEvent keyCode];
 
   aKeyEvent.mKeyCode =
     ComputeGeckoKeyCode(nativeKeyCode, kbType, aKeyEvent.IsMeta());
 
   switch (nativeKeyCode) {
@@ -1091,17 +1091,17 @@ TISInputSourceWrapper::WillDispatchKeybo
   // The mCharCode was set from mKeyValue. However, for example, when Ctrl key
   // is pressed, its value should indicate an ASCII character for backward
   // compatibility rather than inputting character without the modifiers.
   // Therefore, we need to modify mCharCode value here.
   uint32_t charCode =
     insertStringForCharCode.IsEmpty() ? 0 : insertStringForCharCode[0];
   aKeyEvent.SetCharCode(charCode);
   // this is not a special key  XXX not used in XP
-  aKeyEvent.isChar = (aKeyEvent.mMessage == eKeyPress);
+  aKeyEvent.mIsChar = (aKeyEvent.mMessage == eKeyPress);
 
   MOZ_LOG(gLog, LogLevel::Info,
     ("%p TISInputSourceWrapper::WillDispatchKeyboardEvent, "
      "aKeyEvent.mKeyCode=0x%X, aKeyEvent.mCharCode=0x%X",
      this, aKeyEvent.mKeyCode, aKeyEvent.mCharCode));
 
   TISInputSourceWrapper USLayout("com.apple.keylayout.US");
   bool isRomanKeyboardLayout = IsASCIICapable();
@@ -2219,28 +2219,28 @@ TextInputHandler::InsertText(NSAttribute
       MOZ_LOG(gLog, LogLevel::Error,
         ("%p IMEInputHandler::HandleKeyUpEvent, "
          "FAILED, due to BeginNativeInputTransaction() failure", this));
     return;
   }
 
   // Dispatch keypress event with char instead of compositionchange event
   WidgetKeyboardEvent keypressEvent(true, eKeyPress, mWidget);
-  keypressEvent.isChar = IsPrintableChar(str.CharAt(0));
+  keypressEvent.mIsChar = IsPrintableChar(str.CharAt(0));
 
   // Don't set other modifiers from the current event, because here in
   // -insertText: they've already been taken into account in creating
   // the input string.
 
   if (currentKeyEvent) {
     NSEvent* keyEvent = currentKeyEvent->mKeyEvent;
     InitKeyEvent(keyEvent, keypressEvent, &str);
   } else {
     nsCocoaUtils::InitInputEvent(keypressEvent, static_cast<NSEvent*>(nullptr));
-    if (keypressEvent.isChar) {
+    if (keypressEvent.mIsChar) {
       keypressEvent.mCharCode = str.CharAt(0);
     }
     // Note that insertText is not called only at key pressing.
     if (!keypressEvent.mCharCode) {
       keypressEvent.mKeyCode =
         WidgetUtils::ComputeKeyCodeFromChar(keypressEvent.mCharCode);
     }
   }
--- a/widget/gonk/nsAppShell.cpp
+++ b/widget/gonk/nsAppShell.cpp
@@ -301,17 +301,17 @@ KeyEventDispatcher::DispatchKeyEventInte
     if (aEventMessage == eKeyPress) {
         // XXX If the charCode is not a printable character, the charCode
         //     should be computed without Ctrl/Alt/Meta modifiers.
         event.mCharCode = static_cast<uint32_t>(mChar);
     }
     if (!event.mCharCode) {
         event.mKeyCode = mDOMKeyCode;
     }
-    event.isChar = !!event.mCharCode;
+    event.mIsChar = !!event.mCharCode;
     event.mIsRepeat = IsRepeat();
     event.mKeyNameIndex = mDOMKeyNameIndex;
     if (mDOMPrintableKeyValue) {
         event.mKeyValue = mDOMPrintableKeyValue;
     }
     event.mCodeNameIndex = mDOMCodeNameIndex;
     event.mModifiers = getDOMModifiers(mData.metaState);
     event.mLocation = mDOMKeyLocation;
--- a/widget/nsGUIEventIPC.h
+++ b/widget/nsGUIEventIPC.h
@@ -393,17 +393,17 @@ struct ParamTraits<mozilla::WidgetKeyboa
     WriteParam(aMsg, static_cast<uint32_t>(aParam.mKeyNameIndex));
     WriteParam(aMsg, static_cast<uint32_t>(aParam.mCodeNameIndex));
     WriteParam(aMsg, aParam.mKeyValue);
     WriteParam(aMsg, aParam.mCodeValue);
     WriteParam(aMsg, aParam.mKeyCode);
     WriteParam(aMsg, aParam.mCharCode);
     WriteParam(aMsg, aParam.mPseudoCharCode);
     WriteParam(aMsg, aParam.mAlternativeCharCodes);
-    WriteParam(aMsg, aParam.isChar);
+    WriteParam(aMsg, aParam.mIsChar);
     WriteParam(aMsg, aParam.mIsRepeat);
     WriteParam(aMsg, aParam.mIsReserved);
     WriteParam(aMsg, aParam.mAccessKeyForwardedToChild);
     WriteParam(aMsg, aParam.mLocation);
     WriteParam(aMsg, aParam.mUniqueId);
     WriteParam(aMsg, aParam.mIsSynthesizedByTIP);
     WriteParam(aMsg,
                static_cast<mozilla::WidgetKeyboardEvent::InputMethodAppStateType>
@@ -429,17 +429,17 @@ struct ParamTraits<mozilla::WidgetKeyboa
         ReadParam(aMsg, aIter, &keyNameIndex) &&
         ReadParam(aMsg, aIter, &codeNameIndex) &&
         ReadParam(aMsg, aIter, &aResult->mKeyValue) &&
         ReadParam(aMsg, aIter, &aResult->mCodeValue) &&
         ReadParam(aMsg, aIter, &aResult->mKeyCode) &&
         ReadParam(aMsg, aIter, &aResult->mCharCode) &&
         ReadParam(aMsg, aIter, &aResult->mPseudoCharCode) &&
         ReadParam(aMsg, aIter, &aResult->mAlternativeCharCodes) &&
-        ReadParam(aMsg, aIter, &aResult->isChar) &&
+        ReadParam(aMsg, aIter, &aResult->mIsChar) &&
         ReadParam(aMsg, aIter, &aResult->mIsRepeat) &&
         ReadParam(aMsg, aIter, &aResult->mIsReserved) &&
         ReadParam(aMsg, aIter, &aResult->mAccessKeyForwardedToChild) &&
         ReadParam(aMsg, aIter, &aResult->mLocation) &&
         ReadParam(aMsg, aIter, &aResult->mUniqueId) &&
         ReadParam(aMsg, aIter, &aResult->mIsSynthesizedByTIP) &&
         ReadParam(aMsg, aIter, &inputMethodAppState)
 #ifdef XP_MACOSX