Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Cleanup mozilla/WidgetUtils.h from public headers
WidgetUtils.h pulled in also FrameMetrics.h that cannot be
linked from outside (only for internal use).

Due to this we need to redeclare ScreenRotation to
mozilla::embedlite namespace. Internal embedlite components
are still using mozilla::ScreenRotation enum.
  • Loading branch information
rainemak committed Dec 19, 2016
1 parent 2842e8e commit 1d30d93
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
1 change: 0 additions & 1 deletion embedding/embedlite/EmbedLiteView.h
Expand Up @@ -7,7 +7,6 @@
#define MOZ_VIEW_EMBED_H

#include "mozilla/RefPtr.h"
#include "mozilla/WidgetUtils.h"
#include "nsStringGlue.h"
#include "gfxMatrix.h"
#include "nsRect.h"
Expand Down
2 changes: 1 addition & 1 deletion embedding/embedlite/EmbedLiteWindow.cpp
Expand Up @@ -68,7 +68,7 @@ uint32_t EmbedLiteWindow::GetUniqueID() const
return mUniqueID;
}

void EmbedLiteWindow::SetContentOrientation(mozilla::ScreenRotation rotation)
void EmbedLiteWindow::SetContentOrientation(mozilla::embedlite::ScreenRotation rotation)
{
Unused << mWindowParent->SendSetContentOrientation(rotation);
}
Expand Down
13 changes: 11 additions & 2 deletions embedding/embedlite/EmbedLiteWindow.h
Expand Up @@ -9,11 +9,20 @@
#include <stdint.h>

#include "nsRect.h"
#include "mozilla/WidgetUtils.h"

namespace mozilla {
namespace embedlite {

// NB: these must match up with pseudo-enum in nsIScreen.idl.
enum ScreenRotation {
ROTATION_0 = 0,
ROTATION_90,
ROTATION_180,
ROTATION_270,

ROTATION_COUNT
};

class EmbedLiteApp;
class PEmbedLiteWindowParent;
class EmbedLiteWindowBaseParent;
Expand Down Expand Up @@ -69,7 +78,7 @@ class EmbedLiteWindow {

virtual uint32_t GetUniqueID() const;

virtual void SetContentOrientation(mozilla::ScreenRotation);
virtual void SetContentOrientation(mozilla::embedlite::ScreenRotation);
virtual void ScheduleUpdate();
virtual void SuspendRendering();
virtual void ResumeRendering();
Expand Down
5 changes: 2 additions & 3 deletions embedding/embedlite/embedshared/EmbedLitePuppetWidget.cpp
Expand Up @@ -19,7 +19,6 @@
#include "mozilla/layers/ImageBridgeChild.h"
#include "mozilla/ipc/MessageChannel.h"
#include "EmbedLitePuppetWidget.h"
#include "EmbedLiteView.h"
#include "nsIWidgetListener.h"
#include "Layers.h"
#include "BasicLayers.h"
Expand Down Expand Up @@ -90,7 +89,7 @@ EmbedLitePuppetWidget::EmbedLitePuppetWidget(EmbedLiteWindowBaseChild* window,
, mHasCompositor(false)
, mIMEComposing(false)
, mParent(nullptr)
, mRotation(ROTATION_0)
, mRotation(mozilla::ROTATION_0)
, mMargins(0, 0, 0, 0)
, mDPI(-1.0)
{
Expand Down Expand Up @@ -334,7 +333,7 @@ EmbedLitePuppetWidget::Resize(double aWidth, double aHeight, bool aRepaint)
LOGT("sz[%i,%i]->[%g,%g]", oldBounds.width, oldBounds.height, aWidth, aHeight);

mNaturalBounds.SizeTo(nsIntSize(NSToIntRound(aWidth), NSToIntRound(aHeight)));
if (mRotation == ROTATION_0 || mRotation == ROTATION_180) {
if (mRotation == mozilla::ROTATION_0 || mRotation == mozilla::ROTATION_180) {
mBounds.SizeTo(nsIntSize(NSToIntRound(aWidth), NSToIntRound(aHeight)));
} else {
mBounds.SizeTo(nsIntSize(NSToIntRound(aHeight), NSToIntRound(aWidth)));
Expand Down
1 change: 1 addition & 0 deletions embedding/embedlite/embedshared/EmbedLitePuppetWidget.h
Expand Up @@ -19,6 +19,7 @@

#include "EmbedLiteViewChildIface.h"
#include "mozilla/Attributes.h"
#include "mozilla/WidgetUtils.h"
#include "nsBaseWidget.h"
#include "nsCOMArray.h"
#include "nsRect.h"
Expand Down
2 changes: 0 additions & 2 deletions embedding/embedlite/embedshared/EmbedLiteViewIface.idl
Expand Up @@ -7,7 +7,6 @@

%{C++
#include "mozilla/gfx/Matrix.h"
#include "mozilla/WidgetUtils.h"
#include "gfxRect.h"
#include "InputData.h"
#include "EmbedLiteView.h"
Expand All @@ -19,7 +18,6 @@ class nsString;
%}
[ref] native nsStringTArrayRef(nsTArray<nsString>);
[ref] native gfxMatrix(mozilla::gfx::Matrix);
[ref] native ScreenRotation(mozilla::ScreenRotation);
[ref] native gfxRect(gfxRect);
[ref] native nsIntPoint(nsIntPoint);
[ref] native nsIntRect(nsIntRect);
Expand Down

0 comments on commit 1d30d93

Please sign in to comment.