This source file includes following definitions.
- create
- clone
- thumbPosition
- thumbLength
- trackPosition
- trackLength
- hasButtons
- hasThumb
- trackRect
- thumbRect
- minimumThumbLength
- scrollbarThickness
- backButtonStartRect
- backButtonEndRect
- forwardButtonStartRect
- forwardButtonEndRect
- constrainTrackRectToTrackPieces
- splitTrack
#include "config.h"
#include "platform/exported/WebScrollbarThemeGeometryNative.h"
#include "platform/exported/WebScrollbarThemeClientImpl.h"
#include "platform/scroll/ScrollbarTheme.h"
#include "public/platform/WebScrollbar.h"
using namespace WebCore;
namespace blink {
PassOwnPtr<blink::WebScrollbarThemeGeometryNative> WebScrollbarThemeGeometryNative::create(WebCore::ScrollbarTheme* theme)
{
return adoptPtr(new WebScrollbarThemeGeometryNative(theme));
}
WebScrollbarThemeGeometryNative::WebScrollbarThemeGeometryNative(WebCore::ScrollbarTheme* theme)
: m_theme(theme)
{
}
WebScrollbarThemeGeometryNative* WebScrollbarThemeGeometryNative::clone() const
{
return new WebScrollbarThemeGeometryNative(m_theme);
}
int WebScrollbarThemeGeometryNative::thumbPosition(WebScrollbar* scrollbar)
{
WebScrollbarThemeClientImpl client(scrollbar);
return m_theme->thumbPosition(&client);
}
int WebScrollbarThemeGeometryNative::thumbLength(WebScrollbar* scrollbar)
{
WebScrollbarThemeClientImpl client(scrollbar);
return m_theme->thumbLength(&client);
}
int WebScrollbarThemeGeometryNative::trackPosition(WebScrollbar* scrollbar)
{
WebScrollbarThemeClientImpl client(scrollbar);
return m_theme->trackPosition(&client);
}
int WebScrollbarThemeGeometryNative::trackLength(WebScrollbar* scrollbar)
{
WebScrollbarThemeClientImpl client(scrollbar);
return m_theme->trackLength(&client);
}
bool WebScrollbarThemeGeometryNative::hasButtons(WebScrollbar* scrollbar)
{
WebScrollbarThemeClientImpl client(scrollbar);
return m_theme->hasButtons(&client);
}
bool WebScrollbarThemeGeometryNative::hasThumb(WebScrollbar* scrollbar)
{
WebScrollbarThemeClientImpl client(scrollbar);
return m_theme->hasThumb(&client);
}
WebRect WebScrollbarThemeGeometryNative::trackRect(WebScrollbar* scrollbar)
{
WebScrollbarThemeClientImpl client(scrollbar);
return m_theme->trackRect(&client);
}
WebRect WebScrollbarThemeGeometryNative::thumbRect(WebScrollbar* scrollbar)
{
WebScrollbarThemeClientImpl client(scrollbar);
return m_theme->thumbRect(&client);
}
int WebScrollbarThemeGeometryNative::minimumThumbLength(WebScrollbar* scrollbar)
{
WebScrollbarThemeClientImpl client(scrollbar);
return m_theme->minimumThumbLength(&client);
}
int WebScrollbarThemeGeometryNative::scrollbarThickness(WebScrollbar* scrollbar)
{
WebScrollbarThemeClientImpl client(scrollbar);
return m_theme->scrollbarThickness(client.controlSize());
}
WebRect WebScrollbarThemeGeometryNative::backButtonStartRect(WebScrollbar* scrollbar)
{
WebScrollbarThemeClientImpl client(scrollbar);
return m_theme->backButtonRect(&client, BackButtonStartPart, false);
}
WebRect WebScrollbarThemeGeometryNative::backButtonEndRect(WebScrollbar* scrollbar)
{
WebScrollbarThemeClientImpl client(scrollbar);
return m_theme->backButtonRect(&client, BackButtonEndPart, false);
}
WebRect WebScrollbarThemeGeometryNative::forwardButtonStartRect(WebScrollbar* scrollbar)
{
WebScrollbarThemeClientImpl client(scrollbar);
return m_theme->forwardButtonRect(&client, ForwardButtonStartPart, false);
}
WebRect WebScrollbarThemeGeometryNative::forwardButtonEndRect(WebScrollbar* scrollbar)
{
WebScrollbarThemeClientImpl client(scrollbar);
return m_theme->forwardButtonRect(&client, ForwardButtonEndPart, false);
}
WebRect WebScrollbarThemeGeometryNative::constrainTrackRectToTrackPieces(WebScrollbar* scrollbar, const WebRect& rect)
{
WebScrollbarThemeClientImpl client(scrollbar);
return m_theme->constrainTrackRectToTrackPieces(&client, IntRect(rect));
}
void WebScrollbarThemeGeometryNative::splitTrack(WebScrollbar* scrollbar, const WebRect& webTrack, WebRect& webStartTrack, WebRect& webThumb, WebRect& webEndTrack)
{
WebScrollbarThemeClientImpl client(scrollbar);
IntRect track(webTrack);
IntRect startTrack;
IntRect thumb;
IntRect endTrack;
m_theme->splitTrack(&client, track, startTrack, thumb, endTrack);
webStartTrack = startTrack;
webThumb = thumb;
webEndTrack = endTrack;
}
}