зеркало из https://github.com/mozilla/gecko-dev.git
r=jeffreyj@us.ibm.com, sr=blizzard OS/2 only - remove unnecessary class nsCanvas
This commit is contained in:
Родитель
fb0d67af5b
Коммит
c2e045538d
|
@ -49,7 +49,6 @@ endif
|
||||||
CPPSRCS = \
|
CPPSRCS = \
|
||||||
nsAppShell.cpp \
|
nsAppShell.cpp \
|
||||||
nsBidiKeyboard.cpp \
|
nsBidiKeyboard.cpp \
|
||||||
nsCanvas.cpp \
|
|
||||||
nsClipboard.cpp \
|
nsClipboard.cpp \
|
||||||
nsFilePicker.cpp \
|
nsFilePicker.cpp \
|
||||||
nsFrameWindow.cpp \
|
nsFrameWindow.cpp \
|
||||||
|
|
|
@ -1,81 +0,0 @@
|
||||||
/*
|
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
|
||||||
* Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* The Original Code is the Mozilla OS/2 libraries.
|
|
||||||
*
|
|
||||||
* The Initial Developer of the Original Code is John Fairhurst,
|
|
||||||
* <john_fairhurst@iname.com>. Portions created by John Fairhurst are
|
|
||||||
* Copyright (C) 1999 John Fairhurst. All Rights Reserved.
|
|
||||||
*
|
|
||||||
* Contributor(s): Henry Sobotka <sobotka@axess.com> 01/2000 review and update
|
|
||||||
*
|
|
||||||
* This Original Code has been modified by IBM Corporation.
|
|
||||||
* Modifications made by IBM described herein are
|
|
||||||
* Copyright (c) International Business Machines
|
|
||||||
* Corporation, 2000
|
|
||||||
*
|
|
||||||
* Modifications to Mozilla code or documentation
|
|
||||||
* identified per MPL Section 3.3
|
|
||||||
*
|
|
||||||
* Date Modified by Description of modification
|
|
||||||
* 03/31/2000 IBM Corp. @JSK32365 - Set WS_CLIPSIBLINGS on
|
|
||||||
* nsCanvas objects to fix bleed-through
|
|
||||||
* 04/31/2000 IBM Corp. Change parms to DispatchMouseEvent to match Windows.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
// nscanvas - basic window class that dispatches paint events.
|
|
||||||
|
|
||||||
#include "nsCanvas.h"
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
extern BOOL g_bHandlingMouseClick;
|
|
||||||
|
|
||||||
PRBool nsCanvas::DispatchMouseEvent( PRUint32 aEventType, MPARAM mp1, MPARAM mp2)
|
|
||||||
{
|
|
||||||
PRBool rc = PR_FALSE;
|
|
||||||
|
|
||||||
// Don't capture mb2 so that drag'n'drop works.
|
|
||||||
|
|
||||||
if( mEventCallback || mMouseListener)
|
|
||||||
{
|
|
||||||
switch( aEventType)
|
|
||||||
{
|
|
||||||
case NS_MOUSE_LEFT_BUTTON_DOWN:
|
|
||||||
case NS_MOUSE_MIDDLE_BUTTON_DOWN:
|
|
||||||
WinSetCapture( HWND_DESKTOP, mWnd);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case NS_MOUSE_LEFT_BUTTON_UP:
|
|
||||||
case NS_MOUSE_MIDDLE_BUTTON_UP:
|
|
||||||
WinSetCapture( HWND_DESKTOP, 0); // release
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
rc = nsWindow::DispatchMouseEvent( aEventType, mp1, mp2);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Mousemove messages mustn't propagate to get cursors working. Try commenting
|
|
||||||
// this block out & then move the mouse over a link.
|
|
||||||
|
|
||||||
if( aEventType == NS_MOUSE_MOVE)
|
|
||||||
rc = PR_TRUE;
|
|
||||||
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ULONG nsCanvas::WindowStyle()
|
|
||||||
{
|
|
||||||
return BASE_CONTROL_STYLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
|
|
||||||
}
|
|
|
@ -1,50 +0,0 @@
|
||||||
/*
|
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
|
||||||
* Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* The Original Code is the Mozilla OS/2 libraries.
|
|
||||||
*
|
|
||||||
* The Initial Developer of the Original Code is John Fairhurst,
|
|
||||||
* <john_fairhurst@iname.com>. Portions created by John Fairhurst are
|
|
||||||
* Copyright (C) 1999 John Fairhurst. All Rights Reserved.
|
|
||||||
*
|
|
||||||
* Contributor(s):
|
|
||||||
* This Original Code has been modified by IBM Corporation.
|
|
||||||
* Modifications made by IBM described herein are
|
|
||||||
* Copyright (c) International Business Machines
|
|
||||||
* Corporation, 2000
|
|
||||||
*
|
|
||||||
* Modifications to Mozilla code or documentation
|
|
||||||
* identified per MPL Section 3.3
|
|
||||||
*
|
|
||||||
* Date Modified by Description of modification
|
|
||||||
* 04/12/2000 IBM Corp. Changed params on DispatchMouseEvent to match Windows..
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _nscanvas_h
|
|
||||||
#define _nscanvas_h
|
|
||||||
|
|
||||||
// nscanvas - this is the NS_CHILD_CID class which contains content.
|
|
||||||
// The main code added in here is to do painting.
|
|
||||||
|
|
||||||
#include "nswindow.h"
|
|
||||||
|
|
||||||
class nsCanvas : public nsWindow
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
nsCanvas() {};
|
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual PRBool DispatchMouseEvent( PRUint32 aEventType, MPARAM mp1, MPARAM mp2);
|
|
||||||
virtual ULONG WindowStyle();
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -48,7 +48,7 @@
|
||||||
// class definition headers
|
// class definition headers
|
||||||
#include "nsAppShell.h"
|
#include "nsAppShell.h"
|
||||||
#include "nsBidiKeyboard.h"
|
#include "nsBidiKeyboard.h"
|
||||||
#include "nsCanvas.h"
|
#include "nsWindow.h"
|
||||||
#include "nsDragService.h"
|
#include "nsDragService.h"
|
||||||
#include "nsILocalFile.h"
|
#include "nsILocalFile.h"
|
||||||
#include "nsFilePicker.h"
|
#include "nsFilePicker.h"
|
||||||
|
@ -68,7 +68,7 @@
|
||||||
|
|
||||||
// objects that just require generic constructors
|
// objects that just require generic constructors
|
||||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsBidiKeyboard)
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsBidiKeyboard)
|
||||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsCanvas)
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindow)
|
||||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboard)
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboard)
|
||||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboardHelper)
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboardHelper)
|
||||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFilePicker)
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFilePicker)
|
||||||
|
@ -227,10 +227,10 @@ static const nsModuleComponentInfo components[] =
|
||||||
NS_BIDIKEYBOARD_CID,
|
NS_BIDIKEYBOARD_CID,
|
||||||
"@mozilla.org/widget/bidikeyboard;1",
|
"@mozilla.org/widget/bidikeyboard;1",
|
||||||
nsBidiKeyboardConstructor },
|
nsBidiKeyboardConstructor },
|
||||||
{ "OS/2 Canvas",
|
{ "OS/2 Child Window",
|
||||||
NS_CHILD_CID,
|
NS_CHILD_CID,
|
||||||
"@mozilla.org/widget/child_window/os2;1",
|
"@mozilla.org/widget/child_window/os2;1",
|
||||||
nsCanvasConstructor },
|
nsWindowConstructor },
|
||||||
{ "OS/2 Clipboard",
|
{ "OS/2 Clipboard",
|
||||||
NS_CLIPBOARD_CID,
|
NS_CLIPBOARD_CID,
|
||||||
"@mozilla.org/widget/clipboard;1",
|
"@mozilla.org/widget/clipboard;1",
|
||||||
|
|
|
@ -2208,9 +2208,11 @@ PRBool nsWindow::ProcessMessage( ULONG msg, MPARAM mp1, MPARAM mp2, MRESULT *rc)
|
||||||
// behaviour (see nsEditorEventListeners.cpp)
|
// behaviour (see nsEditorEventListeners.cpp)
|
||||||
|
|
||||||
case WM_BUTTON1DOWN:
|
case WM_BUTTON1DOWN:
|
||||||
|
WinSetCapture( HWND_DESKTOP, mWnd);
|
||||||
result = DispatchMouseEvent( NS_MOUSE_LEFT_BUTTON_DOWN, mp1, mp2);
|
result = DispatchMouseEvent( NS_MOUSE_LEFT_BUTTON_DOWN, mp1, mp2);
|
||||||
break;
|
break;
|
||||||
case WM_BUTTON1UP:
|
case WM_BUTTON1UP:
|
||||||
|
WinSetCapture( HWND_DESKTOP, 0); // release
|
||||||
result = DispatchMouseEvent( NS_MOUSE_LEFT_BUTTON_UP, mp1, mp2);
|
result = DispatchMouseEvent( NS_MOUSE_LEFT_BUTTON_UP, mp1, mp2);
|
||||||
break;
|
break;
|
||||||
case WM_BUTTON1DBLCLK:
|
case WM_BUTTON1DBLCLK:
|
||||||
|
@ -2218,9 +2220,11 @@ PRBool nsWindow::ProcessMessage( ULONG msg, MPARAM mp1, MPARAM mp2, MRESULT *rc)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_BUTTON2DOWN:
|
case WM_BUTTON2DOWN:
|
||||||
|
WinSetCapture( HWND_DESKTOP, mWnd);
|
||||||
result = DispatchMouseEvent( NS_MOUSE_RIGHT_BUTTON_DOWN, mp1, mp2);
|
result = DispatchMouseEvent( NS_MOUSE_RIGHT_BUTTON_DOWN, mp1, mp2);
|
||||||
break;
|
break;
|
||||||
case WM_BUTTON2UP:
|
case WM_BUTTON2UP:
|
||||||
|
WinSetCapture( HWND_DESKTOP, 0); // release
|
||||||
result = DispatchMouseEvent( NS_MOUSE_RIGHT_BUTTON_UP, mp1, mp2);
|
result = DispatchMouseEvent( NS_MOUSE_RIGHT_BUTTON_UP, mp1, mp2);
|
||||||
break;
|
break;
|
||||||
case WM_BUTTON2DBLCLK:
|
case WM_BUTTON2DBLCLK:
|
||||||
|
@ -2269,7 +2273,9 @@ PRBool nsWindow::ProcessMessage( ULONG msg, MPARAM mp1, MPARAM mp2, MRESULT *rc)
|
||||||
ptlLastPos.y = (SHORT)SHORT2FROMMP(mp1);
|
ptlLastPos.y = (SHORT)SHORT2FROMMP(mp1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result = DispatchMouseEvent( NS_MOUSE_MOVE, mp1, mp2);
|
DispatchMouseEvent( NS_MOUSE_MOVE, mp1, mp2);
|
||||||
|
// don't propogate mouse move or the OS will change the pointer
|
||||||
|
result = PR_TRUE;
|
||||||
break;
|
break;
|
||||||
case WM_MOUSEENTER:
|
case WM_MOUSEENTER:
|
||||||
result = DispatchMouseEvent( NS_MOUSE_ENTER, mp1, mp2);
|
result = DispatchMouseEvent( NS_MOUSE_ENTER, mp1, mp2);
|
||||||
|
@ -3309,3 +3315,7 @@ PCSZ nsWindow::WindowClass()
|
||||||
return className;
|
return className;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ULONG nsWindow::WindowStyle()
|
||||||
|
{
|
||||||
|
return BASE_CONTROL_STYLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
|
||||||
|
}
|
||||||
|
|
|
@ -183,7 +183,7 @@ protected:
|
||||||
static nsWindow* gCurrentWindow;
|
static nsWindow* gCurrentWindow;
|
||||||
// nsWindow methods subclasses must provide for creation to work
|
// nsWindow methods subclasses must provide for creation to work
|
||||||
virtual PCSZ WindowClass();
|
virtual PCSZ WindowClass();
|
||||||
virtual ULONG WindowStyle() = 0;
|
virtual ULONG WindowStyle();
|
||||||
|
|
||||||
// hooks subclasses may wish to override!
|
// hooks subclasses may wish to override!
|
||||||
virtual void PostCreateWidget() {}
|
virtual void PostCreateWidget() {}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче