2017-01-11 00:00:30 +01:00
|
|
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
2016-01-19 21:09:01 +01:00
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
// can be found in the LICENSE file.
|
|
|
|
//
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// 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
|
|
|
|
// implementations. See the translator.README.txt file in the tools directory
|
|
|
|
// for more information.
|
|
|
|
//
|
2017-05-17 11:29:28 +02:00
|
|
|
// $hash=8df90eb582df20061513fb80264da53b9d97849b$
|
|
|
|
//
|
2016-01-19 21:09:01 +01:00
|
|
|
|
|
|
|
#include "libcef_dll/cpptoc/menu_model_delegate_cpptoc.h"
|
|
|
|
#include "libcef_dll/ctocpp/menu_model_ctocpp.h"
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
void CEF_CALLBACK
|
|
|
|
menu_model_delegate_execute_command(struct _cef_menu_model_delegate_t* self,
|
|
|
|
cef_menu_model_t* menu_model,
|
|
|
|
int command_id,
|
|
|
|
cef_event_flags_t event_flags) {
|
2016-01-19 21:09:01 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return;
|
|
|
|
// Verify param: menu_model; type: refptr_diff
|
|
|
|
DCHECK(menu_model);
|
|
|
|
if (!menu_model)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefMenuModelDelegateCppToC::Get(self)->ExecuteCommand(
|
2017-05-17 11:29:28 +02:00
|
|
|
CefMenuModelCToCpp::Wrap(menu_model), command_id, event_flags);
|
2016-01-19 21:09:01 +01:00
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
void CEF_CALLBACK
|
|
|
|
menu_model_delegate_mouse_outside_menu(struct _cef_menu_model_delegate_t* self,
|
|
|
|
cef_menu_model_t* menu_model,
|
|
|
|
const cef_point_t* screen_point) {
|
2017-02-22 19:05:27 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return;
|
|
|
|
// Verify param: menu_model; type: refptr_diff
|
|
|
|
DCHECK(menu_model);
|
|
|
|
if (!menu_model)
|
|
|
|
return;
|
|
|
|
// Verify param: screen_point; type: simple_byref_const
|
|
|
|
DCHECK(screen_point);
|
|
|
|
if (!screen_point)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Translate param: screen_point; type: simple_byref_const
|
2017-05-17 11:29:28 +02:00
|
|
|
CefPoint screen_pointVal = screen_point ? *screen_point : CefPoint();
|
2017-02-22 19:05:27 +01:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefMenuModelDelegateCppToC::Get(self)->MouseOutsideMenu(
|
2017-05-17 11:29:28 +02:00
|
|
|
CefMenuModelCToCpp::Wrap(menu_model), screen_pointVal);
|
2017-02-22 19:05:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK menu_model_delegate_unhandled_open_submenu(
|
2017-05-17 11:29:28 +02:00
|
|
|
struct _cef_menu_model_delegate_t* self,
|
|
|
|
cef_menu_model_t* menu_model,
|
2017-02-22 19:05:27 +01:00
|
|
|
int is_rtl) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return;
|
|
|
|
// Verify param: menu_model; type: refptr_diff
|
|
|
|
DCHECK(menu_model);
|
|
|
|
if (!menu_model)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefMenuModelDelegateCppToC::Get(self)->UnhandledOpenSubmenu(
|
2017-05-17 11:29:28 +02:00
|
|
|
CefMenuModelCToCpp::Wrap(menu_model), is_rtl ? true : false);
|
2017-02-22 19:05:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK menu_model_delegate_unhandled_close_submenu(
|
2017-05-17 11:29:28 +02:00
|
|
|
struct _cef_menu_model_delegate_t* self,
|
|
|
|
cef_menu_model_t* menu_model,
|
2017-02-22 19:05:27 +01:00
|
|
|
int is_rtl) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return;
|
|
|
|
// Verify param: menu_model; type: refptr_diff
|
|
|
|
DCHECK(menu_model);
|
|
|
|
if (!menu_model)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefMenuModelDelegateCppToC::Get(self)->UnhandledCloseSubmenu(
|
2017-05-17 11:29:28 +02:00
|
|
|
CefMenuModelCToCpp::Wrap(menu_model), is_rtl ? true : false);
|
2017-02-22 19:05:27 +01:00
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
void CEF_CALLBACK
|
|
|
|
menu_model_delegate_menu_will_show(struct _cef_menu_model_delegate_t* self,
|
|
|
|
cef_menu_model_t* menu_model) {
|
2016-01-19 21:09:01 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return;
|
|
|
|
// Verify param: menu_model; type: refptr_diff
|
|
|
|
DCHECK(menu_model);
|
|
|
|
if (!menu_model)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefMenuModelDelegateCppToC::Get(self)->MenuWillShow(
|
|
|
|
CefMenuModelCToCpp::Wrap(menu_model));
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
void CEF_CALLBACK
|
|
|
|
menu_model_delegate_menu_closed(struct _cef_menu_model_delegate_t* self,
|
|
|
|
cef_menu_model_t* menu_model) {
|
2016-10-28 19:17:32 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return;
|
|
|
|
// Verify param: menu_model; type: refptr_diff
|
|
|
|
DCHECK(menu_model);
|
|
|
|
if (!menu_model)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefMenuModelDelegateCppToC::Get(self)->MenuClosed(
|
|
|
|
CefMenuModelCToCpp::Wrap(menu_model));
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
int CEF_CALLBACK
|
|
|
|
menu_model_delegate_format_label(struct _cef_menu_model_delegate_t* self,
|
|
|
|
cef_menu_model_t* menu_model,
|
|
|
|
cef_string_t* label) {
|
2016-10-28 19:17:32 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return 0;
|
|
|
|
// Verify param: menu_model; type: refptr_diff
|
|
|
|
DCHECK(menu_model);
|
|
|
|
if (!menu_model)
|
|
|
|
return 0;
|
|
|
|
// Verify param: label; type: string_byref
|
|
|
|
DCHECK(label);
|
|
|
|
if (!label)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// Translate param: label; type: string_byref
|
|
|
|
CefString labelStr(label);
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefMenuModelDelegateCppToC::Get(self)->FormatLabel(
|
2017-05-17 11:29:28 +02:00
|
|
|
CefMenuModelCToCpp::Wrap(menu_model), labelStr);
|
2016-10-28 19:17:32 +02:00
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
2016-01-19 21:09:01 +01:00
|
|
|
} // namespace
|
|
|
|
|
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefMenuModelDelegateCppToC::CefMenuModelDelegateCppToC() {
|
|
|
|
GetStruct()->execute_command = menu_model_delegate_execute_command;
|
2017-02-22 19:05:27 +01:00
|
|
|
GetStruct()->mouse_outside_menu = menu_model_delegate_mouse_outside_menu;
|
|
|
|
GetStruct()->unhandled_open_submenu =
|
|
|
|
menu_model_delegate_unhandled_open_submenu;
|
|
|
|
GetStruct()->unhandled_close_submenu =
|
|
|
|
menu_model_delegate_unhandled_close_submenu;
|
2016-01-19 21:09:01 +01:00
|
|
|
GetStruct()->menu_will_show = menu_model_delegate_menu_will_show;
|
2016-10-28 19:17:32 +02:00
|
|
|
GetStruct()->menu_closed = menu_model_delegate_menu_closed;
|
|
|
|
GetStruct()->format_label = menu_model_delegate_format_label;
|
2016-01-19 21:09:01 +01:00
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
CefRefPtr<CefMenuModelDelegate> CefCppToCRefCounted<
|
|
|
|
CefMenuModelDelegateCppToC,
|
|
|
|
CefMenuModelDelegate,
|
|
|
|
cef_menu_model_delegate_t>::UnwrapDerived(CefWrapperType type,
|
|
|
|
cef_menu_model_delegate_t* s) {
|
2016-01-19 21:09:01 +01:00
|
|
|
NOTREACHED() << "Unexpected class type: " << type;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2016-09-01 13:24:30 +02:00
|
|
|
#if DCHECK_IS_ON()
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
base::AtomicRefCount
|
|
|
|
CefCppToCRefCounted<CefMenuModelDelegateCppToC,
|
|
|
|
CefMenuModelDelegate,
|
|
|
|
cef_menu_model_delegate_t>::DebugObjCt = 0;
|
2016-01-19 21:09:01 +01:00
|
|
|
#endif
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
CefWrapperType CefCppToCRefCounted<CefMenuModelDelegateCppToC,
|
|
|
|
CefMenuModelDelegate,
|
|
|
|
cef_menu_model_delegate_t>::kWrapperType =
|
2016-01-19 21:09:01 +01:00
|
|
|
WT_MENU_MODEL_DELEGATE;
|