зеркало из https://github.com/mozilla/pjs.git
*** empty log message ***
This commit is contained in:
Родитель
0ab30b5521
Коммит
c9ea8157ef
|
@ -1520,9 +1520,10 @@ nsObjectFrame::HandleEvent(nsIPresContext& aPresContext,
|
|||
case NS_KEY_UP:
|
||||
case NS_KEY_DOWN:
|
||||
//case set cursor must be here:
|
||||
anEventStatus = mInstanceOwner->ProcessEvent(*anEvent);
|
||||
return rv;
|
||||
case NS_GOTFOCUS:
|
||||
case NS_LOSTFOCUS:
|
||||
anEventStatus = mInstanceOwner->ProcessEvent(*anEvent);
|
||||
return rv;
|
||||
default:
|
||||
break;
|
||||
|
@ -2400,49 +2401,6 @@ static void GUItoMacEvent(const nsGUIEvent& anEvent, EventRecord& aMacEvent)
|
|||
}
|
||||
#endif
|
||||
|
||||
//~~~
|
||||
#ifdef XP_WIN
|
||||
static void GUItoWinEvent(const nsGUIEvent& anEvent, nsPluginEvent& aWinEvent)
|
||||
{
|
||||
switch (anEvent.message)
|
||||
{
|
||||
case NS_PAINT:
|
||||
break;
|
||||
case NS_MOUSE_LEFT_BUTTON_DOWN:
|
||||
break;
|
||||
case NS_MOUSE_LEFT_BUTTON_UP:
|
||||
break;
|
||||
case NS_MOUSE_LEFT_DOUBLECLICK:
|
||||
break;
|
||||
case NS_MOUSE_RIGHT_BUTTON_DOWN:
|
||||
break;
|
||||
case NS_MOUSE_RIGHT_BUTTON_UP:
|
||||
break;
|
||||
case NS_MOUSE_RIGHT_DOUBLECLICK:
|
||||
break;
|
||||
case NS_MOUSE_MIDDLE_BUTTON_DOWN:
|
||||
break;
|
||||
case NS_MOUSE_MIDDLE_BUTTON_UP:
|
||||
break;
|
||||
case NS_MOUSE_MIDDLE_DOUBLECLICK:
|
||||
break;
|
||||
case NS_MOUSE_MOVE:
|
||||
break;
|
||||
case NS_KEY_UP:
|
||||
break;
|
||||
case NS_KEY_DOWN:
|
||||
break;
|
||||
//case set cursor must be here:
|
||||
case NS_GOTFOCUS:
|
||||
break;
|
||||
case NS_LOSTFOCUS:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif // XP_WIN
|
||||
|
||||
nsEventStatus nsPluginInstanceOwner::ProcessEvent(const nsGUIEvent& anEvent)
|
||||
{
|
||||
nsEventStatus rv = nsEventStatus_eIgnore;
|
||||
|
@ -2465,10 +2423,9 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const nsGUIEvent& anEvent)
|
|||
|
||||
//~~~
|
||||
#ifdef XP_WIN
|
||||
nsPluginEvent pluginEvent;
|
||||
GUItoWinEvent(anEvent, pluginEvent);
|
||||
nsPluginEvent * pPluginEvent = (nsPluginEvent *)anEvent.nativeMsg;
|
||||
PRBool eventHandled = PR_FALSE;
|
||||
mInstance->HandleEvent(&pluginEvent, &eventHandled);
|
||||
mInstance->HandleEvent(pPluginEvent, &eventHandled);
|
||||
if (eventHandled)
|
||||
rv = nsEventStatus_eConsumeNoDefault;
|
||||
#endif
|
||||
|
|
|
@ -1520,9 +1520,10 @@ nsObjectFrame::HandleEvent(nsIPresContext& aPresContext,
|
|||
case NS_KEY_UP:
|
||||
case NS_KEY_DOWN:
|
||||
//case set cursor must be here:
|
||||
anEventStatus = mInstanceOwner->ProcessEvent(*anEvent);
|
||||
return rv;
|
||||
case NS_GOTFOCUS:
|
||||
case NS_LOSTFOCUS:
|
||||
anEventStatus = mInstanceOwner->ProcessEvent(*anEvent);
|
||||
return rv;
|
||||
default:
|
||||
break;
|
||||
|
@ -2400,49 +2401,6 @@ static void GUItoMacEvent(const nsGUIEvent& anEvent, EventRecord& aMacEvent)
|
|||
}
|
||||
#endif
|
||||
|
||||
//~~~
|
||||
#ifdef XP_WIN
|
||||
static void GUItoWinEvent(const nsGUIEvent& anEvent, nsPluginEvent& aWinEvent)
|
||||
{
|
||||
switch (anEvent.message)
|
||||
{
|
||||
case NS_PAINT:
|
||||
break;
|
||||
case NS_MOUSE_LEFT_BUTTON_DOWN:
|
||||
break;
|
||||
case NS_MOUSE_LEFT_BUTTON_UP:
|
||||
break;
|
||||
case NS_MOUSE_LEFT_DOUBLECLICK:
|
||||
break;
|
||||
case NS_MOUSE_RIGHT_BUTTON_DOWN:
|
||||
break;
|
||||
case NS_MOUSE_RIGHT_BUTTON_UP:
|
||||
break;
|
||||
case NS_MOUSE_RIGHT_DOUBLECLICK:
|
||||
break;
|
||||
case NS_MOUSE_MIDDLE_BUTTON_DOWN:
|
||||
break;
|
||||
case NS_MOUSE_MIDDLE_BUTTON_UP:
|
||||
break;
|
||||
case NS_MOUSE_MIDDLE_DOUBLECLICK:
|
||||
break;
|
||||
case NS_MOUSE_MOVE:
|
||||
break;
|
||||
case NS_KEY_UP:
|
||||
break;
|
||||
case NS_KEY_DOWN:
|
||||
break;
|
||||
//case set cursor must be here:
|
||||
case NS_GOTFOCUS:
|
||||
break;
|
||||
case NS_LOSTFOCUS:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif // XP_WIN
|
||||
|
||||
nsEventStatus nsPluginInstanceOwner::ProcessEvent(const nsGUIEvent& anEvent)
|
||||
{
|
||||
nsEventStatus rv = nsEventStatus_eIgnore;
|
||||
|
@ -2465,10 +2423,9 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const nsGUIEvent& anEvent)
|
|||
|
||||
//~~~
|
||||
#ifdef XP_WIN
|
||||
nsPluginEvent pluginEvent;
|
||||
GUItoWinEvent(anEvent, pluginEvent);
|
||||
nsPluginEvent * pPluginEvent = (nsPluginEvent *)anEvent.nativeMsg;
|
||||
PRBool eventHandled = PR_FALSE;
|
||||
mInstance->HandleEvent(&pluginEvent, &eventHandled);
|
||||
mInstance->HandleEvent(pPluginEvent, &eventHandled);
|
||||
if (eventHandled)
|
||||
rv = nsEventStatus_eConsumeNoDefault;
|
||||
#endif
|
||||
|
|
|
@ -533,12 +533,22 @@ NS_IMETHODIMP ns4xPluginInstance::HandleEvent(nsPluginEvent* event, PRBool* hand
|
|||
#if !TARGET_CARBON
|
||||
// pinkerton
|
||||
// relies on routine descriptors, not present in carbon. We need to fix this.
|
||||
#if defined(XP_MAC) || defined(XP_WIN) //~~~
|
||||
#ifdef XP_MAC
|
||||
res = CallNPP_HandleEventProc(fCallbacks->event,
|
||||
&fNPP,
|
||||
(void*) event->event);
|
||||
#endif
|
||||
|
||||
#ifdef XP_WIN //~~~
|
||||
NPEvent npEvent;
|
||||
npEvent.event = event->event;
|
||||
npEvent.wParam = event->wParam;
|
||||
npEvent.lParam = event->lParam;
|
||||
res = CallNPP_HandleEventProc(fCallbacks->event,
|
||||
&fNPP,
|
||||
(void*)&npEvent);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
*handled = res;
|
||||
|
|
|
@ -533,12 +533,22 @@ NS_IMETHODIMP ns4xPluginInstance::HandleEvent(nsPluginEvent* event, PRBool* hand
|
|||
#if !TARGET_CARBON
|
||||
// pinkerton
|
||||
// relies on routine descriptors, not present in carbon. We need to fix this.
|
||||
#if defined(XP_MAC) || defined(XP_WIN) //~~~
|
||||
#ifdef XP_MAC
|
||||
res = CallNPP_HandleEventProc(fCallbacks->event,
|
||||
&fNPP,
|
||||
(void*) event->event);
|
||||
#endif
|
||||
|
||||
#ifdef XP_WIN //~~~
|
||||
NPEvent npEvent;
|
||||
npEvent.event = event->event;
|
||||
npEvent.wParam = event->wParam;
|
||||
npEvent.lParam = event->lParam;
|
||||
res = CallNPP_HandleEventProc(fCallbacks->event,
|
||||
&fNPP,
|
||||
(void*)&npEvent);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
*handled = res;
|
||||
|
|
|
@ -365,7 +365,6 @@ PRBool nsWindow::ConvertStatus(nsEventStatus aStatus)
|
|||
// Initialize an event to dispatch
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
void nsWindow::InitEvent(nsGUIEvent& event, PRUint32 aEventType, nsPoint* aPoint)
|
||||
{
|
||||
event.widget = this;
|
||||
|
@ -398,6 +397,8 @@ void nsWindow::InitEvent(nsGUIEvent& event, PRUint32 aEventType, nsPoint* aPoint
|
|||
|
||||
mLastPoint.x = event.point.x;
|
||||
mLastPoint.y = event.point.y;
|
||||
|
||||
event.nativeMsg = (void *)&mPluginEvent;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -2143,6 +2144,11 @@ BOOL nsWindow::OnChar( UINT aVirtualKeyCode )
|
|||
//-------------------------------------------------------------------------
|
||||
PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT *aRetValue)
|
||||
{
|
||||
//~~~ Cache this for event.nativeMsg initialization
|
||||
mPluginEvent.event = msg;
|
||||
mPluginEvent.wParam = wParam;
|
||||
mPluginEvent.lParam = lParam;
|
||||
|
||||
static UINT vkKeyCached = 0; // caches VK code fon WM_KEYDOWN
|
||||
static BOOL firstTime = TRUE; // for mouse wheel logic
|
||||
static int iDeltaPerLine, iAccumDelta ; // for mouse wheel logic
|
||||
|
|
|
@ -34,6 +34,10 @@
|
|||
|
||||
#include "nsVoidArray.h"
|
||||
|
||||
//~~~ for windowless plugin support
|
||||
#include "nsplugindefs.h"
|
||||
|
||||
|
||||
#ifdef NEW_DRAG_AND_DROP
|
||||
class nsNativeDragTarget;
|
||||
#endif
|
||||
|
@ -209,6 +213,9 @@ protected:
|
|||
HPALETTE mPalette;
|
||||
WNDPROC mPrevWndProc;
|
||||
|
||||
//~~~
|
||||
nsPluginEvent mPluginEvent;
|
||||
|
||||
PRBool mHas3DBorder;
|
||||
HBRUSH mBrush;
|
||||
PRBool mIsShiftDown;
|
||||
|
|
Загрузка…
Ссылка в новой задаче