2010-08-20 16:24:40 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
* vim: sw=2 ts=8 et :
|
|
|
|
*/
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2010-08-20 16:24:40 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This "puppet widget" isn't really a platform widget. It's intended
|
|
|
|
* to be used in widgetless rendering contexts, such as sandboxed
|
|
|
|
* content processes. If any "real" widgetry is needed, the request
|
|
|
|
* is forwarded to and/or data received from elsewhere.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef mozilla_widget_PuppetWidget_h__
|
|
|
|
#define mozilla_widget_PuppetWidget_h__
|
|
|
|
|
2014-06-09 23:02:21 -07:00
|
|
|
#include "mozilla/gfx/2D.h"
|
|
|
|
#include "mozilla/RefPtr.h"
|
2012-05-08 14:36:07 -07:00
|
|
|
#include "nsBaseScreen.h"
|
2010-08-20 16:24:40 -07:00
|
|
|
#include "nsBaseWidget.h"
|
2012-05-08 14:36:07 -07:00
|
|
|
#include "nsIScreenManager.h"
|
2010-08-20 16:24:40 -07:00
|
|
|
#include "nsThreadUtils.h"
|
|
|
|
#include "nsWeakReference.h"
|
2012-06-18 18:28:00 -07:00
|
|
|
#include "mozilla/Attributes.h"
|
2014-03-20 08:46:29 -07:00
|
|
|
#include "mozilla/EventForwards.h"
|
2010-08-20 16:24:40 -07:00
|
|
|
|
|
|
|
class gfxASurface;
|
|
|
|
|
|
|
|
namespace mozilla {
|
2012-07-17 16:59:45 -07:00
|
|
|
|
|
|
|
namespace dom {
|
|
|
|
class TabChild;
|
|
|
|
}
|
|
|
|
|
2010-08-20 16:24:40 -07:00
|
|
|
namespace widget {
|
|
|
|
|
2014-06-18 17:57:51 -07:00
|
|
|
struct AutoCacheNativeKeyCommands;
|
2014-04-21 13:40:09 -07:00
|
|
|
|
2014-11-12 12:59:19 -08:00
|
|
|
class PuppetWidget : public nsBaseWidget,
|
|
|
|
public nsSupportsWeakReference
|
2010-08-20 16:24:40 -07:00
|
|
|
{
|
2012-07-17 16:59:45 -07:00
|
|
|
typedef mozilla::dom::TabChild TabChild;
|
2014-06-09 23:02:21 -07:00
|
|
|
typedef mozilla::gfx::DrawTarget DrawTarget;
|
2010-08-20 16:24:40 -07:00
|
|
|
typedef nsBaseWidget Base;
|
|
|
|
|
2010-08-20 16:24:40 -07:00
|
|
|
// The width and height of the "widget" are clamped to this.
|
|
|
|
static const size_t kMaxDimension;
|
|
|
|
|
|
|
|
public:
|
2014-08-31 20:33:13 -07:00
|
|
|
explicit PuppetWidget(TabChild* aTabChild);
|
2014-07-08 14:23:18 -07:00
|
|
|
|
|
|
|
protected:
|
2010-08-20 16:24:40 -07:00
|
|
|
virtual ~PuppetWidget();
|
|
|
|
|
2014-07-08 14:23:18 -07:00
|
|
|
public:
|
2010-08-20 16:24:40 -07:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
|
|
|
NS_IMETHOD Create(nsIWidget* aParent,
|
|
|
|
nsNativeWidget aNativeParent,
|
|
|
|
const nsIntRect& aRect,
|
2015-01-01 22:25:48 -08:00
|
|
|
nsWidgetInitData* aInitData = nullptr) MOZ_OVERRIDE;
|
2010-08-20 16:24:40 -07:00
|
|
|
|
2012-08-29 08:26:18 -07:00
|
|
|
void InitIMEState();
|
|
|
|
|
2010-08-20 16:24:40 -07:00
|
|
|
virtual already_AddRefed<nsIWidget>
|
|
|
|
CreateChild(const nsIntRect &aRect,
|
2012-07-30 07:20:58 -07:00
|
|
|
nsWidgetInitData *aInitData = nullptr,
|
2015-01-01 22:25:48 -08:00
|
|
|
bool aForceUseIWidgetParent = false) MOZ_OVERRIDE;
|
2010-08-20 16:24:40 -07:00
|
|
|
|
2015-01-01 22:25:48 -08:00
|
|
|
NS_IMETHOD Destroy() MOZ_OVERRIDE;
|
2010-08-20 16:24:40 -07:00
|
|
|
|
2015-01-01 22:25:48 -08:00
|
|
|
NS_IMETHOD Show(bool aState) MOZ_OVERRIDE;
|
2012-07-19 01:57:50 -07:00
|
|
|
|
2015-01-01 22:25:48 -08:00
|
|
|
virtual bool IsVisible() const MOZ_OVERRIDE
|
2012-07-19 01:57:50 -07:00
|
|
|
{ return mVisible; }
|
2010-08-20 16:24:40 -07:00
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
NS_IMETHOD ConstrainPosition(bool /*ignored aAllowSlop*/,
|
2012-08-22 08:56:38 -07:00
|
|
|
int32_t* aX,
|
2015-01-01 22:25:48 -08:00
|
|
|
int32_t* aY) MOZ_OVERRIDE
|
2010-08-20 16:24:40 -07:00
|
|
|
{ *aX = kMaxDimension; *aY = kMaxDimension; return NS_OK; }
|
|
|
|
|
2015-02-17 07:39:35 -08:00
|
|
|
// We're always at <0, 0>, and so ignore move requests.
|
2015-01-01 22:25:48 -08:00
|
|
|
NS_IMETHOD Move(double aX, double aY) MOZ_OVERRIDE
|
2010-08-20 16:24:40 -07:00
|
|
|
{ return NS_OK; }
|
|
|
|
|
2012-12-12 01:57:38 -08:00
|
|
|
NS_IMETHOD Resize(double aWidth,
|
|
|
|
double aHeight,
|
2015-01-01 22:25:48 -08:00
|
|
|
bool aRepaint) MOZ_OVERRIDE;
|
2012-12-12 01:57:38 -08:00
|
|
|
NS_IMETHOD Resize(double aX,
|
|
|
|
double aY,
|
|
|
|
double aWidth,
|
|
|
|
double aHeight,
|
2015-01-01 22:25:48 -08:00
|
|
|
bool aRepaint) MOZ_OVERRIDE
|
2015-02-17 07:39:35 -08:00
|
|
|
// (we're always at <0, 0>)
|
|
|
|
{ return Resize(aWidth, aHeight, aRepaint); }
|
2010-08-20 16:24:40 -07:00
|
|
|
|
|
|
|
// XXX/cjones: copying gtk behavior here; unclear what disabling a
|
|
|
|
// widget is supposed to entail
|
2015-01-01 22:25:48 -08:00
|
|
|
NS_IMETHOD Enable(bool aState) MOZ_OVERRIDE
|
2010-08-20 16:24:40 -07:00
|
|
|
{ mEnabled = aState; return NS_OK; }
|
2015-01-01 22:25:48 -08:00
|
|
|
virtual bool IsEnabled() const MOZ_OVERRIDE
|
2012-07-22 22:19:08 -07:00
|
|
|
{ return mEnabled; }
|
2010-08-20 16:24:40 -07:00
|
|
|
|
2015-01-01 22:25:48 -08:00
|
|
|
NS_IMETHOD SetFocus(bool aRaise = false) MOZ_OVERRIDE;
|
2010-08-20 16:24:40 -07:00
|
|
|
|
2015-01-01 22:25:48 -08:00
|
|
|
virtual nsresult ConfigureChildren(const nsTArray<Configuration>& aConfigurations) MOZ_OVERRIDE;
|
2010-08-20 16:24:40 -07:00
|
|
|
|
2015-01-01 22:25:48 -08:00
|
|
|
NS_IMETHOD Invalidate(const nsIntRect& aRect) MOZ_OVERRIDE;
|
2010-08-20 16:24:40 -07:00
|
|
|
|
|
|
|
// This API is going away, steer clear.
|
|
|
|
virtual void Scroll(const nsIntPoint& aDelta,
|
|
|
|
const nsTArray<nsIntRect>& aDestRects,
|
|
|
|
const nsTArray<Configuration>& aReconfigureChildren)
|
|
|
|
{ /* dead man walking */ }
|
|
|
|
|
|
|
|
// PuppetWidgets don't have native data, as they're purely nonnative.
|
2015-01-01 22:25:48 -08:00
|
|
|
virtual void* GetNativeData(uint32_t aDataType) MOZ_OVERRIDE;
|
|
|
|
NS_IMETHOD ReparentNativeWidget(nsIWidget* aNewParent) MOZ_OVERRIDE
|
2010-09-18 04:28:50 -07:00
|
|
|
{ return NS_ERROR_UNEXPECTED; }
|
2010-08-20 16:24:40 -07:00
|
|
|
|
|
|
|
// PuppetWidgets don't have any concept of titles.
|
2015-01-01 22:25:48 -08:00
|
|
|
NS_IMETHOD SetTitle(const nsAString& aTitle) MOZ_OVERRIDE
|
2010-08-20 16:24:40 -07:00
|
|
|
{ return NS_ERROR_UNEXPECTED; }
|
|
|
|
|
2015-02-17 07:39:35 -08:00
|
|
|
// PuppetWidgets are always at <0, 0>.
|
2015-02-04 12:21:03 -08:00
|
|
|
virtual mozilla::LayoutDeviceIntPoint WidgetToScreenOffset() MOZ_OVERRIDE
|
2015-02-17 07:39:35 -08:00
|
|
|
{ return mozilla::LayoutDeviceIntPoint(0, 0); }
|
2010-08-20 16:24:40 -07:00
|
|
|
|
2013-10-01 20:46:03 -07:00
|
|
|
void InitEvent(WidgetGUIEvent& aEvent, nsIntPoint* aPoint = nullptr);
|
2010-09-23 20:28:15 -07:00
|
|
|
|
2015-01-01 22:25:48 -08:00
|
|
|
NS_IMETHOD DispatchEvent(WidgetGUIEvent* aEvent, nsEventStatus& aStatus) MOZ_OVERRIDE;
|
2010-08-20 16:24:40 -07:00
|
|
|
|
2011-11-08 11:59:07 -08:00
|
|
|
NS_IMETHOD CaptureRollupEvents(nsIRollupListener* aListener,
|
2015-01-01 22:25:48 -08:00
|
|
|
bool aDoCapture) MOZ_OVERRIDE
|
2010-08-20 16:24:40 -07:00
|
|
|
{ return NS_ERROR_UNEXPECTED; }
|
|
|
|
|
2014-03-20 08:46:29 -07:00
|
|
|
NS_IMETHOD_(bool)
|
|
|
|
ExecuteNativeKeyBinding(NativeKeyBindingsType aType,
|
|
|
|
const mozilla::WidgetKeyboardEvent& aEvent,
|
|
|
|
DoCommandCallback aCallback,
|
|
|
|
void* aCallbackData) MOZ_OVERRIDE;
|
|
|
|
|
2014-06-18 17:57:51 -07:00
|
|
|
friend struct AutoCacheNativeKeyCommands;
|
2014-03-20 08:46:29 -07:00
|
|
|
|
2010-08-20 16:24:40 -07:00
|
|
|
//
|
|
|
|
// nsBaseWidget methods we override
|
|
|
|
//
|
|
|
|
|
2013-11-25 12:12:20 -08:00
|
|
|
// Documents loaded in child processes are always subdocuments of
|
|
|
|
// other docs in an ancestor process. To ensure that the
|
|
|
|
// backgrounds of those documents are painted like those of
|
|
|
|
// same-process subdocuments, we force the widget here to be
|
|
|
|
// transparent, which in turn will cause layout to use a transparent
|
|
|
|
// backstop background color.
|
2012-09-05 09:23:45 -07:00
|
|
|
virtual nsTransparencyMode GetTransparencyMode() MOZ_OVERRIDE
|
2013-11-25 12:12:20 -08:00
|
|
|
{ return eTransparencyTransparent; }
|
2012-09-05 09:23:45 -07:00
|
|
|
|
2011-08-09 12:38:26 -07:00
|
|
|
virtual LayerManager*
|
2013-04-24 11:42:40 -07:00
|
|
|
GetLayerManager(PLayerTransactionChild* aShadowManager = nullptr,
|
2014-01-23 10:26:41 -08:00
|
|
|
LayersBackend aBackendHint = mozilla::layers::LayersBackend::LAYERS_NONE,
|
2011-08-09 12:38:26 -07:00
|
|
|
LayerManagerPersistence aPersistence = LAYER_MANAGER_CURRENT,
|
2015-01-01 22:25:48 -08:00
|
|
|
bool* aAllowRetaining = nullptr) MOZ_OVERRIDE;
|
2010-08-20 16:24:40 -07:00
|
|
|
|
2011-11-27 03:51:52 -08:00
|
|
|
NS_IMETHOD_(void) SetInputContext(const InputContext& aContext,
|
2015-01-01 22:25:48 -08:00
|
|
|
const InputContextAction& aAction) MOZ_OVERRIDE;
|
|
|
|
NS_IMETHOD_(InputContext) GetInputContext() MOZ_OVERRIDE;
|
2014-01-29 01:32:39 -08:00
|
|
|
virtual nsIMEUpdatePreference GetIMEUpdatePreference() MOZ_OVERRIDE;
|
2010-09-23 20:28:15 -07:00
|
|
|
|
2015-01-01 22:25:48 -08:00
|
|
|
NS_IMETHOD SetCursor(nsCursor aCursor) MOZ_OVERRIDE;
|
2012-05-08 14:36:07 -07:00
|
|
|
NS_IMETHOD SetCursor(imgIContainer* aCursor,
|
2015-01-01 22:25:48 -08:00
|
|
|
uint32_t aHotspotX, uint32_t aHotspotY) MOZ_OVERRIDE
|
2012-05-08 14:36:07 -07:00
|
|
|
{
|
|
|
|
return nsBaseWidget::SetCursor(aCursor, aHotspotX, aHotspotY);
|
|
|
|
}
|
2011-06-21 17:32:43 -07:00
|
|
|
|
2010-12-02 17:24:04 -08:00
|
|
|
// Gets the DPI of the screen corresponding to this widget.
|
|
|
|
// Contacts the parent process which gets the DPI from the
|
|
|
|
// proper widget there. TODO: Handle DPI changes that happen
|
|
|
|
// later on.
|
2015-01-01 22:25:48 -08:00
|
|
|
virtual float GetDPI() MOZ_OVERRIDE;
|
|
|
|
virtual double GetDefaultScaleInternal() MOZ_OVERRIDE;
|
2010-12-02 17:24:04 -08:00
|
|
|
|
2012-11-07 19:51:55 -08:00
|
|
|
virtual bool NeedsPaint() MOZ_OVERRIDE;
|
|
|
|
|
2012-09-24 21:15:18 -07:00
|
|
|
virtual TabChild* GetOwningTabChild() MOZ_OVERRIDE { return mTabChild; }
|
2014-05-23 07:36:50 -07:00
|
|
|
virtual void ClearBackingScaleCache()
|
|
|
|
{
|
|
|
|
mDPI = -1;
|
|
|
|
mDefaultScale = -1;
|
|
|
|
}
|
2012-09-24 21:15:18 -07:00
|
|
|
|
2014-12-11 06:44:07 -08:00
|
|
|
nsIntSize GetScreenDimensions();
|
|
|
|
|
|
|
|
// Get the size of the chrome of the window that this tab belongs to.
|
|
|
|
nsIntPoint GetChromeDimensions();
|
|
|
|
|
|
|
|
// Get the screen position of the application window.
|
|
|
|
nsIntPoint GetWindowPosition();
|
|
|
|
|
2014-11-12 12:59:19 -08:00
|
|
|
protected:
|
|
|
|
bool mEnabled;
|
|
|
|
bool mVisible;
|
|
|
|
|
2015-01-27 22:27:31 -08:00
|
|
|
virtual nsresult NotifyIMEInternal(
|
|
|
|
const IMENotification& aIMENotification) MOZ_OVERRIDE;
|
|
|
|
|
2010-08-20 16:24:40 -07:00
|
|
|
private:
|
2012-08-15 11:52:42 -07:00
|
|
|
nsresult Paint();
|
2010-08-20 16:24:40 -07:00
|
|
|
|
|
|
|
void SetChild(PuppetWidget* aChild);
|
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
nsresult IMEEndComposition(bool aCancel);
|
2013-03-05 22:14:31 -08:00
|
|
|
nsresult NotifyIMEOfFocusChange(bool aFocus);
|
2014-02-25 16:48:02 -08:00
|
|
|
nsresult NotifyIMEOfSelectionChange(const IMENotification& aIMENotification);
|
2013-11-06 16:11:11 -08:00
|
|
|
nsresult NotifyIMEOfUpdateComposition();
|
2014-02-17 16:00:15 -08:00
|
|
|
nsresult NotifyIMEOfTextChange(const IMENotification& aIMENotification);
|
2014-09-11 06:46:17 -07:00
|
|
|
nsresult NotifyIMEOfMouseButtonEvent(const IMENotification& aIMENotification);
|
2014-12-15 01:21:20 -08:00
|
|
|
nsresult NotifyIMEOfEditorRect();
|
2014-12-15 01:37:00 -08:00
|
|
|
nsresult NotifyIMEOfPositionChange();
|
|
|
|
|
2015-02-04 12:21:03 -08:00
|
|
|
bool GetEditorRect(mozilla::LayoutDeviceIntRect& aEditorRect);
|
2014-12-15 01:37:00 -08:00
|
|
|
bool GetCompositionRects(uint32_t& aStartOffset,
|
2015-02-04 12:21:03 -08:00
|
|
|
nsTArray<mozilla::LayoutDeviceIntRect>& aRectArray,
|
2014-12-15 01:37:00 -08:00
|
|
|
uint32_t& aTargetCauseOffset);
|
2015-02-04 12:21:03 -08:00
|
|
|
bool GetCaretRect(mozilla::LayoutDeviceIntRect& aCaretRect, uint32_t aCaretOffset);
|
2014-12-15 01:37:00 -08:00
|
|
|
uint32_t GetCaretOffset();
|
2010-09-23 20:28:15 -07:00
|
|
|
|
2010-08-20 16:24:40 -07:00
|
|
|
class PaintTask : public nsRunnable {
|
|
|
|
public:
|
|
|
|
NS_DECL_NSIRUNNABLE
|
2014-08-31 20:33:13 -07:00
|
|
|
explicit PaintTask(PuppetWidget* widget) : mWidget(widget) {}
|
2012-07-30 07:20:58 -07:00
|
|
|
void Revoke() { mWidget = nullptr; }
|
2010-08-20 16:24:40 -07:00
|
|
|
private:
|
|
|
|
PuppetWidget* mWidget;
|
|
|
|
};
|
|
|
|
|
2010-09-23 20:28:15 -07:00
|
|
|
// TabChild normally holds a strong reference to this PuppetWidget
|
2012-07-17 16:59:45 -07:00
|
|
|
// or its root ancestor, but each PuppetWidget also needs a
|
|
|
|
// reference back to TabChild (e.g. to delegate nsIWidget IME calls
|
|
|
|
// to chrome) So we hold a weak reference to TabChild here. Since
|
|
|
|
// it's possible for TabChild to outlive the PuppetWidget, we clear
|
|
|
|
// this weak reference in Destroy()
|
|
|
|
TabChild* mTabChild;
|
2010-08-20 16:24:40 -07:00
|
|
|
// The "widget" to which we delegate events if we don't have an
|
|
|
|
// event handler.
|
|
|
|
nsRefPtr<PuppetWidget> mChild;
|
|
|
|
nsIntRegion mDirtyRegion;
|
|
|
|
nsRevocableEventPtr<PaintTask> mPaintTask;
|
|
|
|
// XXX/cjones: keeping this around until we teach LayerManager to do
|
|
|
|
// retained-content-only transactions
|
2014-06-09 23:02:21 -07:00
|
|
|
mozilla::RefPtr<DrawTarget> mDrawTarget;
|
2010-09-23 20:28:15 -07:00
|
|
|
// IME
|
2014-01-29 01:32:39 -08:00
|
|
|
nsIMEUpdatePreference mIMEPreferenceOfParent;
|
2010-10-01 07:17:37 -07:00
|
|
|
// Latest seqno received through events
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t mIMELastReceivedSeqno;
|
2010-10-01 07:17:37 -07:00
|
|
|
// Chrome's seqno value when last blur occurred
|
|
|
|
// arriving events with seqno up to this should be discarded
|
|
|
|
// Note that if seqno overflows (~50 days at 1 ms increment rate),
|
|
|
|
// events will be discarded until new focus/blur occurs
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t mIMELastBlurSeqno;
|
2012-08-29 08:26:18 -07:00
|
|
|
bool mNeedIMEStateInit;
|
2010-12-02 17:24:04 -08:00
|
|
|
|
|
|
|
// The DPI of the screen corresponding to this widget
|
|
|
|
float mDPI;
|
2013-05-01 16:06:19 -07:00
|
|
|
double mDefaultScale;
|
2014-03-20 08:46:29 -07:00
|
|
|
|
|
|
|
// Precomputed answers for ExecuteNativeKeyBinding
|
2014-04-21 13:40:09 -07:00
|
|
|
bool mNativeKeyCommandsValid;
|
2014-03-20 08:46:29 -07:00
|
|
|
InfallibleTArray<mozilla::CommandInt> mSingleLineCommands;
|
|
|
|
InfallibleTArray<mozilla::CommandInt> mMultiLineCommands;
|
|
|
|
InfallibleTArray<mozilla::CommandInt> mRichTextCommands;
|
2010-08-20 16:24:40 -07:00
|
|
|
};
|
|
|
|
|
2014-04-21 13:40:09 -07:00
|
|
|
struct AutoCacheNativeKeyCommands
|
|
|
|
{
|
2014-08-31 20:33:13 -07:00
|
|
|
explicit AutoCacheNativeKeyCommands(PuppetWidget* aWidget)
|
2014-04-21 13:40:09 -07:00
|
|
|
: mWidget(aWidget)
|
|
|
|
{
|
|
|
|
mSavedValid = mWidget->mNativeKeyCommandsValid;
|
|
|
|
mSavedSingleLine = mWidget->mSingleLineCommands;
|
|
|
|
mSavedMultiLine = mWidget->mMultiLineCommands;
|
|
|
|
mSavedRichText = mWidget->mRichTextCommands;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Cache(const InfallibleTArray<mozilla::CommandInt>& aSingleLineCommands,
|
|
|
|
const InfallibleTArray<mozilla::CommandInt>& aMultiLineCommands,
|
|
|
|
const InfallibleTArray<mozilla::CommandInt>& aRichTextCommands)
|
|
|
|
{
|
|
|
|
mWidget->mNativeKeyCommandsValid = true;
|
|
|
|
mWidget->mSingleLineCommands = aSingleLineCommands;
|
|
|
|
mWidget->mMultiLineCommands = aMultiLineCommands;
|
|
|
|
mWidget->mRichTextCommands = aRichTextCommands;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CacheNoCommands()
|
|
|
|
{
|
|
|
|
mWidget->mNativeKeyCommandsValid = true;
|
|
|
|
mWidget->mSingleLineCommands.Clear();
|
|
|
|
mWidget->mMultiLineCommands.Clear();
|
|
|
|
mWidget->mRichTextCommands.Clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
~AutoCacheNativeKeyCommands()
|
|
|
|
{
|
|
|
|
mWidget->mNativeKeyCommandsValid = mSavedValid;
|
|
|
|
mWidget->mSingleLineCommands = mSavedSingleLine;
|
|
|
|
mWidget->mMultiLineCommands = mSavedMultiLine;
|
|
|
|
mWidget->mRichTextCommands = mSavedRichText;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
PuppetWidget* mWidget;
|
|
|
|
bool mSavedValid;
|
|
|
|
InfallibleTArray<mozilla::CommandInt> mSavedSingleLine;
|
|
|
|
InfallibleTArray<mozilla::CommandInt> mSavedMultiLine;
|
|
|
|
InfallibleTArray<mozilla::CommandInt> mSavedRichText;
|
|
|
|
};
|
|
|
|
|
2012-05-08 14:36:07 -07:00
|
|
|
class PuppetScreen : public nsBaseScreen
|
|
|
|
{
|
|
|
|
public:
|
2014-08-31 20:33:13 -07:00
|
|
|
explicit PuppetScreen(void* nativeScreen);
|
2012-05-08 14:36:07 -07:00
|
|
|
~PuppetScreen();
|
|
|
|
|
2014-07-14 10:22:26 -07:00
|
|
|
NS_IMETHOD GetId(uint32_t* aId) MOZ_OVERRIDE;
|
2012-08-22 08:56:38 -07:00
|
|
|
NS_IMETHOD GetRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight) MOZ_OVERRIDE;
|
|
|
|
NS_IMETHOD GetAvailRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight) MOZ_OVERRIDE;
|
|
|
|
NS_IMETHOD GetPixelDepth(int32_t* aPixelDepth) MOZ_OVERRIDE;
|
|
|
|
NS_IMETHOD GetColorDepth(int32_t* aColorDepth) MOZ_OVERRIDE;
|
|
|
|
NS_IMETHOD GetRotation(uint32_t* aRotation) MOZ_OVERRIDE;
|
|
|
|
NS_IMETHOD SetRotation(uint32_t aRotation) MOZ_OVERRIDE;
|
2012-05-08 14:36:07 -07:00
|
|
|
};
|
|
|
|
|
2012-06-18 18:28:00 -07:00
|
|
|
class PuppetScreenManager MOZ_FINAL : public nsIScreenManager
|
2012-05-08 14:36:07 -07:00
|
|
|
{
|
2014-06-24 09:36:44 -07:00
|
|
|
~PuppetScreenManager();
|
|
|
|
|
2012-05-08 14:36:07 -07:00
|
|
|
public:
|
|
|
|
PuppetScreenManager();
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSISCREENMANAGER
|
|
|
|
|
|
|
|
protected:
|
|
|
|
nsCOMPtr<nsIScreen> mOneScreen;
|
|
|
|
};
|
|
|
|
|
2010-08-20 16:24:40 -07:00
|
|
|
} // namespace widget
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_widget_PuppetWidget_h__
|