views: Add groups and focus/blur callbacks (issue #2102)

- cefclient: Only make menus focusable when ALT is pressed.
- cefclient: Display sample top menu when passed the `--show-top-menu`
  command-line flag.
This commit is contained in:
Marshall Greenblatt 2017-02-17 21:08:51 -05:00
parent bd1b80198f
commit 6ed4fe96b8
58 changed files with 1284 additions and 39 deletions

View File

@ -148,6 +148,18 @@ typedef struct _cef_view_t {
/// ///
void (CEF_CALLBACK *set_id)(struct _cef_view_t* self, int id); void (CEF_CALLBACK *set_id)(struct _cef_view_t* self, int id);
///
// Returns the group id of this View, or -1 if not set.
///
int (CEF_CALLBACK *get_group_id)(struct _cef_view_t* self);
///
// A group id is used to tag Views which are part of the same logical group.
// Focus can be moved between views with the same group using the arrow keys.
// The group id is immutable once it's set.
///
void (CEF_CALLBACK *set_group_id)(struct _cef_view_t* self, int group_id);
/// ///
// Returns the View that contains this View, if any. // Returns the View that contains this View, if any.
/// ///

View File

@ -105,6 +105,18 @@ typedef struct _cef_view_delegate_t {
/// ///
void (CEF_CALLBACK *on_child_view_changed)(struct _cef_view_delegate_t* self, void (CEF_CALLBACK *on_child_view_changed)(struct _cef_view_delegate_t* self,
struct _cef_view_t* view, int added, struct _cef_view_t* child); struct _cef_view_t* view, int added, struct _cef_view_t* child);
///
// Called when |view| gains focus.
///
void (CEF_CALLBACK *on_focus)(struct _cef_view_delegate_t* self,
struct _cef_view_t* view);
///
// Called when |view| loses focus.
///
void (CEF_CALLBACK *on_blur)(struct _cef_view_delegate_t* self,
struct _cef_view_t* view);
} cef_view_delegate_t; } cef_view_delegate_t;

View File

@ -145,6 +145,20 @@ class CefView : public CefBaseRefCounted {
/*--cef()--*/ /*--cef()--*/
virtual void SetID(int id) =0; virtual void SetID(int id) =0;
///
// Returns the group id of this View, or -1 if not set.
///
/*--cef()--*/
virtual int GetGroupID() =0;
///
// A group id is used to tag Views which are part of the same logical group.
// Focus can be moved between views with the same group using the arrow keys.
// The group id is immutable once it's set.
///
/*--cef()--*/
virtual void SetGroupID(int group_id) =0;
/// ///
// Returns the View that contains this View, if any. // Returns the View that contains this View, if any.
/// ///

View File

@ -108,6 +108,18 @@ class CefViewDelegate : public virtual CefBaseRefCounted {
virtual void OnChildViewChanged(CefRefPtr<CefView> view, virtual void OnChildViewChanged(CefRefPtr<CefView> view,
bool added, bool added,
CefRefPtr<CefView> child) {} CefRefPtr<CefView> child) {}
///
// Called when |view| gains focus.
///
/*--cef()--*/
virtual void OnFocus(CefRefPtr<CefView> view) {}
///
// Called when |view| loses focus.
///
/*--cef()--*/
virtual void OnBlur(CefRefPtr<CefView> view) {}
}; };
#endif // CEF_INCLUDE_VIEWS_CEF_WINDOW_DELEGATE_H_ #endif // CEF_INCLUDE_VIEWS_CEF_WINDOW_DELEGATE_H_

View File

@ -377,6 +377,8 @@ CEF_VIEW_IMPL_T class CefViewImpl : public CefViewAdapter,
CefRefPtr<CefWindow> GetWindow() override; CefRefPtr<CefWindow> GetWindow() override;
int GetID() override; int GetID() override;
void SetID(int id) override; void SetID(int id) override;
int GetGroupID() override;
void SetGroupID(int group_id) override;
CefRefPtr<CefView> GetParentView() override; CefRefPtr<CefView> GetParentView() override;
CefRefPtr<CefView> GetViewForID(int id) override; CefRefPtr<CefView> GetViewForID(int id) override;
void SetBounds(const CefRect& bounds) override; void SetBounds(const CefRect& bounds) override;
@ -507,6 +509,19 @@ CEF_VIEW_IMPL_T void CEF_VIEW_IMPL_D::SetID(int id) {
root_view()->set_id(id); root_view()->set_id(id);
} }
CEF_VIEW_IMPL_T int CEF_VIEW_IMPL_D::GetGroupID() {
CEF_REQUIRE_VALID_RETURN(0);
return root_view()->GetGroup();
}
CEF_VIEW_IMPL_T void CEF_VIEW_IMPL_D::SetGroupID(int group_id) {
CEF_REQUIRE_VALID_RETURN_VOID();
if (root_view()->GetGroup() != -1)
return;
root_view()->SetGroup(group_id);
}
CEF_VIEW_IMPL_T CefRefPtr<CefView> CEF_VIEW_IMPL_D::GetParentView() { CEF_VIEW_IMPL_T CefRefPtr<CefView> CEF_VIEW_IMPL_D::GetParentView() {
CEF_REQUIRE_VALID_RETURN(nullptr); CEF_REQUIRE_VALID_RETURN(nullptr);
views::View* view = root_view()->parent(); views::View* view = root_view()->parent();

View File

@ -72,6 +72,8 @@ CEF_VIEW_VIEW_T class CefViewView : public ViewsViewClass {
void Layout() override; void Layout() override;
void ViewHierarchyChanged( void ViewHierarchyChanged(
const views::View::ViewHierarchyChangedDetails& details) override; const views::View::ViewHierarchyChangedDetails& details) override;
void OnFocus() override;
void OnBlur() override;
// Return true if this View is expected to have a minimum size (for example, // Return true if this View is expected to have a minimum size (for example,
// a button where the minimum size is based on the label). // a button where the minimum size is based on the label).
@ -162,6 +164,18 @@ CEF_VIEW_VIEW_T void CEF_VIEW_VIEW_D::ViewHierarchyChanged(
ParentClass::ViewHierarchyChanged(details); ParentClass::ViewHierarchyChanged(details);
} }
CEF_VIEW_VIEW_T void CEF_VIEW_VIEW_D::OnFocus() {
if (cef_delegate())
cef_delegate()->OnFocus(GetCefView());
ParentClass::OnFocus();
}
CEF_VIEW_VIEW_T void CEF_VIEW_VIEW_D::OnBlur() {
if (cef_delegate())
cef_delegate()->OnBlur(GetCefView());
ParentClass::OnBlur();
}
CEF_VIEW_VIEW_T void CEF_VIEW_VIEW_D::NotifyChildViewChanged( CEF_VIEW_VIEW_T void CEF_VIEW_VIEW_D::NotifyChildViewChanged(
const views::View::ViewHierarchyChangedDetails& details) { const views::View::ViewHierarchyChangedDetails& details) {
if (!cef_delegate()) if (!cef_delegate())

View File

@ -326,6 +326,35 @@ void CEF_CALLBACK browser_view_set_id(struct _cef_view_t* self, int id) {
id); id);
} }
int CEF_CALLBACK browser_view_get_group_id(struct _cef_view_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
int _retval = CefBrowserViewCppToC::Get(reinterpret_cast<cef_browser_view_t*>(
self))->GetGroupID();
// Return type: simple
return _retval;
}
void CEF_CALLBACK browser_view_set_group_id(struct _cef_view_t* self,
int group_id) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Execute
CefBrowserViewCppToC::Get(reinterpret_cast<cef_browser_view_t*>(
self))->SetGroupID(
group_id);
}
struct _cef_view_t* CEF_CALLBACK browser_view_get_parent_view( struct _cef_view_t* CEF_CALLBACK browser_view_get_parent_view(
struct _cef_view_t* self) { struct _cef_view_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@ -933,6 +962,8 @@ CefBrowserViewCppToC::CefBrowserViewCppToC() {
GetStruct()->base.get_window = browser_view_get_window; GetStruct()->base.get_window = browser_view_get_window;
GetStruct()->base.get_id = browser_view_get_id; GetStruct()->base.get_id = browser_view_get_id;
GetStruct()->base.set_id = browser_view_set_id; GetStruct()->base.set_id = browser_view_set_id;
GetStruct()->base.get_group_id = browser_view_get_group_id;
GetStruct()->base.set_group_id = browser_view_set_group_id;
GetStruct()->base.get_parent_view = browser_view_get_parent_view; GetStruct()->base.get_parent_view = browser_view_get_parent_view;
GetStruct()->base.get_view_for_id = browser_view_get_view_for_id; GetStruct()->base.get_view_for_id = browser_view_get_view_for_id;
GetStruct()->base.set_bounds = browser_view_set_bounds; GetStruct()->base.set_bounds = browser_view_set_bounds;

View File

@ -270,6 +270,42 @@ void CEF_CALLBACK browser_view_delegate_on_child_view_changed(
CefViewCToCpp::Wrap(child)); CefViewCToCpp::Wrap(child));
} }
void CEF_CALLBACK browser_view_delegate_on_focus(
struct _cef_view_delegate_t* self, cef_view_t* view) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Verify param: view; type: refptr_diff
DCHECK(view);
if (!view)
return;
// Execute
CefBrowserViewDelegateCppToC::Get(
reinterpret_cast<cef_browser_view_delegate_t*>(self))->OnFocus(
CefViewCToCpp::Wrap(view));
}
void CEF_CALLBACK browser_view_delegate_on_blur(
struct _cef_view_delegate_t* self, cef_view_t* view) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Verify param: view; type: refptr_diff
DCHECK(view);
if (!view)
return;
// Execute
CefBrowserViewDelegateCppToC::Get(
reinterpret_cast<cef_browser_view_delegate_t*>(self))->OnBlur(
CefViewCToCpp::Wrap(view));
}
} // namespace } // namespace
@ -293,6 +329,8 @@ CefBrowserViewDelegateCppToC::CefBrowserViewDelegateCppToC() {
browser_view_delegate_on_parent_view_changed; browser_view_delegate_on_parent_view_changed;
GetStruct()->base.on_child_view_changed = GetStruct()->base.on_child_view_changed =
browser_view_delegate_on_child_view_changed; browser_view_delegate_on_child_view_changed;
GetStruct()->base.on_focus = browser_view_delegate_on_focus;
GetStruct()->base.on_blur = browser_view_delegate_on_blur;
} }
template<> CefRefPtr<CefBrowserViewDelegate> CefCppToCRefCounted<CefBrowserViewDelegateCppToC, template<> CefRefPtr<CefBrowserViewDelegate> CefCppToCRefCounted<CefBrowserViewDelegateCppToC,

