1 // Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 2 // reserved. Use of this source code is governed by a BSD-style license that 3 // can be found in the LICENSE file. 4 // 5 // --------------------------------------------------------------------------- 6 // 7 // This file was generated by the CEF translator tool. If making changes by 8 // hand only do so within the body of existing method and function 9 // implementations. See the translator.README.txt file in the tools directory 10 // for more information. 11 // 12 // $hash=6607a4c252dafd39ba695b5d4ecfb14286d70672$ 13 // 14 15 #include "libcef_dll/ctocpp/views/layout_ctocpp.h" 16 #include "libcef_dll/ctocpp/views/box_layout_ctocpp.h" 17 #include "libcef_dll/ctocpp/views/fill_layout_ctocpp.h" 18 #include "libcef_dll/shutdown_checker.h" 19 20 // VIRTUAL METHODS - Body may be edited by hand. 21 22 NO_SANITIZE("cfi-icall") AsBoxLayout()23CefRefPtr<CefBoxLayout> CefLayoutCToCpp::AsBoxLayout() { 24 shutdown_checker::AssertNotShutdown(); 25 26 cef_layout_t* _struct = GetStruct(); 27 if (CEF_MEMBER_MISSING(_struct, as_box_layout)) 28 return nullptr; 29 30 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 31 32 // Execute 33 cef_box_layout_t* _retval = _struct->as_box_layout(_struct); 34 35 // Return type: refptr_same 36 return CefBoxLayoutCToCpp::Wrap(_retval); 37 } 38 39 NO_SANITIZE("cfi-icall") AsFillLayout()40CefRefPtr<CefFillLayout> CefLayoutCToCpp::AsFillLayout() { 41 shutdown_checker::AssertNotShutdown(); 42 43 cef_layout_t* _struct = GetStruct(); 44 if (CEF_MEMBER_MISSING(_struct, as_fill_layout)) 45 return nullptr; 46 47 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 48 49 // Execute 50 cef_fill_layout_t* _retval = _struct->as_fill_layout(_struct); 51 52 // Return type: refptr_same 53 return CefFillLayoutCToCpp::Wrap(_retval); 54 } 55 IsValid()56NO_SANITIZE("cfi-icall") bool CefLayoutCToCpp::IsValid() { 57 shutdown_checker::AssertNotShutdown(); 58 59 cef_layout_t* _struct = GetStruct(); 60 if (CEF_MEMBER_MISSING(_struct, is_valid)) 61 return false; 62 63 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 64 65 // Execute 66 int _retval = _struct->is_valid(_struct); 67 68 // Return type: bool 69 return _retval ? true : false; 70 } 71 72 // CONSTRUCTOR - Do not edit by hand. 73 CefLayoutCToCpp()74CefLayoutCToCpp::CefLayoutCToCpp() {} 75 76 // DESTRUCTOR - Do not edit by hand. 77 ~CefLayoutCToCpp()78CefLayoutCToCpp::~CefLayoutCToCpp() { 79 shutdown_checker::AssertNotShutdown(); 80 } 81 82 template <> 83 cef_layout_t* UnwrapDerived(CefWrapperType type,CefLayout * c)84CefCToCppRefCounted<CefLayoutCToCpp, CefLayout, cef_layout_t>::UnwrapDerived( 85 CefWrapperType type, 86 CefLayout* c) { 87 if (type == WT_BOX_LAYOUT) { 88 return reinterpret_cast<cef_layout_t*>( 89 CefBoxLayoutCToCpp::Unwrap(reinterpret_cast<CefBoxLayout*>(c))); 90 } 91 if (type == WT_FILL_LAYOUT) { 92 return reinterpret_cast<cef_layout_t*>( 93 CefFillLayoutCToCpp::Unwrap(reinterpret_cast<CefFillLayout*>(c))); 94 } 95 NOTREACHED() << "Unexpected class type: " << type; 96 return nullptr; 97 } 98 99 template <> 100 CefWrapperType CefCToCppRefCounted<CefLayoutCToCpp, CefLayout, cef_layout_t>:: 101 kWrapperType = WT_LAYOUT; 102