cef/libcef_dll/cpptoc/menu_model_cpptoc.cc

1054 lines
27 KiB
C++
Raw Normal View History

2016-01-08 20:00:27 +01:00
// Copyright (c) 2016 The Chromium Embedded Framework Authors. All rights
// 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.
//
#include "libcef_dll/cpptoc/menu_model_cpptoc.h"
Implement Views framework on Windows and Linux (issue #1749). - Add Views header files in a new include/views directory. - Add initial top-level window (CefWindow), control (CefBrowserView, CefLabelButton, CefMenuButton, CefPanel, CefScrollView, CefTextfield) and layout (CefBoxLayout, CefFlowLayout) support. See libcef/browser/views/view_impl.h comments for implementation details. - Add Views example usage in cefclient and cefsimple and Views unit tests in cef_unittests. Pass the `--use-views` command-line flag to cefclient, cefsimple and cef_unittests to run using the Views framework instead of platform APIs. For cefclient and cefsimple this will create the browser window and all related functionality using the Views framework. For cef_unittests this will run all tests (except OSR tests) in a Views-based browser window. Views- specific unit tests (`--gtest_filter=Views*`) will be run even if the the `--use-views` flag is not specified. - Pass the `--hide-frame` command-line flag to cefclient to demo a frameless Views-based browser window. - Pass the `--hide-controls` command-line flag to cefclient to demo a browser window without top controls. This also works in non-Views mode. - Pass the `--enable-high-dpi-support` command-line flag to cef_unittests on Windows to test high-DPI support on a display that supports it. - Add CefImage for reading/writing image file formats. - Add CefBrowser::DownloadImage() for downloading image URLs as a CefImage representation. This is primarily for loading favicons. - Add CefMenuModel::CreateMenuModel() and CefMenuModelDelegate for creating custom menus. This is primarily for use with CefMenuButton. - Add CefBrowser::TryCloseBrowser() helper for closing a browser. Also improve related documentation in cef_life_span_handler.h. - Rename cef_page_range_t to cef_range_t. It is now also used by CefTextfield. - Remove CefLifeSpanHandler::RunModal() which is never called. - Add draggable regions example to cefclient.
2016-01-19 21:09:01 +01:00
#include "libcef_dll/ctocpp/menu_model_delegate_ctocpp.h"
// GLOBAL FUNCTIONS - Body may be edited by hand.
CEF_EXPORT cef_menu_model_t* cef_menu_model_create(
struct _cef_menu_model_delegate_t* delegate) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: delegate; type: refptr_diff
DCHECK(delegate);
if (!delegate)
return NULL;
// Execute
CefRefPtr<CefMenuModel> _retval = CefMenuModel::CreateMenuModel(
CefMenuModelDelegateCToCpp::Wrap(delegate));
// Return type: refptr_same
return CefMenuModelCppToC::Wrap(_retval);
}
namespace {
// MEMBER FUNCTIONS - Body may be edited by hand.
int CEF_CALLBACK menu_model_clear(struct _cef_menu_model_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->Clear();
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_get_count(struct _cef_menu_model_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
int _retval = CefMenuModelCppToC::Get(self)->GetCount();
// Return type: simple
return _retval;
}
int CEF_CALLBACK menu_model_add_separator(struct _cef_menu_model_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->AddSeparator();
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_add_item(struct _cef_menu_model_t* self,
int command_id, const cef_string_t* label) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Verify param: label; type: string_byref_const
DCHECK(label);
if (!label)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->AddItem(
command_id,
CefString(label));
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_add_check_item(struct _cef_menu_model_t* self,
int command_id, const cef_string_t* label) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Verify param: label; type: string_byref_const
DCHECK(label);
if (!label)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->AddCheckItem(
command_id,
CefString(label));
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_add_radio_item(struct _cef_menu_model_t* self,
int command_id, const cef_string_t* label, int group_id) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Verify param: label; type: string_byref_const
DCHECK(label);
if (!label)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->AddRadioItem(
command_id,
CefString(label),
group_id);
// Return type: bool
return _retval;
}
struct _cef_menu_model_t* CEF_CALLBACK menu_model_add_sub_menu(
struct _cef_menu_model_t* self, int command_id,
const cef_string_t* label) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return NULL;
// Verify param: label; type: string_byref_const
DCHECK(label);
if (!label)
return NULL;
// Execute
CefRefPtr<CefMenuModel> _retval = CefMenuModelCppToC::Get(self)->AddSubMenu(
command_id,
CefString(label));
// Return type: refptr_same
return CefMenuModelCppToC::Wrap(_retval);
}
int CEF_CALLBACK menu_model_insert_separator_at(struct _cef_menu_model_t* self,
int index) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->InsertSeparatorAt(
index);
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_insert_item_at(struct _cef_menu_model_t* self,
int index, int command_id, const cef_string_t* label) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Verify param: label; type: string_byref_const
DCHECK(label);
if (!label)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->InsertItemAt(
index,
command_id,
CefString(label));
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_insert_check_item_at(struct _cef_menu_model_t* self,
int index, int command_id, const cef_string_t* label) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Verify param: label; type: string_byref_const
DCHECK(label);
if (!label)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->InsertCheckItemAt(
index,
command_id,
CefString(label));
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_insert_radio_item_at(struct _cef_menu_model_t* self,
int index, int command_id, const cef_string_t* label, int group_id) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Verify param: label; type: string_byref_const
DCHECK(label);
if (!label)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->InsertRadioItemAt(
index,
command_id,
CefString(label),
group_id);
// Return type: bool
return _retval;
}
struct _cef_menu_model_t* CEF_CALLBACK menu_model_insert_sub_menu_at(
struct _cef_menu_model_t* self, int index, int command_id,
const cef_string_t* label) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return NULL;
// Verify param: label; type: string_byref_const
DCHECK(label);
if (!label)
return NULL;
// Execute
CefRefPtr<CefMenuModel> _retval = CefMenuModelCppToC::Get(
self)->InsertSubMenuAt(
index,
command_id,
CefString(label));
// Return type: refptr_same
return CefMenuModelCppToC::Wrap(_retval);
}
int CEF_CALLBACK menu_model_remove(struct _cef_menu_model_t* self,
int command_id) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->Remove(
command_id);
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_remove_at(struct _cef_menu_model_t* self,
int index) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->RemoveAt(
index);
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_get_index_of(struct _cef_menu_model_t* self,
int command_id) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
int _retval = CefMenuModelCppToC::Get(self)->GetIndexOf(
command_id);
// Return type: simple
return _retval;
}
int CEF_CALLBACK menu_model_get_command_id_at(struct _cef_menu_model_t* self,
int index) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
int _retval = CefMenuModelCppToC::Get(self)->GetCommandIdAt(
index);
// Return type: simple
return _retval;
}
int CEF_CALLBACK menu_model_set_command_id_at(struct _cef_menu_model_t* self,
int index, int command_id) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->SetCommandIdAt(
index,
command_id);
// Return type: bool
return _retval;
}
cef_string_userfree_t CEF_CALLBACK menu_model_get_label(
struct _cef_menu_model_t* self, int command_id) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return NULL;
// Execute
CefString _retval = CefMenuModelCppToC::Get(self)->GetLabel(
command_id);
// Return type: string
return _retval.DetachToUserFree();
}
cef_string_userfree_t CEF_CALLBACK menu_model_get_label_at(
struct _cef_menu_model_t* self, int index) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return NULL;
// Execute
CefString _retval = CefMenuModelCppToC::Get(self)->GetLabelAt(
index);
// Return type: string
return _retval.DetachToUserFree();
}
int CEF_CALLBACK menu_model_set_label(struct _cef_menu_model_t* self,
int command_id, const cef_string_t* label) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Verify param: label; type: string_byref_const
DCHECK(label);
if (!label)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->SetLabel(
command_id,
CefString(label));
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_set_label_at(struct _cef_menu_model_t* self,
int index, const cef_string_t* label) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Verify param: label; type: string_byref_const
DCHECK(label);
if (!label)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->SetLabelAt(
index,
CefString(label));
// Return type: bool
return _retval;
}
cef_menu_item_type_t CEF_CALLBACK menu_model_get_type(
struct _cef_menu_model_t* self, int command_id) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return MENUITEMTYPE_NONE;
// Execute
cef_menu_item_type_t _retval = CefMenuModelCppToC::Get(self)->GetType(
command_id);
// Return type: simple
return _retval;
}
cef_menu_item_type_t CEF_CALLBACK menu_model_get_type_at(
struct _cef_menu_model_t* self, int index) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return MENUITEMTYPE_NONE;
// Execute
cef_menu_item_type_t _retval = CefMenuModelCppToC::Get(self)->GetTypeAt(
index);
// Return type: simple
return _retval;
}
int CEF_CALLBACK menu_model_get_group_id(struct _cef_menu_model_t* self,
int command_id) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
int _retval = CefMenuModelCppToC::Get(self)->GetGroupId(
command_id);
// Return type: simple
return _retval;
}
int CEF_CALLBACK menu_model_get_group_id_at(struct _cef_menu_model_t* self,
int index) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
int _retval = CefMenuModelCppToC::Get(self)->GetGroupIdAt(
index);
// Return type: simple
return _retval;
}
int CEF_CALLBACK menu_model_set_group_id(struct _cef_menu_model_t* self,
int command_id, int group_id) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->SetGroupId(
command_id,
group_id);
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_set_group_id_at(struct _cef_menu_model_t* self,
int index, int group_id) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->SetGroupIdAt(
index,
group_id);
// Return type: bool
return _retval;
}
struct _cef_menu_model_t* CEF_CALLBACK menu_model_get_sub_menu(
struct _cef_menu_model_t* self, int command_id) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return NULL;
// Execute
CefRefPtr<CefMenuModel> _retval = CefMenuModelCppToC::Get(self)->GetSubMenu(
command_id);
// Return type: refptr_same
return CefMenuModelCppToC::Wrap(_retval);
}
struct _cef_menu_model_t* CEF_CALLBACK menu_model_get_sub_menu_at(
struct _cef_menu_model_t* self, int index) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return NULL;
// Execute
CefRefPtr<CefMenuModel> _retval = CefMenuModelCppToC::Get(self)->GetSubMenuAt(
index);
// Return type: refptr_same
return CefMenuModelCppToC::Wrap(_retval);
}
int CEF_CALLBACK menu_model_is_visible(struct _cef_menu_model_t* self,
int command_id) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->IsVisible(
command_id);
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_is_visible_at(struct _cef_menu_model_t* self,
int index) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->IsVisibleAt(
index);
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_set_visible(struct _cef_menu_model_t* self,
int command_id, int visible) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->SetVisible(
command_id,
visible?true:false);
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_set_visible_at(struct _cef_menu_model_t* self,
int index, int visible) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->SetVisibleAt(
index,
visible?true:false);
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_is_enabled(struct _cef_menu_model_t* self,
int command_id) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->IsEnabled(
command_id);
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_is_enabled_at(struct _cef_menu_model_t* self,
int index) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->IsEnabledAt(
index);
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_set_enabled(struct _cef_menu_model_t* self,
int command_id, int enabled) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->SetEnabled(
command_id,
enabled?true:false);
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_set_enabled_at(struct _cef_menu_model_t* self,
int index, int enabled) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->SetEnabledAt(
index,
enabled?true:false);
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_is_checked(struct _cef_menu_model_t* self,
int command_id) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->IsChecked(
command_id);
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_is_checked_at(struct _cef_menu_model_t* self,
int index) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->IsCheckedAt(
index);
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_set_checked(struct _cef_menu_model_t* self,
int command_id, int checked) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->SetChecked(
command_id,
checked?true:false);
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_set_checked_at(struct _cef_menu_model_t* self,
int index, int checked) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->SetCheckedAt(
index,
checked?true:false);
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_has_accelerator(struct _cef_menu_model_t* self,
int command_id) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->HasAccelerator(
command_id);
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_has_accelerator_at(struct _cef_menu_model_t* self,
int index) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->HasAcceleratorAt(
index);
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_set_accelerator(struct _cef_menu_model_t* self,
int command_id, int key_code, int shift_pressed, int ctrl_pressed,
int alt_pressed) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->SetAccelerator(
command_id,
key_code,
shift_pressed?true:false,
ctrl_pressed?true:false,
alt_pressed?true:false);
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_set_accelerator_at(struct _cef_menu_model_t* self,
int index, int key_code, int shift_pressed, int ctrl_pressed,
int alt_pressed) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->SetAcceleratorAt(
index,
key_code,
shift_pressed?true:false,
ctrl_pressed?true:false,
alt_pressed?true:false);
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_remove_accelerator(struct _cef_menu_model_t* self,
int command_id) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->RemoveAccelerator(
command_id);
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_remove_accelerator_at(
struct _cef_menu_model_t* self, int index) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->RemoveAcceleratorAt(
index);
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_get_accelerator(struct _cef_menu_model_t* self,
int command_id, int* key_code, int* shift_pressed, int* ctrl_pressed,
int* alt_pressed) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Verify param: key_code; type: simple_byref
DCHECK(key_code);
if (!key_code)
return 0;
// Verify param: shift_pressed; type: bool_byref
DCHECK(shift_pressed);
if (!shift_pressed)
return 0;
// Verify param: ctrl_pressed; type: bool_byref
DCHECK(ctrl_pressed);
if (!ctrl_pressed)
return 0;
// Verify param: alt_pressed; type: bool_byref
DCHECK(alt_pressed);
if (!alt_pressed)
return 0;
// Translate param: key_code; type: simple_byref
int key_codeVal = key_code?*key_code:0;
// Translate param: shift_pressed; type: bool_byref
bool shift_pressedBool = (shift_pressed && *shift_pressed)?true:false;
// Translate param: ctrl_pressed; type: bool_byref
bool ctrl_pressedBool = (ctrl_pressed && *ctrl_pressed)?true:false;
// Translate param: alt_pressed; type: bool_byref
bool alt_pressedBool = (alt_pressed && *alt_pressed)?true:false;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->GetAccelerator(
command_id,
key_codeVal,
shift_pressedBool,
ctrl_pressedBool,
alt_pressedBool);
// Restore param: key_code; type: simple_byref
if (key_code)
*key_code = key_codeVal;
// Restore param: shift_pressed; type: bool_byref
if (shift_pressed)
*shift_pressed = shift_pressedBool?true:false;
// Restore param: ctrl_pressed; type: bool_byref
if (ctrl_pressed)
*ctrl_pressed = ctrl_pressedBool?true:false;
// Restore param: alt_pressed; type: bool_byref
if (alt_pressed)
*alt_pressed = alt_pressedBool?true:false;
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_get_accelerator_at(struct _cef_menu_model_t* self,
int index, int* key_code, int* shift_pressed, int* ctrl_pressed,
int* alt_pressed) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Verify param: key_code; type: simple_byref
DCHECK(key_code);
if (!key_code)
return 0;
// Verify param: shift_pressed; type: bool_byref
DCHECK(shift_pressed);
if (!shift_pressed)
return 0;
// Verify param: ctrl_pressed; type: bool_byref
DCHECK(ctrl_pressed);
if (!ctrl_pressed)
return 0;
// Verify param: alt_pressed; type: bool_byref
DCHECK(alt_pressed);
if (!alt_pressed)
return 0;
// Translate param: key_code; type: simple_byref
int key_codeVal = key_code?*key_code:0;
// Translate param: shift_pressed; type: bool_byref
bool shift_pressedBool = (shift_pressed && *shift_pressed)?true:false;
// Translate param: ctrl_pressed; type: bool_byref
bool ctrl_pressedBool = (ctrl_pressed && *ctrl_pressed)?true:false;
// Translate param: alt_pressed; type: bool_byref
bool alt_pressedBool = (alt_pressed && *alt_pressed)?true:false;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->GetAcceleratorAt(
index,
key_codeVal,
shift_pressedBool,
ctrl_pressedBool,
alt_pressedBool);
// Restore param: key_code; type: simple_byref
if (key_code)
*key_code = key_codeVal;
// Restore param: shift_pressed; type: bool_byref
if (shift_pressed)
*shift_pressed = shift_pressedBool?true:false;
// Restore param: ctrl_pressed; type: bool_byref
if (ctrl_pressed)
*ctrl_pressed = ctrl_pressedBool?true:false;
// Restore param: alt_pressed; type: bool_byref
if (alt_pressed)
*alt_pressed = alt_pressedBool?true:false;
// Return type: bool
return _retval;
}
} // namespace
// CONSTRUCTOR - Do not edit by hand.
CefMenuModelCppToC::CefMenuModelCppToC() {
GetStruct()->clear = menu_model_clear;
GetStruct()->get_count = menu_model_get_count;
GetStruct()->add_separator = menu_model_add_separator;
GetStruct()->add_item = menu_model_add_item;
GetStruct()->add_check_item = menu_model_add_check_item;
GetStruct()->add_radio_item = menu_model_add_radio_item;
GetStruct()->add_sub_menu = menu_model_add_sub_menu;
GetStruct()->insert_separator_at = menu_model_insert_separator_at;
GetStruct()->insert_item_at = menu_model_insert_item_at;
GetStruct()->insert_check_item_at = menu_model_insert_check_item_at;
GetStruct()->insert_radio_item_at = menu_model_insert_radio_item_at;
GetStruct()->insert_sub_menu_at = menu_model_insert_sub_menu_at;
GetStruct()->remove = menu_model_remove;
GetStruct()->remove_at = menu_model_remove_at;
GetStruct()->get_index_of = menu_model_get_index_of;
GetStruct()->get_command_id_at = menu_model_get_command_id_at;
GetStruct()->set_command_id_at = menu_model_set_command_id_at;
GetStruct()->get_label = menu_model_get_label;
GetStruct()->get_label_at = menu_model_get_label_at;
GetStruct()->set_label = menu_model_set_label;
GetStruct()->set_label_at = menu_model_set_label_at;
GetStruct()->get_type = menu_model_get_type;
GetStruct()->get_type_at = menu_model_get_type_at;
GetStruct()->get_group_id = menu_model_get_group_id;
GetStruct()->get_group_id_at = menu_model_get_group_id_at;
GetStruct()->set_group_id = menu_model_set_group_id;
GetStruct()->set_group_id_at = menu_model_set_group_id_at;
GetStruct()->get_sub_menu = menu_model_get_sub_menu;
GetStruct()->get_sub_menu_at = menu_model_get_sub_menu_at;
GetStruct()->is_visible = menu_model_is_visible;
GetStruct()->is_visible_at = menu_model_is_visible_at;
GetStruct()->set_visible = menu_model_set_visible;
GetStruct()->set_visible_at = menu_model_set_visible_at;
GetStruct()->is_enabled = menu_model_is_enabled;
GetStruct()->is_enabled_at = menu_model_is_enabled_at;
GetStruct()->set_enabled = menu_model_set_enabled;
GetStruct()->set_enabled_at = menu_model_set_enabled_at;
GetStruct()->is_checked = menu_model_is_checked;
GetStruct()->is_checked_at = menu_model_is_checked_at;
GetStruct()->set_checked = menu_model_set_checked;
GetStruct()->set_checked_at = menu_model_set_checked_at;
GetStruct()->has_accelerator = menu_model_has_accelerator;
GetStruct()->has_accelerator_at = menu_model_has_accelerator_at;
GetStruct()->set_accelerator = menu_model_set_accelerator;
GetStruct()->set_accelerator_at = menu_model_set_accelerator_at;
GetStruct()->remove_accelerator = menu_model_remove_accelerator;
GetStruct()->remove_accelerator_at = menu_model_remove_accelerator_at;
GetStruct()->get_accelerator = menu_model_get_accelerator;
GetStruct()->get_accelerator_at = menu_model_get_accelerator_at;
}
template<> CefRefPtr<CefMenuModel> CefCppToC<CefMenuModelCppToC, CefMenuModel,
cef_menu_model_t>::UnwrapDerived(CefWrapperType type,
cef_menu_model_t* s) {
NOTREACHED() << "Unexpected class type: " << type;
return NULL;
}
#ifndef NDEBUG
Introduce the use of Chromium types (issue #1336). Changes to the CEF public API: - Add base::Bind, base::Callback, base::Lock, base::WeakPtr, scoped_refptr, scoped_ptr and supporting types. - Add include/wrapper/cef_closure_task.h helpers for converting a base::Closure to a CefTask. - Change CefRefPtr to extend scoped_refptr. -- Change CefBase method signatures to match RefCountedThreadSafeBase. - Change IMPLEMENT_REFCOUNTING to use base::AtomicRefCount*. -- Remove the CefAtomic* functions. -- IMPLEMENT_REFCOUNTING now enforces via a compile-time error that the correct class name was passed to the macro. - Change IMPLEMENT_LOCKING to use base::Lock. -- Remove the CefCriticalSection class. -- Deprecate the IMPLEMENT_LOCKING macro. -- base::Lock will DCHECK() in Debug builds if lock usage is reentrant. - Move include/internal/cef_tuple.h to include/base/cef_tuple.h. - Allow an empty |callback| parameter passed to CefBeginTracing. Changes to the CEF implementation: - Fix incorrect names passed to the IMPLEMENT_REFCOUNTING macro. - Fix instances of reentrant locking in the CefXmlObject and CefRequest implementations. - Remove use of the IMPLEMENT_LOCKING macro. Changes to cef_unittests: - Add tests/unittests/chromium_includes.h and always include it first from unit test .cc files to avoid name conflicts with Chromium types. - Fix wrong header include ordering. - Remove use of the IMPLEMENT_LOCKING macro. Changes to cefclient and cefsimple: - Use base::Bind and cef_closure_task.h instead of NewCefRunnable*. - Remove use of the IMPEMENT_LOCKING macro. - Fix incorrect/unnecessary locking. - Add additional runtime thread checks. - Windows: Perform actions on the UI thread instead of the main thread when running in multi-threaded-message-loop mode to avoid excessive locking. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1769 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-07-15 00:18:51 +02:00
template<> base::AtomicRefCount CefCppToC<CefMenuModelCppToC, CefMenuModel,
cef_menu_model_t>::DebugObjCt = 0;
#endif
template<> CefWrapperType CefCppToC<CefMenuModelCppToC, CefMenuModel,
cef_menu_model_t>::kWrapperType = WT_MENU_MODEL;