1 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2 // 3 // Redistribution and use in source and binary forms, with or without 4 // modification, are permitted provided that the following conditions are 5 // met: 6 // 7 // * Redistributions of source code must retain the above copyright 8 // notice, this list of conditions and the following disclaimer. 9 // * Redistributions in binary form must reproduce the above 10 // copyright notice, this list of conditions and the following disclaimer 11 // in the documentation and/or other materials provided with the 12 // distribution. 13 // * Neither the name of Google Inc. nor the name Chromium Embedded 14 // Framework nor the names of its contributors may be used to endorse 15 // or promote products derived from this software without specific prior 16 // written permission. 17 // 18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 // 30 // --------------------------------------------------------------------------- 31 // 32 // This file was generated by the CEF translator tool and should not edited 33 // by hand. See the translator.README.txt file in the tools directory for 34 // more information. 35 // 36 // $hash=a9e35ca17785f77666db7650208cacfd9a85c3e0$ 37 // 38 39 #ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_CAPI_H_ 40 #define CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_CAPI_H_ 41 #pragma once 42 43 #include "include/capi/cef_base_capi.h" 44 #include "include/capi/cef_values_capi.h" 45 46 #ifdef __cplusplus 47 extern "C" { 48 #endif 49 50 /// 51 // Structure used for retrieving resources from the resource bundle (*.pak) 52 // files loaded by CEF during startup or via the cef_resource_bundle_handler_t 53 // returned from cef_app_t::GetResourceBundleHandler. See CefSettings for 54 // additional options related to resource bundle loading. The functions of this 55 // structure may be called on any thread unless otherwise indicated. 56 /// 57 typedef struct _cef_resource_bundle_t { 58 /// 59 // Base structure. 60 /// 61 cef_base_ref_counted_t base; 62 63 /// 64 // Returns the localized string for the specified |string_id| or an NULL 65 // string if the value is not found. Include cef_pack_strings.h for a listing 66 // of valid string ID values. 67 /// 68 // The resulting string must be freed by calling cef_string_userfree_free(). 69 cef_string_userfree_t(CEF_CALLBACK* get_localized_string)( 70 struct _cef_resource_bundle_t* self, 71 int string_id); 72 73 /// 74 // Returns a cef_binary_value_t containing the decompressed contents of the 75 // specified scale independent |resource_id| or NULL if not found. Include 76 // cef_pack_resources.h for a listing of valid resource ID values. 77 /// 78 struct _cef_binary_value_t*(CEF_CALLBACK* get_data_resource)( 79 struct _cef_resource_bundle_t* self, 80 int resource_id); 81 82 /// 83 // Returns a cef_binary_value_t containing the decompressed contents of the 84 // specified |resource_id| nearest the scale factor |scale_factor| or NULL if 85 // not found. Use a |scale_factor| value of SCALE_FACTOR_NONE for scale 86 // independent resources or call GetDataResource instead.Include 87 // cef_pack_resources.h for a listing of valid resource ID values. 88 /// 89 struct _cef_binary_value_t*(CEF_CALLBACK* get_data_resource_for_scale)( 90 struct _cef_resource_bundle_t* self, 91 int resource_id, 92 cef_scale_factor_t scale_factor); 93 } cef_resource_bundle_t; 94 95 /// 96 // Returns the global resource bundle instance. 97 /// 98 CEF_EXPORT cef_resource_bundle_t* cef_resource_bundle_get_global(); 99 100 #ifdef __cplusplus 101 } 102 #endif 103 104 #endif // CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_CAPI_H_ 105