#include "config.h"
#include "Screen.h"
#include "FloatRect.h"
#include "Frame.h"
#include "FrameView.h"
#include "InspectorInstrumentation.h"
#include "PlatformScreen.h"
#include "Settings.h"
#include "Widget.h"
namespace WebCore {
Screen::Screen(Frame* frame)
: DOMWindowProperty(frame)
{
}
unsigned Screen::height() const
{
if (!m_frame)
return 0;
long height = static_cast<long>(screenRect(m_frame->view()).height());
InspectorInstrumentation::applyScreenHeightOverride(m_frame, &height);
return static_cast<unsigned>(height);
}
unsigned Screen::width() const
{
if (!m_frame)
return 0;
long width = static_cast<long>(screenRect(m_frame->view()).width());
InspectorInstrumentation::applyScreenWidthOverride(m_frame, &width);
return static_cast<unsigned>(width);
}
unsigned Screen::colorDepth() const
{
if (!m_frame)
return 0;
return static_cast<unsigned>(screenDepth(m_frame->view()));
}
unsigned Screen::pixelDepth() const
{
if (!m_frame)
return 0;
return static_cast<unsigned>(screenDepth(m_frame->view()));
}
int Screen::availLeft() const
{
if (!m_frame)
return 0;
return static_cast<int>(screenAvailableRect(m_frame->view()).x());
}
int Screen::availTop() const
{
if (!m_frame)
return 0;
return static_cast<int>(screenAvailableRect(m_frame->view()).y());
}
unsigned Screen::availHeight() const
{
if (!m_frame)
return 0;
return static_cast<unsigned>(screenAvailableRect(m_frame->view()).height());
}
unsigned Screen::availWidth() const
{
if (!m_frame)
return 0;
return static_cast<unsigned>(screenAvailableRect(m_frame->view()).width());
}
}