View File

@ -322,6 +322,33 @@ void CEF_CALLBACK button_set_id(struct _cef_view_t* self, int id) {
id); id);
} }
int CEF_CALLBACK button_get_group_id(struct _cef_view_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
int _retval = CefButtonCppToC::Get(reinterpret_cast<cef_button_t*>(
self))->GetGroupID();
// Return type: simple
return _retval;
}
void CEF_CALLBACK button_set_group_id(struct _cef_view_t* self, int group_id) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Execute
CefButtonCppToC::Get(reinterpret_cast<cef_button_t*>(self))->SetGroupID(
group_id);
}
struct _cef_view_t* CEF_CALLBACK button_get_parent_view( struct _cef_view_t* CEF_CALLBACK button_get_parent_view(
struct _cef_view_t* self) { struct _cef_view_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@ -916,6 +943,8 @@ CefButtonCppToC::CefButtonCppToC() {
GetStruct()->base.get_window = button_get_window; GetStruct()->base.get_window = button_get_window;
GetStruct()->base.get_id = button_get_id; GetStruct()->base.get_id = button_get_id;
GetStruct()->base.set_id = button_set_id; GetStruct()->base.set_id = button_set_id;
GetStruct()->base.get_group_id = button_get_group_id;
GetStruct()->base.set_group_id = button_set_group_id;
GetStruct()->base.get_parent_view = button_get_parent_view; GetStruct()->base.get_parent_view = button_get_parent_view;
GetStruct()->base.get_view_for_id = button_get_view_for_id; GetStruct()->base.get_view_for_id = button_get_view_for_id;
GetStruct()->base.set_bounds = button_set_bounds; GetStruct()->base.set_bounds = button_set_bounds;

View File

@ -172,6 +172,42 @@ void CEF_CALLBACK button_delegate_on_child_view_changed(
CefViewCToCpp::Wrap(child)); CefViewCToCpp::Wrap(child));
} }
void CEF_CALLBACK button_delegate_on_focus(struct _cef_view_delegate_t* self,
cef_view_t* view) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Verify param: view; type: refptr_diff
DCHECK(view);
if (!view)
return;
// Execute
CefButtonDelegateCppToC::Get(reinterpret_cast<cef_button_delegate_t*>(
self))->OnFocus(
CefViewCToCpp::Wrap(view));
}
void CEF_CALLBACK button_delegate_on_blur(struct _cef_view_delegate_t* self,
cef_view_t* view) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Verify param: view; type: refptr_diff
DCHECK(view);
if (!view)
return;
// Execute
CefButtonDelegateCppToC::Get(reinterpret_cast<cef_button_delegate_t*>(
self))->OnBlur(
CefViewCToCpp::Wrap(view));
}
} // namespace } // namespace
@ -187,6 +223,8 @@ CefButtonDelegateCppToC::CefButtonDelegateCppToC() {
button_delegate_on_parent_view_changed; button_delegate_on_parent_view_changed;
GetStruct()->base.on_child_view_changed = GetStruct()->base.on_child_view_changed =
button_delegate_on_child_view_changed; button_delegate_on_child_view_changed;
GetStruct()->base.on_focus = button_delegate_on_focus;
GetStruct()->base.on_blur = button_delegate_on_blur;
} }
template<> CefRefPtr<CefButtonDelegate> CefCppToCRefCounted<CefButtonDelegateCppToC, template<> CefRefPtr<CefButtonDelegate> CefCppToCRefCounted<CefButtonDelegateCppToC,

View File

@ -531,6 +531,35 @@ void CEF_CALLBACK label_button_set_id(struct _cef_view_t* self, int id) {
id); id);
} }
int CEF_CALLBACK label_button_get_group_id(struct _cef_view_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
int _retval = CefLabelButtonCppToC::Get(reinterpret_cast<cef_label_button_t*>(
self))->GetGroupID();
// Return type: simple
return _retval;
}
void CEF_CALLBACK label_button_set_group_id(struct _cef_view_t* self,
int group_id) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Execute
CefLabelButtonCppToC::Get(reinterpret_cast<cef_label_button_t*>(
self))->SetGroupID(
group_id);
}
struct _cef_view_t* CEF_CALLBACK label_button_get_parent_view( struct _cef_view_t* CEF_CALLBACK label_button_get_parent_view(
struct _cef_view_t* self) { struct _cef_view_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@ -1152,6 +1181,8 @@ CefLabelButtonCppToC::CefLabelButtonCppToC() {
GetStruct()->base.base.get_window = label_button_get_window; GetStruct()->base.base.get_window = label_button_get_window;
GetStruct()->base.base.get_id = label_button_get_id; GetStruct()->base.base.get_id = label_button_get_id;
GetStruct()->base.base.set_id = label_button_set_id; GetStruct()->base.base.set_id = label_button_set_id;
GetStruct()->base.base.get_group_id = label_button_get_group_id;
GetStruct()->base.base.set_group_id = label_button_set_group_id;
GetStruct()->base.base.get_parent_view = label_button_get_parent_view; GetStruct()->base.base.get_parent_view = label_button_get_parent_view;
GetStruct()->base.base.get_view_for_id = label_button_get_view_for_id; GetStruct()->base.base.get_view_for_id = label_button_get_view_for_id;
GetStruct()->base.base.set_bounds = label_button_set_bounds; GetStruct()->base.base.set_bounds = label_button_set_bounds;

View File

@ -569,6 +569,35 @@ void CEF_CALLBACK menu_button_set_id(struct _cef_view_t* self, int id) {
id); id);
} }
int CEF_CALLBACK menu_button_get_group_id(struct _cef_view_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
int _retval = CefMenuButtonCppToC::Get(reinterpret_cast<cef_menu_button_t*>(
self))->GetGroupID();
// Return type: simple
return _retval;
}
void CEF_CALLBACK menu_button_set_group_id(struct _cef_view_t* self,
int group_id) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Execute
CefMenuButtonCppToC::Get(reinterpret_cast<cef_menu_button_t*>(
self))->SetGroupID(
group_id);
}
struct _cef_view_t* CEF_CALLBACK menu_button_get_parent_view( struct _cef_view_t* CEF_CALLBACK menu_button_get_parent_view(
struct _cef_view_t* self) { struct _cef_view_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@ -1189,6 +1218,8 @@ CefMenuButtonCppToC::CefMenuButtonCppToC() {
GetStruct()->base.base.base.get_window = menu_button_get_window; GetStruct()->base.base.base.get_window = menu_button_get_window;
GetStruct()->base.base.base.get_id = menu_button_get_id; GetStruct()->base.base.base.get_id = menu_button_get_id;
GetStruct()->base.base.base.set_id = menu_button_set_id; GetStruct()->base.base.base.set_id = menu_button_set_id;
GetStruct()->base.base.base.get_group_id = menu_button_get_group_id;
GetStruct()->base.base.base.set_group_id = menu_button_set_group_id;
GetStruct()->base.base.base.get_parent_view = menu_button_get_parent_view; GetStruct()->base.base.base.get_parent_view = menu_button_get_parent_view;
GetStruct()->base.base.base.get_view_for_id = menu_button_get_view_for_id; GetStruct()->base.base.base.get_view_for_id = menu_button_get_view_for_id;
GetStruct()->base.base.base.set_bounds = menu_button_set_bounds; GetStruct()->base.base.base.set_bounds = menu_button_set_bounds;

View File

@ -199,6 +199,42 @@ void CEF_CALLBACK menu_button_delegate_on_child_view_changed(
CefViewCToCpp::Wrap(child)); CefViewCToCpp::Wrap(child));
} }
void CEF_CALLBACK menu_button_delegate_on_focus(
struct _cef_view_delegate_t* self, cef_view_t* view) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Verify param: view; type: refptr_diff
DCHECK(view);
if (!view)
return;
// Execute
CefMenuButtonDelegateCppToC::Get(
reinterpret_cast<cef_menu_button_delegate_t*>(self))->OnFocus(
CefViewCToCpp::Wrap(view));
}
void CEF_CALLBACK menu_button_delegate_on_blur(
struct _cef_view_delegate_t* self, cef_view_t* view) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Verify param: view; type: refptr_diff
DCHECK(view);
if (!view)
return;
// Execute
CefMenuButtonDelegateCppToC::Get(
reinterpret_cast<cef_menu_button_delegate_t*>(self))->OnBlur(
CefViewCToCpp::Wrap(view));
}
} // namespace } // namespace
@ -220,6 +256,8 @@ CefMenuButtonDelegateCppToC::CefMenuButtonDelegateCppToC() {
menu_button_delegate_on_parent_view_changed; menu_button_delegate_on_parent_view_changed;
GetStruct()->base.base.on_child_view_changed = GetStruct()->base.base.on_child_view_changed =
menu_button_delegate_on_child_view_changed; menu_button_delegate_on_child_view_changed;
GetStruct()->base.base.on_focus = menu_button_delegate_on_focus;
GetStruct()->base.base.on_blur = menu_button_delegate_on_blur;
} }
template<> CefRefPtr<CefMenuButtonDelegate> CefCppToCRefCounted<CefMenuButtonDelegateCppToC, template<> CefRefPtr<CefMenuButtonDelegate> CefCppToCRefCounted<CefMenuButtonDelegateCppToC,

View File

