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=91327244b4a4c037841a54ea2a06ebe42efe5477$ 13 // 14 15 #include "libcef_dll/cpptoc/views/layout_cpptoc.h" 16 #include "libcef_dll/cpptoc/views/box_layout_cpptoc.h" 17 #include "libcef_dll/cpptoc/views/fill_layout_cpptoc.h" 18 #include "libcef_dll/shutdown_checker.h" 19 20 namespace { 21 22 // MEMBER FUNCTIONS - Body may be edited by hand. 23 24 cef_box_layout_t* CEF_CALLBACK layout_as_box_layout(struct _cef_layout_t * self)25layout_as_box_layout(struct _cef_layout_t* self) { 26 shutdown_checker::AssertNotShutdown(); 27 28 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 29 30 DCHECK(self); 31 if (!self) 32 return NULL; 33 34 // Execute 35 CefRefPtr<CefBoxLayout> _retval = CefLayoutCppToC::Get(self)->AsBoxLayout(); 36 37 // Return type: refptr_same 38 return CefBoxLayoutCppToC::Wrap(_retval); 39 } 40 41 cef_fill_layout_t* CEF_CALLBACK layout_as_fill_layout(struct _cef_layout_t * self)42layout_as_fill_layout(struct _cef_layout_t* self) { 43 shutdown_checker::AssertNotShutdown(); 44 45 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 46 47 DCHECK(self); 48 if (!self) 49 return NULL; 50 51 // Execute 52 CefRefPtr<CefFillLayout> _retval = CefLayoutCppToC::Get(self)->AsFillLayout(); 53 54 // Return type: refptr_same 55 return CefFillLayoutCppToC::Wrap(_retval); 56 } 57 layout_is_valid(struct _cef_layout_t * self)58int CEF_CALLBACK layout_is_valid(struct _cef_layout_t* self) { 59 shutdown_checker::AssertNotShutdown(); 60 61 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 62 63 DCHECK(self); 64 if (!self) 65 return 0; 66 67 // Execute 68 bool _retval = CefLayoutCppToC::Get(self)->IsValid(); 69 70 // Return type: bool 71 return _retval; 72 } 73 74 } // namespace 75 76 // CONSTRUCTOR - Do not edit by hand. 77 CefLayoutCppToC()78CefLayoutCppToC::CefLayoutCppToC() { 79 GetStruct()->as_box_layout = layout_as_box_layout; 80 GetStruct()->as_fill_layout = layout_as_fill_layout; 81 GetStruct()->is_valid = layout_is_valid; 82 } 83 84 // DESTRUCTOR - Do not edit by hand. 85 ~CefLayoutCppToC()86CefLayoutCppToC::~CefLayoutCppToC() { 87 shutdown_checker::AssertNotShutdown(); 88 } 89 90 template <> 91 CefRefPtr<CefLayout> UnwrapDerived(CefWrapperType type,cef_layout_t * s)92CefCppToCRefCounted<CefLayoutCppToC, CefLayout, cef_layout_t>::UnwrapDerived( 93 CefWrapperType type, 94 cef_layout_t* s) { 95 if (type == WT_BOX_LAYOUT) { 96 return CefBoxLayoutCppToC::Unwrap(reinterpret_cast<cef_box_layout_t*>(s)); 97 } 98 if (type == WT_FILL_LAYOUT) { 99 return CefFillLayoutCppToC::Unwrap(reinterpret_cast<cef_fill_layout_t*>(s)); 100 } 101 NOTREACHED() << "Unexpected class type: " << type; 102 return nullptr; 103 } 104 105 template <> 106 CefWrapperType CefCppToCRefCounted<CefLayoutCppToC, CefLayout, cef_layout_t>:: 107 kWrapperType = WT_LAYOUT; 108