зеркало из https://github.com/mozilla/pjs.git
Changed nsIViewManager interface to conform to XPCOM conventions
This commit is contained in:
Родитель
b421ad3aca
Коммит
a72700df68
|
@ -916,7 +916,8 @@ HTMLContentSink::CloseContainer(const nsIParserNode& aNode)
|
|||
if (nsnull != shell) {
|
||||
nsIViewManager* vm = shell->GetViewManager();
|
||||
if(vm) {
|
||||
nsIView* rootView = vm->GetRootView();
|
||||
nsIView* rootView;
|
||||
vm->GetRootView(rootView);
|
||||
nsRect rect;
|
||||
rootView->GetBounds(rect);
|
||||
rect.x = 0;
|
||||
|
@ -1115,7 +1116,8 @@ HTMLContentSink::StartLayout()
|
|||
if (nsnull != shell) {
|
||||
nsIViewManager* vm = shell->GetViewManager();
|
||||
if (nsnull != vm) {
|
||||
nsIView* rootView = vm->GetRootView();
|
||||
nsIView* rootView;
|
||||
vm->GetRootView(rootView);
|
||||
if (nsnull != rootView) {
|
||||
nsIScrollableView* sview = nsnull;
|
||||
rootView->QueryInterface(kIScrollableViewIID, (void**) &sview);
|
||||
|
@ -1158,7 +1160,8 @@ HTMLContentSink::ScrollToRef()
|
|||
if (nsnull != frame) {
|
||||
nsIViewManager* vm = shell->GetViewManager();
|
||||
if (nsnull != vm) {
|
||||
nsIView* rootView = vm->GetRootView();
|
||||
nsIView* rootView;
|
||||
vm->GetRootView(rootView);
|
||||
if (nsnull != rootView) {
|
||||
nsIScrollableView* sview = nsnull;
|
||||
rootView->QueryInterface(kIScrollableViewIID, (void**) &sview);
|
||||
|
|
|
@ -474,7 +474,8 @@ PresShell::ResizeReflow(nscoord aWidth, nscoord aHeight)
|
|||
reflowReason = eReflowReason_Initial;
|
||||
|
||||
// Bind root frame to root view (and root window)
|
||||
nsIView* rootView = mViewManager->GetRootView();
|
||||
nsIView* rootView;
|
||||
mViewManager->GetRootView(rootView);
|
||||
mRootFrame->SetView(rootView);
|
||||
}
|
||||
NS_RELEASE(root);
|
||||
|
@ -1076,7 +1077,8 @@ PresShell::VerifyIncrementalReflow()
|
|||
|
||||
// Get our scrolling preference
|
||||
nsScrollPreference scrolling;
|
||||
nsIView* rootView = mViewManager->GetRootView();
|
||||
nsIView* rootView;
|
||||
mViewManager->GetRootView(rootView);
|
||||
nsIScrollableView* scrollView;
|
||||
rv = rootView->QueryInterface(kScrollViewIID, (void**)&scrollView);
|
||||
if (NS_OK == rv) {
|
||||
|
|
|
@ -916,7 +916,8 @@ HTMLContentSink::CloseContainer(const nsIParserNode& aNode)
|
|||
if (nsnull != shell) {
|
||||
nsIViewManager* vm = shell->GetViewManager();
|
||||
if(vm) {
|
||||
nsIView* rootView = vm->GetRootView();
|
||||
nsIView* rootView;
|
||||
vm->GetRootView(rootView);
|
||||
nsRect rect;
|
||||
rootView->GetBounds(rect);
|
||||
rect.x = 0;
|
||||
|
@ -1115,7 +1116,8 @@ HTMLContentSink::StartLayout()
|
|||
if (nsnull != shell) {
|
||||
nsIViewManager* vm = shell->GetViewManager();
|
||||
if (nsnull != vm) {
|
||||
nsIView* rootView = vm->GetRootView();
|
||||
nsIView* rootView;
|
||||
vm->GetRootView(rootView);
|
||||
if (nsnull != rootView) {
|
||||
nsIScrollableView* sview = nsnull;
|
||||
rootView->QueryInterface(kIScrollableViewIID, (void**) &sview);
|
||||
|
@ -1158,7 +1160,8 @@ HTMLContentSink::ScrollToRef()
|
|||
if (nsnull != frame) {
|
||||
nsIViewManager* vm = shell->GetViewManager();
|
||||
if (nsnull != vm) {
|
||||
nsIView* rootView = vm->GetRootView();
|
||||
nsIView* rootView;
|
||||
vm->GetRootView(rootView);
|
||||
if (nsnull != rootView) {
|
||||
nsIScrollableView* sview = nsnull;
|
||||
rootView->QueryInterface(kIScrollableViewIID, (void**) &sview);
|
||||
|
|
|
@ -52,19 +52,19 @@ public:
|
|||
* @param aContext the device context to use.
|
||||
* @result The result of the initialization, NS_OK if no errors
|
||||
*/
|
||||
virtual nsresult Init(nsIDeviceContext* aContext) = 0;
|
||||
NS_IMETHOD Init(nsIDeviceContext* aContext) = 0;
|
||||
|
||||
/**
|
||||
* Get the root of the view tree.
|
||||
* @result the root view
|
||||
*/
|
||||
virtual nsIView *GetRootView() = 0;
|
||||
NS_IMETHOD GetRootView(nsIView *&aView) = 0;
|
||||
|
||||
/**
|
||||
* Set the root of the view tree. Does not destroy the current root view.
|
||||
* @param aView view to set as root
|
||||
*/
|
||||
virtual void SetRootView(nsIView *aView) = 0;
|
||||
NS_IMETHOD SetRootView(nsIView *aView) = 0;
|
||||
|
||||
/**
|
||||
* Get the current framerate i.e. the rate at which timed
|
||||
|
@ -72,7 +72,7 @@ public:
|
|||
* should not occur. framerate is in terms of frames per second
|
||||
* @result the update rate in terms of frames per second
|
||||
*/
|
||||
virtual PRUint32 GetFrameRate() = 0;
|
||||
NS_IMETHOD GetFrameRate(PRUint32& aRate) = 0;
|
||||
|
||||
/**
|
||||
* Set the current framerate.
|
||||
|
@ -80,7 +80,7 @@ public:
|
|||
* @result the call may need to create a timer and the success
|
||||
* status will be returned. NS_OK means all is well
|
||||
*/
|
||||
virtual nsresult SetFrameRate(PRUint32 frameRate) = 0;
|
||||
NS_IMETHOD SetFrameRate(PRUint32 frameRate) = 0;
|
||||
|
||||
/**
|
||||
* Get the dimensions of the root window. The dimensions are in
|
||||
|
@ -88,7 +88,7 @@ public:
|
|||
* @param width out parameter for width of window in twips
|
||||
* @param height out parameter for height of window in twips
|
||||
*/
|
||||
virtual void GetWindowDimensions(nscoord *width, nscoord *height) = 0;
|
||||
NS_IMETHOD GetWindowDimensions(nscoord *width, nscoord *height) = 0;
|
||||
|
||||
/**
|
||||
* Set the dimensions of the root window.
|
||||
|
@ -97,7 +97,7 @@ public:
|
|||
* @param width of window in twips
|
||||
* @param height of window in twips
|
||||
*/
|
||||
virtual void SetWindowDimensions(nscoord width, nscoord height) = 0;
|
||||
NS_IMETHOD SetWindowDimensions(nscoord width, nscoord height) = 0;
|
||||
|
||||
/**
|
||||
* Get the position of the root window relative to the
|
||||
|
@ -106,7 +106,7 @@ public:
|
|||
* @param xoffset out parameter for X scroll position of window in twips
|
||||
* @param yoffset out parameter for Y scroll position of window in twips
|
||||
*/
|
||||
virtual void GetWindowOffsets(nscoord *xoffset, nscoord *yoffset) = 0;
|
||||
NS_IMETHOD GetWindowOffsets(nscoord *xoffset, nscoord *yoffset) = 0;
|
||||
|
||||
/**
|
||||
* Set the position of the root window relative to the
|
||||
|
@ -115,17 +115,17 @@ public:
|
|||
* @param xoffset X scroll position of window in twips
|
||||
* @param yoffset Y scroll position of window in twips
|
||||
*/
|
||||
virtual void SetWindowOffsets(nscoord xoffset, nscoord yoffset) = 0;
|
||||
NS_IMETHOD SetWindowOffsets(nscoord xoffset, nscoord yoffset) = 0;
|
||||
|
||||
/**
|
||||
* Reset the state of scrollbars and the scrolling region
|
||||
*/
|
||||
virtual void ResetScrolling(void) = 0;
|
||||
NS_IMETHOD ResetScrolling(void) = 0;
|
||||
|
||||
/**
|
||||
* Called to force a redrawing of any dirty areas.
|
||||
*/
|
||||
virtual void Composite() = 0;
|
||||
NS_IMETHOD Composite(void) = 0;
|
||||
|
||||
/**
|
||||
* Called to inform the view manager that some portion of a view
|
||||
|
@ -136,8 +136,8 @@ public:
|
|||
* view is marked as damaged
|
||||
* @param aUpdateFlags see bottom of nsIViewManager.h for description
|
||||
*/
|
||||
virtual void UpdateView(nsIView *aView, nsIRegion *aRegion,
|
||||
PRUint32 aUpdateFlags) = 0;
|
||||
NS_IMETHOD UpdateView(nsIView *aView, nsIRegion *aRegion,
|
||||
PRUint32 aUpdateFlags) = 0;
|
||||
|
||||
/**
|
||||
* Called to inform the view manager that some portion of a view
|
||||
|
@ -147,7 +147,7 @@ public:
|
|||
* @param rect rect to mark as damaged
|
||||
* @param aUpdateFlags see bottom of nsIViewManager.h for description
|
||||
*/
|
||||
virtual void UpdateView(nsIView *aView, const nsRect &aRect, PRUint32 aUpdateFlags) = 0;
|
||||
NS_IMETHOD UpdateView(nsIView *aView, const nsRect &aRect, PRUint32 aUpdateFlags) = 0;
|
||||
|
||||
/**
|
||||
* Called to dispatch an event to the appropriate view. Often called
|
||||
|
@ -156,7 +156,7 @@ public:
|
|||
* @param event event to dispatch
|
||||
* @result event handling status
|
||||
*/
|
||||
virtual nsEventStatus DispatchEvent(nsGUIEvent *aEvent) = 0;
|
||||
NS_IMETHOD DispatchEvent(nsGUIEvent *aEvent, nsEventStatus& aStatus) = 0;
|
||||
|
||||
/**
|
||||
* Used to grab/capture all mouse events for a specific view,
|
||||
|
@ -165,7 +165,7 @@ public:
|
|||
* @param aView view to capture mouse events
|
||||
* @result event handling status
|
||||
*/
|
||||
virtual PRBool GrabMouseEvents(nsIView *aView) = 0;
|
||||
NS_IMETHOD GrabMouseEvents(nsIView *aView, PRBool& aResult) = 0;
|
||||
|
||||
/**
|
||||
* Used to grab/capture all keyboard events for a specific view,
|
||||
|
@ -174,19 +174,19 @@ public:
|
|||
* @param aView view to capture keyboard events
|
||||
* @result event handling status
|
||||
*/
|
||||
virtual PRBool GrabKeyEvents(nsIView *aView) = 0;
|
||||
NS_IMETHOD GrabKeyEvents(nsIView *aView, PRBool& aResult) = 0;
|
||||
|
||||
/**
|
||||
* Get the current view, if any, that's capturing mouse events.
|
||||
* @result view that is capturing mouse events or nsnull
|
||||
*/
|
||||
virtual nsIView* GetMouseEventGrabber() = 0;
|
||||
NS_IMETHOD GetMouseEventGrabber(nsIView *&aView) = 0;
|
||||
|
||||
/**
|
||||
* Get the current view, if any, that's capturing keyboard events.
|
||||
* @result view that is capturing keyboard events or nsnull
|
||||
*/
|
||||
virtual nsIView* GetKeyEventGrabber() = 0;
|
||||
NS_IMETHOD GetKeyEventGrabber(nsIView *&aView) = 0;
|
||||
|
||||
/**
|
||||
* Given a parent view, insert another view as its child. If above
|
||||
|
@ -198,8 +198,8 @@ public:
|
|||
* @param sibling sibling view
|
||||
* @param above boolean above or below state
|
||||
*/
|
||||
virtual void InsertChild(nsIView *parent, nsIView *child, nsIView *sibling,
|
||||
PRBool above) = 0;
|
||||
NS_IMETHOD InsertChild(nsIView *parent, nsIView *child, nsIView *sibling,
|
||||
PRBool above) = 0;
|
||||
|
||||
/**
|
||||
* Given a parent view, insert another view as its child. The zindex
|
||||
|
@ -210,8 +210,8 @@ public:
|
|||
* @param child child view
|
||||
* @param zindex z depth of child
|
||||
*/
|
||||
virtual void InsertChild(nsIView *parent, nsIView *child,
|
||||
PRInt32 zindex) = 0;
|
||||
NS_IMETHOD InsertChild(nsIView *parent, nsIView *child,
|
||||
PRInt32 zindex) = 0;
|
||||
|
||||
/**
|
||||
* Remove a specific child of a view.
|
||||
|
@ -219,7 +219,7 @@ public:
|
|||
* @param parent parent view
|
||||
* @param child child view
|
||||
*/
|
||||
virtual void RemoveChild(nsIView *parent, nsIView *child) = 0;
|
||||
NS_IMETHOD RemoveChild(nsIView *parent, nsIView *child) = 0;
|
||||
|
||||
/**
|
||||
* Move a view's position by the specified amount.
|
||||
|
@ -228,7 +228,7 @@ public:
|
|||
* @param x x offset to add to current view position
|
||||
* @param y y offset to add to current view position
|
||||
*/
|
||||
virtual void MoveViewBy(nsIView *aView, nscoord x, nscoord y) = 0;
|
||||
NS_IMETHOD MoveViewBy(nsIView *aView, nscoord x, nscoord y) = 0;
|
||||
|
||||
/**
|
||||
* Move a view to the specified position,
|
||||
|
@ -238,7 +238,7 @@ public:
|
|||
* @param x x value for new view position
|
||||
* @param y y value for new view position
|
||||
*/
|
||||
virtual void MoveViewTo(nsIView *aView, nscoord x, nscoord y) = 0;
|
||||
NS_IMETHOD MoveViewTo(nsIView *aView, nscoord x, nscoord y) = 0;
|
||||
|
||||
/**
|
||||
* Resize a view to the specified width and height.
|
||||
|
@ -247,7 +247,7 @@ public:
|
|||
* @param width new view width
|
||||
* @param height new view height
|
||||
*/
|
||||
virtual void ResizeView(nsIView *aView, nscoord width, nscoord height) = 0;
|
||||
NS_IMETHOD ResizeView(nsIView *aView, nscoord width, nscoord height) = 0;
|
||||
|
||||
/**
|
||||
* Set the clip of a view.
|
||||
|
@ -255,7 +255,7 @@ public:
|
|||
* @param aView view to to clip rect on
|
||||
* @param rect new clipping rect for view
|
||||
*/
|
||||
virtual void SetViewClip(nsIView *aView, nsRect *rect) = 0;
|
||||
NS_IMETHOD SetViewClip(nsIView *aView, nsRect *rect) = 0;
|
||||
|
||||
/**
|
||||
* Set the visibility of a view.
|
||||
|
@ -263,7 +263,7 @@ public:
|
|||
* @param aView view to change visibility state of
|
||||
* @param visible new visibility state
|
||||
*/
|
||||
virtual void SetViewVisibility(nsIView *aView, nsViewVisibility visible) = 0;
|
||||
NS_IMETHOD SetViewVisibility(nsIView *aView, nsViewVisibility visible) = 0;
|
||||
|
||||
/**
|
||||
* Set the z-index of a view. Positive z-indices mean that a view
|
||||
|
@ -273,7 +273,7 @@ public:
|
|||
* @param aView view to change z depth of
|
||||
* @param zindex new z depth
|
||||
*/
|
||||
virtual void SetViewZindex(nsIView *aView, PRInt32 zindex) = 0;
|
||||
NS_IMETHOD SetViewZindex(nsIView *aView, PRInt32 zindex) = 0;
|
||||
|
||||
/**
|
||||
* Used to move a view above another in z-order.
|
||||
|
@ -281,7 +281,7 @@ public:
|
|||
* @param aView view to change z depth of
|
||||
* @param other view to move aView above
|
||||
*/
|
||||
virtual void MoveViewAbove(nsIView *aView, nsIView *other) = 0;
|
||||
NS_IMETHOD MoveViewAbove(nsIView *aView, nsIView *other) = 0;
|
||||
|
||||
/**
|
||||
* Used to move a view below another in z-order.
|
||||
|
@ -289,7 +289,7 @@ public:
|
|||
* @param aView view to change z depth of
|
||||
* @param other view to move aView below
|
||||
*/
|
||||
virtual void MoveViewBelow(nsIView *aView, nsIView *other) = 0;
|
||||
NS_IMETHOD MoveViewBelow(nsIView *aView, nsIView *other) = 0;
|
||||
|
||||
/**
|
||||
* Returns whether a view is actually shown (based on its visibility
|
||||
|
@ -297,7 +297,7 @@ public:
|
|||
* @param aView view to query visibilty of
|
||||
* @result PR_TRUE if visible, else PR_FALSE
|
||||
*/
|
||||
virtual PRBool IsViewShown(nsIView *aView) = 0;
|
||||
NS_IMETHOD IsViewShown(nsIView *aView, PRBool &aResult) = 0;
|
||||
|
||||
/**
|
||||
* Returns the clipping area of a view in absolute coordinates.
|
||||
|
@ -305,14 +305,14 @@ public:
|
|||
* @param rect to set with view's clipping rect
|
||||
* @result PR_TRUE if there is a clip rect, else PR_FALSE
|
||||
*/
|
||||
virtual PRBool GetViewClipAbsolute(nsIView *aView, nsRect *rect) = 0;
|
||||
NS_IMETHOD GetViewClipAbsolute(nsIView *aView, nsRect *rect, PRBool &aResult) = 0;
|
||||
|
||||
/**
|
||||
* Used set the transparency status of the content in a view. see
|
||||
* nsIView.HasTransparency().
|
||||
* @param aTransparent PR_TRUE if there are transparent areas, PR_FALSE otherwise.
|
||||
*/
|
||||
virtual void SetViewContentTransparency(nsIView *aView, PRBool aTransparent) = 0;
|
||||
NS_IMETHOD SetViewContentTransparency(nsIView *aView, PRBool aTransparent) = 0;
|
||||
|
||||
/**
|
||||
* Note: This didn't exist in 4.0. Called to set the opacity of a view.
|
||||
|
@ -320,7 +320,7 @@ public:
|
|||
* completely opaque.
|
||||
* @param opacity new opacity value
|
||||
*/
|
||||
virtual void SetViewOpacity(nsIView *aView, float aOpacity) = 0;
|
||||
NS_IMETHOD SetViewOpacity(nsIView *aView, float aOpacity) = 0;
|
||||
|
||||
/**
|
||||
* Set the view observer associated with this manager
|
||||
|
@ -340,31 +340,31 @@ public:
|
|||
* Get the device context associated with this manager
|
||||
* @result device context
|
||||
*/
|
||||
virtual nsIDeviceContext* GetDeviceContext() = 0;
|
||||
NS_IMETHOD GetDeviceContext(nsIDeviceContext *&aContext) = 0;
|
||||
|
||||
/**
|
||||
* Set the area that the view manager considers to be "dirty"
|
||||
* to an empty state
|
||||
*/
|
||||
virtual void ClearDirtyRegion() = 0;
|
||||
NS_IMETHOD ClearDirtyRegion(void) = 0;
|
||||
|
||||
/**
|
||||
* Select whether quality level should be displayed in root view
|
||||
* @param aShow if PR_TRUE, quality level will be displayed, else hidden
|
||||
*/
|
||||
virtual void ShowQuality(PRBool aShow) = 0;
|
||||
NS_IMETHOD ShowQuality(PRBool aShow) = 0;
|
||||
|
||||
/**
|
||||
* Query whether quality level should be displayed in view frame
|
||||
* @return if PR_TRUE, quality level will be displayed, else hidden
|
||||
*/
|
||||
virtual PRBool GetShowQuality(void) = 0;
|
||||
NS_IMETHOD GetShowQuality(PRBool &aResult) = 0;
|
||||
|
||||
/**
|
||||
* Select whether quality level should be displayed in root view
|
||||
* @param aShow if PR_TRUE, quality level will be displayed, else hidden
|
||||
*/
|
||||
virtual void SetQuality(nsContentQuality aQuality) = 0;
|
||||
NS_IMETHOD SetQuality(nsContentQuality aQuality) = 0;
|
||||
|
||||
/**
|
||||
* prevent the view manager from refreshing.
|
||||
|
|
|
@ -85,11 +85,12 @@ void ScrollBarView :: SetPosition(nscoord x, nscoord y)
|
|||
|
||||
if (nsnull != mWindow)
|
||||
{
|
||||
nsIDeviceContext *dx = mViewManager->GetDeviceContext();
|
||||
nsIDeviceContext *dx;
|
||||
float twipToPix;
|
||||
nscoord parx = 0, pary = 0;
|
||||
nsIWidget *pwidget = nsnull;
|
||||
|
||||
mViewManager->GetDeviceContext(dx);
|
||||
dx->GetAppUnitsToDevUnits(twipToPix);
|
||||
|
||||
pwidget = GetOffsetFromWidget(&parx, &pary);
|
||||
|
@ -108,9 +109,10 @@ void ScrollBarView :: SetDimensions(nscoord width, nscoord height, PRBool aPaint
|
|||
|
||||
if (nsnull != mWindow)
|
||||
{
|
||||
nsIDeviceContext *dx = mViewManager->GetDeviceContext();
|
||||
nsIDeviceContext *dx;
|
||||
float t2p;
|
||||
|
||||
mViewManager->GetDeviceContext(dx);
|
||||
dx->GetAppUnitsToDevUnits(t2p);
|
||||
|
||||
mWindow->Resize(NSTwipsToIntPixels(width, t2p), NSTwipsToIntPixels(height, t2p),
|
||||
|
@ -400,11 +402,12 @@ nsresult nsScrollingView :: Init(nsIViewManager* aManager,
|
|||
|
||||
if (rv == NS_OK)
|
||||
{
|
||||
nsIDeviceContext *dx = mViewManager->GetDeviceContext();
|
||||
nsIDeviceContext *dx;
|
||||
mViewManager->GetDeviceContext(dx);
|
||||
|
||||
// Create a view for a corner cover
|
||||
|
||||
mCornerView = new CornerView();
|
||||
mCornerView = new CornerView;
|
||||
|
||||
if (nsnull != mCornerView)
|
||||
{
|
||||
|
@ -473,7 +476,8 @@ nsresult nsScrollingView :: Init(nsIViewManager* aManager,
|
|||
void nsScrollingView :: SetDimensions(nscoord width, nscoord height, PRBool aPaint)
|
||||
{
|
||||
nsRect trect;
|
||||
nsIDeviceContext *dx = mViewManager->GetDeviceContext();
|
||||
nsIDeviceContext *dx;
|
||||
mViewManager->GetDeviceContext(dx);
|
||||
nscoord showHorz = 0, showVert = 0;
|
||||
float scrollWidthFloat, scrollHeightFloat;
|
||||
dx->GetScrollBarDimensions(scrollWidthFloat, scrollHeightFloat);
|
||||
|
@ -560,7 +564,7 @@ void nsScrollingView :: SetDimensions(nscoord width, nscoord height, PRBool aPai
|
|||
|
||||
void nsScrollingView :: SetPosition(nscoord aX, nscoord aY)
|
||||
{
|
||||
nsIDeviceContext *dx = mViewManager->GetDeviceContext();
|
||||
nsIDeviceContext *dx;
|
||||
nsIWidget *thiswin = GetWidget();
|
||||
float t2p;
|
||||
|
||||
|
@ -572,6 +576,7 @@ void nsScrollingView :: SetPosition(nscoord aX, nscoord aY)
|
|||
|
||||
nsView::SetPosition(aX, aY);
|
||||
|
||||
mViewManager->GetDeviceContext(dx);
|
||||
dx->GetAppUnitsToDevUnits(t2p);
|
||||
|
||||
AdjustChildWidgets(this, this, 0, 0, t2p);
|
||||
|
@ -615,11 +620,12 @@ PRBool nsScrollingView :: Paint(nsIRenderingContext& rc, const nsRect& rect,
|
|||
void nsScrollingView :: HandleScrollEvent(nsGUIEvent *aEvent, PRUint32 aEventFlags)
|
||||
{
|
||||
nsIView *scview = nsView::GetViewFor(aEvent->widget);
|
||||
nsIDeviceContext *px = mViewManager->GetDeviceContext();
|
||||
nsIDeviceContext *px;
|
||||
float scale;
|
||||
nscoord dx = 0, dy = 0;
|
||||
nsRect bounds;
|
||||
|
||||
mViewManager->GetDeviceContext(px);
|
||||
px->GetAppUnitsToDevUnits(scale);
|
||||
|
||||
GetBounds(bounds);
|
||||
|
@ -977,7 +983,7 @@ void nsScrollingView :: ComputeContainerSize()
|
|||
if (nsnull != scrollview)
|
||||
{
|
||||
nscoord dx = 0, dy = 0;
|
||||
nsIDeviceContext *px = mViewManager->GetDeviceContext();
|
||||
nsIDeviceContext *px;
|
||||
nscoord hwidth, hheight;
|
||||
nscoord vwidth, vheight;
|
||||
PRUint32 oldsizey = mSizeY, oldsizex = mSizeX;
|
||||
|
@ -985,6 +991,7 @@ void nsScrollingView :: ComputeContainerSize()
|
|||
nscoord offx, offy;
|
||||
float scale;
|
||||
|
||||
mViewManager->GetDeviceContext(px);
|
||||
px->GetAppUnitsToDevUnits(scale);
|
||||
|
||||
ComputeScrollArea(scrollview, area, 0, 0);
|
||||
|
@ -1235,10 +1242,11 @@ nsScrollPreference nsScrollingView :: GetScrollPreference(void)
|
|||
NS_IMETHODIMP
|
||||
nsScrollingView :: ScrollTo(nscoord aX, nscoord aY, PRUint32 aUpdateFlags)
|
||||
{
|
||||
nsIDeviceContext *dx = mViewManager->GetDeviceContext();
|
||||
nsIDeviceContext *dx;
|
||||
float t2p;
|
||||
float p2t;
|
||||
|
||||
mViewManager->GetDeviceContext(dx);
|
||||
dx->GetAppUnitsToDevUnits(t2p);
|
||||
dx->GetDevUnitsToAppUnits(p2t);
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ nsEventStatus PR_CALLBACK HandleEvent(nsGUIEvent *aEvent)
|
|||
nsIView* view = nsView::GetViewFor(aEvent->widget);
|
||||
if (nsnull != view) {
|
||||
nsIViewManager* vm = view->GetViewManager();
|
||||
result = vm->DispatchEvent(aEvent);
|
||||
vm->DispatchEvent(aEvent, result);
|
||||
NS_RELEASE(vm);
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,8 @@ nsView :: ~nsView()
|
|||
|
||||
if (nsnull != mViewManager)
|
||||
{
|
||||
nsIView *rootView = mViewManager->GetRootView();
|
||||
nsIView *rootView;
|
||||
mViewManager->GetRootView(rootView);
|
||||
|
||||
if (nsnull != rootView)
|
||||
{
|
||||
|
@ -215,10 +216,11 @@ nsresult nsView :: Init(nsIViewManager* aManager,
|
|||
// check if a real window has to be created
|
||||
if (aWindowCIID)
|
||||
{
|
||||
nsIDeviceContext *dx = mViewManager->GetDeviceContext();
|
||||
nsIDeviceContext *dx;
|
||||
nsRect trect = aBounds;
|
||||
float scale;
|
||||
|
||||
mViewManager->GetDeviceContext(dx);
|
||||
dx->GetAppUnitsToDevUnits(scale);
|
||||
|
||||
trect *= scale;
|
||||
|
@ -263,10 +265,11 @@ nsIWidget * nsView :: GetWidget()
|
|||
PRBool nsView :: Paint(nsIRenderingContext& rc, const nsRect& rect,
|
||||
PRUint32 aPaintFlags, nsIView *aBackstop)
|
||||
{
|
||||
nsIView *pRoot = mViewManager->GetRootView();
|
||||
nsIView *pRoot;
|
||||
PRBool clipres = PR_FALSE;
|
||||
PRBool clipwasset = PR_FALSE;
|
||||
|
||||
mViewManager->GetRootView(pRoot);
|
||||
rc.PushState();
|
||||
|
||||
if (aPaintFlags & NS_VIEW_FLAG_CLIP_SET)
|
||||
|
@ -570,11 +573,12 @@ void nsView :: SetPosition(nscoord x, nscoord y)
|
|||
|
||||
if (nsnull != mWindow)
|
||||
{
|
||||
nsIDeviceContext *dx = mViewManager->GetDeviceContext();
|
||||
nsIDeviceContext *dx;
|
||||
nscoord offx, offy, parx = 0, pary = 0;
|
||||
float scale;
|
||||
nsIWidget *pwidget = nsnull;
|
||||
|
||||
mViewManager->GetDeviceContext(dx);
|
||||
dx->GetAppUnitsToDevUnits(scale);
|
||||
|
||||
GetScrollOffset(&offx, &offy);
|
||||
|
@ -591,8 +595,9 @@ void nsView :: SetPosition(nscoord x, nscoord y)
|
|||
|
||||
void nsView :: GetPosition(nscoord *x, nscoord *y)
|
||||
{
|
||||
nsIView *rootView = mViewManager->GetRootView();
|
||||
nsIView *rootView;
|
||||
|
||||
mViewManager->GetRootView(rootView);
|
||||
if (this == rootView)
|
||||
*x = *y = 0;
|
||||
else
|
||||
|
@ -620,9 +625,10 @@ void nsView :: SetDimensions(nscoord width, nscoord height, PRBool aPaint)
|
|||
|
||||
if (nsnull != mWindow)
|
||||
{
|
||||
nsIDeviceContext *dx = mViewManager->GetDeviceContext();
|
||||
nsIDeviceContext *dx;
|
||||
float t2p;
|
||||
|
||||
mViewManager->GetDeviceContext(dx);
|
||||
dx->GetAppUnitsToDevUnits(t2p);
|
||||
|
||||
mWindow->Resize(NSTwipsToIntPixels(width, t2p), NSTwipsToIntPixels(height, t2p),
|
||||
|
@ -652,8 +658,9 @@ void nsView :: SetBounds(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight
|
|||
|
||||
void nsView :: GetBounds(nsRect &aBounds) const
|
||||
{
|
||||
nsIView *rootView = mViewManager->GetRootView();
|
||||
nsIView *rootView;
|
||||
|
||||
mViewManager->GetRootView(rootView);
|
||||
aBounds = mBounds;
|
||||
|
||||
if ((nsIView *)this == rootView)
|
||||
|
|
|
@ -41,7 +41,8 @@ static void vm_timer_callback(nsITimer *aTimer, void *aClosure)
|
|||
|
||||
//restart the timer
|
||||
|
||||
PRInt32 fr = vm->GetFrameRate();
|
||||
PRUint32 fr;
|
||||
vm->GetFrameRate(fr);
|
||||
|
||||
vm->mFrameRate = 0;
|
||||
vm->SetFrameRate(fr);
|
||||
|
@ -126,7 +127,7 @@ nsrefcnt nsViewManager::Release(void)
|
|||
|
||||
// We don't hold a reference to the presentation context because it
|
||||
// holds a reference to us.
|
||||
nsresult nsViewManager :: Init(nsIDeviceContext* aContext)
|
||||
NS_IMETHODIMP nsViewManager :: Init(nsIDeviceContext* aContext)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
|
@ -158,12 +159,13 @@ nsresult nsViewManager :: Init(nsIDeviceContext* aContext)
|
|||
return rv;
|
||||
}
|
||||
|
||||
nsIView * nsViewManager :: GetRootView()
|
||||
NS_IMETHODIMP nsViewManager :: GetRootView(nsIView *&aView)
|
||||
{
|
||||
return mRootView;
|
||||
aView = mRootView;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsViewManager :: SetRootView(nsIView *aView)
|
||||
NS_IMETHODIMP nsViewManager :: SetRootView(nsIView *aView)
|
||||
{
|
||||
UpdateTransCnt(mRootView, aView);
|
||||
// Do NOT destroy the current root view. It's the caller's responsibility
|
||||
|
@ -175,14 +177,17 @@ void nsViewManager :: SetRootView(nsIView *aView)
|
|||
|
||||
if (nsnull != mRootView)
|
||||
mRootWindow = mRootView->GetWidget();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRUint32 nsViewManager :: GetFrameRate()
|
||||
NS_IMETHODIMP nsViewManager :: GetFrameRate(PRUint32 &aRate)
|
||||
{
|
||||
return mFrameRate;
|
||||
aRate = mFrameRate;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsViewManager :: SetFrameRate(PRUint32 aFrameRate)
|
||||
NS_IMETHODIMP nsViewManager :: SetFrameRate(PRUint32 aFrameRate)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
|
@ -208,7 +213,7 @@ nsresult nsViewManager :: SetFrameRate(PRUint32 aFrameRate)
|
|||
return rv;
|
||||
}
|
||||
|
||||
void nsViewManager :: GetWindowDimensions(nscoord *width, nscoord *height)
|
||||
NS_IMETHODIMP nsViewManager :: GetWindowDimensions(nscoord *width, nscoord *height)
|
||||
{
|
||||
if (nsnull != mRootView)
|
||||
mRootView->GetDimensions(width, height);
|
||||
|
@ -217,9 +222,10 @@ void nsViewManager :: GetWindowDimensions(nscoord *width, nscoord *height)
|
|||
*width = 0;
|
||||
*height = 0;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsViewManager :: SetWindowDimensions(nscoord width, nscoord height)
|
||||
NS_IMETHODIMP nsViewManager :: SetWindowDimensions(nscoord width, nscoord height)
|
||||
{
|
||||
// Resize the root view
|
||||
if (nsnull != mRootView)
|
||||
|
@ -229,9 +235,10 @@ void nsViewManager :: SetWindowDimensions(nscoord width, nscoord height)
|
|||
// Inform the presentation shell that we've been resized
|
||||
if (nsnull != mObserver)
|
||||
mObserver->ResizeReflow(mRootView, width, height);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsViewManager :: GetWindowOffsets(nscoord *xoffset, nscoord *yoffset)
|
||||
NS_IMETHODIMP nsViewManager :: GetWindowOffsets(nscoord *xoffset, nscoord *yoffset)
|
||||
{
|
||||
if (nsnull != mRootView)
|
||||
{
|
||||
|
@ -244,28 +251,43 @@ void nsViewManager :: GetWindowOffsets(nscoord *xoffset, nscoord *yoffset)
|
|||
}
|
||||
else
|
||||
*xoffset = *yoffset = 0;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsViewManager :: SetWindowOffsets(nscoord xoffset, nscoord yoffset)
|
||||
NS_IMETHODIMP nsViewManager :: SetWindowOffsets(nscoord xoffset, nscoord yoffset)
|
||||
{
|
||||
if (nsnull != mRootView)
|
||||
{
|
||||
nsIScrollableView *scroller;
|
||||
nsresult retval;
|
||||
|
||||
if (NS_OK == mRootView->QueryInterface(kIScrollableViewIID, (void **)&scroller))
|
||||
retval = mRootView->QueryInterface(kIScrollableViewIID, (void **)&scroller);
|
||||
if (NS_SUCCEEDED(retval)) {
|
||||
scroller->SetVisibleOffset(xoffset, yoffset);
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsViewManager :: ResetScrolling(void)
|
||||
NS_IMETHODIMP nsViewManager :: ResetScrolling(void)
|
||||
{
|
||||
if (nsnull != mRootView)
|
||||
{
|
||||
nsIScrollableView *scroller;
|
||||
nsresult retval;
|
||||
|
||||
if (NS_OK == mRootView->QueryInterface(kIScrollableViewIID, (void **)&scroller))
|
||||
retval = mRootView->QueryInterface(kIScrollableViewIID, (void **)&scroller);
|
||||
if (NS_SUCCEEDED(retval)) {
|
||||
scroller->ComputeContainerSize();
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsViewManager :: Refresh(nsIView *aView, nsIRenderingContext *aContext, nsIRegion *region, PRUint32 aUpdateFlags)
|
||||
|
@ -454,7 +476,7 @@ void nsViewManager :: Refresh(nsIView *aView, nsIRenderingContext *aContext, nsR
|
|||
mPainting = PR_FALSE;
|
||||
}
|
||||
|
||||
void nsViewManager :: Composite()
|
||||
NS_IMETHODIMP nsViewManager :: Composite()
|
||||
{
|
||||
#ifdef USE_DIRTY_RECT
|
||||
|
||||
|
@ -467,9 +489,10 @@ void nsViewManager :: Composite()
|
|||
Refresh(mRootView, nsnull, mDirtyRegion, NS_VMREFRESH_DOUBLE_BUFFER);
|
||||
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsViewManager :: UpdateView(nsIView *aView, nsIRegion *aRegion, PRUint32 aUpdateFlags)
|
||||
NS_IMETHODIMP nsViewManager :: UpdateView(nsIView *aView, nsIRegion *aRegion, PRUint32 aUpdateFlags)
|
||||
{
|
||||
if (aRegion == nsnull)
|
||||
{
|
||||
|
@ -479,16 +502,17 @@ void nsViewManager :: UpdateView(nsIView *aView, nsIRegion *aRegion, PRUint32 aU
|
|||
trect.x = trect.y = 0;
|
||||
UpdateView(aView, trect, aUpdateFlags);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsViewManager :: UpdateView(nsIView *aView, const nsRect &aRect, PRUint32 aUpdateFlags)
|
||||
NS_IMETHODIMP nsViewManager :: UpdateView(nsIView *aView, const nsRect &aRect, PRUint32 aUpdateFlags)
|
||||
{
|
||||
nsRect trect = aRect;
|
||||
nsIView *par = aView;
|
||||
nscoord x, y;
|
||||
|
||||
if ((aRect.width == 0) || (aRect.height == 0))
|
||||
return;
|
||||
return NS_OK;
|
||||
|
||||
if (gsDebug)
|
||||
{
|
||||
|
@ -553,7 +577,7 @@ void nsViewManager :: UpdateView(nsIView *aView, const nsRect &aRect, PRUint32 a
|
|||
varea = vrect.width * vrect.height;
|
||||
|
||||
if (varea == 0)
|
||||
return;
|
||||
return NS_OK;
|
||||
|
||||
#ifdef USE_DIRTY_RECT
|
||||
rrect = mDirtyRect;
|
||||
|
@ -596,11 +620,12 @@ void nsViewManager :: UpdateView(nsIView *aView, const nsRect &aRect, PRUint32 a
|
|||
Composite();
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsEventStatus nsViewManager :: DispatchEvent(nsGUIEvent *aEvent)
|
||||
NS_IMETHODIMP nsViewManager :: DispatchEvent(nsGUIEvent *aEvent, nsEventStatus &aStatus)
|
||||
{
|
||||
nsEventStatus result = nsEventStatus_eIgnore;
|
||||
aStatus = nsEventStatus_eIgnore;
|
||||
|
||||
switch(aEvent->message)
|
||||
{
|
||||
|
@ -646,7 +671,7 @@ nsEventStatus nsViewManager :: DispatchEvent(nsGUIEvent *aEvent)
|
|||
|
||||
SetWindowDimensions(NSIntPixelsToTwips(width, p2t),
|
||||
NSIntPixelsToTwips(height, p2t));
|
||||
result = nsEventStatus_eConsumeNoDefault;
|
||||
aStatus = nsEventStatus_eConsumeNoDefault;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -672,13 +697,13 @@ nsEventStatus nsViewManager :: DispatchEvent(nsGUIEvent *aEvent)
|
|||
NS_VMREFRESH_IMMEDIATE |
|
||||
NS_VMREFRESH_AUTO_DOUBLE_BUFFER);
|
||||
|
||||
result = nsEventStatus_eConsumeNoDefault;
|
||||
aStatus = nsEventStatus_eConsumeNoDefault;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case NS_DESTROY:
|
||||
result = nsEventStatus_eConsumeNoDefault;
|
||||
aStatus = nsEventStatus_eConsumeNoDefault;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -708,9 +733,9 @@ nsEventStatus nsViewManager :: DispatchEvent(nsGUIEvent *aEvent)
|
|||
aEvent->point.y = NSIntPixelsToTwips(aEvent->point.y, p2t);
|
||||
|
||||
|
||||
result = view->HandleEvent(aEvent, NS_VIEW_FLAG_CHECK_CHILDREN |
|
||||
NS_VIEW_FLAG_CHECK_PARENT |
|
||||
NS_VIEW_FLAG_CHECK_SIBLINGS);
|
||||
aStatus = view->HandleEvent(aEvent, NS_VIEW_FLAG_CHECK_CHILDREN |
|
||||
NS_VIEW_FLAG_CHECK_PARENT |
|
||||
NS_VIEW_FLAG_CHECK_SIBLINGS);
|
||||
|
||||
aEvent->point.x = NSTwipsToIntPixels(aEvent->point.x, t2p);
|
||||
aEvent->point.y = NSTwipsToIntPixels(aEvent->point.y, t2p);
|
||||
|
@ -718,33 +743,37 @@ nsEventStatus nsViewManager :: DispatchEvent(nsGUIEvent *aEvent)
|
|||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRBool nsViewManager :: GrabMouseEvents(nsIView *aView)
|
||||
NS_IMETHODIMP nsViewManager :: GrabMouseEvents(nsIView *aView, PRBool &aResult)
|
||||
{
|
||||
mMouseGrabber = aView;
|
||||
return PR_TRUE;
|
||||
aResult = PR_TRUE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRBool nsViewManager :: GrabKeyEvents(nsIView *aView)
|
||||
NS_IMETHODIMP nsViewManager :: GrabKeyEvents(nsIView *aView, PRBool &aResult)
|
||||
{
|
||||
mKeyGrabber = aView;
|
||||
return PR_TRUE;
|
||||
aResult = PR_TRUE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsIView * nsViewManager :: GetMouseEventGrabber()
|
||||
NS_IMETHODIMP nsViewManager :: GetMouseEventGrabber(nsIView *&aView)
|
||||
{
|
||||
return mMouseGrabber;
|
||||
aView = mMouseGrabber;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsIView * nsViewManager :: GetKeyEventGrabber()
|
||||
NS_IMETHODIMP nsViewManager :: GetKeyEventGrabber(nsIView *&aView)
|
||||
{
|
||||
return mKeyGrabber;
|
||||
aView = mKeyGrabber;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsViewManager :: InsertChild(nsIView *parent, nsIView *child, nsIView *sibling,
|
||||
PRBool above)
|
||||
NS_IMETHODIMP nsViewManager :: InsertChild(nsIView *parent, nsIView *child, nsIView *sibling,
|
||||
PRBool above)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != parent, "null ptr");
|
||||
NS_PRECONDITION(nsnull != child, "null ptr");
|
||||
|
@ -784,9 +813,10 @@ void nsViewManager :: InsertChild(nsIView *parent, nsIView *child, nsIView *sibl
|
|||
if (child->GetVisibility() != nsViewVisibility_kHide)
|
||||
UpdateView(child, nsnull, 0);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsViewManager :: InsertChild(nsIView *parent, nsIView *child, PRInt32 zindex)
|
||||
NS_IMETHODIMP nsViewManager :: InsertChild(nsIView *parent, nsIView *child, PRInt32 zindex)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != parent, "null ptr");
|
||||
NS_PRECONDITION(nsnull != child, "null ptr");
|
||||
|
@ -825,9 +855,10 @@ void nsViewManager :: InsertChild(nsIView *parent, nsIView *child, PRInt32 zinde
|
|||
if (child->GetVisibility() != nsViewVisibility_kHide)
|
||||
UpdateView(child, nsnull, 0);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsViewManager :: RemoveChild(nsIView *parent, nsIView *child)
|
||||
NS_IMETHODIMP nsViewManager :: RemoveChild(nsIView *parent, nsIView *child)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != parent, "null ptr");
|
||||
NS_PRECONDITION(nsnull != child, "null ptr");
|
||||
|
@ -838,17 +869,19 @@ void nsViewManager :: RemoveChild(nsIView *parent, nsIView *child)
|
|||
UpdateView(child, nsnull, NS_VMREFRESH_NO_SYNC);
|
||||
parent->RemoveChild(child);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsViewManager :: MoveViewBy(nsIView *aView, nscoord aX, nscoord aY)
|
||||
NS_IMETHODIMP nsViewManager :: MoveViewBy(nsIView *aView, nscoord aX, nscoord aY)
|
||||
{
|
||||
nscoord x, y;
|
||||
|
||||
aView->GetPosition(&x, &y);
|
||||
MoveViewTo(aView, aX + x, aY + y);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsViewManager :: MoveViewTo(nsIView *aView, nscoord aX, nscoord aY)
|
||||
NS_IMETHODIMP nsViewManager :: MoveViewTo(nsIView *aView, nscoord aX, nscoord aY)
|
||||
{
|
||||
nscoord oldX;
|
||||
nscoord oldY;
|
||||
|
@ -871,9 +904,10 @@ void nsViewManager :: MoveViewTo(nsIView *aView, nscoord aX, nscoord aY)
|
|||
UpdateView(parent, newArea, 0);
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsViewManager :: ResizeView(nsIView *aView, nscoord width, nscoord height)
|
||||
NS_IMETHODIMP nsViewManager :: ResizeView(nsIView *aView, nscoord width, nscoord height)
|
||||
{
|
||||
nscoord twidth, theight, left, top, right, bottom, x, y;
|
||||
|
||||
|
@ -934,41 +968,49 @@ void nsViewManager :: ResizeView(nsIView *aView, nscoord width, nscoord height)
|
|||
trect.height = bottom - top;
|
||||
|
||||
UpdateView(parent, trect, 0);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsViewManager :: SetViewClip(nsIView *aView, nsRect *rect)
|
||||
NS_IMETHODIMP nsViewManager :: SetViewClip(nsIView *aView, nsRect *rect)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsViewManager :: SetViewVisibility(nsIView *aView, nsViewVisibility visible)
|
||||
NS_IMETHODIMP nsViewManager :: SetViewVisibility(nsIView *aView, nsViewVisibility visible)
|
||||
{
|
||||
aView->SetVisibility(visible);
|
||||
UpdateView(aView, nsnull, 0);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsViewManager :: SetViewZindex(nsIView *aView, PRInt32 zindex)
|
||||
NS_IMETHODIMP nsViewManager :: SetViewZindex(nsIView *aView, PRInt32 zindex)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
void nsViewManager :: MoveViewAbove(nsIView *aView, nsIView *other)
|
||||
NS_IMETHODIMP nsViewManager :: MoveViewAbove(nsIView *aView, nsIView *other)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
void nsViewManager :: MoveViewBelow(nsIView *aView, nsIView *other)
|
||||
NS_IMETHODIMP nsViewManager :: MoveViewBelow(nsIView *aView, nsIView *other)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
PRBool nsViewManager :: IsViewShown(nsIView *aView)
|
||||
NS_IMETHODIMP nsViewManager :: IsViewShown(nsIView *aView, PRBool &aResult)
|
||||
{
|
||||
return PR_TRUE;
|
||||
aResult = PR_TRUE;
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
PRBool nsViewManager :: GetViewClipAbsolute(nsIView *aView, nsRect *rect)
|
||||
NS_IMETHODIMP nsViewManager :: GetViewClipAbsolute(nsIView *aView, nsRect *rect, PRBool &aResult)
|
||||
{
|
||||
return PR_TRUE;
|
||||
aResult = PR_TRUE;
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
void nsViewManager :: SetViewContentTransparency(nsIView *aView, PRBool aTransparent)
|
||||
NS_IMETHODIMP nsViewManager :: SetViewContentTransparency(nsIView *aView, PRBool aTransparent)
|
||||
{
|
||||
if (aTransparent != aView->HasTransparency())
|
||||
{
|
||||
|
@ -985,9 +1027,10 @@ void nsViewManager :: SetViewContentTransparency(nsIView *aView, PRBool aTranspa
|
|||
|
||||
aView->SetContentTransparency(aTransparent);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsViewManager :: SetViewOpacity(nsIView *aView, float aOpacity)
|
||||
NS_IMETHODIMP nsViewManager :: SetViewOpacity(nsIView *aView, float aOpacity)
|
||||
{
|
||||
PRBool newopaque, oldopaque;
|
||||
float oldopacity;
|
||||
|
@ -1019,6 +1062,7 @@ void nsViewManager :: SetViewOpacity(nsIView *aView, float aOpacity)
|
|||
}
|
||||
|
||||
aView->SetOpacity(aOpacity);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsViewManager :: SetViewObserver(nsIViewObserver *aObserver)
|
||||
|
@ -1039,10 +1083,11 @@ NS_IMETHODIMP nsViewManager :: GetViewObserver(nsIViewObserver *&aObserver)
|
|||
return NS_ERROR_NO_INTERFACE;
|
||||
}
|
||||
|
||||
nsIDeviceContext * nsViewManager :: GetDeviceContext()
|
||||
NS_IMETHODIMP nsViewManager :: GetDeviceContext(nsIDeviceContext *&aContext)
|
||||
{
|
||||
NS_IF_ADDREF(mContext);
|
||||
return mContext;
|
||||
aContext = mContext;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsDrawingSurface nsViewManager :: GetDrawingSurface(nsIRenderingContext &aContext, nsRect& aBounds)
|
||||
|
@ -1063,7 +1108,7 @@ nsDrawingSurface nsViewManager :: GetDrawingSurface(nsIRenderingContext &aContex
|
|||
return mDrawingSurface;
|
||||
}
|
||||
|
||||
void nsViewManager :: ClearDirtyRegion()
|
||||
NS_IMETHODIMP nsViewManager :: ClearDirtyRegion(void)
|
||||
{
|
||||
#ifdef USE_DIRTY_RECT
|
||||
|
||||
|
@ -1078,35 +1123,47 @@ void nsViewManager :: ClearDirtyRegion()
|
|||
mDirtyRegion->SetTo(0, 0, 0, 0);
|
||||
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsViewManager :: ShowQuality(PRBool aShow)
|
||||
NS_IMETHODIMP nsViewManager :: ShowQuality(PRBool aShow)
|
||||
{
|
||||
nsIScrollableView *scroller;
|
||||
nsresult retval;
|
||||
|
||||
if (NS_OK == mRootView->QueryInterface(kIScrollableViewIID, (void **)&scroller))
|
||||
retval = mRootView->QueryInterface(kIScrollableViewIID, (void **)&scroller);
|
||||
if (NS_SUCCEEDED(retval)) {
|
||||
scroller->ShowQuality(aShow);
|
||||
}
|
||||
|
||||
PRBool nsViewManager :: GetShowQuality(void)
|
||||
{
|
||||
nsIScrollableView *scroller;
|
||||
PRBool retval = PR_FALSE;
|
||||
|
||||
if (NS_OK == mRootView->QueryInterface(kIScrollableViewIID, (void **)&scroller))
|
||||
retval = scroller->GetShowQuality();
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
void nsViewManager :: SetQuality(nsContentQuality aQuality)
|
||||
NS_IMETHODIMP nsViewManager :: GetShowQuality(PRBool &aResult)
|
||||
{
|
||||
nsIScrollableView *scroller;
|
||||
nsresult retval;
|
||||
|
||||
if (NS_OK == mRootView->QueryInterface(kIScrollableViewIID, (void **)&scroller))
|
||||
retval = mRootView->QueryInterface(kIScrollableViewIID, (void **)&scroller);
|
||||
if (NS_SUCCEEDED(retval)) {
|
||||
aResult = scroller->GetShowQuality();
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsViewManager :: SetQuality(nsContentQuality aQuality)
|
||||
{
|
||||
nsIScrollableView *scroller;
|
||||
nsresult retval;
|
||||
|
||||
retval = mRootView->QueryInterface(kIScrollableViewIID, (void **)&scroller);
|
||||
if (NS_SUCCEEDED(retval))
|
||||
{
|
||||
scroller->SetQuality(aQuality);
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
nsIRenderingContext * nsViewManager :: CreateRenderingContext(nsIView &aView)
|
||||
|
@ -1193,7 +1250,6 @@ void nsViewManager :: UpdateTransCnt(nsIView *oldview, nsIView *newview)
|
|||
NS_IMETHODIMP nsViewManager :: DisableRefresh(void)
|
||||
{
|
||||
mRefreshEnabled = PR_FALSE;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -39,82 +39,82 @@ public:
|
|||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
virtual nsresult Init(nsIDeviceContext* aContext);
|
||||
NS_IMETHOD Init(nsIDeviceContext* aContext);
|
||||
|
||||
virtual nsIView *GetRootView();
|
||||
virtual void SetRootView(nsIView *aView);
|
||||
NS_IMETHOD GetRootView(nsIView *&aView);
|
||||
NS_IMETHOD SetRootView(nsIView *aView);
|
||||
|
||||
virtual PRUint32 GetFrameRate();
|
||||
virtual nsresult SetFrameRate(PRUint32 frameRate);
|
||||
NS_IMETHOD GetFrameRate(PRUint32 &aRate);
|
||||
NS_IMETHOD SetFrameRate(PRUint32 frameRate);
|
||||
|
||||
virtual void GetWindowDimensions(nscoord *width, nscoord *height);
|
||||
virtual void SetWindowDimensions(nscoord width, nscoord height);
|
||||
NS_IMETHOD GetWindowDimensions(nscoord *width, nscoord *height);
|
||||
NS_IMETHOD SetWindowDimensions(nscoord width, nscoord height);
|
||||
|
||||
virtual void GetWindowOffsets(nscoord *xoffset, nscoord *yoffset);
|
||||
virtual void SetWindowOffsets(nscoord xoffset, nscoord yoffset);
|
||||
NS_IMETHOD GetWindowOffsets(nscoord *xoffset, nscoord *yoffset);
|
||||
NS_IMETHOD SetWindowOffsets(nscoord xoffset, nscoord yoffset);
|
||||
|
||||
virtual void ResetScrolling(void);
|
||||
NS_IMETHOD ResetScrolling(void);
|
||||
|
||||
virtual void Composite();
|
||||
NS_IMETHOD Composite(void);
|
||||
|
||||
virtual void UpdateView(nsIView *aView, nsIRegion *aRegion,
|
||||
PRUint32 aUpdateFlags);
|
||||
virtual void UpdateView(nsIView *aView, const nsRect &aRect, PRUint32 aUpdateFlags);
|
||||
NS_IMETHOD UpdateView(nsIView *aView, nsIRegion *aRegion,
|
||||
PRUint32 aUpdateFlags);
|
||||
NS_IMETHOD UpdateView(nsIView *aView, const nsRect &aRect, PRUint32 aUpdateFlags);
|
||||
|
||||
virtual nsEventStatus DispatchEvent(nsGUIEvent *aEvent);
|
||||
NS_IMETHOD DispatchEvent(nsGUIEvent *aEvent, nsEventStatus &aStatus);
|
||||
|
||||
virtual PRBool GrabMouseEvents(nsIView *aView);
|
||||
virtual PRBool GrabKeyEvents(nsIView *aView);
|
||||
NS_IMETHOD GrabMouseEvents(nsIView *aView, PRBool &aResult);
|
||||
NS_IMETHOD GrabKeyEvents(nsIView *aView, PRBool &aresult);
|
||||
|
||||
virtual nsIView* GetMouseEventGrabber();
|
||||
virtual nsIView* GetKeyEventGrabber();
|
||||
NS_IMETHOD GetMouseEventGrabber(nsIView *&aView);
|
||||
NS_IMETHOD GetKeyEventGrabber(nsIView *&aView);
|
||||
|
||||
virtual void InsertChild(nsIView *parent, nsIView *child, nsIView *sibling,
|
||||
PRBool above);
|
||||
NS_IMETHOD InsertChild(nsIView *parent, nsIView *child, nsIView *sibling,
|
||||
PRBool above);
|
||||
|
||||
virtual void InsertChild(nsIView *parent, nsIView *child,
|
||||
PRInt32 zindex);
|
||||
NS_IMETHOD InsertChild(nsIView *parent, nsIView *child,
|
||||
PRInt32 zindex);
|
||||
|
||||
virtual void RemoveChild(nsIView *parent, nsIView *child);
|
||||
NS_IMETHOD RemoveChild(nsIView *parent, nsIView *child);
|
||||
|
||||
virtual void MoveViewBy(nsIView *aView, nscoord x, nscoord y);
|
||||
NS_IMETHOD MoveViewBy(nsIView *aView, nscoord x, nscoord y);
|
||||
|
||||
virtual void MoveViewTo(nsIView *aView, nscoord x, nscoord y);
|
||||
NS_IMETHOD MoveViewTo(nsIView *aView, nscoord x, nscoord y);
|
||||
|
||||
virtual void ResizeView(nsIView *aView, nscoord width, nscoord height);
|
||||
NS_IMETHOD ResizeView(nsIView *aView, nscoord width, nscoord height);
|
||||
|
||||
virtual void SetViewClip(nsIView *aView, nsRect *rect);
|
||||
NS_IMETHOD SetViewClip(nsIView *aView, nsRect *rect);
|
||||
|
||||
virtual void SetViewVisibility(nsIView *aView, nsViewVisibility visible);
|
||||
NS_IMETHOD SetViewVisibility(nsIView *aView, nsViewVisibility visible);
|
||||
|
||||
virtual void SetViewZindex(nsIView *aView, PRInt32 zindex);
|
||||
NS_IMETHOD SetViewZindex(nsIView *aView, PRInt32 zindex);
|
||||
|
||||
virtual void MoveViewAbove(nsIView *aView, nsIView *other);
|
||||
virtual void MoveViewBelow(nsIView *aView, nsIView *other);
|
||||
NS_IMETHOD MoveViewAbove(nsIView *aView, nsIView *other);
|
||||
NS_IMETHOD MoveViewBelow(nsIView *aView, nsIView *other);
|
||||
|
||||
virtual PRBool IsViewShown(nsIView *aView);
|
||||
NS_IMETHOD IsViewShown(nsIView *aView, PRBool& aResult);
|
||||
|
||||
virtual PRBool GetViewClipAbsolute(nsIView *aView, nsRect *rect);
|
||||
NS_IMETHOD GetViewClipAbsolute(nsIView *aView, nsRect *rect, PRBool &aResult);
|
||||
|
||||
virtual void SetViewContentTransparency(nsIView *aView, PRBool aTransparent);
|
||||
virtual void SetViewOpacity(nsIView *aView, float aOpacity);
|
||||
NS_IMETHOD SetViewContentTransparency(nsIView *aView, PRBool aTransparent);
|
||||
NS_IMETHOD SetViewOpacity(nsIView *aView, float aOpacity);
|
||||
|
||||
NS_IMETHOD SetViewObserver(nsIViewObserver *aObserver);
|
||||
NS_IMETHOD GetViewObserver(nsIViewObserver *&aObserver);
|
||||
NS_IMETHOD SetViewObserver(nsIViewObserver *aObserver);
|
||||
NS_IMETHOD GetViewObserver(nsIViewObserver *&aObserver);
|
||||
|
||||
virtual nsIDeviceContext* GetDeviceContext();
|
||||
NS_IMETHOD GetDeviceContext(nsIDeviceContext *&aContext);
|
||||
|
||||
virtual void ClearDirtyRegion();
|
||||
NS_IMETHOD ClearDirtyRegion(void);
|
||||
|
||||
NS_IMETHOD ShowQuality(PRBool aShow);
|
||||
NS_IMETHOD GetShowQuality(PRBool &aResult);
|
||||
NS_IMETHOD SetQuality(nsContentQuality aQuality);
|
||||
|
||||
NS_IMETHOD DisableRefresh(void);
|
||||
NS_IMETHOD EnableRefresh(void);
|
||||
|
||||
nsDrawingSurface GetDrawingSurface(nsIRenderingContext &aContext, nsRect& aBounds);
|
||||
|
||||
virtual void ShowQuality(PRBool aShow);
|
||||
virtual PRBool GetShowQuality(void);
|
||||
virtual void SetQuality(nsContentQuality aQuality);
|
||||
|
||||
NS_IMETHOD DisableRefresh(void);
|
||||
NS_IMETHOD EnableRefresh(void);
|
||||
|
||||
private:
|
||||
virtual ~nsViewManager();
|
||||
nsIRenderingContext *CreateRenderingContext(nsIView &aView);
|
||||
|
|
|
@ -460,7 +460,8 @@ nsBrowserWindow::ForceRefresh()
|
|||
if (nsnull != shell) {
|
||||
nsIViewManager* vm = shell->GetViewManager();
|
||||
if (nsnull != vm) {
|
||||
nsIView* root = vm->GetRootView();
|
||||
nsIView* root;
|
||||
vm->GetRootView(root);
|
||||
if (nsnull != root) {
|
||||
vm->UpdateView(root, (nsIRegion*)nsnull, NS_VMREFRESH_IMMEDIATE);
|
||||
}
|
||||
|
@ -1343,7 +1344,8 @@ DumpViewsRecurse(nsBrowserWindow* aBrowser, nsIWebShell* aWebShell, FILE* out)
|
|||
if (nsnull != shell) {
|
||||
nsIViewManager* vm = shell->GetViewManager();
|
||||
if (nsnull != vm) {
|
||||
nsIView* root = vm->GetRootView();
|
||||
nsIView* root;
|
||||
vm->GetRootView(root);
|
||||
if (nsnull != root) {
|
||||
root->List(out);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче