Bug 743975 - Remove events that are now unused, r=smaug

This commit is contained in:
Neil Deakin 2012-08-15 14:52:42 -04:00
parent 7382e749d4
commit d5239674af
4 changed files with 1 additions and 160 deletions

View File

@ -142,8 +142,6 @@ nsDOMEvent::nsDOMEvent(nsPresContext* aPresContext, nsEvent* aEvent)
}
InitPresContextData(aPresContext);
NS_ASSERTION(mEvent->message != NS_PAINT, "Trying to create a DOM paint event!");
}
void
@ -601,34 +599,6 @@ nsDOMEvent::DuplicatePrivateData()
newEvent = new nsGUIEvent(false, msg, nullptr);
break;
}
case NS_SIZE_EVENT:
{
nsSizeEvent* sizeEvent = new nsSizeEvent(false, msg, nullptr);
NS_ENSURE_TRUE(sizeEvent, NS_ERROR_OUT_OF_MEMORY);
sizeEvent->mWinWidth = static_cast<nsSizeEvent*>(mEvent)->mWinWidth;
sizeEvent->mWinHeight = static_cast<nsSizeEvent*>(mEvent)->mWinHeight;
newEvent = sizeEvent;
break;
}
case NS_SIZEMODE_EVENT:
{
newEvent = new nsSizeModeEvent(false, msg, nullptr);
NS_ENSURE_TRUE(newEvent, NS_ERROR_OUT_OF_MEMORY);
static_cast<nsSizeModeEvent*>(newEvent)->mSizeMode =
static_cast<nsSizeModeEvent*>(mEvent)->mSizeMode;
break;
}
case NS_ZLEVEL_EVENT:
{
nsZLevelEvent* zLevelEvent = new nsZLevelEvent(false, msg, nullptr);
NS_ENSURE_TRUE(zLevelEvent, NS_ERROR_OUT_OF_MEMORY);
nsZLevelEvent* oldZLevelEvent = static_cast<nsZLevelEvent*>(mEvent);
zLevelEvent->mPlacement = oldZLevelEvent->mPlacement;
zLevelEvent->mImmediate = oldZLevelEvent->mImmediate;
zLevelEvent->mAdjusted = oldZLevelEvent->mAdjusted;
newEvent = zLevelEvent;
break;
}
case NS_SCROLLBAR_EVENT:
{
newEvent = new nsScrollbarEvent(false, msg, nullptr);

View File

@ -48,10 +48,6 @@ struct nsTextRange;
class nsEvent;
class nsGUIEvent;
class nsScriptErrorEvent;
class nsSizeEvent;
class nsSizeModeEvent;
class nsZLevelEvent;
class nsPaintEvent;
class nsScrollbarEvent;
class nsScrollPortEvent;
class nsScrollAreaEvent;
@ -76,7 +72,6 @@ class nsUIEvent;
class nsSimpleGestureEvent;
class nsTransitionEvent;
class nsAnimationEvent;
class nsUIStateChangeEvent;
class nsPluginEvent;
namespace mozilla {

View File

@ -147,37 +147,12 @@ class nsHashKey;
// Widget may be destroyed
#define NS_XUL_CLOSE (NS_WINDOW_START + 1)
// Widget was resized
#define NS_SIZE (NS_WINDOW_START + 3)
// Widget size mode was changed
#define NS_SIZEMODE (NS_WINDOW_START + 4)
// Widget got activated
#define NS_ACTIVATE (NS_WINDOW_START + 7)
// Widget got deactivated
#define NS_DEACTIVATE (NS_WINDOW_START + 8)
// top-level window z-level change request
#define NS_SETZLEVEL (NS_WINDOW_START + 9)
// Widget was repainted (dispatched when it's safe to move widgets, but
// only on some platforms (including GTK2 and Windows))
#define NS_DID_PAINT (NS_WINDOW_START + 28)
// Widget will need to be painted
#define NS_WILL_PAINT (NS_WINDOW_START + 29)
// Widget needs to be repainted
#define NS_PAINT (NS_WINDOW_START + 30)
// Key is pressed within a window
#define NS_KEY_PRESS (NS_WINDOW_START + 31)
// Key is released within a window
#define NS_KEY_UP (NS_WINDOW_START + 32)
// Key is pressed within a window
#define NS_KEY_DOWN (NS_WINDOW_START + 33)
// Window has been moved to a new location.
// The events point contains the x, y location in screen coordinates
#define NS_MOVE (NS_WINDOW_START + 34)
#define NS_OS_TOOLBAR (NS_WINDOW_START + 36)
// Done sizing or moving a window, so ensure that the mousedown state was cleared.
#define NS_DONESIZEMOVE (NS_WINDOW_START + 44)
#define NS_RESIZE_EVENT (NS_WINDOW_START + 60)
#define NS_SCROLL_EVENT (NS_WINDOW_START + 61)
@ -217,13 +192,6 @@ class nsHashKey;
#define NS_CONTEXTMENU_MESSAGE_START 500
#define NS_CONTEXTMENU (NS_CONTEXTMENU_MESSAGE_START)
#define NS_SCROLLBAR_MESSAGE_START 1000
#define NS_SCROLLBAR_POS (NS_SCROLLBAR_MESSAGE_START)
#define NS_SCROLLBAR_PAGE_NEXT (NS_SCROLLBAR_MESSAGE_START + 1)
#define NS_SCROLLBAR_PAGE_PREV (NS_SCROLLBAR_MESSAGE_START + 2)
#define NS_SCROLLBAR_LINE_NEXT (NS_SCROLLBAR_MESSAGE_START + 3)
#define NS_SCROLLBAR_LINE_PREV (NS_SCROLLBAR_MESSAGE_START + 4)
#define NS_STREAM_EVENT_START 1100
#define NS_LOAD (NS_STREAM_EVENT_START)
#define NS_PAGE_UNLOAD (NS_STREAM_EVENT_START + 1)
@ -640,84 +608,6 @@ public:
const PRUnichar* fileName;
};
/**
* Window resize event
*/
class nsSizeEvent : public nsGUIEvent
{
public:
nsSizeEvent(bool isTrusted, PRUint32 msg, nsIWidget *w)
: nsGUIEvent(isTrusted, msg, w, NS_SIZE_EVENT),
windowSize(nullptr), mWinWidth(0), mWinHeight(0)
{
}
/// x,y width, height in pixels (client area)
nsIntRect *windowSize;
/// width of entire window (in pixels)
PRInt32 mWinWidth;
/// height of entire window (in pixels)
PRInt32 mWinHeight;
};
/**
* Window size mode event
*/
class nsSizeModeEvent : public nsGUIEvent
{
public:
nsSizeModeEvent(bool isTrusted, PRUint32 msg, nsIWidget *w)
: nsGUIEvent(isTrusted, msg, w, NS_SIZEMODE_EVENT),
mSizeMode(nsSizeMode_Normal)
{
}
nsSizeMode mSizeMode;
};
/**
* Window z-level event
*/
class nsZLevelEvent : public nsGUIEvent
{
public:
nsZLevelEvent(bool isTrusted, PRUint32 msg, nsIWidget *w)
: nsGUIEvent(isTrusted, msg, w, NS_ZLEVEL_EVENT),
mPlacement(nsWindowZTop), mReqBelow(nullptr), mActualBelow(nullptr),
mImmediate(false), mAdjusted(false)
{
}
nsWindowZ mPlacement;
nsIWidget *mReqBelow, // widget we request being below, if any
*mActualBelow; // widget to be below, returned by handler
bool mImmediate, // handler should make changes immediately
mAdjusted; // handler changed placement
};
/**
* Window repaint event
*/
class nsPaintEvent : public nsGUIEvent
{
public:
nsPaintEvent(bool isTrusted, PRUint32 msg, nsIWidget *w)
: nsGUIEvent(isTrusted, msg, w, NS_PAINT_EVENT),
willSendDidPaint(false),
didSendWillPaint(false)
{
}
// area that needs repainting
nsIntRegion region;
bool willSendDidPaint;
bool didSendWillPaint;
};
/**
* Scrollbar event
*/
@ -1811,9 +1701,7 @@ enum nsDragDropEventStatus {
((evnt)->message == NS_COMPOSITION_UPDATE))
#define NS_IS_ACTIVATION_EVENT(evnt) \
(((evnt)->message == NS_ACTIVATE) || \
((evnt)->message == NS_DEACTIVATE) || \
((evnt)->message == NS_PLUGIN_ACTIVATE) || \
(((evnt)->message == NS_PLUGIN_ACTIVATE) || \
((evnt)->message == NS_PLUGIN_FOCUS))
#define NS_IS_QUERY_CONTENT_EVENT(evnt) \

View File

@ -1478,7 +1478,6 @@ case _value: eventName.AssignLiteral(_name) ; break
_ASSIGN_eventName(NS_MOUSE_CLICK,"NS_MOUSE_CLICK");
_ASSIGN_eventName(NS_MOUSE_DOUBLECLICK,"NS_MOUSE_DBLCLICK");
_ASSIGN_eventName(NS_MOUSE_MOVE,"NS_MOUSE_MOVE");
_ASSIGN_eventName(NS_MOVE,"NS_MOVE");
_ASSIGN_eventName(NS_LOAD,"NS_LOAD");
_ASSIGN_eventName(NS_POPSTATE,"NS_POPSTATE");
_ASSIGN_eventName(NS_BEFORE_SCRIPT_EXECUTE,"NS_BEFORE_SCRIPT_EXECUTE");
@ -1486,15 +1485,8 @@ case _value: eventName.AssignLiteral(_name) ; break
_ASSIGN_eventName(NS_PAGE_UNLOAD,"NS_PAGE_UNLOAD");
_ASSIGN_eventName(NS_HASHCHANGE,"NS_HASHCHANGE");
_ASSIGN_eventName(NS_READYSTATECHANGE,"NS_READYSTATECHANGE");
_ASSIGN_eventName(NS_PAINT,"NS_PAINT");
_ASSIGN_eventName(NS_XUL_BROADCAST, "NS_XUL_BROADCAST");
_ASSIGN_eventName(NS_XUL_COMMAND_UPDATE, "NS_XUL_COMMAND_UPDATE");
_ASSIGN_eventName(NS_SCROLLBAR_LINE_NEXT,"NS_SB_LINE_NEXT");
_ASSIGN_eventName(NS_SCROLLBAR_LINE_PREV,"NS_SB_LINE_PREV");
_ASSIGN_eventName(NS_SCROLLBAR_PAGE_NEXT,"NS_SB_PAGE_NEXT");
_ASSIGN_eventName(NS_SCROLLBAR_PAGE_PREV,"NS_SB_PAGE_PREV");
_ASSIGN_eventName(NS_SCROLLBAR_POS,"NS_SB_POS");
_ASSIGN_eventName(NS_SIZE,"NS_SIZE");
#undef _ASSIGN_eventName
@ -1632,10 +1624,6 @@ nsBaseWidget::debug_DumpEvent(FILE * aFileOut,
const nsCAutoString & aWidgetName,
PRInt32 aWindowID)
{
// NS_PAINT is handled by debug_DumpPaintEvent()
if (aGuiEvent->message == NS_PAINT)
return;
if (aGuiEvent->message == NS_MOUSE_MOVE)
{
if (!debug_GetCachedBoolPref("nglayout.debug.motion_event_dumping"))