@ -462,6 +462,33 @@ void CEF_CALLBACK panel_set_id(struct _cef_view_t* self, int id) {
id); id);
} }
int CEF_CALLBACK panel_get_group_id(struct _cef_view_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
int _retval = CefPanelCppToC::Get(reinterpret_cast<cef_panel_t*>(
self))->GetGroupID();
// Return type: simple
return _retval;
}
void CEF_CALLBACK panel_set_group_id(struct _cef_view_t* self, int group_id) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Execute
CefPanelCppToC::Get(reinterpret_cast<cef_panel_t*>(self))->SetGroupID(
group_id);
}
struct _cef_view_t* CEF_CALLBACK panel_get_parent_view( struct _cef_view_t* CEF_CALLBACK panel_get_parent_view(
struct _cef_view_t* self) { struct _cef_view_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@ -1060,6 +1087,8 @@ CefPanelCppToC::CefPanelCppToC() {
GetStruct()->base.get_window = panel_get_window; GetStruct()->base.get_window = panel_get_window;
GetStruct()->base.get_id = panel_get_id; GetStruct()->base.get_id = panel_get_id;
GetStruct()->base.set_id = panel_set_id; GetStruct()->base.set_id = panel_set_id;
GetStruct()->base.get_group_id = panel_get_group_id;
GetStruct()->base.set_group_id = panel_set_group_id;
GetStruct()->base.get_parent_view = panel_get_parent_view; GetStruct()->base.get_parent_view = panel_get_parent_view;
GetStruct()->base.get_view_for_id = panel_get_view_for_id; GetStruct()->base.get_view_for_id = panel_get_view_for_id;
GetStruct()->base.set_bounds = panel_set_bounds; GetStruct()->base.set_bounds = panel_set_bounds;

View File

@ -154,6 +154,42 @@ void CEF_CALLBACK panel_delegate_on_child_view_changed(
CefViewCToCpp::Wrap(child)); CefViewCToCpp::Wrap(child));
} }
void CEF_CALLBACK panel_delegate_on_focus(struct _cef_view_delegate_t* self,
cef_view_t* view) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Verify param: view; type: refptr_diff
DCHECK(view);
if (!view)
return;
// Execute
CefPanelDelegateCppToC::Get(reinterpret_cast<cef_panel_delegate_t*>(
self))->OnFocus(
CefViewCToCpp::Wrap(view));
}
void CEF_CALLBACK panel_delegate_on_blur(struct _cef_view_delegate_t* self,
cef_view_t* view) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Verify param: view; type: refptr_diff
DCHECK(view);
if (!view)
return;
// Execute
CefPanelDelegateCppToC::Get(reinterpret_cast<cef_panel_delegate_t*>(
self))->OnBlur(
CefViewCToCpp::Wrap(view));
}
} // namespace } // namespace
@ -168,6 +204,8 @@ CefPanelDelegateCppToC::CefPanelDelegateCppToC() {
panel_delegate_on_parent_view_changed; panel_delegate_on_parent_view_changed;
GetStruct()->base.on_child_view_changed = GetStruct()->base.on_child_view_changed =
panel_delegate_on_child_view_changed; panel_delegate_on_child_view_changed;
GetStruct()->base.on_focus = panel_delegate_on_focus;
GetStruct()->base.on_blur = panel_delegate_on_blur;
} }
template<> CefRefPtr<CefPanelDelegate> CefCppToCRefCounted<CefPanelDelegateCppToC, template<> CefRefPtr<CefPanelDelegate> CefCppToCRefCounted<CefPanelDelegateCppToC,

View File

@ -369,6 +369,35 @@ void CEF_CALLBACK scroll_view_set_id(struct _cef_view_t* self, int id) {
id); id);
} }
int CEF_CALLBACK scroll_view_get_group_id(struct _cef_view_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
int _retval = CefScrollViewCppToC::Get(reinterpret_cast<cef_scroll_view_t*>(
self))->GetGroupID();
// Return type: simple
return _retval;
}
void CEF_CALLBACK scroll_view_set_group_id(struct _cef_view_t* self,
int group_id) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Execute
CefScrollViewCppToC::Get(reinterpret_cast<cef_scroll_view_t*>(
self))->SetGroupID(
group_id);
}
struct _cef_view_t* CEF_CALLBACK scroll_view_get_parent_view( struct _cef_view_t* CEF_CALLBACK scroll_view_get_parent_view(
struct _cef_view_t* self) { struct _cef_view_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@ -979,6 +1008,8 @@ CefScrollViewCppToC::CefScrollViewCppToC() {
GetStruct()->base.get_window = scroll_view_get_window; GetStruct()->base.get_window = scroll_view_get_window;
GetStruct()->base.get_id = scroll_view_get_id; GetStruct()->base.get_id = scroll_view_get_id;
GetStruct()->base.set_id = scroll_view_set_id; GetStruct()->base.set_id = scroll_view_set_id;
GetStruct()->base.get_group_id = scroll_view_get_group_id;
GetStruct()->base.set_group_id = scroll_view_set_group_id;
GetStruct()->base.get_parent_view = scroll_view_get_parent_view; GetStruct()->base.get_parent_view = scroll_view_get_parent_view;
GetStruct()->base.get_view_for_id = scroll_view_get_view_for_id; GetStruct()->base.get_view_for_id = scroll_view_get_view_for_id;
GetStruct()->base.set_bounds = scroll_view_set_bounds; GetStruct()->base.set_bounds = scroll_view_set_bounds;

View File

@ -732,6 +732,34 @@ void CEF_CALLBACK textfield_set_id(struct _cef_view_t* self, int id) {
id); id);
} }
int CEF_CALLBACK textfield_get_group_id(struct _cef_view_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
int _retval = CefTextfieldCppToC::Get(reinterpret_cast<cef_textfield_t*>(
self))->GetGroupID();
// Return type: simple
return _retval;
}
void CEF_CALLBACK textfield_set_group_id(struct _cef_view_t* self,
int group_id) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Execute
CefTextfieldCppToC::Get(reinterpret_cast<cef_textfield_t*>(self))->SetGroupID(
group_id);
}
struct _cef_view_t* CEF_CALLBACK textfield_get_parent_view( struct _cef_view_t* CEF_CALLBACK textfield_get_parent_view(
struct _cef_view_t* self) { struct _cef_view_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@ -1361,6 +1389,8 @@ CefTextfieldCppToC::CefTextfieldCppToC() {
GetStruct()->base.get_window = textfield_get_window; GetStruct()->base.get_window = textfield_get_window;
GetStruct()->base.get_id = textfield_get_id; GetStruct()->base.get_id = textfield_get_id;
GetStruct()->base.set_id = textfield_set_id; GetStruct()->base.set_id = textfield_set_id;
GetStruct()->base.get_group_id = textfield_get_group_id;
GetStruct()->base.set_group_id = textfield_set_group_id;
GetStruct()->base.get_parent_view = textfield_get_parent_view; GetStruct()->base.get_parent_view = textfield_get_parent_view;
GetStruct()->base.get_view_for_id = textfield_get_view_for_id; GetStruct()->base.get_view_for_id = textfield_get_view_for_id;
GetStruct()->base.set_bounds = textfield_set_bounds; GetStruct()->base.set_bounds = textfield_set_bounds;

View File

@ -202,6 +202,42 @@ void CEF_CALLBACK textfield_delegate_on_child_view_changed(
CefViewCToCpp::Wrap(child)); CefViewCToCpp::Wrap(child));
} }
void CEF_CALLBACK textfield_delegate_on_focus(struct _cef_view_delegate_t* self,
cef_view_t* view) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Verify param: view; type: refptr_diff
DCHECK(view);
if (!view)
return;
// Execute
CefTextfieldDelegateCppToC::Get(reinterpret_cast<cef_textfield_delegate_t*>(
self))->OnFocus(
CefViewCToCpp::Wrap(view));
}
void CEF_CALLBACK textfield_delegate_on_blur(struct _cef_view_delegate_t* self,
cef_view_t* view) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Verify param: view; type: refptr_diff
DCHECK(view);
if (!view)
return;
// Execute
CefTextfieldDelegateCppToC::Get(reinterpret_cast<cef_textfield_delegate_t*>(
self))->OnBlur(
CefViewCToCpp::Wrap(view));
}
} // namespace } // namespace
@ -219,6 +255,8 @@ CefTextfieldDelegateCppToC::CefTextfieldDelegateCppToC() {
textfield_delegate_on_parent_view_changed; textfield_delegate_on_parent_view_changed;
GetStruct()->base.on_child_view_changed = GetStruct()->base.on_child_view_changed =
textfield_delegate_on_child_view_changed; textfield_delegate_on_child_view_changed;
GetStruct()->base.on_focus = textfield_delegate_on_focus;
GetStruct()->base.on_blur = textfield_delegate_on_blur;
} }
template<> CefRefPtr<CefTextfieldDelegate> CefCppToCRefCounted<CefTextfieldDelegateCppToC, template<> CefRefPtr<CefTextfieldDelegate> CefCppToCRefCounted<CefTextfieldDelegateCppToC,

View File

@ -231,6 +231,32 @@ void CEF_CALLBACK view_set_id(struct _cef_view_t* self, int id) {
id); id);
} }
int CEF_CALLBACK view_get_group_id(struct _cef_view_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
int _retval = CefViewCppToC::Get(self)->GetGroupID();
// Return type: simple
return _retval;
}
void CEF_CALLBACK view_set_group_id(struct _cef_view_t* self, int group_id) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Execute
CefViewCppToC::Get(self)->SetGroupID(
group_id);
}
struct _cef_view_t* CEF_CALLBACK view_get_parent_view( struct _cef_view_t* CEF_CALLBACK view_get_parent_view(
struct _cef_view_t* self) { struct _cef_view_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@ -794,6 +820,8 @@ CefViewCppToC::CefViewCppToC() {
GetStruct()->get_window = view_get_window; GetStruct()->get_window = view_get_window;
GetStruct()->get_id = view_get_id; GetStruct()->get_id = view_get_id;
GetStruct()->set_id = view_set_id; GetStruct()->set_id = view_set_id;
GetStruct()->get_group_id = view_get_group_id;
GetStruct()->set_group_id = view_set_group_id;
GetStruct()->get_parent_view = view_get_parent_view; GetStruct()->get_parent_view = view_get_parent_view;
GetStruct()->get_view_for_id = view_get_view_for_id; GetStruct()->get_view_for_id = view_get_view_for_id;
GetStruct()->set_bounds = view_set_bounds; GetStruct()->set_bounds = view_set_bounds;

View File

@ -153,6 +153,40 @@ void CEF_CALLBACK view_delegate_on_child_view_changed(
CefViewCToCpp::Wrap(child)); CefViewCToCpp::Wrap(child));
} }
void CEF_CALLBACK view_delegate_on_focus(struct _cef_view_delegate_t* self,
cef_view_t* view) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Verify param: view; type: refptr_diff
DCHECK(view);
if (!view)
return;
// Execute
CefViewDelegateCppToC::Get(self)->OnFocus(
CefViewCToCpp::Wrap(view));
}
void CEF_CALLBACK view_delegate_on_blur(struct _cef_view_delegate_t* self,
cef_view_t* view) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Verify param: view; type: refptr_diff
DCHECK(view);
if (!view)
return;
// Execute
CefViewDelegateCppToC::Get(self)->OnBlur(
CefViewCToCpp::Wrap(view));
}
} // namespace } // namespace
@ -165,6 +199,8 @@ CefViewDelegateCppToC::CefViewDelegateCppToC() {
GetStruct()->get_height_for_width = view_delegate_get_height_for_width; GetStruct()->get_height_for_width = view_delegate_get_height_for_width;
GetStruct()->on_parent_view_changed = view_delegate_on_parent_view_changed; GetStruct()->on_parent_view_changed = view_delegate_on_parent_view_changed;
GetStruct()->on_child_view_changed = view_delegate_on_child_view_changed; GetStruct()->on_child_view_changed = view_delegate_on_child_view_changed;
GetStruct()->on_focus = view_delegate_on_focus;
GetStruct()->on_blur = view_delegate_on_blur;
} }
template<> CefRefPtr<CefViewDelegate> CefCppToCRefCounted<CefViewDelegateCppToC, template<> CefRefPtr<CefViewDelegate> CefCppToCRefCounted<CefViewDelegateCppToC,

