VisibleContentRectUpdateInfo.h [plain text]
#ifndef VisibleContentRectUpdateInfo_h
#define VisibleContentRectUpdateInfo_h
#include <WebCore/FloatRect.h>
namespace IPC {
class ArgumentDecoder;
class ArgumentEncoder;
}
namespace WebKit {
class VisibleContentRectUpdateInfo {
public:
VisibleContentRectUpdateInfo() = default;
VisibleContentRectUpdateInfo(const WebCore::FloatRect& exposedContentRect, const WebCore::FloatRect& unobscuredContentRect,
const WebCore::FloatRect& unobscuredRectInScrollViewCoordinates, const WebCore::FloatRect& customFixedPositionRect,
const WebCore::FloatSize& obscuredInset, double scale, bool inStableState, bool isChangingObscuredInsetsInteractively, bool allowShrinkToFit, bool enclosedInScrollableAncestorView,
double timestamp, double horizontalVelocity, double verticalVelocity, double scaleChangeRate, uint64_t lastLayerTreeTransactionId)
: m_exposedContentRect(exposedContentRect)
, m_unobscuredContentRect(unobscuredContentRect)
, m_unobscuredRectInScrollViewCoordinates(unobscuredRectInScrollViewCoordinates)
, m_customFixedPositionRect(customFixedPositionRect)
, m_obscuredInset(obscuredInset)
, m_lastLayerTreeTransactionID(lastLayerTreeTransactionId)
, m_scale(scale)
, m_timestamp(timestamp)
, m_horizontalVelocity(horizontalVelocity)
, m_verticalVelocity(verticalVelocity)
, m_scaleChangeRate(scaleChangeRate)
, m_inStableState(inStableState)
, m_isChangingObscuredInsetsInteractively(isChangingObscuredInsetsInteractively)
, m_allowShrinkToFit(allowShrinkToFit)
, m_enclosedInScrollableAncestorView(enclosedInScrollableAncestorView)
{
}
const WebCore::FloatRect& exposedContentRect() const { return m_exposedContentRect; }
const WebCore::FloatRect& unobscuredContentRect() const { return m_unobscuredContentRect; }
const WebCore::FloatRect& unobscuredRectInScrollViewCoordinates() const { return m_unobscuredRectInScrollViewCoordinates; }
const WebCore::FloatRect& customFixedPositionRect() const { return m_customFixedPositionRect; }
const WebCore::FloatSize obscuredInset() const { return m_obscuredInset; }
double scale() const { return m_scale; }
bool inStableState() const { return m_inStableState; }
bool isChangingObscuredInsetsInteractively() const { return m_isChangingObscuredInsetsInteractively; }
bool allowShrinkToFit() const { return m_allowShrinkToFit; }
bool enclosedInScrollableAncestorView() const { return m_enclosedInScrollableAncestorView; }
double timestamp() const { return m_timestamp; }
double horizontalVelocity() const { return m_horizontalVelocity; }
double verticalVelocity() const { return m_verticalVelocity; }
double scaleChangeRate() const { return m_scaleChangeRate; }
uint64_t lastLayerTreeTransactionID() const { return m_lastLayerTreeTransactionID; }
void encode(IPC::ArgumentEncoder&) const;
static bool decode(IPC::ArgumentDecoder&, VisibleContentRectUpdateInfo&);
private:
WebCore::FloatRect m_exposedContentRect;
WebCore::FloatRect m_unobscuredContentRect;
WebCore::FloatRect m_unobscuredRectInScrollViewCoordinates;
WebCore::FloatRect m_customFixedPositionRect;
WebCore::FloatSize m_obscuredInset;
uint64_t m_lastLayerTreeTransactionID { 0 };
double m_scale { -1 };
double m_timestamp { 0 };
double m_horizontalVelocity { 0 };
double m_verticalVelocity { 0 };
double m_scaleChangeRate { 0 };
bool m_inStableState { false };
bool m_isChangingObscuredInsetsInteractively { false };
bool m_allowShrinkToFit { false };
bool m_enclosedInScrollableAncestorView { false };
};
inline bool operator==(const VisibleContentRectUpdateInfo& a, const VisibleContentRectUpdateInfo& b)
{
return a.scale() == b.scale()
&& a.exposedContentRect() == b.exposedContentRect()
&& a.unobscuredContentRect() == b.unobscuredContentRect()
&& a.customFixedPositionRect() == b.customFixedPositionRect()
&& a.obscuredInset() == b.obscuredInset()
&& a.horizontalVelocity() == b.horizontalVelocity()
&& a.verticalVelocity() == b.verticalVelocity()
&& a.scaleChangeRate() == b.scaleChangeRate()
&& a.inStableState() == b.inStableState()
&& a.allowShrinkToFit() == b.allowShrinkToFit()
&& a.enclosedInScrollableAncestorView() == b.enclosedInScrollableAncestorView();
}
}
#endif // VisibleContentRectUpdateInfo_h