r=jeffreyj@us.ibm.com, sr=blizzard
OS/2 only - remove unnecessary class nsCanvas
This commit is contained in:
mkaply%us.ibm.com 2002-06-17 21:06:09 +00:00
Родитель fb0d67af5b
Коммит c2e045538d
6 изменённых файлов: 16 добавлений и 138 удалений

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

@ -49,7 +49,6 @@ endif
CPPSRCS = \
nsAppShell.cpp \
nsBidiKeyboard.cpp \
nsCanvas.cpp \
nsClipboard.cpp \
nsFilePicker.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
#include "nsAppShell.h"
#include "nsBidiKeyboard.h"
#include "nsCanvas.h"
#include "nsWindow.h"
#include "nsDragService.h"
#include "nsILocalFile.h"
#include "nsFilePicker.h"
@ -68,7 +68,7 @@
// objects that just require generic constructors
NS_GENERIC_FACTORY_CONSTRUCTOR(nsBidiKeyboard)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsCanvas)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindow)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboard)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboardHelper)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFilePicker)
@ -227,10 +227,10 @@ static const nsModuleComponentInfo components[] =
NS_BIDIKEYBOARD_CID,
"@mozilla.org/widget/bidikeyboard;1",
nsBidiKeyboardConstructor },
{ "OS/2 Canvas",
{ "OS/2 Child Window",
NS_CHILD_CID,
"@mozilla.org/widget/child_window/os2;1",
nsCanvasConstructor },
nsWindowConstructor },
{ "OS/2 Clipboard",
NS_CLIPBOARD_CID,
"@mozilla.org/widget/clipboard;1",

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

@ -2208,9 +2208,11 @@ PRBool nsWindow::ProcessMessage( ULONG msg, MPARAM mp1, MPARAM mp2, MRESULT *rc)
// behaviour (see nsEditorEventListeners.cpp)
case WM_BUTTON1DOWN:
WinSetCapture( HWND_DESKTOP, mWnd);
result = DispatchMouseEvent( NS_MOUSE_LEFT_BUTTON_DOWN, mp1, mp2);
break;
case WM_BUTTON1UP:
WinSetCapture( HWND_DESKTOP, 0); // release
result = DispatchMouseEvent( NS_MOUSE_LEFT_BUTTON_UP, mp1, mp2);
break;
case WM_BUTTON1DBLCLK:
@ -2218,9 +2220,11 @@ PRBool nsWindow::ProcessMessage( ULONG msg, MPARAM mp1, MPARAM mp2, MRESULT *rc)
break;
case WM_BUTTON2DOWN:
WinSetCapture( HWND_DESKTOP, mWnd);
result = DispatchMouseEvent( NS_MOUSE_RIGHT_BUTTON_DOWN, mp1, mp2);
break;
case WM_BUTTON2UP:
WinSetCapture( HWND_DESKTOP, 0); // release
result = DispatchMouseEvent( NS_MOUSE_RIGHT_BUTTON_UP, mp1, mp2);
break;
case WM_BUTTON2DBLCLK:
@ -2269,7 +2273,9 @@ PRBool nsWindow::ProcessMessage( ULONG msg, MPARAM mp1, MPARAM mp2, MRESULT *rc)
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;
case WM_MOUSEENTER:
result = DispatchMouseEvent( NS_MOUSE_ENTER, mp1, mp2);
@ -3309,3 +3315,7 @@ PCSZ nsWindow::WindowClass()
return className;
}
ULONG nsWindow::WindowStyle()
{
return BASE_CONTROL_STYLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
}

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

@ -183,7 +183,7 @@ protected:
static nsWindow* gCurrentWindow;
// nsWindow methods subclasses must provide for creation to work
virtual PCSZ WindowClass();
virtual ULONG WindowStyle() = 0;
virtual ULONG WindowStyle();
// hooks subclasses may wish to override!
virtual void PostCreateWidget() {}