View File

@ -984,6 +984,33 @@ void CEF_CALLBACK window_set_id(struct _cef_view_t* self, int id) {
id); id);
} }
int CEF_CALLBACK window_get_group_id(struct _cef_view_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
int _retval = CefWindowCppToC::Get(reinterpret_cast<cef_window_t*>(
self))->GetGroupID();
// Return type: simple
return _retval;
}
void CEF_CALLBACK window_set_group_id(struct _cef_view_t* self, int group_id) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Execute
CefWindowCppToC::Get(reinterpret_cast<cef_window_t*>(self))->SetGroupID(
group_id);
}
cef_view_t* CEF_CALLBACK window_get_parent_view(struct _cef_view_t* self) { cef_view_t* CEF_CALLBACK window_get_parent_view(struct _cef_view_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@ -1621,6 +1648,8 @@ CefWindowCppToC::CefWindowCppToC() {
GetStruct()->base.base.get_window = window_get_window; GetStruct()->base.base.get_window = window_get_window;
GetStruct()->base.base.get_id = window_get_id; GetStruct()->base.base.get_id = window_get_id;
GetStruct()->base.base.set_id = window_set_id; GetStruct()->base.base.set_id = window_set_id;
GetStruct()->base.base.get_group_id = window_get_group_id;
GetStruct()->base.base.set_group_id = window_set_group_id;
GetStruct()->base.base.get_parent_view = window_get_parent_view; GetStruct()->base.base.get_parent_view = window_get_parent_view;
GetStruct()->base.base.get_view_for_id = window_get_view_for_id; GetStruct()->base.base.get_view_for_id = window_get_view_for_id;
GetStruct()->base.base.set_bounds = window_set_bounds; GetStruct()->base.base.set_bounds = window_set_bounds;

View File

@ -341,6 +341,42 @@ void CEF_CALLBACK window_delegate_on_child_view_changed(
CefViewCToCpp::Wrap(child)); CefViewCToCpp::Wrap(child));
} }
void CEF_CALLBACK window_delegate_on_focus(struct _cef_view_delegate_t* self,
cef_view_t* view) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Verify param: view; type: refptr_diff
DCHECK(view);
if (!view)
return;
// Execute
CefWindowDelegateCppToC::Get(reinterpret_cast<cef_window_delegate_t*>(
self))->OnFocus(
CefViewCToCpp::Wrap(view));
}
void CEF_CALLBACK window_delegate_on_blur(struct _cef_view_delegate_t* self,
cef_view_t* view) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Verify param: view; type: refptr_diff
DCHECK(view);
if (!view)
return;
// Execute
CefWindowDelegateCppToC::Get(reinterpret_cast<cef_window_delegate_t*>(
self))->OnBlur(
CefViewCToCpp::Wrap(view));
}
} // namespace } // namespace
@ -366,6 +402,8 @@ CefWindowDelegateCppToC::CefWindowDelegateCppToC() {
window_delegate_on_parent_view_changed; window_delegate_on_parent_view_changed;
GetStruct()->base.base.on_child_view_changed = GetStruct()->base.base.on_child_view_changed =
window_delegate_on_child_view_changed; window_delegate_on_child_view_changed;
GetStruct()->base.base.on_focus = window_delegate_on_focus;
GetStruct()->base.base.on_blur = window_delegate_on_blur;
} }
template<> CefRefPtr<CefWindowDelegate> CefCppToCRefCounted<CefWindowDelegateCppToC, template<> CefRefPtr<CefWindowDelegate> CefCppToCRefCounted<CefWindowDelegateCppToC,

View File

@ -298,6 +298,32 @@ void CefBrowserViewCToCpp::SetID(int id) {
id); id);
} }
int CefBrowserViewCToCpp::GetGroupID() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, get_group_id))
return 0;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = _struct->get_group_id(_struct);
// Return type: simple
return _retval;
}
void CefBrowserViewCToCpp::SetGroupID(int group_id) {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, set_group_id))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
_struct->set_group_id(_struct,
group_id);
}
CefRefPtr<CefView> CefBrowserViewCToCpp::GetParentView() { CefRefPtr<CefView> CefBrowserViewCToCpp::GetParentView() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct()); cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, get_parent_view)) if (CEF_MEMBER_MISSING(_struct, get_parent_view))

View File

@ -49,6 +49,8 @@ class CefBrowserViewCToCpp
CefRefPtr<CefWindow> GetWindow() OVERRIDE; CefRefPtr<CefWindow> GetWindow() OVERRIDE;
int GetID() OVERRIDE; int GetID() OVERRIDE;
void SetID(int id) OVERRIDE; void SetID(int id) OVERRIDE;
int GetGroupID() OVERRIDE;
void SetGroupID(int group_id) OVERRIDE;
CefRefPtr<CefView> GetParentView() OVERRIDE; CefRefPtr<CefView> GetParentView() OVERRIDE;
CefRefPtr<CefView> GetViewForID(int id) OVERRIDE; CefRefPtr<CefView> GetViewForID(int id) OVERRIDE;
void SetBounds(const CefRect& bounds) OVERRIDE; void SetBounds(const CefRect& bounds) OVERRIDE;

View File

@ -260,6 +260,42 @@ void CefBrowserViewDelegateCToCpp::OnChildViewChanged(CefRefPtr<CefView> view,
CefViewCppToC::Wrap(child)); CefViewCppToC::Wrap(child));
} }
void CefBrowserViewDelegateCToCpp::OnFocus(CefRefPtr<CefView> view) {
cef_view_delegate_t* _struct = reinterpret_cast<cef_view_delegate_t*>(
GetStruct());
if (CEF_MEMBER_MISSING(_struct, on_focus))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: view; type: refptr_diff
DCHECK(view.get());
if (!view.get())
return;
// Execute
_struct->on_focus(_struct,
CefViewCppToC::Wrap(view));
}
void CefBrowserViewDelegateCToCpp::OnBlur(CefRefPtr<CefView> view) {
cef_view_delegate_t* _struct = reinterpret_cast<cef_view_delegate_t*>(
GetStruct());
if (CEF_MEMBER_MISSING(_struct, on_blur))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: view; type: refptr_diff
DCHECK(view.get());
if (!view.get())
return;
// Execute
_struct->on_blur(_struct,
CefViewCppToC::Wrap(view));
}
// CONSTRUCTOR - Do not edit by hand. // CONSTRUCTOR - Do not edit by hand.

View File

@ -56,6 +56,8 @@ class CefBrowserViewDelegateCToCpp
CefRefPtr<CefView> parent) override; CefRefPtr<CefView> parent) override;
void OnChildViewChanged(CefRefPtr<CefView> view, bool added, void OnChildViewChanged(CefRefPtr<CefView> view, bool added,
CefRefPtr<CefView> child) override; CefRefPtr<CefView> child) override;
void OnFocus(CefRefPtr<CefView> view) override;
void OnBlur(CefRefPtr<CefView> view) override;
}; };
#endif // CEF_LIBCEF_DLL_CTOCPP_VIEWS_BROWSER_VIEW_DELEGATE_CTOCPP_H_ #endif // CEF_LIBCEF_DLL_CTOCPP_VIEWS_BROWSER_VIEW_DELEGATE_CTOCPP_H_

View File

@ -303,6 +303,32 @@ void CefButtonCToCpp::SetID(int id) {
id); id);
} }
int CefButtonCToCpp::GetGroupID() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, get_group_id))
return 0;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = _struct->get_group_id(_struct);
// Return type: simple
return _retval;
}
void CefButtonCToCpp::SetGroupID(int group_id) {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, set_group_id))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
_struct->set_group_id(_struct,
group_id);
}
CefRefPtr<CefView> CefButtonCToCpp::GetParentView() { CefRefPtr<CefView> CefButtonCToCpp::GetParentView() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct()); cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, get_parent_view)) if (CEF_MEMBER_MISSING(_struct, get_parent_view))

View File

@ -53,6 +53,8 @@ class CefButtonCToCpp
CefRefPtr<CefWindow> GetWindow() OVERRIDE; CefRefPtr<CefWindow> GetWindow() OVERRIDE;
int GetID() OVERRIDE; int GetID() OVERRIDE;
void SetID(int id) OVERRIDE; void SetID(int id) OVERRIDE;
int GetGroupID() OVERRIDE;
void SetGroupID(int group_id) OVERRIDE;
CefRefPtr<CefView> GetParentView() OVERRIDE; CefRefPtr<CefView> GetParentView() OVERRIDE;
CefRefPtr<CefView> GetViewForID(int id) OVERRIDE; CefRefPtr<CefView> GetViewForID(int id) OVERRIDE;
void SetBounds(const CefRect& bounds) OVERRIDE; void SetBounds(const CefRect& bounds) OVERRIDE;

View File

