This source file includes following definitions.
- toHostWindow
- screenDepth
- screenDepthPerComponent
- screenIsMonochrome
- screenRect
- screenAvailableRect
- screenColorProfile
#include "config.h"
#include "platform/PlatformScreen.h"
#include "platform/HostWindow.h"
#include "platform/Widget.h"
#include "public/platform/Platform.h"
#include "public/platform/WebScreenInfo.h"
namespace WebCore {
static HostWindow* toHostWindow(Widget* widget)
{
if (!widget)
return 0;
Widget* root = widget->root();
if (!root)
return 0;
return root->hostWindow();
}
int screenDepth(Widget* widget)
{
HostWindow* hostWindow = toHostWindow(widget);
if (!hostWindow)
return 0;
return hostWindow->screenInfo().depth;
}
int screenDepthPerComponent(Widget* widget)
{
HostWindow* hostWindow = toHostWindow(widget);
if (!hostWindow)
return 0;
return hostWindow->screenInfo().depthPerComponent;
}
bool screenIsMonochrome(Widget* widget)
{
HostWindow* hostWindow = toHostWindow(widget);
if (!hostWindow)
return false;
return hostWindow->screenInfo().isMonochrome;
}
FloatRect screenRect(Widget* widget)
{
HostWindow* hostWindow = toHostWindow(widget);
if (!hostWindow)
return FloatRect();
return IntRect(hostWindow->screenInfo().rect);
}
FloatRect screenAvailableRect(Widget* widget)
{
HostWindow* hostWindow = toHostWindow(widget);
if (!hostWindow)
return FloatRect();
return IntRect(hostWindow->screenInfo().availableRect);
}
void screenColorProfile(ColorProfile& toProfile)
{
blink::WebVector<char> profile;
blink::Platform::current()->screenColorProfile(&profile);
toProfile.append(profile.data(), profile.size());
}
}