2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2004-04-18 18:30:37 +04:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
2000-04-15 02:48:30 +04:00
|
|
|
*
|
2004-04-18 18:30:37 +04: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/
|
2000-04-15 02:48:30 +04:00
|
|
|
*
|
2001-09-29 00:14:13 +04:00
|
|
|
* 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.
|
2000-04-15 02:48:30 +04:00
|
|
|
*
|
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2004-04-18 18:30:37 +04:00
|
|
|
* The Initial Developer of the Original Code is
|
2001-09-29 00:14:13 +04:00
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
2000-04-15 02:48:30 +04:00
|
|
|
*
|
2001-09-29 00:14:13 +04:00
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
2004-04-18 18:30:37 +04:00
|
|
|
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
2001-09-29 00:14:13 +04:00
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
2004-04-18 18:30:37 +04:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2001-09-29 00:14:13 +04:00
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
2004-04-18 18:30:37 +04:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
2001-09-29 00:14:13 +04:00
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
2006-03-29 22:29:03 +04:00
|
|
|
|
|
|
|
/* rendering objects for replaced elements implemented by a plugin */
|
|
|
|
|
2000-04-15 02:48:30 +04:00
|
|
|
#ifndef nsObjectFrame_h___
|
|
|
|
#define nsObjectFrame_h___
|
|
|
|
|
2011-08-30 10:09:56 +04:00
|
|
|
#ifdef XP_WIN
|
|
|
|
#include <windows.h>
|
|
|
|
#endif
|
|
|
|
|
2011-06-01 08:37:54 +04:00
|
|
|
#include "nsPluginInstanceOwner.h"
|
2001-02-20 00:50:04 +03:00
|
|
|
#include "nsIObjectFrame.h"
|
2006-02-02 22:29:10 +03:00
|
|
|
#include "nsFrame.h"
|
2009-07-22 04:45:00 +04:00
|
|
|
#include "nsRegion.h"
|
|
|
|
#include "nsDisplayList.h"
|
2010-09-08 04:36:59 +04:00
|
|
|
#include "nsIReflowCallback.h"
|
2010-09-17 08:09:25 +04:00
|
|
|
#include "Layers.h"
|
|
|
|
#include "ImageLayers.h"
|
2000-04-15 02:48:30 +04:00
|
|
|
|
2002-05-11 02:34:53 +04:00
|
|
|
#ifdef ACCESSIBILITY
|
|
|
|
class nsIAccessible;
|
|
|
|
#endif
|
|
|
|
|
2011-04-29 00:08:33 +04:00
|
|
|
class nsPluginHost;
|
2006-02-02 22:29:10 +03:00
|
|
|
class nsPresContext;
|
2009-07-22 04:45:00 +04:00
|
|
|
class nsDisplayPlugin;
|
2011-02-12 19:09:03 +03:00
|
|
|
class nsIOSurface;
|
2011-02-17 01:43:30 +03:00
|
|
|
class PluginBackgroundSink;
|
2000-04-15 02:48:30 +04:00
|
|
|
|
2005-12-31 03:25:36 +03:00
|
|
|
#define nsObjectFrameSuper nsFrame
|
2000-04-15 02:48:30 +04:00
|
|
|
|
2010-09-08 04:36:59 +04:00
|
|
|
class nsObjectFrame : public nsObjectFrameSuper,
|
|
|
|
public nsIObjectFrame,
|
|
|
|
public nsIReflowCallback {
|
2000-04-15 02:48:30 +04:00
|
|
|
public:
|
2010-09-17 08:09:25 +04:00
|
|
|
typedef mozilla::LayerState LayerState;
|
|
|
|
typedef mozilla::layers::Layer Layer;
|
|
|
|
typedef mozilla::layers::LayerManager LayerManager;
|
|
|
|
typedef mozilla::layers::ImageContainer ImageContainer;
|
|
|
|
|
2009-09-12 20:49:24 +04:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
|
|
|
|
2006-03-27 01:30:36 +04:00
|
|
|
friend nsIFrame* NS_NewObjectFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
|
2009-01-12 22:20:59 +03:00
|
|
|
NS_DECL_QUERYFRAME
|
2001-02-20 00:50:04 +03:00
|
|
|
|
2006-03-09 21:55:21 +03:00
|
|
|
NS_IMETHOD Init(nsIContent* aContent,
|
2005-01-05 03:21:06 +03:00
|
|
|
nsIFrame* aParent,
|
|
|
|
nsIFrame* aPrevInFlow);
|
2011-04-08 05:04:40 +04:00
|
|
|
virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext);
|
|
|
|
virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext);
|
2005-01-05 03:21:06 +03:00
|
|
|
NS_IMETHOD Reflow(nsPresContext* aPresContext,
|
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
2000-04-15 02:48:30 +04:00
|
|
|
const nsHTMLReflowState& aReflowState,
|
2005-01-05 03:21:06 +03:00
|
|
|
nsReflowStatus& aStatus);
|
|
|
|
NS_IMETHOD DidReflow(nsPresContext* aPresContext,
|
|
|
|
const nsHTMLReflowState* aReflowState,
|
|
|
|
nsDidReflowStatus aStatus);
|
2006-01-26 05:29:17 +03:00
|
|
|
NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
const nsDisplayListSet& aLists);
|
|
|
|
|
2004-08-01 03:15:21 +04:00
|
|
|
NS_IMETHOD HandleEvent(nsPresContext* aPresContext,
|
2005-01-05 03:21:06 +03:00
|
|
|
nsGUIEvent* aEvent,
|
|
|
|
nsEventStatus* aEventStatus);
|
2000-04-15 02:48:30 +04:00
|
|
|
|
2010-01-22 23:57:04 +03:00
|
|
|
#ifdef XP_MACOSX
|
|
|
|
NS_IMETHOD HandlePress(nsPresContext* aPresContext,
|
|
|
|
nsGUIEvent* aEvent,
|
|
|
|
nsEventStatus* aEventStatus);
|
|
|
|
#endif
|
|
|
|
|
2003-10-31 23:19:18 +03:00
|
|
|
virtual nsIAtom* GetType() const;
|
2007-02-24 21:33:33 +03:00
|
|
|
|
|
|
|
virtual PRBool IsFrameOfType(PRUint32 aFlags) const
|
|
|
|
{
|
|
|
|
return nsObjectFrameSuper::IsFrameOfType(aFlags & ~(nsIFrame::eReplaced));
|
|
|
|
}
|
|
|
|
|
2005-04-04 01:00:41 +04:00
|
|
|
virtual PRBool NeedsView() { return PR_TRUE; }
|
2003-04-10 21:22:24 +04:00
|
|
|
|
2000-04-15 02:48:30 +04:00
|
|
|
#ifdef DEBUG
|
2001-11-14 04:33:42 +03:00
|
|
|
NS_IMETHOD GetFrameName(nsAString& aResult) const;
|
2000-04-15 02:48:30 +04:00
|
|
|
#endif
|
|
|
|
|
2009-12-24 08:21:15 +03:00
|
|
|
virtual void DestroyFrom(nsIFrame* aDestructRoot);
|
2000-04-15 02:48:30 +04:00
|
|
|
|
2008-10-26 13:11:34 +03:00
|
|
|
virtual void DidSetStyleContext(nsStyleContext* aOldStyleContext);
|
2007-10-19 07:41:07 +04:00
|
|
|
|
2011-05-18 05:48:34 +04:00
|
|
|
NS_METHOD GetPluginInstance(nsNPAPIPluginInstance** aPluginInstance);
|
2011-08-30 10:09:56 +04:00
|
|
|
virtual nsresult Instantiate(nsIChannel* aChannel, nsIStreamListener** aStreamListener);
|
|
|
|
virtual nsresult Instantiate(const char* aMimeType, nsIURI* aURI);
|
|
|
|
virtual void TryNotifyContentObjectWrapper();
|
|
|
|
virtual void StopPlugin();
|
2011-08-29 11:09:22 +04:00
|
|
|
virtual void SetIsDocumentActive(PRBool aIsActive);
|
2001-02-20 00:50:04 +03:00
|
|
|
|
2011-08-30 10:09:56 +04:00
|
|
|
/*
|
|
|
|
* Stop a plugin instance. If aDelayedStop is true, the plugin will
|
|
|
|
* be stopped at a later point when it's safe to do so (i.e. not
|
|
|
|
* while destroying the frame tree). Delayed stopping is only
|
|
|
|
* implemented on Win32 for now.
|
|
|
|
*/
|
|
|
|
void StopPluginInternal(PRBool aDelayedStop);
|
|
|
|
|
2011-04-08 23:58:04 +04:00
|
|
|
NS_IMETHOD GetCursor(const nsPoint& aPoint, nsIFrame::Cursor& aCursor);
|
2002-01-26 03:39:43 +03:00
|
|
|
|
2009-07-22 04:45:00 +04:00
|
|
|
// Compute the desired position of the plugin's widget, on the assumption
|
|
|
|
// that it is not visible (clipped out or covered by opaque content).
|
|
|
|
// This will only be called for plugins which have been registered
|
|
|
|
// with the root pres context for geometry updates.
|
|
|
|
// The widget, its new position, size and (empty) clip region are appended
|
|
|
|
// as a Configuration record to aConfigurations.
|
|
|
|
// If there is no widget associated with the plugin, this
|
|
|
|
// simply does nothing.
|
|
|
|
void GetEmptyClipConfiguration(nsTArray<nsIWidget::Configuration>* aConfigurations) {
|
|
|
|
ComputeWidgetGeometry(nsRegion(), nsPoint(0,0), aConfigurations);
|
|
|
|
}
|
|
|
|
|
2009-07-22 04:45:02 +04:00
|
|
|
void DidSetWidgetGeometry();
|
|
|
|
|
2002-05-11 02:34:53 +04:00
|
|
|
// accessibility support
|
|
|
|
#ifdef ACCESSIBILITY
|
2010-06-28 16:02:03 +04:00
|
|
|
virtual already_AddRefed<nsAccessible> CreateAccessible();
|
2002-05-11 02:34:53 +04:00
|
|
|
#ifdef XP_WIN
|
|
|
|
NS_IMETHOD GetPluginPort(HWND *aPort);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2000-04-15 02:48:30 +04:00
|
|
|
//local methods
|
2011-08-30 10:09:56 +04:00
|
|
|
nsresult CreateWidget(nscoord aWidth, nscoord aHeight, PRBool aViewOnly);
|
2005-01-05 03:21:06 +03:00
|
|
|
|
2001-09-18 06:11:09 +04:00
|
|
|
// for a given aRoot, this walks the frame tree looking for the next outFrame
|
2004-08-01 03:15:21 +04:00
|
|
|
static nsIObjectFrame* GetNextObjectFrame(nsPresContext* aPresContext,
|
2004-02-09 20:33:45 +03:00
|
|
|
nsIFrame* aRoot);
|
2001-09-18 06:11:09 +04:00
|
|
|
|
2010-09-08 04:36:59 +04:00
|
|
|
// nsIReflowCallback
|
|
|
|
virtual PRBool ReflowFinished();
|
|
|
|
virtual void ReflowCallbackCanceled();
|
|
|
|
|
2011-02-17 06:56:06 +03:00
|
|
|
void UpdateImageLayer(ImageContainer* aContainer, const gfxRect& aRect);
|
|
|
|
|
2011-02-17 01:43:30 +03:00
|
|
|
/**
|
|
|
|
* Builds either an ImageLayer or a ReadbackLayer, depending on the type
|
|
|
|
* of aItem (TYPE_PLUGIN or TYPE_PLUGIN_READBACK respectively).
|
|
|
|
*/
|
2010-09-17 08:09:25 +04:00
|
|
|
already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,
|
|
|
|
LayerManager* aManager,
|
|
|
|
nsDisplayItem* aItem);
|
|
|
|
|
|
|
|
virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder,
|
|
|
|
LayerManager* aManager);
|
|
|
|
|
2011-03-02 11:53:27 +03:00
|
|
|
already_AddRefed<ImageContainer> GetImageContainer(LayerManager* aManager = nsnull);
|
2011-02-23 08:38:09 +03:00
|
|
|
/**
|
|
|
|
* Get the rectangle (relative to this frame) which it will paint. Normally
|
|
|
|
* the frame's content-box but may be smaller if the plugin is rendering
|
|
|
|
* asynchronously and has a different-sized image temporarily.
|
|
|
|
*/
|
|
|
|
nsRect GetPaintedRect(nsDisplayPlugin* aItem);
|
2010-09-17 08:09:25 +04:00
|
|
|
|
2010-09-18 15:28:49 +04:00
|
|
|
/**
|
|
|
|
* If aContent has a nsObjectFrame, then prepare it for a DocShell swap.
|
|
|
|
* @see nsSubDocumentFrame::BeginSwapDocShells.
|
|
|
|
* There will be a call to EndSwapDocShells after we were moved to the
|
|
|
|
* new view tree.
|
|
|
|
*/
|
|
|
|
static void BeginSwapDocShells(nsIContent* aContent, void*);
|
|
|
|
/**
|
|
|
|
* If aContent has a nsObjectFrame, then set it up after a DocShell swap.
|
|
|
|
* @see nsSubDocumentFrame::EndSwapDocShells.
|
|
|
|
*/
|
|
|
|
static void EndSwapDocShells(nsIContent* aContent, void*);
|
|
|
|
|
2011-04-01 01:33:46 +04:00
|
|
|
nsIWidget* GetWidget() { return mWidget; }
|
|
|
|
|
2011-08-29 11:09:22 +04:00
|
|
|
protected:
|
|
|
|
nsObjectFrame(nsStyleContext* aContext);
|
|
|
|
virtual ~nsObjectFrame();
|
|
|
|
|
|
|
|
// NOTE: This frame class does not inherit from |nsLeafFrame|, so
|
|
|
|
// this is not a virtual method implementation.
|
|
|
|
void GetDesiredSize(nsPresContext* aPresContext,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsHTMLReflowMetrics& aDesiredSize);
|
|
|
|
|
2011-08-30 10:09:56 +04:00
|
|
|
nsresult InstantiatePlugin(nsPluginHost* aPluginHost,
|
|
|
|
const char* aMimetype,
|
|
|
|
nsIURI* aURL);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Adjust the plugin's idea of its size, using aSize as its new size.
|
|
|
|
* (aSize must be in twips)
|
|
|
|
*/
|
|
|
|
void FixupWindow(const nsSize& aSize);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets up the plugin window and calls SetWindow on the plugin.
|
|
|
|
*/
|
|
|
|
nsresult CallSetWindow(PRBool aCheckIsHidden = PR_TRUE);
|
|
|
|
|
2005-03-31 05:38:04 +04:00
|
|
|
PRBool IsFocusable(PRInt32 *aTabIndex = nsnull, PRBool aWithMouse = PR_FALSE);
|
|
|
|
|
2002-04-13 05:53:23 +04:00
|
|
|
// check attributes and optionally CSS to see if we should display anything
|
|
|
|
PRBool IsHidden(PRBool aCheckVisibilityStyle = PR_TRUE) const;
|
2000-07-20 03:46:43 +04:00
|
|
|
|
2009-07-22 04:45:00 +04:00
|
|
|
PRBool IsOpaque() const;
|
2011-02-17 01:43:30 +03:00
|
|
|
PRBool IsTransparentMode() const;
|
2009-07-22 04:45:00 +04:00
|
|
|
|
2011-08-30 10:09:56 +04:00
|
|
|
void NotifyContentObjectWrapper();
|
|
|
|
|
2009-01-15 06:27:09 +03:00
|
|
|
nsIntPoint GetWindowOriginInPixels(PRBool aWindowless);
|
2001-12-22 03:00:44 +03:00
|
|
|
|
2008-07-07 06:49:38 +04:00
|
|
|
static void PaintPrintPlugin(nsIFrame* aFrame,
|
2011-04-08 05:04:40 +04:00
|
|
|
nsRenderingContext* aRenderingContext,
|
2008-07-07 06:49:38 +04:00
|
|
|
const nsRect& aDirtyRect, nsPoint aPt);
|
2011-04-08 05:04:40 +04:00
|
|
|
void PrintPlugin(nsRenderingContext& aRenderingContext,
|
2008-07-07 06:49:38 +04:00
|
|
|
const nsRect& aDirtyRect);
|
2010-10-25 18:38:09 +04:00
|
|
|
void PaintPlugin(nsDisplayListBuilder* aBuilder,
|
2011-04-08 05:04:40 +04:00
|
|
|
nsRenderingContext& aRenderingContext,
|
2009-09-11 05:44:20 +04:00
|
|
|
const nsRect& aDirtyRect, const nsRect& aPluginRect);
|
2008-07-07 06:49:38 +04:00
|
|
|
|
2011-08-30 10:09:56 +04:00
|
|
|
/**
|
|
|
|
* Makes sure that mInstanceOwner is valid and without a current plugin
|
|
|
|
* instance. Essentially, this prepares the frame to receive a new plugin.
|
|
|
|
*/
|
|
|
|
NS_HIDDEN_(nsresult) PrepareInstanceOwner();
|
|
|
|
|
2009-07-22 04:45:00 +04:00
|
|
|
/**
|
|
|
|
* Get the widget geometry for the plugin. aRegion is in some appunits
|
|
|
|
* coordinate system whose origin is device-pixel-aligned (if possible),
|
2009-09-11 05:44:20 +04:00
|
|
|
* and aPluginOrigin gives the top-left of the plugin frame's content-rect
|
|
|
|
* in that coordinate system. It doesn't matter what that coordinate
|
|
|
|
* system actually is, as long as aRegion and aPluginOrigin are consistent.
|
2009-07-22 04:45:00 +04:00
|
|
|
* This will append a Configuration object to aConfigurations
|
|
|
|
* containing the widget, its desired position, size and clip region.
|
|
|
|
*/
|
|
|
|
void ComputeWidgetGeometry(const nsRegion& aRegion,
|
|
|
|
const nsPoint& aPluginOrigin,
|
|
|
|
nsTArray<nsIWidget::Configuration>* aConfigurations);
|
|
|
|
|
2010-01-21 18:17:52 +03:00
|
|
|
void NotifyPluginReflowObservers();
|
2009-11-21 01:59:27 +03:00
|
|
|
|
2003-04-12 19:03:08 +04:00
|
|
|
friend class nsPluginInstanceOwner;
|
2009-07-22 04:45:00 +04:00
|
|
|
friend class nsDisplayPlugin;
|
2011-02-17 01:43:30 +03:00
|
|
|
friend class PluginBackgroundSink;
|
2009-07-22 04:45:00 +04:00
|
|
|
|
2000-04-15 02:48:30 +04:00
|
|
|
private:
|
2010-01-21 18:17:52 +03:00
|
|
|
|
|
|
|
class PluginEventNotifier : public nsRunnable {
|
|
|
|
public:
|
|
|
|
PluginEventNotifier(const nsString &aEventType) :
|
|
|
|
mEventType(aEventType) {}
|
|
|
|
|
|
|
|
NS_IMETHOD Run();
|
|
|
|
private:
|
|
|
|
nsString mEventType;
|
|
|
|
};
|
2011-08-30 10:09:56 +04:00
|
|
|
|
|
|
|
nsRefPtr<nsPluginInstanceOwner> mInstanceOwner;
|
2009-09-11 05:44:20 +04:00
|
|
|
nsIView* mInnerView;
|
2009-07-22 04:45:00 +04:00
|
|
|
nsCOMPtr<nsIWidget> mWidget;
|
2009-01-15 06:27:09 +03:00
|
|
|
nsIntRect mWindowlessRect;
|
2011-02-17 01:43:30 +03:00
|
|
|
/**
|
|
|
|
* This is owned by the ReadbackLayer for this nsObjectFrame. It is
|
|
|
|
* automatically cleared if the PluginBackgroundSink is destroyed.
|
|
|
|
*/
|
|
|
|
PluginBackgroundSink* mBackgroundSink;
|
2005-04-15 01:50:46 +04:00
|
|
|
|
2011-08-30 10:09:56 +04:00
|
|
|
// For assertions that make it easier to determine if a crash is due
|
|
|
|
// to the underlying problem described in bug 136927, and to prevent
|
|
|
|
// reentry into instantiation.
|
|
|
|
PRBool mPreventInstantiation;
|
|
|
|
|
2010-09-08 04:36:59 +04:00
|
|
|
PRPackedBool mReflowCallbackPosted;
|
2010-09-17 08:09:25 +04:00
|
|
|
|
|
|
|
// A reference to the ImageContainer which contains the current frame
|
|
|
|
// of plugin to display.
|
|
|
|
nsRefPtr<ImageContainer> mImageContainer;
|
2000-04-15 02:48:30 +04:00
|
|
|
};
|
|
|
|
|
2009-07-22 04:45:00 +04:00
|
|
|
class nsDisplayPlugin : public nsDisplayItem {
|
|
|
|
public:
|
2010-08-13 14:01:13 +04:00
|
|
|
nsDisplayPlugin(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame)
|
|
|
|
: nsDisplayItem(aBuilder, aFrame)
|
2009-07-22 04:45:00 +04:00
|
|
|
{
|
|
|
|
MOZ_COUNT_CTOR(nsDisplayPlugin);
|
|
|
|
}
|
|
|
|
#ifdef NS_BUILD_REFCNT_LOGGING
|
|
|
|
virtual ~nsDisplayPlugin() {
|
|
|
|
MOZ_COUNT_DTOR(nsDisplayPlugin);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder);
|
2011-01-03 04:48:09 +03:00
|
|
|
virtual nsRegion GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
|
|
|
|
PRBool* aForceTransparentSurface = nsnull);
|
2009-09-07 04:35:14 +04:00
|
|
|
virtual void Paint(nsDisplayListBuilder* aBuilder,
|
2011-04-08 05:04:40 +04:00
|
|
|
nsRenderingContext* aCtx);
|
2009-09-07 04:35:14 +04:00
|
|
|
virtual PRBool ComputeVisibility(nsDisplayListBuilder* aBuilder,
|
2011-01-28 01:58:50 +03:00
|
|
|
nsRegion* aVisibleRegion,
|
2011-05-13 20:40:46 +04:00
|
|
|
const nsRect& aAllowVisibleRegionExpansion);
|
2009-07-22 04:45:00 +04:00
|
|
|
|
2010-07-16 01:07:49 +04:00
|
|
|
NS_DISPLAY_DECL_NAME("Plugin", TYPE_PLUGIN)
|
2009-07-22 04:45:00 +04:00
|
|
|
|
|
|
|
// Compute the desired position and clip region of the plugin's widget.
|
|
|
|
// This will only be called for plugins which have been registered
|
|
|
|
// with the root pres context for geometry updates.
|
|
|
|
// The widget, its new position, size and clip region are appended as
|
|
|
|
// a Configuration record to aConfigurations.
|
2011-04-01 01:33:46 +04:00
|
|
|
// If the plugin has no widget, no configuration is added, but
|
|
|
|
// the plugin visibility state may be adjusted.
|
2009-07-22 04:45:00 +04:00
|
|
|
void GetWidgetConfiguration(nsDisplayListBuilder* aBuilder,
|
|
|
|
nsTArray<nsIWidget::Configuration>* aConfigurations);
|
|
|
|
|
2010-09-17 08:09:25 +04:00
|
|
|
virtual already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,
|
2011-06-22 16:11:27 +04:00
|
|
|
LayerManager* aManager,
|
|
|
|
const ContainerParameters& aContainerParameters)
|
2010-09-17 08:09:25 +04:00
|
|
|
{
|
2011-02-12 19:09:03 +03:00
|
|
|
return static_cast<nsObjectFrame*>(mFrame)->BuildLayer(aBuilder,
|
|
|
|
aManager,
|
|
|
|
this);
|
2010-09-17 08:09:25 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder,
|
|
|
|
LayerManager* aManager)
|
|
|
|
{
|
2011-02-17 01:43:30 +03:00
|
|
|
return static_cast<nsObjectFrame*>(mFrame)->GetLayerState(aBuilder,
|
|
|
|
aManager);
|
2010-09-17 08:09:25 +04:00
|
|
|
}
|
|
|
|
|
2009-07-22 04:45:00 +04:00
|
|
|
private:
|
|
|
|
nsRegion mVisibleRegion;
|
|
|
|
};
|
2000-04-15 02:48:30 +04:00
|
|
|
|
|
|
|
#endif /* nsObjectFrame_h___ */
|