summaryrefslogtreecommitdiffstats
path: root/widget/uikit/nsWindow.h
diff options
context:
space:
mode:
Diffstat (limited to 'widget/uikit/nsWindow.h')
-rw-r--r--widget/uikit/nsWindow.h77
1 files changed, 44 insertions, 33 deletions
diff --git a/widget/uikit/nsWindow.h b/widget/uikit/nsWindow.h
index 5dad452930..cb5d676d7c 100644
--- a/widget/uikit/nsWindow.h
+++ b/widget/uikit/nsWindow.h
@@ -15,6 +15,10 @@
@class UIView;
@class ChildView;
+namespace mozilla::widget {
+class TextInputHandler;
+}
+
class nsWindow final : public nsBaseWidget {
typedef nsBaseWidget Inherited;
@@ -27,49 +31,47 @@ class nsWindow final : public nsBaseWidget {
// nsIWidget
//
- [[nodiscard]] virtual nsresult Create(
+ [[nodiscard]] nsresult Create(
nsIWidget* aParent, nsNativeWidget aNativeParent,
const LayoutDeviceIntRect& aRect,
- widget::InitData* aInitData = nullptr) override;
- virtual void Destroy() override;
- virtual void Show(bool aState) override;
- virtual void Enable(bool aState) override {}
- virtual bool IsEnabled() const override { return true; }
- virtual bool IsVisible() const override { return mVisible; }
- virtual void SetFocus(Raise, mozilla::dom::CallerType aCallerType) override;
- virtual LayoutDeviceIntPoint WidgetToScreenOffset() override;
-
- virtual void SetBackgroundColor(const nscolor& aColor) override;
- virtual void* GetNativeData(uint32_t aDataType) override;
-
- virtual void Move(double aX, double aY) override;
- virtual nsSizeMode SizeMode() override { return mSizeMode; }
- virtual void SetSizeMode(nsSizeMode aMode) override;
+ mozilla::widget::InitData* aInitData = nullptr) override;
+ void Destroy() override;
+ void Show(bool aState) override;
+ void Enable(bool aState) override {}
+ bool IsEnabled() const override { return true; }
+ bool IsVisible() const override { return mVisible; }
+ void SetFocus(Raise, mozilla::dom::CallerType aCallerType) override;
+ LayoutDeviceIntPoint WidgetToScreenOffset() override;
+
+ void SetBackgroundColor(const nscolor& aColor) override;
+ void* GetNativeData(uint32_t aDataType) override;
+
+ void Move(double aX, double aY) override;
+ nsSizeMode SizeMode() override { return mSizeMode; }
+ void SetSizeMode(nsSizeMode aMode) override;
void EnteredFullScreen(bool aFullScreen);
- virtual void Resize(double aWidth, double aHeight, bool aRepaint) override;
- virtual void Resize(double aX, double aY, double aWidth, double aHeight,
- bool aRepaint) override;
- virtual LayoutDeviceIntRect GetScreenBounds() override;
+ void Resize(double aWidth, double aHeight, bool aRepaint) override;
+ void Resize(double aX, double aY, double aWidth, double aHeight,
+ bool aRepaint) override;
+ LayoutDeviceIntRect GetScreenBounds() override;
void ReportMoveEvent();
void ReportSizeEvent();
void ReportSizeModeEvent(nsSizeMode aMode);
CGFloat BackingScaleFactor();
void BackingScaleFactorChanged();
- virtual float GetDPI() override {
+ float GetDPI() override {
// XXX: terrible
return 326.0f;
}
- virtual double GetDefaultScaleInternal() override {
- return BackingScaleFactor();
- }
- virtual int32_t RoundsWidgetCoordinatesTo() override;
+ double GetDefaultScaleInternal() override { return BackingScaleFactor(); }
+ int32_t RoundsWidgetCoordinatesTo() override;
- virtual nsresult SetTitle(const nsAString& aTitle) override { return NS_OK; }
+ nsresult SetTitle(const nsAString& aTitle) override { return NS_OK; }
- virtual void Invalidate(const LayoutDeviceIntRect& aRect) override;
- virtual nsresult DispatchEvent(mozilla::WidgetGUIEvent* aEvent,
- nsEventStatus& aStatus) override;
+ void Invalidate(const LayoutDeviceIntRect& aRect) override;
+ nsresult DispatchEvent(mozilla::WidgetGUIEvent* aEvent,
+ nsEventStatus& aStatus) override;
void WillPaintWindow();
bool PaintWindow(LayoutDeviceIntRegion aRegion);
@@ -78,9 +80,16 @@ class nsWindow final : public nsBaseWidget {
// virtual nsresult
// NotifyIME(const IMENotification& aIMENotification) override;
- virtual void SetInputContext(const InputContext& aContext,
- const InputContextAction& aAction);
- virtual InputContext GetInputContext();
+ void SetInputContext(const InputContext& aContext,
+ const InputContextAction& aAction) override;
+ InputContext GetInputContext() override;
+ TextEventDispatcherListener* GetNativeTextEventDispatcherListener() override;
+
+ mozilla::widget::TextInputHandler* GetTextInputHandler() const {
+ return mTextInputHandler;
+ }
+ bool IsVirtualKeyboardDisabled() const;
+
/*
virtual bool ExecuteNativeKeyBinding(
NativeKeyBindingsType aType,
@@ -104,7 +113,9 @@ class nsWindow final : public nsBaseWidget {
nsSizeMode mSizeMode;
nsTArray<nsWindow*> mChildren;
nsWindow* mParent;
- InputContext mInputContext;
+
+ mozilla::widget::InputContext mInputContext;
+ RefPtr<mozilla::widget::TextInputHandler> mTextInputHandler;
void OnSizeChanged(const mozilla::gfx::IntSize& aSize);