Bug 1184004 part.1 Give a name to each struct in IMENotification r=smaug

This commit is contained in:
Masayuki Nakano 2015-07-17 13:30:01 +09:00
parent 3cab9a2283
commit dc9a7deb5d

View File

@ -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