• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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=5081aa41e87ea1a44df19f1df060a478b3b902d8$
13 //
14 
15 #include "libcef_dll/cpptoc/resource_bundle_cpptoc.h"
16 #include "libcef_dll/cpptoc/binary_value_cpptoc.h"
17 
18 // GLOBAL FUNCTIONS - Body may be edited by hand.
19 
cef_resource_bundle_get_global()20 CEF_EXPORT cef_resource_bundle_t* cef_resource_bundle_get_global() {
21   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
22 
23   // Execute
24   CefRefPtr<CefResourceBundle> _retval = CefResourceBundle::GetGlobal();
25 
26   // Return type: refptr_same
27   return CefResourceBundleCppToC::Wrap(_retval);
28 }
29 
30 namespace {
31 
32 // MEMBER FUNCTIONS - Body may be edited by hand.
33 
34 cef_string_userfree_t CEF_CALLBACK
resource_bundle_get_localized_string(struct _cef_resource_bundle_t * self,int string_id)35 resource_bundle_get_localized_string(struct _cef_resource_bundle_t* self,
36                                      int string_id) {
37   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
38 
39   DCHECK(self);
40   if (!self)
41     return NULL;
42 
43   // Execute
44   CefString _retval =
45       CefResourceBundleCppToC::Get(self)->GetLocalizedString(string_id);
46 
47   // Return type: string
48   return _retval.DetachToUserFree();
49 }
50 
51 struct _cef_binary_value_t* CEF_CALLBACK
resource_bundle_get_data_resource(struct _cef_resource_bundle_t * self,int resource_id)52 resource_bundle_get_data_resource(struct _cef_resource_bundle_t* self,
53                                   int resource_id) {
54   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
55 
56   DCHECK(self);
57   if (!self)
58     return NULL;
59 
60   // Execute
61   CefRefPtr<CefBinaryValue> _retval =
62       CefResourceBundleCppToC::Get(self)->GetDataResource(resource_id);
63 
64   // Return type: refptr_same
65   return CefBinaryValueCppToC::Wrap(_retval);
66 }
67 
68 struct _cef_binary_value_t* CEF_CALLBACK
resource_bundle_get_data_resource_for_scale(struct _cef_resource_bundle_t * self,int resource_id,cef_scale_factor_t scale_factor)69 resource_bundle_get_data_resource_for_scale(struct _cef_resource_bundle_t* self,
70                                             int resource_id,
71                                             cef_scale_factor_t scale_factor) {
72   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
73 
74   DCHECK(self);
75   if (!self)
76     return NULL;
77 
78   // Execute
79   CefRefPtr<CefBinaryValue> _retval =
80       CefResourceBundleCppToC::Get(self)->GetDataResourceForScale(resource_id,
81                                                                   scale_factor);
82 
83   // Return type: refptr_same
84   return CefBinaryValueCppToC::Wrap(_retval);
85 }
86 
87 }  // namespace
88 
89 // CONSTRUCTOR - Do not edit by hand.
90 
CefResourceBundleCppToC()91 CefResourceBundleCppToC::CefResourceBundleCppToC() {
92   GetStruct()->get_localized_string = resource_bundle_get_localized_string;
93   GetStruct()->get_data_resource = resource_bundle_get_data_resource;
94   GetStruct()->get_data_resource_for_scale =
95       resource_bundle_get_data_resource_for_scale;
96 }
97 
98 // DESTRUCTOR - Do not edit by hand.
99 
~CefResourceBundleCppToC()100 CefResourceBundleCppToC::~CefResourceBundleCppToC() {}
101 
102 template <>
103 CefRefPtr<CefResourceBundle> CefCppToCRefCounted<
104     CefResourceBundleCppToC,
105     CefResourceBundle,
UnwrapDerived(CefWrapperType type,cef_resource_bundle_t * s)106     cef_resource_bundle_t>::UnwrapDerived(CefWrapperType type,
107                                           cef_resource_bundle_t* s) {
108   NOTREACHED() << "Unexpected class type: " << type;
109   return nullptr;
110 }
111 
112 template <>
113 CefWrapperType CefCppToCRefCounted<CefResourceBundleCppToC,
114                                    CefResourceBundle,
115                                    cef_resource_bundle_t>::kWrapperType =
116     WT_RESOURCE_BUNDLE;
117