@ -171,6 +171,42 @@ void CefButtonDelegateCToCpp::OnChildViewChanged(CefRefPtr<CefView> view,
CefViewCppToC::Wrap(child)); CefViewCppToC::Wrap(child));
} }
void CefButtonDelegateCToCpp::OnFocus(CefRefPtr<CefView> view) {
cef_view_delegate_t* _struct = reinterpret_cast<cef_view_delegate_t*>(
GetStruct());
if (CEF_MEMBER_MISSING(_struct, on_focus))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: view; type: refptr_diff
DCHECK(view.get());
if (!view.get())
return;
// Execute
_struct->on_focus(_struct,
CefViewCppToC::Wrap(view));
}
void CefButtonDelegateCToCpp::OnBlur(CefRefPtr<CefView> view) {
cef_view_delegate_t* _struct = reinterpret_cast<cef_view_delegate_t*>(
GetStruct());
if (CEF_MEMBER_MISSING(_struct, on_blur))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: view; type: refptr_diff
DCHECK(view.get());
if (!view.get())
return;
// Execute
_struct->on_blur(_struct,
CefViewCppToC::Wrap(view));
}
// CONSTRUCTOR - Do not edit by hand. // CONSTRUCTOR - Do not edit by hand.

View File

@ -44,6 +44,8 @@ class CefButtonDelegateCToCpp
CefRefPtr<CefView> parent) override; CefRefPtr<CefView> parent) override;
void OnChildViewChanged(CefRefPtr<CefView> view, bool added, void OnChildViewChanged(CefRefPtr<CefView> view, bool added,
CefRefPtr<CefView> child) override; CefRefPtr<CefView> child) override;
void OnFocus(CefRefPtr<CefView> view) override;
void OnBlur(CefRefPtr<CefView> view) override;
}; };
#endif // CEF_LIBCEF_DLL_CTOCPP_VIEWS_BUTTON_DELEGATE_CTOCPP_H_ #endif // CEF_LIBCEF_DLL_CTOCPP_VIEWS_BUTTON_DELEGATE_CTOCPP_H_

View File

@ -488,6 +488,32 @@ void CefLabelButtonCToCpp::SetID(int id) {
id); id);
} }
int CefLabelButtonCToCpp::GetGroupID() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, get_group_id))
return 0;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = _struct->get_group_id(_struct);
// Return type: simple
return _retval;
}
void CefLabelButtonCToCpp::SetGroupID(int group_id) {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, set_group_id))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
_struct->set_group_id(_struct,
group_id);
}
CefRefPtr<CefView> CefLabelButtonCToCpp::GetParentView() { CefRefPtr<CefView> CefLabelButtonCToCpp::GetParentView() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct()); cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, get_parent_view)) if (CEF_MEMBER_MISSING(_struct, get_parent_view))

View File

@ -68,6 +68,8 @@ class CefLabelButtonCToCpp
CefRefPtr<CefWindow> GetWindow() OVERRIDE; CefRefPtr<CefWindow> GetWindow() OVERRIDE;
int GetID() OVERRIDE; int GetID() OVERRIDE;
void SetID(int id) OVERRIDE; void SetID(int id) OVERRIDE;
int GetGroupID() OVERRIDE;
void SetGroupID(int group_id) OVERRIDE;
CefRefPtr<CefView> GetParentView() OVERRIDE; CefRefPtr<CefView> GetParentView() OVERRIDE;
CefRefPtr<CefView> GetViewForID(int id) OVERRIDE; CefRefPtr<CefView> GetViewForID(int id) OVERRIDE;
void SetBounds(const CefRect& bounds) OVERRIDE; void SetBounds(const CefRect& bounds) OVERRIDE;

View File

@ -522,6 +522,32 @@ void CefMenuButtonCToCpp::SetID(int id) {
id); id);
} }
int CefMenuButtonCToCpp::GetGroupID() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, get_group_id))
return 0;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = _struct->get_group_id(_struct);
// Return type: simple
return _retval;
}
void CefMenuButtonCToCpp::SetGroupID(int group_id) {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, set_group_id))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
_struct->set_group_id(_struct,
group_id);
}
CefRefPtr<CefView> CefMenuButtonCToCpp::GetParentView() { CefRefPtr<CefView> CefMenuButtonCToCpp::GetParentView() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct()); cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, get_parent_view)) if (CEF_MEMBER_MISSING(_struct, get_parent_view))

View File

@ -71,6 +71,8 @@ class CefMenuButtonCToCpp
CefRefPtr<CefWindow> GetWindow() OVERRIDE; CefRefPtr<CefWindow> GetWindow() OVERRIDE;
int GetID() OVERRIDE; int GetID() OVERRIDE;
void SetID(int id) OVERRIDE; void SetID(int id) OVERRIDE;
int GetGroupID() OVERRIDE;
void SetGroupID(int group_id) OVERRIDE;
CefRefPtr<CefView> GetParentView() OVERRIDE; CefRefPtr<CefView> GetParentView() OVERRIDE;
CefRefPtr<CefView> GetViewForID(int id) OVERRIDE; CefRefPtr<CefView> GetViewForID(int id) OVERRIDE;
void SetBounds(const CefRect& bounds) OVERRIDE; void SetBounds(const CefRect& bounds) OVERRIDE;

View File

@ -191,6 +191,42 @@ void CefMenuButtonDelegateCToCpp::OnChildViewChanged(CefRefPtr<CefView> view,
CefViewCppToC::Wrap(child)); CefViewCppToC::Wrap(child));
} }
void CefMenuButtonDelegateCToCpp::OnFocus(CefRefPtr<CefView> view) {
cef_view_delegate_t* _struct = reinterpret_cast<cef_view_delegate_t*>(
GetStruct());
if (CEF_MEMBER_MISSING(_struct, on_focus))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: view; type: refptr_diff
DCHECK(view.get());
if (!view.get())
return;
// Execute
_struct->on_focus(_struct,
CefViewCppToC::Wrap(view));
}
void CefMenuButtonDelegateCToCpp::OnBlur(CefRefPtr<CefView> view) {
cef_view_delegate_t* _struct = reinterpret_cast<cef_view_delegate_t*>(
GetStruct());
if (CEF_MEMBER_MISSING(_struct, on_blur))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: view; type: refptr_diff
DCHECK(view.get());
if (!view.get())
return;
// Execute
_struct->on_blur(_struct,
CefViewCppToC::Wrap(view));
}
// CONSTRUCTOR - Do not edit by hand. // CONSTRUCTOR - Do not edit by hand.

View File

@ -48,6 +48,8 @@ class CefMenuButtonDelegateCToCpp
CefRefPtr<CefView> parent) override; CefRefPtr<CefView> parent) override;
void OnChildViewChanged(CefRefPtr<CefView> view, bool added, void OnChildViewChanged(CefRefPtr<CefView> view, bool added,
CefRefPtr<CefView> child) override; CefRefPtr<CefView> child) override;
void OnFocus(CefRefPtr<CefView> view) override;
void OnBlur(CefRefPtr<CefView> view) override;
}; };
#endif // CEF_LIBCEF_DLL_CTOCPP_VIEWS_MENU_BUTTON_DELEGATE_CTOCPP_H_ #endif // CEF_LIBCEF_DLL_CTOCPP_VIEWS_MENU_BUTTON_DELEGATE_CTOCPP_H_

View File

@ -436,6 +436,32 @@ void CefPanelCToCpp::SetID(int id) {
id); id);
} }
int CefPanelCToCpp::GetGroupID() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, get_group_id))
return 0;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = _struct->get_group_id(_struct);
// Return type: simple
return _retval;
}
void CefPanelCToCpp::SetGroupID(int group_id) {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, set_group_id))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
_struct->set_group_id(_struct,
group_id);
}
CefRefPtr<CefView> CefPanelCToCpp::GetParentView() { CefRefPtr<CefView> CefPanelCToCpp::GetParentView() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct()); cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, get_parent_view)) if (CEF_MEMBER_MISSING(_struct, get_parent_view))

View File

@ -67,6 +67,8 @@ class CefPanelCToCpp
CefRefPtr<CefWindow> GetWindow() OVERRIDE; CefRefPtr<CefWindow> GetWindow() OVERRIDE;
int GetID() OVERRIDE; int GetID() OVERRIDE;
void SetID(int id) OVERRIDE; void SetID(int id) OVERRIDE;
int GetGroupID() OVERRIDE;
void SetGroupID(int group_id) OVERRIDE;
CefRefPtr<CefView> GetParentView() OVERRIDE; CefRefPtr<CefView> GetParentView() OVERRIDE;
CefRefPtr<CefView> GetViewForID(int id) OVERRIDE; CefRefPtr<CefView> GetViewForID(int id) OVERRIDE;
void SetBounds(const CefRect& bounds) OVERRIDE; void SetBounds(const CefRect& bounds) OVERRIDE;

View File

@ -153,6 +153,42 @@ void CefPanelDelegateCToCpp::OnChildViewChanged(CefRefPtr<CefView> view,
CefViewCppToC::Wrap(child)); CefViewCppToC::Wrap(child));
} }
void CefPanelDelegateCToCpp::OnFocus(CefRefPtr<CefView> view) {
cef_view_delegate_t* _struct = reinterpret_cast<cef_view_delegate_t*>(
GetStruct());
if (CEF_MEMBER_MISSING(_struct, on_focus))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: view; type: refptr_diff
DCHECK(view.get());
if (!view.get())
return;
// Execute
_struct->on_focus(_struct,
CefViewCppToC::Wrap(view));
}
void CefPanelDelegateCToCpp::OnBlur(CefRefPtr<CefView> view) {
cef_view_delegate_t* _struct = reinterpret_cast<cef_view_delegate_t*>(
GetStruct());
if (CEF_MEMBER_MISSING(_struct, on_blur))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: view; type: refptr_diff
DCHECK(view.get());
if (!view.get())
return;
// Execute
_struct->on_blur(_struct,
CefViewCppToC::Wrap(view));
}
// CONSTRUCTOR - Do not edit by hand. // CONSTRUCTOR - Do not edit by hand.

View File

@ -41,6 +41,8 @@ class CefPanelDelegateCToCpp
CefRefPtr<CefView> parent) override; CefRefPtr<CefView> parent) override;
void OnChildViewChanged(CefRefPtr<CefView> view, bool added, void OnChildViewChanged(CefRefPtr<CefView> view, bool added,
CefRefPtr<CefView> child) override; CefRefPtr<CefView> child) override;
void OnFocus(CefRefPtr<CefView> view) override;
void OnBlur(CefRefPtr<CefView> view) override;
}; };
#endif // CEF_LIBCEF_DLL_CTOCPP_VIEWS_PANEL_DELEGATE_CTOCPP_H_ #endif // CEF_LIBCEF_DLL_CTOCPP_VIEWS_PANEL_DELEGATE_CTOCPP_H_

