1999-06-28 23:39:35 +00:00
|
|
|
/*
|
|
|
|
* 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):
|
2000-04-03 23:30:26 +00:00
|
|
|
* 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/23/2000 IBM Corp. Added InvalidateRegion method.
|
2000-05-02 23:13:43 +00:00
|
|
|
* 04/12/2000 IBM Corp. Changed params on DispatchMouseEvent to match Windows..
|
|
|
|
* 04/14/2000 IBM Corp. Declared EventIsInsideWindow for CaptureRollupEvents
|
2000-06-22 14:00:16 +00:00
|
|
|
* 06/15/2000 IBM Corp. Added NS2PM for rectangles
|
|
|
|
* 06/21/2000 IBM Corp. Added CaptureMouse
|
1999-06-28 23:39:35 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _nswindow_h
|
|
|
|
#define _nswindow_h
|
|
|
|
|
|
|
|
#include "nsWidgetDefs.h"
|
|
|
|
#include "nsBaseWidget.h"
|
|
|
|
#include "nsToolkit.h"
|
2000-08-07 20:51:47 +00:00
|
|
|
#include "nsSwitchToUIThread.h"
|
1999-06-28 23:39:35 +00:00
|
|
|
|
2002-05-31 18:48:25 +00:00
|
|
|
//#define DEBUG_FOCUS
|
1999-06-28 23:39:35 +00:00
|
|
|
|
|
|
|
// Base widget class.
|
|
|
|
// This is abstract. Controls (labels, radio buttons, listboxen) derive
|
|
|
|
// from here. A thing called a child window derives from here, and the
|
|
|
|
// frame window class derives from the child. The content-displaying
|
|
|
|
// classes are off on their own branch to avoid creating a palette for
|
|
|
|
// every window we create. This may turn out to be what's required, in
|
|
|
|
// which case the paint & palette code from nsChildWindow needs to be
|
|
|
|
// munged in here. nsFrameWindow is separate because work needs to be done
|
|
|
|
// there to decide whether methods apply to frame or client.
|
|
|
|
|
2001-09-19 14:01:02 +00:00
|
|
|
/* Possible states of the window, used to emulate windows better... */
|
|
|
|
// default state; Create() not called
|
|
|
|
#define nsWindowState_ePrecreate 0x00000001
|
|
|
|
// processing Create() method
|
|
|
|
#define nsWindowState_eInCreate 0x00000002
|
|
|
|
// active, existing window
|
|
|
|
#define nsWindowState_eLive 0x00000004
|
|
|
|
//processing Close() method
|
|
|
|
#define nsWindowState_eClosing 0x00000008
|
|
|
|
// object destructor running
|
|
|
|
#define nsWindowState_eDoingDelete 0x00000010
|
|
|
|
// window destroyed
|
|
|
|
#define nsWindowState_eDead 0x00000100
|
|
|
|
|
|
|
|
|
1999-06-28 23:39:35 +00:00
|
|
|
class nsWindow : public nsBaseWidget,
|
2000-08-07 20:51:47 +00:00
|
|
|
public nsSwitchToUIThread
|
1999-06-28 23:39:35 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// Scaffolding
|
|
|
|
nsWindow();
|
|
|
|
virtual ~nsWindow();
|
|
|
|
|
|
|
|
// nsIWidget
|
|
|
|
|
|
|
|
// Creation from native (eh?) or widget parent, destroy
|
|
|
|
NS_IMETHOD Create( nsIWidget *aParent,
|
|
|
|
const nsRect &aRect,
|
|
|
|
EVENT_CALLBACK aHandleEventFunction,
|
|
|
|
nsIDeviceContext *aContext,
|
|
|
|
nsIAppShell *aAppShell = nsnull,
|
|
|
|
nsIToolkit *aToolkit = nsnull,
|
|
|
|
nsWidgetInitData *aInitData = nsnull);
|
|
|
|
NS_IMETHOD Create( nsNativeWidget aParent,
|
|
|
|
const nsRect &aRect,
|
|
|
|
EVENT_CALLBACK aHandleEventFunction,
|
|
|
|
nsIDeviceContext *aContext,
|
|
|
|
nsIAppShell *aAppShell = nsnull,
|
|
|
|
nsIToolkit *aToolkit = nsnull,
|
|
|
|
nsWidgetInitData *aInitData = nsnull);
|
|
|
|
NS_IMETHOD Destroy(); // call before releasing
|
|
|
|
|
|
|
|
// Hierarchy: only interested in widget children (it seems)
|
|
|
|
virtual nsIWidget *GetParent();
|
|
|
|
|
2001-05-22 21:49:16 +00:00
|
|
|
NS_IMETHOD SetSizeMode(PRInt32 aMode);
|
1999-06-28 23:39:35 +00:00
|
|
|
|
|
|
|
// Physical properties
|
|
|
|
NS_IMETHOD Show( PRBool bState);
|
2002-01-09 01:29:18 +00:00
|
|
|
NS_IMETHOD ConstrainPosition(PRBool aAllowSlop, PRInt32 *aX, PRInt32 *aY);
|
2000-04-03 23:30:26 +00:00
|
|
|
NS_IMETHOD Move( PRInt32 aX, PRInt32 aY);
|
|
|
|
NS_IMETHOD Resize( PRInt32 aWidth,
|
|
|
|
PRInt32 aHeight,
|
1999-06-28 23:39:35 +00:00
|
|
|
PRBool aRepaint);
|
2000-04-03 23:30:26 +00:00
|
|
|
NS_IMETHOD Resize( PRInt32 aX,
|
|
|
|
PRInt32 aY,
|
|
|
|
PRInt32 aWidth,
|
|
|
|
PRInt32 aHeight,
|
1999-06-28 23:39:35 +00:00
|
|
|
PRBool aRepaint);
|
|
|
|
NS_IMETHOD GetClientBounds( nsRect &aRect);
|
2002-02-28 23:10:04 +00:00
|
|
|
NS_IMETHOD Enable( PRBool aState);
|
|
|
|
NS_IMETHOD IsEnabled(PRBool *aState);
|
2001-03-19 17:56:04 +00:00
|
|
|
NS_IMETHOD SetFocus(PRBool aRaise);
|
1999-06-28 23:39:35 +00:00
|
|
|
NS_IMETHOD IsVisible( PRBool &aState);
|
2000-09-14 22:49:36 +00:00
|
|
|
NS_IMETHOD PlaceBehind(nsIWidget *aWidget, PRBool aActivate);
|
|
|
|
|
2000-06-22 14:00:16 +00:00
|
|
|
NS_IMETHOD CaptureMouse(PRBool aCapture);
|
1999-06-28 23:39:35 +00:00
|
|
|
|
1999-11-12 23:45:59 +00:00
|
|
|
NS_IMETHOD ModalEventFilter( PRBool aRealEvent, void *aEvent,
|
|
|
|
PRBool *aForWindow );
|
|
|
|
|
1999-06-28 23:39:35 +00:00
|
|
|
NS_IMETHOD GetPreferredSize( PRInt32 &aWidth, PRInt32 &aHeight);
|
|
|
|
NS_IMETHOD SetPreferredSize( PRInt32 aWidth, PRInt32 aHeight);
|
|
|
|
|
|
|
|
NS_IMETHOD BeginResizingChildren();
|
|
|
|
NS_IMETHOD EndResizingChildren();
|
|
|
|
NS_IMETHOD WidgetToScreen( const nsRect &aOldRect, nsRect &aNewRect);
|
|
|
|
NS_IMETHOD ScreenToWidget( const nsRect &aOldRect, nsRect &aNewRect);
|
|
|
|
NS_IMETHOD DispatchEvent( struct nsGUIEvent *event, nsEventStatus &aStatus);
|
2000-04-03 23:30:26 +00:00
|
|
|
NS_IMETHOD CaptureRollupEvents(nsIRollupListener * aListener, PRBool aDoCapture, PRBool aConsumeRollupEvent);
|
1999-06-28 23:39:35 +00:00
|
|
|
|
|
|
|
// Widget appearance
|
|
|
|
virtual nsIFontMetrics *GetFont();
|
|
|
|
NS_IMETHOD SetFont( const nsFont &aFont);
|
|
|
|
NS_IMETHOD SetColorMap( nsColorMap *aColorMap);
|
|
|
|
NS_IMETHOD SetCursor( nsCursor aCursor);
|
2002-03-31 04:38:11 +00:00
|
|
|
NS_IMETHOD HideWindowChrome(PRBool aShouldHide);
|
1999-06-28 23:39:35 +00:00
|
|
|
NS_IMETHOD SetTitle( const nsString& aTitle);
|
2002-05-31 18:48:25 +00:00
|
|
|
NS_IMETHOD SetMenuBar(nsIMenuBar * aMenuBar) { return NS_ERROR_FAILURE; }
|
|
|
|
NS_IMETHOD ShowMenuBar(PRBool aShow) { return NS_ERROR_FAILURE; }
|
1999-06-28 23:39:35 +00:00
|
|
|
NS_IMETHOD Invalidate( PRBool aIsSynchronous);
|
|
|
|
NS_IMETHOD Invalidate( const nsRect & aRect, PRBool aIsSynchronous);
|
2000-04-03 23:30:26 +00:00
|
|
|
NS_IMETHOD InvalidateRegion(const nsIRegion *aRegion, PRBool aIsSynchronous);
|
1999-06-28 23:39:35 +00:00
|
|
|
NS_IMETHOD Update();
|
|
|
|
NS_IMETHOD Scroll( PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect);
|
2000-09-14 22:49:36 +00:00
|
|
|
NS_IMETHOD ScrollWidgets(PRInt32 aDx, PRInt32 aDy);
|
|
|
|
NS_IMETHOD ScrollRect(nsRect &aRect, PRInt32 aDx, PRInt32 aDy);
|
1999-06-28 23:39:35 +00:00
|
|
|
|
2000-07-06 02:52:58 +00:00
|
|
|
#if 0 // Handled by XP code now
|
1999-06-28 23:39:35 +00:00
|
|
|
// Tooltips
|
|
|
|
NS_IMETHOD SetTooltips( PRUint32 aNumberOfTips, nsRect *aTooltipAreas[]);
|
|
|
|
NS_IMETHOD RemoveTooltips();
|
|
|
|
NS_IMETHOD UpdateTooltips( nsRect* aNewTips[]);
|
2000-07-06 02:52:58 +00:00
|
|
|
#endif
|
1999-06-28 23:39:35 +00:00
|
|
|
|
|
|
|
// Get a HWND or a HPS.
|
|
|
|
virtual void *GetNativeData( PRUint32 aDataType);
|
|
|
|
virtual void FreeNativeData( void *aDatum, PRUint32 aDataType);
|
2000-12-05 03:50:31 +00:00
|
|
|
virtual HWND GetMainWindow() const { return mWnd; }
|
1999-06-28 23:39:35 +00:00
|
|
|
|
|
|
|
// nsSwitchToPMThread interface
|
2000-08-07 20:51:47 +00:00
|
|
|
virtual BOOL CallMethod(MethodInfo *info);
|
1999-06-28 23:39:35 +00:00
|
|
|
|
|
|
|
// PM methods which need to be public (menus, etc)
|
|
|
|
ULONG GetNextID() { return mNextID++; }
|
|
|
|
void NS2PM_PARENT( POINTL &ptl);
|
|
|
|
void NS2PM( POINTL &ptl);
|
2000-06-20 13:24:52 +00:00
|
|
|
void NS2PM( RECTL &rcl);
|
1999-06-28 23:39:35 +00:00
|
|
|
|
2000-09-01 01:00:46 +00:00
|
|
|
protected:
|
|
|
|
static BOOL DealWithPopups ( ULONG inMsg, MRESULT* outResult ) ;
|
|
|
|
|
|
|
|
static PRBool EventIsInsideWindow(nsWindow* aWindow);
|
|
|
|
|
|
|
|
static nsWindow * GetNSWindowPtr(HWND aWnd);
|
|
|
|
static BOOL SetNSWindowPtr(HWND aWnd, nsWindow * ptr);
|
|
|
|
|
2000-05-02 23:13:43 +00:00
|
|
|
static nsWindow* gCurrentWindow;
|
1999-06-28 23:39:35 +00:00
|
|
|
// nsWindow methods subclasses must provide for creation to work
|
2001-10-19 21:57:02 +00:00
|
|
|
virtual PCSZ WindowClass();
|
1999-06-28 23:39:35 +00:00
|
|
|
virtual ULONG WindowStyle() = 0;
|
|
|
|
|
|
|
|
// hooks subclasses may wish to override!
|
|
|
|
virtual void PostCreateWidget() {}
|
|
|
|
virtual PRInt32 GetHeight( PRInt32 aHeight) { return aHeight; }
|
|
|
|
virtual PRInt32 GetClientHeight() { return mBounds.height; }
|
|
|
|
virtual ULONG GetSWPFlags( ULONG flags) { return flags; }
|
|
|
|
virtual void SetupForPrint( HWND /*hwnd*/) {}
|
|
|
|
|
|
|
|
// Useful functions for subclasses to use, threaded as necessary.
|
|
|
|
virtual nsresult GetWindowText( nsString &str, PRUint32 *rc);
|
|
|
|
virtual void AddToStyle( ULONG style);
|
|
|
|
virtual void RemoveFromStyle( ULONG style);
|
|
|
|
// return true if deferred
|
|
|
|
virtual BOOL SetWindowPos( HWND hwndInsertBehind, long x, long y,
|
|
|
|
long cx, long cy, unsigned long flags);
|
|
|
|
|
|
|
|
// Message handlers - may wish to override. Default implementation for
|
|
|
|
// palette, control, paint & scroll is to do nothing.
|
|
|
|
|
|
|
|
// Return whether message has been processed.
|
2002-06-17 20:54:08 +00:00
|
|
|
virtual PRBool ProcessMessage( ULONG m, MPARAM p1, MPARAM p2, MRESULT *r);
|
1999-06-28 23:39:35 +00:00
|
|
|
virtual PRBool OnPaint();
|
|
|
|
virtual void OnDestroy();
|
|
|
|
virtual PRBool OnReposition( PSWP pNewSwp);
|
|
|
|
virtual PRBool OnResize( PRInt32 aX, PRInt32 aY);
|
|
|
|
virtual PRBool OnMove( PRInt32 aX, PRInt32 aY);
|
|
|
|
virtual PRBool OnKey( MPARAM mp1, MPARAM mp2);
|
|
|
|
virtual PRBool OnRealizePalette();
|
2001-08-09 03:30:52 +00:00
|
|
|
virtual PRBool DispatchFocus( PRUint32 aEventType, PRBool isMozWindowTakingFocus);
|
2000-10-25 10:58:20 +00:00
|
|
|
virtual PRBool OnScroll( ULONG msgid, MPARAM mp1, MPARAM mp2);
|
|
|
|
virtual PRBool OnVScroll( MPARAM mp1, MPARAM mp2);
|
|
|
|
virtual PRBool OnHScroll( MPARAM mp1, MPARAM mp2);
|
1999-06-28 23:39:35 +00:00
|
|
|
virtual PRBool OnControl( MPARAM mp1, MPARAM mp2);
|
2000-06-16 14:18:49 +00:00
|
|
|
// virtual PRBool OnMenuClick( USHORT aCmd);
|
|
|
|
// virtual PRBool OnActivateMenu( HWND aMenu, BOOL aActivate);
|
1999-06-28 23:39:35 +00:00
|
|
|
// called after param has been set...
|
|
|
|
virtual PRBool OnPresParamChanged( MPARAM mp1, MPARAM mp2);
|
2002-06-17 20:54:08 +00:00
|
|
|
virtual PRBool OnDragOver( MPARAM mp1, MPARAM mp2, MRESULT *mr);
|
1999-06-28 23:39:35 +00:00
|
|
|
virtual PRBool OnDragLeave( MPARAM mp1, MPARAM mp2);
|
|
|
|
virtual PRBool OnDrop( MPARAM mp1, MPARAM mp2);
|
|
|
|
|
2001-10-22 20:49:50 +00:00
|
|
|
static BOOL sIsRegistered;
|
|
|
|
|
1999-06-28 23:39:35 +00:00
|
|
|
// PM data members
|
|
|
|
HWND mWnd; // window handle
|
2002-05-31 18:48:25 +00:00
|
|
|
HWND mFrameWnd; // frame window handle
|
2000-09-01 01:00:46 +00:00
|
|
|
PFNWP mPrevWndProc; // previous window procedure
|
1999-06-28 23:39:35 +00:00
|
|
|
nsWindow *mParent; // parent widget
|
|
|
|
ULONG mNextID; // next child window id
|
|
|
|
PSWP mSWPs; // SWPs for deferred window positioning
|
|
|
|
ULONG mlHave, mlUsed; // description of mSWPs array
|
|
|
|
HPOINTER mPointer; // current PM pointer
|
|
|
|
HPS mPS; // cache PS for window
|
|
|
|
ULONG mPSRefs; // number of refs to cache ps
|
|
|
|
BOOL mDragInside; // track draginside state
|
|
|
|
VDKEY mDeadKey; // dead key from previous keyevent
|
|
|
|
BOOL mHaveDeadKey; // is mDeadKey valid [0 may be a valid dead key, for all I know]
|
|
|
|
HWND mHackDestroyWnd; // access GetMainWindow() window from destructor
|
2000-04-03 23:30:26 +00:00
|
|
|
QMSG mQmsg;
|
2002-04-25 21:03:12 +00:00
|
|
|
PRBool mIsTopWidgetWindow;
|
1999-06-28 23:39:35 +00:00
|
|
|
|
|
|
|
HWND GetParentHWND() const;
|
|
|
|
HWND GetHWND() const { return mWnd; }
|
2000-09-01 01:00:46 +00:00
|
|
|
PFNWP GetPrevWP() const { return mPrevWndProc; }
|
1999-06-28 23:39:35 +00:00
|
|
|
|
|
|
|
// nglayout data members
|
|
|
|
PRInt32 mPreferredHeight;
|
|
|
|
PRInt32 mPreferredWidth;
|
|
|
|
nsToolkit *mOS2Toolkit;
|
|
|
|
nsFont *mFont;
|
|
|
|
nsIMenuBar *mMenuBar;
|
2001-09-19 14:01:02 +00:00
|
|
|
PRInt32 mWindowState;
|
1999-06-28 23:39:35 +00:00
|
|
|
|
|
|
|
// Implementation ------------------------------
|
|
|
|
void DoCreate( HWND hwndP, nsWindow *wndP, const nsRect &rect,
|
|
|
|
EVENT_CALLBACK aHandleEventFunction,
|
|
|
|
nsIDeviceContext *aContext, nsIAppShell *aAppShell,
|
|
|
|
nsIToolkit *aToolkit, nsWidgetInitData *aInitData);
|
|
|
|
|
|
|
|
virtual void RealDoCreate( HWND hwndP, nsWindow *aParent,
|
|
|
|
const nsRect &aRect,
|
|
|
|
EVENT_CALLBACK aHandleEventFunction,
|
|
|
|
nsIDeviceContext *aContext,
|
|
|
|
nsIAppShell *aAppShell,
|
|
|
|
nsWidgetInitData *aInitData,
|
|
|
|
HWND hwndOwner = 0);
|
|
|
|
|
2000-09-01 01:00:46 +00:00
|
|
|
virtual void SubclassWindow(BOOL bState);
|
1999-06-28 23:39:35 +00:00
|
|
|
|
|
|
|
PRBool ConvertStatus( nsEventStatus aStatus);
|
|
|
|
void InitEvent( nsGUIEvent &event, PRUint32 aEventType, nsPoint *pt = 0);
|
2000-09-18 20:39:13 +00:00
|
|
|
virtual PRBool DispatchWindowEvent(nsGUIEvent* event);
|
|
|
|
virtual PRBool DispatchWindowEvent(nsGUIEvent*event, nsEventStatus &aStatus);
|
1999-06-28 23:39:35 +00:00
|
|
|
PRBool DispatchStandardEvent( PRUint32 aMsg, PRUint8 aStructType = NS_GUI_EVENT);
|
2000-05-02 23:13:43 +00:00
|
|
|
virtual PRBool DispatchMouseEvent( PRUint32 aEventType, MPARAM mp1, MPARAM mp2);
|
1999-06-28 23:39:35 +00:00
|
|
|
virtual PRBool DispatchResizeEvent( PRInt32 aClientX, PRInt32 aClientY);
|
|
|
|
void DeferPosition( HWND, HWND, long, long, long, long, ULONG);
|
|
|
|
|
2002-04-24 04:15:37 +00:00
|
|
|
void ConstrainZLevel(HWND *aAfter);
|
|
|
|
|
1999-06-28 23:39:35 +00:00
|
|
|
// Enumeration of the methods which are accessable on the PM thread
|
|
|
|
enum {
|
2000-09-18 20:39:13 +00:00
|
|
|
CREATE,
|
|
|
|
DESTROY,
|
|
|
|
SET_FOCUS,
|
|
|
|
UPDATE_WINDOW,
|
|
|
|
SET_TITLE,
|
|
|
|
GET_TITLE
|
1999-06-28 23:39:35 +00:00
|
|
|
};
|
|
|
|
friend MRESULT EXPENTRY fnwpNSWindow( HWND, ULONG, MPARAM, MPARAM);
|
|
|
|
friend MRESULT EXPENTRY fnwpFrame( HWND, ULONG, MPARAM, MPARAM);
|
2002-05-31 18:48:25 +00:00
|
|
|
#ifdef DEBUG_FOCUS
|
|
|
|
int mWindowIdentifier;
|
|
|
|
#endif
|
1999-06-28 23:39:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#define PM2NS_PARENT NS2PM_PARENT
|
|
|
|
#define PM2NS NS2PM
|
|
|
|
|
2000-10-16 22:30:06 +00:00
|
|
|
#define PMSCAN_PAD7 0x47
|
|
|
|
#define PMSCAN_PAD8 0x48
|
|
|
|
#define PMSCAN_PAD9 0x49
|
|
|
|
#define PMSCAN_PADMINUS 0x4A
|
|
|
|
#define PMSCAN_PAD4 0x4B
|
|
|
|
#define PMSCAN_PAD5 0x4C
|
|
|
|
#define PMSCAN_PAD6 0x4D
|
|
|
|
#define PMSCAN_PADPLUS 0x4E
|
|
|
|
#define PMSCAN_PAD1 0x4F
|
|
|
|
#define PMSCAN_PAD2 0x50
|
|
|
|
#define PMSCAN_PAD3 0x51
|
|
|
|
#define PMSCAN_PAD0 0x52
|
2000-10-26 18:40:24 +00:00
|
|
|
#define PMSCAN_PADPERIOD 0x53
|
2000-10-16 22:30:06 +00:00
|
|
|
|
|
|
|
#define isNumPadScanCode(scanCode) !( (scanCode < PMSCAN_PAD7) || \
|
2000-10-26 18:40:24 +00:00
|
|
|
(scanCode > PMSCAN_PADPERIOD) || \
|
2000-10-16 22:30:06 +00:00
|
|
|
(scanCode == PMSCAN_PADMINUS) || \
|
|
|
|
(scanCode == PMSCAN_PADPLUS) )
|
|
|
|
|
1999-06-28 23:39:35 +00:00
|
|
|
extern PRUint32 WMChar2KeyCode( MPARAM mp1, MPARAM mp2);
|
|
|
|
|
|
|
|
extern nsWindow *NS_HWNDToWindow( HWND hwnd);
|
|
|
|
|
|
|
|
#define NSCANVASCLASS "WarpzillaCanvas"
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
|
|
|
// Need to do this because the cross-platform widgets (toolbars) assume
|
|
|
|
// that the name of the NS_CHILD_CID is ChildWindow and that it gets
|
|
|
|
// defined in "nsWindow.h".
|
|
|
|
//
|
|
|
|
// However, if we've included this header *from nsCanvas.h*, then we
|
|
|
|
// get a lovely circular dependency, and so special-case this.
|
|
|
|
//
|
|
|
|
// Yes, I suppose I'm just being perverse by having three separate classes
|
|
|
|
// here, but I just baulk at naming a class 'ChildWindow'.
|
|
|
|
//
|
|
|
|
// (and don't tell me there's a JLib class called JMother. Believe me,
|
|
|
|
// I know, and I regret it at least twice a week...)
|
|
|
|
//
|
|
|
|
#ifndef _nscanvas_h
|
|
|
|
#include "nsCanvas.h"
|
|
|
|
typedef nsCanvas ChildWindow;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|