2013-01-17 19:39:09 +01:00
|
|
|
// Copyright (c) 2013 The Chromium Embedded Framework Authors. All rights
|
2011-05-20 16:42:25 +02:00
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
// can be found in the LICENSE file.
|
|
|
|
//
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
//
|
2011-12-08 02:38:30 +01:00
|
|
|
// This file was generated by the CEF translator tool. If making changes by
|
|
|
|
// hand only do so within the body of existing method and function
|
2011-05-20 16:42:25 +02:00
|
|
|
// implementations. See the translator.README.txt file in the tools directory
|
|
|
|
// for more information.
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "libcef_dll/cpptoc/render_handler_cpptoc.h"
|
|
|
|
#include "libcef_dll/ctocpp/browser_ctocpp.h"
|
|
|
|
|
|
|
|
|
|
|
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
|
|
|
|
|
|
|
int CEF_CALLBACK render_handler_get_view_rect(
|
|
|
|
struct _cef_render_handler_t* self, cef_browser_t* browser,
|
2012-01-10 00:46:23 +01:00
|
|
|
cef_rect_t* rect) {
|
2011-12-08 02:38:30 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(self);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!self)
|
|
|
|
return 0;
|
|
|
|
// Verify param: browser; type: refptr_diff
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(browser);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!browser)
|
|
|
|
return 0;
|
|
|
|
// Verify param: rect; type: simple_byref
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(rect);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!rect)
|
2011-05-20 16:42:25 +02:00
|
|
|
return 0;
|
|
|
|
|
2011-12-08 02:38:30 +01:00
|
|
|
// Translate param: rect; type: simple_byref
|
|
|
|
CefRect rectVal = rect?*rect:CefRect();
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefRenderHandlerCppToC::Get(self)->GetViewRect(
|
|
|
|
CefBrowserCToCpp::Wrap(browser),
|
|
|
|
rectVal);
|
|
|
|
|
|
|
|
// Restore param: rect; type: simple_byref
|
|
|
|
if (rect)
|
|
|
|
*rect = rectVal;
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
2011-05-20 16:42:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
int CEF_CALLBACK render_handler_get_screen_rect(
|
|
|
|
struct _cef_render_handler_t* self, cef_browser_t* browser,
|
2012-01-10 00:46:23 +01:00
|
|
|
cef_rect_t* rect) {
|
2011-12-08 02:38:30 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(self);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!self)
|
|
|
|
return 0;
|
|
|
|
// Verify param: browser; type: refptr_diff
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(browser);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!browser)
|
|
|
|
return 0;
|
|
|
|
// Verify param: rect; type: simple_byref
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(rect);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!rect)
|
2011-05-20 16:42:25 +02:00
|
|
|
return 0;
|
|
|
|
|
2011-12-08 02:38:30 +01:00
|
|
|
// Translate param: rect; type: simple_byref
|
|
|
|
CefRect rectVal = rect?*rect:CefRect();
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefRenderHandlerCppToC::Get(self)->GetScreenRect(
|
|
|
|
CefBrowserCToCpp::Wrap(browser),
|
|
|
|
rectVal);
|
|
|
|
|
|
|
|
// Restore param: rect; type: simple_byref
|
|
|
|
if (rect)
|
|
|
|
*rect = rectVal;
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
2011-05-20 16:42:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
int CEF_CALLBACK render_handler_get_screen_point(
|
|
|
|
struct _cef_render_handler_t* self, cef_browser_t* browser, int viewX,
|
2012-01-10 00:46:23 +01:00
|
|
|
int viewY, int* screenX, int* screenY) {
|
2011-12-08 02:38:30 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(self);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!self)
|
|
|
|
return 0;
|
|
|
|
// Verify param: browser; type: refptr_diff
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(browser);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!browser)
|
|
|
|
return 0;
|
|
|
|
// Verify param: screenX; type: simple_byref
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(screenX);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!screenX)
|
|
|
|
return 0;
|
|
|
|
// Verify param: screenY; type: simple_byref
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(screenY);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!screenY)
|
2011-05-20 16:42:25 +02:00
|
|
|
return 0;
|
|
|
|
|
2011-12-08 02:38:30 +01:00
|
|
|
// Translate param: screenX; type: simple_byref
|
|
|
|
int screenXVal = screenX?*screenX:0;
|
|
|
|
// Translate param: screenY; type: simple_byref
|
|
|
|
int screenYVal = screenY?*screenY:0;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefRenderHandlerCppToC::Get(self)->GetScreenPoint(
|
|
|
|
CefBrowserCToCpp::Wrap(browser),
|
|
|
|
viewX,
|
|
|
|
viewY,
|
|
|
|
screenXVal,
|
|
|
|
screenYVal);
|
|
|
|
|
|
|
|
// Restore param: screenX; type: simple_byref
|
|
|
|
if (screenX)
|
|
|
|
*screenX = screenXVal;
|
|
|
|
// Restore param: screenY; type: simple_byref
|
|
|
|
if (screenY)
|
|
|
|
*screenY = screenYVal;
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
2011-05-20 16:42:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK render_handler_on_popup_show(
|
2012-01-10 00:46:23 +01:00
|
|
|
struct _cef_render_handler_t* self, cef_browser_t* browser, int show) {
|
2011-12-08 02:38:30 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(self);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!self)
|
|
|
|
return;
|
|
|
|
// Verify param: browser; type: refptr_diff
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(browser);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!browser)
|
2011-05-20 16:42:25 +02:00
|
|
|
return;
|
|
|
|
|
2011-12-08 02:38:30 +01:00
|
|
|
// Execute
|
2011-05-20 16:42:25 +02:00
|
|
|
CefRenderHandlerCppToC::Get(self)->OnPopupShow(
|
2011-12-08 02:38:30 +01:00
|
|
|
CefBrowserCToCpp::Wrap(browser),
|
|
|
|
show?true:false);
|
2011-05-20 16:42:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK render_handler_on_popup_size(
|
|
|
|
struct _cef_render_handler_t* self, cef_browser_t* browser,
|
2012-01-10 00:46:23 +01:00
|
|
|
const cef_rect_t* rect) {
|
2011-12-08 02:38:30 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(self);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!self)
|
|
|
|
return;
|
|
|
|
// Verify param: browser; type: refptr_diff
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(browser);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!browser)
|
|
|
|
return;
|
|
|
|
// Verify param: rect; type: simple_byref_const
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(rect);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!rect)
|
2011-05-20 16:42:25 +02:00
|
|
|
return;
|
|
|
|
|
2011-12-08 02:38:30 +01:00
|
|
|
// Translate param: rect; type: simple_byref_const
|
|
|
|
CefRect rectVal = rect?*rect:CefRect();
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefRenderHandlerCppToC::Get(self)->OnPopupSize(
|
|
|
|
CefBrowserCToCpp::Wrap(browser),
|
|
|
|
rectVal);
|
2011-05-20 16:42:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK render_handler_on_paint(struct _cef_render_handler_t* self,
|
|
|
|
cef_browser_t* browser, enum cef_paint_element_type_t type,
|
2012-01-10 00:46:23 +01:00
|
|
|
size_t dirtyRectsCount, cef_rect_t const* dirtyRects,
|
|
|
|
const void* buffer) {
|
2011-12-08 02:38:30 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(self);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!self)
|
|
|
|
return;
|
|
|
|
// Verify param: browser; type: refptr_diff
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(browser);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!browser)
|
|
|
|
return;
|
|
|
|
// Verify param: dirtyRects; type: simple_vec_byref_const
|
|
|
|
DCHECK(dirtyRectsCount == 0 || dirtyRects);
|
|
|
|
if (dirtyRectsCount > 0 && !dirtyRects)
|
|
|
|
return;
|
|
|
|
// Verify param: buffer; type: simple_byaddr
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(buffer);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!buffer)
|
2011-05-20 16:42:25 +02:00
|
|
|
return;
|
|
|
|
|
2011-12-08 02:38:30 +01:00
|
|
|
// Translate param: dirtyRects; type: simple_vec_byref_const
|
|
|
|
std::vector<CefRect > dirtyRectsList;
|
|
|
|
if (dirtyRectsCount > 0) {
|
|
|
|
for (size_t i = 0; i < dirtyRectsCount; ++i) {
|
|
|
|
dirtyRectsList.push_back(dirtyRects[i]);
|
|
|
|
}
|
|
|
|
}
|
2011-11-09 21:09:24 +01:00
|
|
|
|
2011-12-08 02:38:30 +01:00
|
|
|
// Execute
|
|
|
|
CefRenderHandlerCppToC::Get(self)->OnPaint(
|
|
|
|
CefBrowserCToCpp::Wrap(browser),
|
|
|
|
type,
|
|
|
|
dirtyRectsList,
|
|
|
|
buffer);
|
2011-05-20 16:42:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK render_handler_on_cursor_change(
|
|
|
|
struct _cef_render_handler_t* self, cef_browser_t* browser,
|
2012-01-10 00:46:23 +01:00
|
|
|
cef_cursor_handle_t cursor) {
|
2011-12-08 02:38:30 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(self);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!self)
|
|
|
|
return;
|
|
|
|
// Verify param: browser; type: refptr_diff
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(browser);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!browser)
|
2011-05-20 16:42:25 +02:00
|
|
|
return;
|
|
|
|
|
2011-12-08 02:38:30 +01:00
|
|
|
// Execute
|
|
|
|
CefRenderHandlerCppToC::Get(self)->OnCursorChange(
|
|
|
|
CefBrowserCToCpp::Wrap(browser),
|
|
|
|
cursor);
|
2011-05-20 16:42:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefRenderHandlerCppToC::CefRenderHandlerCppToC(CefRenderHandler* cls)
|
|
|
|
: CefCppToC<CefRenderHandlerCppToC, CefRenderHandler, cef_render_handler_t>(
|
2012-01-10 00:46:23 +01:00
|
|
|
cls) {
|
2011-05-20 16:42:25 +02:00
|
|
|
struct_.struct_.get_view_rect = render_handler_get_view_rect;
|
|
|
|
struct_.struct_.get_screen_rect = render_handler_get_screen_rect;
|
|
|
|
struct_.struct_.get_screen_point = render_handler_get_screen_point;
|
|
|
|
struct_.struct_.on_popup_show = render_handler_on_popup_show;
|
|
|
|
struct_.struct_.on_popup_size = render_handler_on_popup_size;
|
|
|
|
struct_.struct_.on_paint = render_handler_on_paint;
|
|
|
|
struct_.struct_.on_cursor_change = render_handler_on_cursor_change;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifndef NDEBUG
|
|
|
|
template<> long CefCppToC<CefRenderHandlerCppToC, CefRenderHandler,
|
|
|
|
cef_render_handler_t>::DebugObjCt = 0;
|
|
|
|
#endif
|
|
|
|
|