View File

@ -345,6 +345,32 @@ void CefScrollViewCToCpp::SetID(int id) {
id); id);
} }
int CefScrollViewCToCpp::GetGroupID() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, get_group_id))
return 0;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = _struct->get_group_id(_struct);
// Return type: simple
return _retval;
}
void CefScrollViewCToCpp::SetGroupID(int group_id) {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, set_group_id))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
_struct->set_group_id(_struct,
group_id);
}
CefRefPtr<CefView> CefScrollViewCToCpp::GetParentView() { CefRefPtr<CefView> CefScrollViewCToCpp::GetParentView() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct()); cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, get_parent_view)) if (CEF_MEMBER_MISSING(_struct, get_parent_view))

View File

@ -54,6 +54,8 @@ class CefScrollViewCToCpp
CefRefPtr<CefWindow> GetWindow() OVERRIDE; CefRefPtr<CefWindow> GetWindow() OVERRIDE;
int GetID() OVERRIDE; int GetID() OVERRIDE;
void SetID(int id) OVERRIDE; void SetID(int id) OVERRIDE;
int GetGroupID() OVERRIDE;
void SetGroupID(int group_id) OVERRIDE;
CefRefPtr<CefView> GetParentView() OVERRIDE; CefRefPtr<CefView> GetParentView() OVERRIDE;
CefRefPtr<CefView> GetViewForID(int id) OVERRIDE; CefRefPtr<CefView> GetViewForID(int id) OVERRIDE;
void SetBounds(const CefRect& bounds) OVERRIDE; void SetBounds(const CefRect& bounds) OVERRIDE;

View File

@ -681,6 +681,32 @@ void CefTextfieldCToCpp::SetID(int id) {
id); id);
} }
int CefTextfieldCToCpp::GetGroupID() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, get_group_id))
return 0;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = _struct->get_group_id(_struct);
// Return type: simple
return _retval;
}
void CefTextfieldCToCpp::SetGroupID(int group_id) {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, set_group_id))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
_struct->set_group_id(_struct,
group_id);
}
CefRefPtr<CefView> CefTextfieldCToCpp::GetParentView() { CefRefPtr<CefView> CefTextfieldCToCpp::GetParentView() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct()); cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, get_parent_view)) if (CEF_MEMBER_MISSING(_struct, get_parent_view))

View File

@ -79,6 +79,8 @@ class CefTextfieldCToCpp
CefRefPtr<CefWindow> GetWindow() OVERRIDE; CefRefPtr<CefWindow> GetWindow() OVERRIDE;
int GetID() OVERRIDE; int GetID() OVERRIDE;
void SetID(int id) OVERRIDE; void SetID(int id) OVERRIDE;
int GetGroupID() OVERRIDE;
void SetGroupID(int group_id) OVERRIDE;
CefRefPtr<CefView> GetParentView() OVERRIDE; CefRefPtr<CefView> GetParentView() OVERRIDE;
CefRefPtr<CefView> GetViewForID(int id) OVERRIDE; CefRefPtr<CefView> GetViewForID(int id) OVERRIDE;
void SetBounds(const CefRect& bounds) OVERRIDE; void SetBounds(const CefRect& bounds) OVERRIDE;

View File

@ -193,6 +193,42 @@ void CefTextfieldDelegateCToCpp::OnChildViewChanged(CefRefPtr<CefView> view,
CefViewCppToC::Wrap(child)); CefViewCppToC::Wrap(child));
} }
void CefTextfieldDelegateCToCpp::OnFocus(CefRefPtr<CefView> view) {
cef_view_delegate_t* _struct = reinterpret_cast<cef_view_delegate_t*>(
GetStruct());
if (CEF_MEMBER_MISSING(_struct, on_focus))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: view; type: refptr_diff
DCHECK(view.get());
if (!view.get())
return;
// Execute
_struct->on_focus(_struct,
CefViewCppToC::Wrap(view));
}
void CefTextfieldDelegateCToCpp::OnBlur(CefRefPtr<CefView> view) {
cef_view_delegate_t* _struct = reinterpret_cast<cef_view_delegate_t*>(
GetStruct());
if (CEF_MEMBER_MISSING(_struct, on_blur))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: view; type: refptr_diff
DCHECK(view.get());
if (!view.get())
return;
// Execute
_struct->on_blur(_struct,
CefViewCppToC::Wrap(view));
}
// CONSTRUCTOR - Do not edit by hand. // CONSTRUCTOR - Do not edit by hand.

View File

@ -46,6 +46,8 @@ class CefTextfieldDelegateCToCpp
CefRefPtr<CefView> parent) override; CefRefPtr<CefView> parent) override;
void OnChildViewChanged(CefRefPtr<CefView> view, bool added, void OnChildViewChanged(CefRefPtr<CefView> view, bool added,
CefRefPtr<CefView> child) override; CefRefPtr<CefView> child) override;
void OnFocus(CefRefPtr<CefView> view) override;
void OnBlur(CefRefPtr<CefView> view) override;
}; };
#endif // CEF_LIBCEF_DLL_CTOCPP_VIEWS_TEXTFIELD_DELEGATE_CTOCPP_H_ #endif // CEF_LIBCEF_DLL_CTOCPP_VIEWS_TEXTFIELD_DELEGATE_CTOCPP_H_

View File

@ -229,6 +229,32 @@ void CefViewCToCpp::SetID(int id) {
id); id);
} }
int CefViewCToCpp::GetGroupID() {
cef_view_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_group_id))
return 0;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = _struct->get_group_id(_struct);
// Return type: simple
return _retval;
}
void CefViewCToCpp::SetGroupID(int group_id) {
cef_view_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, set_group_id))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
_struct->set_group_id(_struct,
group_id);
}
CefRefPtr<CefView> CefViewCToCpp::GetParentView() { CefRefPtr<CefView> CefViewCToCpp::GetParentView() {
cef_view_t* _struct = GetStruct(); cef_view_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_parent_view)) if (CEF_MEMBER_MISSING(_struct, get_parent_view))

View File

@ -56,6 +56,8 @@ class CefViewCToCpp
CefRefPtr<CefWindow> GetWindow() OVERRIDE; CefRefPtr<CefWindow> GetWindow() OVERRIDE;
int GetID() OVERRIDE; int GetID() OVERRIDE;
void SetID(int id) OVERRIDE; void SetID(int id) OVERRIDE;
int GetGroupID() OVERRIDE;
void SetGroupID(int group_id) OVERRIDE;
CefRefPtr<CefView> GetParentView() OVERRIDE; CefRefPtr<CefView> GetParentView() OVERRIDE;
CefRefPtr<CefView> GetViewForID(int id) OVERRIDE; CefRefPtr<CefView> GetViewForID(int id) OVERRIDE;
void SetBounds(const CefRect& bounds) OVERRIDE; void SetBounds(const CefRect& bounds) OVERRIDE;

View File

@ -152,6 +152,40 @@ void CefViewDelegateCToCpp::OnChildViewChanged(CefRefPtr<CefView> view,
CefViewCppToC::Wrap(child)); CefViewCppToC::Wrap(child));
} }
void CefViewDelegateCToCpp::OnFocus(CefRefPtr<CefView> view) {
cef_view_delegate_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, on_focus))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: view; type: refptr_diff
DCHECK(view.get());
if (!view.get())
return;
// Execute
_struct->on_focus(_struct,
CefViewCppToC::Wrap(view));
}
void CefViewDelegateCToCpp::OnBlur(CefRefPtr<CefView> view) {
cef_view_delegate_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, on_blur))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: view; type: refptr_diff
DCHECK(view.get());
if (!view.get())
return;
// Execute
_struct->on_blur(_struct,
CefViewCppToC::Wrap(view));
}
// CONSTRUCTOR - Do not edit by hand. // CONSTRUCTOR - Do not edit by hand.

View File

@ -41,6 +41,8 @@ class CefViewDelegateCToCpp
CefRefPtr<CefView> parent) override; CefRefPtr<CefView> parent) override;
void OnChildViewChanged(CefRefPtr<CefView> view, bool added, void OnChildViewChanged(CefRefPtr<CefView> view, bool added,
CefRefPtr<CefView> child) override; CefRefPtr<CefView> child) override;
void OnFocus(CefRefPtr<CefView> view) override;
void OnBlur(CefRefPtr<CefView> view) override;
}; };
#endif // CEF_LIBCEF_DLL_CTOCPP_VIEWS_VIEW_DELEGATE_CTOCPP_H_ #endif // CEF_LIBCEF_DLL_CTOCPP_VIEWS_VIEW_DELEGATE_CTOCPP_H_

View File

@ -938,6 +938,32 @@ void CefWindowCToCpp::SetID(int id) {
id); id);
} }
int CefWindowCToCpp::GetGroupID() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, get_group_id))
return 0;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = _struct->get_group_id(_struct);
// Return type: simple
return _retval;
}
void CefWindowCToCpp::SetGroupID(int group_id) {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, set_group_id))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
_struct->set_group_id(_struct,
group_id);
}
CefRefPtr<CefView> CefWindowCToCpp::GetParentView() { CefRefPtr<CefView> CefWindowCToCpp::GetParentView() {
cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct()); cef_view_t* _struct = reinterpret_cast<cef_view_t*>(GetStruct());
if (CEF_MEMBER_MISSING(_struct, get_parent_view)) if (CEF_MEMBER_MISSING(_struct, get_parent_view))

View File

@ -103,6 +103,8 @@ class CefWindowCToCpp
CefRefPtr<CefWindow> GetWindow() OVERRIDE; CefRefPtr<CefWindow> GetWindow() OVERRIDE;
int GetID() OVERRIDE; int GetID() OVERRIDE;
void SetID(int id) OVERRIDE; void SetID(int id) OVERRIDE;
int GetGroupID() OVERRIDE;
void SetGroupID(int group_id) OVERRIDE;
CefRefPtr<CefView> GetParentView() OVERRIDE; CefRefPtr<CefView> GetParentView() OVERRIDE;
CefRefPtr<CefView> GetViewForID(int id) OVERRIDE; CefRefPtr<CefView> GetViewForID(int id) OVERRIDE;
void SetBounds(const CefRect& bounds) OVERRIDE; void SetBounds(const CefRect& bounds) OVERRIDE;

View File

@ -331,6 +331,42 @@ void CefWindowDelegateCToCpp::OnChildViewChanged(CefRefPtr<CefView> view,
CefViewCppToC::Wrap(child)); CefViewCppToC::Wrap(child));
} }
void CefWindowDelegateCToCpp::OnFocus(CefRefPtr<CefView> view) {
cef_view_delegate_t* _struct = reinterpret_cast<cef_view_delegate_t*>(
GetStruct());
if (CEF_MEMBER_MISSING(_struct, on_focus))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: view; type: refptr_diff
DCHECK(view.get());
if (!view.get())
return;
// Execute
_struct->on_focus(_struct,
CefViewCppToC::Wrap(view));
}
void CefWindowDelegateCToCpp::OnBlur(CefRefPtr<CefView> view) {
cef_view_delegate_t* _struct = reinterpret_cast<cef_view_delegate_t*>(
GetStruct());
if (CEF_MEMBER_MISSING(_struct, on_blur))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: view; type: refptr_diff
DCHECK(view.get());
if (!view.get())
return;
// Execute
_struct->on_blur(_struct,
CefViewCppToC::Wrap(view));
}
// CONSTRUCTOR - Do not edit by hand. // CONSTRUCTOR - Do not edit by hand.

