зеркало из https://github.com/mozilla/gecko-dev.git
Landing framesets changes. Added mVisRegion, mResizingChildren and mSaveVisible. Approved: choffmann. Bug #2236 et al.
This commit is contained in:
Родитель
d115fcf23c
Коммит
e8d613aa03
|
@ -42,7 +42,6 @@ struct nsPluginPort;
|
||||||
// nsWindow
|
// nsWindow
|
||||||
//
|
//
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
// Generic object
|
|
||||||
|
|
||||||
class nsWindow : public nsBaseWidget, public nsDeleteObserved
|
class nsWindow : public nsBaseWidget, public nsDeleteObserved
|
||||||
{
|
{
|
||||||
|
@ -83,7 +82,7 @@ public:
|
||||||
virtual nsIWidget* GetParent(void);
|
virtual nsIWidget* GetParent(void);
|
||||||
|
|
||||||
NS_IMETHOD Show(PRBool aState);
|
NS_IMETHOD Show(PRBool aState);
|
||||||
NS_IMETHOD IsVisible(PRBool & aState);
|
NS_IMETHOD IsVisible(PRBool & aState);
|
||||||
|
|
||||||
NS_IMETHOD Move(PRUint32 aX, PRUint32 aY);
|
NS_IMETHOD Move(PRUint32 aX, PRUint32 aY);
|
||||||
NS_IMETHOD Resize(PRUint32 aWidth,PRUint32 aHeight, PRBool aRepaint);
|
NS_IMETHOD Resize(PRUint32 aWidth,PRUint32 aHeight, PRBool aRepaint);
|
||||||
|
@ -96,7 +95,7 @@ public:
|
||||||
virtual nsIFontMetrics* GetFont(void);
|
virtual nsIFontMetrics* GetFont(void);
|
||||||
NS_IMETHOD SetFont(const nsFont &aFont);
|
NS_IMETHOD SetFont(const nsFont &aFont);
|
||||||
NS_IMETHOD Invalidate(PRBool aIsSynchronous);
|
NS_IMETHOD Invalidate(PRBool aIsSynchronous);
|
||||||
NS_IMETHOD Invalidate(const nsRect &aRect,PRBool aIsSynchronous);
|
NS_IMETHOD Invalidate(const nsRect &aRect,PRBool aIsSynchronous);
|
||||||
|
|
||||||
virtual void* GetNativeData(PRUint32 aDataType);
|
virtual void* GetNativeData(PRUint32 aDataType);
|
||||||
NS_IMETHOD SetColorMap(nsColorMap *aColorMap);
|
NS_IMETHOD SetColorMap(nsColorMap *aColorMap);
|
||||||
|
@ -107,88 +106,87 @@ public:
|
||||||
NS_IMETHOD EndResizingChildren(void);
|
NS_IMETHOD EndResizingChildren(void);
|
||||||
|
|
||||||
static PRBool ConvertStatus(nsEventStatus aStatus);
|
static PRBool ConvertStatus(nsEventStatus aStatus);
|
||||||
NS_IMETHOD DispatchEvent(nsGUIEvent* event, nsEventStatus & aStatus);
|
NS_IMETHOD DispatchEvent(nsGUIEvent* event, nsEventStatus & aStatus);
|
||||||
virtual PRBool DispatchMouseEvent(nsMouseEvent &aEvent);
|
virtual PRBool DispatchMouseEvent(nsMouseEvent &aEvent);
|
||||||
|
|
||||||
virtual void StartDraw(nsIRenderingContext* aRenderingContext = nsnull);
|
virtual void StartDraw(nsIRenderingContext* aRenderingContext = nsnull);
|
||||||
virtual void EndDraw();
|
virtual void EndDraw();
|
||||||
virtual PRBool OnPaint(nsPaintEvent &event);
|
virtual PRBool OnPaint(nsPaintEvent &event);
|
||||||
NS_IMETHOD Update();
|
NS_IMETHOD Update();
|
||||||
virtual void UpdateWidget(nsRect& aRect, nsIRenderingContext* aContext);
|
virtual void UpdateWidget(nsRect& aRect, nsIRenderingContext* aContext);
|
||||||
|
|
||||||
virtual void ConvertToDeviceCoordinates(nscoord &aX, nscoord &aY);
|
virtual void ConvertToDeviceCoordinates(nscoord &aX, nscoord &aY);
|
||||||
virtual void LocalToWindowCoordinate(nsPoint& aPoint);
|
void LocalToWindowCoordinate(nsPoint& aPoint) {ConvertToDeviceCoordinates(aPoint.x, aPoint.y);}
|
||||||
virtual void LocalToWindowCoordinate(nscoord& aX, nscoord& aY);
|
void LocalToWindowCoordinate(nscoord& aX, nscoord& aY) {ConvertToDeviceCoordinates(aX, aY);}
|
||||||
virtual void LocalToWindowCoordinate(nsRect& aRect);
|
void LocalToWindowCoordinate(nsRect& aRect) {ConvertToDeviceCoordinates(aRect.x, aRect.y);}
|
||||||
|
|
||||||
virtual void ConvertToLocalCoordinates(nscoord &aX, nscoord &aY);
|
|
||||||
virtual void WindowToLocalCoordinate(nsPoint& aPoint);
|
|
||||||
virtual void WindowToLocalCoordinate(nscoord& aX, nscoord& aY);
|
|
||||||
virtual void WindowToLocalCoordinate(nsRect& aRect);
|
|
||||||
|
|
||||||
NS_IMETHOD SetMenuBar(nsIMenuBar * aMenuBar);
|
NS_IMETHOD SetMenuBar(nsIMenuBar * aMenuBar);
|
||||||
virtual nsIMenuBar* GetMenuBar();
|
virtual nsIMenuBar* GetMenuBar();
|
||||||
NS_IMETHOD GetPreferredSize(PRInt32& aWidth, PRInt32& aHeight);
|
NS_IMETHOD GetPreferredSize(PRInt32& aWidth, PRInt32& aHeight);
|
||||||
NS_IMETHOD SetPreferredSize(PRInt32 aWidth, PRInt32 aHeight);
|
NS_IMETHOD SetPreferredSize(PRInt32 aWidth, PRInt32 aHeight);
|
||||||
|
|
||||||
NS_IMETHOD SetCursor(nsCursor aCursor);
|
NS_IMETHOD SetCursor(nsCursor aCursor);
|
||||||
|
|
||||||
// Mac specific methods
|
// Mac specific methods
|
||||||
void nsRectToMacRect(const nsRect& aRect, Rect& aMacRect) const;
|
void nsRectToMacRect(const nsRect& aRect, Rect& aMacRect) const;
|
||||||
void DoPaintWidgets(RgnHandle aTheRegion,nsIRenderingContext *aRC);
|
PRBool RgnIntersects(RgnHandle aTheRegion,RgnHandle aIntersectRgn);
|
||||||
PRBool RgnIntersects(RgnHandle aTheRegion,RgnHandle aIntersectRgn);
|
virtual void CalcWindowRegions();
|
||||||
|
|
||||||
void StringToStr255(const nsString& aText, Str255& aStr255);
|
virtual PRBool PointInWidget(Point aThePoint);
|
||||||
void Str255ToString(const Str255& aStr255, nsString& aText);
|
virtual nsWindow* FindWidgetHit(Point aThePoint);
|
||||||
|
|
||||||
virtual PRBool PointInWidget(Point aThePoint);
|
virtual PRBool DispatchWindowEvent(nsGUIEvent& event);
|
||||||
virtual nsWindow* FindWidgetHit(Point aThePoint);
|
virtual nsresult HandleUpdateEvent();
|
||||||
|
|
||||||
char gInstanceClassName[256];
|
|
||||||
|
|
||||||
virtual PRBool DispatchWindowEvent(nsGUIEvent& event);
|
|
||||||
virtual nsresult HandleUpdateEvent();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
PRBool ReportDestroyEvent();
|
PRBool ReportDestroyEvent();
|
||||||
PRBool ReportMoveEvent();
|
PRBool ReportMoveEvent();
|
||||||
PRBool ReportSizeEvent();
|
PRBool ReportSizeEvent();
|
||||||
|
|
||||||
NS_IMETHOD CalcOffset(PRInt32 &aX,PRInt32 &aY);
|
NS_IMETHOD CalcOffset(PRInt32 &aX,PRInt32 &aY);
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
char gInstanceClassName[256];
|
||||||
|
|
||||||
nsIWidget* mParent;
|
nsIWidget* mParent;
|
||||||
|
PRBool mResizingChildren;
|
||||||
|
PRBool mSaveVisible;
|
||||||
PRBool mVisible;
|
PRBool mVisible;
|
||||||
PRBool mEnabled;
|
PRBool mEnabled;
|
||||||
PRInt32 mPreferredWidth;
|
PRInt32 mPreferredWidth;
|
||||||
PRInt32 mPreferredHeight;
|
PRInt32 mPreferredHeight;
|
||||||
nsIFontMetrics* mFontMetrics;
|
nsIFontMetrics* mFontMetrics;
|
||||||
nsIMenuBar* mMenuBar;
|
nsIMenuBar* mMenuBar;
|
||||||
RgnHandle mWindowRegion; // the region defining this window
|
|
||||||
WindowPtr mWindowPtr;
|
|
||||||
PRBool mDestroyCalled;
|
|
||||||
PRBool mDestructorCalled;
|
|
||||||
|
|
||||||
PRBool mDrawing;
|
RgnHandle mWindowRegion;
|
||||||
|
RgnHandle mVisRegion;
|
||||||
|
WindowPtr mWindowPtr;
|
||||||
|
|
||||||
|
PRBool mDestroyCalled;
|
||||||
|
PRBool mDestructorCalled;
|
||||||
|
|
||||||
|
PRBool mDrawing;
|
||||||
nsIRenderingContext* mTempRenderingContext;
|
nsIRenderingContext* mTempRenderingContext;
|
||||||
PRBool mTempRenderingContextMadeHere;
|
PRBool mTempRenderingContextMadeHere;
|
||||||
|
|
||||||
nsPluginPort* mPluginPort;
|
nsPluginPort* mPluginPort;
|
||||||
};
|
};
|
||||||
|
|
||||||
// =============================================================================
|
//-------------------------------------------------------------------------
|
||||||
class ChildWindow : public nsWindow {
|
//
|
||||||
|
// nsChildWindow
|
||||||
|
//
|
||||||
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
public:
|
// Some XP Widgets (like the nsImageButton) include this header file
|
||||||
NS_IMETHOD_(nsrefcnt) AddRef();
|
// and expect to find in it the definition of a "ChildWindow".
|
||||||
NS_IMETHOD_(nsrefcnt) Release();
|
|
||||||
|
|
||||||
ChildWindow();
|
#include "nsChildWindow.h"
|
||||||
virtual ~ChildWindow() {};
|
|
||||||
|
#define ChildWindow nsChildWindow
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif // Window_h__
|
#endif // Window_h__
|
||||||
|
|
Загрузка…
Ссылка в новой задаче