From dc9a7deb5db06a1ec9fc3163eac32664931ed02d Mon Sep 17 00:00:00 2001 From: Masayuki Nakano Date: Fri, 17 Jul 2015 13:30:01 +0900 Subject: [PATCH] Bug 1184004 part.1 Give a name to each struct in IMENotification r=smaug --- widget/nsIWidget.h | 102 ++++++++++++++++++++++++--------------------- 1 file changed, 54 insertions(+), 48 deletions(-) diff --git a/widget/nsIWidget.h b/widget/nsIWidget.h index b2c573ef127..7218ba9bc43 100644 --- a/widget/nsIWidget.h +++ b/widget/nsIWidget.h @@ -692,6 +692,42 @@ struct IMENotification IMEMessage mMessage; + struct Point + { + int32_t mX; + int32_t mY; + + void Set(const nsIntPoint& aPoint) + { + mX = aPoint.x; + mY = aPoint.y; + } + nsIntPoint AsIntPoint() const + { + return nsIntPoint(mX, mY); + } + }; + + struct Rect + { + int32_t mX; + int32_t mY; + int32_t mWidth; + int32_t mHeight; + + void Set(const nsIntRect& aRect) + { + mX = aRect.x; + mY = aRect.y; + mWidth = aRect.width; + mHeight = aRect.height; + } + nsIntRect AsIntRect() const + { + return nsIntRect(mX, mY, mWidth, mHeight); + } + }; + // NOTIFY_IME_OF_SELECTION_CHANGE specific data struct SelectionChangeData { @@ -810,6 +846,23 @@ struct IMENotification } }; + struct MouseButtonEventData + { + // The value of WidgetEvent::message + uint32_t mEventMessage; + // Character offset from the start of the focused editor under the cursor + uint32_t mOffset; + // Cursor position in pixels relative to the widget + Point mCursorPos; + // Character rect in pixels under the cursor relative to the widget + Rect mCharRect; + // The value of WidgetMouseEventBase::button and buttons + int16_t mButton; + int16_t mButtons; + // The value of WidgetInputEvent::modifiers + Modifiers mModifiers; + }; + union { // NOTIFY_IME_OF_SELECTION_CHANGE specific data @@ -819,54 +872,7 @@ struct IMENotification TextChangeDataBase mTextChangeData; // NOTIFY_IME_OF_MOUSE_BUTTON_EVENT specific data - struct - { - // The value of WidgetEvent::message - uint32_t mEventMessage; - // Character offset from the start of the focused editor under the cursor - uint32_t mOffset; - // Cursor position in pixels relative to the widget - struct - { - int32_t mX; - int32_t mY; - - void Set(const nsIntPoint& aPoint) - { - mX = aPoint.x; - mY = aPoint.y; - } - nsIntPoint AsIntPoint() const - { - return nsIntPoint(mX, mY); - } - } mCursorPos; - // Character rect in pixels under the cursor relative to the widget - struct - { - int32_t mX; - int32_t mY; - int32_t mWidth; - int32_t mHeight; - - void Set(const nsIntRect& aRect) - { - mX = aRect.x; - mY = aRect.y; - mWidth = aRect.width; - mHeight = aRect.height; - } - nsIntRect AsIntRect() const - { - return nsIntRect(mX, mY, mWidth, mHeight); - } - } mCharRect; - // The value of WidgetMouseEventBase::button and buttons - int16_t mButton; - int16_t mButtons; - // The value of WidgetInputEvent::modifiers - Modifiers mModifiers; - } mMouseButtonEventData; + MouseButtonEventData mMouseButtonEventData; }; bool IsCausedByComposition() const