cef/libcef_dll/ctocpp/views/menu_button_ctocpp.cc

991 lines
27 KiB
C++
Raw Normal View History

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
// 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/views/menu_button_delegate_cpptoc.h"
#include "libcef_dll/cpptoc/views/view_delegate_cpptoc.h"
#include "libcef_dll/ctocpp/views/browser_view_ctocpp.h"
#include "libcef_dll/ctocpp/views/button_ctocpp.h"
#include "libcef_dll/ctocpp/image_ctocpp.h"
#include "libcef_dll/ctocpp/views/label_button_ctocpp.h"
#include "libcef_dll/ctocpp/views/menu_button_ctocpp.h"
#include "libcef_dll/ctocpp/menu_model_ctocpp.h"
#include "libcef_dll/ctocpp/views/panel_ctocpp.h"
#include "libcef_dll/ctocpp/views/scroll_view_ctocpp.h"
#include "libcef_dll/ctocpp/views/textfield_ctocpp.h"
#include "libcef_dll/ctocpp/views/view_ctocpp.h"
#include "libcef_dll/ctocpp/views/window_ctocpp.h"
// STATIC METHODS - Body may be edited by hand.
CefRefPtr<CefMenuButton> CefMenuButton::CreateMenuButton(
CefRefPtr<CefMenuButtonDelegate> delegate, const CefString& text,
bool with_frame, bool with_menu_marker) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: delegate; type: refptr_diff
DCHECK(delegate.get());
if (!delegate.get())
return NULL;
// Unverified params: text
// Execute
cef_menu_button_t* _retval = cef_menu_button_create(
CefMenuButtonDelegateCppToC::Wrap(delegate),
text.GetStruct(),
with_frame,
with_menu_marker);
// Return type: refptr_same
return CefMenuButtonCToCpp::Wrap(_retval);
}
// VIRTUAL METHODS - Body may be edited by hand.
void CefMenuButtonCToCpp::ShowMenu(CefRefPtr<CefMenuModel> menu_model,
const CefPoint& screen_point,
cef_menu_anchor_position_t anchor_position) {
cef_menu_button_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, show_menu))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: menu_model; type: refptr_same
DCHECK(menu_model.get());
if (!menu_model.get())
return;
// Execute
_struct->show_menu(_struct,
CefMenuModelCToCpp::Unwrap(menu_model),
&screen_point,
anchor_position);
}
CefRefPtr<CefMenuButton> CefMenuButtonCToCpp::AsMenuButton() {
cef_label_button_t* _struct = reinterpret_cast<cef_label_button_t*>(GetStruct(
));
if (CEF_MEMBER_MISSING(_struct, as_menu_button))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_menu_button_t* _retval = _struct->as_menu_button(_struct);
// Return type: refptr_same
return CefMenuButtonCToCpp::Wrap(_retval);
}
void CefMenuButtonCToCpp::SetText(const CefString& text) {
cef_label_button_t* _struct = reinterpret_cast<cef_label_button_t*>(GetStruct(
));
if (CEF_MEMBER_MISSING(_struct, set_text))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: text; type: string_byref_const
DCHECK(!text.empty());
if (text.empty())
return;
// Execute
_struct->set_text(_struct,
text.GetStruct());
}
CefString CefMenuButtonCToCpp::GetText() {
cef_label_button_t* _struct = reinterpret_cast<cef_label_button_t*>(GetStruct(
));
if (CEF_MEMBER_MISSING(_struct, get_text))
return CefString();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_string_userfree_t _retval = _struct->get_text(_struct);
// Return type: string
CefString _retvalStr;
_retvalStr.AttachToUserFree(_retval);
return _retvalStr;
}
void CefMenuButtonCToCpp::SetImage(cef_button_state_t button_state,
CefRefPtr<CefImage> image) {
cef_label_button_t* _struct = reinterpret_cast<cef_label_button_t*>(GetStruct(
));
if (CEF_MEMBER_MISSING(_struct, set_image))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Unverified params: image
// Execute
_struct->set_image(_struct,
button_state,
CefImageCToCpp::Unwrap(image));
}
CefRefPtr<CefImage> CefMenuButtonCToCpp::GetImage(
cef_button_state_t button_state) {
cef_label_button_t* _struct = reinterpret_cast<cef_label_button_t*>(GetStruct(
));
if (CEF_MEMBER_MISSING(_struct, get_image))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_image_t* _retval = _struct->get_image(_struct,
button_state);
// Return type: refptr_same
return CefImageCToCpp::Wrap(_retval);
}
void CefMenuButtonCToCpp::SetTextColor(cef_button_state_t for_state,
cef_color_t color) {
cef_label_button_t* _struct = reinterpret_cast<cef_label_button_t*>(GetStruct(
));
if (CEF_MEMBER_MISSING(_struct, set_text_color))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
_struct->set_text_color(_struct,
for_state,
color);
}
void CefMenuButtonCToCpp::SetEnabledTextColors(cef_color_t color) {
cef_label_button_t* _struct = reinterpret_cast<cef_label_button_t*>(GetStruct(
));
if (CEF_MEMBER_MISSING(_struct, set_enabled_text_colors))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
_struct->set_enabled_text_colors(_struct,
color);
}
void CefMenuButtonCToCpp::SetFontList(const CefString& font_list) {
cef_label_button_t* _struct = reinterpret_cast<cef_label_button_t*>(GetStruct(
));
if (CEF_MEMBER_MISSING(_struct, set_font_list))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: font_list; type: string_byref_const
DCHECK(!font_list.empty());
if (font_list.empty())
return;
// Execute
_struct->set_font_list(_struct,
font_list.GetStruct());
}
void CefMenuButtonCToCpp::SetHorizontalAlignment(
cef_horizontal_alignment_t alignment) {
cef_label_button_t* _struct = reinterpret_cast<cef_label_button_t*>(GetStruct(
));
if (CEF_MEMBER_MISSING(_struct, set_horizontal_alignment))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
_struct->set_horizontal_alignment(_struct,
alignment);
}
void CefMenuButtonCToCpp::SetMinimumSize(const CefSize& size) {
cef_label_button_t* _struct = reinterpret_cast<cef_label_button_t*>(GetStruct(
));
if (CEF_MEMBER_MISSING(_struct, set_minimum_size))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
_struct->set_minimum_size(_struct,
&size);
}
void CefMenuButtonCToCpp::SetMaximumSize(const CefSize& size) {
cef_label_button_t* _struct = reinterpret_cast<cef_label_button_t*>(GetStruct(
));
if (CEF_MEMBER_MISSING(_struct, set_maximum_size))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
_struct->set_maximum_size(_struct,
&size);
}
CefRefPtr<CefLabelButton> CefMenuButtonCToCpp::AsLabelButton() {
cef_button_t* _struct = reinterpret_cast<cef_button_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, as_label_button))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_label_button_t* _retval = _struct->as_label_button(_struct);
// Return type: refptr_same
return CefLabelButtonCToCpp::Wrap(_retval);
}
void CefMenuButtonCToCpp::SetState(cef_button_state_t state) {
cef_button_t* _struct = reinterpret_cast<cef_button_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, set_state))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
_struct->set_state(_struct,
state);
}
cef_button_state_t CefMenuButtonCToCpp::GetState() {
cef_button_t* _struct = reinterpret_cast<cef_button_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, get_state))
return CEF_BUTTON_STATE_NORMAL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_button_state_t _retval = _struct->get_state(_struct);
// Return type: simple
return _retval;
}
void CefMenuButtonCToCpp::SetTooltipText(const CefString& tooltip_text) {
cef_button_t* _struct = reinterpret_cast<cef_button_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, set_tooltip_text))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: tooltip_text; type: string_byref_const
DCHECK(!tooltip_text.empty());
if (tooltip_text.empty())
return;
// Execute
_struct->set_tooltip_text(_struct,
tooltip_text.GetStruct());
}
void CefMenuButtonCToCpp::SetAccessibleName(const CefString& name) {
cef_button_t* _struct = reinterpret_cast<cef_button_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, set_accessible_name))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: name; type: string_byref_const
DCHECK(!name.empty());
if (name.empty())
return;
// Execute
_struct->set_accessible_name(_struct,
name.GetStruct());
}
CefRefPtr<CefBrowserView> CefMenuButtonCToCpp::AsBrowserView() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, as_browser_view))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_browser_view_t* _retval = _struct->as_browser_view(_struct);
// Return type: refptr_same
return CefBrowserViewCToCpp::Wrap(_retval);
}
CefRefPtr<CefButton> CefMenuButtonCToCpp::AsButton() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, as_button))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_button_t* _retval = _struct->as_button(_struct);
// Return type: refptr_same
return CefButtonCToCpp::Wrap(_retval);
}
CefRefPtr<CefPanel> CefMenuButtonCToCpp::AsPanel() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, as_panel))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_panel_t* _retval = _struct->as_panel(_struct);
// Return type: refptr_same
return CefPanelCToCpp::Wrap(_retval);
}
CefRefPtr<CefScrollView> CefMenuButtonCToCpp::AsScrollView() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, as_scroll_view))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_scroll_view_t* _retval = _struct->as_scroll_view(_struct);
// Return type: refptr_same
return CefScrollViewCToCpp::Wrap(_retval);
}
CefRefPtr<CefTextfield> CefMenuButtonCToCpp::AsTextfield() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, as_textfield))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_textfield_t* _retval = _struct->as_textfield(_struct);
// Return type: refptr_same
return CefTextfieldCToCpp::Wrap(_retval);
}
CefString CefMenuButtonCToCpp::GetTypeString() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, get_type_string))
return CefString();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_string_userfree_t _retval = _struct->get_type_string(_struct);
// Return type: string
CefString _retvalStr;
_retvalStr.AttachToUserFree(_retval);
return _retvalStr;
}
CefString CefMenuButtonCToCpp::ToString(bool include_children) {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, to_string))
return CefString();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_string_userfree_t _retval = _struct->to_string(_struct,
include_children);
// Return type: string
CefString _retvalStr;
_retvalStr.AttachToUserFree(_retval);
return _retvalStr;
}
bool CefMenuButtonCToCpp::IsValid() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, is_valid))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = _struct->is_valid(_struct);
// Return type: bool
return _retval?true:false;
}
bool CefMenuButtonCToCpp::IsAttached() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, is_attached))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = _struct->is_attached(_struct);
// Return type: bool
return _retval?true:false;
}
bool CefMenuButtonCToCpp::IsSame(CefRefPtr<CefView> that) {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, is_same))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: that; type: refptr_same
DCHECK(that.get());
if (!that.get())
return false;
// Execute
int _retval = _struct->is_same(_struct,
CefViewCToCpp::Unwrap(that));
// Return type: bool
return _retval?true:false;
}
CefRefPtr<CefViewDelegate> CefMenuButtonCToCpp::GetDelegate() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, get_delegate))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_view_delegate_t* _retval = _struct->get_delegate(_struct);
// Return type: refptr_diff
return CefViewDelegateCppToC::Unwrap(_retval);
}
CefRefPtr<CefWindow> CefMenuButtonCToCpp::GetWindow() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, get_window))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_window_t* _retval = _struct->get_window(_struct);
// Return type: refptr_same
return CefWindowCToCpp::Wrap(_retval);
}
int CefMenuButtonCToCpp::GetID() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, get_id))
return 0;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = _struct->get_id(_struct);
// Return type: simple
return _retval;
}
void CefMenuButtonCToCpp::SetID(int id) {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, set_id))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
_struct->set_id(_struct,
id);
}
CefRefPtr<CefView> CefMenuButtonCToCpp::GetParentView() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, get_parent_view))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_view_t* _retval = _struct->get_parent_view(_struct);
// Return type: refptr_same
return CefViewCToCpp::Wrap(_retval);
}
CefRefPtr<CefView> CefMenuButtonCToCpp::GetViewForID(int id) {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, get_view_for_id))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_view_t* _retval = _struct->get_view_for_id(_struct,
id);
// Return type: refptr_same
return CefViewCToCpp::Wrap(_retval);
}
void CefMenuButtonCToCpp::SetBounds(const CefRect& bounds) {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, set_bounds))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
_struct->set_bounds(_struct,
&bounds);
}
CefRect CefMenuButtonCToCpp::GetBounds() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, get_bounds))
return CefRect();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_rect_t _retval = _struct->get_bounds(_struct);
// Return type: simple
return _retval;
}
CefRect CefMenuButtonCToCpp::GetBoundsInScreen() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, get_bounds_in_screen))
return CefRect();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_rect_t _retval = _struct->get_bounds_in_screen(_struct);
// Return type: simple
return _retval;
}
void CefMenuButtonCToCpp::SetSize(const CefSize& size) {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, set_size))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
_struct->set_size(_struct,
&size);
}
CefSize CefMenuButtonCToCpp::GetSize() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, get_size))
return CefSize();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_size_t _retval = _struct->get_size(_struct);
// Return type: simple
return _retval;
}
void CefMenuButtonCToCpp::SetPosition(const CefPoint& position) {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, set_position))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
_struct->set_position(_struct,
&position);
}
CefPoint CefMenuButtonCToCpp::GetPosition() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, get_position))
return CefPoint();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_point_t _retval = _struct->get_position(_struct);
// Return type: simple
return _retval;
}
CefSize CefMenuButtonCToCpp::GetPreferredSize() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, get_preferred_size))
return CefSize();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_size_t _retval = _struct->get_preferred_size(_struct);
// Return type: simple
return _retval;
}
void CefMenuButtonCToCpp::SizeToPreferredSize() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, size_to_preferred_size))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
_struct->size_to_preferred_size(_struct);
}
CefSize CefMenuButtonCToCpp::GetMinimumSize() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, get_minimum_size))
return CefSize();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_size_t _retval = _struct->get_minimum_size(_struct);
// Return type: simple
return _retval;
}
CefSize CefMenuButtonCToCpp::GetMaximumSize() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, get_maximum_size))
return CefSize();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_size_t _retval = _struct->get_maximum_size(_struct);
// Return type: simple
return _retval;
}
int CefMenuButtonCToCpp::GetHeightForWidth(int width) {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, get_height_for_width))
return 0;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = _struct->get_height_for_width(_struct,
width);
// Return type: simple
return _retval;
}
void CefMenuButtonCToCpp::InvalidateLayout() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, invalidate_layout))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
_struct->invalidate_layout(_struct);
}
void CefMenuButtonCToCpp::SetVisible(bool visible) {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, set_visible))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
_struct->set_visible(_struct,
visible);
}
bool CefMenuButtonCToCpp::IsVisible() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, is_visible))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = _struct->is_visible(_struct);
// Return type: bool
return _retval?true:false;
}
bool CefMenuButtonCToCpp::IsDrawn() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, is_drawn))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = _struct->is_drawn(_struct);
// Return type: bool
return _retval?true:false;
}
void CefMenuButtonCToCpp::SetEnabled(bool enabled) {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, set_enabled))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
_struct->set_enabled(_struct,
enabled);
}
bool CefMenuButtonCToCpp::IsEnabled() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, is_enabled))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = _struct->is_enabled(_struct);
// Return type: bool
return _retval?true:false;
}
void CefMenuButtonCToCpp::SetFocusable(bool focusable) {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, set_focusable))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
_struct->set_focusable(_struct,
focusable);
}
bool CefMenuButtonCToCpp::IsFocusable() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, is_focusable))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = _struct->is_focusable(_struct);
// Return type: bool
return _retval?true:false;
}
bool CefMenuButtonCToCpp::IsAccessibilityFocusable() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, is_accessibility_focusable))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = _struct->is_accessibility_focusable(_struct);
// Return type: bool
return _retval?true:false;
}
void CefMenuButtonCToCpp::RequestFocus() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, request_focus))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
_struct->request_focus(_struct);
}
void CefMenuButtonCToCpp::SetBackgroundColor(cef_color_t color) {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, set_background_color))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
_struct->set_background_color(_struct,
color);
}
cef_color_t CefMenuButtonCToCpp::GetBackgroundColor() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, get_background_color))
return 0;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_color_t _retval = _struct->get_background_color(_struct);
// Return type: simple
return _retval;
}
bool CefMenuButtonCToCpp::ConvertPointToScreen(CefPoint& point) {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, convert_point_to_screen))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = _struct->convert_point_to_screen(_struct,
&point);
// Return type: bool
return _retval?true:false;
}
bool CefMenuButtonCToCpp::ConvertPointFromScreen(CefPoint& point) {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, convert_point_from_screen))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = _struct->convert_point_from_screen(_struct,
&point);
// Return type: bool
return _retval?true:false;
}
bool CefMenuButtonCToCpp::ConvertPointToWindow(CefPoint& point) {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, convert_point_to_window))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = _struct->convert_point_to_window(_struct,
&point);
// Return type: bool
return _retval?true:false;
}
bool CefMenuButtonCToCpp::ConvertPointFromWindow(CefPoint& point) {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, convert_point_from_window))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = _struct->convert_point_from_window(_struct,
&point);
// Return type: bool
return _retval?true:false;
}
bool CefMenuButtonCToCpp::ConvertPointToView(CefRefPtr<CefView> view,
CefPoint& point) {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, convert_point_to_view))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: view; type: refptr_same
DCHECK(view.get());
if (!view.get())
return false;
// Execute
int _retval = _struct->convert_point_to_view(_struct,
CefViewCToCpp::Unwrap(view),
&point);
// Return type: bool
return _retval?true:false;
}
bool CefMenuButtonCToCpp::ConvertPointFromView(CefRefPtr<CefView> view,
CefPoint& point) {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, convert_point_from_view))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: view; type: refptr_same
DCHECK(view.get());
if (!view.get())
return false;
// Execute
int _retval = _struct->convert_point_from_view(_struct,
CefViewCToCpp::Unwrap(view),
&point);
// Return type: bool
return _retval?true:false;
}
// CONSTRUCTOR - Do not edit by hand.
CefMenuButtonCToCpp::CefMenuButtonCToCpp() {
}
template<> cef_menu_button_t* CefCToCpp<CefMenuButtonCToCpp, CefMenuButton,
cef_menu_button_t>::UnwrapDerived(CefWrapperType type, CefMenuButton* c) {
NOTREACHED() << "Unexpected class type: " << type;
return NULL;
}
#if DCHECK_IS_ON()
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
template<> base::AtomicRefCount CefCToCpp<CefMenuButtonCToCpp, CefMenuButton,
cef_menu_button_t>::DebugObjCt = 0;
#endif
template<> CefWrapperType CefCToCpp<CefMenuButtonCToCpp, CefMenuButton,
cef_menu_button_t>::kWrapperType = WT_MENU_BUTTON;