This commit is contained in:
av%netscape.com 1999-06-11 22:48:50 +00:00
Родитель e59e832a60
Коммит 9419f45af9
4 изменённых файлов: 57 добавлений и 28 удалений

Просмотреть файл

@ -1461,13 +1461,27 @@ nsObjectFrame::Paint(nsIPresContext& aPresContext,
return NS_OK;
}
if (NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer) {
const nsStyleFont* font = (const nsStyleFont*)
mStyleContext->GetStyleData(eStyleStruct_Font);
aRenderingContext.SetFont(font->mFont);
if (NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer)
{
aRenderingContext.SetColor(NS_RGB(192, 192, 192));
aRenderingContext.FillRect(0, 0, mRect.width, mRect.height);
//~~~
nsIPluginInstance * inst;
if(NS_OK == GetPluginInstance(inst))
{
NS_RELEASE(inst);
// Look if it's windowless
nsPluginWindow * window;
mInstanceOwner->GetWindow(window);
if(window->type == nsPluginWindowType_Drawable)
mInstanceOwner->Paint(aDirtyRect);
return NS_OK;
}
const nsStyleFont* font = (const nsStyleFont*)mStyleContext->GetStyleData(eStyleStruct_Font);
aRenderingContext.SetFont(font->mFont);
aRenderingContext.SetColor(NS_RGB(0, 0, 0));
aRenderingContext.DrawRect(0, 0, mRect.width, mRect.height);
float p2t;
@ -1506,7 +1520,6 @@ nsObjectFrame::HandleEvent(nsIPresContext& aPresContext,
{
switch (anEvent->message)
{
case NS_PAINT:
case NS_MOUSE_LEFT_BUTTON_DOWN:
case NS_MOUSE_LEFT_BUTTON_UP:
case NS_MOUSE_LEFT_DOUBLECLICK:
@ -1520,7 +1533,7 @@ nsObjectFrame::HandleEvent(nsIPresContext& aPresContext,
case NS_KEY_UP:
case NS_KEY_DOWN:
//case set cursor must be here:
anEventStatus = mInstanceOwner->ProcessEvent(*anEvent);
//anEventStatus = mInstanceOwner->ProcessEvent(*anEvent);
return rv;
case NS_GOTFOCUS:
case NS_LOSTFOCUS:
@ -2451,6 +2464,13 @@ void nsPluginInstanceOwner::Paint(const nsRect& aDirtyRect)
mInstance->HandleEvent(&pluginEvent, &eventHandled);
}
#endif
//~~~
#ifdef XP_WIN
nsPluginEvent pluginEvent;
PRBool eventHandled = PR_FALSE;
mInstance->HandleEvent(&pluginEvent, &eventHandled);
#endif
}
// Here's how we give idle time to plugins.

Просмотреть файл

@ -1461,13 +1461,27 @@ nsObjectFrame::Paint(nsIPresContext& aPresContext,
return NS_OK;
}
if (NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer) {
const nsStyleFont* font = (const nsStyleFont*)
mStyleContext->GetStyleData(eStyleStruct_Font);
aRenderingContext.SetFont(font->mFont);
if (NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer)
{
aRenderingContext.SetColor(NS_RGB(192, 192, 192));
aRenderingContext.FillRect(0, 0, mRect.width, mRect.height);
//~~~
nsIPluginInstance * inst;
if(NS_OK == GetPluginInstance(inst))
{
NS_RELEASE(inst);
// Look if it's windowless
nsPluginWindow * window;
mInstanceOwner->GetWindow(window);
if(window->type == nsPluginWindowType_Drawable)
mInstanceOwner->Paint(aDirtyRect);
return NS_OK;
}
const nsStyleFont* font = (const nsStyleFont*)mStyleContext->GetStyleData(eStyleStruct_Font);
aRenderingContext.SetFont(font->mFont);
aRenderingContext.SetColor(NS_RGB(0, 0, 0));
aRenderingContext.DrawRect(0, 0, mRect.width, mRect.height);
float p2t;
@ -1506,7 +1520,6 @@ nsObjectFrame::HandleEvent(nsIPresContext& aPresContext,
{
switch (anEvent->message)
{
case NS_PAINT:
case NS_MOUSE_LEFT_BUTTON_DOWN:
case NS_MOUSE_LEFT_BUTTON_UP:
case NS_MOUSE_LEFT_DOUBLECLICK:
@ -1520,7 +1533,7 @@ nsObjectFrame::HandleEvent(nsIPresContext& aPresContext,
case NS_KEY_UP:
case NS_KEY_DOWN:
//case set cursor must be here:
anEventStatus = mInstanceOwner->ProcessEvent(*anEvent);
//anEventStatus = mInstanceOwner->ProcessEvent(*anEvent);
return rv;
case NS_GOTFOCUS:
case NS_LOSTFOCUS:
@ -2451,6 +2464,13 @@ void nsPluginInstanceOwner::Paint(const nsRect& aDirtyRect)
mInstance->HandleEvent(&pluginEvent, &eventHandled);
}
#endif
//~~~
#ifdef XP_WIN
nsPluginEvent pluginEvent;
PRBool eventHandled = PR_FALSE;
mInstance->HandleEvent(&pluginEvent, &eventHandled);
#endif
}
// Here's how we give idle time to plugins.

Просмотреть файл

@ -52,6 +52,9 @@
//#include "DropSrc.h"
#endif
//~~~ for windowless plugin support
#include "nsplugindefs.h"
// For clipboard support
#include "nsIServiceManager.h"
#include "nsIClipboard.h"
@ -397,8 +400,6 @@ void nsWindow::InitEvent(nsGUIEvent& event, PRUint32 aEventType, nsPoint* aPoint
mLastPoint.x = event.point.x;
mLastPoint.y = event.point.y;
event.nativeMsg = (void *)&mPluginEvent;
}
//-------------------------------------------------------------------------
@ -2156,11 +2157,6 @@ 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,10 +34,6 @@
#include "nsVoidArray.h"
//~~~ for windowless plugin support
#include "nsplugindefs.h"
#ifdef NEW_DRAG_AND_DROP
class nsNativeDragTarget;
#endif
@ -214,9 +210,6 @@ protected:
HPALETTE mPalette;
WNDPROC mPrevWndProc;
//~~~
nsPluginEvent mPluginEvent;
PRBool mHas3DBorder;
HBRUSH mBrush;
PRBool mIsShiftDown;