forked from ataranto/CefSharp
/
WpfClientAdapter.cpp
37 lines (30 loc) · 1.03 KB
/
WpfClientAdapter.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "stdafx.h"
#include "CefWpfWebBrowser.h"
namespace CefSharp
{
bool WpfClientAdapter::GetViewRect(CefRefPtr<CefBrowser> browser, CefRect& rect)
{
return false;
}
bool WpfClientAdapter::GetScreenRect(CefRefPtr<CefBrowser> browser, CefRect& rect)
{
return false;
}
bool WpfClientAdapter::GetScreenPoint(CefRefPtr<CefBrowser> browser, int viewX, int viewY, int& screenX, int& screenY)
{
return false;
}
void WpfClientAdapter::OnPaint(CefRefPtr<CefBrowser> browser, PaintElementType type, const RectList& dirtyRects, const void* buffer)
{
int width, height;
browser->GetSize(type, width, height);
CefRect dummy;
// NB: We don't actually use dirtyRect, we rerender the entire buffer
// in the SetBuffer call regardless
_wpfBrowserControl->SetBuffer(width, height, dummy, buffer);
}
void WpfClientAdapter::OnCursorChange(CefRefPtr<CefBrowser> browser, CefCursorHandle cursor)
{
_wpfBrowserControl->SetCursor(cursor);
}
}