View File

@ -55,6 +55,8 @@ class CefWindowDelegateCToCpp
CefRefPtr<CefView> parent) override; CefRefPtr<CefView> parent) override;
void OnChildViewChanged(CefRefPtr<CefView> view, bool added, void OnChildViewChanged(CefRefPtr<CefView> view, bool added,
CefRefPtr<CefView> child) override; CefRefPtr<CefView> child) override;
void OnFocus(CefRefPtr<CefView> view) override;
void OnBlur(CefRefPtr<CefView> view) override;
}; };
#endif // CEF_LIBCEF_DLL_CTOCPP_VIEWS_WINDOW_DELEGATE_CTOCPP_H_ #endif // CEF_LIBCEF_DLL_CTOCPP_VIEWS_WINDOW_DELEGATE_CTOCPP_H_

View File

@ -34,6 +34,8 @@ enum ControlIds {
ID_RELOAD_BUTTON, ID_RELOAD_BUTTON,
ID_URL_TEXTFIELD, ID_URL_TEXTFIELD,
ID_MENU_BUTTON, ID_MENU_BUTTON,
ID_TOP_FILE_MENU_BUTTON,
ID_TOP_TEST_MENU_BUTTON,
}; };
typedef std::vector<CefRefPtr<CefLabelButton> > LabelButtons; typedef std::vector<CefRefPtr<CefLabelButton> > LabelButtons;
@ -60,6 +62,30 @@ void MakeButtonsSameSize(const LabelButtons& buttons) {
} }
} }
void AddTestMenuItems(CefRefPtr<CefMenuModel> test_menu) {
test_menu->AddItem(ID_TESTS_GETSOURCE, "Get Source");
test_menu->AddItem(ID_TESTS_GETTEXT, "Get Text");
test_menu->AddItem(ID_TESTS_WINDOW_NEW, "New Window");
test_menu->AddItem(ID_TESTS_WINDOW_POPUP, "Popup Window");
test_menu->AddItem(ID_TESTS_REQUEST, "Request");
test_menu->AddItem(ID_TESTS_PLUGIN_INFO, "Plugin Info");
test_menu->AddItem(ID_TESTS_ZOOM_IN, "Zoom In");
test_menu->AddItem(ID_TESTS_ZOOM_OUT, "Zoom Out");
test_menu->AddItem(ID_TESTS_ZOOM_RESET, "Zoom Reset");
test_menu->AddItem(ID_TESTS_TRACING_BEGIN, "Begin Tracing");
test_menu->AddItem(ID_TESTS_TRACING_END, "End Tracing");
test_menu->AddItem(ID_TESTS_PRINT, "Print");
test_menu->AddItem(ID_TESTS_PRINT_TO_PDF, "Print to PDF");
test_menu->AddItem(ID_TESTS_OTHER_TESTS, "Other Tests");
}
void AddFileMenuItems(CefRefPtr<CefMenuModel> file_menu, int offset) {
file_menu->AddItem(ID_QUIT, "E&xit");
// Show the accelerator shortcut text in the menu.
file_menu->SetAcceleratorAt(offset, 'X', false, false, true);
}
} // namespace } // namespace
// static // static
@ -211,13 +237,8 @@ void ViewsWindow::TakeFocus(bool next) {
if (!window_ || !with_controls_) if (!window_ || !with_controls_)
return; return;
if (next) { // Give focus to the URL textfield.
// Focus is moving forwards (tab). Give focus to the URL textfield. window_->GetViewForID(ID_URL_TEXTFIELD)->RequestFocus();
window_->GetViewForID(ID_URL_TEXTFIELD)->RequestFocus();
} else {
// Focus is moving backwards (tab+shift). Give focus to the menu button.
window_->GetViewForID(ID_MENU_BUTTON)->RequestFocus();
}
} }
bool ViewsWindow::OnPopupBrowserViewCreated( bool ViewsWindow::OnPopupBrowserViewCreated(
@ -280,9 +301,23 @@ void ViewsWindow::OnMenuButtonPressed(CefRefPtr<CefMenuButton> menu_button,
const CefPoint& screen_point) { const CefPoint& screen_point) {
CEF_REQUIRE_UI_THREAD(); CEF_REQUIRE_UI_THREAD();
DCHECK(with_controls_); DCHECK(with_controls_);
DCHECK_EQ(ID_MENU_BUTTON, menu_button->GetID());
menu_button->ShowMenu(menu_model_, screen_point, CEF_MENU_ANCHOR_TOPRIGHT); CefRefPtr<CefMenuModel> menu_model;
switch (menu_button->GetID()) {
case ID_MENU_BUTTON:
menu_model = button_menu_model_;
break;
case ID_TOP_FILE_MENU_BUTTON:
menu_model = file_menu_model_;
break;
case ID_TOP_TEST_MENU_BUTTON:
menu_model = test_menu_model_;
break;
}
if (menu_model)
menu_button->ShowMenu(menu_model, screen_point, CEF_MENU_ANCHOR_TOPRIGHT);
} }
void ViewsWindow::ExecuteCommand(CefRefPtr<CefMenuModel> menu_model, void ViewsWindow::ExecuteCommand(CefRefPtr<CefMenuModel> menu_model,
@ -386,7 +421,9 @@ void ViewsWindow::OnWindowDestroyed(CefRefPtr<CefWindow> window) {
delegate_->OnViewsWindowDestroyed(this); delegate_->OnViewsWindowDestroyed(this);
browser_view_ = NULL; browser_view_ = NULL;
menu_model_ = NULL; button_menu_model_ = NULL;
file_menu_model_ = NULL;
test_menu_model_ = NULL;
window_ = NULL; window_ = NULL;
} }
@ -424,8 +461,8 @@ bool ViewsWindow::OnKeyEvent(CefRefPtr<CefWindow> window,
return false; return false;
if (event.type == KEYEVENT_RAWKEYDOWN && event.windows_key_code == VK_MENU) { if (event.type == KEYEVENT_RAWKEYDOWN && event.windows_key_code == VK_MENU) {
// ALT key is pressed. Give focus to the menu button. // ALT key is pressed. Make the menu buttons focusable.
window_->GetViewForID(ID_MENU_BUTTON)->RequestFocus(); SetMenuFocusable(true);
return true; return true;
} }
@ -441,10 +478,28 @@ CefSize ViewsWindow::GetMinimumSize(CefRefPtr<CefView> view) {
return CefSize(); return CefSize();
} }
void ViewsWindow::OnFocus(CefRefPtr<CefView> view) {
CEF_REQUIRE_UI_THREAD();
// When focus leaves the menu buttons make them unfocusable.
if (menu_has_focus_) {
const int view_id = view->GetID();
if (with_top_menu_) {
if (view_id != ID_TOP_FILE_MENU_BUTTON &&
view_id != ID_TOP_TEST_MENU_BUTTON) {
SetMenuFocusable(false);
}
} else if (view_id != ID_MENU_BUTTON) {
SetMenuFocusable(false);
}
}
}
ViewsWindow::ViewsWindow(Delegate* delegate, ViewsWindow::ViewsWindow(Delegate* delegate,
CefRefPtr<CefBrowserView> browser_view) CefRefPtr<CefBrowserView> browser_view)
: delegate_(delegate), : delegate_(delegate),
with_controls_(false) { with_controls_(false),
menu_has_focus_(false) {
DCHECK(delegate_); DCHECK(delegate_);
if (browser_view) if (browser_view)
SetBrowserView(browser_view); SetBrowserView(browser_view);
@ -452,6 +507,7 @@ ViewsWindow::ViewsWindow(Delegate* delegate,
CefRefPtr<CefCommandLine> command_line = CefRefPtr<CefCommandLine> command_line =
CefCommandLine::GetGlobalCommandLine(); CefCommandLine::GetGlobalCommandLine();
frameless_ = command_line->HasSwitch(switches::kHideFrame); frameless_ = command_line->HasSwitch(switches::kHideFrame);
with_top_menu_ = command_line->HasSwitch(switches::kShowTopMenu);
} }
void ViewsWindow::SetBrowserView(CefRefPtr<CefBrowserView> browser_view) { void ViewsWindow::SetBrowserView(CefRefPtr<CefBrowserView> browser_view) {
@ -463,29 +519,31 @@ void ViewsWindow::SetBrowserView(CefRefPtr<CefBrowserView> browser_view) {
} }
void ViewsWindow::CreateMenuModel() { void ViewsWindow::CreateMenuModel() {
menu_model_ = CefMenuModel::CreateMenuModel(this); // Create the menu button model.
button_menu_model_ = CefMenuModel::CreateMenuModel(this);
CefRefPtr<CefMenuModel> test_menu =
button_menu_model_->AddSubMenu(0, "&Tests");
AddTestMenuItems(test_menu);
AddFileMenuItems(button_menu_model_, 1);
// Create the test menu. if (with_top_menu_) {
CefRefPtr<CefMenuModel> test_menu = menu_model_->AddSubMenu(0, "&Tests"); // Create the top menu model.
test_menu->AddItem(ID_TESTS_GETSOURCE, "Get Source"); file_menu_model_ = CefMenuModel::CreateMenuModel(this);
test_menu->AddItem(ID_TESTS_GETTEXT, "Get Text"); AddFileMenuItems(file_menu_model_, 0);
test_menu->AddItem(ID_TESTS_WINDOW_NEW, "New Window"); test_menu_model_ = CefMenuModel::CreateMenuModel(this);
test_menu->AddItem(ID_TESTS_WINDOW_POPUP, "Popup Window"); AddTestMenuItems(test_menu_model_);
test_menu->AddItem(ID_TESTS_REQUEST, "Request"); }
test_menu->AddItem(ID_TESTS_PLUGIN_INFO, "Plugin Info"); }
test_menu->AddItem(ID_TESTS_ZOOM_IN, "Zoom In");
test_menu->AddItem(ID_TESTS_ZOOM_OUT, "Zoom Out");
test_menu->AddItem(ID_TESTS_ZOOM_RESET, "Zoom Reset");
test_menu->AddItem(ID_TESTS_TRACING_BEGIN, "Begin Tracing");
test_menu->AddItem(ID_TESTS_TRACING_END, "End Tracing");
test_menu->AddItem(ID_TESTS_PRINT, "Print");
test_menu->AddItem(ID_TESTS_PRINT_TO_PDF, "Print to PDF");
test_menu->AddItem(ID_TESTS_OTHER_TESTS, "Other Tests");
menu_model_->AddItem(ID_QUIT, "E&xit"); CefRefPtr<CefMenuButton> ViewsWindow::CreateTopMenuButton(
const std::string& label, int id) {
// Show the accelerator shortcut text in the menu. CefRefPtr<CefMenuButton> button =
menu_model_->SetAcceleratorAt(1, 'X', false, false, true); CefMenuButton::CreateMenuButton(this, label, false, false);
button->SetID(id);
// Assign a group ID to allow focus traversal between top menu buttons using
// the arrow keys.
button->SetGroupID(1);
return button;
} }
CefRefPtr<CefLabelButton> ViewsWindow::CreateBrowseButton( CefRefPtr<CefLabelButton> ViewsWindow::CreateBrowseButton(
@ -503,6 +561,27 @@ void ViewsWindow::AddControls() {
// Create the MenuModel that will be displayed via the menu button. // Create the MenuModel that will be displayed via the menu button.
CreateMenuModel(); CreateMenuModel();
CefRefPtr<CefPanel> top_menu_panel;
if (with_top_menu_) {
// Create the top menu buttons.
CefRefPtr<CefMenuButton> top_file_menu_button =
CreateTopMenuButton("File", ID_TOP_FILE_MENU_BUTTON);
CefRefPtr<CefMenuButton> top_test_menu_button =
CreateTopMenuButton("Test", ID_TOP_TEST_MENU_BUTTON);
// Create the top menu panel.
top_menu_panel = CefPanel::CreatePanel(NULL);
// Use a horizontal box layout for |top_panel|.
CefBoxLayoutSettings top_panel_layout_settings;
top_panel_layout_settings.horizontal = true;
CefRefPtr<CefBoxLayout> top_panel_layout =
top_menu_panel->SetToBoxLayout(top_panel_layout_settings);
top_menu_panel->AddChildView(top_file_menu_button);
top_menu_panel->AddChildView(top_test_menu_button);
}
// Create the browse buttons. // Create the browse buttons.
LabelButtons browse_buttons; LabelButtons browse_buttons;
browse_buttons.push_back(CreateBrowseButton("Back", ID_BACK_BUTTON)); browse_buttons.push_back(CreateBrowseButton("Back", ID_BACK_BUTTON));
@ -522,8 +601,6 @@ void ViewsWindow::AddControls() {
menu_button->SetImage(CEF_BUTTON_STATE_NORMAL, LoadImageIcon("menu_icon")); menu_button->SetImage(CEF_BUTTON_STATE_NORMAL, LoadImageIcon("menu_icon"));
// Override the default minimum size. // Override the default minimum size.
menu_button->SetMinimumSize(CefSize(0, 0)); menu_button->SetMinimumSize(CefSize(0, 0));
// Menu button must be focusable for keyboard access to work.
menu_button->SetFocusable(true);
// Create the top panel. // Create the top panel.
CefRefPtr<CefPanel> top_panel = CefPanel::CreatePanel(NULL); CefRefPtr<CefPanel> top_panel = CefPanel::CreatePanel(NULL);
@ -551,6 +628,8 @@ void ViewsWindow::AddControls() {
window_->SetToBoxLayout(window_layout_settings); window_->SetToBoxLayout(window_layout_settings);
// Add the top panel and browser view to |window|. // Add the top panel and browser view to |window|.
if (top_menu_panel)
window_->AddChildView(top_menu_panel);
window_->AddChildView(top_panel); window_->AddChildView(top_panel);
window_->AddChildView(browser_view_); window_->AddChildView(browser_view_);
@ -570,7 +649,9 @@ void ViewsWindow::AddControls() {
const int min_width = browse_buttons[0]->GetBounds().width * 4 + const int min_width = browse_buttons[0]->GetBounds().width * 4 +
menu_button->GetBounds().width + 100; menu_button->GetBounds().width + 100;
// Minimum window height is the hight of the top toolbar plus some extra. // Minimum window height is the hight of the top toolbar plus some extra.
const int min_height = top_panel->GetBounds().height + 100; int min_height = top_panel->GetBounds().height + 100;
if (top_menu_panel)
min_height += top_menu_panel->GetBounds().height;
minimum_window_size_ = CefSize(min_width, min_height); minimum_window_size_ = CefSize(min_width, min_height);
} }
@ -584,6 +665,30 @@ void ViewsWindow::AddAccelerators() {
window_->SetAccelerator(ID_QUIT, 'X', false, false, true); window_->SetAccelerator(ID_QUIT, 'X', false, false, true);
} }
void ViewsWindow::SetMenuFocusable(bool focusable) {
if (!window_ || !with_controls_)
return;
if (with_top_menu_) {
window_->GetViewForID(ID_TOP_FILE_MENU_BUTTON)->SetFocusable(focusable);
window_->GetViewForID(ID_TOP_TEST_MENU_BUTTON)->SetFocusable(focusable);
if (focusable) {
// Give focus to top file menu button.
window_->GetViewForID(ID_TOP_FILE_MENU_BUTTON)->RequestFocus();
}
} else {
window_->GetViewForID(ID_MENU_BUTTON)->SetFocusable(focusable);
if (focusable) {
// Give focus to menu button.
window_->GetViewForID(ID_MENU_BUTTON)->RequestFocus();
}
}
menu_has_focus_ = focusable;
}
void ViewsWindow::EnableView(int id, bool enable) { void ViewsWindow::EnableView(int id, bool enable) {
if (!window_) if (!window_)
return; return;

View File

@ -117,7 +117,8 @@ class ViewsWindow : public CefBrowserViewDelegate,
const CefKeyEvent& event) OVERRIDE; const CefKeyEvent& event) OVERRIDE;
// CefViewDelegate methods: // CefViewDelegate methods:
CefSize GetMinimumSize(CefRefPtr<CefView> view) override; CefSize GetMinimumSize(CefRefPtr<CefView> view) OVERRIDE;
void OnFocus(CefRefPtr<CefView> view) OVERRIDE;
private: private:
// |delegate| is guaranteed to outlive this object. // |delegate| is guaranteed to outlive this object.
@ -129,6 +130,8 @@ class ViewsWindow : public CefBrowserViewDelegate,
// Create controls. // Create controls.
void CreateMenuModel(); void CreateMenuModel();
CefRefPtr<CefMenuButton> CreateTopMenuButton(const std::string& label,
int id);
CefRefPtr<CefLabelButton> CreateBrowseButton(const std::string& label, CefRefPtr<CefLabelButton> CreateBrowseButton(const std::string& label,
int id); int id);
@ -138,6 +141,9 @@ class ViewsWindow : public CefBrowserViewDelegate,
// Add keyboard accelerators to the Window. // Add keyboard accelerators to the Window.
void AddAccelerators(); void AddAccelerators();
// Control whether the top menu butons are focusable.
void SetMenuFocusable(bool focusable);
// Enable or disable a view by |id|. // Enable or disable a view by |id|.
void EnableView(int id, bool enable); void EnableView(int id, bool enable);
@ -148,9 +154,13 @@ class ViewsWindow : public CefBrowserViewDelegate,
CefRefPtr<CefBrowserView> browser_view_; CefRefPtr<CefBrowserView> browser_view_;
bool frameless_; bool frameless_;
bool with_controls_; bool with_controls_;
bool with_top_menu_;
CefRefPtr<CefWindow> window_; CefRefPtr<CefWindow> window_;
CefRefPtr<CefMenuModel> menu_model_; CefRefPtr<CefMenuModel> button_menu_model_;
CefRefPtr<CefMenuModel> file_menu_model_;
CefRefPtr<CefMenuModel> test_menu_model_;
bool menu_has_focus_;
CefSize minimum_window_size_; CefSize minimum_window_size_;

View File

@ -34,6 +34,7 @@ const char kFilterURL[] = "filter-url";
const char kUseViews[] = "use-views"; const char kUseViews[] = "use-views";
const char kHideFrame[] = "hide-frame"; const char kHideFrame[] = "hide-frame";
const char kHideControls[] = "hide-controls"; const char kHideControls[] = "hide-controls";
const char kShowTopMenu[] = "show-top-menu";
const char kWidevineCdmPath[] = "widevine-cdm-path"; const char kWidevineCdmPath[] = "widevine-cdm-path";
const char kSslClientCertificate[] = "ssl-client-certificate"; const char kSslClientCertificate[] = "ssl-client-certificate";

View File

@ -28,6 +28,7 @@ extern const char kFilterURL[];
extern const char kUseViews[]; extern const char kUseViews[];
extern const char kHideFrame[]; extern const char kHideFrame[];
extern const char kHideControls[]; extern const char kHideControls[];
extern const char kShowTopMenu[];
extern const char kWidevineCdmPath[]; extern const char kWidevineCdmPath[];
extern const char kSslClientCertificate[]; extern const char kSslClientCertificate[];