diff --git a/cef.gyp b/cef.gyp index 24addfa31..d5c583e62 100644 --- a/cef.gyp +++ b/cef.gyp @@ -492,6 +492,7 @@ 'libcef_dll/ctocpp/write_handler_ctocpp.cc', 'libcef_dll/ctocpp/write_handler_ctocpp.h', 'libcef_dll/libcef_dll.cc', + 'libcef_dll/libcef_dll2.cc', 'libcef_dll/resource.h', 'libcef_dll/transfer_util.cpp', 'libcef_dll/transfer_util.h', diff --git a/cef_paths.gypi b/cef_paths.gypi index f3fe7ac6f..6dce703ce 100644 --- a/cef_paths.gypi +++ b/cef_paths.gypi @@ -235,6 +235,7 @@ 'libcef_dll/wrapper/cef_xml_object.cc', 'libcef_dll/wrapper/cef_zip_archive.cc', 'libcef_dll/wrapper/libcef_dll_wrapper.cc', + 'libcef_dll/wrapper/libcef_dll_wrapper2.cc', ], }, } diff --git a/include/cef.h b/include/cef.h index db6b371f6..4049a74b5 100644 --- a/include/cef.h +++ b/include/cef.h @@ -90,7 +90,7 @@ class CefWebURLRequestClient; // empty. A return value of true indicates that it succeeded and false indicates // that it failed. /// -/*--cef()--*/ +/*--cef(revision_check,optional_param=application)--*/ bool CefInitialize(const CefSettings& settings, CefRefPtr application); /// @@ -181,7 +181,7 @@ void CefRunMessageLoop(); // example.test.increment(); // /// -/*--cef()--*/ +/*--cef(optional_param=handler)--*/ bool CefRegisterExtension(const CefString& extension_name, const CefString& javascript_code, CefRefPtr handler); @@ -249,7 +249,7 @@ bool CefRegisterCustomScheme(const CefString& scheme_name, // that matches the specified |scheme_name| and optional |domain_name|. // Returns false if an error occurs. This function may be called on any thread. /// -/*--cef()--*/ +/*--cef(optional_param=domain_name,optional_param=factory)--*/ bool CefRegisterSchemeHandlerFactory(const CefString& scheme_name, const CefString& domain_name, CefRefPtr factory); @@ -400,7 +400,7 @@ bool CefSetCookie(const CefString& url, const CefCookie& cookie); // invalid URL is specified or if cookies cannot be accessed. This method must // be called on the IO thread. /// -/*--cef()--*/ +/*--cef(optional_param=url,optional_param=cookie_name)--*/ bool CefDeleteCookies(const CefString& url, const CefString& cookie_name); /// @@ -408,7 +408,7 @@ bool CefDeleteCookies(const CefString& url, const CefString& cookie_name); // is empty data will be stored in memory only. By default the cookie path is // the same as the cache path. Returns false if cookies cannot be accessed. /// -/*--cef()--*/ +/*--cef(optional_param=path)--*/ bool CefSetCookiePath(const CefString& path); @@ -422,7 +422,7 @@ typedef cef_storage_type_t CefStorageType; // origin is specified only data currently in memory will be returned. Returns // false if the storage cannot be accessed. /// -/*--cef()--*/ +/*--cef(optional_param=origin,optional_param=key)--*/ bool CefVisitStorage(CefStorageType type, const CefString& origin, const CefString& key, CefRefPtr visitor); @@ -442,7 +442,7 @@ bool CefSetStorage(CefStorageType type, const CefString& origin, // will be cleared. Returns false if storage cannot be accessed. This method // must be called on the UI thread. /// -/*--cef()--*/ +/*--cef(optional_param=origin,optional_param=key)--*/ bool CefDeleteStorage(CefStorageType type, const CefString& origin, const CefString& key); @@ -453,7 +453,7 @@ bool CefDeleteStorage(CefStorageType type, const CefString& origin, // path is the same as the cache path. Returns false if the storage cannot be // accessed. /// -/*--cef()--*/ +/*--cef(optional_param=path)--*/ bool CefSetStoragePath(CefStorageType type, const CefString& path); @@ -635,7 +635,7 @@ public: // |windowInfo|. All values will be copied internally and the actual window // will be created on the UI thread. This method call will not block. /// - /*--cef()--*/ + /*--cef(optional_param=url)--*/ static bool CreateBrowser(CefWindowInfo& windowInfo, CefRefPtr client, const CefString& url, @@ -645,7 +645,7 @@ public: // Create a new browser window using the window parameters specified by // |windowInfo|. This method should only be called on the UI thread. /// - /*--cef()--*/ + /*--cef(optional_param=url)--*/ static CefRefPtr CreateBrowserSync(CefWindowInfo& windowInfo, CefRefPtr client, const CefString& url, @@ -1013,7 +1013,7 @@ public: // error. The |start_line| parameter is the base line number to use for error // reporting. /// - /*--cef()--*/ + /*--cef(optional_param=scriptUrl)--*/ virtual void ExecuteJavaScript(const CefString& jsCode, const CefString& scriptUrl, int startLine) =0; @@ -1084,7 +1084,7 @@ public: /// // Implement this interface to provide handler implementations. /// -/*--cef(source=client)--*/ +/*--cef(source=client,no_debugct_check)--*/ class CefApp : public virtual CefBase { public: @@ -1348,7 +1348,7 @@ public: /// // Called when the page title changes. /// - /*--cef()--*/ + /*--cef(optional_param=title)--*/ virtual void OnTitleChange(CefRefPtr browser, const CefString& title) {} @@ -1358,7 +1358,7 @@ public: // tooltip yourself return true. Otherwise, you can optionally modify |text| // and then return false to allow the browser to display the tooltip. /// - /*--cef()--*/ + /*--cef(optional_param=text)--*/ virtual bool OnTooltip(CefRefPtr browser, CefString& text) { return false; } @@ -1367,7 +1367,7 @@ public: // that will be displayed in the status message and |type| indicates the // status message type. /// - /*--cef()--*/ + /*--cef(optional_param=value)--*/ virtual void OnStatusMessage(CefRefPtr browser, const CefString& value, StatusType type) {} @@ -1376,7 +1376,7 @@ public: // Called to display a console message. Return true to stop the message from // being output to the console. /// - /*--cef()--*/ + /*--cef(optional_param=message,optional_param=source)--*/ virtual bool OnConsoleMessage(CefRefPtr browser, const CefString& message, const CefString& source, @@ -1421,7 +1421,7 @@ public: // keep references to or attempt to access any DOM objects outside the scope // of this method. /// - /*--cef()--*/ + /*--cef(optional_param=frame,optional_param=node)--*/ virtual void OnFocusedNodeChanged(CefRefPtr browser, CefRefPtr frame, CefRefPtr node) {} @@ -1470,8 +1470,7 @@ public: class CefMenuHandler : public virtual CefBase { public: - typedef cef_handler_menuid_t MenuId; - typedef cef_handler_menuinfo_t MenuInfo; + typedef cef_menu_id_t MenuId; /// // Called before a context menu is displayed. Return false to display the @@ -1479,7 +1478,7 @@ public: /// /*--cef()--*/ virtual bool OnBeforeMenu(CefRefPtr browser, - const MenuInfo& menuInfo) { return false; } + const CefMenuInfo& menuInfo) { return false; } /// // Called to optionally override the default text for a context menu item. @@ -1509,8 +1508,6 @@ public: class CefPrintHandler : public virtual CefBase { public: - typedef cef_print_options_t CefPrintOptions; - /// // Called to allow customization of standard print options before the print // dialog is displayed. |printOptions| allows specification of paper size, @@ -1763,7 +1760,7 @@ public: /// // Implement this interface to provide handler implementations. /// -/*--cef(source=client)--*/ +/*--cef(source=client,no_debugct_check)--*/ class CefClient : public virtual CefBase { public: @@ -1912,7 +1909,7 @@ public: /// // Set all values at one time. /// - /*--cef()--*/ + /*--cef(optional_param=postData)--*/ virtual void Set(const CefString& url, const CefString& method, CefRefPtr postData, @@ -1921,7 +1918,7 @@ public: /// // Get the flags used in combination with CefWebURLRequest. /// - /*--cef()--*/ + /*--cef(default_retval=WUR_FLAG_NONE)--*/ virtual RequestFlags GetFlags() =0; /// // Set the flags used in combination with CefWebURLRequest. @@ -1969,7 +1966,7 @@ public: /// // Retrieve the post data elements. /// - /*--cef()--*/ + /*--cef(count_func=elements:GetElementCount)--*/ virtual void GetElements(ElementVector& elements) =0; /// @@ -2034,7 +2031,7 @@ public: /// // Return the type of this post data element. /// - /*--cef()--*/ + /*--cef(default_retval=PDE_TYPE_EMPTY)--*/ virtual Type GetType() =0; /// @@ -2526,7 +2523,7 @@ public: /// // Create a new CefV8Value object of type string. /// - /*--cef()--*/ + /*--cef(optional_param=value)--*/ static CefRefPtr CreateString(const CefString& value); /// // Create a new CefV8Value object of type object. This method should only be @@ -2534,7 +2531,7 @@ public: // CefV8Accessor callback, or in combination with calling Enter() and Exit() // on a stored CefV8Context reference. /// - /*--cef()--*/ + /*--cef(optional_param=user_data)--*/ static CefRefPtr CreateObject(CefRefPtr user_data); /// // Create a new CefV8Value object of type object with accessors. This method @@ -2542,7 +2539,8 @@ public: // CefV8Handler or CefV8Accessor callback, or in combination with calling // Enter() and Exit() on a stored CefV8Context reference. /// - /*--cef(capi_name=cef_v8value_create_object_with_accessor)--*/ + /*--cef(capi_name=cef_v8value_create_object_with_accessor, + optional_param=user_data,optional_param=accessor)--*/ static CefRefPtr CreateObject(CefRefPtr user_data, CefRefPtr accessor); /// @@ -2666,7 +2664,7 @@ public: // Returns true if the object has a value with the specified identifier. /// /*--cef(capi_name=has_value_byindex)--*/ - virtual bool HasValue(int index) =0; + virtual bool HasValue(size_t index) =0; /// // Delete the value with the specified identifier. @@ -2677,7 +2675,7 @@ public: // Delete the value with the specified identifier. /// /*--cef(capi_name=delete_value_byindex)--*/ - virtual bool DeleteValue(int index) =0; + virtual bool DeleteValue(size_t index) =0; /// // Returns the value with the specified identifier. @@ -2688,7 +2686,7 @@ public: // Returns the value with the specified identifier. /// /*--cef(capi_name=get_value_byindex)--*/ - virtual CefRefPtr GetValue(int index) =0; + virtual CefRefPtr GetValue(size_t index) =0; /// // Associate a value with the specified identifier. @@ -2700,7 +2698,7 @@ public: // Associate a value with the specified identifier. /// /*--cef(capi_name=set_value_byindex)--*/ - virtual bool SetValue(int index, CefRefPtr value) =0; + virtual bool SetValue(size_t index, CefRefPtr value) =0; /// // Register an identifier whose access will be forwarded to the CefV8Accessor @@ -2758,7 +2756,7 @@ public: // thrown. If |rethrow_exception| is true any exception will also be re- // thrown. This method returns false if called incorrectly. /// - /*--cef()--*/ + /*--cef(optional_param=object)--*/ virtual bool ExecuteFunction(CefRefPtr object, const CefV8ValueList& arguments, CefRefPtr& retval, @@ -2774,7 +2772,7 @@ public: // |rethrow_exception| is true any exception will also be re-thrown. This // method returns false if called incorrectly. /// - /*--cef()--*/ + /*--cef(optional_param=object)--*/ virtual bool ExecuteFunctionWithContext(CefRefPtr context, CefRefPtr object, const CefV8ValueList& arguments, @@ -2936,7 +2934,7 @@ public: /// // Returns the current ready state of the request. /// - /*--cef()--*/ + /*--cef(default_retval=WUR_STATE_UNSENT)--*/ virtual RequestState GetState() =0; }; @@ -3054,7 +3052,7 @@ public: /// // Returns the node type. /// - /*--cef()--*/ + /*--cef(default_retval=XML_NODE_UNSUPPORTED)--*/ virtual NodeType GetType() =0; /// @@ -3140,7 +3138,7 @@ public: // Returns the value of the attribute at the specified 0-based index. /// /*--cef(capi_name=get_attribute_byindex)--*/ - virtual CefString GetAttribute(int index) =0; + virtual CefString GetAttribute(size_t index) =0; /// // Returns the value of the attribute with the specified qualified name. @@ -3185,7 +3183,7 @@ public: // true if the cursor position was set successfully. /// /*--cef(capi_name=move_to_attribute_byindex)--*/ - virtual bool MoveToAttribute(int index) =0; + virtual bool MoveToAttribute(size_t index) =0; /// // Moves the cursor to the attribute with the specified qualified name. @@ -3295,7 +3293,7 @@ public: // Opens the file for reading of uncompressed data. A read password may // optionally be specified. /// - /*--cef()--*/ + /*--cef(optional_param=password)--*/ virtual bool OpenFile(const CefString& password) =0; /// @@ -3358,7 +3356,7 @@ public: /// // Returns the document type. /// - /*--cef()--*/ + /*--cef(default_retval=DOM_DOCUMENT_TYPE_UNKNOWN)--*/ virtual Type GetType() =0; /// @@ -3468,7 +3466,7 @@ public: /// // Returns the type for this node. /// - /*--cef()--*/ + /*--cef(default_retval=DOM_NODE_TYPE_UNSUPPORTED)--*/ virtual Type GetType() =0; /// @@ -3652,13 +3650,13 @@ public: /// // Returns the event category. /// - /*--cef()--*/ + /*--cef(default_retval=DOM_EVENT_CATEGORY_UNKNOWN)--*/ virtual Category GetCategory() =0; /// // Returns the event processing phase. /// - /*--cef()--*/ + /*--cef(default_retval=DOM_EVENT_PHASE_UNKNOWN)--*/ virtual Phase GetPhase() =0; /// @@ -3832,16 +3830,17 @@ public: // arguments. Switch names are considered case-insensitive. This class can be // used before CefInitialize() is called. /// -/*--cef(source=library)--*/ +/*--cef(source=library,no_debugct_check)--*/ class CefCommandLine : public virtual CefBase { public: typedef std::vector ArgumentList; typedef std::map SwitchMap; + /// // Create a new CefCommandLine instance. /// - /*--cef()--*/ + /*--cef(revision_check)--*/ static CefRefPtr CreateCommandLine(); /// diff --git a/include/cef_capi.h b/include/cef_capi.h index f4f6bec0c..cca6673b6 100644 --- a/include/cef_capi.h +++ b/include/cef_capi.h @@ -1281,7 +1281,7 @@ typedef struct _cef_menu_handler_t /// int (CEF_CALLBACK *on_before_menu)(struct _cef_menu_handler_t* self, struct _cef_browser_t* browser, - const struct _cef_handler_menuinfo_t* menuInfo); + const struct _cef_menu_info_t* menuInfo); /// // Called to optionally override the default text for a context menu item. @@ -1289,7 +1289,7 @@ typedef struct _cef_menu_handler_t // alternate text. /// void (CEF_CALLBACK *get_menu_label)(struct _cef_menu_handler_t* self, - struct _cef_browser_t* browser, enum cef_handler_menuid_t menuId, + struct _cef_browser_t* browser, enum cef_menu_id_t menuId, cef_string_t* label); /// @@ -1297,7 +1297,7 @@ typedef struct _cef_menu_handler_t // false (0) to execute the default action or true (1) to cancel the action. /// int (CEF_CALLBACK *on_menu_action)(struct _cef_menu_handler_t* self, - struct _cef_browser_t* browser, enum cef_handler_menuid_t menuId); + struct _cef_browser_t* browser, enum cef_menu_id_t menuId); } cef_menu_handler_t; @@ -1494,7 +1494,7 @@ typedef struct _cef_render_handler_t /// void (CEF_CALLBACK *on_paint)(struct _cef_render_handler_t* self, struct _cef_browser_t* browser, enum cef_paint_element_type_t type, - size_t dirtyRectCount, cef_rect_t const* dirtyRects, + size_t dirtyRectsCount, cef_rect_t const* dirtyRects, const void* buffer); /// @@ -1745,8 +1745,8 @@ typedef struct _cef_post_data_t /// // Retrieve the post data elements. /// - struct _cef_post_data_element_t* (CEF_CALLBACK *get_elements)( - struct _cef_post_data_t* self, int elementIndex); + void (CEF_CALLBACK *get_elements)(struct _cef_post_data_t* self, + size_t* elementsCount, struct _cef_post_data_element_t** elements); /// // Remove the specified post data element. Returns true (1) if the removal @@ -2159,7 +2159,7 @@ typedef struct _cef_v8handler_t /// int (CEF_CALLBACK *execute)(struct _cef_v8handler_t* self, const cef_string_t* name, struct _cef_v8value_t* object, - size_t argumentCount, struct _cef_v8value_t* const* arguments, + size_t argumentsCount, struct _cef_v8value_t* const* arguments, struct _cef_v8value_t** retval, cef_string_t* exception); } cef_v8handler_t; @@ -2375,7 +2375,8 @@ typedef struct _cef_v8value_t /// // Returns true (1) if the object has a value with the specified identifier. /// - int (CEF_CALLBACK *has_value_byindex)(struct _cef_v8value_t* self, int index); + int (CEF_CALLBACK *has_value_byindex)(struct _cef_v8value_t* self, + size_t index); /// // Delete the value with the specified identifier. @@ -2387,7 +2388,7 @@ typedef struct _cef_v8value_t // Delete the value with the specified identifier. /// int (CEF_CALLBACK *delete_value_byindex)(struct _cef_v8value_t* self, - int index); + size_t index); /// // Returns the value with the specified identifier. @@ -2399,7 +2400,7 @@ typedef struct _cef_v8value_t // Returns the value with the specified identifier. /// struct _cef_v8value_t* (CEF_CALLBACK *get_value_byindex)( - struct _cef_v8value_t* self, int index); + struct _cef_v8value_t* self, size_t index); /// // Associate a value with the specified identifier. @@ -2411,8 +2412,8 @@ typedef struct _cef_v8value_t /// // Associate a value with the specified identifier. /// - int (CEF_CALLBACK *set_value_byindex)(struct _cef_v8value_t* self, int index, - struct _cef_v8value_t* value); + int (CEF_CALLBACK *set_value_byindex)(struct _cef_v8value_t* self, + size_t index, struct _cef_v8value_t* value); /// // Register an identifier whose access will be forwarded to the @@ -2473,7 +2474,7 @@ typedef struct _cef_v8value_t // called incorrectly. /// int (CEF_CALLBACK *execute_function)(struct _cef_v8value_t* self, - struct _cef_v8value_t* object, size_t argumentCount, + struct _cef_v8value_t* object, size_t argumentsCount, struct _cef_v8value_t* const* arguments, struct _cef_v8value_t** retval, struct _cef_v8exception_t** exception, int rethrow_exception); @@ -2488,7 +2489,7 @@ typedef struct _cef_v8value_t /// int (CEF_CALLBACK *execute_function_with_context)(struct _cef_v8value_t* self, struct _cef_v8context_t* context, struct _cef_v8value_t* object, - size_t argumentCount, struct _cef_v8value_t* const* arguments, + size_t argumentsCount, struct _cef_v8value_t* const* arguments, struct _cef_v8value_t** retval, struct _cef_v8exception_t** exception, int rethrow_exception); @@ -2916,7 +2917,7 @@ typedef struct _cef_xml_reader_t /// // The resulting string must be freed by calling cef_string_userfree_free(). cef_string_userfree_t (CEF_CALLBACK *get_attribute_byindex)( - struct _cef_xml_reader_t* self, int index); + struct _cef_xml_reader_t* self, size_t index); /// // Returns the value of the attribute with the specified qualified name. @@ -2964,7 +2965,7 @@ typedef struct _cef_xml_reader_t // true (1) if the cursor position was set successfully. /// int (CEF_CALLBACK *move_to_attribute_byindex)(struct _cef_xml_reader_t* self, - int index); + size_t index); /// // Moves the cursor to the attribute with the specified qualified name. diff --git a/include/internal/cef_types.h b/include/internal/cef_types.h index 8786890ad..261304ff2 100644 --- a/include/internal/cef_types.h +++ b/include/internal/cef_types.h @@ -652,7 +652,7 @@ enum cef_v8_propertyattribute_t /// // Structure representing menu information. /// -typedef struct _cef_handler_menuinfo_t +typedef struct _cef_menu_info_t { /// // Values from the cef_handler_menutypebits_t enumeration. @@ -679,13 +679,13 @@ typedef struct _cef_handler_menuinfo_t int editFlags; cef_string_t securityInfo; -} cef_handler_menuinfo_t; +} cef_menu_info_t; /// -// The cef_handler_menuinfo_t typeFlags value will be a combination of the +// The cef_menu_info_t typeFlags value will be a combination of the // following values. /// -enum cef_handler_menutypebits_t +enum cef_menu_typebits_t { /// // No node is selected @@ -730,10 +730,10 @@ enum cef_handler_menutypebits_t }; /// -// The cef_handler_menuinfo_t editFlags value will be a combination of the +// The cef_menu_info_t editFlags value will be a combination of the // following values. /// -enum cef_handler_menucapabilitybits_t +enum cef_menu_capabilitybits_t { // Values from WebContextMenuData::EditFlags in WebContextMenuData.h MENU_CAN_DO_NONE = 0x0, @@ -753,7 +753,7 @@ enum cef_handler_menucapabilitybits_t /// // Supported menu ID values. /// -enum cef_handler_menuid_t +enum cef_menu_id_t { MENU_ID_NAV_BACK = 10, MENU_ID_NAV_FORWARD = 11, diff --git a/include/internal/cef_types_wrappers.h b/include/internal/cef_types_wrappers.h index c900fb496..56f5a6b95 100644 --- a/include/internal/cef_types_wrappers.h +++ b/include/internal/cef_types_wrappers.h @@ -190,6 +190,25 @@ inline bool operator!=(const CefRect& a, const CefRect& b) } +struct CefPrintOptionsTraits { + typedef cef_print_options_t struct_type; + + static inline void init(struct_type* s) {} + static inline void clear(struct_type* s) {} + + static inline void set(const struct_type* src, struct_type* target, bool copy) + { + *target = *src; + } +}; + +/// +// Class representing print options. +/// +typedef CefStructBase CefPrintOptions; + + + struct CefPopupFeaturesTraits { typedef cef_popup_features_t struct_type; @@ -528,6 +547,53 @@ struct CefCookieTraits { typedef CefStructBase CefCookie; +struct CefMenuInfoTraits { + typedef cef_menu_info_t struct_type; + + static inline void init(struct_type* s) {} + + static inline void clear(struct_type* s) + { + cef_string_clear(&s->linkUrl); + cef_string_clear(&s->imageUrl); + cef_string_clear(&s->pageUrl); + cef_string_clear(&s->frameUrl); + cef_string_clear(&s->selectionText); + cef_string_clear(&s->misspelledWord); + cef_string_clear(&s->securityInfo); + } + + static inline void set(const struct_type* src, struct_type* target, bool copy) + { + target->typeFlags = src->typeFlags; + target->x = src->x; + target->y = src->y; + + cef_string_set(src->linkUrl.str, src->linkUrl.length, + &target->linkUrl, copy); + cef_string_set(src->imageUrl.str, src->imageUrl.length, + &target->imageUrl, copy); + cef_string_set(src->pageUrl.str, src->pageUrl.length, + &target->pageUrl, copy); + cef_string_set(src->frameUrl.str, src->frameUrl.length, + &target->frameUrl, copy); + cef_string_set(src->selectionText.str, src->selectionText.length, + &target->selectionText, copy); + cef_string_set(src->misspelledWord.str, src->misspelledWord.length, + &target->misspelledWord, copy); + cef_string_set(src->securityInfo.str, src->securityInfo.length, + &target->securityInfo, copy); + + target->editFlags = src->editFlags; + } +}; + +/// +// Class representing menu info. +/// +typedef CefStructBase CefMenuInfo; + + struct CefProxyInfoTraits { typedef cef_proxy_info_t struct_type; diff --git a/libcef/browser_impl.cc b/libcef/browser_impl.cc index 34708948a..64c0bf81a 100644 --- a/libcef/browser_impl.cc +++ b/libcef/browser_impl.cc @@ -1199,12 +1199,12 @@ void CefBrowserImpl::UIT_Show(WebKit::WebNavigationPolicy policy) delegate_->show(policy); } -void CefBrowserImpl::UIT_HandleActionView(cef_handler_menuid_t menuId) +void CefBrowserImpl::UIT_HandleActionView(cef_menu_id_t menuId) { return UIT_HandleAction(menuId, NULL); } -void CefBrowserImpl::UIT_HandleAction(cef_handler_menuid_t menuId, +void CefBrowserImpl::UIT_HandleAction(cef_menu_id_t menuId, CefRefPtr frame) { REQUIRE_UIT(); diff --git a/libcef/browser_impl.h b/libcef/browser_impl.h index 74b925827..e5a1baad6 100644 --- a/libcef/browser_impl.h +++ b/libcef/browser_impl.h @@ -275,8 +275,8 @@ public: void UIT_Show(WebKit::WebNavigationPolicy policy); // Handles most simple browser actions - void UIT_HandleActionView(cef_handler_menuid_t menuId); - void UIT_HandleAction(cef_handler_menuid_t menuId, CefRefPtr frame); + void UIT_HandleActionView(cef_menu_id_t menuId); + void UIT_HandleAction(cef_menu_id_t menuId, CefRefPtr frame); // Save the document HTML to a temporary file and open in the default viewing // application diff --git a/libcef/browser_impl_win.cc b/libcef/browser_impl_win.cc index 32af717f7..51415676c 100644 --- a/libcef/browser_impl_win.cc +++ b/libcef/browser_impl_win.cc @@ -496,8 +496,7 @@ void CefBrowserImpl::UIT_PrintPages(WebKit::WebFrame* frame) { { // Make a copy of settings. printing::PrintSettings settings = print_context_.settings(); - cef_print_options_t print_options; - memset(&print_options, 0, sizeof(print_options)); + CefPrintOptions print_options; settings.UpdatePrintOptions(print_options); CefRefPtr handler; diff --git a/libcef/browser_webview_delegate.cc b/libcef/browser_webview_delegate.cc index 32fc98591..220f405a5 100644 --- a/libcef/browser_webview_delegate.cc +++ b/libcef/browser_webview_delegate.cc @@ -1243,8 +1243,7 @@ bool BrowserWebViewDelegate::OnBeforeMenu( if (handler.get()) { // Gather menu information. - cef_handler_menuinfo_t menuInfo; - memset(&menuInfo, 0, sizeof(menuInfo)); + CefMenuInfo menuInfo; CefString linkStr(std::string(data.linkURL.spec())); CefString imageStr(std::string(data.srcURL.spec())); diff --git a/libcef/browser_webview_delegate_gtk.cc b/libcef/browser_webview_delegate_gtk.cc index ce33583c7..ed7d59ced 100644 --- a/libcef/browser_webview_delegate_gtk.cc +++ b/libcef/browser_webview_delegate_gtk.cc @@ -345,8 +345,7 @@ void BrowserWebViewDelegate::HandleContextMenu(int selected_id) handler = client->GetMenuHandler(); // An action was chosen - cef_handler_menuid_t menuId = - static_cast(selected_id); + cef_menu_id_t menuId = static_cast(selected_id); bool handled = false; if (handler.get()) { // Ask the handler if it wants to handle the action diff --git a/libcef/browser_webview_delegate_mac.mm b/libcef/browser_webview_delegate_mac.mm index afca4ac69..04476246a 100644 --- a/libcef/browser_webview_delegate_mac.mm +++ b/libcef/browser_webview_delegate_mac.mm @@ -48,7 +48,7 @@ namespace { void AddMenuItem(CefRefPtr browser, CefRefPtr handler, NSMenu* menu, - cef_handler_menuid_t menuId, + cef_menu_id_t menuId, const std::string& label, bool enabled) { std::string disp_str; diff --git a/libcef/browser_webview_delegate_win.cc b/libcef/browser_webview_delegate_win.cc index 2e940aaf8..f5debfca1 100644 --- a/libcef/browser_webview_delegate_win.cc +++ b/libcef/browser_webview_delegate_win.cc @@ -63,7 +63,7 @@ static const wchar_t kPluginWindowClassName[] = L"WebPluginHost"; void AddMenuItem(CefRefPtr browser, CefRefPtr handler, HMENU menu, - cef_handler_menuid_t menuId, + cef_menu_id_t menuId, const wchar_t* label, bool enabled, std::list& label_list) @@ -504,8 +504,7 @@ void BrowserWebViewDelegate::showContextMenu( if (selected_id != 0) { // An action was chosen - cef_handler_menuid_t menuId = - static_cast(selected_id); + cef_menu_id_t menuId = static_cast(selected_id); bool handled = false; if (handler.get()) { // Ask the handler if it wants to handle the action diff --git a/libcef/browser_webview_mac.mm b/libcef/browser_webview_mac.mm index d406592c0..2a88c4207 100644 --- a/libcef/browser_webview_mac.mm +++ b/libcef/browser_webview_mac.mm @@ -232,8 +232,7 @@ } - (void)menuItemSelected:(id)sender { - cef_handler_menuid_t menuId = - static_cast([sender tag]); + cef_menu_id_t menuId = static_cast([sender tag]); bool handled = false; CefRefPtr client = browser_->GetClient(); diff --git a/libcef/printing/print_settings.cc b/libcef/printing/print_settings.cc index eddd64151..4802eaaba 100644 --- a/libcef/printing/print_settings.cc +++ b/libcef/printing/print_settings.cc @@ -238,7 +238,8 @@ void PrintSettings::UpdatePrintOptions(cef_print_options_t& print_options) { print_options.paper_margins.footer = ConvertUnitDouble( requested_margins.footer, desired_dpi, 1); } -void PrintSettings::UpdateFromPrintOptions(const cef_print_options_t& print_options) { +void PrintSettings::UpdateFromPrintOptions( + const cef_print_options_t& print_options) { landscape = print_options.page_orientation == LANDSCAPE; page_measurements.page_type = print_options.paper_metrics.paper_type; if (page_measurements.page_type == PT_CUSTOM) { diff --git a/libcef/v8_impl.cc b/libcef/v8_impl.cc index 0a767f110..10bfebcb5 100644 --- a/libcef/v8_impl.cc +++ b/libcef/v8_impl.cc @@ -851,7 +851,7 @@ bool CefV8ValueImpl::HasValue(const CefString& key) return obj->Has(GetV8String(key)); } -bool CefV8ValueImpl::HasValue(int index) +bool CefV8ValueImpl::HasValue(size_t index) { CEF_REQUIRE_UI_THREAD(false); if(!GetHandle()->IsObject()) { @@ -859,11 +859,6 @@ bool CefV8ValueImpl::HasValue(int index) return false; } - if (index < 0) { - NOTREACHED() << "invalid input parameter"; - return false; - } - v8::HandleScope handle_scope; v8::Local obj = GetHandle()->ToObject(); return obj->Has(index); @@ -887,7 +882,7 @@ bool CefV8ValueImpl::DeleteValue(const CefString& key) return obj->Delete(GetV8String(key)); } -bool CefV8ValueImpl::DeleteValue(int index) +bool CefV8ValueImpl::DeleteValue(size_t index) { CEF_REQUIRE_UI_THREAD(false); if(!GetHandle()->IsObject()) { @@ -895,11 +890,6 @@ bool CefV8ValueImpl::DeleteValue(int index) return false; } - if (index < 0) { - NOTREACHED() << "invalid input parameter"; - return false; - } - v8::HandleScope handle_scope; v8::Local obj = GetHandle()->ToObject(); return obj->Delete(index); @@ -923,7 +913,7 @@ CefRefPtr CefV8ValueImpl::GetValue(const CefString& key) return new CefV8ValueImpl(obj->Get(GetV8String(key))); } -CefRefPtr CefV8ValueImpl::GetValue(int index) +CefRefPtr CefV8ValueImpl::GetValue(size_t index) { CEF_REQUIRE_UI_THREAD(NULL); if(!GetHandle()->IsObject()) { @@ -931,11 +921,6 @@ CefRefPtr CefV8ValueImpl::GetValue(int index) return NULL; } - if (index < 0) { - NOTREACHED() << "invalid input parameter"; - return NULL; - } - v8::HandleScope handle_scope; v8::Local obj = GetHandle()->ToObject(); return new CefV8ValueImpl(obj->Get(v8::Number::New(index))); @@ -963,7 +948,7 @@ bool CefV8ValueImpl::SetValue(const CefString& key, } } -bool CefV8ValueImpl::SetValue(int index, CefRefPtr value) +bool CefV8ValueImpl::SetValue(size_t index, CefRefPtr value) { CEF_REQUIRE_UI_THREAD(false); @@ -972,11 +957,6 @@ bool CefV8ValueImpl::SetValue(int index, CefRefPtr value) return false; } - if (index < 0) { - NOTREACHED() << "invalid input parameter"; - return false; - } - CefV8ValueImpl *impl = static_cast(value.get()); if(impl) { v8::HandleScope handle_scope; diff --git a/libcef/v8_impl.h b/libcef/v8_impl.h index 4eec22753..2d56f2b65 100644 --- a/libcef/v8_impl.h +++ b/libcef/v8_impl.h @@ -127,14 +127,14 @@ public: virtual CefTime GetDateValue() OVERRIDE; virtual CefString GetStringValue() OVERRIDE; virtual bool HasValue(const CefString& key) OVERRIDE; - virtual bool HasValue(int index) OVERRIDE; + virtual bool HasValue(size_t index) OVERRIDE; virtual bool DeleteValue(const CefString& key) OVERRIDE; - virtual bool DeleteValue(int index) OVERRIDE; + virtual bool DeleteValue(size_t index) OVERRIDE; virtual CefRefPtr GetValue(const CefString& key) OVERRIDE; - virtual CefRefPtr GetValue(int index) OVERRIDE; + virtual CefRefPtr GetValue(size_t index) OVERRIDE; virtual bool SetValue(const CefString& key, CefRefPtr value, PropertyAttribute attribute) OVERRIDE; - virtual bool SetValue(int index, CefRefPtr value) OVERRIDE; + virtual bool SetValue(size_t index, CefRefPtr value) OVERRIDE; virtual bool SetValue(const CefString& key, AccessControl settings, PropertyAttribute attribute) OVERRIDE; virtual bool GetKeys(std::vector& keys) OVERRIDE; diff --git a/libcef/xml_reader_impl.cc b/libcef/xml_reader_impl.cc index 0215b58d8..2921e581e 100644 --- a/libcef/xml_reader_impl.cc +++ b/libcef/xml_reader_impl.cc @@ -355,7 +355,7 @@ size_t CefXmlReaderImpl::GetAttributeCount() return xmlTextReaderAttributeCount(reader_); } -CefString CefXmlReaderImpl::GetAttribute(int index) +CefString CefXmlReaderImpl::GetAttribute(size_t index) { if (!VerifyContext()) return CefString(); @@ -409,7 +409,7 @@ int CefXmlReaderImpl::GetLineNumber() return xmlTextReaderGetParserLineNumber(reader_); } -bool CefXmlReaderImpl::MoveToAttribute(int index) +bool CefXmlReaderImpl::MoveToAttribute(size_t index) { if (!VerifyContext()) return false; diff --git a/libcef/xml_reader_impl.h b/libcef/xml_reader_impl.h index 766c71c61..9d8ceb461 100644 --- a/libcef/xml_reader_impl.h +++ b/libcef/xml_reader_impl.h @@ -21,37 +21,37 @@ public: bool Initialize(CefRefPtr stream, EncodingType encodingType, const CefString& URI); - virtual bool MoveToNextNode(); - virtual bool Close(); - virtual bool HasError(); - virtual CefString GetError(); - virtual NodeType GetType(); - virtual int GetDepth(); - virtual CefString GetLocalName(); - virtual CefString GetPrefix(); - virtual CefString GetQualifiedName(); - virtual CefString GetNamespaceURI(); - virtual CefString GetBaseURI(); - virtual CefString GetXmlLang(); - virtual bool IsEmptyElement(); - virtual bool HasValue(); - virtual CefString GetValue(); - virtual bool HasAttributes(); - virtual size_t GetAttributeCount(); - virtual CefString GetAttribute(int index); - virtual CefString GetAttribute(const CefString& qualifiedName); + virtual bool MoveToNextNode() OVERRIDE; + virtual bool Close() OVERRIDE; + virtual bool HasError() OVERRIDE; + virtual CefString GetError() OVERRIDE; + virtual NodeType GetType() OVERRIDE; + virtual int GetDepth() OVERRIDE; + virtual CefString GetLocalName() OVERRIDE; + virtual CefString GetPrefix() OVERRIDE; + virtual CefString GetQualifiedName() OVERRIDE; + virtual CefString GetNamespaceURI() OVERRIDE; + virtual CefString GetBaseURI() OVERRIDE; + virtual CefString GetXmlLang() OVERRIDE; + virtual bool IsEmptyElement() OVERRIDE; + virtual bool HasValue() OVERRIDE; + virtual CefString GetValue() OVERRIDE; + virtual bool HasAttributes() OVERRIDE; + virtual size_t GetAttributeCount() OVERRIDE; + virtual CefString GetAttribute(size_t index) OVERRIDE; + virtual CefString GetAttribute(const CefString& qualifiedName) OVERRIDE; virtual CefString GetAttribute(const CefString& localName, - const CefString& namespaceURI); - virtual CefString GetInnerXml(); - virtual CefString GetOuterXml(); - virtual int GetLineNumber(); - virtual bool MoveToAttribute(int index); - virtual bool MoveToAttribute(const CefString& qualifiedName); + const CefString& namespaceURI) OVERRIDE; + virtual CefString GetInnerXml() OVERRIDE; + virtual CefString GetOuterXml() OVERRIDE; + virtual int GetLineNumber() OVERRIDE; + virtual bool MoveToAttribute(size_t index) OVERRIDE; + virtual bool MoveToAttribute(const CefString& qualifiedName) OVERRIDE; virtual bool MoveToAttribute(const CefString& localName, - const CefString& namespaceURI); - virtual bool MoveToFirstAttribute(); - virtual bool MoveToNextAttribute(); - virtual bool MoveToCarryingElement(); + const CefString& namespaceURI) OVERRIDE; + virtual bool MoveToFirstAttribute() OVERRIDE; + virtual bool MoveToNextAttribute() OVERRIDE; + virtual bool MoveToCarryingElement() OVERRIDE; // Add another line to the error string. void AppendError(const CefString& error_str); diff --git a/libcef_dll/cpptoc/app_cpptoc.cc b/libcef_dll/cpptoc/app_cpptoc.cc index 54c24d268..d9ba6e693 100644 --- a/libcef_dll/cpptoc/app_cpptoc.cc +++ b/libcef_dll/cpptoc/app_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -18,19 +18,22 @@ cef_proxy_handler_t* CEF_CALLBACK app_get_proxy_handler(struct _cef_app_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return NULL; - CefRefPtr handlerPtr = - CefAppCppToC::Get(self)->GetProxyHandler(); - if(handlerPtr.get()) - return CefProxyHandlerCppToC::Wrap(handlerPtr); + // Execute + CefRefPtr _retval = CefAppCppToC::Get(self)->GetProxyHandler( + ); - return NULL; + // Return type: refptr_same + return CefProxyHandlerCppToC::Wrap(_retval); } + // CONSTRUCTOR - Do not edit by hand. CefAppCppToC::CefAppCppToC(CefApp* cls) diff --git a/libcef_dll/cpptoc/app_cpptoc.h b/libcef_dll/cpptoc/app_cpptoc.h index 720365259..3d24fb955 100644 --- a/libcef_dll/cpptoc/app_cpptoc.h +++ b/libcef_dll/cpptoc/app_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _APP_CPPTOC_H #define _APP_CPPTOC_H diff --git a/libcef_dll/cpptoc/base_cpptoc.h b/libcef_dll/cpptoc/base_cpptoc.h index 9b14519af..2206eeeaa 100644 --- a/libcef_dll/cpptoc/base_cpptoc.h +++ b/libcef_dll/cpptoc/base_cpptoc.h @@ -20,6 +20,8 @@ public: // is done in this case. static CefRefPtr Get(cef_base_t* s) { + DCHECK(s); + // Cast our structure to the wrapper structure type. CefBaseCppToC::Struct* wrapperStruct = reinterpret_cast(s); @@ -31,6 +33,9 @@ public: // instance to the other side. static cef_base_t* Wrap(CefRefPtr c) { + if (!c.get()) + return NULL; + // Wrap our object with the CefCppToC class. CefBaseCppToC* wrapper = new CefBaseCppToC(c); // Add a reference to our wrapper object that will be released once our @@ -44,6 +49,9 @@ public: // our wrapper structure back from the other side. static CefRefPtr Unwrap(cef_base_t* s) { + if (!s) + return NULL; + // Cast our structure to the wrapper structure type. CefBaseCppToC::Struct* wrapperStruct = reinterpret_cast(s); diff --git a/libcef_dll/cpptoc/browser_cpptoc.cc b/libcef_dll/cpptoc/browser_cpptoc.cc index ef19a3c77..ab3b748db 100644 --- a/libcef_dll/cpptoc/browser_cpptoc.cc +++ b/libcef_dll/cpptoc/browser_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -22,455 +22,760 @@ CEF_EXPORT int cef_browser_create(cef_window_info_t* windowInfo, struct _cef_client_t* client, const cef_string_t* url, const struct _cef_browser_settings_t* settings) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: windowInfo; type: struct_byref DCHECK(windowInfo); if (!windowInfo) return 0; + // Verify param: client; type: refptr_diff + DCHECK(client); + if (!client) + return 0; + // Verify param: settings; type: struct_byref_const + DCHECK(settings); + if (!settings) + return 0; + // Unverified params: url - CefRefPtr clientPtr; + // Translate param: windowInfo; type: struct_byref CefWindowInfo windowInfoObj; - CefBrowserSettings browserSettingsObj; - - windowInfoObj.Set(*windowInfo, false); - if(client) - clientPtr = CefClientCToCpp::Wrap(client); + if (windowInfo) + windowInfoObj.AttachTo(*windowInfo); + // Translate param: settings; type: struct_byref_const + CefBrowserSettings settingsObj; if (settings) - browserSettingsObj.Set(*settings, false); - - return CefBrowser::CreateBrowser(windowInfoObj, clientPtr, CefString(url), - browserSettingsObj); + settingsObj.Set(*settings, false); + + // Execute + bool _retval = CefBrowser::CreateBrowser( + windowInfoObj, + CefClientCToCpp::Wrap(client), + CefString(url), + settingsObj); + + // Restore param: windowInfo; type: struct_byref + if (windowInfo) + windowInfoObj.DetachTo(*windowInfo); + + // Return type: bool + return _retval; } + CEF_EXPORT cef_browser_t* cef_browser_create_sync(cef_window_info_t* windowInfo, struct _cef_client_t* client, const cef_string_t* url, const struct _cef_browser_settings_t* settings) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: windowInfo; type: struct_byref DCHECK(windowInfo); if (!windowInfo) return NULL; + // Verify param: client; type: refptr_diff + DCHECK(client); + if (!client) + return NULL; + // Verify param: settings; type: struct_byref_const + DCHECK(settings); + if (!settings) + return NULL; + // Unverified params: url - CefRefPtr clientPtr; + // Translate param: windowInfo; type: struct_byref CefWindowInfo windowInfoObj; - CefBrowserSettings browserSettingsObj; - - windowInfoObj.Set(*windowInfo, false); - if(client) - clientPtr = CefClientCToCpp::Wrap(client); + if (windowInfo) + windowInfoObj.AttachTo(*windowInfo); + // Translate param: settings; type: struct_byref_const + CefBrowserSettings settingsObj; if (settings) - browserSettingsObj.Set(*settings, false); - - CefRefPtr browserPtr( - CefBrowser::CreateBrowserSync(windowInfoObj, clientPtr, CefString(url), - browserSettingsObj)); - if(browserPtr.get()) - return CefBrowserCppToC::Wrap(browserPtr); - return NULL; + settingsObj.Set(*settings, false); + + // Execute + CefRefPtr _retval = CefBrowser::CreateBrowserSync( + windowInfoObj, + CefClientCToCpp::Wrap(client), + CefString(url), + settingsObj); + + // Restore param: windowInfo; type: struct_byref + if (windowInfo) + windowInfoObj.DetachTo(*windowInfo); + + // Return type: refptr_same + return CefBrowserCppToC::Wrap(_retval); } + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK browser_parent_window_will_close(struct _cef_browser_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return; + // Execute CefBrowserCppToC::Get(self)->ParentWindowWillClose(); } + void CEF_CALLBACK browser_close_browser(struct _cef_browser_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; + // Execute CefBrowserCppToC::Get(self)->CloseBrowser(); } + int CEF_CALLBACK browser_can_go_back(struct _cef_browser_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefBrowserCppToC::Get(self)->CanGoBack(); + // Execute + bool _retval = CefBrowserCppToC::Get(self)->CanGoBack(); + + // Return type: bool + return _retval; } + void CEF_CALLBACK browser_go_back(struct _cef_browser_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; + // Execute CefBrowserCppToC::Get(self)->GoBack(); } + int CEF_CALLBACK browser_can_go_forward(struct _cef_browser_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefBrowserCppToC::Get(self)->CanGoForward(); + // Execute + bool _retval = CefBrowserCppToC::Get(self)->CanGoForward(); + + // Return type: bool + return _retval; } + void CEF_CALLBACK browser_go_forward(struct _cef_browser_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; + // Execute CefBrowserCppToC::Get(self)->GoForward(); } + void CEF_CALLBACK browser_reload(struct _cef_browser_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; + // Execute CefBrowserCppToC::Get(self)->Reload(); } + void CEF_CALLBACK browser_reload_ignore_cache(struct _cef_browser_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; + // Execute CefBrowserCppToC::Get(self)->ReloadIgnoreCache(); } + void CEF_CALLBACK browser_stop_load(struct _cef_browser_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; + // Execute CefBrowserCppToC::Get(self)->StopLoad(); } + void CEF_CALLBACK browser_set_focus(struct _cef_browser_t* self, int enable) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; - CefBrowserCppToC::Get(self)->SetFocus(enable ? true : false); + // Execute + CefBrowserCppToC::Get(self)->SetFocus( + enable?true:false); } + cef_window_handle_t CEF_CALLBACK browser_get_window_handle( struct _cef_browser_t* self) { - DCHECK(self); - if(!self) - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return CefBrowserCppToC::Get(self)->GetWindowHandle(); -} - -cef_window_handle_t CEF_CALLBACK browser_get_opener_window_handle( - struct _cef_browser_t* self) -{ - DCHECK(self); - if(!self) - return NULL; - - return CefBrowserCppToC::Get(self)->GetOpenerWindowHandle(); -} - -int CEF_CALLBACK browser_is_popup(struct _cef_browser_t* self) -{ - DCHECK(self); - if(!self) - return 0; - - return CefBrowserCppToC::Get(self)->IsPopup(); -} - -int CEF_CALLBACK browser_has_document(struct _cef_browser_t* self) -{ - DCHECK(self); - if(!self) - return 0; - - return CefBrowserCppToC::Get(self)->HasDocument(); -} - -struct _cef_client_t* CEF_CALLBACK browser_get_client( - struct _cef_browser_t* self) -{ DCHECK(self); if (!self) return NULL; - CefRefPtr clientPtr = CefBrowserCppToC::Get(self)->GetClient(); - if(clientPtr.get()) - return CefClientCToCpp::Unwrap(clientPtr); + // Execute + cef_window_handle_t _retval = CefBrowserCppToC::Get(self)->GetWindowHandle(); - return NULL; + // Return type: simple + return _retval; } + +cef_window_handle_t CEF_CALLBACK browser_get_opener_window_handle( + struct _cef_browser_t* self) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + + // Execute + cef_window_handle_t _retval = CefBrowserCppToC::Get( + self)->GetOpenerWindowHandle(); + + // Return type: simple + return _retval; +} + + +int CEF_CALLBACK browser_is_popup(struct _cef_browser_t* self) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + bool _retval = CefBrowserCppToC::Get(self)->IsPopup(); + + // Return type: bool + return _retval; +} + + +int CEF_CALLBACK browser_has_document(struct _cef_browser_t* self) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + bool _retval = CefBrowserCppToC::Get(self)->HasDocument(); + + // Return type: bool + return _retval; +} + + +struct _cef_client_t* CEF_CALLBACK browser_get_client( + struct _cef_browser_t* self) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + + // Execute + CefRefPtr _retval = CefBrowserCppToC::Get(self)->GetClient(); + + // Return type: refptr_diff + return CefClientCToCpp::Unwrap(_retval); +} + + struct _cef_frame_t* CEF_CALLBACK browser_get_main_frame( struct _cef_browser_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefRefPtr browserPtr = CefBrowserCppToC::Get(self); - CefRefPtr framePtr = browserPtr->GetMainFrame(); - if(framePtr.get()) - return CefFrameCppToC::Wrap(framePtr); - return NULL; + // Execute + CefRefPtr _retval = CefBrowserCppToC::Get(self)->GetMainFrame(); + + // Return type: refptr_same + return CefFrameCppToC::Wrap(_retval); } + struct _cef_frame_t* CEF_CALLBACK browser_get_focused_frame( struct _cef_browser_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefRefPtr browserPtr = CefBrowserCppToC::Get(self); - CefRefPtr framePtr = browserPtr->GetFocusedFrame(); - if(framePtr.get()) - return CefFrameCppToC::Wrap(framePtr); - return NULL; + // Execute + CefRefPtr _retval = CefBrowserCppToC::Get(self)->GetFocusedFrame(); + + // Return type: refptr_same + return CefFrameCppToC::Wrap(_retval); } + struct _cef_frame_t* CEF_CALLBACK browser_get_frame(struct _cef_browser_t* self, const cef_string_t* name) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) + return NULL; + // Verify param: name; type: string_byref_const + DCHECK(name); + if (!name) return NULL; - CefRefPtr browserPtr = CefBrowserCppToC::Get(self); - CefRefPtr framePtr = browserPtr->GetFrame(CefString(name)); - if(framePtr.get()) - return CefFrameCppToC::Wrap(framePtr); - return NULL; + // Execute + CefRefPtr _retval = CefBrowserCppToC::Get(self)->GetFrame( + CefString(name)); + + // Return type: refptr_same + return CefFrameCppToC::Wrap(_retval); } + void CEF_CALLBACK browser_get_frame_names(struct _cef_browser_t* self, cef_string_list_t names) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: names; type: string_vec_byref DCHECK(names); - if(!self || !names) + if (!names) return; - CefRefPtr browserPtr = CefBrowserCppToC::Get(self); - std::vector stringList; - browserPtr->GetFrameNames(stringList); - transfer_string_list_contents(stringList, names); + // Translate param: names; type: string_vec_byref + std::vector namesList; + transfer_string_list_contents(names, namesList); + + // Execute + CefBrowserCppToC::Get(self)->GetFrameNames( + namesList); + + // Restore param: names; type: string_vec_byref + cef_string_list_clear(names); + transfer_string_list_contents(namesList, names); } + void CEF_CALLBACK browser_find(struct _cef_browser_t* self, int identifier, const cef_string_t* searchText, int forward, int matchCase, int findNext) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) + return; + // Verify param: searchText; type: string_byref_const + DCHECK(searchText); + if (!searchText) return; - CefBrowserCppToC::Get(self)->Find(identifier, CefString(searchText), - forward?true:false, matchCase?true:false, findNext?true:false); + // Execute + CefBrowserCppToC::Get(self)->Find( + identifier, + CefString(searchText), + forward?true:false, + matchCase?true:false, + findNext?true:false); } + void CEF_CALLBACK browser_stop_finding(struct _cef_browser_t* self, int clearSelection) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; - CefBrowserCppToC::Get(self)->StopFinding(clearSelection?true:false); + // Execute + CefBrowserCppToC::Get(self)->StopFinding( + clearSelection?true:false); } + double CEF_CALLBACK browser_get_zoom_level(struct _cef_browser_t* self) { - DCHECK(self); - if(!self) - return 0.0; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return CefBrowserCppToC::Get(self)->GetZoomLevel(); + DCHECK(self); + if (!self) + return 0; + + // Execute + double _retval = CefBrowserCppToC::Get(self)->GetZoomLevel(); + + // Return type: simple + return _retval; } + void CEF_CALLBACK browser_set_zoom_level(struct _cef_browser_t* self, double zoomLevel) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; - return CefBrowserCppToC::Get(self)->SetZoomLevel(zoomLevel); + // Execute + CefBrowserCppToC::Get(self)->SetZoomLevel( + zoomLevel); } + void CEF_CALLBACK browser_clear_history(struct _cef_browser_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; + // Execute CefBrowserCppToC::Get(self)->ClearHistory(); } + void CEF_CALLBACK browser_show_dev_tools(struct _cef_browser_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; + // Execute CefBrowserCppToC::Get(self)->ShowDevTools(); } + void CEF_CALLBACK browser_close_dev_tools(struct _cef_browser_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; + // Execute CefBrowserCppToC::Get(self)->CloseDevTools(); } + int CEF_CALLBACK browser_is_window_rendering_disabled( struct _cef_browser_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefBrowserCppToC::Get(self)->IsWindowRenderingDisabled(); + // Execute + bool _retval = CefBrowserCppToC::Get(self)->IsWindowRenderingDisabled(); + + // Return type: bool + return _retval; } + int CEF_CALLBACK browser_get_size(struct _cef_browser_t* self, enum cef_paint_element_type_t type, int* width, int* height) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: width; type: simple_byref DCHECK(width); + if (!width) + return 0; + // Verify param: height; type: simple_byref DCHECK(height); - if(!self || !width || !height) + if (!height) return 0; - return CefBrowserCppToC::Get(self)->GetSize(type, *width, *height); + // Translate param: width; type: simple_byref + int widthVal = width?*width:0; + // Translate param: height; type: simple_byref + int heightVal = height?*height:0; + + // Execute + bool _retval = CefBrowserCppToC::Get(self)->GetSize( + type, + widthVal, + heightVal); + + // Restore param: width; type: simple_byref + if (width) + *width = widthVal; + // Restore param: height; type: simple_byref + if (height) + *height = heightVal; + + // Return type: bool + return _retval; } + void CEF_CALLBACK browser_set_size(struct _cef_browser_t* self, enum cef_paint_element_type_t type, int width, int height) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; - return CefBrowserCppToC::Get(self)->SetSize(type, width, height); + // Execute + CefBrowserCppToC::Get(self)->SetSize( + type, + width, + height); } + int CEF_CALLBACK browser_is_popup_visible(struct _cef_browser_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefBrowserCppToC::Get(self)->IsPopupVisible(); + // Execute + bool _retval = CefBrowserCppToC::Get(self)->IsPopupVisible(); + + // Return type: bool + return _retval; } + void CEF_CALLBACK browser_hide_popup(struct _cef_browser_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; + // Execute CefBrowserCppToC::Get(self)->HidePopup(); } + void CEF_CALLBACK browser_invalidate(struct _cef_browser_t* self, const cef_rect_t* dirtyRect) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: dirtyRect; type: simple_byref_const DCHECK(dirtyRect); - if(!self || !dirtyRect) + if (!dirtyRect) return; - CefRect rect(*dirtyRect); - CefBrowserCppToC::Get(self)->Invalidate(rect); + // Translate param: dirtyRect; type: simple_byref_const + CefRect dirtyRectVal = dirtyRect?*dirtyRect:CefRect(); + + // Execute + CefBrowserCppToC::Get(self)->Invalidate( + dirtyRectVal); } + int CEF_CALLBACK browser_get_image(struct _cef_browser_t* self, enum cef_paint_element_type_t type, int width, int height, void* buffer) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: buffer; type: simple_byaddr DCHECK(buffer); - if(!self || !buffer) + if (!buffer) return 0; - return CefBrowserCppToC::Get(self)->GetImage(type, width, height, buffer); + // Execute + bool _retval = CefBrowserCppToC::Get(self)->GetImage( + type, + width, + height, + buffer); + + // Return type: bool + return _retval; } + void CEF_CALLBACK browser_send_key_event(struct _cef_browser_t* self, enum cef_key_type_t type, int key, int modifiers, int sysChar, int imeChar) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; - CefBrowserCppToC::Get(self)->SendKeyEvent(type, key, modifiers, - sysChar?true:false, imeChar?true:false); + // Execute + CefBrowserCppToC::Get(self)->SendKeyEvent( + type, + key, + modifiers, + sysChar?true:false, + imeChar?true:false); } + void CEF_CALLBACK browser_send_mouse_click_event(struct _cef_browser_t* self, int x, int y, enum cef_mouse_button_type_t type, int mouseUp, int clickCount) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; - CefBrowserCppToC::Get(self)->SendMouseClickEvent(x, y, type, - mouseUp?true:false, clickCount); + // Execute + CefBrowserCppToC::Get(self)->SendMouseClickEvent( + x, + y, + type, + mouseUp?true:false, + clickCount); } + void CEF_CALLBACK browser_send_mouse_move_event(struct _cef_browser_t* self, int x, int y, int mouseLeave) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; - CefBrowserCppToC::Get(self)->SendMouseMoveEvent(x, y, mouseLeave?true:false); + // Execute + CefBrowserCppToC::Get(self)->SendMouseMoveEvent( + x, + y, + mouseLeave?true:false); } + void CEF_CALLBACK browser_send_mouse_wheel_event(struct _cef_browser_t* self, int x, int y, int delta) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; - CefBrowserCppToC::Get(self)->SendMouseWheelEvent(x, y, delta); + // Execute + CefBrowserCppToC::Get(self)->SendMouseWheelEvent( + x, + y, + delta); } + void CEF_CALLBACK browser_send_focus_event(struct _cef_browser_t* self, int setFocus) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; - CefBrowserCppToC::Get(self)->SendFocusEvent(setFocus?true:false); + // Execute + CefBrowserCppToC::Get(self)->SendFocusEvent( + setFocus?true:false); } + void CEF_CALLBACK browser_send_capture_lost_event(struct _cef_browser_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; + // Execute CefBrowserCppToC::Get(self)->SendCaptureLostEvent(); } + // CONSTRUCTOR - Do not edit by hand. CefBrowserCppToC::CefBrowserCppToC(CefBrowser* cls) diff --git a/libcef_dll/cpptoc/browser_cpptoc.h b/libcef_dll/cpptoc/browser_cpptoc.h index 474deee19..2c226d16a 100644 --- a/libcef_dll/cpptoc/browser_cpptoc.h +++ b/libcef_dll/cpptoc/browser_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _BROWSER_CPPTOC_H #define _BROWSER_CPPTOC_H diff --git a/libcef_dll/cpptoc/client_cpptoc.cc b/libcef_dll/cpptoc/client_cpptoc.cc index 0688f9544..e1f217a44 100644 --- a/libcef_dll/cpptoc/client_cpptoc.cc +++ b/libcef_dll/cpptoc/client_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -31,199 +31,238 @@ cef_life_span_handler_t* CEF_CALLBACK client_get_life_span_handler( struct _cef_client_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return NULL; - CefRefPtr handlerPtr = - CefClientCppToC::Get(self)->GetLifeSpanHandler(); - if(handlerPtr.get()) - return CefLifeSpanHandlerCppToC::Wrap(handlerPtr); + // Execute + CefRefPtr _retval = CefClientCppToC::Get( + self)->GetLifeSpanHandler(); - return NULL; + // Return type: refptr_same + return CefLifeSpanHandlerCppToC::Wrap(_retval); } + cef_load_handler_t* CEF_CALLBACK client_get_load_handler( struct _cef_client_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return NULL; - CefRefPtr handlerPtr = - CefClientCppToC::Get(self)->GetLoadHandler(); - if(handlerPtr.get()) - return CefLoadHandlerCppToC::Wrap(handlerPtr); + // Execute + CefRefPtr _retval = CefClientCppToC::Get( + self)->GetLoadHandler(); - return NULL; + // Return type: refptr_same + return CefLoadHandlerCppToC::Wrap(_retval); } + cef_request_handler_t* CEF_CALLBACK client_get_request_handler( struct _cef_client_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return NULL; - CefRefPtr handlerPtr = - CefClientCppToC::Get(self)->GetRequestHandler(); - if(handlerPtr.get()) - return CefRequestHandlerCppToC::Wrap(handlerPtr); + // Execute + CefRefPtr _retval = CefClientCppToC::Get( + self)->GetRequestHandler(); - return NULL; + // Return type: refptr_same + return CefRequestHandlerCppToC::Wrap(_retval); } + cef_display_handler_t* CEF_CALLBACK client_get_display_handler( struct _cef_client_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return NULL; - CefRefPtr handlerPtr = - CefClientCppToC::Get(self)->GetDisplayHandler(); - if(handlerPtr.get()) - return CefDisplayHandlerCppToC::Wrap(handlerPtr); + // Execute + CefRefPtr _retval = CefClientCppToC::Get( + self)->GetDisplayHandler(); - return NULL; + // Return type: refptr_same + return CefDisplayHandlerCppToC::Wrap(_retval); } + cef_focus_handler_t* CEF_CALLBACK client_get_focus_handler( struct _cef_client_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return NULL; - CefRefPtr handlerPtr = - CefClientCppToC::Get(self)->GetFocusHandler(); - if(handlerPtr.get()) - return CefFocusHandlerCppToC::Wrap(handlerPtr); + // Execute + CefRefPtr _retval = CefClientCppToC::Get( + self)->GetFocusHandler(); - return NULL; + // Return type: refptr_same + return CefFocusHandlerCppToC::Wrap(_retval); } + cef_keyboard_handler_t* CEF_CALLBACK client_get_keyboard_handler( struct _cef_client_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return NULL; - CefRefPtr handlerPtr = - CefClientCppToC::Get(self)->GetKeyboardHandler(); - if(handlerPtr.get()) - return CefKeyboardHandlerCppToC::Wrap(handlerPtr); + // Execute + CefRefPtr _retval = CefClientCppToC::Get( + self)->GetKeyboardHandler(); - return NULL; + // Return type: refptr_same + return CefKeyboardHandlerCppToC::Wrap(_retval); } + cef_menu_handler_t* CEF_CALLBACK client_get_menu_handler( struct _cef_client_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return NULL; - CefRefPtr handlerPtr = - CefClientCppToC::Get(self)->GetMenuHandler(); - if(handlerPtr.get()) - return CefMenuHandlerCppToC::Wrap(handlerPtr); + // Execute + CefRefPtr _retval = CefClientCppToC::Get( + self)->GetMenuHandler(); - return NULL; + // Return type: refptr_same + return CefMenuHandlerCppToC::Wrap(_retval); } + cef_print_handler_t* CEF_CALLBACK client_get_print_handler( struct _cef_client_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return NULL; - CefRefPtr handlerPtr = - CefClientCppToC::Get(self)->GetPrintHandler(); - if(handlerPtr.get()) - return CefPrintHandlerCppToC::Wrap(handlerPtr); + // Execute + CefRefPtr _retval = CefClientCppToC::Get( + self)->GetPrintHandler(); - return NULL; + // Return type: refptr_same + return CefPrintHandlerCppToC::Wrap(_retval); } + cef_find_handler_t* CEF_CALLBACK client_get_find_handler( struct _cef_client_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return NULL; - CefRefPtr handlerPtr = - CefClientCppToC::Get(self)->GetFindHandler(); - if(handlerPtr.get()) - return CefFindHandlerCppToC::Wrap(handlerPtr); + // Execute + CefRefPtr _retval = CefClientCppToC::Get( + self)->GetFindHandler(); - return NULL; + // Return type: refptr_same + return CefFindHandlerCppToC::Wrap(_retval); } + cef_jsdialog_handler_t* CEF_CALLBACK client_get_jsdialog_handler( struct _cef_client_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return NULL; - CefRefPtr handlerPtr = - CefClientCppToC::Get(self)->GetJSDialogHandler(); - if(handlerPtr.get()) - return CefJSDialogHandlerCppToC::Wrap(handlerPtr); + // Execute + CefRefPtr _retval = CefClientCppToC::Get( + self)->GetJSDialogHandler(); - return NULL; + // Return type: refptr_same + return CefJSDialogHandlerCppToC::Wrap(_retval); } + cef_v8context_handler_t* CEF_CALLBACK client_get_v8context_handler( struct _cef_client_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return NULL; - CefRefPtr handlerPtr = - CefClientCppToC::Get(self)->GetV8ContextHandler(); - if(handlerPtr.get()) - return CefV8ContextHandlerCppToC::Wrap(handlerPtr); + // Execute + CefRefPtr _retval = CefClientCppToC::Get( + self)->GetV8ContextHandler(); - return NULL; + // Return type: refptr_same + return CefV8ContextHandlerCppToC::Wrap(_retval); } + cef_render_handler_t* CEF_CALLBACK client_get_render_handler( struct _cef_client_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return NULL; - CefRefPtr handlerPtr = - CefClientCppToC::Get(self)->GetRenderHandler(); - if(handlerPtr.get()) - return CefRenderHandlerCppToC::Wrap(handlerPtr); + // Execute + CefRefPtr _retval = CefClientCppToC::Get( + self)->GetRenderHandler(); - return NULL; + // Return type: refptr_same + return CefRenderHandlerCppToC::Wrap(_retval); } + cef_drag_handler_t* CEF_CALLBACK client_get_drag_handler( struct _cef_client_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return NULL; - CefRefPtr handlerPtr = - CefClientCppToC::Get(self)->GetDragHandler(); - if(handlerPtr.get()) - return CefDragHandlerCppToC::Wrap(handlerPtr); + // Execute + CefRefPtr _retval = CefClientCppToC::Get( + self)->GetDragHandler(); - return NULL; + // Return type: refptr_same + return CefDragHandlerCppToC::Wrap(_retval); } + // CONSTRUCTOR - Do not edit by hand. CefClientCppToC::CefClientCppToC(CefClient* cls) diff --git a/libcef_dll/cpptoc/client_cpptoc.h b/libcef_dll/cpptoc/client_cpptoc.h index 5ac0f17af..c04d5d5b7 100644 --- a/libcef_dll/cpptoc/client_cpptoc.h +++ b/libcef_dll/cpptoc/client_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _CLIENT_CPPTOC_H #define _CLIENT_CPPTOC_H diff --git a/libcef_dll/cpptoc/command_line_cpptoc.cc b/libcef_dll/cpptoc/command_line_cpptoc.cc index 69b3e5d1f..b27ff6385 100644 --- a/libcef_dll/cpptoc/command_line_cpptoc.cc +++ b/libcef_dll/cpptoc/command_line_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -18,171 +18,305 @@ CEF_EXPORT cef_command_line_t* cef_command_line_create() { - CefRefPtr impl = CefCommandLine::CreateCommandLine(); - if(impl.get()) - return CefCommandLineCppToC::Wrap(impl); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + CefRefPtr _retval = CefCommandLine::CreateCommandLine(); + + // Return type: refptr_same + return CefCommandLineCppToC::Wrap(_retval); } + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK command_line_init_from_argv(struct _cef_command_line_t* self, int argc, const char* const* argv) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return; + // Verify param: argv; type: simple_byaddr + DCHECK(argv); + if (!argv) + return; - CefCommandLineCppToC::Get(self)->InitFromArgv(argc, argv); + // Execute + CefCommandLineCppToC::Get(self)->InitFromArgv( + argc, + argv); } + void CEF_CALLBACK command_line_init_from_string( struct _cef_command_line_t* self, const cef_string_t* command_line) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return; + // Verify param: command_line; type: string_byref_const + DCHECK(command_line); + if (!command_line) + return; - CefCommandLineCppToC::Get(self)->InitFromString(CefString(command_line)); + // Execute + CefCommandLineCppToC::Get(self)->InitFromString( + CefString(command_line)); } + cef_string_userfree_t CEF_CALLBACK command_line_get_command_line_string( struct _cef_command_line_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return NULL; - CefString str = CefCommandLineCppToC::Get(self)->GetCommandLineString(); - return str.DetachToUserFree(); + // Execute + CefString _retval = CefCommandLineCppToC::Get(self)->GetCommandLineString(); + + // Return type: string + return _retval.DetachToUserFree(); } + cef_string_userfree_t CEF_CALLBACK command_line_get_program( struct _cef_command_line_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return NULL; - CefString str = CefCommandLineCppToC::Get(self)->GetProgram(); - return str.DetachToUserFree(); + // Execute + CefString _retval = CefCommandLineCppToC::Get(self)->GetProgram(); + + // Return type: string + return _retval.DetachToUserFree(); } + void CEF_CALLBACK command_line_set_program(struct _cef_command_line_t* self, const cef_string_t* program) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return; + // Verify param: program; type: string_byref_const + DCHECK(program); + if (!program) + return; - CefCommandLineCppToC::Get(self)->SetProgram(CefString(program)); + // Execute + CefCommandLineCppToC::Get(self)->SetProgram( + CefString(program)); } + int CEF_CALLBACK command_line_has_switches(struct _cef_command_line_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return 0; - return CefCommandLineCppToC::Get(self)->HasSwitches(); + // Execute + bool _retval = CefCommandLineCppToC::Get(self)->HasSwitches(); + + // Return type: bool + return _retval; } + int CEF_CALLBACK command_line_has_switch(struct _cef_command_line_t* self, const cef_string_t* name) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: name; type: string_byref_const DCHECK(name); - if (!self || !name) + if (!name) return 0; - return CefCommandLineCppToC::Get(self)->HasSwitch(CefString(name)); + // Execute + bool _retval = CefCommandLineCppToC::Get(self)->HasSwitch( + CefString(name)); + + // Return type: bool + return _retval; } + cef_string_userfree_t CEF_CALLBACK command_line_get_switch_value( struct _cef_command_line_t* self, const cef_string_t* name) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return NULL; + // Verify param: name; type: string_byref_const DCHECK(name); - if (!self || !name) + if (!name) return NULL; - CefString str = CefCommandLineCppToC::Get(self)->GetSwitchValue( + // Execute + CefString _retval = CefCommandLineCppToC::Get(self)->GetSwitchValue( CefString(name)); - return str.DetachToUserFree(); + + // Return type: string + return _retval.DetachToUserFree(); } + void CEF_CALLBACK command_line_get_switches(struct _cef_command_line_t* self, cef_string_map_t switches) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: switches; type: string_map_single_byref DCHECK(switches); - if (!self || !switches) + if (!switches) return; - CefCommandLine::SwitchMap map; - CefCommandLineCppToC::Get(self)->GetSwitches(map); - transfer_string_map_contents(map, switches); + // Translate param: switches; type: string_map_single_byref + std::map switchesMap; + transfer_string_map_contents(switches, switchesMap); + + // Execute + CefCommandLineCppToC::Get(self)->GetSwitches( + switchesMap); + + // Restore param: switches; type: string_map_single_byref + cef_string_map_clear(switches); + transfer_string_map_contents(switchesMap, switches); } + void CEF_CALLBACK command_line_append_switch(struct _cef_command_line_t* self, const cef_string_t* name) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: name; type: string_byref_const DCHECK(name); - if (!self || !name) + if (!name) return; - CefCommandLineCppToC::Get(self)->AppendSwitch(CefString(name)); + // Execute + CefCommandLineCppToC::Get(self)->AppendSwitch( + CefString(name)); } + void CEF_CALLBACK command_line_append_switch_with_value( struct _cef_command_line_t* self, const cef_string_t* name, const cef_string_t* value) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: name; type: string_byref_const DCHECK(name); + if (!name) + return; + // Verify param: value; type: string_byref_const DCHECK(value); - if (!self || !name || !value) + if (!value) return; - CefCommandLineCppToC::Get(self)->AppendSwitchWithValue(CefString(name), + // Execute + CefCommandLineCppToC::Get(self)->AppendSwitchWithValue( + CefString(name), CefString(value)); } + int CEF_CALLBACK command_line_has_arguments(struct _cef_command_line_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return 0; - return CefCommandLineCppToC::Get(self)->HasArguments(); + // Execute + bool _retval = CefCommandLineCppToC::Get(self)->HasArguments(); + + // Return type: bool + return _retval; } + void CEF_CALLBACK command_line_get_arguments(struct _cef_command_line_t* self, cef_string_list_t arguments) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return; + // Verify param: arguments; type: string_vec_byref + DCHECK(arguments); + if (!arguments) + return; - CefCommandLine::ArgumentList list; - CefCommandLineCppToC::Get(self)->GetArguments(list); - transfer_string_list_contents(list, arguments); + // Translate param: arguments; type: string_vec_byref + std::vector argumentsList; + transfer_string_list_contents(arguments, argumentsList); + + // Execute + CefCommandLineCppToC::Get(self)->GetArguments( + argumentsList); + + // Restore param: arguments; type: string_vec_byref + cef_string_list_clear(arguments); + transfer_string_list_contents(argumentsList, arguments); } + void CEF_CALLBACK command_line_append_argument(struct _cef_command_line_t* self, const cef_string_t* argument) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: argument; type: string_byref_const DCHECK(argument); - if (!self || !argument) + if (!argument) return; - CefCommandLineCppToC::Get(self)->AppendArgument(CefString(argument)); + // Execute + CefCommandLineCppToC::Get(self)->AppendArgument( + CefString(argument)); } + // CONSTRUCTOR - Do not edit by hand. CefCommandLineCppToC::CefCommandLineCppToC(CefCommandLine* cls) diff --git a/libcef_dll/cpptoc/command_line_cpptoc.h b/libcef_dll/cpptoc/command_line_cpptoc.h index 3d996c167..38b863303 100644 --- a/libcef_dll/cpptoc/command_line_cpptoc.h +++ b/libcef_dll/cpptoc/command_line_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _COMMANDLINE_CPPTOC_H #define _COMMANDLINE_CPPTOC_H diff --git a/libcef_dll/cpptoc/content_filter_cpptoc.cc b/libcef_dll/cpptoc/content_filter_cpptoc.cc index 912cd7b23..5fd8db816 100644 --- a/libcef_dll/cpptoc/content_filter_cpptoc.cc +++ b/libcef_dll/cpptoc/content_filter_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -20,38 +20,82 @@ void CEF_CALLBACK content_filter_process_data( struct _cef_content_filter_t* self, const void* data, int data_size, cef_stream_reader_t** substitute_data) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: data; type: simple_byaddr DCHECK(data); + if (!data) + return; + // Verify param: substitute_data; type: refptr_diff_byref DCHECK(substitute_data); - if (!self || !data || !substitute_data) + if (!substitute_data) return; - CefRefPtr substituteDataPtr; + // Translate param: substitute_data; type: refptr_diff_byref + CefRefPtr substitute_dataPtr; + if (substitute_data && *substitute_data) + substitute_dataPtr = CefStreamReaderCToCpp::Wrap(*substitute_data); + CefStreamReader* substitute_dataOrig = substitute_dataPtr.get(); - CefContentFilterCppToC::Get(self)->ProcessData(data, data_size, - substituteDataPtr); + // Execute + CefContentFilterCppToC::Get(self)->ProcessData( + data, + data_size, + substitute_dataPtr); - if(substituteDataPtr.get()) - *substitute_data = CefStreamReaderCToCpp::Unwrap(substituteDataPtr); + // Restore param: substitute_data; type: refptr_diff_byref + if (substitute_data) { + if (substitute_dataPtr.get()) { + if (substitute_dataPtr.get() != substitute_dataOrig) { + *substitute_data = CefStreamReaderCToCpp::Unwrap(substitute_dataPtr); + } + } else { + *substitute_data = NULL; + } + } } + void CEF_CALLBACK content_filter_drain(struct _cef_content_filter_t* self, cef_stream_reader_t** remainder) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: remainder; type: refptr_diff_byref DCHECK(remainder); - if (!self || !remainder) + if (!remainder) return; + // Translate param: remainder; type: refptr_diff_byref CefRefPtr remainderPtr; + if (remainder && *remainder) + remainderPtr = CefStreamReaderCToCpp::Wrap(*remainder); + CefStreamReader* remainderOrig = remainderPtr.get(); - CefContentFilterCppToC::Get(self)->Drain(remainderPtr); + // Execute + CefContentFilterCppToC::Get(self)->Drain( + remainderPtr); - if(remainderPtr.get()) - *remainder = CefStreamReaderCToCpp::Unwrap(remainderPtr); + // Restore param: remainder; type: refptr_diff_byref + if (remainder) { + if (remainderPtr.get()) { + if (remainderPtr.get() != remainderOrig) { + *remainder = CefStreamReaderCToCpp::Unwrap(remainderPtr); + } + } else { + *remainder = NULL; + } + } } + // CONSTRUCTOR - Do not edit by hand. CefContentFilterCppToC::CefContentFilterCppToC(CefContentFilter* cls) diff --git a/libcef_dll/cpptoc/content_filter_cpptoc.h b/libcef_dll/cpptoc/content_filter_cpptoc.h index f8c84d41f..6f4582a34 100644 --- a/libcef_dll/cpptoc/content_filter_cpptoc.h +++ b/libcef_dll/cpptoc/content_filter_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _CONTENTFILTER_CPPTOC_H #define _CONTENTFILTER_CPPTOC_H diff --git a/libcef_dll/cpptoc/cookie_visitor_cpptoc.cc b/libcef_dll/cpptoc/cookie_visitor_cpptoc.cc index 681cbc5c3..3de5d482c 100644 --- a/libcef_dll/cpptoc/cookie_visitor_cpptoc.cc +++ b/libcef_dll/cpptoc/cookie_visitor_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -19,24 +19,44 @@ int CEF_CALLBACK cookie_visitor_visit(struct _cef_cookie_visitor_t* self, const struct _cef_cookie_t* cookie, int count, int total, int* deleteCookie) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: cookie; type: struct_byref_const DCHECK(cookie); - if(!self || !cookie) + if (!cookie) + return 0; + // Verify param: deleteCookie; type: bool_byref + DCHECK(deleteCookie); + if (!deleteCookie) return 0; - // Reference the existing values without copying. + // Translate param: cookie; type: struct_byref_const CefCookie cookieObj; - cookieObj.Set(*cookie, false); + if (cookie) + cookieObj.Set(*cookie, false); + // Translate param: deleteCookie; type: bool_byref + bool deleteCookieBool = (deleteCookie && *deleteCookie)?true:false; - bool delVal = (*deleteCookie)?true:false; - bool retVal = CefCookieVisitorCppToC::Get(self)->Visit(cookieObj, count, - total, delVal); - *deleteCookie = delVal; + // Execute + bool _retval = CefCookieVisitorCppToC::Get(self)->Visit( + cookieObj, + count, + total, + deleteCookieBool); - return retVal; + // Restore param: deleteCookie; type: bool_byref + if (deleteCookie) + *deleteCookie = deleteCookieBool?true:false; + + // Return type: bool + return _retval; } + // CONSTRUCTOR - Do not edit by hand. CefCookieVisitorCppToC::CefCookieVisitorCppToC(CefCookieVisitor* cls) diff --git a/libcef_dll/cpptoc/cookie_visitor_cpptoc.h b/libcef_dll/cpptoc/cookie_visitor_cpptoc.h index f9512e4a4..e92f7b513 100644 --- a/libcef_dll/cpptoc/cookie_visitor_cpptoc.h +++ b/libcef_dll/cpptoc/cookie_visitor_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _COOKIEVISITOR_CPPTOC_H #define _COOKIEVISITOR_CPPTOC_H diff --git a/libcef_dll/cpptoc/cpptoc.h b/libcef_dll/cpptoc/cpptoc.h index 157684e53..ce7f8876a 100644 --- a/libcef_dll/cpptoc/cpptoc.h +++ b/libcef_dll/cpptoc/cpptoc.h @@ -30,6 +30,8 @@ public: // is done in this case. static CefRefPtr Get(StructName* s) { + DCHECK(s); + // Cast our structure to the wrapper structure type. Struct* wrapperStruct = reinterpret_cast(s); // Return the underlying object instance. @@ -56,7 +58,8 @@ public: // our wrapper structure back from the other side. static CefRefPtr Unwrap(StructName* s) { - DCHECK(s); + if (!s) + return NULL; // Cast our structure to the wrapper structure type. Struct* wrapperStruct = reinterpret_cast(s); diff --git a/libcef_dll/cpptoc/display_handler_cpptoc.cc b/libcef_dll/cpptoc/display_handler_cpptoc.cc index 6529b6205..b385419c3 100644 --- a/libcef_dll/cpptoc/display_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/display_handler_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -21,101 +21,181 @@ void CEF_CALLBACK display_handler_on_nav_state_change( struct _cef_display_handler_t* self, cef_browser_t* browser, int canGoBack, int canGoForward) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff DCHECK(browser); - if (!self || !browser) + if (!browser) return; + // Execute CefDisplayHandlerCppToC::Get(self)->OnNavStateChange( - CefBrowserCToCpp::Wrap(browser), (canGoBack?true:false), - (canGoForward?true:false)); + CefBrowserCToCpp::Wrap(browser), + canGoBack?true:false, + canGoForward?true:false); } + void CEF_CALLBACK display_handler_on_address_change( struct _cef_display_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, const cef_string_t* url) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff DCHECK(browser); + if (!browser) + return; + // Verify param: frame; type: refptr_diff DCHECK(frame); + if (!frame) + return; + // Verify param: url; type: string_byref_const DCHECK(url); - if (!self || !browser || !frame || !url) + if (!url) return; + // Execute CefDisplayHandlerCppToC::Get(self)->OnAddressChange( - CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), + CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame), CefString(url)); } + void CEF_CALLBACK display_handler_on_contents_size_change( struct _cef_display_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, int width, int height) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff DCHECK(browser); + if (!browser) + return; + // Verify param: frame; type: refptr_diff DCHECK(frame); - if (!self || !browser || !frame) + if (!frame) return; + // Execute CefDisplayHandlerCppToC::Get(self)->OnContentsSizeChange( - CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), width, + CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame), + width, height); } + void CEF_CALLBACK display_handler_on_title_change( struct _cef_display_handler_t* self, cef_browser_t* browser, const cef_string_t* title) { - DCHECK(self); - DCHECK(browser); - if (!self || !browser) - return; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + // Unverified params: title + + // Execute CefDisplayHandlerCppToC::Get(self)->OnTitleChange( - CefBrowserCToCpp::Wrap(browser), CefString(title)); + CefBrowserCToCpp::Wrap(browser), + CefString(title)); } + int CEF_CALLBACK display_handler_on_tooltip(struct _cef_display_handler_t* self, cef_browser_t* browser, cef_string_t* text) { - DCHECK(self); - DCHECK(browser); - if (!self || !browser) - return 0; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return 0; + // Unverified params: text + + // Translate param: text; type: string_byref CefString textStr(text); - return CefDisplayHandlerCppToC::Get(self)->OnTooltip( - CefBrowserCToCpp::Wrap(browser), textStr); + + // Execute + bool _retval = CefDisplayHandlerCppToC::Get(self)->OnTooltip( + CefBrowserCToCpp::Wrap(browser), + textStr); + + // Return type: bool + return _retval; } + void CEF_CALLBACK display_handler_on_status_message( struct _cef_display_handler_t* self, cef_browser_t* browser, const cef_string_t* value, enum cef_handler_statustype_t type) { - DCHECK(self); - DCHECK(browser); - if (!self || !browser) - return; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + // Unverified params: value + + // Execute CefDisplayHandlerCppToC::Get(self)->OnStatusMessage( - CefBrowserCToCpp::Wrap(browser), CefString(value), type); + CefBrowserCToCpp::Wrap(browser), + CefString(value), + type); } + int CEF_CALLBACK display_handler_on_console_message( struct _cef_display_handler_t* self, cef_browser_t* browser, const cef_string_t* message, const cef_string_t* source, int line) { - DCHECK(self); - DCHECK(browser); - if (!self || !browser) - return 0; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return CefDisplayHandlerCppToC::Get(self)->OnConsoleMessage( - CefBrowserCToCpp::Wrap(browser), CefString(message), CefString(source), + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return 0; + // Unverified params: message, source + + // Execute + bool _retval = CefDisplayHandlerCppToC::Get(self)->OnConsoleMessage( + CefBrowserCToCpp::Wrap(browser), + CefString(message), + CefString(source), line); + + // Return type: bool + return _retval; } + // CONSTRUCTOR - Do not edit by hand. CefDisplayHandlerCppToC::CefDisplayHandlerCppToC(CefDisplayHandler* cls) diff --git a/libcef_dll/cpptoc/display_handler_cpptoc.h b/libcef_dll/cpptoc/display_handler_cpptoc.h index 23dd1e143..1dc36ea81 100644 --- a/libcef_dll/cpptoc/display_handler_cpptoc.h +++ b/libcef_dll/cpptoc/display_handler_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _DISPLAYHANDLER_CPPTOC_H #define _DISPLAYHANDLER_CPPTOC_H diff --git a/libcef_dll/cpptoc/domdocument_cpptoc.cc b/libcef_dll/cpptoc/domdocument_cpptoc.cc index 8bdd1c9f2..44cf25275 100644 --- a/libcef_dll/cpptoc/domdocument_cpptoc.cc +++ b/libcef_dll/cpptoc/domdocument_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -19,196 +19,290 @@ enum cef_dom_document_type_t CEF_CALLBACK domdocument_get_type( struct _cef_domdocument_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return DOM_DOCUMENT_TYPE_UNKNOWN; - return CefDOMDocumentCppToC::Get(self)->GetType(); + // Execute + cef_dom_document_type_t _retval = CefDOMDocumentCppToC::Get(self)->GetType(); + + // Return type: simple + return _retval; } + struct _cef_domnode_t* CEF_CALLBACK domdocument_get_document( struct _cef_domdocument_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefRefPtr nodePtr = - CefDOMDocumentCppToC::Get(self)->GetDocument(); - if (nodePtr.get()) - return CefDOMNodeCppToC::Wrap(nodePtr); - return NULL; + // Execute + CefRefPtr _retval = CefDOMDocumentCppToC::Get(self)->GetDocument( + ); + + // Return type: refptr_same + return CefDOMNodeCppToC::Wrap(_retval); } + struct _cef_domnode_t* CEF_CALLBACK domdocument_get_body( struct _cef_domdocument_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefRefPtr nodePtr = CefDOMDocumentCppToC::Get(self)->GetBody(); - if (nodePtr.get()) - return CefDOMNodeCppToC::Wrap(nodePtr); - return NULL; + // Execute + CefRefPtr _retval = CefDOMDocumentCppToC::Get(self)->GetBody(); + + // Return type: refptr_same + return CefDOMNodeCppToC::Wrap(_retval); } + struct _cef_domnode_t* CEF_CALLBACK domdocument_get_head( struct _cef_domdocument_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefRefPtr elementPtr = CefDOMDocumentCppToC::Get(self)->GetHead(); - if (elementPtr.get()) - return CefDOMNodeCppToC::Wrap(elementPtr); - return NULL; + // Execute + CefRefPtr _retval = CefDOMDocumentCppToC::Get(self)->GetHead(); + + // Return type: refptr_same + return CefDOMNodeCppToC::Wrap(_retval); } + cef_string_userfree_t CEF_CALLBACK domdocument_get_title( struct _cef_domdocument_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefString str = CefDOMDocumentCppToC::Get(self)->GetTitle(); - return str.DetachToUserFree(); + // Execute + CefString _retval = CefDOMDocumentCppToC::Get(self)->GetTitle(); + + // Return type: string + return _retval.DetachToUserFree(); } + struct _cef_domnode_t* CEF_CALLBACK domdocument_get_element_by_id( struct _cef_domdocument_t* self, const cef_string_t* id) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return NULL; + // Verify param: id; type: string_byref_const DCHECK(id); - if(!self || !id) + if (!id) return NULL; - CefRefPtr elementPtr = - CefDOMDocumentCppToC::Get(self)->GetElementById(CefString(id)); - if (elementPtr.get()) - return CefDOMNodeCppToC::Wrap(elementPtr); - return NULL; + // Execute + CefRefPtr _retval = CefDOMDocumentCppToC::Get( + self)->GetElementById( + CefString(id)); + + // Return type: refptr_same + return CefDOMNodeCppToC::Wrap(_retval); } + struct _cef_domnode_t* CEF_CALLBACK domdocument_get_focused_node( struct _cef_domdocument_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefRefPtr elementPtr = - CefDOMDocumentCppToC::Get(self)->GetFocusedNode(); - if (elementPtr.get()) - return CefDOMNodeCppToC::Wrap(elementPtr); - return NULL; + // Execute + CefRefPtr _retval = CefDOMDocumentCppToC::Get( + self)->GetFocusedNode(); + + // Return type: refptr_same + return CefDOMNodeCppToC::Wrap(_retval); } + int CEF_CALLBACK domdocument_has_selection(struct _cef_domdocument_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefDOMDocumentCppToC::Get(self)->HasSelection(); + // Execute + bool _retval = CefDOMDocumentCppToC::Get(self)->HasSelection(); + + // Return type: bool + return _retval; } + struct _cef_domnode_t* CEF_CALLBACK domdocument_get_selection_start_node( struct _cef_domdocument_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefRefPtr elementPtr = - CefDOMDocumentCppToC::Get(self)->GetSelectionStartNode(); - if (elementPtr.get()) - return CefDOMNodeCppToC::Wrap(elementPtr); - return NULL; + // Execute + CefRefPtr _retval = CefDOMDocumentCppToC::Get( + self)->GetSelectionStartNode(); + + // Return type: refptr_same + return CefDOMNodeCppToC::Wrap(_retval); } + int CEF_CALLBACK domdocument_get_selection_start_offset( struct _cef_domdocument_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefDOMDocumentCppToC::Get(self)->GetSelectionStartOffset(); + // Execute + int _retval = CefDOMDocumentCppToC::Get(self)->GetSelectionStartOffset(); + + // Return type: simple + return _retval; } + struct _cef_domnode_t* CEF_CALLBACK domdocument_get_selection_end_node( struct _cef_domdocument_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefRefPtr elementPtr = - CefDOMDocumentCppToC::Get(self)->GetSelectionEndNode(); - if (elementPtr.get()) - return CefDOMNodeCppToC::Wrap(elementPtr); - return NULL; + // Execute + CefRefPtr _retval = CefDOMDocumentCppToC::Get( + self)->GetSelectionEndNode(); + + // Return type: refptr_same + return CefDOMNodeCppToC::Wrap(_retval); } + int CEF_CALLBACK domdocument_get_selection_end_offset( struct _cef_domdocument_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefDOMDocumentCppToC::Get(self)->GetSelectionEndOffset(); + // Execute + int _retval = CefDOMDocumentCppToC::Get(self)->GetSelectionEndOffset(); + + // Return type: simple + return _retval; } + cef_string_userfree_t CEF_CALLBACK domdocument_get_selection_as_markup( struct _cef_domdocument_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefString str = CefDOMDocumentCppToC::Get(self)->GetSelectionAsMarkup(); - return str.DetachToUserFree(); + // Execute + CefString _retval = CefDOMDocumentCppToC::Get(self)->GetSelectionAsMarkup(); + + // Return type: string + return _retval.DetachToUserFree(); } + cef_string_userfree_t CEF_CALLBACK domdocument_get_selection_as_text( struct _cef_domdocument_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefString str = CefDOMDocumentCppToC::Get(self)->GetSelectionAsText(); - return str.DetachToUserFree(); + // Execute + CefString _retval = CefDOMDocumentCppToC::Get(self)->GetSelectionAsText(); + + // Return type: string + return _retval.DetachToUserFree(); } + cef_string_userfree_t CEF_CALLBACK domdocument_get_base_url( struct _cef_domdocument_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefString str = CefDOMDocumentCppToC::Get(self)->GetBaseURL(); - return str.DetachToUserFree(); + // Execute + CefString _retval = CefDOMDocumentCppToC::Get(self)->GetBaseURL(); + + // Return type: string + return _retval.DetachToUserFree(); } + cef_string_userfree_t CEF_CALLBACK domdocument_get_complete_url( struct _cef_domdocument_t* self, const cef_string_t* partialURL) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) + return NULL; + // Verify param: partialURL; type: string_byref_const + DCHECK(partialURL); + if (!partialURL) return NULL; - CefString str = - CefDOMDocumentCppToC::Get(self)->GetCompleteURL(CefString(partialURL)); - return str.DetachToUserFree(); + // Execute + CefString _retval = CefDOMDocumentCppToC::Get(self)->GetCompleteURL( + CefString(partialURL)); + + // Return type: string + return _retval.DetachToUserFree(); } + // CONSTRUCTOR - Do not edit by hand. CefDOMDocumentCppToC::CefDOMDocumentCppToC(CefDOMDocument* cls) diff --git a/libcef_dll/cpptoc/domdocument_cpptoc.h b/libcef_dll/cpptoc/domdocument_cpptoc.h index 3b1097a99..f2afd490a 100644 --- a/libcef_dll/cpptoc/domdocument_cpptoc.h +++ b/libcef_dll/cpptoc/domdocument_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _DOMDOCUMENT_CPPTOC_H #define _DOMDOCUMENT_CPPTOC_H diff --git a/libcef_dll/cpptoc/domevent_cpptoc.cc b/libcef_dll/cpptoc/domevent_cpptoc.cc index f8d369f6b..237b6e795 100644 --- a/libcef_dll/cpptoc/domevent_cpptoc.cc +++ b/libcef_dll/cpptoc/domevent_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -20,93 +20,140 @@ cef_string_userfree_t CEF_CALLBACK domevent_get_type( struct _cef_domevent_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefString str = CefDOMEventCppToC::Get(self)->GetType(); - return str.DetachToUserFree(); + // Execute + CefString _retval = CefDOMEventCppToC::Get(self)->GetType(); + + // Return type: string + return _retval.DetachToUserFree(); } + enum cef_dom_event_category_t CEF_CALLBACK domevent_get_category( struct _cef_domevent_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return DOM_EVENT_CATEGORY_UNKNOWN; - return CefDOMEventCppToC::Get(self)->GetCategory(); + // Execute + cef_dom_event_category_t _retval = CefDOMEventCppToC::Get(self)->GetCategory( + ); + + // Return type: simple + return _retval; } + enum cef_dom_event_phase_t CEF_CALLBACK domevent_get_phase( struct _cef_domevent_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return DOM_EVENT_PHASE_UNKNOWN; - return CefDOMEventCppToC::Get(self)->GetPhase(); + // Execute + cef_dom_event_phase_t _retval = CefDOMEventCppToC::Get(self)->GetPhase(); + + // Return type: simple + return _retval; } + int CEF_CALLBACK domevent_can_bubble(struct _cef_domevent_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefDOMEventCppToC::Get(self)->CanBubble(); + // Execute + bool _retval = CefDOMEventCppToC::Get(self)->CanBubble(); + + // Return type: bool + return _retval; } + int CEF_CALLBACK domevent_can_cancel(struct _cef_domevent_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefDOMEventCppToC::Get(self)->CanCancel(); + // Execute + bool _retval = CefDOMEventCppToC::Get(self)->CanCancel(); + + // Return type: bool + return _retval; } + cef_domdocument_t* CEF_CALLBACK domevent_get_document( struct _cef_domevent_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefRefPtr documentPtr = - CefDOMEventCppToC::Get(self)->GetDocument(); - if (documentPtr.get()) - return CefDOMDocumentCppToC::Wrap(documentPtr); - return NULL; + // Execute + CefRefPtr _retval = CefDOMEventCppToC::Get(self)->GetDocument( + ); + + // Return type: refptr_same + return CefDOMDocumentCppToC::Wrap(_retval); } + cef_domnode_t* CEF_CALLBACK domevent_get_target(struct _cef_domevent_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefRefPtr nodePtr = CefDOMEventCppToC::Get(self)->GetTarget(); - if (nodePtr.get()) - return CefDOMNodeCppToC::Wrap(nodePtr); - return NULL; + // Execute + CefRefPtr _retval = CefDOMEventCppToC::Get(self)->GetTarget(); + + // Return type: refptr_same + return CefDOMNodeCppToC::Wrap(_retval); } + cef_domnode_t* CEF_CALLBACK domevent_get_current_target( struct _cef_domevent_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefRefPtr nodePtr = - CefDOMEventCppToC::Get(self)->GetCurrentTarget(); - if (nodePtr.get()) - return CefDOMNodeCppToC::Wrap(nodePtr); - return NULL; + // Execute + CefRefPtr _retval = CefDOMEventCppToC::Get( + self)->GetCurrentTarget(); + + // Return type: refptr_same + return CefDOMNodeCppToC::Wrap(_retval); } + // CONSTRUCTOR - Do not edit by hand. CefDOMEventCppToC::CefDOMEventCppToC(CefDOMEvent* cls) diff --git a/libcef_dll/cpptoc/domevent_cpptoc.h b/libcef_dll/cpptoc/domevent_cpptoc.h index 37da2359c..603fc9fa7 100644 --- a/libcef_dll/cpptoc/domevent_cpptoc.h +++ b/libcef_dll/cpptoc/domevent_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _DOMEVENT_CPPTOC_H #define _DOMEVENT_CPPTOC_H diff --git a/libcef_dll/cpptoc/domevent_listener_cpptoc.cc b/libcef_dll/cpptoc/domevent_listener_cpptoc.cc index 250b29c1b..688f93f6b 100644 --- a/libcef_dll/cpptoc/domevent_listener_cpptoc.cc +++ b/libcef_dll/cpptoc/domevent_listener_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -19,18 +19,23 @@ void CEF_CALLBACK domevent_listener_handle_event( struct _cef_domevent_listener_t* self, cef_domevent_t* event) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) + return; + // Verify param: event; type: refptr_diff + DCHECK(event); + if (!event) return; - CefRefPtr eventPtr; - if (event) - eventPtr = CefDOMEventCToCpp::Wrap(event); - - CefDOMEventListenerCppToC::Get(self)->HandleEvent(eventPtr); + // Execute + CefDOMEventListenerCppToC::Get(self)->HandleEvent( + CefDOMEventCToCpp::Wrap(event)); } + // CONSTRUCTOR - Do not edit by hand. CefDOMEventListenerCppToC::CefDOMEventListenerCppToC(CefDOMEventListener* cls) diff --git a/libcef_dll/cpptoc/domevent_listener_cpptoc.h b/libcef_dll/cpptoc/domevent_listener_cpptoc.h index 7d509efff..8b6ee09f6 100644 --- a/libcef_dll/cpptoc/domevent_listener_cpptoc.h +++ b/libcef_dll/cpptoc/domevent_listener_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _DOMEVENTLISTENER_CPPTOC_H #define _DOMEVENTLISTENER_CPPTOC_H diff --git a/libcef_dll/cpptoc/domnode_cpptoc.cc b/libcef_dll/cpptoc/domnode_cpptoc.cc index 6e502af35..3f9771feb 100644 --- a/libcef_dll/cpptoc/domnode_cpptoc.cc +++ b/libcef_dll/cpptoc/domnode_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -21,289 +21,474 @@ enum cef_dom_node_type_t CEF_CALLBACK domnode_get_type( struct _cef_domnode_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return DOM_NODE_TYPE_UNSUPPORTED; - return CefDOMNodeCppToC::Get(self)->GetType(); + // Execute + cef_dom_node_type_t _retval = CefDOMNodeCppToC::Get(self)->GetType(); + + // Return type: simple + return _retval; } + int CEF_CALLBACK domnode_is_text(struct _cef_domnode_t* self) { - DCHECK(self); - if(!self) - return 0; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return CefDOMNodeCppToC::Get(self)->IsText(); -} - -int CEF_CALLBACK domnode_is_element(struct _cef_domnode_t* self) -{ - DCHECK(self); - if(!self) - return 0; - - return CefDOMNodeCppToC::Get(self)->IsElement(); -} - -int CEF_CALLBACK domnode_is_form_control_element(struct _cef_domnode_t* self) -{ DCHECK(self); if (!self) return 0; - return CefDOMNodeCppToC::Get(self)->IsFormControlElement(); + // Execute + bool _retval = CefDOMNodeCppToC::Get(self)->IsText(); + + // Return type: bool + return _retval; } + +int CEF_CALLBACK domnode_is_element(struct _cef_domnode_t* self) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + bool _retval = CefDOMNodeCppToC::Get(self)->IsElement(); + + // Return type: bool + return _retval; +} + + +int CEF_CALLBACK domnode_is_form_control_element(struct _cef_domnode_t* self) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + bool _retval = CefDOMNodeCppToC::Get(self)->IsFormControlElement(); + + // Return type: bool + return _retval; +} + + cef_string_userfree_t CEF_CALLBACK domnode_get_form_control_element_type( struct _cef_domnode_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return NULL; - CefString str = CefDOMNodeCppToC::Get(self)->GetFormControlElementType(); - return str.DetachToUserFree(); + // Execute + CefString _retval = CefDOMNodeCppToC::Get(self)->GetFormControlElementType(); + + // Return type: string + return _retval.DetachToUserFree(); } + int CEF_CALLBACK domnode_is_same(struct _cef_domnode_t* self, struct _cef_domnode_t* that) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: that; type: refptr_same DCHECK(that); - if (!self || !that) + if (!that) return 0; - return CefDOMNodeCppToC::Get(self)->IsSame(CefDOMNodeCppToC::Unwrap(that)); + // Execute + bool _retval = CefDOMNodeCppToC::Get(self)->IsSame( + CefDOMNodeCppToC::Unwrap(that)); + + // Return type: bool + return _retval; } + cef_string_userfree_t CEF_CALLBACK domnode_get_name(struct _cef_domnode_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefString str = CefDOMNodeCppToC::Get(self)->GetName(); - return str.DetachToUserFree(); + // Execute + CefString _retval = CefDOMNodeCppToC::Get(self)->GetName(); + + // Return type: string + return _retval.DetachToUserFree(); } + cef_string_userfree_t CEF_CALLBACK domnode_get_value( struct _cef_domnode_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefString str = CefDOMNodeCppToC::Get(self)->GetValue(); - return str.DetachToUserFree(); + // Execute + CefString _retval = CefDOMNodeCppToC::Get(self)->GetValue(); + + // Return type: string + return _retval.DetachToUserFree(); } + int CEF_CALLBACK domnode_set_value(struct _cef_domnode_t* self, const cef_string_t* value) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: value; type: string_byref_const DCHECK(value); - if(!self || !value) + if (!value) return 0; - return CefDOMNodeCppToC::Get(self)->SetValue(CefString(value)); + // Execute + bool _retval = CefDOMNodeCppToC::Get(self)->SetValue( + CefString(value)); + + // Return type: bool + return _retval; } + cef_string_userfree_t CEF_CALLBACK domnode_get_as_markup( struct _cef_domnode_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefString str = CefDOMNodeCppToC::Get(self)->GetAsMarkup(); - return str.DetachToUserFree(); + // Execute + CefString _retval = CefDOMNodeCppToC::Get(self)->GetAsMarkup(); + + // Return type: string + return _retval.DetachToUserFree(); } + cef_domdocument_t* CEF_CALLBACK domnode_get_document( struct _cef_domnode_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefRefPtr documentPtr = - CefDOMNodeCppToC::Get(self)->GetDocument(); - if(documentPtr.get()) - return CefDOMDocumentCppToC::Wrap(documentPtr); - return NULL; + // Execute + CefRefPtr _retval = CefDOMNodeCppToC::Get(self)->GetDocument( + ); + + // Return type: refptr_same + return CefDOMDocumentCppToC::Wrap(_retval); } + struct _cef_domnode_t* CEF_CALLBACK domnode_get_parent( struct _cef_domnode_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefRefPtr nodePtr = CefDOMNodeCppToC::Get(self)->GetParent(); - if(nodePtr.get()) - return CefDOMNodeCppToC::Wrap(nodePtr); - return NULL; + // Execute + CefRefPtr _retval = CefDOMNodeCppToC::Get(self)->GetParent(); + + // Return type: refptr_same + return CefDOMNodeCppToC::Wrap(_retval); } + struct _cef_domnode_t* CEF_CALLBACK domnode_get_previous_sibling( struct _cef_domnode_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefRefPtr nodePtr = - CefDOMNodeCppToC::Get(self)->GetPreviousSibling(); - if(nodePtr.get()) - return CefDOMNodeCppToC::Wrap(nodePtr); - return NULL; + // Execute + CefRefPtr _retval = CefDOMNodeCppToC::Get( + self)->GetPreviousSibling(); + + // Return type: refptr_same + return CefDOMNodeCppToC::Wrap(_retval); } + struct _cef_domnode_t* CEF_CALLBACK domnode_get_next_sibling( struct _cef_domnode_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefRefPtr nodePtr = CefDOMNodeCppToC::Get(self)->GetNextSibling(); - if(nodePtr.get()) - return CefDOMNodeCppToC::Wrap(nodePtr); - return NULL; + // Execute + CefRefPtr _retval = CefDOMNodeCppToC::Get(self)->GetNextSibling(); + + // Return type: refptr_same + return CefDOMNodeCppToC::Wrap(_retval); } + int CEF_CALLBACK domnode_has_children(struct _cef_domnode_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefDOMNodeCppToC::Get(self)->HasChildren(); + // Execute + bool _retval = CefDOMNodeCppToC::Get(self)->HasChildren(); + + // Return type: bool + return _retval; } + struct _cef_domnode_t* CEF_CALLBACK domnode_get_first_child( struct _cef_domnode_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefRefPtr nodePtr = CefDOMNodeCppToC::Get(self)->GetFirstChild(); - if(nodePtr.get()) - return CefDOMNodeCppToC::Wrap(nodePtr); - return NULL; + // Execute + CefRefPtr _retval = CefDOMNodeCppToC::Get(self)->GetFirstChild(); + + // Return type: refptr_same + return CefDOMNodeCppToC::Wrap(_retval); } + struct _cef_domnode_t* CEF_CALLBACK domnode_get_last_child( struct _cef_domnode_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefRefPtr nodePtr = CefDOMNodeCppToC::Get(self)->GetLastChild(); - if(nodePtr.get()) - return CefDOMNodeCppToC::Wrap(nodePtr); - return NULL; + // Execute + CefRefPtr _retval = CefDOMNodeCppToC::Get(self)->GetLastChild(); + + // Return type: refptr_same + return CefDOMNodeCppToC::Wrap(_retval); } + void CEF_CALLBACK domnode_add_event_listener(struct _cef_domnode_t* self, const cef_string_t* eventType, struct _cef_domevent_listener_t* listener, int useCapture) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: eventType; type: string_byref_const DCHECK(eventType); + if (!eventType) + return; + // Verify param: listener; type: refptr_diff DCHECK(listener); - if(!self || !eventType || !listener) + if (!listener) return; - CefDOMNodeCppToC::Get(self)->AddEventListener(CefString(eventType), - CefDOMEventListenerCToCpp::Wrap(listener), useCapture?true:false); + // Execute + CefDOMNodeCppToC::Get(self)->AddEventListener( + CefString(eventType), + CefDOMEventListenerCToCpp::Wrap(listener), + useCapture?true:false); } + cef_string_userfree_t CEF_CALLBACK domnode_get_element_tag_name( struct _cef_domnode_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefString str = CefDOMNodeCppToC::Get(self)->GetElementTagName(); - return str.DetachToUserFree(); + // Execute + CefString _retval = CefDOMNodeCppToC::Get(self)->GetElementTagName(); + + // Return type: string + return _retval.DetachToUserFree(); } + int CEF_CALLBACK domnode_has_element_attributes(struct _cef_domnode_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefDOMNodeCppToC::Get(self)->HasElementAttributes(); + // Execute + bool _retval = CefDOMNodeCppToC::Get(self)->HasElementAttributes(); + + // Return type: bool + return _retval; } + int CEF_CALLBACK domnode_has_element_attribute(struct _cef_domnode_t* self, const cef_string_t* attrName) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: attrName; type: string_byref_const DCHECK(attrName); - if(!self || !attrName) + if (!attrName) return 0; - return CefDOMNodeCppToC::Get(self)->HasElementAttribute(CefString(attrName)); + // Execute + bool _retval = CefDOMNodeCppToC::Get(self)->HasElementAttribute( + CefString(attrName)); + + // Return type: bool + return _retval; } + cef_string_userfree_t CEF_CALLBACK domnode_get_element_attribute( struct _cef_domnode_t* self, const cef_string_t* attrName) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return NULL; + // Verify param: attrName; type: string_byref_const DCHECK(attrName); - if(!self || !attrName) + if (!attrName) return NULL; - CefString str = - CefDOMNodeCppToC::Get(self)->GetElementAttribute(CefString(attrName)); - return str.DetachToUserFree(); + // Execute + CefString _retval = CefDOMNodeCppToC::Get(self)->GetElementAttribute( + CefString(attrName)); + + // Return type: string + return _retval.DetachToUserFree(); } + void CEF_CALLBACK domnode_get_element_attributes(struct _cef_domnode_t* self, cef_string_map_t attrMap) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) + return; + // Verify param: attrMap; type: string_map_single_byref + DCHECK(attrMap); + if (!attrMap) return; - CefDOMNode::AttributeMap map; - CefDOMNodeCppToC::Get(self)->GetElementAttributes(map); - transfer_string_map_contents(map, attrMap); + // Translate param: attrMap; type: string_map_single_byref + std::map attrMapMap; + transfer_string_map_contents(attrMap, attrMapMap); + + // Execute + CefDOMNodeCppToC::Get(self)->GetElementAttributes( + attrMapMap); + + // Restore param: attrMap; type: string_map_single_byref + cef_string_map_clear(attrMap); + transfer_string_map_contents(attrMapMap, attrMap); } + int CEF_CALLBACK domnode_set_element_attribute(struct _cef_domnode_t* self, const cef_string_t* attrName, const cef_string_t* value) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: attrName; type: string_byref_const DCHECK(attrName); + if (!attrName) + return 0; + // Verify param: value; type: string_byref_const DCHECK(value); - if(!self || !attrName || !value) + if (!value) return 0; - return CefDOMNodeCppToC::Get(self)->SetElementAttribute(CefString(attrName), + // Execute + bool _retval = CefDOMNodeCppToC::Get(self)->SetElementAttribute( + CefString(attrName), CefString(value)); + + // Return type: bool + return _retval; } + cef_string_userfree_t CEF_CALLBACK domnode_get_element_inner_text( struct _cef_domnode_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefString str = CefDOMNodeCppToC::Get(self)->GetElementInnerText(); - return str.DetachToUserFree(); + // Execute + CefString _retval = CefDOMNodeCppToC::Get(self)->GetElementInnerText(); + + // Return type: string + return _retval.DetachToUserFree(); } + // CONSTRUCTOR - Do not edit by hand. CefDOMNodeCppToC::CefDOMNodeCppToC(CefDOMNode* cls) diff --git a/libcef_dll/cpptoc/domnode_cpptoc.h b/libcef_dll/cpptoc/domnode_cpptoc.h index 3b2c65f61..707f26fa1 100644 --- a/libcef_dll/cpptoc/domnode_cpptoc.h +++ b/libcef_dll/cpptoc/domnode_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _DOMNODE_CPPTOC_H #define _DOMNODE_CPPTOC_H diff --git a/libcef_dll/cpptoc/domvisitor_cpptoc.cc b/libcef_dll/cpptoc/domvisitor_cpptoc.cc index e24fad77d..4133665a0 100644 --- a/libcef_dll/cpptoc/domvisitor_cpptoc.cc +++ b/libcef_dll/cpptoc/domvisitor_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -19,18 +19,23 @@ void CEF_CALLBACK domvisitor_visit(struct _cef_domvisitor_t* self, struct _cef_domdocument_t* document) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) + return; + // Verify param: document; type: refptr_diff + DCHECK(document); + if (!document) return; - CefRefPtr documentPtr; - if (document) - documentPtr = CefDOMDocumentCToCpp::Wrap(document); - - CefDOMVisitorCppToC::Get(self)->Visit(documentPtr); + // Execute + CefDOMVisitorCppToC::Get(self)->Visit( + CefDOMDocumentCToCpp::Wrap(document)); } + // CONSTRUCTOR - Do not edit by hand. CefDOMVisitorCppToC::CefDOMVisitorCppToC(CefDOMVisitor* cls) diff --git a/libcef_dll/cpptoc/domvisitor_cpptoc.h b/libcef_dll/cpptoc/domvisitor_cpptoc.h index 800284377..86c937ec0 100644 --- a/libcef_dll/cpptoc/domvisitor_cpptoc.h +++ b/libcef_dll/cpptoc/domvisitor_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _DOMVISITOR_CPPTOC_H #define _DOMVISITOR_CPPTOC_H diff --git a/libcef_dll/cpptoc/download_handler_cpptoc.cc b/libcef_dll/cpptoc/download_handler_cpptoc.cc index ec135f9fc..61152dddc 100644 --- a/libcef_dll/cpptoc/download_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/download_handler_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -18,24 +18,41 @@ int CEF_CALLBACK download_handler_received_data( struct _cef_download_handler_t* self, void* data, int data_size) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) + return 0; + // Verify param: data; type: simple_byaddr + DCHECK(data); + if (!data) return 0; - return CefDownloadHandlerCppToC::Get(self)->ReceivedData(data, data_size); + // Execute + bool _retval = CefDownloadHandlerCppToC::Get(self)->ReceivedData( + data, + data_size); + + // Return type: bool + return _retval; } + void CEF_CALLBACK download_handler_complete( struct _cef_download_handler_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; + // Execute CefDownloadHandlerCppToC::Get(self)->Complete(); } + // CONSTRUCTOR - Do not edit by hand. CefDownloadHandlerCppToC::CefDownloadHandlerCppToC(CefDownloadHandler* cls) diff --git a/libcef_dll/cpptoc/download_handler_cpptoc.h b/libcef_dll/cpptoc/download_handler_cpptoc.h index 04e8c9a1d..afb0cde81 100644 --- a/libcef_dll/cpptoc/download_handler_cpptoc.h +++ b/libcef_dll/cpptoc/download_handler_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _DOWNLOADHANDLER_CPPTOC_H #define _DOWNLOADHANDLER_CPPTOC_H diff --git a/libcef_dll/cpptoc/drag_data_cpptoc.cc b/libcef_dll/cpptoc/drag_data_cpptoc.cc index 1aa09af03..0db410f3f 100644 --- a/libcef_dll/cpptoc/drag_data_cpptoc.cc +++ b/libcef_dll/cpptoc/drag_data_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -18,136 +18,219 @@ int CEF_CALLBACK drag_data_is_link(struct _cef_drag_data_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return 0; - return CefDragDataCppToC::Get(self)->IsLink(); + // Execute + bool _retval = CefDragDataCppToC::Get(self)->IsLink(); + + // Return type: bool + return _retval; } + int CEF_CALLBACK drag_data_is_fragment(struct _cef_drag_data_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return 0; - return CefDragDataCppToC::Get(self)->IsFragment(); + // Execute + bool _retval = CefDragDataCppToC::Get(self)->IsFragment(); + + // Return type: bool + return _retval; } + int CEF_CALLBACK drag_data_is_file(struct _cef_drag_data_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return 0; - return CefDragDataCppToC::Get(self)->IsFile(); + // Execute + bool _retval = CefDragDataCppToC::Get(self)->IsFile(); + + // Return type: bool + return _retval; } + cef_string_userfree_t CEF_CALLBACK drag_data_get_link_url( struct _cef_drag_data_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return NULL; - CefString str = CefDragDataCppToC::Get(self)->GetLinkURL(); - return str.DetachToUserFree(); + // Execute + CefString _retval = CefDragDataCppToC::Get(self)->GetLinkURL(); + + // Return type: string + return _retval.DetachToUserFree(); } + cef_string_userfree_t CEF_CALLBACK drag_data_get_link_title( struct _cef_drag_data_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return NULL; - CefString str = CefDragDataCppToC::Get(self)->GetLinkTitle(); - return str.DetachToUserFree(); + // Execute + CefString _retval = CefDragDataCppToC::Get(self)->GetLinkTitle(); + + // Return type: string + return _retval.DetachToUserFree(); } + cef_string_userfree_t CEF_CALLBACK drag_data_get_link_metadata( struct _cef_drag_data_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return NULL; - CefString str = CefDragDataCppToC::Get(self)->GetLinkMetadata(); - return str.DetachToUserFree(); + // Execute + CefString _retval = CefDragDataCppToC::Get(self)->GetLinkMetadata(); + + // Return type: string + return _retval.DetachToUserFree(); } + cef_string_userfree_t CEF_CALLBACK drag_data_get_fragment_text( struct _cef_drag_data_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return NULL; - CefString str = CefDragDataCppToC::Get(self)->GetFragmentText(); - return str.DetachToUserFree(); + // Execute + CefString _retval = CefDragDataCppToC::Get(self)->GetFragmentText(); + + // Return type: string + return _retval.DetachToUserFree(); } + cef_string_userfree_t CEF_CALLBACK drag_data_get_fragment_html( struct _cef_drag_data_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return NULL; - CefString str = CefDragDataCppToC::Get(self)->GetFragmentHtml(); - return str.DetachToUserFree(); + // Execute + CefString _retval = CefDragDataCppToC::Get(self)->GetFragmentHtml(); + + // Return type: string + return _retval.DetachToUserFree(); } + cef_string_userfree_t CEF_CALLBACK drag_data_get_fragment_base_url( struct _cef_drag_data_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return NULL; - CefString str = CefDragDataCppToC::Get(self)->GetFragmentBaseURL(); - return str.DetachToUserFree(); + // Execute + CefString _retval = CefDragDataCppToC::Get(self)->GetFragmentBaseURL(); + + // Return type: string + return _retval.DetachToUserFree(); } + cef_string_userfree_t CEF_CALLBACK drag_data_get_file_extension( struct _cef_drag_data_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return NULL; - CefString str = CefDragDataCppToC::Get(self)->GetFileExtension(); - return str.DetachToUserFree(); + // Execute + CefString _retval = CefDragDataCppToC::Get(self)->GetFileExtension(); + + // Return type: string + return _retval.DetachToUserFree(); } + cef_string_userfree_t CEF_CALLBACK drag_data_get_file_name( struct _cef_drag_data_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return NULL; - CefString str = CefDragDataCppToC::Get(self)->GetFileName(); - return str.DetachToUserFree(); + // Execute + CefString _retval = CefDragDataCppToC::Get(self)->GetFileName(); + + // Return type: string + return _retval.DetachToUserFree(); } + int CEF_CALLBACK drag_data_get_file_names(struct _cef_drag_data_t* self, cef_string_list_t names) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return 0; + // Verify param: names; type: string_vec_byref + DCHECK(names); + if (!names) + return 0; - StringList file_names; - if (CefDragDataCppToC::Get(self)->GetFileNames(file_names)) { - transfer_string_list_contents(file_names, names); - return 1; - } + // Translate param: names; type: string_vec_byref + std::vector namesList; + transfer_string_list_contents(names, namesList); - return 0; + // Execute + bool _retval = CefDragDataCppToC::Get(self)->GetFileNames( + namesList); + + // Restore param: names; type: string_vec_byref + cef_string_list_clear(names); + transfer_string_list_contents(namesList, names); + + // Return type: bool + return _retval; } + // CONSTRUCTOR - Do not edit by hand. CefDragDataCppToC::CefDragDataCppToC(CefDragData* cls) diff --git a/libcef_dll/cpptoc/drag_data_cpptoc.h b/libcef_dll/cpptoc/drag_data_cpptoc.h index 24fe84fd0..b053eac51 100644 --- a/libcef_dll/cpptoc/drag_data_cpptoc.h +++ b/libcef_dll/cpptoc/drag_data_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _DRAGDATA_CPPTOC_H #define _DRAGDATA_CPPTOC_H diff --git a/libcef_dll/cpptoc/drag_handler_cpptoc.cc b/libcef_dll/cpptoc/drag_handler_cpptoc.cc index 406b6c9d7..e36e94ada 100644 --- a/libcef_dll/cpptoc/drag_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/drag_handler_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -21,31 +21,61 @@ int CEF_CALLBACK drag_handler_on_drag_start(struct _cef_drag_handler_t* self, cef_browser_t* browser, struct _cef_drag_data_t* dragData, enum cef_drag_operations_mask_t mask) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff DCHECK(browser); + if (!browser) + return 0; + // Verify param: dragData; type: refptr_diff DCHECK(dragData); - if (!self || !browser || !dragData) + if (!dragData) return 0; - return CefDragHandlerCppToC::Get(self)->OnDragStart( - CefBrowserCToCpp::Wrap(browser), CefDragDataCToCpp::Wrap(dragData), mask); + // Execute + bool _retval = CefDragHandlerCppToC::Get(self)->OnDragStart( + CefBrowserCToCpp::Wrap(browser), + CefDragDataCToCpp::Wrap(dragData), + mask); + + // Return type: bool + return _retval; } + int CEF_CALLBACK drag_handler_on_drag_enter(struct _cef_drag_handler_t* self, cef_browser_t* browser, struct _cef_drag_data_t* dragData, enum cef_drag_operations_mask_t mask) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff DCHECK(browser); + if (!browser) + return 0; + // Verify param: dragData; type: refptr_diff DCHECK(dragData); - if (!self || !browser || !dragData) + if (!dragData) return 0; - return CefDragHandlerCppToC::Get(self)->OnDragEnter( - CefBrowserCToCpp::Wrap(browser), CefDragDataCToCpp::Wrap(dragData), mask); + // Execute + bool _retval = CefDragHandlerCppToC::Get(self)->OnDragEnter( + CefBrowserCToCpp::Wrap(browser), + CefDragDataCToCpp::Wrap(dragData), + mask); + + // Return type: bool + return _retval; } + // CONSTRUCTOR - Do not edit by hand. CefDragHandlerCppToC::CefDragHandlerCppToC(CefDragHandler* cls) diff --git a/libcef_dll/cpptoc/drag_handler_cpptoc.h b/libcef_dll/cpptoc/drag_handler_cpptoc.h index 14f4a8792..cb42b2439 100644 --- a/libcef_dll/cpptoc/drag_handler_cpptoc.h +++ b/libcef_dll/cpptoc/drag_handler_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _DRAGHANDLER_CPPTOC_H #define _DRAGHANDLER_CPPTOC_H diff --git a/libcef_dll/cpptoc/find_handler_cpptoc.cc b/libcef_dll/cpptoc/find_handler_cpptoc.cc index eff968a2b..1b562a62a 100644 --- a/libcef_dll/cpptoc/find_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/find_handler_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -20,19 +20,35 @@ void CEF_CALLBACK find_handler_on_find_result(struct _cef_find_handler_t* self, cef_browser_t* browser, int identifier, int count, const cef_rect_t* selectionRect, int activeMatchOrdinal, int finalUpdate) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff DCHECK(browser); + if (!browser) + return; + // Verify param: selectionRect; type: simple_byref_const DCHECK(selectionRect); - if (!self || !browser || !selectionRect) + if (!selectionRect) return; - CefRect rect(*selectionRect); + // Translate param: selectionRect; type: simple_byref_const + CefRect selectionRectVal = selectionRect?*selectionRect:CefRect(); + + // Execute CefFindHandlerCppToC::Get(self)->OnFindResult( - CefBrowserCToCpp::Wrap(browser), identifier, count, rect, - activeMatchOrdinal, finalUpdate?true:false); + CefBrowserCToCpp::Wrap(browser), + identifier, + count, + selectionRectVal, + activeMatchOrdinal, + finalUpdate?true:false); } + // CONSTRUCTOR - Do not edit by hand. CefFindHandlerCppToC::CefFindHandlerCppToC(CefFindHandler* cls) diff --git a/libcef_dll/cpptoc/find_handler_cpptoc.h b/libcef_dll/cpptoc/find_handler_cpptoc.h index 898bba1ae..0d5f90601 100644 --- a/libcef_dll/cpptoc/find_handler_cpptoc.h +++ b/libcef_dll/cpptoc/find_handler_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _FINDHANDLER_CPPTOC_H #define _FINDHANDLER_CPPTOC_H diff --git a/libcef_dll/cpptoc/focus_handler_cpptoc.cc b/libcef_dll/cpptoc/focus_handler_cpptoc.cc index 55799aea3..4358486eb 100644 --- a/libcef_dll/cpptoc/focus_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/focus_handler_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -21,43 +21,70 @@ void CEF_CALLBACK focus_handler_on_take_focus(struct _cef_focus_handler_t* self, cef_browser_t* browser, int next) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff DCHECK(browser); - if (!self || !browser) + if (!browser) return; + // Execute CefFocusHandlerCppToC::Get(self)->OnTakeFocus( - CefBrowserCToCpp::Wrap(browser), next?true:false); + CefBrowserCToCpp::Wrap(browser), + next?true:false); } + int CEF_CALLBACK focus_handler_on_set_focus(struct _cef_focus_handler_t* self, cef_browser_t* browser, enum cef_handler_focus_source_t source) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff DCHECK(browser); - if (!self || !browser) + if (!browser) return 0; - return CefFocusHandlerCppToC::Get(self)->OnSetFocus( - CefBrowserCToCpp::Wrap(browser), source); + // Execute + bool _retval = CefFocusHandlerCppToC::Get(self)->OnSetFocus( + CefBrowserCToCpp::Wrap(browser), + source); + + // Return type: bool + return _retval; } + void CEF_CALLBACK focus_handler_on_focused_node_changed( struct _cef_focus_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, struct _cef_domnode_t* node) { - DCHECK(self); - DCHECK(browser); - DCHECK(frame); - if (!self || !browser || !frame) - return; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return CefFocusHandlerCppToC::Get(self)->OnFocusedNodeChanged( - CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + // Unverified params: frame, node + + // Execute + CefFocusHandlerCppToC::Get(self)->OnFocusedNodeChanged( + CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame), CefDOMNodeCToCpp::Wrap(node)); } + // CONSTRUCTOR - Do not edit by hand. CefFocusHandlerCppToC::CefFocusHandlerCppToC(CefFocusHandler* cls) diff --git a/libcef_dll/cpptoc/focus_handler_cpptoc.h b/libcef_dll/cpptoc/focus_handler_cpptoc.h index 2f3259453..377b3ad6e 100644 --- a/libcef_dll/cpptoc/focus_handler_cpptoc.h +++ b/libcef_dll/cpptoc/focus_handler_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _FOCUSHANDLER_CPPTOC_H #define _FOCUSHANDLER_CPPTOC_H diff --git a/libcef_dll/cpptoc/frame_cpptoc.cc b/libcef_dll/cpptoc/frame_cpptoc.cc index bc7789f44..4de699a94 100644 --- a/libcef_dll/cpptoc/frame_cpptoc.cc +++ b/libcef_dll/cpptoc/frame_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -22,238 +22,378 @@ void CEF_CALLBACK frame_undo(struct _cef_frame_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; + // Execute CefFrameCppToC::Get(self)->Undo(); } + void CEF_CALLBACK frame_redo(struct _cef_frame_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; + // Execute CefFrameCppToC::Get(self)->Redo(); } + void CEF_CALLBACK frame_cut(struct _cef_frame_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; + // Execute CefFrameCppToC::Get(self)->Cut(); } + void CEF_CALLBACK frame_copy(struct _cef_frame_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; + // Execute CefFrameCppToC::Get(self)->Copy(); } + void CEF_CALLBACK frame_paste(struct _cef_frame_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; + // Execute CefFrameCppToC::Get(self)->Paste(); } + void CEF_CALLBACK frame_del(struct _cef_frame_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; + // Execute CefFrameCppToC::Get(self)->Delete(); } + void CEF_CALLBACK frame_select_all(struct _cef_frame_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; + // Execute CefFrameCppToC::Get(self)->SelectAll(); } + void CEF_CALLBACK frame_print(struct _cef_frame_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; + // Execute CefFrameCppToC::Get(self)->Print(); } + void CEF_CALLBACK frame_view_source(struct _cef_frame_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; + // Execute CefFrameCppToC::Get(self)->ViewSource(); } + cef_string_userfree_t CEF_CALLBACK frame_get_source(struct _cef_frame_t* self) { - DCHECK(self); - if(!self) - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - CefString sourceStr = CefFrameCppToC::Get(self)->GetSource(); - return sourceStr.DetachToUserFree(); -} - -cef_string_userfree_t CEF_CALLBACK frame_get_text(struct _cef_frame_t* self) -{ - DCHECK(self); - if(!self) - return NULL; - - CefString textStr = CefFrameCppToC::Get(self)->GetText(); - return textStr.DetachToUserFree(); -} - -void CEF_CALLBACK frame_load_request(struct _cef_frame_t* self, - struct _cef_request_t* request) -{ - DCHECK(self); - DCHECK(request); - if(!self || !request) - return; - - CefRefPtr requestPtr = CefRequestCppToC::Unwrap(request); - CefFrameCppToC::Get(self)->LoadRequest(requestPtr); -} - -void CEF_CALLBACK frame_load_url(struct _cef_frame_t* self, - const cef_string_t* url) -{ - DCHECK(self); - if(!self) - return; - - CefFrameCppToC::Get(self)->LoadURL(CefString(url)); -} - -void CEF_CALLBACK frame_load_string(struct _cef_frame_t* self, - const cef_string_t* string, const cef_string_t* url) -{ - DCHECK(self); - if(!self) - return; - - CefFrameCppToC::Get(self)->LoadString(CefString(string), CefString(url)); -} - -void CEF_CALLBACK frame_load_stream(struct _cef_frame_t* self, - struct _cef_stream_reader_t* stream, const cef_string_t* url) -{ - DCHECK(self); - DCHECK(stream); - if(!self || !stream) - return; - - CefFrameCppToC::Get(self)->LoadStream(CefStreamReaderCppToC::Unwrap(stream), - CefString(url)); -} - -void CEF_CALLBACK frame_execute_java_script(struct _cef_frame_t* self, - const cef_string_t* jsCode, const cef_string_t* scriptUrl, int startLine) -{ - DCHECK(self); - if(!self) - return; - - CefFrameCppToC::Get(self)->ExecuteJavaScript(CefString(jsCode), - CefString(scriptUrl), startLine); -} - -int CEF_CALLBACK frame_is_main(struct _cef_frame_t* self) -{ - DCHECK(self); - if(!self) - return 0; - - return CefFrameCppToC::Get(self)->IsMain(); -} - -int CEF_CALLBACK frame_is_focused(struct _cef_frame_t* self) -{ - DCHECK(self); - if(!self) - return 0; - - return CefFrameCppToC::Get(self)->IsFocused(); -} - -cef_string_userfree_t CEF_CALLBACK frame_get_name(struct _cef_frame_t* self) -{ - DCHECK(self); - if(!self) - return 0; - - CefString nameStr = CefFrameCppToC::Get(self)->GetName(); - return nameStr.DetachToUserFree(); -} - -cef_string_userfree_t CEF_CALLBACK frame_get_url(struct _cef_frame_t* self) -{ - DCHECK(self); - if(!self) - return NULL; - - CefString urlStr = CefFrameCppToC::Get(self)->GetURL(); - return urlStr.DetachToUserFree(); -} - -cef_browser_t* CEF_CALLBACK frame_get_browser(struct _cef_frame_t* self) -{ - DCHECK(self); - if(!self) - return NULL; - - CefRefPtr browserPtr = - CefFrameCppToC::Get(self)->GetBrowser(); - if(browserPtr.get()) - return CefBrowserCppToC::Wrap(browserPtr); - return NULL; -} - -void CEF_CALLBACK frame_visit_dom(struct _cef_frame_t* self, - struct _cef_domvisitor_t* visitor) -{ - DCHECK(self); - DCHECK(visitor); - if(!self || !visitor) - return; - - CefFrameCppToC::Get(self)->VisitDOM(CefDOMVisitorCToCpp::Wrap(visitor)); -} - -struct _cef_v8context_t* CEF_CALLBACK frame_get_v8context( - struct _cef_frame_t* self) -{ DCHECK(self); if (!self) return NULL; - CefRefPtr framePtr = CefFrameCppToC::Get(self); - CefRefPtr v8ContextPtr = framePtr->GetV8Context(); - if (v8ContextPtr.get()) - return CefV8ContextCppToC::Wrap(v8ContextPtr); + // Execute + CefString _retval = CefFrameCppToC::Get(self)->GetSource(); - return NULL; + // Return type: string + return _retval.DetachToUserFree(); } +cef_string_userfree_t CEF_CALLBACK frame_get_text(struct _cef_frame_t* self) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + + // Execute + CefString _retval = CefFrameCppToC::Get(self)->GetText(); + + // Return type: string + return _retval.DetachToUserFree(); +} + + +void CEF_CALLBACK frame_load_request(struct _cef_frame_t* self, + struct _cef_request_t* request) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: request; type: refptr_same + DCHECK(request); + if (!request) + return; + + // Execute + CefFrameCppToC::Get(self)->LoadRequest( + CefRequestCppToC::Unwrap(request)); +} + + +void CEF_CALLBACK frame_load_url(struct _cef_frame_t* self, + const cef_string_t* url) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: url; type: string_byref_const + DCHECK(url); + if (!url) + return; + + // Execute + CefFrameCppToC::Get(self)->LoadURL( + CefString(url)); +} + + +void CEF_CALLBACK frame_load_string(struct _cef_frame_t* self, + const cef_string_t* string, const cef_string_t* url) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: string; type: string_byref_const + DCHECK(string); + if (!string) + return; + // Verify param: url; type: string_byref_const + DCHECK(url); + if (!url) + return; + + // Execute + CefFrameCppToC::Get(self)->LoadString( + CefString(string), + CefString(url)); +} + + +void CEF_CALLBACK frame_load_stream(struct _cef_frame_t* self, + struct _cef_stream_reader_t* stream, const cef_string_t* url) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: stream; type: refptr_same + DCHECK(stream); + if (!stream) + return; + // Verify param: url; type: string_byref_const + DCHECK(url); + if (!url) + return; + + // Execute + CefFrameCppToC::Get(self)->LoadStream( + CefStreamReaderCppToC::Unwrap(stream), + CefString(url)); +} + + +void CEF_CALLBACK frame_execute_java_script(struct _cef_frame_t* self, + const cef_string_t* jsCode, const cef_string_t* scriptUrl, int startLine) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: jsCode; type: string_byref_const + DCHECK(jsCode); + if (!jsCode) + return; + // Unverified params: scriptUrl + + // Execute + CefFrameCppToC::Get(self)->ExecuteJavaScript( + CefString(jsCode), + CefString(scriptUrl), + startLine); +} + + +int CEF_CALLBACK frame_is_main(struct _cef_frame_t* self) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + bool _retval = CefFrameCppToC::Get(self)->IsMain(); + + // Return type: bool + return _retval; +} + + +int CEF_CALLBACK frame_is_focused(struct _cef_frame_t* self) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + bool _retval = CefFrameCppToC::Get(self)->IsFocused(); + + // Return type: bool + return _retval; +} + + +cef_string_userfree_t CEF_CALLBACK frame_get_name(struct _cef_frame_t* self) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + + // Execute + CefString _retval = CefFrameCppToC::Get(self)->GetName(); + + // Return type: string + return _retval.DetachToUserFree(); +} + + +cef_string_userfree_t CEF_CALLBACK frame_get_url(struct _cef_frame_t* self) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + + // Execute + CefString _retval = CefFrameCppToC::Get(self)->GetURL(); + + // Return type: string + return _retval.DetachToUserFree(); +} + + +cef_browser_t* CEF_CALLBACK frame_get_browser(struct _cef_frame_t* self) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + + // Execute + CefRefPtr _retval = CefFrameCppToC::Get(self)->GetBrowser(); + + // Return type: refptr_same + return CefBrowserCppToC::Wrap(_retval); +} + + +void CEF_CALLBACK frame_visit_dom(struct _cef_frame_t* self, + struct _cef_domvisitor_t* visitor) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: visitor; type: refptr_diff + DCHECK(visitor); + if (!visitor) + return; + + // Execute + CefFrameCppToC::Get(self)->VisitDOM( + CefDOMVisitorCToCpp::Wrap(visitor)); +} + + +struct _cef_v8context_t* CEF_CALLBACK frame_get_v8context( + struct _cef_frame_t* self) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + + // Execute + CefRefPtr _retval = CefFrameCppToC::Get(self)->GetV8Context(); + + // Return type: refptr_same + return CefV8ContextCppToC::Wrap(_retval); +} + + + // CONSTRUCTOR - Do not edit by hand. CefFrameCppToC::CefFrameCppToC(CefFrame* cls) diff --git a/libcef_dll/cpptoc/frame_cpptoc.h b/libcef_dll/cpptoc/frame_cpptoc.h index 270227420..1992f5e7a 100644 --- a/libcef_dll/cpptoc/frame_cpptoc.h +++ b/libcef_dll/cpptoc/frame_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _FRAME_CPPTOC_H #define _FRAME_CPPTOC_H diff --git a/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc b/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc index 22bff7797..cce925780 100644 --- a/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -21,66 +21,139 @@ int CEF_CALLBACK jsdialog_handler_on_jsalert( struct _cef_jsdialog_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, const cef_string_t* message) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff DCHECK(browser); + if (!browser) + return 0; + // Verify param: frame; type: refptr_diff DCHECK(frame); + if (!frame) + return 0; + // Verify param: message; type: string_byref_const DCHECK(message); - if (!self || !browser || !frame || !message) + if (!message) return 0; - return CefJSDialogHandlerCppToC::Get(self)->OnJSAlert( - CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), + // Execute + bool _retval = CefJSDialogHandlerCppToC::Get(self)->OnJSAlert( + CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame), CefString(message)); + + // Return type: bool + return _retval; } + int CEF_CALLBACK jsdialog_handler_on_jsconfirm( struct _cef_jsdialog_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, const cef_string_t* message, int* retval) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff DCHECK(browser); + if (!browser) + return 0; + // Verify param: frame; type: refptr_diff DCHECK(frame); + if (!frame) + return 0; + // Verify param: message; type: string_byref_const DCHECK(message); + if (!message) + return 0; + // Verify param: retval; type: bool_byref DCHECK(retval); - if (!self || !browser || !frame || !message || !retval) + if (!retval) return 0; - bool ret = false; - int rv = CefJSDialogHandlerCppToC::Get(self)->OnJSConfirm( - CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), - CefString(message), ret); - *retval = (ret ? 1 : 0); + // Translate param: retval; type: bool_byref + bool retvalBool = (retval && *retval)?true:false; - return rv; + // Execute + bool _retval = CefJSDialogHandlerCppToC::Get(self)->OnJSConfirm( + CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame), + CefString(message), + retvalBool); + + // Restore param: retval; type: bool_byref + if (retval) + *retval = retvalBool?true:false; + + // Return type: bool + return _retval; } + int CEF_CALLBACK jsdialog_handler_on_jsprompt( struct _cef_jsdialog_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, const cef_string_t* message, const cef_string_t* defaultValue, int* retval, cef_string_t* result) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff DCHECK(browser); + if (!browser) + return 0; + // Verify param: frame; type: refptr_diff DCHECK(frame); + if (!frame) + return 0; + // Verify param: message; type: string_byref_const DCHECK(message); + if (!message) + return 0; + // Verify param: defaultValue; type: string_byref_const DCHECK(defaultValue); + if (!defaultValue) + return 0; + // Verify param: retval; type: bool_byref DCHECK(retval); + if (!retval) + return 0; + // Verify param: result; type: string_byref DCHECK(result); - if (!self || !browser || !frame || !message || !defaultValue || !retval || - !result) + if (!result) return 0; - bool ret = false; + // Translate param: retval; type: bool_byref + bool retvalBool = (retval && *retval)?true:false; + // Translate param: result; type: string_byref CefString resultStr(result); - int rv = CefJSDialogHandlerCppToC::Get(self)->OnJSPrompt( - CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), - CefString(message), CefString(defaultValue), ret, resultStr); - *retval = (ret ? 1 : 0); - return rv; + // Execute + bool _retval = CefJSDialogHandlerCppToC::Get(self)->OnJSPrompt( + CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame), + CefString(message), + CefString(defaultValue), + retvalBool, + resultStr); + + // Restore param: retval; type: bool_byref + if (retval) + *retval = retvalBool?true:false; + + // Return type: bool + return _retval; } + // CONSTRUCTOR - Do not edit by hand. CefJSDialogHandlerCppToC::CefJSDialogHandlerCppToC(CefJSDialogHandler* cls) diff --git a/libcef_dll/cpptoc/jsdialog_handler_cpptoc.h b/libcef_dll/cpptoc/jsdialog_handler_cpptoc.h index 03e533faa..a1fdb66f3 100644 --- a/libcef_dll/cpptoc/jsdialog_handler_cpptoc.h +++ b/libcef_dll/cpptoc/jsdialog_handler_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _JSDIALOGHANDLER_CPPTOC_H #define _JSDIALOGHANDLER_CPPTOC_H diff --git a/libcef_dll/cpptoc/keyboard_handler_cpptoc.cc b/libcef_dll/cpptoc/keyboard_handler_cpptoc.cc index 1fcdae8ae..ad2e6f340 100644 --- a/libcef_dll/cpptoc/keyboard_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/keyboard_handler_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -21,17 +21,31 @@ int CEF_CALLBACK keyboard_handler_on_key_event( enum cef_handler_keyevent_type_t type, int code, int modifiers, int isSystemKey, int isAfterJavaScript) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff DCHECK(browser); - if (!self || !browser) + if (!browser) return 0; - return CefKeyboardHandlerCppToC::Get(self)->OnKeyEvent( - CefBrowserCToCpp::Wrap(browser), type, code, - modifiers, isSystemKey?true:false, isAfterJavaScript?true:false); + // Execute + bool _retval = CefKeyboardHandlerCppToC::Get(self)->OnKeyEvent( + CefBrowserCToCpp::Wrap(browser), + type, + code, + modifiers, + isSystemKey?true:false, + isAfterJavaScript?true:false); + + // Return type: bool + return _retval; } + // CONSTRUCTOR - Do not edit by hand. CefKeyboardHandlerCppToC::CefKeyboardHandlerCppToC(CefKeyboardHandler* cls) diff --git a/libcef_dll/cpptoc/keyboard_handler_cpptoc.h b/libcef_dll/cpptoc/keyboard_handler_cpptoc.h index 28b635bdc..0d1dbc3b4 100644 --- a/libcef_dll/cpptoc/keyboard_handler_cpptoc.h +++ b/libcef_dll/cpptoc/keyboard_handler_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _KEYBOARDHANDLER_CPPTOC_H #define _KEYBOARDHANDLER_CPPTOC_H diff --git a/libcef_dll/cpptoc/life_span_handler_cpptoc.cc b/libcef_dll/cpptoc/life_span_handler_cpptoc.cc index 44fa27923..4d52e3796 100644 --- a/libcef_dll/cpptoc/life_span_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/life_span_handler_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -23,105 +23,168 @@ int CEF_CALLBACK life_span_handler_on_before_popup( cef_window_info_t* windowInfo, const cef_string_t* url, struct _cef_client_t** client, struct _cef_browser_settings_t* settings) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: parentBrowser; type: refptr_diff DCHECK(parentBrowser); + if (!parentBrowser) + return 0; + // Verify param: popupFeatures; type: struct_byref_const DCHECK(popupFeatures); + if (!popupFeatures) + return 0; + // Verify param: windowInfo; type: struct_byref DCHECK(windowInfo); + if (!windowInfo) + return 0; + // Verify param: url; type: string_byref_const + DCHECK(url); + if (!url) + return 0; + // Verify param: client; type: refptr_same_byref DCHECK(client); + if (!client) + return 0; + // Verify param: settings; type: struct_byref DCHECK(settings); - if (!self || !parentBrowser || !popupFeatures || !windowInfo || !client || - !settings) + if (!settings) return 0; - CefWindowInfo wndInfo; - CefBrowserSettings browserSettings; - CefPopupFeatures features; - - // Take ownership of the values. - wndInfo.AttachTo(*windowInfo); - browserSettings.AttachTo(*settings); - - // Reference the existing values instead of copying. - features.Set(*popupFeatures, false); - - // |newHandler| will start off pointing to the current handler. + // Translate param: popupFeatures; type: struct_byref_const + CefPopupFeatures popupFeaturesObj; + if (popupFeatures) + popupFeaturesObj.Set(*popupFeatures, false); + // Translate param: windowInfo; type: struct_byref + CefWindowInfo windowInfoObj; + if (windowInfo) + windowInfoObj.AttachTo(*windowInfo); + // Translate param: client; type: refptr_same_byref CefRefPtr clientPtr; - if (*client) + if (client && *client) clientPtr = CefClientCppToC::Unwrap(*client); - CefClient* origClient = clientPtr.get(); + CefClient* clientOrig = clientPtr.get(); + // Translate param: settings; type: struct_byref + CefBrowserSettings settingsObj; + if (settings) + settingsObj.AttachTo(*settings); - // |parentBrowser| will be NULL if this is a top-level browser window. - CefRefPtr browserPtr(CefBrowserCToCpp::Wrap(parentBrowser)); + // Execute + bool _retval = CefLifeSpanHandlerCppToC::Get(self)->OnBeforePopup( + CefBrowserCToCpp::Wrap(parentBrowser), + popupFeaturesObj, + windowInfoObj, + CefString(url), + clientPtr, + settingsObj); - bool rv = CefLifeSpanHandlerCppToC::Get(self)->OnBeforePopup( - browserPtr, features, wndInfo, CefString(url), clientPtr, - browserSettings); - - if (clientPtr.get()) { - if (clientPtr.get() != origClient) { - // The handler has been changed. - *client = CefClientCppToC::Wrap(clientPtr); + // Restore param: windowInfo; type: struct_byref + if (windowInfo) + windowInfoObj.DetachTo(*windowInfo); + // Restore param: client; type: refptr_same_byref + if (client) { + if (clientPtr.get()) { + if (clientPtr.get() != clientOrig) { + *client = CefClientCppToC::Wrap(clientPtr); + } + } else { + *client = NULL; } - } else { - *client = NULL; } + // Restore param: settings; type: struct_byref + if (settings) + settingsObj.DetachTo(*settings); - // Return the values to the structures. - wndInfo.DetachTo(*windowInfo); - browserSettings.DetachTo(*settings); - - return rv; + // Return type: bool + return _retval; } + void CEF_CALLBACK life_span_handler_on_after_created( struct _cef_life_span_handler_t* self, cef_browser_t* browser) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff DCHECK(browser); - if (!self || !browser) + if (!browser) return; + // Execute CefLifeSpanHandlerCppToC::Get(self)->OnAfterCreated( CefBrowserCToCpp::Wrap(browser)); } + int CEF_CALLBACK life_span_handler_run_modal( struct _cef_life_span_handler_t* self, cef_browser_t* browser) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff DCHECK(browser); - if (!self || !browser) + if (!browser) return 0; - return CefLifeSpanHandlerCppToC::Get(self)->RunModal( + // Execute + bool _retval = CefLifeSpanHandlerCppToC::Get(self)->RunModal( CefBrowserCToCpp::Wrap(browser)); + + // Return type: bool + return _retval; } + int CEF_CALLBACK life_span_handler_do_close( struct _cef_life_span_handler_t* self, cef_browser_t* browser) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff DCHECK(browser); - if (!self || !browser) + if (!browser) return 0; - return CefLifeSpanHandlerCppToC::Get(self)->DoClose( + // Execute + bool _retval = CefLifeSpanHandlerCppToC::Get(self)->DoClose( CefBrowserCToCpp::Wrap(browser)); + + // Return type: bool + return _retval; } + void CEF_CALLBACK life_span_handler_on_before_close( struct _cef_life_span_handler_t* self, cef_browser_t* browser) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff DCHECK(browser); - if (!self || !browser) + if (!browser) return; + // Execute CefLifeSpanHandlerCppToC::Get(self)->OnBeforeClose( CefBrowserCToCpp::Wrap(browser)); } + // CONSTRUCTOR - Do not edit by hand. CefLifeSpanHandlerCppToC::CefLifeSpanHandlerCppToC(CefLifeSpanHandler* cls) diff --git a/libcef_dll/cpptoc/life_span_handler_cpptoc.h b/libcef_dll/cpptoc/life_span_handler_cpptoc.h index 92b2c96f6..722bf967b 100644 --- a/libcef_dll/cpptoc/life_span_handler_cpptoc.h +++ b/libcef_dll/cpptoc/life_span_handler_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _LIFESPANHANDLER_CPPTOC_H #define _LIFESPANHANDLER_CPPTOC_H diff --git a/libcef_dll/cpptoc/load_handler_cpptoc.cc b/libcef_dll/cpptoc/load_handler_cpptoc.cc index 88de43d7c..2f7ca596c 100644 --- a/libcef_dll/cpptoc/load_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/load_handler_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -20,50 +20,96 @@ void CEF_CALLBACK load_handler_on_load_start(struct _cef_load_handler_t* self, cef_browser_t* browser, cef_frame_t* frame) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff DCHECK(browser); + if (!browser) + return; + // Verify param: frame; type: refptr_diff DCHECK(frame); - if (!self || !browser || !frame) + if (!frame) return; + // Execute CefLoadHandlerCppToC::Get(self)->OnLoadStart( - CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame)); + CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame)); } + void CEF_CALLBACK load_handler_on_load_end(struct _cef_load_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, int httpStatusCode) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff DCHECK(browser); + if (!browser) + return; + // Verify param: frame; type: refptr_diff DCHECK(frame); - if (!self || !browser || !frame) + if (!frame) return; + // Execute CefLoadHandlerCppToC::Get(self)->OnLoadEnd( - CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), + CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame), httpStatusCode); } + int CEF_CALLBACK load_handler_on_load_error(struct _cef_load_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, enum cef_handler_errorcode_t errorCode, const cef_string_t* failedUrl, cef_string_t* errorText) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff DCHECK(browser); + if (!browser) + return 0; + // Verify param: frame; type: refptr_diff DCHECK(frame); + if (!frame) + return 0; + // Verify param: failedUrl; type: string_byref_const DCHECK(failedUrl); + if (!failedUrl) + return 0; + // Verify param: errorText; type: string_byref DCHECK(errorText); - if (!self || !browser || !frame || !failedUrl || !errorText) + if (!errorText) return 0; + // Translate param: errorText; type: string_byref CefString errorTextStr(errorText); - return CefLoadHandlerCppToC::Get(self)->OnLoadError( - CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), errorCode, - CefString(failedUrl), errorTextStr); + + // Execute + bool _retval = CefLoadHandlerCppToC::Get(self)->OnLoadError( + CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame), + errorCode, + CefString(failedUrl), + errorTextStr); + + // Return type: bool + return _retval; } + // CONSTRUCTOR - Do not edit by hand. CefLoadHandlerCppToC::CefLoadHandlerCppToC(CefLoadHandler* cls) diff --git a/libcef_dll/cpptoc/load_handler_cpptoc.h b/libcef_dll/cpptoc/load_handler_cpptoc.h index 288df1bc2..c4f56c92d 100644 --- a/libcef_dll/cpptoc/load_handler_cpptoc.h +++ b/libcef_dll/cpptoc/load_handler_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _LOADHANDLER_CPPTOC_H #define _LOADHANDLER_CPPTOC_H diff --git a/libcef_dll/cpptoc/menu_handler_cpptoc.cc b/libcef_dll/cpptoc/menu_handler_cpptoc.cc index 104d1736c..491b77e3a 100644 --- a/libcef_dll/cpptoc/menu_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/menu_handler_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -17,46 +17,89 @@ // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK menu_handler_on_before_menu(struct _cef_menu_handler_t* self, - cef_browser_t* browser, const cef_handler_menuinfo_t* menuInfo) + cef_browser_t* browser, const struct _cef_menu_info_t* menuInfo) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff DCHECK(browser); + if (!browser) + return 0; + // Verify param: menuInfo; type: struct_byref_const DCHECK(menuInfo); - if (!self || !browser || !menuInfo) + if (!menuInfo) return 0; - return CefMenuHandlerCppToC::Get(self)->OnBeforeMenu( - CefBrowserCToCpp::Wrap(browser), *menuInfo); + // Translate param: menuInfo; type: struct_byref_const + CefMenuInfo menuInfoObj; + if (menuInfo) + menuInfoObj.Set(*menuInfo, false); + + // Execute + bool _retval = CefMenuHandlerCppToC::Get(self)->OnBeforeMenu( + CefBrowserCToCpp::Wrap(browser), + menuInfoObj); + + // Return type: bool + return _retval; } + void CEF_CALLBACK menu_handler_get_menu_label(struct _cef_menu_handler_t* self, - cef_browser_t* browser, enum cef_handler_menuid_t menuId, - cef_string_t* label) + cef_browser_t* browser, enum cef_menu_id_t menuId, cef_string_t* label) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff DCHECK(browser); + if (!browser) + return; + // Verify param: label; type: string_byref DCHECK(label); - if (!self || !browser || !label) + if (!label) return; + // Translate param: label; type: string_byref CefString labelStr(label); + + // Execute CefMenuHandlerCppToC::Get(self)->GetMenuLabel( - CefBrowserCToCpp::Wrap(browser), menuId, labelStr); + CefBrowserCToCpp::Wrap(browser), + menuId, + labelStr); } + int CEF_CALLBACK menu_handler_on_menu_action(struct _cef_menu_handler_t* self, - cef_browser_t* browser, enum cef_handler_menuid_t menuId) + cef_browser_t* browser, enum cef_menu_id_t menuId) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff DCHECK(browser); - if (!self || !browser) + if (!browser) return 0; - return CefMenuHandlerCppToC::Get(self)->OnMenuAction( - CefBrowserCToCpp::Wrap(browser), menuId); + // Execute + bool _retval = CefMenuHandlerCppToC::Get(self)->OnMenuAction( + CefBrowserCToCpp::Wrap(browser), + menuId); + + // Return type: bool + return _retval; } + // CONSTRUCTOR - Do not edit by hand. CefMenuHandlerCppToC::CefMenuHandlerCppToC(CefMenuHandler* cls) diff --git a/libcef_dll/cpptoc/menu_handler_cpptoc.h b/libcef_dll/cpptoc/menu_handler_cpptoc.h index 9688adbdf..e50f11d54 100644 --- a/libcef_dll/cpptoc/menu_handler_cpptoc.h +++ b/libcef_dll/cpptoc/menu_handler_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _MENUHANDLER_CPPTOC_H #define _MENUHANDLER_CPPTOC_H diff --git a/libcef_dll/cpptoc/post_data_cpptoc.cc b/libcef_dll/cpptoc/post_data_cpptoc.cc index bfe5400e0..2cda6bd50 100644 --- a/libcef_dll/cpptoc/post_data_cpptoc.cc +++ b/libcef_dll/cpptoc/post_data_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -18,76 +18,130 @@ CEF_EXPORT cef_post_data_t* cef_post_data_create() { - CefRefPtr impl = CefPostData::CreatePostData(); - if(impl.get()) - return CefPostDataCppToC::Wrap(impl); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + CefRefPtr _retval = CefPostData::CreatePostData(); + + // Return type: refptr_same + return CefPostDataCppToC::Wrap(_retval); } + // MEMBER FUNCTIONS - Body may be edited by hand. size_t CEF_CALLBACK post_data_get_element_count(struct _cef_post_data_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefPostDataCppToC::Get(self)->GetElementCount(); + // Execute + size_t _retval = CefPostDataCppToC::Get(self)->GetElementCount(); + + // Return type: simple + return _retval; } -struct _cef_post_data_element_t* CEF_CALLBACK post_data_get_elements( - struct _cef_post_data_t* self, int elementIndex) + +void CEF_CALLBACK post_data_get_elements(struct _cef_post_data_t* self, + size_t* elementsCount, struct _cef_post_data_element_t** elements) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) - return NULL; + if (!self) + return; + // Verify param: elements; type: refptr_vec_same_byref + DCHECK(elementsCount && (*elementsCount == 0 || elements)); + if (!elementsCount || (*elementsCount > 0 && !elements)) + return; - CefPostData::ElementVector elements; - CefPostDataCppToC::Get(self)->GetElements(elements); + // Translate param: elements; type: refptr_vec_same_byref + std::vector > elementsList; + if (elementsCount && *elementsCount > 0 && elements) { + for (size_t i = 0; i < *elementsCount; ++i) { + elementsList.push_back(CefPostDataElementCppToC::Unwrap(elements[i])); + } + } - if(elementIndex < 0 || elementIndex >= (int)elements.size()) - return NULL; + // Execute + CefPostDataCppToC::Get(self)->GetElements( + elementsList); - return CefPostDataElementCppToC::Wrap(elements[elementIndex]); + // Restore param: elements; type: refptr_vec_same_byref + if (elementsCount && elements) { + *elementsCount = std::min(elementsList.size(), *elementsCount); + if (*elementsCount > 0) { + for (size_t i = 0; i < *elementsCount; ++i) { + elements[i] = CefPostDataElementCppToC::Wrap(elementsList[i]); + } + } + } } + int CEF_CALLBACK post_data_remove_element(struct _cef_post_data_t* self, struct _cef_post_data_element_t* element) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: element; type: refptr_same DCHECK(element); - if(!self || !element) + if (!element) return 0; - CefRefPtr selfElementPtr = - CefPostDataElementCppToC::Unwrap(element); - return CefPostDataCppToC::Get(self)->RemoveElement(selfElementPtr); + // Execute + bool _retval = CefPostDataCppToC::Get(self)->RemoveElement( + CefPostDataElementCppToC::Unwrap(element)); + + // Return type: bool + return _retval; } + int CEF_CALLBACK post_data_add_element(struct _cef_post_data_t* self, struct _cef_post_data_element_t* element) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: element; type: refptr_same DCHECK(element); - if(!self || !element) + if (!element) return 0; - CefRefPtr selfElementPtr = - CefPostDataElementCppToC::Unwrap(element); - return CefPostDataCppToC::Get(self)->AddElement(selfElementPtr); + // Execute + bool _retval = CefPostDataCppToC::Get(self)->AddElement( + CefPostDataElementCppToC::Unwrap(element)); + + // Return type: bool + return _retval; } + void CEF_CALLBACK post_data_remove_elements(struct _cef_post_data_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; + // Execute CefPostDataCppToC::Get(self)->RemoveElements(); } + // CONSTRUCTOR - Do not edit by hand. CefPostDataCppToC::CefPostDataCppToC(CefPostData* cls) diff --git a/libcef_dll/cpptoc/post_data_cpptoc.h b/libcef_dll/cpptoc/post_data_cpptoc.h index d4ce8ac3a..a7ba2f2a7 100644 --- a/libcef_dll/cpptoc/post_data_cpptoc.h +++ b/libcef_dll/cpptoc/post_data_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _POSTDATA_CPPTOC_H #define _POSTDATA_CPPTOC_H diff --git a/libcef_dll/cpptoc/post_data_element_cpptoc.cc b/libcef_dll/cpptoc/post_data_element_cpptoc.cc index dc76459df..bc53c0bb1 100644 --- a/libcef_dll/cpptoc/post_data_element_cpptoc.cc +++ b/libcef_dll/cpptoc/post_data_element_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -17,88 +17,149 @@ CEF_EXPORT cef_post_data_element_t* cef_post_data_element_create() { - CefRefPtr impl = + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + CefRefPtr _retval = CefPostDataElement::CreatePostDataElement(); - if(impl.get()) - return CefPostDataElementCppToC::Wrap(impl); - return NULL; + + // Return type: refptr_same + return CefPostDataElementCppToC::Wrap(_retval); } + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK post_data_element_set_to_empty( struct _cef_post_data_element_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; + // Execute CefPostDataElementCppToC::Get(self)->SetToEmpty(); } + void CEF_CALLBACK post_data_element_set_to_file( struct _cef_post_data_element_t* self, const cef_string_t* fileName) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) + return; + // Verify param: fileName; type: string_byref_const + DCHECK(fileName); + if (!fileName) return; - CefPostDataElementCppToC::Get(self)->SetToFile(CefString(fileName)); + // Execute + CefPostDataElementCppToC::Get(self)->SetToFile( + CefString(fileName)); } + void CEF_CALLBACK post_data_element_set_to_bytes( struct _cef_post_data_element_t* self, size_t size, const void* bytes) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) + return; + // Verify param: bytes; type: simple_byaddr + DCHECK(bytes); + if (!bytes) return; - CefPostDataElementCppToC::Get(self)->SetToBytes(size, bytes); + // Execute + CefPostDataElementCppToC::Get(self)->SetToBytes( + size, + bytes); } + enum cef_postdataelement_type_t CEF_CALLBACK post_data_element_get_type( struct _cef_post_data_element_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return PDE_TYPE_EMPTY; - return CefPostDataElementCppToC::Get(self)->GetType(); + // Execute + cef_postdataelement_type_t _retval = CefPostDataElementCppToC::Get( + self)->GetType(); + + // Return type: simple + return _retval; } + cef_string_userfree_t CEF_CALLBACK post_data_element_get_file( struct _cef_post_data_element_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefString fileNameStr = CefPostDataElementCppToC::Get(self)->GetFile(); - return fileNameStr.DetachToUserFree(); + // Execute + CefString _retval = CefPostDataElementCppToC::Get(self)->GetFile(); + + // Return type: string + return _retval.DetachToUserFree(); } + size_t CEF_CALLBACK post_data_element_get_bytes_count( struct _cef_post_data_element_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefPostDataElementCppToC::Get(self)->GetBytesCount(); + // Execute + size_t _retval = CefPostDataElementCppToC::Get(self)->GetBytesCount(); + + // Return type: simple + return _retval; } + size_t CEF_CALLBACK post_data_element_get_bytes( struct _cef_post_data_element_t* self, size_t size, void* bytes) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) + return 0; + // Verify param: bytes; type: simple_byaddr + DCHECK(bytes); + if (!bytes) return 0; - return CefPostDataElementCppToC::Get(self)->GetBytes(size, bytes); + // Execute + size_t _retval = CefPostDataElementCppToC::Get(self)->GetBytes( + size, + bytes); + + // Return type: simple + return _retval; } + // CONSTRUCTOR - Do not edit by hand. CefPostDataElementCppToC::CefPostDataElementCppToC(CefPostDataElement* cls) diff --git a/libcef_dll/cpptoc/post_data_element_cpptoc.h b/libcef_dll/cpptoc/post_data_element_cpptoc.h index 976e726ed..3b03d1555 100644 --- a/libcef_dll/cpptoc/post_data_element_cpptoc.h +++ b/libcef_dll/cpptoc/post_data_element_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _POSTDATAELEMENT_CPPTOC_H #define _POSTDATAELEMENT_CPPTOC_H diff --git a/libcef_dll/cpptoc/print_handler_cpptoc.cc b/libcef_dll/cpptoc/print_handler_cpptoc.cc index ce31dd48b..60b4417ef 100644 --- a/libcef_dll/cpptoc/print_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/print_handler_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -21,16 +21,39 @@ int CEF_CALLBACK print_handler_get_print_options( struct _cef_print_handler_t* self, cef_browser_t* browser, struct _cef_print_options_t* printOptions) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff DCHECK(browser); + if (!browser) + return 0; + // Verify param: printOptions; type: struct_byref DCHECK(printOptions); - if (!self || !browser || !printOptions) + if (!printOptions) return 0; - return CefPrintHandlerCppToC::Get(self)->GetPrintOptions( - CefBrowserCToCpp::Wrap(browser), *printOptions); + // Translate param: printOptions; type: struct_byref + CefPrintOptions printOptionsObj; + if (printOptions) + printOptionsObj.AttachTo(*printOptions); + + // Execute + bool _retval = CefPrintHandlerCppToC::Get(self)->GetPrintOptions( + CefBrowserCToCpp::Wrap(browser), + printOptionsObj); + + // Restore param: printOptions; type: struct_byref + if (printOptions) + printOptionsObj.DetachTo(*printOptions); + + // Return type: bool + return _retval; } + int CEF_CALLBACK print_handler_get_print_header_footer( struct _cef_print_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, const cef_print_info_t* printInfo, @@ -39,36 +62,95 @@ int CEF_CALLBACK print_handler_get_print_header_footer( cef_string_t* topRight, cef_string_t* bottomLeft, cef_string_t* bottomCenter, cef_string_t* bottomRight) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff DCHECK(browser); + if (!browser) + return 0; + // Verify param: frame; type: refptr_diff DCHECK(frame); + if (!frame) + return 0; + // Verify param: printInfo; type: struct_byref_const DCHECK(printInfo); + if (!printInfo) + return 0; + // Verify param: url; type: string_byref_const DCHECK(url); + if (!url) + return 0; + // Verify param: title; type: string_byref_const DCHECK(title); + if (!title) + return 0; + // Verify param: topLeft; type: string_byref DCHECK(topLeft); + if (!topLeft) + return 0; + // Verify param: topCenter; type: string_byref DCHECK(topCenter); + if (!topCenter) + return 0; + // Verify param: topRight; type: string_byref DCHECK(topRight); + if (!topRight) + return 0; + // Verify param: bottomLeft; type: string_byref DCHECK(bottomLeft); + if (!bottomLeft) + return 0; + // Verify param: bottomCenter; type: string_byref DCHECK(bottomCenter); + if (!bottomCenter) + return 0; + // Verify param: bottomRight; type: string_byref DCHECK(bottomRight); - if (!self || !browser || !frame || !printInfo || !url || !title || !topLeft || - !topCenter || !topRight || !bottomLeft || !bottomCenter || !bottomRight) + if (!bottomRight) return 0; + // Translate param: printInfo; type: struct_byref_const + CefPrintInfo printInfoObj; + if (printInfo) + printInfoObj.Set(*printInfo, false); + // Translate param: topLeft; type: string_byref CefString topLeftStr(topLeft); + // Translate param: topCenter; type: string_byref CefString topCenterStr(topCenter); + // Translate param: topRight; type: string_byref CefString topRightStr(topRight); + // Translate param: bottomLeft; type: string_byref CefString bottomLeftStr(bottomLeft); + // Translate param: bottomCenter; type: string_byref CefString bottomCenterStr(bottomCenter); + // Translate param: bottomRight; type: string_byref CefString bottomRightStr(bottomRight); - return CefPrintHandlerCppToC::Get(self)->GetPrintHeaderFooter( - CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), *printInfo, - CefString(url), CefString(title), currentPage, maxPages, topLeftStr, - topCenterStr, topRightStr, bottomLeftStr, bottomCenterStr, + + // Execute + bool _retval = CefPrintHandlerCppToC::Get(self)->GetPrintHeaderFooter( + CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame), + printInfoObj, + CefString(url), + CefString(title), + currentPage, + maxPages, + topLeftStr, + topCenterStr, + topRightStr, + bottomLeftStr, + bottomCenterStr, bottomRightStr); + + // Return type: bool + return _retval; } + // CONSTRUCTOR - Do not edit by hand. CefPrintHandlerCppToC::CefPrintHandlerCppToC(CefPrintHandler* cls) diff --git a/libcef_dll/cpptoc/print_handler_cpptoc.h b/libcef_dll/cpptoc/print_handler_cpptoc.h index ab405f0f9..35717bf65 100644 --- a/libcef_dll/cpptoc/print_handler_cpptoc.h +++ b/libcef_dll/cpptoc/print_handler_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _PRINTHANDLER_CPPTOC_H #define _PRINTHANDLER_CPPTOC_H diff --git a/libcef_dll/cpptoc/proxy_handler_cpptoc.cc b/libcef_dll/cpptoc/proxy_handler_cpptoc.cc index 9a671a53e..6cec9f11c 100644 --- a/libcef_dll/cpptoc/proxy_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/proxy_handler_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -19,24 +19,37 @@ void CEF_CALLBACK proxy_handler_get_proxy_for_url( struct _cef_proxy_handler_t* self, const cef_string_t* url, struct _cef_proxy_info_t* proxy_info) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: url; type: string_byref_const DCHECK(url); + if (!url) + return; + // Verify param: proxy_info; type: struct_byref DCHECK(proxy_info); - if (!self || !url || !proxy_info) + if (!proxy_info) return; - CefProxyInfo info; + // Translate param: proxy_info; type: struct_byref + CefProxyInfo proxy_infoObj; + if (proxy_info) + proxy_infoObj.AttachTo(*proxy_info); - // Take ownership of the values. - info.AttachTo(*proxy_info); + // Execute + CefProxyHandlerCppToC::Get(self)->GetProxyForUrl( + CefString(url), + proxy_infoObj); - CefProxyHandlerCppToC::Get(self)->GetProxyForUrl(CefString(url), info); - - // Return the values to the structure. - info.DetachTo(*proxy_info); + // Restore param: proxy_info; type: struct_byref + if (proxy_info) + proxy_infoObj.DetachTo(*proxy_info); } + // CONSTRUCTOR - Do not edit by hand. CefProxyHandlerCppToC::CefProxyHandlerCppToC(CefProxyHandler* cls) diff --git a/libcef_dll/cpptoc/proxy_handler_cpptoc.h b/libcef_dll/cpptoc/proxy_handler_cpptoc.h index 2c58d2a56..edeb12440 100644 --- a/libcef_dll/cpptoc/proxy_handler_cpptoc.h +++ b/libcef_dll/cpptoc/proxy_handler_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _PROXYHANDLER_CPPTOC_H #define _PROXYHANDLER_CPPTOC_H diff --git a/libcef_dll/cpptoc/read_handler_cpptoc.cc b/libcef_dll/cpptoc/read_handler_cpptoc.cc index b93f25582..80ac42639 100644 --- a/libcef_dll/cpptoc/read_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/read_handler_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -18,42 +18,79 @@ size_t CEF_CALLBACK read_handler_read(struct _cef_read_handler_t* self, void* ptr, size_t size, size_t n) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) + return 0; + // Verify param: ptr; type: simple_byaddr + DCHECK(ptr); + if (!ptr) return 0; - return CefReadHandlerCppToC::Get(self)->Read(ptr, size, n); + // Execute + size_t _retval = CefReadHandlerCppToC::Get(self)->Read( + ptr, + size, + n); + + // Return type: simple + return _retval; } + int CEF_CALLBACK read_handler_seek(struct _cef_read_handler_t* self, long offset, int whence) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefReadHandlerCppToC::Get(self)->Seek(offset, whence); + // Execute + int _retval = CefReadHandlerCppToC::Get(self)->Seek( + offset, + whence); + + // Return type: simple + return _retval; } + long CEF_CALLBACK read_handler_tell(struct _cef_read_handler_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefReadHandlerCppToC::Get(self)->Tell(); + // Execute + long _retval = CefReadHandlerCppToC::Get(self)->Tell(); + + // Return type: simple + return _retval; } + int CEF_CALLBACK read_handler_eof(struct _cef_read_handler_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefReadHandlerCppToC::Get(self)->Eof(); + // Execute + int _retval = CefReadHandlerCppToC::Get(self)->Eof(); + + // Return type: simple + return _retval; } + // CONSTRUCTOR - Do not edit by hand. CefReadHandlerCppToC::CefReadHandlerCppToC(CefReadHandler* cls) diff --git a/libcef_dll/cpptoc/read_handler_cpptoc.h b/libcef_dll/cpptoc/read_handler_cpptoc.h index 222d347bf..f45ca0db7 100644 --- a/libcef_dll/cpptoc/read_handler_cpptoc.h +++ b/libcef_dll/cpptoc/read_handler_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _READHANDLER_CPPTOC_H #define _READHANDLER_CPPTOC_H diff --git a/libcef_dll/cpptoc/render_handler_cpptoc.cc b/libcef_dll/cpptoc/render_handler_cpptoc.cc index d3dcc31d5..01d53d346 100644 --- a/libcef_dll/cpptoc/render_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/render_handler_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -20,112 +20,228 @@ int CEF_CALLBACK render_handler_get_view_rect( struct _cef_render_handler_t* self, cef_browser_t* browser, cef_rect_t* rect) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff DCHECK(browser); + if (!browser) + return 0; + // Verify param: rect; type: simple_byref DCHECK(rect); - if (!self || !browser || !rect) + if (!rect) return 0; - CefRect changeRect(*rect); - int rv = CefRenderHandlerCppToC::Get(self)->GetViewRect( - CefBrowserCToCpp::Wrap(browser), changeRect); - *rect = changeRect; - return rv; + // Translate param: rect; type: simple_byref + CefRect rectVal = rect?*rect:CefRect(); + + // Execute + bool _retval = CefRenderHandlerCppToC::Get(self)->GetViewRect( + CefBrowserCToCpp::Wrap(browser), + rectVal); + + // Restore param: rect; type: simple_byref + if (rect) + *rect = rectVal; + + // Return type: bool + return _retval; } + int CEF_CALLBACK render_handler_get_screen_rect( struct _cef_render_handler_t* self, cef_browser_t* browser, cef_rect_t* rect) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff DCHECK(browser); + if (!browser) + return 0; + // Verify param: rect; type: simple_byref DCHECK(rect); - if (!self || !browser || !rect) + if (!rect) return 0; - CefRect changeRect(*rect); - int rv = CefRenderHandlerCppToC::Get(self)->GetScreenRect( - CefBrowserCToCpp::Wrap(browser), changeRect); - *rect = changeRect; - return rv; + // Translate param: rect; type: simple_byref + CefRect rectVal = rect?*rect:CefRect(); + + // Execute + bool _retval = CefRenderHandlerCppToC::Get(self)->GetScreenRect( + CefBrowserCToCpp::Wrap(browser), + rectVal); + + // Restore param: rect; type: simple_byref + if (rect) + *rect = rectVal; + + // Return type: bool + return _retval; } + int CEF_CALLBACK render_handler_get_screen_point( struct _cef_render_handler_t* self, cef_browser_t* browser, int viewX, int viewY, int* screenX, int* screenY) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff DCHECK(browser); + if (!browser) + return 0; + // Verify param: screenX; type: simple_byref DCHECK(screenX); + if (!screenX) + return 0; + // Verify param: screenY; type: simple_byref DCHECK(screenY); - if (!self || !browser || !screenX || !screenY) + if (!screenY) return 0; - return CefRenderHandlerCppToC::Get(self)->GetScreenPoint( - CefBrowserCToCpp::Wrap(browser), viewX, viewY, *screenX, *screenY); + // Translate param: screenX; type: simple_byref + int screenXVal = screenX?*screenX:0; + // Translate param: screenY; type: simple_byref + int screenYVal = screenY?*screenY:0; + + // Execute + bool _retval = CefRenderHandlerCppToC::Get(self)->GetScreenPoint( + CefBrowserCToCpp::Wrap(browser), + viewX, + viewY, + screenXVal, + screenYVal); + + // Restore param: screenX; type: simple_byref + if (screenX) + *screenX = screenXVal; + // Restore param: screenY; type: simple_byref + if (screenY) + *screenY = screenYVal; + + // Return type: bool + return _retval; } + void CEF_CALLBACK render_handler_on_popup_show( struct _cef_render_handler_t* self, cef_browser_t* browser, int show) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff DCHECK(browser); - if (!self || !browser) + if (!browser) return; + // Execute CefRenderHandlerCppToC::Get(self)->OnPopupShow( - CefBrowserCToCpp::Wrap(browser), show?true:false); + CefBrowserCToCpp::Wrap(browser), + show?true:false); } + void CEF_CALLBACK render_handler_on_popup_size( struct _cef_render_handler_t* self, cef_browser_t* browser, const cef_rect_t* rect) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff DCHECK(browser); + if (!browser) + return; + // Verify param: rect; type: simple_byref_const DCHECK(rect); - if (!self || !browser || !rect) + if (!rect) return; - CefRect sizeRect(*rect); - return CefRenderHandlerCppToC::Get(self)->OnPopupSize( - CefBrowserCToCpp::Wrap(browser), sizeRect); + // Translate param: rect; type: simple_byref_const + CefRect rectVal = rect?*rect:CefRect(); + + // Execute + CefRenderHandlerCppToC::Get(self)->OnPopupSize( + CefBrowserCToCpp::Wrap(browser), + rectVal); } + void CEF_CALLBACK render_handler_on_paint(struct _cef_render_handler_t* self, cef_browser_t* browser, enum cef_paint_element_type_t type, - size_t dirtyRectCount, cef_rect_t const* dirtyRects, const void* buffer) + size_t dirtyRectsCount, cef_rect_t const* dirtyRects, const void* buffer) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff DCHECK(browser); - DCHECK(dirtyRectCount > 0); - DCHECK(dirtyRects); + if (!browser) + return; + // Verify param: dirtyRects; type: simple_vec_byref_const + DCHECK(dirtyRectsCount == 0 || dirtyRects); + if (dirtyRectsCount > 0 && !dirtyRects) + return; + // Verify param: buffer; type: simple_byaddr DCHECK(buffer); - if (!self || !browser || dirtyRectCount == 0 || !dirtyRects || !buffer) + if (!buffer) return; - CefRenderHandler::RectList rectList; - for (size_t i = 0; i < dirtyRectCount; ++i) - rectList.push_back(dirtyRects[i]); + // Translate param: dirtyRects; type: simple_vec_byref_const + std::vector dirtyRectsList; + if (dirtyRectsCount > 0) { + for (size_t i = 0; i < dirtyRectsCount; ++i) { + dirtyRectsList.push_back(dirtyRects[i]); + } + } - return CefRenderHandlerCppToC::Get(self)->OnPaint( - CefBrowserCToCpp::Wrap(browser), type, rectList, buffer); + // Execute + CefRenderHandlerCppToC::Get(self)->OnPaint( + CefBrowserCToCpp::Wrap(browser), + type, + dirtyRectsList, + buffer); } + void CEF_CALLBACK render_handler_on_cursor_change( struct _cef_render_handler_t* self, cef_browser_t* browser, cef_cursor_handle_t cursor) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff DCHECK(browser); - if (!self || !browser) + if (!browser) return; - return CefRenderHandlerCppToC::Get(self)->OnCursorChange( - CefBrowserCToCpp::Wrap(browser), cursor); + // Execute + CefRenderHandlerCppToC::Get(self)->OnCursorChange( + CefBrowserCToCpp::Wrap(browser), + cursor); } + // CONSTRUCTOR - Do not edit by hand. CefRenderHandlerCppToC::CefRenderHandlerCppToC(CefRenderHandler* cls) diff --git a/libcef_dll/cpptoc/render_handler_cpptoc.h b/libcef_dll/cpptoc/render_handler_cpptoc.h index 8c9d8e9ff..1304e1198 100644 --- a/libcef_dll/cpptoc/render_handler_cpptoc.h +++ b/libcef_dll/cpptoc/render_handler_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _RENDERHANDLER_CPPTOC_H #define _RENDERHANDLER_CPPTOC_H diff --git a/libcef_dll/cpptoc/request_cpptoc.cc b/libcef_dll/cpptoc/request_cpptoc.cc index b9922cbd0..5e89d234c 100644 --- a/libcef_dll/cpptoc/request_cpptoc.cc +++ b/libcef_dll/cpptoc/request_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -19,173 +19,281 @@ CEF_EXPORT cef_request_t* cef_request_create() { - CefRefPtr impl = CefRequest::CreateRequest(); - if(impl.get()) - return CefRequestCppToC::Wrap(impl); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + CefRefPtr _retval = CefRequest::CreateRequest(); + + // Return type: refptr_same + return CefRequestCppToC::Wrap(_retval); } + // MEMBER FUNCTIONS - Body may be edited by hand. cef_string_userfree_t CEF_CALLBACK request_get_url(struct _cef_request_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefString urlStr = CefRequestCppToC::Get(self)->GetURL(); - return urlStr.DetachToUserFree(); + // Execute + CefString _retval = CefRequestCppToC::Get(self)->GetURL(); + + // Return type: string + return _retval.DetachToUserFree(); } + void CEF_CALLBACK request_set_url(struct _cef_request_t* self, const cef_string_t* url) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) + return; + // Verify param: url; type: string_byref_const + DCHECK(url); + if (!url) return; - CefRequestCppToC::Get(self)->SetURL(CefString(url)); + // Execute + CefRequestCppToC::Get(self)->SetURL( + CefString(url)); } + cef_string_userfree_t CEF_CALLBACK request_get_method( struct _cef_request_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefString methodStr = CefRequestCppToC::Get(self)->GetMethod(); - return methodStr.DetachToUserFree(); + // Execute + CefString _retval = CefRequestCppToC::Get(self)->GetMethod(); + + // Return type: string + return _retval.DetachToUserFree(); } + void CEF_CALLBACK request_set_method(struct _cef_request_t* self, const cef_string_t* method) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) + return; + // Verify param: method; type: string_byref_const + DCHECK(method); + if (!method) return; - CefRequestCppToC::Get(self)->SetMethod(CefString(method)); + // Execute + CefRequestCppToC::Get(self)->SetMethod( + CefString(method)); } + struct _cef_post_data_t* CEF_CALLBACK request_get_post_data( struct _cef_request_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefRefPtr postDataPtr = - CefRequestCppToC::Get(self)->GetPostData(); - if(!postDataPtr.get()) - return NULL; + // Execute + CefRefPtr _retval = CefRequestCppToC::Get(self)->GetPostData(); - return CefPostDataCppToC::Wrap(postDataPtr); + // Return type: refptr_same + return CefPostDataCppToC::Wrap(_retval); } + void CEF_CALLBACK request_set_post_data(struct _cef_request_t* self, struct _cef_post_data_t* postData) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) + return; + // Verify param: postData; type: refptr_same + DCHECK(postData); + if (!postData) return; - CefRefPtr postDataPtr; - if(postData) - postDataPtr = CefPostDataCppToC::Unwrap(postData); - - CefRequestCppToC::Get(self)->SetPostData(postDataPtr); + // Execute + CefRequestCppToC::Get(self)->SetPostData( + CefPostDataCppToC::Unwrap(postData)); } + void CEF_CALLBACK request_get_header_map(struct _cef_request_t* self, cef_string_multimap_t headerMap) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) + return; + // Verify param: headerMap; type: string_map_multi_byref + DCHECK(headerMap); + if (!headerMap) return; - CefRequest::HeaderMap map; - CefRequestCppToC::Get(self)->GetHeaderMap(map); - transfer_string_multimap_contents(map, headerMap); + // Translate param: headerMap; type: string_map_multi_byref + std::multimap headerMapMultimap; + transfer_string_multimap_contents(headerMap, headerMapMultimap); + + // Execute + CefRequestCppToC::Get(self)->GetHeaderMap( + headerMapMultimap); + + // Restore param: headerMap; type: string_map_multi_byref + cef_string_multimap_clear(headerMap); + transfer_string_multimap_contents(headerMapMultimap, headerMap); } + void CEF_CALLBACK request_set_header_map(struct _cef_request_t* self, cef_string_multimap_t headerMap) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) + return; + // Verify param: headerMap; type: string_map_multi_byref_const + DCHECK(headerMap); + if (!headerMap) return; - CefRequest::HeaderMap map; - if(headerMap) - transfer_string_multimap_contents(headerMap, map); + // Translate param: headerMap; type: string_map_multi_byref_const + std::multimap headerMapMultimap; + transfer_string_multimap_contents(headerMap, headerMapMultimap); - CefRequestCppToC::Get(self)->SetHeaderMap(map); + // Execute + CefRequestCppToC::Get(self)->SetHeaderMap( + headerMapMultimap); } + void CEF_CALLBACK request_set(struct _cef_request_t* self, const cef_string_t* url, const cef_string_t* method, struct _cef_post_data_t* postData, cef_string_multimap_t headerMap) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; + // Verify param: url; type: string_byref_const + DCHECK(url); + if (!url) + return; + // Verify param: method; type: string_byref_const + DCHECK(method); + if (!method) + return; + // Verify param: headerMap; type: string_map_multi_byref_const + DCHECK(headerMap); + if (!headerMap) + return; + // Unverified params: postData - CefRefPtr postDataPtr; - CefRequest::HeaderMap map; + // Translate param: headerMap; type: string_map_multi_byref_const + std::multimap headerMapMultimap; + transfer_string_multimap_contents(headerMap, headerMapMultimap); - if(postData) - postDataPtr = CefPostDataCppToC::Unwrap(postData); - if(headerMap) - transfer_string_multimap_contents(headerMap, map); - - CefRequestCppToC::Get(self)->Set(CefString(url), CefString(method), - postDataPtr, map); + // Execute + CefRequestCppToC::Get(self)->Set( + CefString(url), + CefString(method), + CefPostDataCppToC::Unwrap(postData), + headerMapMultimap); } + enum cef_weburlrequest_flags_t CEF_CALLBACK request_get_flags( struct _cef_request_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return WUR_FLAG_NONE; - return CefRequestCppToC::Get(self)->GetFlags(); + // Execute + cef_weburlrequest_flags_t _retval = CefRequestCppToC::Get(self)->GetFlags(); + + // Return type: simple + return _retval; } + void CEF_CALLBACK request_set_flags(struct _cef_request_t* self, enum cef_weburlrequest_flags_t flags) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; - CefRequestCppToC::Get(self)->SetFlags(flags); + // Execute + CefRequestCppToC::Get(self)->SetFlags( + flags); } + cef_string_userfree_t CEF_CALLBACK request_get_first_party_for_cookies( struct _cef_request_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefString urlStr = CefRequestCppToC::Get(self)->GetFirstPartyForCookies(); - return urlStr.DetachToUserFree(); + // Execute + CefString _retval = CefRequestCppToC::Get(self)->GetFirstPartyForCookies(); + + // Return type: string + return _retval.DetachToUserFree(); } + void CEF_CALLBACK request_set_first_party_for_cookies( struct _cef_request_t* self, const cef_string_t* url) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) + return; + // Verify param: url; type: string_byref_const + DCHECK(url); + if (!url) return; - CefRequestCppToC::Get(self)->SetFirstPartyForCookies(CefString(url)); + // Execute + CefRequestCppToC::Get(self)->SetFirstPartyForCookies( + CefString(url)); } + // CONSTRUCTOR - Do not edit by hand. CefRequestCppToC::CefRequestCppToC(CefRequest* cls) diff --git a/libcef_dll/cpptoc/request_cpptoc.h b/libcef_dll/cpptoc/request_cpptoc.h index d3d80ee7d..ce0383d5a 100644 --- a/libcef_dll/cpptoc/request_cpptoc.h +++ b/libcef_dll/cpptoc/request_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _REQUEST_CPPTOC_H #define _REQUEST_CPPTOC_H diff --git a/libcef_dll/cpptoc/request_handler_cpptoc.cc b/libcef_dll/cpptoc/request_handler_cpptoc.cc index d753831f9..913602bf8 100644 --- a/libcef_dll/cpptoc/request_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/request_handler_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -27,139 +27,311 @@ int CEF_CALLBACK request_handler_on_before_browse( cef_frame_t* frame, struct _cef_request_t* request, enum cef_handler_navtype_t navType, int isRedirect) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff DCHECK(browser); + if (!browser) + return 0; + // Verify param: frame; type: refptr_diff DCHECK(frame); + if (!frame) + return 0; + // Verify param: request; type: refptr_diff DCHECK(request); - if (!self || !browser || !frame || !request) + if (!request) return 0; - return CefRequestHandlerCppToC::Get(self)->OnBeforeBrowse( - CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), - CefRequestCToCpp::Wrap(request), navType, (isRedirect ? true : false)); + // Execute + bool _retval = CefRequestHandlerCppToC::Get(self)->OnBeforeBrowse( + CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame), + CefRequestCToCpp::Wrap(request), + navType, + isRedirect?true:false); + + // Return type: bool + return _retval; } + int CEF_CALLBACK request_handler_on_before_resource_load( struct _cef_request_handler_t* self, cef_browser_t* browser, struct _cef_request_t* request, cef_string_t* redirectUrl, struct _cef_stream_reader_t** resourceStream, struct _cef_response_t* response, int loadFlags) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff DCHECK(browser); + if (!browser) + return 0; + // Verify param: request; type: refptr_diff DCHECK(request); + if (!request) + return 0; + // Verify param: redirectUrl; type: string_byref DCHECK(redirectUrl); + if (!redirectUrl) + return 0; + // Verify param: resourceStream; type: refptr_diff_byref DCHECK(resourceStream); + if (!resourceStream) + return 0; + // Verify param: response; type: refptr_diff DCHECK(response); - if (!self || !browser || !request || !redirectUrl || !resourceStream || - !response) + if (!response) return 0; - CefRefPtr streamPtr; - + // Translate param: redirectUrl; type: string_byref CefString redirectUrlStr(redirectUrl); - int rv = CefRequestHandlerCppToC::Get(self)->OnBeforeResourceLoad( - CefBrowserCToCpp::Wrap(browser), CefRequestCToCpp::Wrap(request), - redirectUrlStr, streamPtr, CefResponseCToCpp::Wrap(response), loadFlags); + // Translate param: resourceStream; type: refptr_diff_byref + CefRefPtr resourceStreamPtr; + if (resourceStream && *resourceStream) + resourceStreamPtr = CefStreamReaderCToCpp::Wrap(*resourceStream); + CefStreamReader* resourceStreamOrig = resourceStreamPtr.get(); - if(streamPtr.get()) - *resourceStream = CefStreamReaderCToCpp::Unwrap(streamPtr); + // Execute + bool _retval = CefRequestHandlerCppToC::Get(self)->OnBeforeResourceLoad( + CefBrowserCToCpp::Wrap(browser), + CefRequestCToCpp::Wrap(request), + redirectUrlStr, + resourceStreamPtr, + CefResponseCToCpp::Wrap(response), + loadFlags); - return rv; + // Restore param: resourceStream; type: refptr_diff_byref + if (resourceStream) { + if (resourceStreamPtr.get()) { + if (resourceStreamPtr.get() != resourceStreamOrig) { + *resourceStream = CefStreamReaderCToCpp::Unwrap(resourceStreamPtr); + } + } else { + *resourceStream = NULL; + } + } + + // Return type: bool + return _retval; } + void CEF_CALLBACK request_handler_on_resource_response( struct _cef_request_handler_t* self, cef_browser_t* browser, const cef_string_t* url, struct _cef_response_t* response, struct _cef_content_filter_t** filter) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff DCHECK(browser); + if (!browser) + return; + // Verify param: url; type: string_byref_const DCHECK(url); + if (!url) + return; + // Verify param: response; type: refptr_diff DCHECK(response); + if (!response) + return; + // Verify param: filter; type: refptr_same_byref DCHECK(filter); - if (!self || !browser || !url || !response || !filter) + if (!filter) return; + // Translate param: filter; type: refptr_same_byref CefRefPtr filterPtr; + if (filter && *filter) + filterPtr = CefContentFilterCppToC::Unwrap(*filter); + CefContentFilter* filterOrig = filterPtr.get(); + // Execute CefRequestHandlerCppToC::Get(self)->OnResourceResponse( - CefBrowserCToCpp::Wrap(browser), url, CefResponseCToCpp::Wrap(response), + CefBrowserCToCpp::Wrap(browser), + CefString(url), + CefResponseCToCpp::Wrap(response), filterPtr); - if(filterPtr.get()) - *filter = CefContentFilterCppToC::Wrap(filterPtr); + // Restore param: filter; type: refptr_same_byref + if (filter) { + if (filterPtr.get()) { + if (filterPtr.get() != filterOrig) { + *filter = CefContentFilterCppToC::Wrap(filterPtr); + } + } else { + *filter = NULL; + } + } } + int CEF_CALLBACK request_handler_on_protocol_execution( struct _cef_request_handler_t* self, cef_browser_t* browser, const cef_string_t* url, int* allowOSExecution) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff DCHECK(browser); + if (!browser) + return 0; + // Verify param: url; type: string_byref_const DCHECK(url); + if (!url) + return 0; + // Verify param: allowOSExecution; type: bool_byref DCHECK(allowOSExecution); - if (!self || !browser || !url || !allowOSExecution) + if (!allowOSExecution) return 0; - bool allowExec = *allowOSExecution?true:false; - int rv = CefRequestHandlerCppToC::Get(self)->OnProtocolExecution( - CefBrowserCToCpp::Wrap(browser), CefString(url), allowExec); - *allowOSExecution = allowExec; + // Translate param: allowOSExecution; type: bool_byref + bool allowOSExecutionBool = ( + allowOSExecution && *allowOSExecution)?true:false; - return rv; + // Execute + bool _retval = CefRequestHandlerCppToC::Get(self)->OnProtocolExecution( + CefBrowserCToCpp::Wrap(browser), + CefString(url), + allowOSExecutionBool); + + // Restore param: allowOSExecution; type: bool_byref + if (allowOSExecution) + *allowOSExecution = allowOSExecutionBool?true:false; + + // Return type: bool + return _retval; } + int CEF_CALLBACK request_handler_get_download_handler( struct _cef_request_handler_t* self, cef_browser_t* browser, const cef_string_t* mimeType, const cef_string_t* fileName, int64 contentLength, struct _cef_download_handler_t** handler) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff DCHECK(browser); + if (!browser) + return 0; + // Verify param: mimeType; type: string_byref_const DCHECK(mimeType); + if (!mimeType) + return 0; + // Verify param: fileName; type: string_byref_const DCHECK(fileName); + if (!fileName) + return 0; + // Verify param: handler; type: refptr_same_byref DCHECK(handler); - if (!self || !browser || !mimeType || !fileName || !handler) + if (!handler) return 0; - CefRefPtr downloadPtr; + // Translate param: handler; type: refptr_same_byref + CefRefPtr handlerPtr; + if (handler && *handler) + handlerPtr = CefDownloadHandlerCppToC::Unwrap(*handler); + CefDownloadHandler* handlerOrig = handlerPtr.get(); - int rv = CefRequestHandlerCppToC::Get(self)->GetDownloadHandler( - CefBrowserCToCpp::Wrap(browser), CefString(mimeType), CefString(fileName), - contentLength, downloadPtr); + // Execute + bool _retval = CefRequestHandlerCppToC::Get(self)->GetDownloadHandler( + CefBrowserCToCpp::Wrap(browser), + CefString(mimeType), + CefString(fileName), + contentLength, + handlerPtr); - if(downloadPtr.get()) - *handler = CefDownloadHandlerCppToC::Wrap(downloadPtr); + // Restore param: handler; type: refptr_same_byref + if (handler) { + if (handlerPtr.get()) { + if (handlerPtr.get() != handlerOrig) { + *handler = CefDownloadHandlerCppToC::Wrap(handlerPtr); + } + } else { + *handler = NULL; + } + } - return rv; + // Return type: bool + return _retval; } + int CEF_CALLBACK request_handler_get_auth_credentials( struct _cef_request_handler_t* self, cef_browser_t* browser, int isProxy, const cef_string_t* host, int port, const cef_string_t* realm, const cef_string_t* scheme, cef_string_t* username, cef_string_t* password) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff DCHECK(browser); + if (!browser) + return 0; + // Verify param: host; type: string_byref_const DCHECK(host); + if (!host) + return 0; + // Verify param: realm; type: string_byref_const DCHECK(realm); + if (!realm) + return 0; + // Verify param: scheme; type: string_byref_const DCHECK(scheme); + if (!scheme) + return 0; + // Verify param: username; type: string_byref DCHECK(username); + if (!username) + return 0; + // Verify param: password; type: string_byref DCHECK(password); - if (!self || !browser || !host || !realm || !scheme || !username || !password) + if (!password) return 0; + // Translate param: username; type: string_byref CefString usernameStr(username); + // Translate param: password; type: string_byref CefString passwordStr(password); - return CefRequestHandlerCppToC::Get(self)->GetAuthCredentials( - CefBrowserCToCpp::Wrap(browser), (isProxy ? true : false), - CefString(host), port, CefString(realm), CefString(scheme), usernameStr, + + // Execute + bool _retval = CefRequestHandlerCppToC::Get(self)->GetAuthCredentials( + CefBrowserCToCpp::Wrap(browser), + isProxy?true:false, + CefString(host), + port, + CefString(realm), + CefString(scheme), + usernameStr, passwordStr); + + // Return type: bool + return _retval; } + // CONSTRUCTOR - Do not edit by hand. CefRequestHandlerCppToC::CefRequestHandlerCppToC(CefRequestHandler* cls) diff --git a/libcef_dll/cpptoc/request_handler_cpptoc.h b/libcef_dll/cpptoc/request_handler_cpptoc.h index 0d1c0b647..d61d80a53 100644 --- a/libcef_dll/cpptoc/request_handler_cpptoc.h +++ b/libcef_dll/cpptoc/request_handler_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _REQUESTHANDLER_CPPTOC_H #define _REQUESTHANDLER_CPPTOC_H diff --git a/libcef_dll/cpptoc/response_cpptoc.cc b/libcef_dll/cpptoc/response_cpptoc.cc index d723ddc16..afc33e0d5 100644 --- a/libcef_dll/cpptoc/response_cpptoc.cc +++ b/libcef_dll/cpptoc/response_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -18,102 +18,179 @@ int CEF_CALLBACK response_get_status(struct _cef_response_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefResponseCppToC::Get(self)->GetStatus(); + // Execute + int _retval = CefResponseCppToC::Get(self)->GetStatus(); + + // Return type: simple + return _retval; } + void CEF_CALLBACK response_set_status(struct _cef_response_t* self, int status) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; - CefResponseCppToC::Get(self)->SetStatus(status); + // Execute + CefResponseCppToC::Get(self)->SetStatus( + status); } + cef_string_userfree_t CEF_CALLBACK response_get_status_text( struct _cef_response_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefString text = CefResponseCppToC::Get(self)->GetStatusText(); - return text.DetachToUserFree(); + // Execute + CefString _retval = CefResponseCppToC::Get(self)->GetStatusText(); + + // Return type: string + return _retval.DetachToUserFree(); } + void CEF_CALLBACK response_set_status_text(struct _cef_response_t* self, const cef_string_t* statusText) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) + return; + // Verify param: statusText; type: string_byref_const + DCHECK(statusText); + if (!statusText) return; - CefResponseCppToC::Get(self)->SetStatusText(CefString(statusText)); + // Execute + CefResponseCppToC::Get(self)->SetStatusText( + CefString(statusText)); } + cef_string_userfree_t CEF_CALLBACK response_get_mime_type( struct _cef_response_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefString text = CefResponseCppToC::Get(self)->GetMimeType(); - return text.DetachToUserFree(); + // Execute + CefString _retval = CefResponseCppToC::Get(self)->GetMimeType(); + + // Return type: string + return _retval.DetachToUserFree(); } + void CEF_CALLBACK response_set_mime_type(struct _cef_response_t* self, const cef_string_t* mimeType) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) + return; + // Verify param: mimeType; type: string_byref_const + DCHECK(mimeType); + if (!mimeType) return; - CefResponseCppToC::Get(self)->SetMimeType(CefString(mimeType)); + // Execute + CefResponseCppToC::Get(self)->SetMimeType( + CefString(mimeType)); } + cef_string_userfree_t CEF_CALLBACK response_get_header( struct _cef_response_t* self, const cef_string_t* name) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) + return NULL; + // Verify param: name; type: string_byref_const + DCHECK(name); + if (!name) return NULL; - CefString text = CefResponseCppToC::Get(self)->GetHeader(CefString(name)); - return text.DetachToUserFree(); + // Execute + CefString _retval = CefResponseCppToC::Get(self)->GetHeader( + CefString(name)); + + // Return type: string + return _retval.DetachToUserFree(); } + void CEF_CALLBACK response_get_header_map(struct _cef_response_t* self, cef_string_multimap_t headerMap) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) + return; + // Verify param: headerMap; type: string_map_multi_byref + DCHECK(headerMap); + if (!headerMap) return; - CefResponse::HeaderMap map; - CefResponseCppToC::Get(self)->GetHeaderMap(map); - transfer_string_multimap_contents(map, headerMap); + // Translate param: headerMap; type: string_map_multi_byref + std::multimap headerMapMultimap; + transfer_string_multimap_contents(headerMap, headerMapMultimap); + + // Execute + CefResponseCppToC::Get(self)->GetHeaderMap( + headerMapMultimap); + + // Restore param: headerMap; type: string_map_multi_byref + cef_string_multimap_clear(headerMap); + transfer_string_multimap_contents(headerMapMultimap, headerMap); } + void CEF_CALLBACK response_set_header_map(struct _cef_response_t* self, cef_string_multimap_t headerMap) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) + return; + // Verify param: headerMap; type: string_map_multi_byref_const + DCHECK(headerMap); + if (!headerMap) return; - CefResponse::HeaderMap map; - if(headerMap) - transfer_string_multimap_contents(headerMap, map); + // Translate param: headerMap; type: string_map_multi_byref_const + std::multimap headerMapMultimap; + transfer_string_multimap_contents(headerMap, headerMapMultimap); - CefResponseCppToC::Get(self)->SetHeaderMap(map); + // Execute + CefResponseCppToC::Get(self)->SetHeaderMap( + headerMapMultimap); } + // CONSTRUCTOR - Do not edit by hand. CefResponseCppToC::CefResponseCppToC(CefResponse* cls) diff --git a/libcef_dll/cpptoc/response_cpptoc.h b/libcef_dll/cpptoc/response_cpptoc.h index 1fce7673e..fba22da5c 100644 --- a/libcef_dll/cpptoc/response_cpptoc.h +++ b/libcef_dll/cpptoc/response_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _RESPONSE_CPPTOC_H #define _RESPONSE_CPPTOC_H diff --git a/libcef_dll/cpptoc/scheme_handler_callback_cpptoc.cc b/libcef_dll/cpptoc/scheme_handler_callback_cpptoc.cc index a2507a3e4..7080be6d2 100644 --- a/libcef_dll/cpptoc/scheme_handler_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/scheme_handler_callback_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -18,34 +18,46 @@ void CEF_CALLBACK scheme_handler_callback_headers_available( struct _cef_scheme_handler_callback_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return; + // Execute CefSchemeHandlerCallbackCppToC::Get(self)->HeadersAvailable(); } + void CEF_CALLBACK scheme_handler_callback_bytes_available( struct _cef_scheme_handler_callback_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return; + // Execute CefSchemeHandlerCallbackCppToC::Get(self)->BytesAvailable(); } + void CEF_CALLBACK scheme_handler_callback_cancel( struct _cef_scheme_handler_callback_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return; + // Execute CefSchemeHandlerCallbackCppToC::Get(self)->Cancel(); } + // CONSTRUCTOR - Do not edit by hand. CefSchemeHandlerCallbackCppToC::CefSchemeHandlerCallbackCppToC( diff --git a/libcef_dll/cpptoc/scheme_handler_callback_cpptoc.h b/libcef_dll/cpptoc/scheme_handler_callback_cpptoc.h index 3f28ed81f..6c83f46bd 100644 --- a/libcef_dll/cpptoc/scheme_handler_callback_cpptoc.h +++ b/libcef_dll/cpptoc/scheme_handler_callback_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _SCHEMEHANDLERCALLBACK_CPPTOC_H #define _SCHEMEHANDLERCALLBACK_CPPTOC_H diff --git a/libcef_dll/cpptoc/scheme_handler_cpptoc.cc b/libcef_dll/cpptoc/scheme_handler_cpptoc.cc index 2de6e34a2..9746185c3 100644 --- a/libcef_dll/cpptoc/scheme_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/scheme_handler_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -22,57 +22,124 @@ int CEF_CALLBACK scheme_handler_process_request( struct _cef_scheme_handler_t* self, cef_request_t* request, cef_scheme_handler_callback_t* callback) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: request; type: refptr_diff DCHECK(request); - if(!self || !request) + if (!request) + return 0; + // Verify param: callback; type: refptr_diff + DCHECK(callback); + if (!callback) return 0; - return CefSchemeHandlerCppToC::Get(self)->ProcessRequest( + // Execute + bool _retval = CefSchemeHandlerCppToC::Get(self)->ProcessRequest( CefRequestCToCpp::Wrap(request), CefSchemeHandlerCallbackCToCpp::Wrap(callback)); + + // Return type: bool + return _retval; } + void CEF_CALLBACK scheme_handler_get_response_headers( struct _cef_scheme_handler_t* self, cef_response_t* response, int64* response_length, cef_string_t* redirectUrl) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: response; type: refptr_diff DCHECK(response); + if (!response) + return; + // Verify param: response_length; type: simple_byref DCHECK(response_length); + if (!response_length) + return; + // Verify param: redirectUrl; type: string_byref DCHECK(redirectUrl); - if (!self || !response || !response_length || !redirectUrl) + if (!redirectUrl) return; + // Translate param: response_length; type: simple_byref + int64 response_lengthVal = response_length?*response_length:0; + // Translate param: redirectUrl; type: string_byref CefString redirectUrlStr(redirectUrl); + + // Execute CefSchemeHandlerCppToC::Get(self)->GetResponseHeaders( - CefResponseCToCpp::Wrap(response), *response_length, redirectUrlStr); + CefResponseCToCpp::Wrap(response), + response_lengthVal, + redirectUrlStr); + + // Restore param: response_length; type: simple_byref + if (response_length) + *response_length = response_lengthVal; } + int CEF_CALLBACK scheme_handler_read_response( struct _cef_scheme_handler_t* self, void* data_out, int bytes_to_read, int* bytes_read, cef_scheme_handler_callback_t* callback) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: data_out; type: simple_byaddr DCHECK(data_out); + if (!data_out) + return 0; + // Verify param: bytes_read; type: simple_byref DCHECK(bytes_read); - if(!self || !data_out || !bytes_read) + if (!bytes_read) + return 0; + // Verify param: callback; type: refptr_diff + DCHECK(callback); + if (!callback) return 0; - return CefSchemeHandlerCppToC::Get(self)->ReadResponse( - data_out, bytes_to_read, *bytes_read, - CefSchemeHandlerCallbackCToCpp::Wrap(callback)) ? 1 : 0; + // Translate param: bytes_read; type: simple_byref + int bytes_readVal = bytes_read?*bytes_read:0; + + // Execute + bool _retval = CefSchemeHandlerCppToC::Get(self)->ReadResponse( + data_out, + bytes_to_read, + bytes_readVal, + CefSchemeHandlerCallbackCToCpp::Wrap(callback)); + + // Restore param: bytes_read; type: simple_byref + if (bytes_read) + *bytes_read = bytes_readVal; + + // Return type: bool + return _retval; } + void CEF_CALLBACK scheme_handler_cancel(struct _cef_scheme_handler_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; + // Execute CefSchemeHandlerCppToC::Get(self)->Cancel(); } + // CONSTRUCTOR - Do not edit by hand. CefSchemeHandlerCppToC::CefSchemeHandlerCppToC(CefSchemeHandler* cls) diff --git a/libcef_dll/cpptoc/scheme_handler_cpptoc.h b/libcef_dll/cpptoc/scheme_handler_cpptoc.h index 51297f48e..3dc7f55e4 100644 --- a/libcef_dll/cpptoc/scheme_handler_cpptoc.h +++ b/libcef_dll/cpptoc/scheme_handler_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _SCHEMEHANDLER_CPPTOC_H #define _SCHEMEHANDLER_CPPTOC_H diff --git a/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc b/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc index 027af3175..cb18538e7 100644 --- a/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc +++ b/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -22,20 +22,37 @@ struct _cef_scheme_handler_t* CEF_CALLBACK scheme_handler_factory_create( struct _cef_scheme_handler_factory_t* self, cef_browser_t* browser, const cef_string_t* scheme_name, cef_request_t* request) { - CefRefPtr browserPtr; - if (browser) - browserPtr = CefBrowserCToCpp::Wrap(browser); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - CefRefPtr rv = - CefSchemeHandlerFactoryCppToC::Get(self)->Create(browserPtr, - CefString(scheme_name), CefRequestCToCpp::Wrap(request)); - if (rv.get()) - return CefSchemeHandlerCppToC::Wrap(rv); + DCHECK(self); + if (!self) + return NULL; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return NULL; + // Verify param: scheme_name; type: string_byref_const + DCHECK(scheme_name); + if (!scheme_name) + return NULL; + // Verify param: request; type: refptr_diff + DCHECK(request); + if (!request) + return NULL; - return NULL; + // Execute + CefRefPtr _retval = CefSchemeHandlerFactoryCppToC::Get( + self)->Create( + CefBrowserCToCpp::Wrap(browser), + CefString(scheme_name), + CefRequestCToCpp::Wrap(request)); + + // Return type: refptr_same + return CefSchemeHandlerCppToC::Wrap(_retval); } + // CONSTRUCTOR - Do not edit by hand. CefSchemeHandlerFactoryCppToC::CefSchemeHandlerFactoryCppToC( diff --git a/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h b/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h index 6a1124373..f2d8fcc5d 100644 --- a/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h +++ b/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _SCHEMEHANDLERFACTORY_CPPTOC_H #define _SCHEMEHANDLERFACTORY_CPPTOC_H diff --git a/libcef_dll/cpptoc/storage_visitor_cpptoc.cc b/libcef_dll/cpptoc/storage_visitor_cpptoc.cc index fcb357acb..ca2f5b4d2 100644 --- a/libcef_dll/cpptoc/storage_visitor_cpptoc.cc +++ b/libcef_dll/cpptoc/storage_visitor_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -20,21 +20,51 @@ int CEF_CALLBACK storage_visitor_visit(struct _cef_storage_visitor_t* self, const cef_string_t* key, const cef_string_t* value, int count, int total, int* deleteData) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: origin; type: string_byref_const DCHECK(origin); + if (!origin) + return 0; + // Verify param: key; type: string_byref_const + DCHECK(key); + if (!key) + return 0; + // Verify param: value; type: string_byref_const + DCHECK(value); + if (!value) + return 0; + // Verify param: deleteData; type: bool_byref DCHECK(deleteData); - if (!self || !origin || !deleteData) - return false; + if (!deleteData) + return 0; - bool delVal = (*deleteData)?true:false; - bool retVal = CefStorageVisitorCppToC::Get(self)->Visit(type, origin, key, - value, count, total, delVal); - *deleteData = delVal; + // Translate param: deleteData; type: bool_byref + bool deleteDataBool = (deleteData && *deleteData)?true:false; - return retVal; + // Execute + bool _retval = CefStorageVisitorCppToC::Get(self)->Visit( + type, + CefString(origin), + CefString(key), + CefString(value), + count, + total, + deleteDataBool); + + // Restore param: deleteData; type: bool_byref + if (deleteData) + *deleteData = deleteDataBool?true:false; + + // Return type: bool + return _retval; } + // CONSTRUCTOR - Do not edit by hand. CefStorageVisitorCppToC::CefStorageVisitorCppToC(CefStorageVisitor* cls) diff --git a/libcef_dll/cpptoc/storage_visitor_cpptoc.h b/libcef_dll/cpptoc/storage_visitor_cpptoc.h index ee4474241..a90b23830 100644 --- a/libcef_dll/cpptoc/storage_visitor_cpptoc.h +++ b/libcef_dll/cpptoc/storage_visitor_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _STORAGEVISITOR_CPPTOC_H #define _STORAGEVISITOR_CPPTOC_H diff --git a/libcef_dll/cpptoc/stream_reader_cpptoc.cc b/libcef_dll/cpptoc/stream_reader_cpptoc.cc index 80296000e..e4ea58327 100644 --- a/libcef_dll/cpptoc/stream_reader_cpptoc.cc +++ b/libcef_dll/cpptoc/stream_reader_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -19,74 +19,140 @@ CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_file( const cef_string_t* fileName) { - CefRefPtr impl = - CefStreamReader::CreateForFile(CefString(fileName)); - if(impl.get()) - return CefStreamReaderCppToC::Wrap(impl); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: fileName; type: string_byref_const + DCHECK(fileName); + if (!fileName) + return NULL; + + // Execute + CefRefPtr _retval = CefStreamReader::CreateForFile( + CefString(fileName)); + + // Return type: refptr_same + return CefStreamReaderCppToC::Wrap(_retval); } + CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_data(void* data, size_t size) { - CefRefPtr impl = CefStreamReader::CreateForData(data, size); - if(impl.get()) - return CefStreamReaderCppToC::Wrap(impl); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: data; type: simple_byaddr + DCHECK(data); + if (!data) + return NULL; + + // Execute + CefRefPtr _retval = CefStreamReader::CreateForData( + data, + size); + + // Return type: refptr_same + return CefStreamReaderCppToC::Wrap(_retval); } + CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_handler( cef_read_handler_t* handler) { - CefRefPtr impl = - CefStreamReader::CreateForHandler(CefReadHandlerCToCpp::Wrap(handler)); - if(impl.get()) - return CefStreamReaderCppToC::Wrap(impl); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: handler; type: refptr_diff + DCHECK(handler); + if (!handler) + return NULL; + + // Execute + CefRefPtr _retval = CefStreamReader::CreateForHandler( + CefReadHandlerCToCpp::Wrap(handler)); + + // Return type: refptr_same + return CefStreamReaderCppToC::Wrap(_retval); } + // MEMBER FUNCTIONS - Body may be edited by hand. size_t CEF_CALLBACK stream_reader_read(struct _cef_stream_reader_t* self, void* ptr, size_t size, size_t n) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) + return 0; + // Verify param: ptr; type: simple_byaddr + DCHECK(ptr); + if (!ptr) return 0; - return CefStreamReaderCppToC::Get(self)->Read(ptr, size, n); + // Execute + size_t _retval = CefStreamReaderCppToC::Get(self)->Read( + ptr, + size, + n); + + // Return type: simple + return _retval; } + int CEF_CALLBACK stream_reader_seek(struct _cef_stream_reader_t* self, long offset, int whence) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefStreamReaderCppToC::Get(self)->Seek(offset, whence); + // Execute + int _retval = CefStreamReaderCppToC::Get(self)->Seek( + offset, + whence); + + // Return type: simple + return _retval; } + long CEF_CALLBACK stream_reader_tell(struct _cef_stream_reader_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefStreamReaderCppToC::Get(self)->Tell(); + // Execute + long _retval = CefStreamReaderCppToC::Get(self)->Tell(); + + // Return type: simple + return _retval; } + int CEF_CALLBACK stream_reader_eof(struct _cef_stream_reader_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefStreamReaderCppToC::Get(self)->Eof(); + // Execute + int _retval = CefStreamReaderCppToC::Get(self)->Eof(); + + // Return type: simple + return _retval; } + // CONSTRUCTOR - Do not edit by hand. CefStreamReaderCppToC::CefStreamReaderCppToC(CefStreamReader* cls) diff --git a/libcef_dll/cpptoc/stream_reader_cpptoc.h b/libcef_dll/cpptoc/stream_reader_cpptoc.h index eb455d08a..88395a2da 100644 --- a/libcef_dll/cpptoc/stream_reader_cpptoc.h +++ b/libcef_dll/cpptoc/stream_reader_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _STREAMREADER_CPPTOC_H #define _STREAMREADER_CPPTOC_H diff --git a/libcef_dll/cpptoc/stream_writer_cpptoc.cc b/libcef_dll/cpptoc/stream_writer_cpptoc.cc index a4e783a72..83751f0a9 100644 --- a/libcef_dll/cpptoc/stream_writer_cpptoc.cc +++ b/libcef_dll/cpptoc/stream_writer_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -19,73 +19,120 @@ CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_file( const cef_string_t* fileName) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: fileName; type: string_byref_const DCHECK(fileName); - if(!fileName) + if (!fileName) return NULL; - CefRefPtr impl = - CefStreamWriter::CreateForFile(CefString(fileName)); - if(impl.get()) - return CefStreamWriterCppToC::Wrap(impl); - return NULL; + // Execute + CefRefPtr _retval = CefStreamWriter::CreateForFile( + CefString(fileName)); + + // Return type: refptr_same + return CefStreamWriterCppToC::Wrap(_retval); } + CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_handler( cef_write_handler_t* handler) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: handler; type: refptr_diff DCHECK(handler); - if(!handler) + if (!handler) return NULL; - CefRefPtr impl = - CefStreamWriter::CreateForHandler(CefWriteHandlerCToCpp::Wrap(handler)); - if(impl.get()) - return CefStreamWriterCppToC::Wrap(impl); - return NULL; + // Execute + CefRefPtr _retval = CefStreamWriter::CreateForHandler( + CefWriteHandlerCToCpp::Wrap(handler)); + + // Return type: refptr_same + return CefStreamWriterCppToC::Wrap(_retval); } + // MEMBER FUNCTIONS - Body may be edited by hand. size_t CEF_CALLBACK stream_writer_write(struct _cef_stream_writer_t* self, const void* ptr, size_t size, size_t n) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) + return 0; + // Verify param: ptr; type: simple_byaddr + DCHECK(ptr); + if (!ptr) return 0; - return CefStreamWriterCppToC::Get(self)->Write(ptr, size, n); + // Execute + size_t _retval = CefStreamWriterCppToC::Get(self)->Write( + ptr, + size, + n); + + // Return type: simple + return _retval; } + int CEF_CALLBACK stream_writer_seek(struct _cef_stream_writer_t* self, long offset, int whence) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefStreamWriterCppToC::Get(self)->Seek(offset, whence); + // Execute + int _retval = CefStreamWriterCppToC::Get(self)->Seek( + offset, + whence); + + // Return type: simple + return _retval; } + long CEF_CALLBACK stream_writer_tell(struct _cef_stream_writer_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefStreamWriterCppToC::Get(self)->Tell(); + // Execute + long _retval = CefStreamWriterCppToC::Get(self)->Tell(); + + // Return type: simple + return _retval; } + int CEF_CALLBACK stream_writer_flush(struct _cef_stream_writer_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefStreamWriterCppToC::Get(self)->Flush(); + // Execute + int _retval = CefStreamWriterCppToC::Get(self)->Flush(); + + // Return type: simple + return _retval; } + // CONSTRUCTOR - Do not edit by hand. CefStreamWriterCppToC::CefStreamWriterCppToC(CefStreamWriter* cls) diff --git a/libcef_dll/cpptoc/stream_writer_cpptoc.h b/libcef_dll/cpptoc/stream_writer_cpptoc.h index 0f10936b3..1958a4f66 100644 --- a/libcef_dll/cpptoc/stream_writer_cpptoc.h +++ b/libcef_dll/cpptoc/stream_writer_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _STREAMWRITER_CPPTOC_H #define _STREAMWRITER_CPPTOC_H diff --git a/libcef_dll/cpptoc/task_cpptoc.cc b/libcef_dll/cpptoc/task_cpptoc.cc index 605c22a9b..3b6c6051d 100644 --- a/libcef_dll/cpptoc/task_cpptoc.cc +++ b/libcef_dll/cpptoc/task_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -18,14 +18,19 @@ void CEF_CALLBACK task_execute(struct _cef_task_t* self, cef_thread_id_t threadId) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; - CefTaskCppToC::Get(self)->Execute(threadId); + // Execute + CefTaskCppToC::Get(self)->Execute( + threadId); } + // CONSTRUCTOR - Do not edit by hand. CefTaskCppToC::CefTaskCppToC(CefTask* cls) diff --git a/libcef_dll/cpptoc/task_cpptoc.h b/libcef_dll/cpptoc/task_cpptoc.h index d3ddb01fb..d29d8ec9e 100644 --- a/libcef_dll/cpptoc/task_cpptoc.h +++ b/libcef_dll/cpptoc/task_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _TASK_CPPTOC_H #define _TASK_CPPTOC_H diff --git a/libcef_dll/cpptoc/v8accessor_cpptoc.cc b/libcef_dll/cpptoc/v8accessor_cpptoc.cc index 712a089f3..4186ecd66 100644 --- a/libcef_dll/cpptoc/v8accessor_cpptoc.cc +++ b/libcef_dll/cpptoc/v8accessor_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -20,49 +20,101 @@ int CEF_CALLBACK v8accessor_get(struct _cef_v8accessor_t* self, const cef_string_t* name, struct _cef_v8value_t* object, struct _cef_v8value_t** retval, cef_string_t* exception) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) + return 0; + // Verify param: name; type: string_byref_const + DCHECK(name); + if (!name) + return 0; + // Verify param: object; type: refptr_diff + DCHECK(object); + if (!object) + return 0; + // Verify param: retval; type: refptr_diff_byref + DCHECK(retval); + if (!retval) + return 0; + // Verify param: exception; type: string_byref + DCHECK(exception); + if (!exception) return 0; - CefRefPtr objectPtr; - if(object) - objectPtr = CefV8ValueCToCpp::Wrap(object); - - CefRefPtr retValPtr; + // Translate param: retval; type: refptr_diff_byref + CefRefPtr retvalPtr; + if (retval && *retval) + retvalPtr = CefV8ValueCToCpp::Wrap(*retval); + CefV8Value* retvalOrig = retvalPtr.get(); + // Translate param: exception; type: string_byref CefString exceptionStr(exception); - bool rv = CefV8AccessorCppToC::Get(self)->Get(CefString(name), objectPtr, - retValPtr, exceptionStr); - if(rv) { - if(retValPtr.get() && retval) - *retval = CefV8ValueCToCpp::Unwrap(retValPtr); + + // Execute + bool _retval = CefV8AccessorCppToC::Get(self)->Get( + CefString(name), + CefV8ValueCToCpp::Wrap(object), + retvalPtr, + exceptionStr); + + // Restore param: retval; type: refptr_diff_byref + if (retval) { + if (retvalPtr.get()) { + if (retvalPtr.get() != retvalOrig) { + *retval = CefV8ValueCToCpp::Unwrap(retvalPtr); + } + } else { + *retval = NULL; + } } - return rv; + // Return type: bool + return _retval; } + int CEF_CALLBACK v8accessor_set(struct _cef_v8accessor_t* self, const cef_string_t* name, struct _cef_v8value_t* object, struct _cef_v8value_t* value, cef_string_t* exception) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) + return 0; + // Verify param: name; type: string_byref_const + DCHECK(name); + if (!name) + return 0; + // Verify param: object; type: refptr_diff + DCHECK(object); + if (!object) + return 0; + // Verify param: value; type: refptr_diff + DCHECK(value); + if (!value) + return 0; + // Verify param: exception; type: string_byref + DCHECK(exception); + if (!exception) return 0; - CefRefPtr objectPtr; - if(object) - objectPtr = CefV8ValueCToCpp::Wrap(object); - - CefRefPtr valuePtr; - if(value) - valuePtr = CefV8ValueCToCpp::Wrap(value); - + // Translate param: exception; type: string_byref CefString exceptionStr(exception); - bool rv = CefV8AccessorCppToC::Get(self)->Set(CefString(name), objectPtr, - valuePtr, exceptionStr); - return rv; + + // Execute + bool _retval = CefV8AccessorCppToC::Get(self)->Set( + CefString(name), + CefV8ValueCToCpp::Wrap(object), + CefV8ValueCToCpp::Wrap(value), + exceptionStr); + + // Return type: bool + return _retval; } + // CONSTRUCTOR - Do not edit by hand. CefV8AccessorCppToC::CefV8AccessorCppToC(CefV8Accessor* cls) diff --git a/libcef_dll/cpptoc/v8accessor_cpptoc.h b/libcef_dll/cpptoc/v8accessor_cpptoc.h index 0dadafbf8..fe8a09422 100644 --- a/libcef_dll/cpptoc/v8accessor_cpptoc.h +++ b/libcef_dll/cpptoc/v8accessor_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _V8ACCESSOR_CPPTOC_H #define _V8ACCESSOR_CPPTOC_H diff --git a/libcef_dll/cpptoc/v8context_cpptoc.cc b/libcef_dll/cpptoc/v8context_cpptoc.cc index f38a5c045..ebb32017d 100644 --- a/libcef_dll/cpptoc/v8context_cpptoc.cc +++ b/libcef_dll/cpptoc/v8context_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -20,103 +20,147 @@ CEF_EXPORT cef_v8context_t* cef_v8context_get_current_context() { - CefRefPtr - contextPtr( CefV8Context::GetCurrentContext() ); - if(contextPtr.get()) - return CefV8ContextCppToC::Wrap(contextPtr); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + CefRefPtr _retval = CefV8Context::GetCurrentContext(); + + // Return type: refptr_same + return CefV8ContextCppToC::Wrap(_retval); } + CEF_EXPORT cef_v8context_t* cef_v8context_get_entered_context() { - CefRefPtr - contextPtr( CefV8Context::GetEnteredContext() ); - if(contextPtr.get()) - return CefV8ContextCppToC::Wrap(contextPtr); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + CefRefPtr _retval = CefV8Context::GetEnteredContext(); + + // Return type: refptr_same + return CefV8ContextCppToC::Wrap(_retval); } + CEF_EXPORT int cef_v8context_in_context() { - return CefV8Context::InContext(); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + bool _retval = CefV8Context::InContext(); + + // Return type: bool + return _retval; } + // MEMBER FUNCTIONS - Body may be edited by hand. cef_browser_t* CEF_CALLBACK v8context_get_browser(struct _cef_v8context_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefRefPtr contextPtr = CefV8ContextCppToC::Get(self); - CefRefPtr browserPtr = contextPtr->GetBrowser(); - if(browserPtr.get()) - return CefBrowserCppToC::Wrap(browserPtr); - return NULL; + // Execute + CefRefPtr _retval = CefV8ContextCppToC::Get(self)->GetBrowser(); + + // Return type: refptr_same + return CefBrowserCppToC::Wrap(_retval); } + cef_frame_t* CEF_CALLBACK v8context_get_frame(struct _cef_v8context_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefRefPtr contextPtr = CefV8ContextCppToC::Get(self); - CefRefPtr framePtr = contextPtr->GetFrame(); - if(framePtr.get()) - return CefFrameCppToC::Wrap(framePtr); - return NULL; + // Execute + CefRefPtr _retval = CefV8ContextCppToC::Get(self)->GetFrame(); + + // Return type: refptr_same + return CefFrameCppToC::Wrap(_retval); } + struct _cef_v8value_t* CEF_CALLBACK v8context_get_global( struct _cef_v8context_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefRefPtr contextPtr = CefV8ContextCppToC::Get(self); - CefRefPtr globalPtr = contextPtr->GetGlobal(); - if(globalPtr.get()) - return CefV8ValueCppToC::Wrap(globalPtr); - return NULL; + // Execute + CefRefPtr _retval = CefV8ContextCppToC::Get(self)->GetGlobal(); + + // Return type: refptr_same + return CefV8ValueCppToC::Wrap(_retval); } + int CEF_CALLBACK v8context_enter(struct _cef_v8context_t* self) { - DCHECK(self); - if(!self) - return false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - CefRefPtr contextPtr = CefV8ContextCppToC::Get(self); - return contextPtr->Enter(); + DCHECK(self); + if (!self) + return 0; + + // Execute + bool _retval = CefV8ContextCppToC::Get(self)->Enter(); + + // Return type: bool + return _retval; } + int CEF_CALLBACK v8context_exit(struct _cef_v8context_t* self) { - DCHECK(self); - if(!self) - return false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - CefRefPtr contextPtr = CefV8ContextCppToC::Get(self); - return contextPtr->Exit(); + DCHECK(self); + if (!self) + return 0; + + // Execute + bool _retval = CefV8ContextCppToC::Get(self)->Exit(); + + // Return type: bool + return _retval; } + int CEF_CALLBACK v8context_is_same(struct _cef_v8context_t* self, struct _cef_v8context_t* that) { - DCHECK(self); - DCHECK(that); - if (!self || !that) - return false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return CefV8ContextCppToC::Get(self)->IsSame( + DCHECK(self); + if (!self) + return 0; + // Verify param: that; type: refptr_same + DCHECK(that); + if (!that) + return 0; + + // Execute + bool _retval = CefV8ContextCppToC::Get(self)->IsSame( CefV8ContextCppToC::Unwrap(that)); + + // Return type: bool + return _retval; } + // CONSTRUCTOR - Do not edit by hand. CefV8ContextCppToC::CefV8ContextCppToC(CefV8Context* cls) diff --git a/libcef_dll/cpptoc/v8context_cpptoc.h b/libcef_dll/cpptoc/v8context_cpptoc.h index 4a31be34d..df20c6b86 100644 --- a/libcef_dll/cpptoc/v8context_cpptoc.h +++ b/libcef_dll/cpptoc/v8context_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _V8CONTEXT_CPPTOC_H #define _V8CONTEXT_CPPTOC_H diff --git a/libcef_dll/cpptoc/v8context_handler_cpptoc.cc b/libcef_dll/cpptoc/v8context_handler_cpptoc.cc index 112cd7a2a..6b5a3617e 100644 --- a/libcef_dll/cpptoc/v8context_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/v8context_handler_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -22,35 +22,63 @@ void CEF_CALLBACK v8context_handler_on_context_created( struct _cef_v8context_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, struct _cef_v8context_t* context) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff DCHECK(browser); + if (!browser) + return; + // Verify param: frame; type: refptr_diff DCHECK(frame); + if (!frame) + return; + // Verify param: context; type: refptr_diff DCHECK(context); - if (!self || !browser || !frame || !context) + if (!context) return; + // Execute CefV8ContextHandlerCppToC::Get(self)->OnContextCreated( - CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), + CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame), CefV8ContextCToCpp::Wrap(context)); } + void CEF_CALLBACK v8context_handler_on_context_released( struct _cef_v8context_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, struct _cef_v8context_t* context) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff DCHECK(browser); + if (!browser) + return; + // Verify param: frame; type: refptr_diff DCHECK(frame); + if (!frame) + return; + // Verify param: context; type: refptr_diff DCHECK(context); - if (!self || !browser || !frame || !context) + if (!context) return; + // Execute CefV8ContextHandlerCppToC::Get(self)->OnContextReleased( - CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), + CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame), CefV8ContextCToCpp::Wrap(context)); } + // CONSTRUCTOR - Do not edit by hand. CefV8ContextHandlerCppToC::CefV8ContextHandlerCppToC(CefV8ContextHandler* cls) diff --git a/libcef_dll/cpptoc/v8context_handler_cpptoc.h b/libcef_dll/cpptoc/v8context_handler_cpptoc.h index f67422bc4..e5c862890 100644 --- a/libcef_dll/cpptoc/v8context_handler_cpptoc.h +++ b/libcef_dll/cpptoc/v8context_handler_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _V8CONTEXTHANDLER_CPPTOC_H #define _V8CONTEXTHANDLER_CPPTOC_H diff --git a/libcef_dll/cpptoc/v8exception_cpptoc.cc b/libcef_dll/cpptoc/v8exception_cpptoc.cc index 5deefa0cc..55f0098e9 100644 --- a/libcef_dll/cpptoc/v8exception_cpptoc.cc +++ b/libcef_dll/cpptoc/v8exception_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -18,82 +18,135 @@ cef_string_userfree_t CEF_CALLBACK v8exception_get_message( struct _cef_v8exception_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return NULL; - CefString str = CefV8ExceptionCppToC::Get(self)->GetMessage(); - return str.DetachToUserFree(); + // Execute + CefString _retval = CefV8ExceptionCppToC::Get(self)->GetMessage(); + + // Return type: string + return _retval.DetachToUserFree(); } + cef_string_userfree_t CEF_CALLBACK v8exception_get_source_line( struct _cef_v8exception_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return NULL; - CefString str = CefV8ExceptionCppToC::Get(self)->GetSourceLine(); - return str.DetachToUserFree(); + // Execute + CefString _retval = CefV8ExceptionCppToC::Get(self)->GetSourceLine(); + + // Return type: string + return _retval.DetachToUserFree(); } + cef_string_userfree_t CEF_CALLBACK v8exception_get_script_resource_name( struct _cef_v8exception_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return NULL; - CefString str = CefV8ExceptionCppToC::Get(self)->GetScriptResourceName(); - return str.DetachToUserFree(); + // Execute + CefString _retval = CefV8ExceptionCppToC::Get(self)->GetScriptResourceName(); + + // Return type: string + return _retval.DetachToUserFree(); } + int CEF_CALLBACK v8exception_get_line_number(struct _cef_v8exception_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return 0; - return CefV8ExceptionCppToC::Get(self)->GetLineNumber(); + // Execute + int _retval = CefV8ExceptionCppToC::Get(self)->GetLineNumber(); + + // Return type: simple + return _retval; } + int CEF_CALLBACK v8exception_get_start_position(struct _cef_v8exception_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return 0; - return CefV8ExceptionCppToC::Get(self)->GetStartPosition(); + // Execute + int _retval = CefV8ExceptionCppToC::Get(self)->GetStartPosition(); + + // Return type: simple + return _retval; } + int CEF_CALLBACK v8exception_get_end_position(struct _cef_v8exception_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return 0; - return CefV8ExceptionCppToC::Get(self)->GetEndPosition(); + // Execute + int _retval = CefV8ExceptionCppToC::Get(self)->GetEndPosition(); + + // Return type: simple + return _retval; } + int CEF_CALLBACK v8exception_get_start_column(struct _cef_v8exception_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return 0; - return CefV8ExceptionCppToC::Get(self)->GetStartColumn(); + // Execute + int _retval = CefV8ExceptionCppToC::Get(self)->GetStartColumn(); + + // Return type: simple + return _retval; } + int CEF_CALLBACK v8exception_get_end_column(struct _cef_v8exception_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) return 0; - return CefV8ExceptionCppToC::Get(self)->GetEndColumn(); + // Execute + int _retval = CefV8ExceptionCppToC::Get(self)->GetEndColumn(); + + // Return type: simple + return _retval; } + // CONSTRUCTOR - Do not edit by hand. CefV8ExceptionCppToC::CefV8ExceptionCppToC(CefV8Exception* cls) diff --git a/libcef_dll/cpptoc/v8exception_cpptoc.h b/libcef_dll/cpptoc/v8exception_cpptoc.h index dff7e00a3..b03143fb7 100644 --- a/libcef_dll/cpptoc/v8exception_cpptoc.h +++ b/libcef_dll/cpptoc/v8exception_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _V8EXCEPTION_CPPTOC_H #define _V8EXCEPTION_CPPTOC_H diff --git a/libcef_dll/cpptoc/v8handler_cpptoc.cc b/libcef_dll/cpptoc/v8handler_cpptoc.cc index f6fb83e61..d19a271de 100644 --- a/libcef_dll/cpptoc/v8handler_cpptoc.cc +++ b/libcef_dll/cpptoc/v8handler_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -18,35 +18,75 @@ int CEF_CALLBACK v8handler_execute(struct _cef_v8handler_t* self, const cef_string_t* name, struct _cef_v8value_t* object, - size_t argumentCount, struct _cef_v8value_t* const* arguments, + size_t argumentsCount, struct _cef_v8value_t* const* arguments, struct _cef_v8value_t** retval, cef_string_t* exception) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) + return 0; + // Verify param: name; type: string_byref_const + DCHECK(name); + if (!name) + return 0; + // Verify param: object; type: refptr_diff + DCHECK(object); + if (!object) + return 0; + // Verify param: arguments; type: refptr_vec_diff_byref_const + DCHECK(argumentsCount == 0 || arguments); + if (argumentsCount > 0 && !arguments) + return 0; + // Verify param: retval; type: refptr_diff_byref + DCHECK(retval); + if (!retval) + return 0; + // Verify param: exception; type: string_byref + DCHECK(exception); + if (!exception) return 0; - CefRefPtr objectPtr; - if(object) - objectPtr = CefV8ValueCToCpp::Wrap(object); - - CefV8ValueList list; - for(size_t i = 0; i < argumentCount; ++i) { - list.push_back(CefV8ValueCToCpp::Wrap(arguments[i])); + // Translate param: arguments; type: refptr_vec_diff_byref_const + std::vector > argumentsList; + if (argumentsCount > 0) { + for (size_t i = 0; i < argumentsCount; ++i) { + argumentsList.push_back(CefV8ValueCToCpp::Wrap(arguments[i])); + } } - - CefRefPtr retValPtr; + // Translate param: retval; type: refptr_diff_byref + CefRefPtr retvalPtr; + if (retval && *retval) + retvalPtr = CefV8ValueCToCpp::Wrap(*retval); + CefV8Value* retvalOrig = retvalPtr.get(); + // Translate param: exception; type: string_byref CefString exceptionStr(exception); - bool rv = CefV8HandlerCppToC::Get(self)->Execute(CefString(name), objectPtr, - list, retValPtr, exceptionStr); - if(rv) { - if(retValPtr.get() && retval) - *retval = CefV8ValueCToCpp::Unwrap(retValPtr); + + // Execute + bool _retval = CefV8HandlerCppToC::Get(self)->Execute( + CefString(name), + CefV8ValueCToCpp::Wrap(object), + argumentsList, + retvalPtr, + exceptionStr); + + // Restore param: retval; type: refptr_diff_byref + if (retval) { + if (retvalPtr.get()) { + if (retvalPtr.get() != retvalOrig) { + *retval = CefV8ValueCToCpp::Unwrap(retvalPtr); + } + } else { + *retval = NULL; + } } - return rv; + // Return type: bool + return _retval; } + // CONSTRUCTOR - Do not edit by hand. CefV8HandlerCppToC::CefV8HandlerCppToC(CefV8Handler* cls) diff --git a/libcef_dll/cpptoc/v8handler_cpptoc.h b/libcef_dll/cpptoc/v8handler_cpptoc.h index 171fb5095..995232229 100644 --- a/libcef_dll/cpptoc/v8handler_cpptoc.h +++ b/libcef_dll/cpptoc/v8handler_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _V8HANDLER_CPPTOC_H #define _V8HANDLER_CPPTOC_H diff --git a/libcef_dll/cpptoc/v8value_cpptoc.cc b/libcef_dll/cpptoc/v8value_cpptoc.cc index e60573c6b..25513f511 100644 --- a/libcef_dll/cpptoc/v8value_cpptoc.cc +++ b/libcef_dll/cpptoc/v8value_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -16,514 +16,897 @@ #include "libcef_dll/ctocpp/base_ctocpp.h" #include "libcef_dll/ctocpp/v8accessor_ctocpp.h" #include "libcef_dll/ctocpp/v8handler_ctocpp.h" +#include "libcef_dll/transfer_util.h" // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_v8value_t* cef_v8value_create_undefined() { - CefRefPtr impl = CefV8Value::CreateUndefined(); - if(impl.get()) - return CefV8ValueCppToC::Wrap(impl); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + CefRefPtr _retval = CefV8Value::CreateUndefined(); + + // Return type: refptr_same + return CefV8ValueCppToC::Wrap(_retval); } + CEF_EXPORT cef_v8value_t* cef_v8value_create_null() { - CefRefPtr impl = CefV8Value::CreateNull(); - if(impl.get()) - return CefV8ValueCppToC::Wrap(impl); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + CefRefPtr _retval = CefV8Value::CreateNull(); + + // Return type: refptr_same + return CefV8ValueCppToC::Wrap(_retval); } + CEF_EXPORT cef_v8value_t* cef_v8value_create_bool(int value) { - CefRefPtr impl = CefV8Value::CreateBool(value?true:false); - if(impl.get()) - return CefV8ValueCppToC::Wrap(impl); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + CefRefPtr _retval = CefV8Value::CreateBool( + value?true:false); + + // Return type: refptr_same + return CefV8ValueCppToC::Wrap(_retval); } + CEF_EXPORT cef_v8value_t* cef_v8value_create_int(int value) { - CefRefPtr impl = CefV8Value::CreateInt(value); - if(impl.get()) - return CefV8ValueCppToC::Wrap(impl); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + CefRefPtr _retval = CefV8Value::CreateInt( + value); + + // Return type: refptr_same + return CefV8ValueCppToC::Wrap(_retval); } + CEF_EXPORT cef_v8value_t* cef_v8value_create_double(double value) { - CefRefPtr impl = CefV8Value::CreateDouble(value); - if(impl.get()) - return CefV8ValueCppToC::Wrap(impl); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + CefRefPtr _retval = CefV8Value::CreateDouble( + value); + + // Return type: refptr_same + return CefV8ValueCppToC::Wrap(_retval); } + CEF_EXPORT cef_v8value_t* cef_v8value_create_date(const cef_time_t* date) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: date; type: simple_byref_const DCHECK(date); if (!date) return NULL; - CefRefPtr impl = CefV8Value::CreateDate(*date); - if(impl.get()) - return CefV8ValueCppToC::Wrap(impl); - return NULL; + // Translate param: date; type: simple_byref_const + CefTime dateVal = date?*date:CefTime(); + + // Execute + CefRefPtr _retval = CefV8Value::CreateDate( + dateVal); + + // Return type: refptr_same + return CefV8ValueCppToC::Wrap(_retval); } + CEF_EXPORT cef_v8value_t* cef_v8value_create_string(const cef_string_t* value) { - CefRefPtr impl = CefV8Value::CreateString(CefString(value)); - if(impl.get()) - return CefV8ValueCppToC::Wrap(impl); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: value + + // Execute + CefRefPtr _retval = CefV8Value::CreateString( + CefString(value)); + + // Return type: refptr_same + return CefV8ValueCppToC::Wrap(_retval); } + CEF_EXPORT cef_v8value_t* cef_v8value_create_object(cef_base_t* user_data) { - CefRefPtr basePtr; - if(user_data) - basePtr = CefBaseCToCpp::Wrap(user_data); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - CefRefPtr impl = CefV8Value::CreateObject(basePtr); - if(impl.get()) - return CefV8ValueCppToC::Wrap(impl); - return NULL; + // Unverified params: user_data + + // Execute + CefRefPtr _retval = CefV8Value::CreateObject( + CefBaseCToCpp::Wrap(user_data)); + + // Return type: refptr_same + return CefV8ValueCppToC::Wrap(_retval); } + CEF_EXPORT cef_v8value_t* cef_v8value_create_object_with_accessor( cef_base_t* user_data, cef_v8accessor_t* accessor) { - CefRefPtr basePtr; - if(user_data) - basePtr = CefBaseCToCpp::Wrap(user_data); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - CefRefPtr accessorPtr; - if(accessor) - accessorPtr = CefV8AccessorCToCpp::Wrap(accessor); + // Unverified params: user_data, accessor - CefRefPtr impl = CefV8Value::CreateObject(basePtr, accessorPtr); - if(impl.get()) - return CefV8ValueCppToC::Wrap(impl); - return NULL; + // Execute + CefRefPtr _retval = CefV8Value::CreateObject( + CefBaseCToCpp::Wrap(user_data), + CefV8AccessorCToCpp::Wrap(accessor)); + + // Return type: refptr_same + return CefV8ValueCppToC::Wrap(_retval); } + CEF_EXPORT cef_v8value_t* cef_v8value_create_array() { - CefRefPtr impl = CefV8Value::CreateArray(); - if(impl.get()) - return CefV8ValueCppToC::Wrap(impl); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + CefRefPtr _retval = CefV8Value::CreateArray(); + + // Return type: refptr_same + return CefV8ValueCppToC::Wrap(_retval); } + CEF_EXPORT cef_v8value_t* cef_v8value_create_function(const cef_string_t* name, cef_v8handler_t* handler) { - CefRefPtr handlerPtr; - if(handler) - handlerPtr = CefV8HandlerCToCpp::Wrap(handler); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - CefRefPtr impl = - CefV8Value::CreateFunction(CefString(name), handlerPtr); - if(impl.get()) - return CefV8ValueCppToC::Wrap(impl); - return NULL; + // Verify param: name; type: string_byref_const + DCHECK(name); + if (!name) + return NULL; + // Verify param: handler; type: refptr_diff + DCHECK(handler); + if (!handler) + return NULL; + + // Execute + CefRefPtr _retval = CefV8Value::CreateFunction( + CefString(name), + CefV8HandlerCToCpp::Wrap(handler)); + + // Return type: refptr_same + return CefV8ValueCppToC::Wrap(_retval); } + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK v8value_is_undefined(struct _cef_v8value_t* self) { - DCHECK(self); - if(!self) - return 0; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return CefV8ValueCppToC::Get(self)->IsUndefined(); -} - -int CEF_CALLBACK v8value_is_null(struct _cef_v8value_t* self) -{ - DCHECK(self); - if(!self) - return 0; - - return CefV8ValueCppToC::Get(self)->IsNull(); -} - -int CEF_CALLBACK v8value_is_bool(struct _cef_v8value_t* self) -{ - DCHECK(self); - if(!self) - return 0; - - return CefV8ValueCppToC::Get(self)->IsBool(); -} - -int CEF_CALLBACK v8value_is_int(struct _cef_v8value_t* self) -{ - DCHECK(self); - if(!self) - return 0; - - return CefV8ValueCppToC::Get(self)->IsInt(); -} - -int CEF_CALLBACK v8value_is_double(struct _cef_v8value_t* self) -{ - DCHECK(self); - if(!self) - return 0; - - return CefV8ValueCppToC::Get(self)->IsDouble(); -} - -int CEF_CALLBACK v8value_is_date(struct _cef_v8value_t* self) -{ DCHECK(self); if (!self) return 0; - return CefV8ValueCppToC::Get(self)->IsDate(); + // Execute + bool _retval = CefV8ValueCppToC::Get(self)->IsUndefined(); + + // Return type: bool + return _retval; } + +int CEF_CALLBACK v8value_is_null(struct _cef_v8value_t* self) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + bool _retval = CefV8ValueCppToC::Get(self)->IsNull(); + + // Return type: bool + return _retval; +} + + +int CEF_CALLBACK v8value_is_bool(struct _cef_v8value_t* self) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + bool _retval = CefV8ValueCppToC::Get(self)->IsBool(); + + // Return type: bool + return _retval; +} + + +int CEF_CALLBACK v8value_is_int(struct _cef_v8value_t* self) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + bool _retval = CefV8ValueCppToC::Get(self)->IsInt(); + + // Return type: bool + return _retval; +} + + +int CEF_CALLBACK v8value_is_double(struct _cef_v8value_t* self) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + bool _retval = CefV8ValueCppToC::Get(self)->IsDouble(); + + // Return type: bool + return _retval; +} + + +int CEF_CALLBACK v8value_is_date(struct _cef_v8value_t* self) +{ + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + bool _retval = CefV8ValueCppToC::Get(self)->IsDate(); + + // Return type: bool + return _retval; +} + + int CEF_CALLBACK v8value_is_string(struct _cef_v8value_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefV8ValueCppToC::Get(self)->IsString(); + // Execute + bool _retval = CefV8ValueCppToC::Get(self)->IsString(); + + // Return type: bool + return _retval; } + int CEF_CALLBACK v8value_is_object(struct _cef_v8value_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefV8ValueCppToC::Get(self)->IsObject(); + // Execute + bool _retval = CefV8ValueCppToC::Get(self)->IsObject(); + + // Return type: bool + return _retval; } + int CEF_CALLBACK v8value_is_array(struct _cef_v8value_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefV8ValueCppToC::Get(self)->IsArray(); + // Execute + bool _retval = CefV8ValueCppToC::Get(self)->IsArray(); + + // Return type: bool + return _retval; } + int CEF_CALLBACK v8value_is_function(struct _cef_v8value_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefV8ValueCppToC::Get(self)->IsFunction(); + // Execute + bool _retval = CefV8ValueCppToC::Get(self)->IsFunction(); + + // Return type: bool + return _retval; } + int CEF_CALLBACK v8value_is_same(struct _cef_v8value_t* self, struct _cef_v8value_t* that) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: that; type: refptr_same DCHECK(that); - if(!self || !that) + if (!that) return 0; - return CefV8ValueCppToC::Get(self)->IsSame(CefV8ValueCppToC::Unwrap(that)); + // Execute + bool _retval = CefV8ValueCppToC::Get(self)->IsSame( + CefV8ValueCppToC::Unwrap(that)); + + // Return type: bool + return _retval; } + int CEF_CALLBACK v8value_get_bool_value(struct _cef_v8value_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefV8ValueCppToC::Get(self)->GetBoolValue(); + // Execute + bool _retval = CefV8ValueCppToC::Get(self)->GetBoolValue(); + + // Return type: bool + return _retval; } + int CEF_CALLBACK v8value_get_int_value(struct _cef_v8value_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefV8ValueCppToC::Get(self)->GetIntValue(); + // Execute + int _retval = CefV8ValueCppToC::Get(self)->GetIntValue(); + + // Return type: simple + return _retval; } + double CEF_CALLBACK v8value_get_double_value(struct _cef_v8value_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefV8ValueCppToC::Get(self)->GetDoubleValue(); + // Execute + double _retval = CefV8ValueCppToC::Get(self)->GetDoubleValue(); + + // Return type: simple + return _retval; } + cef_time_t CEF_CALLBACK v8value_get_date_value(struct _cef_v8value_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); if (!self) - return cef_time_t(); + return CefTime(); - return CefV8ValueCppToC::Get(self)->GetDateValue(); + // Execute + cef_time_t _retval = CefV8ValueCppToC::Get(self)->GetDateValue(); + + // Return type: simple + return _retval; } + cef_string_userfree_t CEF_CALLBACK v8value_get_string_value( struct _cef_v8value_t* self) { - DCHECK(self); - if(!self) - return 0; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - CefString valueStr = CefV8ValueCppToC::Get(self)->GetStringValue(); - return valueStr.DetachToUserFree(); + DCHECK(self); + if (!self) + return NULL; + + // Execute + CefString _retval = CefV8ValueCppToC::Get(self)->GetStringValue(); + + // Return type: string + return _retval.DetachToUserFree(); } + int CEF_CALLBACK v8value_has_value_bykey(struct _cef_v8value_t* self, const cef_string_t* key) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: key; type: string_byref_const DCHECK(key); - if(!self || !key) + if (!key) return 0; - return CefV8ValueCppToC::Get(self)->HasValue(CefString(key)); + // Execute + bool _retval = CefV8ValueCppToC::Get(self)->HasValue( + CefString(key)); + + // Return type: bool + return _retval; } + int CEF_CALLBACK v8value_has_value_byindex(struct _cef_v8value_t* self, - int index) + size_t index) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - DCHECK(index >= 0); - if(!self || index < 0) + if (!self) return 0; - return CefV8ValueCppToC::Get(self)->HasValue(index); + // Execute + bool _retval = CefV8ValueCppToC::Get(self)->HasValue( + index); + + // Return type: bool + return _retval; } + int CEF_CALLBACK v8value_delete_value_bykey(struct _cef_v8value_t* self, const cef_string_t* key) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: key; type: string_byref_const DCHECK(key); - if(!self || !key) + if (!key) return 0; - return CefV8ValueCppToC::Get(self)->DeleteValue(CefString(key)); + // Execute + bool _retval = CefV8ValueCppToC::Get(self)->DeleteValue( + CefString(key)); + + // Return type: bool + return _retval; } + int CEF_CALLBACK v8value_delete_value_byindex(struct _cef_v8value_t* self, - int index) + size_t index) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - DCHECK(index >= 0); - if(!self || index < 0) + if (!self) return 0; - return CefV8ValueCppToC::Get(self)->DeleteValue(index); + // Execute + bool _retval = CefV8ValueCppToC::Get(self)->DeleteValue( + index); + + // Return type: bool + return _retval; } + struct _cef_v8value_t* CEF_CALLBACK v8value_get_value_bykey( struct _cef_v8value_t* self, const cef_string_t* key) { - DCHECK(self); - DCHECK(key); - if(!self || !key) - return 0; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - CefRefPtr valuePtr = - CefV8ValueCppToC::Get(self)->GetValue(CefString(key)); - return CefV8ValueCppToC::Wrap(valuePtr); + DCHECK(self); + if (!self) + return NULL; + // Verify param: key; type: string_byref_const + DCHECK(key); + if (!key) + return NULL; + + // Execute + CefRefPtr _retval = CefV8ValueCppToC::Get(self)->GetValue( + CefString(key)); + + // Return type: refptr_same + return CefV8ValueCppToC::Wrap(_retval); } + struct _cef_v8value_t* CEF_CALLBACK v8value_get_value_byindex( - struct _cef_v8value_t* self, int index) + struct _cef_v8value_t* self, size_t index) { - DCHECK(self); - DCHECK(index >= 0); - if(!self || index < 0) - return 0; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - CefRefPtr valuePtr = - CefV8ValueCppToC::Get(self)->GetValue(index); - return CefV8ValueCppToC::Wrap(valuePtr); + DCHECK(self); + if (!self) + return NULL; + + // Execute + CefRefPtr _retval = CefV8ValueCppToC::Get(self)->GetValue( + index); + + // Return type: refptr_same + return CefV8ValueCppToC::Wrap(_retval); } + int CEF_CALLBACK v8value_set_value_bykey(struct _cef_v8value_t* self, const cef_string_t* key, struct _cef_v8value_t* value, enum cef_v8_propertyattribute_t attribute) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: key; type: string_byref_const DCHECK(key); + if (!key) + return 0; + // Verify param: value; type: refptr_same DCHECK(value); - if(!self || !key || !value) + if (!value) return 0; - CefRefPtr valuePtr = CefV8ValueCppToC::Unwrap(value); - return CefV8ValueCppToC::Get(self)->SetValue(CefString(key), valuePtr, + // Execute + bool _retval = CefV8ValueCppToC::Get(self)->SetValue( + CefString(key), + CefV8ValueCppToC::Unwrap(value), attribute); + + // Return type: bool + return _retval; } + int CEF_CALLBACK v8value_set_value_byindex(struct _cef_v8value_t* self, - int index, struct _cef_v8value_t* value) + size_t index, struct _cef_v8value_t* value) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - DCHECK(index >= 0); + if (!self) + return 0; + // Verify param: value; type: refptr_same DCHECK(value); - if(!self || index < 0 || !value) + if (!value) return 0; - CefRefPtr valuePtr = CefV8ValueCppToC::Unwrap(value); - return CefV8ValueCppToC::Get(self)->SetValue(index, valuePtr); + // Execute + bool _retval = CefV8ValueCppToC::Get(self)->SetValue( + index, + CefV8ValueCppToC::Unwrap(value)); + + // Return type: bool + return _retval; } + int CEF_CALLBACK v8value_set_value_byaccessor(struct _cef_v8value_t* self, const cef_string_t* key, enum cef_v8_accesscontrol_t settings, enum cef_v8_propertyattribute_t attribute) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: key; type: string_byref_const DCHECK(key); - if(!self || !key) + if (!key) return 0; - return CefV8ValueCppToC::Get(self)->SetValue(CefString(key), - settings, attribute); + // Execute + bool _retval = CefV8ValueCppToC::Get(self)->SetValue( + CefString(key), + settings, + attribute); + + // Return type: bool + return _retval; } + int CEF_CALLBACK v8value_get_keys(struct _cef_v8value_t* self, cef_string_list_t keys) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: keys; type: string_vec_byref DCHECK(keys); - if(!self || !keys) + if (!keys) return 0; + // Translate param: keys; type: string_vec_byref std::vector keysList; - CefV8ValueCppToC::Get(self)->GetKeys(keysList); - size_t size = keysList.size(); - for(size_t i = 0; i < size; ++i) - cef_string_list_append(keys, keysList[i].GetStruct()); - return size; + transfer_string_list_contents(keys, keysList); + + // Execute + bool _retval = CefV8ValueCppToC::Get(self)->GetKeys( + keysList); + + // Restore param: keys; type: string_vec_byref + cef_string_list_clear(keys); + transfer_string_list_contents(keysList, keys); + + // Return type: bool + return _retval; } + cef_base_t* CEF_CALLBACK v8value_get_user_data(struct _cef_v8value_t* self) { - DCHECK(self); - if(!self) - return 0; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - CefRefPtr base = CefV8ValueCppToC::Get(self)->GetUserData(); - if(base.get()) - return CefBaseCToCpp::Unwrap(base); - return NULL; + DCHECK(self); + if (!self) + return NULL; + + // Execute + CefRefPtr _retval = CefV8ValueCppToC::Get(self)->GetUserData(); + + // Return type: refptr_diff + return CefBaseCToCpp::Unwrap(_retval); } + int CEF_CALLBACK v8value_get_array_length(struct _cef_v8value_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefV8ValueCppToC::Get(self)->GetArrayLength(); + // Execute + int _retval = CefV8ValueCppToC::Get(self)->GetArrayLength(); + + // Return type: simple + return _retval; } + cef_string_userfree_t CEF_CALLBACK v8value_get_function_name( struct _cef_v8value_t* self) { - DCHECK(self); - if(!self) - return 0; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - CefString functionNameStr = CefV8ValueCppToC::Get(self)->GetFunctionName(); - return functionNameStr.DetachToUserFree(); + DCHECK(self); + if (!self) + return NULL; + + // Execute + CefString _retval = CefV8ValueCppToC::Get(self)->GetFunctionName(); + + // Return type: string + return _retval.DetachToUserFree(); } + cef_v8handler_t* CEF_CALLBACK v8value_get_function_handler( struct _cef_v8value_t* self) { - DCHECK(self); - if(!self) - return 0; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - CefRefPtr handlerPtr = - CefV8ValueCppToC::Get(self)->GetFunctionHandler(); - if(handlerPtr.get()) - return CefV8HandlerCToCpp::Unwrap(handlerPtr); - return NULL; + DCHECK(self); + if (!self) + return NULL; + + // Execute + CefRefPtr _retval = CefV8ValueCppToC::Get( + self)->GetFunctionHandler(); + + // Return type: refptr_diff + return CefV8HandlerCToCpp::Unwrap(_retval); } + int CEF_CALLBACK v8value_execute_function(struct _cef_v8value_t* self, - struct _cef_v8value_t* object, size_t argumentCount, + struct _cef_v8value_t* object, size_t argumentsCount, struct _cef_v8value_t* const* arguments, struct _cef_v8value_t** retval, cef_v8exception_t** exception, int rethrow_exception) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; + // Verify param: arguments; type: refptr_vec_same_byref_const + DCHECK(argumentsCount == 0 || arguments); + if (argumentsCount > 0 && !arguments) + return 0; + // Verify param: retval; type: refptr_same_byref + DCHECK(retval); + if (!retval) + return 0; + // Verify param: exception; type: refptr_same_byref + DCHECK(exception); + if (!exception) + return 0; + // Unverified params: object - CefRefPtr objectPtr; - if(object) - objectPtr = CefV8ValueCppToC::Unwrap(object); - - CefV8ValueList argsList; - for(size_t i = 0; i < argumentCount; i++) - argsList.push_back(CefV8ValueCppToC::Unwrap(arguments[i])); - + // Translate param: arguments; type: refptr_vec_same_byref_const + std::vector > argumentsList; + if (argumentsCount > 0) { + for (size_t i = 0; i < argumentsCount; ++i) { + argumentsList.push_back(CefV8ValueCppToC::Unwrap(arguments[i])); + } + } + // Translate param: retval; type: refptr_same_byref CefRefPtr retvalPtr; + if (retval && *retval) + retvalPtr = CefV8ValueCppToC::Unwrap(*retval); + CefV8Value* retvalOrig = retvalPtr.get(); + // Translate param: exception; type: refptr_same_byref CefRefPtr exceptionPtr; + if (exception && *exception) + exceptionPtr = CefV8ExceptionCppToC::Unwrap(*exception); + CefV8Exception* exceptionOrig = exceptionPtr.get(); - bool rv = CefV8ValueCppToC::Get(self)->ExecuteFunction(objectPtr, - argsList, retvalPtr, exceptionPtr, rethrow_exception?true:false); + // Execute + bool _retval = CefV8ValueCppToC::Get(self)->ExecuteFunction( + CefV8ValueCppToC::Unwrap(object), + argumentsList, + retvalPtr, + exceptionPtr, + rethrow_exception?true:false); - if( retvalPtr.get() && retval) - *retval = CefV8ValueCppToC::Wrap(retvalPtr); - if (exceptionPtr.get() && exception) - *exception = CefV8ExceptionCppToC::Wrap(exceptionPtr); + // Restore param: retval; type: refptr_same_byref + if (retval) { + if (retvalPtr.get()) { + if (retvalPtr.get() != retvalOrig) { + *retval = CefV8ValueCppToC::Wrap(retvalPtr); + } + } else { + *retval = NULL; + } + } + // Restore param: exception; type: refptr_same_byref + if (exception) { + if (exceptionPtr.get()) { + if (exceptionPtr.get() != exceptionOrig) { + *exception = CefV8ExceptionCppToC::Wrap(exceptionPtr); + } + } else { + *exception = NULL; + } + } - return rv; + // Return type: bool + return _retval; } + int CEF_CALLBACK v8value_execute_function_with_context( struct _cef_v8value_t* self, cef_v8context_t* context, - struct _cef_v8value_t* object, size_t argumentCount, + struct _cef_v8value_t* object, size_t argumentsCount, struct _cef_v8value_t* const* arguments, struct _cef_v8value_t** retval, cef_v8exception_t** exception, int rethrow_exception) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; + // Verify param: context; type: refptr_same + DCHECK(context); + if (!context) + return 0; + // Verify param: arguments; type: refptr_vec_same_byref_const + DCHECK(argumentsCount == 0 || arguments); + if (argumentsCount > 0 && !arguments) + return 0; + // Verify param: retval; type: refptr_same_byref + DCHECK(retval); + if (!retval) + return 0; + // Verify param: exception; type: refptr_same_byref + DCHECK(exception); + if (!exception) + return 0; + // Unverified params: object - CefRefPtr contextPtr; - if(context) - contextPtr = CefV8ContextCppToC::Unwrap(context); - - CefRefPtr objectPtr; - if(object) - objectPtr = CefV8ValueCppToC::Unwrap(object); - - CefV8ValueList argsList; - for(size_t i = 0; i < argumentCount; i++) - argsList.push_back(CefV8ValueCppToC::Unwrap(arguments[i])); - + // Translate param: arguments; type: refptr_vec_same_byref_const + std::vector > argumentsList; + if (argumentsCount > 0) { + for (size_t i = 0; i < argumentsCount; ++i) { + argumentsList.push_back(CefV8ValueCppToC::Unwrap(arguments[i])); + } + } + // Translate param: retval; type: refptr_same_byref CefRefPtr retvalPtr; + if (retval && *retval) + retvalPtr = CefV8ValueCppToC::Unwrap(*retval); + CefV8Value* retvalOrig = retvalPtr.get(); + // Translate param: exception; type: refptr_same_byref CefRefPtr exceptionPtr; + if (exception && *exception) + exceptionPtr = CefV8ExceptionCppToC::Unwrap(*exception); + CefV8Exception* exceptionOrig = exceptionPtr.get(); - bool rv = CefV8ValueCppToC::Get(self)->ExecuteFunctionWithContext( - contextPtr, objectPtr, argsList, retvalPtr, exceptionPtr, + // Execute + bool _retval = CefV8ValueCppToC::Get(self)->ExecuteFunctionWithContext( + CefV8ContextCppToC::Unwrap(context), + CefV8ValueCppToC::Unwrap(object), + argumentsList, + retvalPtr, + exceptionPtr, rethrow_exception?true:false); - if (retvalPtr.get() && retval) - *retval = CefV8ValueCppToC::Wrap(retvalPtr); - if (exceptionPtr.get() && exception) - *exception = CefV8ExceptionCppToC::Wrap(exceptionPtr); + // Restore param: retval; type: refptr_same_byref + if (retval) { + if (retvalPtr.get()) { + if (retvalPtr.get() != retvalOrig) { + *retval = CefV8ValueCppToC::Wrap(retvalPtr); + } + } else { + *retval = NULL; + } + } + // Restore param: exception; type: refptr_same_byref + if (exception) { + if (exceptionPtr.get()) { + if (exceptionPtr.get() != exceptionOrig) { + *exception = CefV8ExceptionCppToC::Wrap(exceptionPtr); + } + } else { + *exception = NULL; + } + } - return rv; + // Return type: bool + return _retval; } + // CONSTRUCTOR - Do not edit by hand. CefV8ValueCppToC::CefV8ValueCppToC(CefV8Value* cls) diff --git a/libcef_dll/cpptoc/v8value_cpptoc.h b/libcef_dll/cpptoc/v8value_cpptoc.h index da541b492..930f7efc3 100644 --- a/libcef_dll/cpptoc/v8value_cpptoc.h +++ b/libcef_dll/cpptoc/v8value_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _V8VALUE_CPPTOC_H #define _V8VALUE_CPPTOC_H diff --git a/libcef_dll/cpptoc/web_urlrequest_client_cpptoc.cc b/libcef_dll/cpptoc/web_urlrequest_client_cpptoc.cc index ad45327e1..377d1a194 100644 --- a/libcef_dll/cpptoc/web_urlrequest_client_cpptoc.cc +++ b/libcef_dll/cpptoc/web_urlrequest_client_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -22,86 +22,148 @@ void CEF_CALLBACK web_urlrequest_client_on_state_change( struct _cef_web_urlrequest_client_t* self, cef_web_urlrequest_t* requester, enum cef_weburlrequest_state_t state) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: requester; type: refptr_diff DCHECK(requester); - if(!self || !requester) + if (!requester) return; + // Execute CefWebURLRequestClientCppToC::Get(self)->OnStateChange( - CefWebURLRequestCToCpp::Wrap(requester), state ); + CefWebURLRequestCToCpp::Wrap(requester), + state); } + void CEF_CALLBACK web_urlrequest_client_on_redirect( struct _cef_web_urlrequest_client_t* self, cef_web_urlrequest_t* requester, cef_request_t* request, cef_response_t* response) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: requester; type: refptr_diff DCHECK(requester); + if (!requester) + return; + // Verify param: request; type: refptr_diff DCHECK(request); + if (!request) + return; + // Verify param: response; type: refptr_diff DCHECK(response); - if(!self || !requester || !request || !response) + if (!response) return; + // Execute CefWebURLRequestClientCppToC::Get(self)->OnRedirect( - CefWebURLRequestCToCpp::Wrap(requester), CefRequestCToCpp::Wrap(request), + CefWebURLRequestCToCpp::Wrap(requester), + CefRequestCToCpp::Wrap(request), CefResponseCToCpp::Wrap(response)); } + void CEF_CALLBACK web_urlrequest_client_on_headers_received( struct _cef_web_urlrequest_client_t* self, cef_web_urlrequest_t* requester, cef_response_t* response) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: requester; type: refptr_diff DCHECK(requester); + if (!requester) + return; + // Verify param: response; type: refptr_diff DCHECK(response); - if(!self || !requester || !response) + if (!response) return; + // Execute CefWebURLRequestClientCppToC::Get(self)->OnHeadersReceived( CefWebURLRequestCToCpp::Wrap(requester), CefResponseCToCpp::Wrap(response)); } + void CEF_CALLBACK web_urlrequest_client_on_progress( struct _cef_web_urlrequest_client_t* self, cef_web_urlrequest_t* requester, uint64 bytesSent, uint64 totalBytesToBeSent) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: requester; type: refptr_diff DCHECK(requester); - if(!self || !requester) + if (!requester) return; + // Execute CefWebURLRequestClientCppToC::Get(self)->OnProgress( - CefWebURLRequestCToCpp::Wrap(requester), bytesSent, totalBytesToBeSent); + CefWebURLRequestCToCpp::Wrap(requester), + bytesSent, + totalBytesToBeSent); } + void CEF_CALLBACK web_urlrequest_client_on_data( struct _cef_web_urlrequest_client_t* self, cef_web_urlrequest_t* requester, const void* data, int dataLength) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: requester; type: refptr_diff DCHECK(requester); - if(!self || !requester) + if (!requester) + return; + // Verify param: data; type: simple_byaddr + DCHECK(data); + if (!data) return; + // Execute CefWebURLRequestClientCppToC::Get(self)->OnData( - CefWebURLRequestCToCpp::Wrap(requester), data, dataLength); + CefWebURLRequestCToCpp::Wrap(requester), + data, + dataLength); } + void CEF_CALLBACK web_urlrequest_client_on_error( struct _cef_web_urlrequest_client_t* self, cef_web_urlrequest_t* requester, enum cef_handler_errorcode_t errorCode) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return; + // Verify param: requester; type: refptr_diff DCHECK(requester); - if(!self || !requester) + if (!requester) return; + // Execute CefWebURLRequestClientCppToC::Get(self)->OnError( - CefWebURLRequestCToCpp::Wrap(requester), errorCode); + CefWebURLRequestCToCpp::Wrap(requester), + errorCode); } + // CONSTRUCTOR - Do not edit by hand. CefWebURLRequestClientCppToC::CefWebURLRequestClientCppToC( diff --git a/libcef_dll/cpptoc/web_urlrequest_client_cpptoc.h b/libcef_dll/cpptoc/web_urlrequest_client_cpptoc.h index fabcd94d9..7d891b0d8 100644 --- a/libcef_dll/cpptoc/web_urlrequest_client_cpptoc.h +++ b/libcef_dll/cpptoc/web_urlrequest_client_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _WEBURLREQUESTCLIENT_CPPTOC_H #define _WEBURLREQUESTCLIENT_CPPTOC_H diff --git a/libcef_dll/cpptoc/web_urlrequest_cpptoc.cc b/libcef_dll/cpptoc/web_urlrequest_cpptoc.cc index 270db8ab8..b08795ddd 100644 --- a/libcef_dll/cpptoc/web_urlrequest_cpptoc.cc +++ b/libcef_dll/cpptoc/web_urlrequest_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -20,42 +20,62 @@ CEF_EXPORT cef_web_urlrequest_t* cef_web_urlrequest_create( cef_request_t* request, struct _cef_web_urlrequest_client_t* client) { - CefRefPtr requestPtr = CefRequestCppToC::Unwrap(request); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - CefRefPtr clientPtr; - if(client) - clientPtr = CefWebURLRequestClientCToCpp::Wrap(client); + // Verify param: request; type: refptr_same + DCHECK(request); + if (!request) + return NULL; + // Verify param: client; type: refptr_diff + DCHECK(client); + if (!client) + return NULL; - CefRefPtr impl = - CefWebURLRequest::CreateWebURLRequest(requestPtr, clientPtr); - if(impl.get()) - return CefWebURLRequestCppToC::Wrap(impl); - return NULL; + // Execute + CefRefPtr _retval = CefWebURLRequest::CreateWebURLRequest( + CefRequestCppToC::Unwrap(request), + CefWebURLRequestClientCToCpp::Wrap(client)); + + // Return type: refptr_same + return CefWebURLRequestCppToC::Wrap(_retval); } + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK web_urlrequest_cancel(struct _cef_web_urlrequest_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return; + // Execute CefWebURLRequestCppToC::Get(self)->Cancel(); } + enum cef_weburlrequest_state_t CEF_CALLBACK web_urlrequest_get_state( struct _cef_web_urlrequest_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return WUR_STATE_UNSENT; - return CefWebURLRequestCppToC::Get(self)->GetState(); + // Execute + cef_weburlrequest_state_t _retval = CefWebURLRequestCppToC::Get( + self)->GetState(); + + // Return type: simple + return _retval; } + // CONSTRUCTOR - Do not edit by hand. CefWebURLRequestCppToC::CefWebURLRequestCppToC(CefWebURLRequest* cls) diff --git a/libcef_dll/cpptoc/web_urlrequest_cpptoc.h b/libcef_dll/cpptoc/web_urlrequest_cpptoc.h index 934fe263f..8601c2197 100644 --- a/libcef_dll/cpptoc/web_urlrequest_cpptoc.h +++ b/libcef_dll/cpptoc/web_urlrequest_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _WEBURLREQUEST_CPPTOC_H #define _WEBURLREQUEST_CPPTOC_H diff --git a/libcef_dll/cpptoc/write_handler_cpptoc.cc b/libcef_dll/cpptoc/write_handler_cpptoc.cc index 7409c3fbe..901db462b 100644 --- a/libcef_dll/cpptoc/write_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/write_handler_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -18,42 +18,79 @@ size_t CEF_CALLBACK write_handler_write(struct _cef_write_handler_t* self, const void* ptr, size_t size, size_t n) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) + return 0; + // Verify param: ptr; type: simple_byaddr + DCHECK(ptr); + if (!ptr) return 0; - return CefWriteHandlerCppToC::Get(self)->Write(ptr, size, n); + // Execute + size_t _retval = CefWriteHandlerCppToC::Get(self)->Write( + ptr, + size, + n); + + // Return type: simple + return _retval; } + int CEF_CALLBACK write_handler_seek(struct _cef_write_handler_t* self, long offset, int whence) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefWriteHandlerCppToC::Get(self)->Seek(offset, whence); + // Execute + int _retval = CefWriteHandlerCppToC::Get(self)->Seek( + offset, + whence); + + // Return type: simple + return _retval; } + long CEF_CALLBACK write_handler_tell(struct _cef_write_handler_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefWriteHandlerCppToC::Get(self)->Tell(); + // Execute + long _retval = CefWriteHandlerCppToC::Get(self)->Tell(); + + // Return type: simple + return _retval; } + int CEF_CALLBACK write_handler_flush(struct _cef_write_handler_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefWriteHandlerCppToC::Get(self)->Flush(); + // Execute + int _retval = CefWriteHandlerCppToC::Get(self)->Flush(); + + // Return type: simple + return _retval; } + // CONSTRUCTOR - Do not edit by hand. CefWriteHandlerCppToC::CefWriteHandlerCppToC(CefWriteHandler* cls) diff --git a/libcef_dll/cpptoc/write_handler_cpptoc.h b/libcef_dll/cpptoc/write_handler_cpptoc.h index 9cf60294a..30e032e8b 100644 --- a/libcef_dll/cpptoc/write_handler_cpptoc.h +++ b/libcef_dll/cpptoc/write_handler_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _WRITEHANDLER_CPPTOC_H #define _WRITEHANDLER_CPPTOC_H diff --git a/libcef_dll/cpptoc/xml_reader_cpptoc.cc b/libcef_dll/cpptoc/xml_reader_cpptoc.cc index 986bdb45b..14aee2ee3 100644 --- a/libcef_dll/cpptoc/xml_reader_cpptoc.cc +++ b/libcef_dll/cpptoc/xml_reader_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -19,324 +19,551 @@ CEF_EXPORT cef_xml_reader_t* cef_xml_reader_create(cef_stream_reader_t* stream, enum cef_xml_encoding_type_t encodingType, const cef_string_t* URI) { - CefRefPtr impl = CefXmlReader::Create( - CefStreamReaderCppToC::Unwrap(stream), encodingType, CefString(URI)); - if(impl.get()) - return CefXmlReaderCppToC::Wrap(impl); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: stream; type: refptr_same + DCHECK(stream); + if (!stream) + return NULL; + // Verify param: URI; type: string_byref_const + DCHECK(URI); + if (!URI) + return NULL; + + // Execute + CefRefPtr _retval = CefXmlReader::Create( + CefStreamReaderCppToC::Unwrap(stream), + encodingType, + CefString(URI)); + + // Return type: refptr_same + return CefXmlReaderCppToC::Wrap(_retval); } + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK xml_reader_move_to_next_node(struct _cef_xml_reader_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefXmlReaderCppToC::Get(self)->MoveToNextNode(); + // Execute + bool _retval = CefXmlReaderCppToC::Get(self)->MoveToNextNode(); + + // Return type: bool + return _retval; } + int CEF_CALLBACK xml_reader_close(struct _cef_xml_reader_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefXmlReaderCppToC::Get(self)->Close(); + // Execute + bool _retval = CefXmlReaderCppToC::Get(self)->Close(); + + // Return type: bool + return _retval; } + int CEF_CALLBACK xml_reader_has_error(struct _cef_xml_reader_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefXmlReaderCppToC::Get(self)->HasError(); + // Execute + bool _retval = CefXmlReaderCppToC::Get(self)->HasError(); + + // Return type: bool + return _retval; } + cef_string_userfree_t CEF_CALLBACK xml_reader_get_error( struct _cef_xml_reader_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefString retStr = CefXmlReaderCppToC::Get(self)->GetError(); - return retStr.DetachToUserFree(); + // Execute + CefString _retval = CefXmlReaderCppToC::Get(self)->GetError(); + + // Return type: string + return _retval.DetachToUserFree(); } + enum cef_xml_node_type_t CEF_CALLBACK xml_reader_get_type( struct _cef_xml_reader_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return XML_NODE_UNSUPPORTED; - return CefXmlReaderCppToC::Get(self)->GetType(); + // Execute + cef_xml_node_type_t _retval = CefXmlReaderCppToC::Get(self)->GetType(); + + // Return type: simple + return _retval; } + int CEF_CALLBACK xml_reader_get_depth(struct _cef_xml_reader_t* self) { - DCHECK(self); - if(!self) - return -1; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return CefXmlReaderCppToC::Get(self)->GetDepth(); + DCHECK(self); + if (!self) + return 0; + + // Execute + int _retval = CefXmlReaderCppToC::Get(self)->GetDepth(); + + // Return type: simple + return _retval; } + cef_string_userfree_t CEF_CALLBACK xml_reader_get_local_name( struct _cef_xml_reader_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefString retStr = CefXmlReaderCppToC::Get(self)->GetLocalName(); - return retStr.DetachToUserFree(); + // Execute + CefString _retval = CefXmlReaderCppToC::Get(self)->GetLocalName(); + + // Return type: string + return _retval.DetachToUserFree(); } + cef_string_userfree_t CEF_CALLBACK xml_reader_get_prefix( struct _cef_xml_reader_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefString retStr = CefXmlReaderCppToC::Get(self)->GetPrefix(); - return retStr.DetachToUserFree(); + // Execute + CefString _retval = CefXmlReaderCppToC::Get(self)->GetPrefix(); + + // Return type: string + return _retval.DetachToUserFree(); } + cef_string_userfree_t CEF_CALLBACK xml_reader_get_qualified_name( struct _cef_xml_reader_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefString retStr = CefXmlReaderCppToC::Get(self)->GetQualifiedName(); - return retStr.DetachToUserFree(); + // Execute + CefString _retval = CefXmlReaderCppToC::Get(self)->GetQualifiedName(); + + // Return type: string + return _retval.DetachToUserFree(); } + cef_string_userfree_t CEF_CALLBACK xml_reader_get_namespace_uri( struct _cef_xml_reader_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefString retStr = CefXmlReaderCppToC::Get(self)->GetNamespaceURI(); - return retStr.DetachToUserFree(); + // Execute + CefString _retval = CefXmlReaderCppToC::Get(self)->GetNamespaceURI(); + + // Return type: string + return _retval.DetachToUserFree(); } + cef_string_userfree_t CEF_CALLBACK xml_reader_get_base_uri( struct _cef_xml_reader_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefString retStr = CefXmlReaderCppToC::Get(self)->GetBaseURI(); - return retStr.DetachToUserFree(); + // Execute + CefString _retval = CefXmlReaderCppToC::Get(self)->GetBaseURI(); + + // Return type: string + return _retval.DetachToUserFree(); } + cef_string_userfree_t CEF_CALLBACK xml_reader_get_xml_lang( struct _cef_xml_reader_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefString retStr = CefXmlReaderCppToC::Get(self)->GetXmlLang(); - return retStr.DetachToUserFree(); + // Execute + CefString _retval = CefXmlReaderCppToC::Get(self)->GetXmlLang(); + + // Return type: string + return _retval.DetachToUserFree(); } + int CEF_CALLBACK xml_reader_is_empty_element(struct _cef_xml_reader_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefXmlReaderCppToC::Get(self)->IsEmptyElement(); + // Execute + bool _retval = CefXmlReaderCppToC::Get(self)->IsEmptyElement(); + + // Return type: bool + return _retval; } + int CEF_CALLBACK xml_reader_has_value(struct _cef_xml_reader_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefXmlReaderCppToC::Get(self)->HasValue(); + // Execute + bool _retval = CefXmlReaderCppToC::Get(self)->HasValue(); + + // Return type: bool + return _retval; } + cef_string_userfree_t CEF_CALLBACK xml_reader_get_value( struct _cef_xml_reader_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefString retStr = CefXmlReaderCppToC::Get(self)->GetValue(); - return retStr.DetachToUserFree(); + // Execute + CefString _retval = CefXmlReaderCppToC::Get(self)->GetValue(); + + // Return type: string + return _retval.DetachToUserFree(); } + int CEF_CALLBACK xml_reader_has_attributes(struct _cef_xml_reader_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefXmlReaderCppToC::Get(self)->HasAttributes(); + // Execute + bool _retval = CefXmlReaderCppToC::Get(self)->HasAttributes(); + + // Return type: bool + return _retval; } + size_t CEF_CALLBACK xml_reader_get_attribute_count( struct _cef_xml_reader_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefXmlReaderCppToC::Get(self)->GetAttributeCount(); + // Execute + size_t _retval = CefXmlReaderCppToC::Get(self)->GetAttributeCount(); + + // Return type: simple + return _retval; } + cef_string_userfree_t CEF_CALLBACK xml_reader_get_attribute_byindex( - struct _cef_xml_reader_t* self, int index) + struct _cef_xml_reader_t* self, size_t index) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefString retStr = CefXmlReaderCppToC::Get(self)->GetAttribute(index); - return retStr.DetachToUserFree(); + // Execute + CefString _retval = CefXmlReaderCppToC::Get(self)->GetAttribute( + index); + + // Return type: string + return _retval.DetachToUserFree(); } + cef_string_userfree_t CEF_CALLBACK xml_reader_get_attribute_byqname( struct _cef_xml_reader_t* self, const cef_string_t* qualifiedName) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return NULL; + // Verify param: qualifiedName; type: string_byref_const DCHECK(qualifiedName); - if(!self || !qualifiedName) + if (!qualifiedName) return NULL; - CefString retStr = CefXmlReaderCppToC::Get(self)->GetAttribute( + // Execute + CefString _retval = CefXmlReaderCppToC::Get(self)->GetAttribute( CefString(qualifiedName)); - return retStr.DetachToUserFree(); + + // Return type: string + return _retval.DetachToUserFree(); } + cef_string_userfree_t CEF_CALLBACK xml_reader_get_attribute_bylname( struct _cef_xml_reader_t* self, const cef_string_t* localName, const cef_string_t* namespaceURI) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return NULL; + // Verify param: localName; type: string_byref_const DCHECK(localName); + if (!localName) + return NULL; + // Verify param: namespaceURI; type: string_byref_const DCHECK(namespaceURI); - if(!self || !localName || !namespaceURI) + if (!namespaceURI) return NULL; - CefString retStr = CefXmlReaderCppToC::Get(self)->GetAttribute( - CefString(localName), CefString(namespaceURI)); - return retStr.DetachToUserFree(); + // Execute + CefString _retval = CefXmlReaderCppToC::Get(self)->GetAttribute( + CefString(localName), + CefString(namespaceURI)); + + // Return type: string + return _retval.DetachToUserFree(); } + cef_string_userfree_t CEF_CALLBACK xml_reader_get_inner_xml( struct _cef_xml_reader_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefString retStr = CefXmlReaderCppToC::Get(self)->GetInnerXml(); - return retStr.DetachToUserFree(); + // Execute + CefString _retval = CefXmlReaderCppToC::Get(self)->GetInnerXml(); + + // Return type: string + return _retval.DetachToUserFree(); } + cef_string_userfree_t CEF_CALLBACK xml_reader_get_outer_xml( struct _cef_xml_reader_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefString retStr = CefXmlReaderCppToC::Get(self)->GetOuterXml(); - return retStr.DetachToUserFree(); + // Execute + CefString _retval = CefXmlReaderCppToC::Get(self)->GetOuterXml(); + + // Return type: string + return _retval.DetachToUserFree(); } + int CEF_CALLBACK xml_reader_get_line_number(struct _cef_xml_reader_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefXmlReaderCppToC::Get(self)->GetLineNumber(); + // Execute + int _retval = CefXmlReaderCppToC::Get(self)->GetLineNumber(); + + // Return type: simple + return _retval; } + int CEF_CALLBACK xml_reader_move_to_attribute_byindex( - struct _cef_xml_reader_t* self, int index) + struct _cef_xml_reader_t* self, size_t index) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefXmlReaderCppToC::Get(self)->MoveToAttribute(index); + // Execute + bool _retval = CefXmlReaderCppToC::Get(self)->MoveToAttribute( + index); + + // Return type: bool + return _retval; } + int CEF_CALLBACK xml_reader_move_to_attribute_byqname( struct _cef_xml_reader_t* self, const cef_string_t* qualifiedName) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: qualifiedName; type: string_byref_const DCHECK(qualifiedName); - if(!self || !qualifiedName) + if (!qualifiedName) return 0; - return CefXmlReaderCppToC::Get(self)->MoveToAttribute( + // Execute + bool _retval = CefXmlReaderCppToC::Get(self)->MoveToAttribute( CefString(qualifiedName)); + + // Return type: bool + return _retval; } + int CEF_CALLBACK xml_reader_move_to_attribute_bylname( struct _cef_xml_reader_t* self, const cef_string_t* localName, const cef_string_t* namespaceURI) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); + if (!self) + return 0; + // Verify param: localName; type: string_byref_const DCHECK(localName); + if (!localName) + return 0; + // Verify param: namespaceURI; type: string_byref_const DCHECK(namespaceURI); - if(!self || !localName || !namespaceURI) + if (!namespaceURI) return 0; - return CefXmlReaderCppToC::Get(self)->MoveToAttribute(CefString(localName), + // Execute + bool _retval = CefXmlReaderCppToC::Get(self)->MoveToAttribute( + CefString(localName), CefString(namespaceURI)); + + // Return type: bool + return _retval; } + int CEF_CALLBACK xml_reader_move_to_first_attribute( struct _cef_xml_reader_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefXmlReaderCppToC::Get(self)->MoveToFirstAttribute(); + // Execute + bool _retval = CefXmlReaderCppToC::Get(self)->MoveToFirstAttribute(); + + // Return type: bool + return _retval; } + int CEF_CALLBACK xml_reader_move_to_next_attribute( struct _cef_xml_reader_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefXmlReaderCppToC::Get(self)->MoveToNextAttribute(); + // Execute + bool _retval = CefXmlReaderCppToC::Get(self)->MoveToNextAttribute(); + + // Return type: bool + return _retval; } + int CEF_CALLBACK xml_reader_move_to_carrying_element( struct _cef_xml_reader_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefXmlReaderCppToC::Get(self)->MoveToCarryingElement(); + // Execute + bool _retval = CefXmlReaderCppToC::Get(self)->MoveToCarryingElement(); + + // Return type: bool + return _retval; } + // CONSTRUCTOR - Do not edit by hand. CefXmlReaderCppToC::CefXmlReaderCppToC(CefXmlReader* cls) diff --git a/libcef_dll/cpptoc/xml_reader_cpptoc.h b/libcef_dll/cpptoc/xml_reader_cpptoc.h index a1b1ee073..679670ecb 100644 --- a/libcef_dll/cpptoc/xml_reader_cpptoc.h +++ b/libcef_dll/cpptoc/xml_reader_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _XMLREADER_CPPTOC_H #define _XMLREADER_CPPTOC_H diff --git a/libcef_dll/cpptoc/zip_reader_cpptoc.cc b/libcef_dll/cpptoc/zip_reader_cpptoc.cc index 40b3a5fc5..69cc5019e 100644 --- a/libcef_dll/cpptoc/zip_reader_cpptoc.cc +++ b/libcef_dll/cpptoc/zip_reader_cpptoc.cc @@ -4,8 +4,8 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // @@ -18,134 +18,237 @@ CEF_EXPORT cef_zip_reader_t* cef_zip_reader_create(cef_stream_reader_t* stream) { - CefRefPtr impl = CefZipReader::Create( + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: stream; type: refptr_same + DCHECK(stream); + if (!stream) + return NULL; + + // Execute + CefRefPtr _retval = CefZipReader::Create( CefStreamReaderCppToC::Unwrap(stream)); - if(impl.get()) - return CefZipReaderCppToC::Wrap(impl); - return NULL; + + // Return type: refptr_same + return CefZipReaderCppToC::Wrap(_retval); } + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK zip_reader_move_to_first_file(struct _cef_zip_reader_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefZipReaderCppToC::Get(self)->MoveToFirstFile(); + // Execute + bool _retval = CefZipReaderCppToC::Get(self)->MoveToFirstFile(); + + // Return type: bool + return _retval; } + int CEF_CALLBACK zip_reader_move_to_next_file(struct _cef_zip_reader_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefZipReaderCppToC::Get(self)->MoveToNextFile(); + // Execute + bool _retval = CefZipReaderCppToC::Get(self)->MoveToNextFile(); + + // Return type: bool + return _retval; } + int CEF_CALLBACK zip_reader_move_to_file(struct _cef_zip_reader_t* self, const cef_string_t* fileName, int caseSensitive) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) + return 0; + // Verify param: fileName; type: string_byref_const + DCHECK(fileName); + if (!fileName) return 0; - return CefZipReaderCppToC::Get(self)->MoveToFile(CefString(fileName), - caseSensitive ? true : false); + // Execute + bool _retval = CefZipReaderCppToC::Get(self)->MoveToFile( + CefString(fileName), + caseSensitive?true:false); + + // Return type: bool + return _retval; } + int CEF_CALLBACK zip_reader_close(struct _cef_zip_reader_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefZipReaderCppToC::Get(self)->Close(); + // Execute + bool _retval = CefZipReaderCppToC::Get(self)->Close(); + + // Return type: bool + return _retval; } + cef_string_userfree_t CEF_CALLBACK zip_reader_get_file_name( struct _cef_zip_reader_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return NULL; - CefString retStr = CefZipReaderCppToC::Get(self)->GetFileName(); - if(!retStr.empty()) - return retStr.DetachToUserFree(); - return NULL; + // Execute + CefString _retval = CefZipReaderCppToC::Get(self)->GetFileName(); + + // Return type: string + return _retval.DetachToUserFree(); } + long CEF_CALLBACK zip_reader_get_file_size(struct _cef_zip_reader_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefZipReaderCppToC::Get(self)->GetFileSize(); + // Execute + long _retval = CefZipReaderCppToC::Get(self)->GetFileSize(); + + // Return type: simple + return _retval; } + time_t CEF_CALLBACK zip_reader_get_file_last_modified( struct _cef_zip_reader_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefZipReaderCppToC::Get(self)->GetFileLastModified(); + // Execute + time_t _retval = CefZipReaderCppToC::Get(self)->GetFileLastModified(); + + // Return type: simple + return _retval; } + int CEF_CALLBACK zip_reader_open_file(struct _cef_zip_reader_t* self, const cef_string_t* password) { - DCHECK(self); - if(!self) - return 0; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return CefZipReaderCppToC::Get(self)->OpenFile(CefString(password)); + DCHECK(self); + if (!self) + return 0; + // Unverified params: password + + // Execute + bool _retval = CefZipReaderCppToC::Get(self)->OpenFile( + CefString(password)); + + // Return type: bool + return _retval; } + int CEF_CALLBACK zip_reader_close_file(struct _cef_zip_reader_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefZipReaderCppToC::Get(self)->CloseFile(); + // Execute + bool _retval = CefZipReaderCppToC::Get(self)->CloseFile(); + + // Return type: bool + return _retval; } + int CEF_CALLBACK zip_reader_read_file(struct _cef_zip_reader_t* self, void* buffer, size_t bufferSize) { - DCHECK(self); - if(!self) - return -1; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return CefZipReaderCppToC::Get(self)->ReadFile(buffer, bufferSize); + DCHECK(self); + if (!self) + return 0; + // Verify param: buffer; type: simple_byaddr + DCHECK(buffer); + if (!buffer) + return 0; + + // Execute + int _retval = CefZipReaderCppToC::Get(self)->ReadFile( + buffer, + bufferSize); + + // Return type: simple + return _retval; } + long CEF_CALLBACK zip_reader_tell(struct _cef_zip_reader_t* self) { - DCHECK(self); - if(!self) - return -1; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return CefZipReaderCppToC::Get(self)->Tell(); + DCHECK(self); + if (!self) + return 0; + + // Execute + long _retval = CefZipReaderCppToC::Get(self)->Tell(); + + // Return type: simple + return _retval; } + int CEF_CALLBACK zip_reader_eof(struct _cef_zip_reader_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + DCHECK(self); - if(!self) + if (!self) return 0; - return CefZipReaderCppToC::Get(self)->Eof(); + // Execute + bool _retval = CefZipReaderCppToC::Get(self)->Eof(); + + // Return type: bool + return _retval; } + // CONSTRUCTOR - Do not edit by hand. CefZipReaderCppToC::CefZipReaderCppToC(CefZipReader* cls) diff --git a/libcef_dll/cpptoc/zip_reader_cpptoc.h b/libcef_dll/cpptoc/zip_reader_cpptoc.h index 6a6b0e24c..fdc3757fd 100644 --- a/libcef_dll/cpptoc/zip_reader_cpptoc.h +++ b/libcef_dll/cpptoc/zip_reader_cpptoc.h @@ -4,10 +4,12 @@ // // --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // + #ifndef _ZIPREADER_CPPTOC_H #define _ZIPREADER_CPPTOC_H diff --git a/libcef_dll/ctocpp/app_ctocpp.cc b/libcef_dll/ctocpp/app_ctocpp.cc index 4c9ab73a4..ee5503b5f 100644 --- a/libcef_dll/ctocpp/app_ctocpp.cc +++ b/libcef_dll/ctocpp/app_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/ctocpp/app_ctocpp.h" @@ -21,14 +21,17 @@ CefRefPtr CefAppCToCpp::GetProxyHandler() if (CEF_MEMBER_MISSING(struct_, get_proxy_handler)) return NULL; - cef_proxy_handler_t* handlerStruct = struct_->get_proxy_handler(struct_); - if(handlerStruct) - return CefProxyHandlerCToCpp::Wrap(handlerStruct); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return NULL; + // Execute + cef_proxy_handler_t* _retval = struct_->get_proxy_handler(struct_); + + // Return type: refptr_same + return CefProxyHandlerCToCpp::Wrap(_retval); } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; #endif diff --git a/libcef_dll/ctocpp/app_ctocpp.h b/libcef_dll/ctocpp/app_ctocpp.h index 82df4b9d9..b221e8562 100644 --- a/libcef_dll/ctocpp/app_ctocpp.h +++ b/libcef_dll/ctocpp/app_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _APP_CTOCPP_H diff --git a/libcef_dll/ctocpp/base_ctocpp.h b/libcef_dll/ctocpp/base_ctocpp.h index 2a74aaef2..8a7de871e 100644 --- a/libcef_dll/ctocpp/base_ctocpp.h +++ b/libcef_dll/ctocpp/base_ctocpp.h @@ -18,6 +18,9 @@ public: // received from the other side. static CefRefPtr Wrap(cef_base_t* s) { + if (!s) + return NULL; + // Wrap their structure with the CefCToCpp object. CefBaseCToCpp* wrapper = new CefBaseCToCpp(s); // Put the wrapper object in a smart pointer. @@ -33,6 +36,9 @@ public: // instance for return back to the other side. static cef_base_t* Unwrap(CefRefPtr c) { + if (!c.get()) + return NULL; + // Cast the object to our wrapper class type. CefBaseCToCpp* wrapper = static_cast(c.get()); // Add a reference to the CefCppToC wrapper object on the other side that diff --git a/libcef_dll/ctocpp/browser_ctocpp.cc b/libcef_dll/ctocpp/browser_ctocpp.cc index 423b82d87..aad112c7d 100644 --- a/libcef_dll/ctocpp/browser_ctocpp.cc +++ b/libcef_dll/ctocpp/browser_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/cpptoc/client_cpptoc.h" @@ -22,22 +22,51 @@ bool CefBrowser::CreateBrowser(CefWindowInfo& windowInfo, CefRefPtr client, const CefString& url, const CefBrowserSettings& settings) { - return cef_browser_create(&windowInfo, CefClientCppToC::Wrap(client), - url.GetStruct(), &settings)?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: client; type: refptr_diff + DCHECK(client.get()); + if (!client.get()) + return false; + // Unverified params: url + + // Execute + int _retval = cef_browser_create( + &windowInfo, + CefClientCppToC::Wrap(client), + url.GetStruct(), + &settings); + + // Return type: bool + return _retval?true:false; } + CefRefPtr CefBrowser::CreateBrowserSync(CefWindowInfo& windowInfo, CefRefPtr client, const CefString& url, const CefBrowserSettings& settings) { - cef_browser_t* impl = cef_browser_create_sync(&windowInfo, - CefClientCppToC::Wrap(client), url.GetStruct(), &settings); - if(impl) - return CefBrowserCToCpp::Wrap(impl); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: client; type: refptr_diff + DCHECK(client.get()); + if (!client.get()) + return NULL; + // Unverified params: url + + // Execute + cef_browser_t* _retval = cef_browser_create_sync( + &windowInfo, + CefClientCppToC::Wrap(client), + url.GetStruct(), + &settings); + + // Return type: refptr_same + return CefBrowserCToCpp::Wrap(_retval); } + // VIRTUAL METHODS - Body may be edited by hand. void CefBrowserCToCpp::ParentWindowWillClose() @@ -45,339 +74,585 @@ void CefBrowserCToCpp::ParentWindowWillClose() if (CEF_MEMBER_MISSING(struct_, parent_window_will_close)) return; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute struct_->parent_window_will_close(struct_); } + void CefBrowserCToCpp::CloseBrowser() { - if(CEF_MEMBER_MISSING(struct_, close_browser)) + if (CEF_MEMBER_MISSING(struct_, close_browser)) return; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute struct_->close_browser(struct_); } + bool CefBrowserCToCpp::CanGoBack() { - if(CEF_MEMBER_MISSING(struct_, can_go_back)) + if (CEF_MEMBER_MISSING(struct_, can_go_back)) return false; - return struct_->can_go_back(struct_) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->can_go_back(struct_); + + // Return type: bool + return _retval?true:false; } + void CefBrowserCToCpp::GoBack() { - if(CEF_MEMBER_MISSING(struct_, go_back)) + if (CEF_MEMBER_MISSING(struct_, go_back)) return; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute struct_->go_back(struct_); } + bool CefBrowserCToCpp::CanGoForward() { - if(CEF_MEMBER_MISSING(struct_, can_go_forward)) + if (CEF_MEMBER_MISSING(struct_, can_go_forward)) return false; - - return struct_->can_go_forward(struct_)?true:false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->can_go_forward(struct_); + + // Return type: bool + return _retval?true:false; } + void CefBrowserCToCpp::GoForward() { - if(CEF_MEMBER_MISSING(struct_, go_forward)) + if (CEF_MEMBER_MISSING(struct_, go_forward)) return; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute struct_->go_forward(struct_); } + void CefBrowserCToCpp::Reload() { - if(CEF_MEMBER_MISSING(struct_, reload)) + if (CEF_MEMBER_MISSING(struct_, reload)) return; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute struct_->reload(struct_); } + void CefBrowserCToCpp::ReloadIgnoreCache() { - if(CEF_MEMBER_MISSING(struct_, reload)) + if (CEF_MEMBER_MISSING(struct_, reload_ignore_cache)) return; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute struct_->reload_ignore_cache(struct_); } + void CefBrowserCToCpp::StopLoad() { - if(CEF_MEMBER_MISSING(struct_, stop_load)) + if (CEF_MEMBER_MISSING(struct_, stop_load)) return; - + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute struct_->stop_load(struct_); } + void CefBrowserCToCpp::SetFocus(bool enable) { - if(CEF_MEMBER_MISSING(struct_, set_focus)) + if (CEF_MEMBER_MISSING(struct_, set_focus)) return; - - struct_->set_focus(struct_, enable); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->set_focus(struct_, + enable); } + CefWindowHandle CefBrowserCToCpp::GetWindowHandle() { - if(CEF_MEMBER_MISSING(struct_, get_window_handle)) - return 0; - - return struct_->get_window_handle(struct_); + if (CEF_MEMBER_MISSING(struct_, get_window_handle)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_window_handle_t _retval = struct_->get_window_handle(struct_); + + // Return type: simple + return _retval; } + CefWindowHandle CefBrowserCToCpp::GetOpenerWindowHandle() { if (CEF_MEMBER_MISSING(struct_, get_opener_window_handle)) - return 0; - - return struct_->get_opener_window_handle(struct_); + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_window_handle_t _retval = struct_->get_opener_window_handle(struct_); + + // Return type: simple + return _retval; } + bool CefBrowserCToCpp::IsPopup() { - if(CEF_MEMBER_MISSING(struct_, is_popup)) + if (CEF_MEMBER_MISSING(struct_, is_popup)) return false; - - return struct_->is_popup(struct_)?true:false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_popup(struct_); + + // Return type: bool + return _retval?true:false; } + bool CefBrowserCToCpp::HasDocument() { - if(CEF_MEMBER_MISSING(struct_, has_document)) + if (CEF_MEMBER_MISSING(struct_, has_document)) return false; - - return struct_->has_document(struct_)?true:false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->has_document(struct_); + + // Return type: bool + return _retval?true:false; } + CefRefPtr CefBrowserCToCpp::GetClient() { if (CEF_MEMBER_MISSING(struct_, get_client)) return NULL; - cef_client_t* clientStruct = struct_->get_client(struct_); - if(clientStruct) - return CefClientCppToC::Unwrap(clientStruct); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return NULL; + // Execute + cef_client_t* _retval = struct_->get_client(struct_); + + // Return type: refptr_diff + return CefClientCppToC::Unwrap(_retval); } + CefRefPtr CefBrowserCToCpp::GetMainFrame() { - if(CEF_MEMBER_MISSING(struct_, get_main_frame)) + if (CEF_MEMBER_MISSING(struct_, get_main_frame)) return NULL; - cef_frame_t* frameStruct = struct_->get_main_frame(struct_); - if(frameStruct) - return CefFrameCToCpp::Wrap(frameStruct); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return NULL; + // Execute + cef_frame_t* _retval = struct_->get_main_frame(struct_); + + // Return type: refptr_same + return CefFrameCToCpp::Wrap(_retval); } + CefRefPtr CefBrowserCToCpp::GetFocusedFrame() { - if(CEF_MEMBER_MISSING(struct_, get_main_frame)) + if (CEF_MEMBER_MISSING(struct_, get_focused_frame)) return NULL; - cef_frame_t* frameStruct = struct_->get_focused_frame(struct_); - if(frameStruct) - return CefFrameCToCpp::Wrap(frameStruct); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return NULL; + // Execute + cef_frame_t* _retval = struct_->get_focused_frame(struct_); + + // Return type: refptr_same + return CefFrameCToCpp::Wrap(_retval); } + CefRefPtr CefBrowserCToCpp::GetFrame(const CefString& name) { - if(CEF_MEMBER_MISSING(struct_, get_main_frame)) + if (CEF_MEMBER_MISSING(struct_, get_frame)) return NULL; - cef_frame_t* frameStruct = struct_->get_frame(struct_, name.GetStruct()); - if(frameStruct) - return CefFrameCToCpp::Wrap(frameStruct); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return NULL; + // Verify param: name; type: string_byref_const + DCHECK(!name.empty()); + if (name.empty()) + return NULL; + + // Execute + cef_frame_t* _retval = struct_->get_frame(struct_, + name.GetStruct()); + + // Return type: refptr_same + return CefFrameCToCpp::Wrap(_retval); } + void CefBrowserCToCpp::GetFrameNames(std::vector& names) { - if(CEF_MEMBER_MISSING(struct_, get_frame_names)) + if (CEF_MEMBER_MISSING(struct_, get_frame_names)) return; - cef_string_list_t list = cef_string_list_alloc(); - if (!list) - return; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - struct_->get_frame_names(struct_, list); + // Translate param: names; type: string_vec_byref + cef_string_list_t namesList = cef_string_list_alloc(); + DCHECK(namesList); + if (namesList) + transfer_string_list_contents(names, namesList); - transfer_string_list_contents(list, names); - cef_string_list_free(list); + // Execute + struct_->get_frame_names(struct_, + namesList); + + // Restore param:names; type: string_vec_byref + if (namesList) { + names.clear(); + transfer_string_list_contents(namesList, names); + cef_string_list_free(namesList); + } } + void CefBrowserCToCpp::Find(int identifier, const CefString& searchText, bool forward, bool matchCase, bool findNext) { - if(CEF_MEMBER_MISSING(struct_, find)) + if (CEF_MEMBER_MISSING(struct_, find)) return; - struct_->find(struct_, identifier, searchText.GetStruct(), forward, - matchCase, findNext); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: searchText; type: string_byref_const + DCHECK(!searchText.empty()); + if (searchText.empty()) + return; + + // Execute + struct_->find(struct_, + identifier, + searchText.GetStruct(), + forward, + matchCase, + findNext); } + void CefBrowserCToCpp::StopFinding(bool clearSelection) { - if(CEF_MEMBER_MISSING(struct_, stop_finding)) + if (CEF_MEMBER_MISSING(struct_, stop_finding)) return; - struct_->stop_finding(struct_, clearSelection); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->stop_finding(struct_, + clearSelection); } + double CefBrowserCToCpp::GetZoomLevel() { - if(CEF_MEMBER_MISSING(struct_, get_zoom_level)) - return 0.0; + if (CEF_MEMBER_MISSING(struct_, get_zoom_level)) + return 0; - return struct_->get_zoom_level(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + double _retval = struct_->get_zoom_level(struct_); + + // Return type: simple + return _retval; } + void CefBrowserCToCpp::SetZoomLevel(double zoomLevel) { - if(CEF_MEMBER_MISSING(struct_, set_zoom_level)) + if (CEF_MEMBER_MISSING(struct_, set_zoom_level)) return; - return struct_->set_zoom_level(struct_, zoomLevel); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->set_zoom_level(struct_, + zoomLevel); } + void CefBrowserCToCpp::ClearHistory() { if (CEF_MEMBER_MISSING(struct_, clear_history)) return; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute struct_->clear_history(struct_); } + void CefBrowserCToCpp::ShowDevTools() { if (CEF_MEMBER_MISSING(struct_, show_dev_tools)) return; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute struct_->show_dev_tools(struct_); } + void CefBrowserCToCpp::CloseDevTools() { if (CEF_MEMBER_MISSING(struct_, close_dev_tools)) return; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute struct_->close_dev_tools(struct_); } + bool CefBrowserCToCpp::IsWindowRenderingDisabled() { if (CEF_MEMBER_MISSING(struct_, is_window_rendering_disabled)) return false; - return struct_->is_window_rendering_disabled(struct_)?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_window_rendering_disabled(struct_); + + // Return type: bool + return _retval?true:false; } + bool CefBrowserCToCpp::GetSize(PaintElementType type, int& width, int& height) { if (CEF_MEMBER_MISSING(struct_, get_size)) return false; - return struct_->get_size(struct_, type, &width, &height)?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_size(struct_, + type, + &width, + &height); + + // Return type: bool + return _retval?true:false; } + void CefBrowserCToCpp::SetSize(PaintElementType type, int width, int height) { if (CEF_MEMBER_MISSING(struct_, set_size)) return; - struct_->set_size(struct_, type, width, height); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->set_size(struct_, + type, + width, + height); } + bool CefBrowserCToCpp::IsPopupVisible() { if (CEF_MEMBER_MISSING(struct_, is_popup_visible)) return false; - return struct_->is_popup_visible(struct_)?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_popup_visible(struct_); + + // Return type: bool + return _retval?true:false; } + void CefBrowserCToCpp::HidePopup() { if (CEF_MEMBER_MISSING(struct_, hide_popup)) return; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute struct_->hide_popup(struct_); } + void CefBrowserCToCpp::Invalidate(const CefRect& dirtyRect) { if (CEF_MEMBER_MISSING(struct_, invalidate)) return; - struct_->invalidate(struct_, &dirtyRect); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->invalidate(struct_, + &dirtyRect); } + bool CefBrowserCToCpp::GetImage(PaintElementType type, int width, int height, void* buffer) { if (CEF_MEMBER_MISSING(struct_, get_image)) return false; - return struct_->get_image(struct_, type, width, height, buffer)?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: buffer; type: simple_byaddr + DCHECK(buffer); + if (!buffer) + return false; + + // Execute + int _retval = struct_->get_image(struct_, + type, + width, + height, + buffer); + + // Return type: bool + return _retval?true:false; } + void CefBrowserCToCpp::SendKeyEvent(KeyType type, int key, int modifiers, bool sysChar, bool imeChar) { - struct_->send_key_event(struct_, type, key, modifiers, sysChar, imeChar); + if (CEF_MEMBER_MISSING(struct_, send_key_event)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->send_key_event(struct_, + type, + key, + modifiers, + sysChar, + imeChar); } + void CefBrowserCToCpp::SendMouseClickEvent(int x, int y, MouseButtonType type, bool mouseUp, int clickCount) { if (CEF_MEMBER_MISSING(struct_, send_mouse_click_event)) return; - struct_->send_mouse_click_event(struct_, x, y, type, mouseUp, clickCount); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->send_mouse_click_event(struct_, + x, + y, + type, + mouseUp, + clickCount); } + void CefBrowserCToCpp::SendMouseMoveEvent(int x, int y, bool mouseLeave) { if (CEF_MEMBER_MISSING(struct_, send_mouse_move_event)) return; - struct_->send_mouse_move_event(struct_, x, y, mouseLeave); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->send_mouse_move_event(struct_, + x, + y, + mouseLeave); } + void CefBrowserCToCpp::SendMouseWheelEvent(int x, int y, int delta) { if (CEF_MEMBER_MISSING(struct_, send_mouse_wheel_event)) return; - struct_->send_mouse_wheel_event(struct_, x, y, delta); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->send_mouse_wheel_event(struct_, + x, + y, + delta); } + void CefBrowserCToCpp::SendFocusEvent(bool setFocus) { if (CEF_MEMBER_MISSING(struct_, send_focus_event)) return; - struct_->send_focus_event(struct_, setFocus); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->send_focus_event(struct_, + setFocus); } + void CefBrowserCToCpp::SendCaptureLostEvent() { if (CEF_MEMBER_MISSING(struct_, send_capture_lost_event)) return; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute struct_->send_capture_lost_event(struct_); } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/browser_ctocpp.h b/libcef_dll/ctocpp/browser_ctocpp.h index 53700cb7c..de9739b20 100644 --- a/libcef_dll/ctocpp/browser_ctocpp.h +++ b/libcef_dll/ctocpp/browser_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _BROWSER_CTOCPP_H diff --git a/libcef_dll/ctocpp/client_ctocpp.cc b/libcef_dll/ctocpp/client_ctocpp.cc index 4be57bc3e..9190b9edf 100644 --- a/libcef_dll/ctocpp/client_ctocpp.cc +++ b/libcef_dll/ctocpp/client_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/ctocpp/client_ctocpp.h" @@ -33,162 +33,197 @@ CefRefPtr CefClientCToCpp::GetLifeSpanHandler() if (CEF_MEMBER_MISSING(struct_, get_life_span_handler)) return NULL; - cef_life_span_handler_t* handlerStruct = - struct_->get_life_span_handler(struct_); - if(handlerStruct) - return CefLifeSpanHandlerCToCpp::Wrap(handlerStruct); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return NULL; + // Execute + cef_life_span_handler_t* _retval = struct_->get_life_span_handler(struct_); + + // Return type: refptr_same + return CefLifeSpanHandlerCToCpp::Wrap(_retval); } + CefRefPtr CefClientCToCpp::GetLoadHandler() { if (CEF_MEMBER_MISSING(struct_, get_load_handler)) return NULL; - cef_load_handler_t* handlerStruct = struct_->get_load_handler(struct_); - if(handlerStruct) - return CefLoadHandlerCToCpp::Wrap(handlerStruct); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return NULL; + // Execute + cef_load_handler_t* _retval = struct_->get_load_handler(struct_); + + // Return type: refptr_same + return CefLoadHandlerCToCpp::Wrap(_retval); } + CefRefPtr CefClientCToCpp::GetRequestHandler() { if (CEF_MEMBER_MISSING(struct_, get_request_handler)) return NULL; - cef_request_handler_t* handlerStruct = struct_->get_request_handler(struct_); - if(handlerStruct) - return CefRequestHandlerCToCpp::Wrap(handlerStruct); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return NULL; + // Execute + cef_request_handler_t* _retval = struct_->get_request_handler(struct_); + + // Return type: refptr_same + return CefRequestHandlerCToCpp::Wrap(_retval); } + CefRefPtr CefClientCToCpp::GetDisplayHandler() { if (CEF_MEMBER_MISSING(struct_, get_display_handler)) return NULL; - cef_display_handler_t* handlerStruct = struct_->get_display_handler(struct_); - if(handlerStruct) - return CefDisplayHandlerCToCpp::Wrap(handlerStruct); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return NULL; + // Execute + cef_display_handler_t* _retval = struct_->get_display_handler(struct_); + + // Return type: refptr_same + return CefDisplayHandlerCToCpp::Wrap(_retval); } + CefRefPtr CefClientCToCpp::GetFocusHandler() { if (CEF_MEMBER_MISSING(struct_, get_focus_handler)) return NULL; - cef_focus_handler_t* handlerStruct = struct_->get_focus_handler(struct_); - if(handlerStruct) - return CefFocusHandlerCToCpp::Wrap(handlerStruct); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return NULL; + // Execute + cef_focus_handler_t* _retval = struct_->get_focus_handler(struct_); + + // Return type: refptr_same + return CefFocusHandlerCToCpp::Wrap(_retval); } + CefRefPtr CefClientCToCpp::GetKeyboardHandler() { if (CEF_MEMBER_MISSING(struct_, get_keyboard_handler)) return NULL; - cef_keyboard_handler_t* handlerStruct = - struct_->get_keyboard_handler(struct_); - if(handlerStruct) - return CefKeyboardHandlerCToCpp::Wrap(handlerStruct); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return NULL; + // Execute + cef_keyboard_handler_t* _retval = struct_->get_keyboard_handler(struct_); + + // Return type: refptr_same + return CefKeyboardHandlerCToCpp::Wrap(_retval); } + CefRefPtr CefClientCToCpp::GetMenuHandler() { if (CEF_MEMBER_MISSING(struct_, get_menu_handler)) return NULL; - cef_menu_handler_t* handlerStruct = struct_->get_menu_handler(struct_); - if(handlerStruct) - return CefMenuHandlerCToCpp::Wrap(handlerStruct); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return NULL; + // Execute + cef_menu_handler_t* _retval = struct_->get_menu_handler(struct_); + + // Return type: refptr_same + return CefMenuHandlerCToCpp::Wrap(_retval); } + CefRefPtr CefClientCToCpp::GetPrintHandler() { if (CEF_MEMBER_MISSING(struct_, get_print_handler)) return NULL; - cef_print_handler_t* handlerStruct = struct_->get_print_handler(struct_); - if(handlerStruct) - return CefPrintHandlerCToCpp::Wrap(handlerStruct); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return NULL; + // Execute + cef_print_handler_t* _retval = struct_->get_print_handler(struct_); + + // Return type: refptr_same + return CefPrintHandlerCToCpp::Wrap(_retval); } + CefRefPtr CefClientCToCpp::GetFindHandler() { if (CEF_MEMBER_MISSING(struct_, get_find_handler)) return NULL; - cef_find_handler_t* handlerStruct = struct_->get_find_handler(struct_); - if(handlerStruct) - return CefFindHandlerCToCpp::Wrap(handlerStruct); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return NULL; + // Execute + cef_find_handler_t* _retval = struct_->get_find_handler(struct_); + + // Return type: refptr_same + return CefFindHandlerCToCpp::Wrap(_retval); } + CefRefPtr CefClientCToCpp::GetJSDialogHandler() { if (CEF_MEMBER_MISSING(struct_, get_jsdialog_handler)) return NULL; - cef_jsdialog_handler_t* handlerStruct = - struct_->get_jsdialog_handler(struct_); - if(handlerStruct) - return CefJSDialogHandlerCToCpp::Wrap(handlerStruct); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return NULL; + // Execute + cef_jsdialog_handler_t* _retval = struct_->get_jsdialog_handler(struct_); + + // Return type: refptr_same + return CefJSDialogHandlerCToCpp::Wrap(_retval); } + CefRefPtr CefClientCToCpp::GetV8ContextHandler() { if (CEF_MEMBER_MISSING(struct_, get_v8context_handler)) return NULL; - cef_v8context_handler_t* handlerStruct = - struct_->get_v8context_handler(struct_); - if(handlerStruct) - return CefV8ContextHandlerCToCpp::Wrap(handlerStruct); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return NULL; + // Execute + cef_v8context_handler_t* _retval = struct_->get_v8context_handler(struct_); + + // Return type: refptr_same + return CefV8ContextHandlerCToCpp::Wrap(_retval); } + CefRefPtr CefClientCToCpp::GetRenderHandler() { if (CEF_MEMBER_MISSING(struct_, get_render_handler)) return NULL; - cef_render_handler_t* handlerStruct = struct_->get_render_handler(struct_); - if(handlerStruct) - return CefRenderHandlerCToCpp::Wrap(handlerStruct); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return NULL; + // Execute + cef_render_handler_t* _retval = struct_->get_render_handler(struct_); + + // Return type: refptr_same + return CefRenderHandlerCToCpp::Wrap(_retval); } + CefRefPtr CefClientCToCpp::GetDragHandler() { if (CEF_MEMBER_MISSING(struct_, get_drag_handler)) return NULL; - cef_drag_handler_t* handlerStruct = struct_->get_drag_handler(struct_); - if(handlerStruct) - return CefDragHandlerCToCpp::Wrap(handlerStruct); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return NULL; + // Execute + cef_drag_handler_t* _retval = struct_->get_drag_handler(struct_); + + // Return type: refptr_same + return CefDragHandlerCToCpp::Wrap(_retval); } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/client_ctocpp.h b/libcef_dll/ctocpp/client_ctocpp.h index ae4d13706..aa0ee9d7c 100644 --- a/libcef_dll/ctocpp/client_ctocpp.h +++ b/libcef_dll/ctocpp/client_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _CLIENT_CTOCPP_H diff --git a/libcef_dll/ctocpp/command_line_ctocpp.cc b/libcef_dll/ctocpp/command_line_ctocpp.cc index 88c36ef46..c66e8542c 100644 --- a/libcef_dll/ctocpp/command_line_ctocpp.cc +++ b/libcef_dll/ctocpp/command_line_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "include/cef_version.h" @@ -25,14 +25,18 @@ CefRefPtr CefCommandLine::CreateCommandLine() DCHECK(false); return NULL; } - - cef_command_line_t* impl = cef_command_line_create(); - if(impl) - return CefCommandLineCToCpp::Wrap(impl); - return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_command_line_t* _retval = cef_command_line_create(); + + // Return type: refptr_same + return CefCommandLineCToCpp::Wrap(_retval); } + // VIRTUAL METHODS - Body may be edited by hand. void CefCommandLineCToCpp::InitFromArgv(int argc, const char* const* argv) @@ -40,139 +44,277 @@ void CefCommandLineCToCpp::InitFromArgv(int argc, const char* const* argv) if (CEF_MEMBER_MISSING(struct_, init_from_argv)) return; - struct_->init_from_argv(struct_, argc, argv); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: argv; type: simple_byaddr + DCHECK(argv); + if (!argv) + return; + + // Execute + struct_->init_from_argv(struct_, + argc, + argv); } + void CefCommandLineCToCpp::InitFromString(const CefString& command_line) { if (CEF_MEMBER_MISSING(struct_, init_from_string)) return; - struct_->init_from_string(struct_, command_line.GetStruct()); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: command_line; type: string_byref_const + DCHECK(!command_line.empty()); + if (command_line.empty()) + return; + + // Execute + struct_->init_from_string(struct_, + command_line.GetStruct()); } + CefString CefCommandLineCToCpp::GetCommandLineString() { - CefString str; if (CEF_MEMBER_MISSING(struct_, get_command_line_string)) - return str; + return CefString(); - cef_string_userfree_t strPtr = struct_->get_command_line_string(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_command_line_string(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + CefString CefCommandLineCToCpp::GetProgram() { - CefString str; if (CEF_MEMBER_MISSING(struct_, get_program)) - return str; + return CefString(); - cef_string_userfree_t strPtr = struct_->get_program(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_program(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + void CefCommandLineCToCpp::SetProgram(const CefString& program) { if (CEF_MEMBER_MISSING(struct_, set_program)) return; - struct_->set_program(struct_, program.GetStruct()); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: program; type: string_byref_const + DCHECK(!program.empty()); + if (program.empty()) + return; + + // Execute + struct_->set_program(struct_, + program.GetStruct()); } + bool CefCommandLineCToCpp::HasSwitches() { if (CEF_MEMBER_MISSING(struct_, has_switches)) return false; - return struct_->has_switches(struct_)?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->has_switches(struct_); + + // Return type: bool + return _retval?true:false; } + bool CefCommandLineCToCpp::HasSwitch(const CefString& name) { if (CEF_MEMBER_MISSING(struct_, has_switch)) return false; - return struct_->has_switch(struct_, name.GetStruct())?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: name; type: string_byref_const + DCHECK(!name.empty()); + if (name.empty()) + return false; + + // Execute + int _retval = struct_->has_switch(struct_, + name.GetStruct()); + + // Return type: bool + return _retval?true:false; } + CefString CefCommandLineCToCpp::GetSwitchValue(const CefString& name) { - CefString str; if (CEF_MEMBER_MISSING(struct_, get_switch_value)) - return str; + return CefString(); - cef_string_userfree_t strPtr = struct_->get_switch_value(struct_, + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: name; type: string_byref_const + DCHECK(!name.empty()); + if (name.empty()) + return CefString(); + + // Execute + cef_string_userfree_t _retval = struct_->get_switch_value(struct_, name.GetStruct()); - str.AttachToUserFree(strPtr); - return str; + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + void CefCommandLineCToCpp::GetSwitches(SwitchMap& switches) { if (CEF_MEMBER_MISSING(struct_, get_switches)) return; - cef_string_map_t map = cef_string_map_alloc(); - if(!map) - return; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - struct_->get_switches(struct_, map); - transfer_string_map_contents(map, switches); - cef_string_map_free(map); + // Translate param: switches; type: string_map_single_byref + cef_string_map_t switchesMap = cef_string_map_alloc(); + DCHECK(switchesMap); + if (switchesMap) + transfer_string_map_contents(switches, switchesMap); + + // Execute + struct_->get_switches(struct_, + switchesMap); + + // Restore param:switches; type: string_map_single_byref + if (switchesMap) { + switches.clear(); + transfer_string_map_contents(switchesMap, switches); + cef_string_map_free(switchesMap); + } } + void CefCommandLineCToCpp::AppendSwitch(const CefString& name) { if (CEF_MEMBER_MISSING(struct_, append_switch)) return; - struct_->append_switch(struct_, name.GetStruct()); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: name; type: string_byref_const + DCHECK(!name.empty()); + if (name.empty()) + return; + + // Execute + struct_->append_switch(struct_, + name.GetStruct()); } + void CefCommandLineCToCpp::AppendSwitchWithValue(const CefString& name, const CefString& value) { if (CEF_MEMBER_MISSING(struct_, append_switch_with_value)) return; - struct_->append_switch_with_value(struct_, name.GetStruct(), + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: name; type: string_byref_const + DCHECK(!name.empty()); + if (name.empty()) + return; + // Verify param: value; type: string_byref_const + DCHECK(!value.empty()); + if (value.empty()) + return; + + // Execute + struct_->append_switch_with_value(struct_, + name.GetStruct(), value.GetStruct()); } + bool CefCommandLineCToCpp::HasArguments() { if (CEF_MEMBER_MISSING(struct_, has_arguments)) return false; - return struct_->has_arguments(struct_)?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->has_arguments(struct_); + + // Return type: bool + return _retval?true:false; } + void CefCommandLineCToCpp::GetArguments(ArgumentList& arguments) { if (CEF_MEMBER_MISSING(struct_, get_arguments)) return; - cef_string_list_t list = cef_string_list_alloc(); - if (!list) - return; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - struct_->get_arguments(struct_, list); + // Translate param: arguments; type: string_vec_byref + cef_string_list_t argumentsList = cef_string_list_alloc(); + DCHECK(argumentsList); + if (argumentsList) + transfer_string_list_contents(arguments, argumentsList); - transfer_string_list_contents(list, arguments); - cef_string_list_free(list); + // Execute + struct_->get_arguments(struct_, + argumentsList); + + // Restore param:arguments; type: string_vec_byref + if (argumentsList) { + arguments.clear(); + transfer_string_list_contents(argumentsList, arguments); + cef_string_list_free(argumentsList); + } } + void CefCommandLineCToCpp::AppendArgument(const CefString& argument) { if (CEF_MEMBER_MISSING(struct_, append_argument)) return; - struct_->append_argument(struct_, argument.GetStruct()); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: argument; type: string_byref_const + DCHECK(!argument.empty()); + if (argument.empty()) + return; + + // Execute + struct_->append_argument(struct_, + argument.GetStruct()); } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/command_line_ctocpp.h b/libcef_dll/ctocpp/command_line_ctocpp.h index 0e6820e50..cc8b6778c 100644 --- a/libcef_dll/ctocpp/command_line_ctocpp.h +++ b/libcef_dll/ctocpp/command_line_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _COMMANDLINE_CTOCPP_H diff --git a/libcef_dll/ctocpp/content_filter_ctocpp.cc b/libcef_dll/ctocpp/content_filter_ctocpp.cc index 6a123dce9..64fbc52ed 100644 --- a/libcef_dll/ctocpp/content_filter_ctocpp.cc +++ b/libcef_dll/ctocpp/content_filter_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/cpptoc/stream_reader_cpptoc.h" @@ -22,26 +22,65 @@ void CefContentFilterCToCpp::ProcessData(const void* data, int data_size, if (CEF_MEMBER_MISSING(struct_, process_data)) return; - cef_stream_reader_t* streamRet = NULL; - struct_->process_data(struct_, data, data_size, &streamRet); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - if(streamRet) - substitute_data = CefStreamReaderCppToC::Unwrap(streamRet); + // Verify param: data; type: simple_byaddr + DCHECK(data); + if (!data) + return; + + // Translate param: substitute_data; type: refptr_diff_byref + cef_stream_reader_t* substitute_dataStruct = NULL; + if(substitute_data.get()) + substitute_dataStruct = CefStreamReaderCppToC::Wrap(substitute_data); + cef_stream_reader_t* substitute_dataOrig = substitute_dataStruct; + + // Execute + struct_->process_data(struct_, + data, + data_size, + &substitute_dataStruct); + + // Restore param:substitute_data; type: refptr_diff_byref + if (substitute_dataStruct) { + if (substitute_dataStruct != substitute_dataOrig) { + substitute_data = CefStreamReaderCppToC::Unwrap(substitute_dataStruct); + } + } else { + substitute_data = NULL; + } } + void CefContentFilterCToCpp::Drain(CefRefPtr& remainder) { if (CEF_MEMBER_MISSING(struct_, drain)) return; - cef_stream_reader_t* streamRet = NULL; - struct_->drain(struct_, &streamRet); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - if(streamRet) - remainder = CefStreamReaderCppToC::Unwrap(streamRet); + // Translate param: remainder; type: refptr_diff_byref + cef_stream_reader_t* remainderStruct = NULL; + if(remainder.get()) + remainderStruct = CefStreamReaderCppToC::Wrap(remainder); + cef_stream_reader_t* remainderOrig = remainderStruct; + + // Execute + struct_->drain(struct_, + &remainderStruct); + + // Restore param:remainder; type: refptr_diff_byref + if (remainderStruct) { + if (remainderStruct != remainderOrig) { + remainder = CefStreamReaderCppToC::Unwrap(remainderStruct); + } + } else { + remainder = NULL; + } } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/content_filter_ctocpp.h b/libcef_dll/ctocpp/content_filter_ctocpp.h index 7652e96d6..a9b8e75ce 100644 --- a/libcef_dll/ctocpp/content_filter_ctocpp.h +++ b/libcef_dll/ctocpp/content_filter_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _CONTENTFILTER_CTOCPP_H diff --git a/libcef_dll/ctocpp/cookie_visitor_ctocpp.cc b/libcef_dll/ctocpp/cookie_visitor_ctocpp.cc index 89f53d999..0a36ca4f0 100644 --- a/libcef_dll/ctocpp/cookie_visitor_ctocpp.cc +++ b/libcef_dll/ctocpp/cookie_visitor_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/ctocpp/cookie_visitor_ctocpp.h" @@ -18,18 +18,30 @@ bool CefCookieVisitorCToCpp::Visit(const CefCookie& cookie, int count, int total, bool& deleteCookie) { - if(CEF_MEMBER_MISSING(struct_, visit)) + if (CEF_MEMBER_MISSING(struct_, visit)) return false; - int delVal = deleteCookie; - bool retVal = struct_->visit(struct_, &cookie, count, total, &delVal) ? - true : false; - deleteCookie = delVal?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return retVal; + // Translate param: deleteCookie; type: bool_byref + int deleteCookieInt = deleteCookie; + + // Execute + int _retval = struct_->visit(struct_, + &cookie, + count, + total, + &deleteCookieInt); + + // Restore param:deleteCookie; type: bool_byref + deleteCookie = deleteCookieInt?true:false; + + // Return type: bool + return _retval?true:false; } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/cookie_visitor_ctocpp.h b/libcef_dll/ctocpp/cookie_visitor_ctocpp.h index f79e11faa..7a89a697e 100644 --- a/libcef_dll/ctocpp/cookie_visitor_ctocpp.h +++ b/libcef_dll/ctocpp/cookie_visitor_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _COOKIEVISITOR_CTOCPP_H diff --git a/libcef_dll/ctocpp/ctocpp.h b/libcef_dll/ctocpp/ctocpp.h index 9d275c356..ba2e01c2a 100644 --- a/libcef_dll/ctocpp/ctocpp.h +++ b/libcef_dll/ctocpp/ctocpp.h @@ -39,7 +39,8 @@ public: // instance for return back to the other side. static StructName* Unwrap(CefRefPtr c) { - DCHECK(c.get()); + if (!c.get()) + return NULL; // Cast the object to our wrapper class type. ClassName* wrapper = static_cast(c.get()); diff --git a/libcef_dll/ctocpp/display_handler_ctocpp.cc b/libcef_dll/ctocpp/display_handler_ctocpp.cc index 043647701..0769369fa 100644 --- a/libcef_dll/ctocpp/display_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/display_handler_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/cpptoc/browser_cpptoc.h" @@ -23,20 +23,50 @@ void CefDisplayHandlerCToCpp::OnNavStateChange(CefRefPtr browser, if (CEF_MEMBER_MISSING(struct_, on_nav_state_change)) return; - struct_->on_nav_state_change(struct_, CefBrowserCppToC::Wrap(browser), - canGoBack, canGoForward); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return; + + // Execute + struct_->on_nav_state_change(struct_, + CefBrowserCppToC::Wrap(browser), + canGoBack, + canGoForward); } + void CefDisplayHandlerCToCpp::OnAddressChange(CefRefPtr browser, CefRefPtr frame, const CefString& url) { if (CEF_MEMBER_MISSING(struct_, on_address_change)) return; - struct_->on_address_change(struct_, CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), url.GetStruct()); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return; + // Verify param: frame; type: refptr_diff + DCHECK(frame.get()); + if (!frame.get()) + return; + // Verify param: url; type: string_byref_const + DCHECK(!url.empty()); + if (url.empty()) + return; + + // Execute + struct_->on_address_change(struct_, + CefBrowserCppToC::Wrap(browser), + CefFrameCppToC::Wrap(frame), + url.GetStruct()); } + void CefDisplayHandlerCToCpp::OnContentsSizeChange( CefRefPtr browser, CefRefPtr frame, int width, int height) @@ -44,51 +74,120 @@ void CefDisplayHandlerCToCpp::OnContentsSizeChange( if (CEF_MEMBER_MISSING(struct_, on_contents_size_change)) return; - struct_->on_contents_size_change(struct_, CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), width, height); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return; + // Verify param: frame; type: refptr_diff + DCHECK(frame.get()); + if (!frame.get()) + return; + + // Execute + struct_->on_contents_size_change(struct_, + CefBrowserCppToC::Wrap(browser), + CefFrameCppToC::Wrap(frame), + width, + height); } + void CefDisplayHandlerCToCpp::OnTitleChange(CefRefPtr browser, const CefString& title) { if (CEF_MEMBER_MISSING(struct_, on_title_change)) return; - struct_->on_title_change(struct_, CefBrowserCppToC::Wrap(browser), + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return; + // Unverified params: title + + // Execute + struct_->on_title_change(struct_, + CefBrowserCppToC::Wrap(browser), title.GetStruct()); } + bool CefDisplayHandlerCToCpp::OnTooltip(CefRefPtr browser, CefString& text) { if (CEF_MEMBER_MISSING(struct_, on_tooltip)) return false; - return struct_->on_tooltip(struct_, CefBrowserCppToC::Wrap(browser), - text.GetWritableStruct()) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return false; + // Unverified params: text + + // Execute + int _retval = struct_->on_tooltip(struct_, + CefBrowserCppToC::Wrap(browser), + text.GetWritableStruct()); + + // Return type: bool + return _retval?true:false; } + void CefDisplayHandlerCToCpp::OnStatusMessage(CefRefPtr browser, const CefString& value, StatusType type) { if (CEF_MEMBER_MISSING(struct_, on_status_message)) return; - struct_->on_status_message(struct_, CefBrowserCppToC::Wrap(browser), - value.GetStruct(), type); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return; + // Unverified params: value + + // Execute + struct_->on_status_message(struct_, + CefBrowserCppToC::Wrap(browser), + value.GetStruct(), + type); } + bool CefDisplayHandlerCToCpp::OnConsoleMessage(CefRefPtr browser, const CefString& message, const CefString& source, int line) { if (CEF_MEMBER_MISSING(struct_, on_console_message)) return false; - return struct_->on_console_message(struct_, CefBrowserCppToC::Wrap(browser), - message.GetStruct(), source.GetStruct(), line) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return false; + // Unverified params: message, source + + // Execute + int _retval = struct_->on_console_message(struct_, + CefBrowserCppToC::Wrap(browser), + message.GetStruct(), + source.GetStruct(), + line); + + // Return type: bool + return _retval?true:false; } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/display_handler_ctocpp.h b/libcef_dll/ctocpp/display_handler_ctocpp.h index b8ef05dd9..7b6df4425 100644 --- a/libcef_dll/ctocpp/display_handler_ctocpp.h +++ b/libcef_dll/ctocpp/display_handler_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _DISPLAYHANDLER_CTOCPP_H diff --git a/libcef_dll/ctocpp/domdocument_ctocpp.cc b/libcef_dll/ctocpp/domdocument_ctocpp.cc index 98b2ef60d..e784f572e 100644 --- a/libcef_dll/ctocpp/domdocument_ctocpp.cc +++ b/libcef_dll/ctocpp/domdocument_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/ctocpp/domdocument_ctocpp.h" @@ -18,171 +18,267 @@ CefDOMDocument::Type CefDOMDocumentCToCpp::GetType() { - if(CEF_MEMBER_MISSING(struct_, get_type)) + if (CEF_MEMBER_MISSING(struct_, get_type)) return DOM_DOCUMENT_TYPE_UNKNOWN; - - return struct_->get_type(struct_); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_dom_document_type_t _retval = struct_->get_type(struct_); + + // Return type: simple + return _retval; } + CefRefPtr CefDOMDocumentCToCpp::GetDocument() { - if(CEF_MEMBER_MISSING(struct_, get_document)) + if (CEF_MEMBER_MISSING(struct_, get_document)) return NULL; - - cef_domnode_t* nodeStruct = struct_->get_document(struct_); - if (nodeStruct) - return CefDOMNodeCToCpp::Wrap(nodeStruct); - return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_domnode_t* _retval = struct_->get_document(struct_); + + // Return type: refptr_same + return CefDOMNodeCToCpp::Wrap(_retval); } + CefRefPtr CefDOMDocumentCToCpp::GetBody() { - if(CEF_MEMBER_MISSING(struct_, get_body)) + if (CEF_MEMBER_MISSING(struct_, get_body)) return NULL; - cef_domnode_t* nodeStruct = struct_->get_body(struct_); - if (nodeStruct) - return CefDOMNodeCToCpp::Wrap(nodeStruct); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_domnode_t* _retval = struct_->get_body(struct_); + + // Return type: refptr_same + return CefDOMNodeCToCpp::Wrap(_retval); } + CefRefPtr CefDOMDocumentCToCpp::GetHead() { - if(CEF_MEMBER_MISSING(struct_, get_head)) + if (CEF_MEMBER_MISSING(struct_, get_head)) return NULL; - cef_domnode_t* nodeStruct = struct_->get_head(struct_); - if (nodeStruct) - return CefDOMNodeCToCpp::Wrap(nodeStruct); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_domnode_t* _retval = struct_->get_head(struct_); + + // Return type: refptr_same + return CefDOMNodeCToCpp::Wrap(_retval); } + CefString CefDOMDocumentCToCpp::GetTitle() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_title)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_title)) + return CefString(); - cef_string_userfree_t strPtr = struct_->get_title(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_title(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + CefRefPtr CefDOMDocumentCToCpp::GetElementById(const CefString& id) { - if(CEF_MEMBER_MISSING(struct_, get_element_by_id)) + if (CEF_MEMBER_MISSING(struct_, get_element_by_id)) return NULL; - cef_domnode_t* nodeStruct = - struct_->get_element_by_id(struct_, id.GetStruct()); - if (nodeStruct) - return CefDOMNodeCToCpp::Wrap(nodeStruct); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: id; type: string_byref_const + DCHECK(!id.empty()); + if (id.empty()) + return NULL; + + // Execute + cef_domnode_t* _retval = struct_->get_element_by_id(struct_, + id.GetStruct()); + + // Return type: refptr_same + return CefDOMNodeCToCpp::Wrap(_retval); } + CefRefPtr CefDOMDocumentCToCpp::GetFocusedNode() { - if(CEF_MEMBER_MISSING(struct_, get_focused_node)) + if (CEF_MEMBER_MISSING(struct_, get_focused_node)) return NULL; - cef_domnode_t* nodeStruct = struct_->get_focused_node(struct_); - if (nodeStruct) - return CefDOMNodeCToCpp::Wrap(nodeStruct); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_domnode_t* _retval = struct_->get_focused_node(struct_); + + // Return type: refptr_same + return CefDOMNodeCToCpp::Wrap(_retval); } + bool CefDOMDocumentCToCpp::HasSelection() { - if(CEF_MEMBER_MISSING(struct_, has_selection)) + if (CEF_MEMBER_MISSING(struct_, has_selection)) return false; - return struct_->has_selection(struct_) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->has_selection(struct_); + + // Return type: bool + return _retval?true:false; } + CefRefPtr CefDOMDocumentCToCpp::GetSelectionStartNode() { - if(CEF_MEMBER_MISSING(struct_, get_selection_start_node)) + if (CEF_MEMBER_MISSING(struct_, get_selection_start_node)) return NULL; - cef_domnode_t* nodeStruct = struct_->get_selection_start_node(struct_); - if (nodeStruct) - return CefDOMNodeCToCpp::Wrap(nodeStruct); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_domnode_t* _retval = struct_->get_selection_start_node(struct_); + + // Return type: refptr_same + return CefDOMNodeCToCpp::Wrap(_retval); } + int CefDOMDocumentCToCpp::GetSelectionStartOffset() { - if(CEF_MEMBER_MISSING(struct_, get_selection_start_offset)) + if (CEF_MEMBER_MISSING(struct_, get_selection_start_offset)) return 0; - return struct_->get_selection_start_offset(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_selection_start_offset(struct_); + + // Return type: simple + return _retval; } + CefRefPtr CefDOMDocumentCToCpp::GetSelectionEndNode() { - if(CEF_MEMBER_MISSING(struct_, get_selection_end_node)) + if (CEF_MEMBER_MISSING(struct_, get_selection_end_node)) return NULL; - cef_domnode_t* nodeStruct = struct_->get_selection_end_node(struct_); - if (nodeStruct) - return CefDOMNodeCToCpp::Wrap(nodeStruct); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_domnode_t* _retval = struct_->get_selection_end_node(struct_); + + // Return type: refptr_same + return CefDOMNodeCToCpp::Wrap(_retval); } + int CefDOMDocumentCToCpp::GetSelectionEndOffset() { - if(CEF_MEMBER_MISSING(struct_, get_selection_end_offset)) + if (CEF_MEMBER_MISSING(struct_, get_selection_end_offset)) return 0; - return struct_->get_selection_end_offset(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_selection_end_offset(struct_); + + // Return type: simple + return _retval; } + CefString CefDOMDocumentCToCpp::GetSelectionAsMarkup() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_selection_as_markup)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_selection_as_markup)) + return CefString(); - cef_string_userfree_t strPtr = struct_->get_selection_as_markup(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_selection_as_markup(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + CefString CefDOMDocumentCToCpp::GetSelectionAsText() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_selection_as_text)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_selection_as_text)) + return CefString(); - cef_string_userfree_t strPtr = struct_->get_selection_as_text(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_selection_as_text(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + CefString CefDOMDocumentCToCpp::GetBaseURL() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_base_url)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_base_url)) + return CefString(); - cef_string_userfree_t strPtr = struct_->get_base_url(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_base_url(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + CefString CefDOMDocumentCToCpp::GetCompleteURL(const CefString& partialURL) { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_complete_url)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_complete_url)) + return CefString(); - cef_string_userfree_t strPtr = - struct_->get_complete_url(struct_, partialURL.GetStruct()); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: partialURL; type: string_byref_const + DCHECK(!partialURL.empty()); + if (partialURL.empty()) + return CefString(); + + // Execute + cef_string_userfree_t _retval = struct_->get_complete_url(struct_, + partialURL.GetStruct()); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/domdocument_ctocpp.h b/libcef_dll/ctocpp/domdocument_ctocpp.h index 1f7b20a1f..c448a83a4 100644 --- a/libcef_dll/ctocpp/domdocument_ctocpp.h +++ b/libcef_dll/ctocpp/domdocument_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _DOMDOCUMENT_CTOCPP_H diff --git a/libcef_dll/ctocpp/domevent_ctocpp.cc b/libcef_dll/ctocpp/domevent_ctocpp.cc index f04e4adff..a02cdb946 100644 --- a/libcef_dll/ctocpp/domevent_ctocpp.cc +++ b/libcef_dll/ctocpp/domevent_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/ctocpp/domdocument_ctocpp.h" @@ -19,81 +19,127 @@ CefString CefDOMEventCToCpp::GetType() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_type)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_type)) + return CefString(); - cef_string_userfree_t strPtr = struct_->get_type(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_type(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + CefDOMEvent::Category CefDOMEventCToCpp::GetCategory() { - if(CEF_MEMBER_MISSING(struct_, get_category)) + if (CEF_MEMBER_MISSING(struct_, get_category)) return DOM_EVENT_CATEGORY_UNKNOWN; - return struct_->get_category(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_dom_event_category_t _retval = struct_->get_category(struct_); + + // Return type: simple + return _retval; } + CefDOMEvent::Phase CefDOMEventCToCpp::GetPhase() { - if(CEF_MEMBER_MISSING(struct_, get_phase)) + if (CEF_MEMBER_MISSING(struct_, get_phase)) return DOM_EVENT_PHASE_UNKNOWN; - return struct_->get_phase(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_dom_event_phase_t _retval = struct_->get_phase(struct_); + + // Return type: simple + return _retval; } + bool CefDOMEventCToCpp::CanBubble() { - if(CEF_MEMBER_MISSING(struct_, can_bubble)) + if (CEF_MEMBER_MISSING(struct_, can_bubble)) return false; - return struct_->can_bubble(struct_) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->can_bubble(struct_); + + // Return type: bool + return _retval?true:false; } + bool CefDOMEventCToCpp::CanCancel() { - if(CEF_MEMBER_MISSING(struct_, can_cancel)) + if (CEF_MEMBER_MISSING(struct_, can_cancel)) return false; - return struct_->can_cancel(struct_) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->can_cancel(struct_); + + // Return type: bool + return _retval?true:false; } + CefRefPtr CefDOMEventCToCpp::GetDocument() { - if(CEF_MEMBER_MISSING(struct_, get_document)) + if (CEF_MEMBER_MISSING(struct_, get_document)) return NULL; - cef_domdocument_t* documentStruct = struct_->get_document(struct_); - if(documentStruct) - return CefDOMDocumentCToCpp::Wrap(documentStruct); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_domdocument_t* _retval = struct_->get_document(struct_); + + // Return type: refptr_same + return CefDOMDocumentCToCpp::Wrap(_retval); } + CefRefPtr CefDOMEventCToCpp::GetTarget() { - if(CEF_MEMBER_MISSING(struct_, get_target)) + if (CEF_MEMBER_MISSING(struct_, get_target)) return NULL; - cef_domnode_t* nodeStruct = struct_->get_target(struct_); - if(nodeStruct) - return CefDOMNodeCToCpp::Wrap(nodeStruct); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_domnode_t* _retval = struct_->get_target(struct_); + + // Return type: refptr_same + return CefDOMNodeCToCpp::Wrap(_retval); } + CefRefPtr CefDOMEventCToCpp::GetCurrentTarget() { - if(CEF_MEMBER_MISSING(struct_, get_current_target)) + if (CEF_MEMBER_MISSING(struct_, get_current_target)) return NULL; - cef_domnode_t* nodeStruct = struct_->get_current_target(struct_); - if(nodeStruct) - return CefDOMNodeCToCpp::Wrap(nodeStruct); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_domnode_t* _retval = struct_->get_current_target(struct_); + + // Return type: refptr_same + return CefDOMNodeCToCpp::Wrap(_retval); } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/domevent_ctocpp.h b/libcef_dll/ctocpp/domevent_ctocpp.h index 2ce132bcf..75136b753 100644 --- a/libcef_dll/ctocpp/domevent_ctocpp.h +++ b/libcef_dll/ctocpp/domevent_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _DOMEVENT_CTOCPP_H diff --git a/libcef_dll/ctocpp/domevent_listener_ctocpp.cc b/libcef_dll/ctocpp/domevent_listener_ctocpp.cc index 4214cbbbc..dcb06a821 100644 --- a/libcef_dll/ctocpp/domevent_listener_ctocpp.cc +++ b/libcef_dll/ctocpp/domevent_listener_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/cpptoc/domevent_cpptoc.h" @@ -18,16 +18,23 @@ void CefDOMEventListenerCToCpp::HandleEvent(CefRefPtr event) { - if(CEF_MEMBER_MISSING(struct_, handle_event)) + if (CEF_MEMBER_MISSING(struct_, handle_event)) return; - cef_domevent_t* eventStruct = NULL; - if (event.get()) - eventStruct = CefDOMEventCppToC::Wrap(event); - struct_->handle_event(struct_, eventStruct); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: event; type: refptr_diff + DCHECK(event.get()); + if (!event.get()) + return; + + // Execute + struct_->handle_event(struct_, + CefDOMEventCppToC::Wrap(event)); } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/domevent_listener_ctocpp.h b/libcef_dll/ctocpp/domevent_listener_ctocpp.h index a602c82f3..c8435fb1d 100644 --- a/libcef_dll/ctocpp/domevent_listener_ctocpp.h +++ b/libcef_dll/ctocpp/domevent_listener_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _DOMEVENTLISTENER_CTOCPP_H diff --git a/libcef_dll/ctocpp/domnode_ctocpp.cc b/libcef_dll/ctocpp/domnode_ctocpp.cc index db8a84295..783818660 100644 --- a/libcef_dll/ctocpp/domnode_ctocpp.cc +++ b/libcef_dll/ctocpp/domnode_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/cpptoc/domevent_listener_cpptoc.h" @@ -20,259 +20,452 @@ CefDOMNode::Type CefDOMNodeCToCpp::GetType() { - if(CEF_MEMBER_MISSING(struct_, get_type)) + if (CEF_MEMBER_MISSING(struct_, get_type)) return DOM_NODE_TYPE_UNSUPPORTED; - return struct_->get_type(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_dom_node_type_t _retval = struct_->get_type(struct_); + + // Return type: simple + return _retval; } + bool CefDOMNodeCToCpp::IsText() { - if(CEF_MEMBER_MISSING(struct_, is_text)) + if (CEF_MEMBER_MISSING(struct_, is_text)) return false; - return struct_->is_text(struct_) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_text(struct_); + + // Return type: bool + return _retval?true:false; } + bool CefDOMNodeCToCpp::IsElement() { - if(CEF_MEMBER_MISSING(struct_, is_element)) + if (CEF_MEMBER_MISSING(struct_, is_element)) return false; - return struct_->is_element(struct_) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_element(struct_); + + // Return type: bool + return _retval?true:false; } + bool CefDOMNodeCToCpp::IsFormControlElement() { if (CEF_MEMBER_MISSING(struct_, is_form_control_element)) return false; - return struct_->is_form_control_element(struct_) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_form_control_element(struct_); + + // Return type: bool + return _retval?true:false; } + CefString CefDOMNodeCToCpp::GetFormControlElementType() { - CefString str; if (CEF_MEMBER_MISSING(struct_, get_form_control_element_type)) - return str; + return CefString(); - cef_string_userfree_t strPtr = - struct_->get_form_control_element_type(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_form_control_element_type( + struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + bool CefDOMNodeCToCpp::IsSame(CefRefPtr that) { if (CEF_MEMBER_MISSING(struct_, is_same)) return false; - return struct_->is_same(struct_, CefDOMNodeCToCpp::Unwrap(that)) ? - true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: that; type: refptr_same + DCHECK(that.get()); + if (!that.get()) + return false; + + // Execute + int _retval = struct_->is_same(struct_, + CefDOMNodeCToCpp::Unwrap(that)); + + // Return type: bool + return _retval?true:false; } + CefString CefDOMNodeCToCpp::GetName() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_name)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_name)) + return CefString(); - cef_string_userfree_t strPtr = struct_->get_name(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_name(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + CefString CefDOMNodeCToCpp::GetValue() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_value)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_value)) + return CefString(); - cef_string_userfree_t strPtr = struct_->get_value(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_value(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + bool CefDOMNodeCToCpp::SetValue(const CefString& value) { - if(CEF_MEMBER_MISSING(struct_, set_value)) + if (CEF_MEMBER_MISSING(struct_, set_value)) return false; - return struct_->set_value(struct_, value.GetStruct()) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: value; type: string_byref_const + DCHECK(!value.empty()); + if (value.empty()) + return false; + + // Execute + int _retval = struct_->set_value(struct_, + value.GetStruct()); + + // Return type: bool + return _retval?true:false; } + CefString CefDOMNodeCToCpp::GetAsMarkup() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_as_markup)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_as_markup)) + return CefString(); - cef_string_userfree_t strPtr = struct_->get_as_markup(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_as_markup(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + CefRefPtr CefDOMNodeCToCpp::GetDocument() { - if(CEF_MEMBER_MISSING(struct_, get_document)) + if (CEF_MEMBER_MISSING(struct_, get_document)) return NULL; - cef_domdocument_t* documentStruct = struct_->get_document(struct_); - if(documentStruct) - return CefDOMDocumentCToCpp::Wrap(documentStruct); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return NULL; + // Execute + cef_domdocument_t* _retval = struct_->get_document(struct_); + + // Return type: refptr_same + return CefDOMDocumentCToCpp::Wrap(_retval); } + CefRefPtr CefDOMNodeCToCpp::GetParent() { - if(CEF_MEMBER_MISSING(struct_, get_parent)) + if (CEF_MEMBER_MISSING(struct_, get_parent)) return NULL; - cef_domnode_t* nodeStruct = struct_->get_parent(struct_); - if(nodeStruct) - return CefDOMNodeCToCpp::Wrap(nodeStruct); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_domnode_t* _retval = struct_->get_parent(struct_); + + // Return type: refptr_same + return CefDOMNodeCToCpp::Wrap(_retval); } + CefRefPtr CefDOMNodeCToCpp::GetPreviousSibling() { - if(CEF_MEMBER_MISSING(struct_, get_previous_sibling)) + if (CEF_MEMBER_MISSING(struct_, get_previous_sibling)) return NULL; - cef_domnode_t* nodeStruct = struct_->get_previous_sibling(struct_); - if(nodeStruct) - return CefDOMNodeCToCpp::Wrap(nodeStruct); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_domnode_t* _retval = struct_->get_previous_sibling(struct_); + + // Return type: refptr_same + return CefDOMNodeCToCpp::Wrap(_retval); } + CefRefPtr CefDOMNodeCToCpp::GetNextSibling() { - if(CEF_MEMBER_MISSING(struct_, get_next_sibling)) + if (CEF_MEMBER_MISSING(struct_, get_next_sibling)) return NULL; - cef_domnode_t* nodeStruct = struct_->get_next_sibling(struct_); - if(nodeStruct) - return CefDOMNodeCToCpp::Wrap(nodeStruct); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_domnode_t* _retval = struct_->get_next_sibling(struct_); + + // Return type: refptr_same + return CefDOMNodeCToCpp::Wrap(_retval); } + bool CefDOMNodeCToCpp::HasChildren() { - if(CEF_MEMBER_MISSING(struct_, has_children)) + if (CEF_MEMBER_MISSING(struct_, has_children)) return false; - return struct_->has_children(struct_) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->has_children(struct_); + + // Return type: bool + return _retval?true:false; } + CefRefPtr CefDOMNodeCToCpp::GetFirstChild() { - if(CEF_MEMBER_MISSING(struct_, get_first_child)) + if (CEF_MEMBER_MISSING(struct_, get_first_child)) return NULL; - cef_domnode_t* nodeStruct = struct_->get_first_child(struct_); - if(nodeStruct) - return CefDOMNodeCToCpp::Wrap(nodeStruct); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_domnode_t* _retval = struct_->get_first_child(struct_); + + // Return type: refptr_same + return CefDOMNodeCToCpp::Wrap(_retval); } + CefRefPtr CefDOMNodeCToCpp::GetLastChild() { - if(CEF_MEMBER_MISSING(struct_, get_last_child)) + if (CEF_MEMBER_MISSING(struct_, get_last_child)) return NULL; - cef_domnode_t* nodeStruct = struct_->get_last_child(struct_); - if(nodeStruct) - return CefDOMNodeCToCpp::Wrap(nodeStruct); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_domnode_t* _retval = struct_->get_last_child(struct_); + + // Return type: refptr_same + return CefDOMNodeCToCpp::Wrap(_retval); } + void CefDOMNodeCToCpp::AddEventListener(const CefString& eventType, CefRefPtr listener, bool useCapture) { - if(CEF_MEMBER_MISSING(struct_, add_event_listener)) + if (CEF_MEMBER_MISSING(struct_, add_event_listener)) return; - struct_->add_event_listener(struct_, eventType.GetStruct(), - CefDOMEventListenerCppToC::Wrap(listener), useCapture); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: eventType; type: string_byref_const + DCHECK(!eventType.empty()); + if (eventType.empty()) + return; + // Verify param: listener; type: refptr_diff + DCHECK(listener.get()); + if (!listener.get()) + return; + + // Execute + struct_->add_event_listener(struct_, + eventType.GetStruct(), + CefDOMEventListenerCppToC::Wrap(listener), + useCapture); } + CefString CefDOMNodeCToCpp::GetElementTagName() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_element_tag_name)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_element_tag_name)) + return CefString(); - cef_string_userfree_t strPtr = struct_->get_element_tag_name(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_element_tag_name(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + bool CefDOMNodeCToCpp::HasElementAttributes() { - if(CEF_MEMBER_MISSING(struct_, has_element_attributes)) + if (CEF_MEMBER_MISSING(struct_, has_element_attributes)) return false; - return struct_->has_element_attributes(struct_) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->has_element_attributes(struct_); + + // Return type: bool + return _retval?true:false; } + bool CefDOMNodeCToCpp::HasElementAttribute(const CefString& attrName) { - if(CEF_MEMBER_MISSING(struct_, has_element_attribute)) + if (CEF_MEMBER_MISSING(struct_, has_element_attribute)) return false; - return struct_->has_element_attribute(struct_, attrName.GetStruct()) ? - true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: attrName; type: string_byref_const + DCHECK(!attrName.empty()); + if (attrName.empty()) + return false; + + // Execute + int _retval = struct_->has_element_attribute(struct_, + attrName.GetStruct()); + + // Return type: bool + return _retval?true:false; } + CefString CefDOMNodeCToCpp::GetElementAttribute(const CefString& attrName) { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_element_attribute)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_element_attribute)) + return CefString(); - cef_string_userfree_t strPtr = - struct_->get_element_attribute(struct_, attrName.GetStruct()); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: attrName; type: string_byref_const + DCHECK(!attrName.empty()); + if (attrName.empty()) + return CefString(); + + // Execute + cef_string_userfree_t _retval = struct_->get_element_attribute(struct_, + attrName.GetStruct()); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + void CefDOMNodeCToCpp::GetElementAttributes(AttributeMap& attrMap) { - if(CEF_MEMBER_MISSING(struct_, get_element_attributes)) + if (CEF_MEMBER_MISSING(struct_, get_element_attributes)) return; - cef_string_map_t map = cef_string_map_alloc(); - if(!map) - return; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - struct_->get_element_attributes(struct_, map); - transfer_string_map_contents(map, attrMap); - cef_string_map_free(map); + // Translate param: attrMap; type: string_map_single_byref + cef_string_map_t attrMapMap = cef_string_map_alloc(); + DCHECK(attrMapMap); + if (attrMapMap) + transfer_string_map_contents(attrMap, attrMapMap); + + // Execute + struct_->get_element_attributes(struct_, + attrMapMap); + + // Restore param:attrMap; type: string_map_single_byref + if (attrMapMap) { + attrMap.clear(); + transfer_string_map_contents(attrMapMap, attrMap); + cef_string_map_free(attrMapMap); + } } + bool CefDOMNodeCToCpp::SetElementAttribute(const CefString& attrName, const CefString& value) { - if(CEF_MEMBER_MISSING(struct_, set_element_attribute)) + if (CEF_MEMBER_MISSING(struct_, set_element_attribute)) return false; - return struct_->set_element_attribute(struct_, attrName.GetStruct(), - value.GetStruct()) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: attrName; type: string_byref_const + DCHECK(!attrName.empty()); + if (attrName.empty()) + return false; + // Verify param: value; type: string_byref_const + DCHECK(!value.empty()); + if (value.empty()) + return false; + + // Execute + int _retval = struct_->set_element_attribute(struct_, + attrName.GetStruct(), + value.GetStruct()); + + // Return type: bool + return _retval?true:false; } + CefString CefDOMNodeCToCpp::GetElementInnerText() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_element_inner_text)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_element_inner_text)) + return CefString(); - cef_string_userfree_t strPtr = struct_->get_element_inner_text(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_element_inner_text(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/domnode_ctocpp.h b/libcef_dll/ctocpp/domnode_ctocpp.h index 693dc0b54..5c8d50c12 100644 --- a/libcef_dll/ctocpp/domnode_ctocpp.h +++ b/libcef_dll/ctocpp/domnode_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _DOMNODE_CTOCPP_H diff --git a/libcef_dll/ctocpp/domvisitor_ctocpp.cc b/libcef_dll/ctocpp/domvisitor_ctocpp.cc index 9ff7da0b1..4b84d05de 100644 --- a/libcef_dll/ctocpp/domvisitor_ctocpp.cc +++ b/libcef_dll/ctocpp/domvisitor_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/cpptoc/domdocument_cpptoc.h" @@ -18,16 +18,23 @@ void CefDOMVisitorCToCpp::Visit(CefRefPtr document) { - if(CEF_MEMBER_MISSING(struct_, visit)) + if (CEF_MEMBER_MISSING(struct_, visit)) return; - cef_domdocument_t* documentStruct = NULL; - if (document.get()) - documentStruct = CefDOMDocumentCppToC::Wrap(document); - struct_->visit(struct_, documentStruct); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: document; type: refptr_diff + DCHECK(document.get()); + if (!document.get()) + return; + + // Execute + struct_->visit(struct_, + CefDOMDocumentCppToC::Wrap(document)); } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/domvisitor_ctocpp.h b/libcef_dll/ctocpp/domvisitor_ctocpp.h index 05d8b4a5c..a86362562 100644 --- a/libcef_dll/ctocpp/domvisitor_ctocpp.h +++ b/libcef_dll/ctocpp/domvisitor_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _DOMVISITOR_CTOCPP_H diff --git a/libcef_dll/ctocpp/download_handler_ctocpp.cc b/libcef_dll/ctocpp/download_handler_ctocpp.cc index cf3216f36..affab7abf 100644 --- a/libcef_dll/ctocpp/download_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/download_handler_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/ctocpp/download_handler_ctocpp.h" @@ -17,21 +17,39 @@ bool CefDownloadHandlerCToCpp::ReceivedData(void* data, int data_size) { - if(CEF_MEMBER_MISSING(struct_, received_data)) + if (CEF_MEMBER_MISSING(struct_, received_data)) return false; - return struct_->received_data(struct_, data, data_size) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: data; type: simple_byaddr + DCHECK(data); + if (!data) + return false; + + // Execute + int _retval = struct_->received_data(struct_, + data, + data_size); + + // Return type: bool + return _retval?true:false; } + void CefDownloadHandlerCToCpp::Complete() { - if(CEF_MEMBER_MISSING(struct_, complete)) + if (CEF_MEMBER_MISSING(struct_, complete)) return; - return struct_->complete(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->complete(struct_); } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/download_handler_ctocpp.h b/libcef_dll/ctocpp/download_handler_ctocpp.h index a1705de97..d398f1ede 100644 --- a/libcef_dll/ctocpp/download_handler_ctocpp.h +++ b/libcef_dll/ctocpp/download_handler_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _DOWNLOADHANDLER_CTOCPP_H diff --git a/libcef_dll/ctocpp/drag_data_ctocpp.cc b/libcef_dll/ctocpp/drag_data_ctocpp.cc index ec581a91a..b6179b24d 100644 --- a/libcef_dll/ctocpp/drag_data_ctocpp.cc +++ b/libcef_dll/ctocpp/drag_data_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/ctocpp/drag_data_ctocpp.h" @@ -21,132 +21,212 @@ bool CefDragDataCToCpp::IsLink() if (CEF_MEMBER_MISSING(struct_, is_link)) return false; - return struct_->is_link(struct_) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_link(struct_); + + // Return type: bool + return _retval?true:false; } + bool CefDragDataCToCpp::IsFragment() { if (CEF_MEMBER_MISSING(struct_, is_fragment)) return false; - return struct_->is_fragment(struct_) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_fragment(struct_); + + // Return type: bool + return _retval?true:false; } + bool CefDragDataCToCpp::IsFile() { if (CEF_MEMBER_MISSING(struct_, is_file)) return false; - return struct_->is_file(struct_) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_file(struct_); + + // Return type: bool + return _retval?true:false; } + CefString CefDragDataCToCpp::GetLinkURL() { - CefString str; if (CEF_MEMBER_MISSING(struct_, get_link_url)) - return str; + return CefString(); - cef_string_userfree_t strPtr = struct_->get_link_url(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_link_url(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + CefString CefDragDataCToCpp::GetLinkTitle() { - CefString str; if (CEF_MEMBER_MISSING(struct_, get_link_title)) - return str; + return CefString(); - cef_string_userfree_t strPtr = struct_->get_link_title(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_link_title(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + CefString CefDragDataCToCpp::GetLinkMetadata() { - CefString str; if (CEF_MEMBER_MISSING(struct_, get_link_metadata)) - return str; + return CefString(); - cef_string_userfree_t strPtr = struct_->get_link_metadata(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_link_metadata(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + CefString CefDragDataCToCpp::GetFragmentText() { - CefString str; if (CEF_MEMBER_MISSING(struct_, get_fragment_text)) - return str; + return CefString(); - cef_string_userfree_t strPtr = struct_->get_fragment_text(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_fragment_text(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + CefString CefDragDataCToCpp::GetFragmentHtml() { - CefString str; if (CEF_MEMBER_MISSING(struct_, get_fragment_html)) - return str; + return CefString(); - cef_string_userfree_t strPtr = struct_->get_fragment_html(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_fragment_html(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + CefString CefDragDataCToCpp::GetFragmentBaseURL() { - CefString str; if (CEF_MEMBER_MISSING(struct_, get_fragment_base_url)) - return str; + return CefString(); - cef_string_userfree_t strPtr = struct_->get_fragment_base_url(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_fragment_base_url(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + CefString CefDragDataCToCpp::GetFileExtension() { - CefString str; if (CEF_MEMBER_MISSING(struct_, get_file_extension)) - return str; + return CefString(); - cef_string_userfree_t strPtr = struct_->get_file_extension(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_file_extension(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + CefString CefDragDataCToCpp::GetFileName() { - CefString str; if (CEF_MEMBER_MISSING(struct_, get_file_name)) - return str; + return CefString(); - cef_string_userfree_t strPtr = struct_->get_file_name(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_file_name(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + bool CefDragDataCToCpp::GetFileNames(std::vector& names) { if (CEF_MEMBER_MISSING(struct_, get_file_names)) return false; - cef_string_list_t list = cef_string_list_alloc(); - if (!list) - return false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - if(struct_->get_file_names(struct_, list)) { - transfer_string_list_contents(list, names); - cef_string_list_free(list); - return true; + // Translate param: names; type: string_vec_byref + cef_string_list_t namesList = cef_string_list_alloc(); + DCHECK(namesList); + if (namesList) + transfer_string_list_contents(names, namesList); + + // Execute + int _retval = struct_->get_file_names(struct_, + namesList); + + // Restore param:names; type: string_vec_byref + if (namesList) { + names.clear(); + transfer_string_list_contents(namesList, names); + cef_string_list_free(namesList); } - return false; + // Return type: bool + return _retval?true:false; } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/drag_data_ctocpp.h b/libcef_dll/ctocpp/drag_data_ctocpp.h index 105a4c288..9b867d967 100644 --- a/libcef_dll/ctocpp/drag_data_ctocpp.h +++ b/libcef_dll/ctocpp/drag_data_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _DRAGDATA_CTOCPP_H diff --git a/libcef_dll/ctocpp/drag_handler_ctocpp.cc b/libcef_dll/ctocpp/drag_handler_ctocpp.cc index 80836ae6a..d961d5073 100644 --- a/libcef_dll/ctocpp/drag_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/drag_handler_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/cpptoc/browser_cpptoc.h" @@ -23,21 +23,57 @@ bool CefDragHandlerCToCpp::OnDragStart(CefRefPtr browser, if (CEF_MEMBER_MISSING(struct_, on_drag_start)) return false; - return struct_->on_drag_start(struct_, CefBrowserCppToC::Wrap(browser), - CefDragDataCppToC::Wrap(dragData), mask) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return false; + // Verify param: dragData; type: refptr_diff + DCHECK(dragData.get()); + if (!dragData.get()) + return false; + + // Execute + int _retval = struct_->on_drag_start(struct_, + CefBrowserCppToC::Wrap(browser), + CefDragDataCppToC::Wrap(dragData), + mask); + + // Return type: bool + return _retval?true:false; } + bool CefDragHandlerCToCpp::OnDragEnter(CefRefPtr browser, CefRefPtr dragData, DragOperationsMask mask) { if (CEF_MEMBER_MISSING(struct_, on_drag_enter)) return false; - return struct_->on_drag_enter(struct_, CefBrowserCppToC::Wrap(browser), - CefDragDataCppToC::Wrap(dragData), mask) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return false; + // Verify param: dragData; type: refptr_diff + DCHECK(dragData.get()); + if (!dragData.get()) + return false; + + // Execute + int _retval = struct_->on_drag_enter(struct_, + CefBrowserCppToC::Wrap(browser), + CefDragDataCppToC::Wrap(dragData), + mask); + + // Return type: bool + return _retval?true:false; } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/drag_handler_ctocpp.h b/libcef_dll/ctocpp/drag_handler_ctocpp.h index 285193a6f..381c9c482 100644 --- a/libcef_dll/ctocpp/drag_handler_ctocpp.h +++ b/libcef_dll/ctocpp/drag_handler_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _DRAGHANDLER_CTOCPP_H diff --git a/libcef_dll/ctocpp/find_handler_ctocpp.cc b/libcef_dll/ctocpp/find_handler_ctocpp.cc index 52e7748fc..ff3240c45 100644 --- a/libcef_dll/ctocpp/find_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/find_handler_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/cpptoc/browser_cpptoc.h" @@ -23,11 +23,25 @@ void CefFindHandlerCToCpp::OnFindResult(CefRefPtr browser, if (CEF_MEMBER_MISSING(struct_, on_find_result)) return; - struct_->on_find_result(struct_, CefBrowserCppToC::Wrap(browser), identifier, - count, &selectionRect, activeMatchOrdinal, finalUpdate); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return; + + // Execute + struct_->on_find_result(struct_, + CefBrowserCppToC::Wrap(browser), + identifier, + count, + &selectionRect, + activeMatchOrdinal, + finalUpdate); } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/find_handler_ctocpp.h b/libcef_dll/ctocpp/find_handler_ctocpp.h index 388b2b57d..6e9693c01 100644 --- a/libcef_dll/ctocpp/find_handler_ctocpp.h +++ b/libcef_dll/ctocpp/find_handler_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _FINDHANDLER_CTOCPP_H diff --git a/libcef_dll/ctocpp/focus_handler_ctocpp.cc b/libcef_dll/ctocpp/focus_handler_ctocpp.cc index 40d40b9cc..8ea09d40f 100644 --- a/libcef_dll/ctocpp/focus_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/focus_handler_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/cpptoc/browser_cpptoc.h" @@ -24,31 +24,66 @@ void CefFocusHandlerCToCpp::OnTakeFocus(CefRefPtr browser, if (CEF_MEMBER_MISSING(struct_, on_take_focus)) return; - struct_->on_take_focus(struct_, CefBrowserCppToC::Wrap(browser), next); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return; + + // Execute + struct_->on_take_focus(struct_, + CefBrowserCppToC::Wrap(browser), + next); } + bool CefFocusHandlerCToCpp::OnSetFocus(CefRefPtr browser, FocusSource source) { if (CEF_MEMBER_MISSING(struct_, on_set_focus)) return false; - return struct_->on_set_focus(struct_, CefBrowserCppToC::Wrap(browser), - source) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return false; + + // Execute + int _retval = struct_->on_set_focus(struct_, + CefBrowserCppToC::Wrap(browser), + source); + + // Return type: bool + return _retval?true:false; } + void CefFocusHandlerCToCpp::OnFocusedNodeChanged(CefRefPtr browser, CefRefPtr frame, CefRefPtr node) { if (CEF_MEMBER_MISSING(struct_, on_focused_node_changed)) return; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return; + // Unverified params: frame, node + + // Execute struct_->on_focused_node_changed(struct_, - CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), + CefBrowserCppToC::Wrap(browser), + CefFrameCppToC::Wrap(frame), CefDOMNodeCppToC::Wrap(node)); } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/focus_handler_ctocpp.h b/libcef_dll/ctocpp/focus_handler_ctocpp.h index 3d290f197..0a56aa23d 100644 --- a/libcef_dll/ctocpp/focus_handler_ctocpp.h +++ b/libcef_dll/ctocpp/focus_handler_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _FOCUSHANDLER_CTOCPP_H diff --git a/libcef_dll/ctocpp/frame_ctocpp.cc b/libcef_dll/ctocpp/frame_ctocpp.cc index e502c3cde..ff09b1f37 100644 --- a/libcef_dll/ctocpp/frame_ctocpp.cc +++ b/libcef_dll/ctocpp/frame_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/cpptoc/domvisitor_cpptoc.h" @@ -22,214 +22,364 @@ void CefFrameCToCpp::Undo() { - if(CEF_MEMBER_MISSING(struct_, undo)) + if (CEF_MEMBER_MISSING(struct_, undo)) return; - + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute struct_->undo(struct_); } + void CefFrameCToCpp::Redo() { - if(CEF_MEMBER_MISSING(struct_, redo)) + if (CEF_MEMBER_MISSING(struct_, redo)) return; - + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute struct_->redo(struct_); } + void CefFrameCToCpp::Cut() { - if(CEF_MEMBER_MISSING(struct_, cut)) + if (CEF_MEMBER_MISSING(struct_, cut)) return; - + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute struct_->cut(struct_); } + void CefFrameCToCpp::Copy() { - if(CEF_MEMBER_MISSING(struct_, copy)) + if (CEF_MEMBER_MISSING(struct_, copy)) return; - + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute struct_->copy(struct_); } + void CefFrameCToCpp::Paste() { - if(CEF_MEMBER_MISSING(struct_, paste)) + if (CEF_MEMBER_MISSING(struct_, paste)) return; - + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute struct_->paste(struct_); } + void CefFrameCToCpp::Delete() { - if(CEF_MEMBER_MISSING(struct_, del)) + if (CEF_MEMBER_MISSING(struct_, del)) return; - + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute struct_->del(struct_); } + void CefFrameCToCpp::SelectAll() { - if(CEF_MEMBER_MISSING(struct_, select_all)) + if (CEF_MEMBER_MISSING(struct_, select_all)) return; - + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute struct_->select_all(struct_); } + void CefFrameCToCpp::Print() { - if(CEF_MEMBER_MISSING(struct_, print)) + if (CEF_MEMBER_MISSING(struct_, print)) return; - + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute struct_->print(struct_); } + void CefFrameCToCpp::ViewSource() { - if(CEF_MEMBER_MISSING(struct_, view_source)) + if (CEF_MEMBER_MISSING(struct_, view_source)) return; - + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute struct_->view_source(struct_); } + CefString CefFrameCToCpp::GetSource() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_source)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_source)) + return CefString(); - cef_string_userfree_t strPtr = struct_->get_source(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_source(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + CefString CefFrameCToCpp::GetText() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_text)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_text)) + return CefString(); - cef_string_userfree_t strPtr = struct_->get_text(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_text(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + void CefFrameCToCpp::LoadRequest(CefRefPtr request) { - if(CEF_MEMBER_MISSING(struct_, load_request)) + if (CEF_MEMBER_MISSING(struct_, load_request)) return; - struct_->load_request(struct_, CefRequestCToCpp::Unwrap(request)); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: request; type: refptr_same + DCHECK(request.get()); + if (!request.get()) + return; + + // Execute + struct_->load_request(struct_, + CefRequestCToCpp::Unwrap(request)); } + void CefFrameCToCpp::LoadURL(const CefString& url) { - if(CEF_MEMBER_MISSING(struct_, load_url)) + if (CEF_MEMBER_MISSING(struct_, load_url)) return; - struct_->load_url(struct_, url.GetStruct()); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: url; type: string_byref_const + DCHECK(!url.empty()); + if (url.empty()) + return; + + // Execute + struct_->load_url(struct_, + url.GetStruct()); } + void CefFrameCToCpp::LoadString(const CefString& string, const CefString& url) { - if(CEF_MEMBER_MISSING(struct_, load_string)) + if (CEF_MEMBER_MISSING(struct_, load_string)) return; - - struct_->load_string(struct_, string.GetStruct(), url.GetStruct()); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: string; type: string_byref_const + DCHECK(!string.empty()); + if (string.empty()) + return; + // Verify param: url; type: string_byref_const + DCHECK(!url.empty()); + if (url.empty()) + return; + + // Execute + struct_->load_string(struct_, + string.GetStruct(), + url.GetStruct()); } + void CefFrameCToCpp::LoadStream(CefRefPtr stream, const CefString& url) { - if(CEF_MEMBER_MISSING(struct_, load_stream)) + if (CEF_MEMBER_MISSING(struct_, load_stream)) return; - struct_->load_stream(struct_, CefStreamReaderCToCpp::Unwrap(stream), + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: stream; type: refptr_same + DCHECK(stream.get()); + if (!stream.get()) + return; + // Verify param: url; type: string_byref_const + DCHECK(!url.empty()); + if (url.empty()) + return; + + // Execute + struct_->load_stream(struct_, + CefStreamReaderCToCpp::Unwrap(stream), url.GetStruct()); } + void CefFrameCToCpp::ExecuteJavaScript(const CefString& jsCode, const CefString& scriptUrl, int startLine) { - if(CEF_MEMBER_MISSING(struct_, execute_java_script)) + if (CEF_MEMBER_MISSING(struct_, execute_java_script)) return; - struct_->execute_java_script(struct_, jsCode.GetStruct(), - scriptUrl.GetStruct(), startLine); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: jsCode; type: string_byref_const + DCHECK(!jsCode.empty()); + if (jsCode.empty()) + return; + // Unverified params: scriptUrl + + // Execute + struct_->execute_java_script(struct_, + jsCode.GetStruct(), + scriptUrl.GetStruct(), + startLine); } + bool CefFrameCToCpp::IsMain() { - if(CEF_MEMBER_MISSING(struct_, is_main)) + if (CEF_MEMBER_MISSING(struct_, is_main)) return false; - return struct_->is_main(struct_)?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_main(struct_); + + // Return type: bool + return _retval?true:false; } + bool CefFrameCToCpp::IsFocused() { - if(CEF_MEMBER_MISSING(struct_, is_focused)) + if (CEF_MEMBER_MISSING(struct_, is_focused)) return false; - return struct_->is_focused(struct_)?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_focused(struct_); + + // Return type: bool + return _retval?true:false; } + CefString CefFrameCToCpp::GetName() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_name)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_name)) + return CefString(); - cef_string_userfree_t strPtr = struct_->get_name(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_name(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + CefString CefFrameCToCpp::GetURL() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_url)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_url)) + return CefString(); - cef_string_userfree_t strPtr = struct_->get_url(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_url(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + CefRefPtr CefFrameCToCpp::GetBrowser() { - CefRefPtr browser; - if(CEF_MEMBER_MISSING(struct_, get_browser)) - return browser; + if (CEF_MEMBER_MISSING(struct_, get_browser)) + return NULL; - cef_browser_t* browserStruct = struct_->get_browser(struct_); - if(browserStruct) - return CefBrowserCToCpp::Wrap(browserStruct); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return browser; + // Execute + cef_browser_t* _retval = struct_->get_browser(struct_); + + // Return type: refptr_same + return CefBrowserCToCpp::Wrap(_retval); } + void CefFrameCToCpp::VisitDOM(CefRefPtr visitor) { - if(CEF_MEMBER_MISSING(struct_, visit_dom)) + if (CEF_MEMBER_MISSING(struct_, visit_dom)) return; - struct_->visit_dom(struct_, CefDOMVisitorCppToC::Wrap(visitor)); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: visitor; type: refptr_diff + DCHECK(visitor.get()); + if (!visitor.get()) + return; + + // Execute + struct_->visit_dom(struct_, + CefDOMVisitorCppToC::Wrap(visitor)); } + CefRefPtr CefFrameCToCpp::GetV8Context() { if (CEF_MEMBER_MISSING(struct_, get_v8context)) return NULL; - cef_v8context_t* v8ContextStruct = struct_->get_v8context(struct_); - if (v8ContextStruct) - return CefV8ContextCToCpp::Wrap(v8ContextStruct); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return NULL; + // Execute + cef_v8context_t* _retval = struct_->get_v8context(struct_); + + // Return type: refptr_same + return CefV8ContextCToCpp::Wrap(_retval); } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/frame_ctocpp.h b/libcef_dll/ctocpp/frame_ctocpp.h index 2f457153a..de714e869 100644 --- a/libcef_dll/ctocpp/frame_ctocpp.h +++ b/libcef_dll/ctocpp/frame_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _FRAME_CTOCPP_H diff --git a/libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc b/libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc index d57a20458..884013997 100644 --- a/libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/cpptoc/browser_cpptoc.h" @@ -23,23 +23,71 @@ bool CefJSDialogHandlerCToCpp::OnJSAlert(CefRefPtr browser, if (CEF_MEMBER_MISSING(struct_, on_jsalert)) return false; - return struct_->on_jsalert(struct_, CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), message.GetStruct()) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return false; + // Verify param: frame; type: refptr_diff + DCHECK(frame.get()); + if (!frame.get()) + return false; + // Verify param: message; type: string_byref_const + DCHECK(!message.empty()); + if (message.empty()) + return false; + + // Execute + int _retval = struct_->on_jsalert(struct_, + CefBrowserCppToC::Wrap(browser), + CefFrameCppToC::Wrap(frame), + message.GetStruct()); + + // Return type: bool + return _retval?true:false; } + bool CefJSDialogHandlerCToCpp::OnJSConfirm(CefRefPtr browser, CefRefPtr frame, const CefString& message, bool& retval) { if (CEF_MEMBER_MISSING(struct_, on_jsconfirm)) return false; - int ret = 0; - int rv = struct_->on_jsconfirm(struct_, CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), message.GetStruct(), &ret); - retval = (ret ? true : false); - return (rv ? true : false); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return false; + // Verify param: frame; type: refptr_diff + DCHECK(frame.get()); + if (!frame.get()) + return false; + // Verify param: message; type: string_byref_const + DCHECK(!message.empty()); + if (message.empty()) + return false; + + // Translate param: retval; type: bool_byref + int retvalInt = retval; + + // Execute + int _retval = struct_->on_jsconfirm(struct_, + CefBrowserCppToC::Wrap(browser), + CefFrameCppToC::Wrap(frame), + message.GetStruct(), + &retvalInt); + + // Restore param:retval; type: bool_byref + retval = retvalInt?true:false; + + // Return type: bool + return _retval?true:false; } + bool CefJSDialogHandlerCToCpp::OnJSPrompt(CefRefPtr browser, CefRefPtr frame, const CefString& message, const CefString& defaultValue, bool& retval, CefString& result) @@ -47,15 +95,46 @@ bool CefJSDialogHandlerCToCpp::OnJSPrompt(CefRefPtr browser, if (CEF_MEMBER_MISSING(struct_, on_jsprompt)) return false; - int ret = 0; - int rv = struct_->on_jsprompt(struct_, CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), message.GetStruct(), - defaultValue.GetStruct(), &ret, result.GetWritableStruct()); - retval = (ret ? true : false); - return (rv ? true : false); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return false; + // Verify param: frame; type: refptr_diff + DCHECK(frame.get()); + if (!frame.get()) + return false; + // Verify param: message; type: string_byref_const + DCHECK(!message.empty()); + if (message.empty()) + return false; + // Verify param: defaultValue; type: string_byref_const + DCHECK(!defaultValue.empty()); + if (defaultValue.empty()) + return false; + + // Translate param: retval; type: bool_byref + int retvalInt = retval; + + // Execute + int _retval = struct_->on_jsprompt(struct_, + CefBrowserCppToC::Wrap(browser), + CefFrameCppToC::Wrap(frame), + message.GetStruct(), + defaultValue.GetStruct(), + &retvalInt, + result.GetWritableStruct()); + + // Restore param:retval; type: bool_byref + retval = retvalInt?true:false; + + // Return type: bool + return _retval?true:false; } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/jsdialog_handler_ctocpp.h b/libcef_dll/ctocpp/jsdialog_handler_ctocpp.h index f1c69906b..3b89b2a65 100644 --- a/libcef_dll/ctocpp/jsdialog_handler_ctocpp.h +++ b/libcef_dll/ctocpp/jsdialog_handler_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _JSDIALOGHANDLER_CTOCPP_H diff --git a/libcef_dll/ctocpp/keyboard_handler_ctocpp.cc b/libcef_dll/ctocpp/keyboard_handler_ctocpp.cc index 545883301..dfbc41f64 100644 --- a/libcef_dll/ctocpp/keyboard_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/keyboard_handler_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/cpptoc/browser_cpptoc.h" @@ -23,11 +23,28 @@ bool CefKeyboardHandlerCToCpp::OnKeyEvent(CefRefPtr browser, if (CEF_MEMBER_MISSING(struct_, on_key_event)) return false; - return struct_->on_key_event(struct_, CefBrowserCppToC::Wrap(browser), - type, code, modifiers, isSystemKey, isAfterJavaScript) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return false; + + // Execute + int _retval = struct_->on_key_event(struct_, + CefBrowserCppToC::Wrap(browser), + type, + code, + modifiers, + isSystemKey, + isAfterJavaScript); + + // Return type: bool + return _retval?true:false; } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/keyboard_handler_ctocpp.h b/libcef_dll/ctocpp/keyboard_handler_ctocpp.h index 0b77b3e3b..99a2c9df8 100644 --- a/libcef_dll/ctocpp/keyboard_handler_ctocpp.h +++ b/libcef_dll/ctocpp/keyboard_handler_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _KEYBOARDHANDLER_CTOCPP_H diff --git a/libcef_dll/ctocpp/life_span_handler_ctocpp.cc b/libcef_dll/ctocpp/life_span_handler_ctocpp.cc index 5ac0b0447..69045f686 100644 --- a/libcef_dll/ctocpp/life_span_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/life_span_handler_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/cpptoc/browser_cpptoc.h" @@ -25,65 +25,125 @@ bool CefLifeSpanHandlerCToCpp::OnBeforePopup( if (CEF_MEMBER_MISSING(struct_, on_before_popup)) return false; - cef_browser_t* browserStruct = CefBrowserCppToC::Wrap(parentBrowser); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: parentBrowser; type: refptr_diff + DCHECK(parentBrowser.get()); + if (!parentBrowser.get()) + return false; + // Verify param: url; type: string_byref_const + DCHECK(!url.empty()); + if (url.empty()) + return false; + + // Translate param: client; type: refptr_same_byref cef_client_t* clientStruct = NULL; if(client.get()) clientStruct = CefClientCToCpp::Unwrap(client); - cef_client_t* origClientStruct = clientStruct; + cef_client_t* clientOrig = clientStruct; - int rv = struct_->on_before_popup(struct_, - browserStruct, &popupFeatures, &windowInfo, url.GetStruct(), - &clientStruct, &settings); + // Execute + int _retval = struct_->on_before_popup(struct_, + CefBrowserCppToC::Wrap(parentBrowser), + &popupFeatures, + &windowInfo, + url.GetStruct(), + &clientStruct, + &settings); + // Restore param:client; type: refptr_same_byref if (clientStruct) { - if (clientStruct != origClientStruct) { - // The handler was changed. + if (clientStruct != clientOrig) { client = CefClientCToCpp::Wrap(clientStruct); } } else { client = NULL; } - return (rv ? true : false); + // Return type: bool + return _retval?true:false; } + void CefLifeSpanHandlerCToCpp::OnAfterCreated(CefRefPtr browser) { if (CEF_MEMBER_MISSING(struct_, on_after_created)) return; - struct_->on_after_created(struct_, CefBrowserCppToC::Wrap(browser)); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return; + + // Execute + struct_->on_after_created(struct_, + CefBrowserCppToC::Wrap(browser)); } + bool CefLifeSpanHandlerCToCpp::RunModal(CefRefPtr browser) { if (CEF_MEMBER_MISSING(struct_, run_modal)) return false; - int rv = struct_->run_modal(struct_, CefBrowserCppToC::Wrap(browser)); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return (rv ? true : false); + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return false; + + // Execute + int _retval = struct_->run_modal(struct_, + CefBrowserCppToC::Wrap(browser)); + + // Return type: bool + return _retval?true:false; } + bool CefLifeSpanHandlerCToCpp::DoClose(CefRefPtr browser) { if (CEF_MEMBER_MISSING(struct_, do_close)) return false; - int rv = struct_->do_close(struct_, CefBrowserCppToC::Wrap(browser)); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return (rv ? true : false); + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return false; + + // Execute + int _retval = struct_->do_close(struct_, + CefBrowserCppToC::Wrap(browser)); + + // Return type: bool + return _retval?true:false; } + void CefLifeSpanHandlerCToCpp::OnBeforeClose(CefRefPtr browser) { if (CEF_MEMBER_MISSING(struct_, on_before_close)) return; - struct_->on_before_close(struct_, CefBrowserCppToC::Wrap(browser)); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return; + + // Execute + struct_->on_before_close(struct_, + CefBrowserCppToC::Wrap(browser)); } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/life_span_handler_ctocpp.h b/libcef_dll/ctocpp/life_span_handler_ctocpp.h index 43f07eae1..1394ec55d 100644 --- a/libcef_dll/ctocpp/life_span_handler_ctocpp.h +++ b/libcef_dll/ctocpp/life_span_handler_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _LIFESPANHANDLER_CTOCPP_H diff --git a/libcef_dll/ctocpp/load_handler_ctocpp.cc b/libcef_dll/ctocpp/load_handler_ctocpp.cc index 02bafaa41..46b64f9b1 100644 --- a/libcef_dll/ctocpp/load_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/load_handler_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/cpptoc/browser_cpptoc.h" @@ -23,20 +23,49 @@ void CefLoadHandlerCToCpp::OnLoadStart(CefRefPtr browser, if (CEF_MEMBER_MISSING(struct_, on_load_start)) return; - struct_->on_load_start(struct_, CefBrowserCppToC::Wrap(browser), + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return; + // Verify param: frame; type: refptr_diff + DCHECK(frame.get()); + if (!frame.get()) + return; + + // Execute + struct_->on_load_start(struct_, + CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame)); } + void CefLoadHandlerCToCpp::OnLoadEnd(CefRefPtr browser, CefRefPtr frame, int httpStatusCode) { if (CEF_MEMBER_MISSING(struct_, on_load_end)) return; - struct_->on_load_end(struct_, CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), httpStatusCode); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return; + // Verify param: frame; type: refptr_diff + DCHECK(frame.get()); + if (!frame.get()) + return; + + // Execute + struct_->on_load_end(struct_, + CefBrowserCppToC::Wrap(browser), + CefFrameCppToC::Wrap(frame), + httpStatusCode); } + bool CefLoadHandlerCToCpp::OnLoadError(CefRefPtr browser, CefRefPtr frame, ErrorCode errorCode, const CefString& failedUrl, CefString& errorText) @@ -44,12 +73,35 @@ bool CefLoadHandlerCToCpp::OnLoadError(CefRefPtr browser, if (CEF_MEMBER_MISSING(struct_, on_load_error)) return false; - return struct_->on_load_error(struct_, CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), errorCode, failedUrl.GetStruct(), - errorText.GetWritableStruct()) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return false; + // Verify param: frame; type: refptr_diff + DCHECK(frame.get()); + if (!frame.get()) + return false; + // Verify param: failedUrl; type: string_byref_const + DCHECK(!failedUrl.empty()); + if (failedUrl.empty()) + return false; + + // Execute + int _retval = struct_->on_load_error(struct_, + CefBrowserCppToC::Wrap(browser), + CefFrameCppToC::Wrap(frame), + errorCode, + failedUrl.GetStruct(), + errorText.GetWritableStruct()); + + // Return type: bool + return _retval?true:false; } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/load_handler_ctocpp.h b/libcef_dll/ctocpp/load_handler_ctocpp.h index 1d38d7ac8..93c2e288f 100644 --- a/libcef_dll/ctocpp/load_handler_ctocpp.h +++ b/libcef_dll/ctocpp/load_handler_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _LOADHANDLER_CTOCPP_H diff --git a/libcef_dll/ctocpp/menu_handler_ctocpp.cc b/libcef_dll/ctocpp/menu_handler_ctocpp.cc index 8bfe6c5fc..e61c7cdd1 100644 --- a/libcef_dll/ctocpp/menu_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/menu_handler_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/cpptoc/browser_cpptoc.h" @@ -17,36 +17,73 @@ // VIRTUAL METHODS - Body may be edited by hand. bool CefMenuHandlerCToCpp::OnBeforeMenu(CefRefPtr browser, - const MenuInfo& menuInfo) + const CefMenuInfo& menuInfo) { if (CEF_MEMBER_MISSING(struct_, on_before_menu)) return false; - return struct_->on_before_menu(struct_, CefBrowserCppToC::Wrap(browser), - &menuInfo) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return false; + + // Execute + int _retval = struct_->on_before_menu(struct_, + CefBrowserCppToC::Wrap(browser), + &menuInfo); + + // Return type: bool + return _retval?true:false; } + void CefMenuHandlerCToCpp::GetMenuLabel(CefRefPtr browser, MenuId menuId, CefString& label) { if (CEF_MEMBER_MISSING(struct_, get_menu_label)) return; - return struct_->get_menu_label(struct_, CefBrowserCppToC::Wrap(browser), - menuId, label.GetWritableStruct()); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return; + + // Execute + struct_->get_menu_label(struct_, + CefBrowserCppToC::Wrap(browser), + menuId, + label.GetWritableStruct()); } + bool CefMenuHandlerCToCpp::OnMenuAction(CefRefPtr browser, MenuId menuId) { if (CEF_MEMBER_MISSING(struct_, on_menu_action)) return false; - return struct_->on_menu_action(struct_, CefBrowserCppToC::Wrap(browser), - menuId) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return false; + + // Execute + int _retval = struct_->on_menu_action(struct_, + CefBrowserCppToC::Wrap(browser), + menuId); + + // Return type: bool + return _retval?true:false; } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/menu_handler_ctocpp.h b/libcef_dll/ctocpp/menu_handler_ctocpp.h index 903e76f02..e9c1287fe 100644 --- a/libcef_dll/ctocpp/menu_handler_ctocpp.h +++ b/libcef_dll/ctocpp/menu_handler_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _MENUHANDLER_CTOCPP_H @@ -33,7 +34,7 @@ public: // CefMenuHandler methods virtual bool OnBeforeMenu(CefRefPtr browser, - const MenuInfo& menuInfo) OVERRIDE; + const CefMenuInfo& menuInfo) OVERRIDE; virtual void GetMenuLabel(CefRefPtr browser, MenuId menuId, CefString& label) OVERRIDE; virtual bool OnMenuAction(CefRefPtr browser, diff --git a/libcef_dll/ctocpp/post_data_ctocpp.cc b/libcef_dll/ctocpp/post_data_ctocpp.cc index a64c34059..7c6fe1dde 100644 --- a/libcef_dll/ctocpp/post_data_ctocpp.cc +++ b/libcef_dll/ctocpp/post_data_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/ctocpp/post_data_ctocpp.h" @@ -18,67 +18,129 @@ CefRefPtr CefPostData::CreatePostData() { - cef_post_data_t* impl = cef_post_data_create(); - if(impl) - return CefPostDataCToCpp::Wrap(impl); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_post_data_t* _retval = cef_post_data_create(); + + // Return type: refptr_same + return CefPostDataCToCpp::Wrap(_retval); } + // VIRTUAL METHODS - Body may be edited by hand. size_t CefPostDataCToCpp::GetElementCount() { - if(CEF_MEMBER_MISSING(struct_, get_element_count)) + if (CEF_MEMBER_MISSING(struct_, get_element_count)) return 0; - return struct_->get_element_count(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + size_t _retval = struct_->get_element_count(struct_); + + // Return type: simple + return _retval; } + void CefPostDataCToCpp::GetElements(ElementVector& elements) { - if(CEF_MEMBER_MISSING(struct_, get_elements)) + if (CEF_MEMBER_MISSING(struct_, get_elements)) return; - int count = (int)GetElementCount(); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - cef_post_data_element_t* structPtr; - for(int i = 0; i < count; ++i) { - structPtr = struct_->get_elements(struct_, i); - if(structPtr) - elements.push_back(CefPostDataElementCToCpp::Wrap(structPtr)); + // Translate param: elements; type: refptr_vec_same_byref + size_t elementsSize = elements.size(); + size_t elementsCount = std::max(GetElementCount(), elementsSize); + cef_post_data_element_t** elementsList = NULL; + if (elementsCount > 0) { + elementsList = new cef_post_data_element_t*[elementsCount]; + DCHECK(elementsList); + if (elementsList) { + memset(elementsList, 0, sizeof(cef_post_data_element_t*)*elementsCount); + } + if (elementsList && elementsSize > 0) { + for (size_t i = 0; i < elementsSize; ++i) { + elementsList[i] = CefPostDataElementCToCpp::Unwrap(elements[i]); + } + } + } + + // Execute + struct_->get_elements(struct_, + &elementsCount, + elementsList); + + // Restore param:elements; type: refptr_vec_same_byref + elements.clear(); + if (elementsCount > 0 && elementsList) { + for (size_t i = 0; i < elementsCount; ++i) { + elements.push_back(CefPostDataElementCToCpp::Wrap(elementsList[i])); + } + delete [] elementsList; } } + bool CefPostDataCToCpp::RemoveElement(CefRefPtr element) { - DCHECK(element.get()); - if(CEF_MEMBER_MISSING(struct_, remove_element) || !element.get()) + if (CEF_MEMBER_MISSING(struct_, remove_element)) return false; - return struct_->remove_element(struct_, - CefPostDataElementCToCpp::Unwrap(element))?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: element; type: refptr_same + DCHECK(element.get()); + if (!element.get()) + return false; + + // Execute + int _retval = struct_->remove_element(struct_, + CefPostDataElementCToCpp::Unwrap(element)); + + // Return type: bool + return _retval?true:false; } + bool CefPostDataCToCpp::AddElement(CefRefPtr element) { - DCHECK(element.get()); - if(CEF_MEMBER_MISSING(struct_, add_element) || !element.get()) + if (CEF_MEMBER_MISSING(struct_, add_element)) return false; - return struct_->add_element(struct_, - CefPostDataElementCToCpp::Unwrap(element))?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: element; type: refptr_same + DCHECK(element.get()); + if (!element.get()) + return false; + + // Execute + int _retval = struct_->add_element(struct_, + CefPostDataElementCToCpp::Unwrap(element)); + + // Return type: bool + return _retval?true:false; } + void CefPostDataCToCpp::RemoveElements() { - if(CEF_MEMBER_MISSING(struct_, remove_elements)) + if (CEF_MEMBER_MISSING(struct_, remove_elements)) return; - return struct_->remove_elements(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->remove_elements(struct_); } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/post_data_ctocpp.h b/libcef_dll/ctocpp/post_data_ctocpp.h index d03df2e4e..1cc115158 100644 --- a/libcef_dll/ctocpp/post_data_ctocpp.h +++ b/libcef_dll/ctocpp/post_data_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _POSTDATA_CTOCPP_H diff --git a/libcef_dll/ctocpp/post_data_element_ctocpp.cc b/libcef_dll/ctocpp/post_data_element_ctocpp.cc index 76b7f5f21..848c6067f 100644 --- a/libcef_dll/ctocpp/post_data_element_ctocpp.cc +++ b/libcef_dll/ctocpp/post_data_element_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/ctocpp/post_data_element_ctocpp.h" @@ -17,75 +17,138 @@ CefRefPtr CefPostDataElement::CreatePostDataElement() { - cef_post_data_element_t* impl = cef_post_data_element_create(); - if(impl) - return CefPostDataElementCToCpp::Wrap(impl); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_post_data_element_t* _retval = cef_post_data_element_create(); + + // Return type: refptr_same + return CefPostDataElementCToCpp::Wrap(_retval); } + // VIRTUAL METHODS - Body may be edited by hand. void CefPostDataElementCToCpp::SetToEmpty() { - if(CEF_MEMBER_MISSING(struct_, set_to_empty)) + if (CEF_MEMBER_MISSING(struct_, set_to_empty)) return; - return struct_->set_to_empty(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->set_to_empty(struct_); } + void CefPostDataElementCToCpp::SetToFile(const CefString& fileName) { - if(CEF_MEMBER_MISSING(struct_, set_to_file)) + if (CEF_MEMBER_MISSING(struct_, set_to_file)) return; - return struct_->set_to_file(struct_, fileName.GetStruct()); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: fileName; type: string_byref_const + DCHECK(!fileName.empty()); + if (fileName.empty()) + return; + + // Execute + struct_->set_to_file(struct_, + fileName.GetStruct()); } + void CefPostDataElementCToCpp::SetToBytes(size_t size, const void* bytes) { - if(CEF_MEMBER_MISSING(struct_, set_to_bytes)) + if (CEF_MEMBER_MISSING(struct_, set_to_bytes)) return; - return struct_->set_to_bytes(struct_, size, bytes); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: bytes; type: simple_byaddr + DCHECK(bytes); + if (!bytes) + return; + + // Execute + struct_->set_to_bytes(struct_, + size, + bytes); } + CefPostDataElement::Type CefPostDataElementCToCpp::GetType() { - if(CEF_MEMBER_MISSING(struct_, get_type)) + if (CEF_MEMBER_MISSING(struct_, get_type)) return PDE_TYPE_EMPTY; - return struct_->get_type(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_postdataelement_type_t _retval = struct_->get_type(struct_); + + // Return type: simple + return _retval; } + CefString CefPostDataElementCToCpp::GetFile() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_file)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_file)) + return CefString(); - cef_string_userfree_t strPtr = struct_->get_file(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_file(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + size_t CefPostDataElementCToCpp::GetBytesCount() { - if(CEF_MEMBER_MISSING(struct_, get_bytes_count)) + if (CEF_MEMBER_MISSING(struct_, get_bytes_count)) return 0; - return struct_->get_bytes_count(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + size_t _retval = struct_->get_bytes_count(struct_); + + // Return type: simple + return _retval; } + size_t CefPostDataElementCToCpp::GetBytes(size_t size, void* bytes) { - if(CEF_MEMBER_MISSING(struct_, get_bytes)) + if (CEF_MEMBER_MISSING(struct_, get_bytes)) return 0; - return struct_->get_bytes(struct_, size, bytes); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: bytes; type: simple_byaddr + DCHECK(bytes); + if (!bytes) + return 0; + + // Execute + size_t _retval = struct_->get_bytes(struct_, + size, + bytes); + + // Return type: simple + return _retval; } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/post_data_element_ctocpp.h b/libcef_dll/ctocpp/post_data_element_ctocpp.h index 2b8496dee..13186689a 100644 --- a/libcef_dll/ctocpp/post_data_element_ctocpp.h +++ b/libcef_dll/ctocpp/post_data_element_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _POSTDATAELEMENT_CTOCPP_H diff --git a/libcef_dll/ctocpp/print_handler_ctocpp.cc b/libcef_dll/ctocpp/print_handler_ctocpp.cc index 6fcca75e9..c634cc777 100644 --- a/libcef_dll/ctocpp/print_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/print_handler_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/cpptoc/browser_cpptoc.h" @@ -23,10 +23,23 @@ bool CefPrintHandlerCToCpp::GetPrintOptions(CefRefPtr browser, if (CEF_MEMBER_MISSING(struct_, get_print_options)) return false; - return struct_->get_print_options(struct_, CefBrowserCppToC::Wrap(browser), - &printOptions) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return false; + + // Execute + int _retval = struct_->get_print_options(struct_, + CefBrowserCppToC::Wrap(browser), + &printOptions); + + // Return type: bool + return _retval?true:false; } + bool CefPrintHandlerCToCpp::GetPrintHeaderFooter(CefRefPtr browser, CefRefPtr frame, const CefPrintInfo& printInfo, const CefString& url, const CefString& title, int currentPage, @@ -37,16 +50,47 @@ bool CefPrintHandlerCToCpp::GetPrintHeaderFooter(CefRefPtr browser, if (CEF_MEMBER_MISSING(struct_, get_print_header_footer)) return false; - return struct_->get_print_header_footer(struct_, - CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), - &printInfo, url.GetStruct(), title.GetStruct(), currentPage, maxPages, - topLeft.GetWritableStruct(), topCenter.GetWritableStruct(), - topRight.GetWritableStruct(), bottomLeft.GetWritableStruct(), - bottomCenter.GetWritableStruct(), bottomRight.GetWritableStruct()) ? - true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return false; + // Verify param: frame; type: refptr_diff + DCHECK(frame.get()); + if (!frame.get()) + return false; + // Verify param: url; type: string_byref_const + DCHECK(!url.empty()); + if (url.empty()) + return false; + // Verify param: title; type: string_byref_const + DCHECK(!title.empty()); + if (title.empty()) + return false; + + // Execute + int _retval = struct_->get_print_header_footer(struct_, + CefBrowserCppToC::Wrap(browser), + CefFrameCppToC::Wrap(frame), + &printInfo, + url.GetStruct(), + title.GetStruct(), + currentPage, + maxPages, + topLeft.GetWritableStruct(), + topCenter.GetWritableStruct(), + topRight.GetWritableStruct(), + bottomLeft.GetWritableStruct(), + bottomCenter.GetWritableStruct(), + bottomRight.GetWritableStruct()); + + // Return type: bool + return _retval?true:false; } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/print_handler_ctocpp.h b/libcef_dll/ctocpp/print_handler_ctocpp.h index a0574f66b..a392c04b8 100644 --- a/libcef_dll/ctocpp/print_handler_ctocpp.h +++ b/libcef_dll/ctocpp/print_handler_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _PRINTHANDLER_CTOCPP_H diff --git a/libcef_dll/ctocpp/proxy_handler_ctocpp.cc b/libcef_dll/ctocpp/proxy_handler_ctocpp.cc index de0c05d0c..06a7d6efc 100644 --- a/libcef_dll/ctocpp/proxy_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/proxy_handler_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/ctocpp/proxy_handler_ctocpp.h" @@ -21,10 +21,21 @@ void CefProxyHandlerCToCpp::GetProxyForUrl(const CefString& url, if (CEF_MEMBER_MISSING(struct_, get_proxy_for_url)) return; - struct_->get_proxy_for_url(struct_, url.GetStruct(), &proxy_info); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: url; type: string_byref_const + DCHECK(!url.empty()); + if (url.empty()) + return; + + // Execute + struct_->get_proxy_for_url(struct_, + url.GetStruct(), + &proxy_info); } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/proxy_handler_ctocpp.h b/libcef_dll/ctocpp/proxy_handler_ctocpp.h index 30a5548af..86bc62b7c 100644 --- a/libcef_dll/ctocpp/proxy_handler_ctocpp.h +++ b/libcef_dll/ctocpp/proxy_handler_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _PROXYHANDLER_CTOCPP_H diff --git a/libcef_dll/ctocpp/read_handler_ctocpp.cc b/libcef_dll/ctocpp/read_handler_ctocpp.cc index ba4c5dabc..6a1cd501b 100644 --- a/libcef_dll/ctocpp/read_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/read_handler_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/ctocpp/read_handler_ctocpp.h" @@ -17,37 +17,75 @@ size_t CefReadHandlerCToCpp::Read(void* ptr, size_t size, size_t n) { - if(CEF_MEMBER_MISSING(struct_, read)) + if (CEF_MEMBER_MISSING(struct_, read)) return 0; - return struct_->read(struct_, ptr, size, n); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: ptr; type: simple_byaddr + DCHECK(ptr); + if (!ptr) + return 0; + + // Execute + size_t _retval = struct_->read(struct_, + ptr, + size, + n); + + // Return type: simple + return _retval; } + int CefReadHandlerCToCpp::Seek(long offset, int whence) { - if(CEF_MEMBER_MISSING(struct_, seek)) + if (CEF_MEMBER_MISSING(struct_, seek)) return 0; - return struct_->seek(struct_, offset, whence); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->seek(struct_, + offset, + whence); + + // Return type: simple + return _retval; } + long CefReadHandlerCToCpp::Tell() { - if(CEF_MEMBER_MISSING(struct_, tell)) + if (CEF_MEMBER_MISSING(struct_, tell)) return 0; - return struct_->tell(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + long _retval = struct_->tell(struct_); + + // Return type: simple + return _retval; } + int CefReadHandlerCToCpp::Eof() { - if(CEF_MEMBER_MISSING(struct_, eof)) + if (CEF_MEMBER_MISSING(struct_, eof)) return 0; - return struct_->eof(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->eof(struct_); + + // Return type: simple + return _retval; } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/read_handler_ctocpp.h b/libcef_dll/ctocpp/read_handler_ctocpp.h index 09cad2d44..39b20bf09 100644 --- a/libcef_dll/ctocpp/read_handler_ctocpp.h +++ b/libcef_dll/ctocpp/read_handler_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _READHANDLER_CTOCPP_H diff --git a/libcef_dll/ctocpp/render_handler_ctocpp.cc b/libcef_dll/ctocpp/render_handler_ctocpp.cc index b38db63f1..6be7d5aba 100644 --- a/libcef_dll/ctocpp/render_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/render_handler_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/cpptoc/browser_cpptoc.h" @@ -22,82 +22,173 @@ bool CefRenderHandlerCToCpp::GetViewRect(CefRefPtr browser, if (CEF_MEMBER_MISSING(struct_, get_view_rect)) return false; - return struct_->get_view_rect(struct_, CefBrowserCppToC::Wrap(browser), - &rect) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return false; + + // Execute + int _retval = struct_->get_view_rect(struct_, + CefBrowserCppToC::Wrap(browser), + &rect); + + // Return type: bool + return _retval?true:false; } + bool CefRenderHandlerCToCpp::GetScreenRect(CefRefPtr browser, CefRect& rect) { if (CEF_MEMBER_MISSING(struct_, get_screen_rect)) return false; - return struct_->get_screen_rect(struct_, CefBrowserCppToC::Wrap(browser), - &rect) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return false; + + // Execute + int _retval = struct_->get_screen_rect(struct_, + CefBrowserCppToC::Wrap(browser), + &rect); + + // Return type: bool + return _retval?true:false; } + bool CefRenderHandlerCToCpp::GetScreenPoint(CefRefPtr browser, int viewX, int viewY, int& screenX, int& screenY) { if (CEF_MEMBER_MISSING(struct_, get_screen_point)) return false; - return struct_->get_screen_point(struct_, CefBrowserCppToC::Wrap(browser), - viewX, viewY, &screenX, &screenY) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return false; + + // Execute + int _retval = struct_->get_screen_point(struct_, + CefBrowserCppToC::Wrap(browser), + viewX, + viewY, + &screenX, + &screenY); + + // Return type: bool + return _retval?true:false; } + void CefRenderHandlerCToCpp::OnPopupShow(CefRefPtr browser, bool show) { if (CEF_MEMBER_MISSING(struct_, on_popup_show)) return; - struct_->on_popup_show(struct_, CefBrowserCppToC::Wrap(browser), show); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return; + + // Execute + struct_->on_popup_show(struct_, + CefBrowserCppToC::Wrap(browser), + show); } + void CefRenderHandlerCToCpp::OnPopupSize(CefRefPtr browser, const CefRect& rect) { - // BEGIN DELETE BEFORE MODIFYING if (CEF_MEMBER_MISSING(struct_, on_popup_size)) return; - struct_->on_popup_size(struct_, CefBrowserCppToC::Wrap(browser), &rect); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return; + + // Execute + struct_->on_popup_size(struct_, + CefBrowserCppToC::Wrap(browser), + &rect); } + void CefRenderHandlerCToCpp::OnPaint(CefRefPtr browser, PaintElementType type, const RectList& dirtyRects, const void* buffer) { if (CEF_MEMBER_MISSING(struct_, on_paint)) return; - const size_t rectCt = dirtyRects.size(); - DCHECK(rectCt > 0); - if (rectCt == 0) + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return; + // Verify param: buffer; type: simple_byaddr + DCHECK(buffer); + if (!buffer) return; - cef_rect_t* rects = new cef_rect_t[rectCt]; - RectList::const_iterator it = dirtyRects.begin(); - for (size_t i = 0; it != dirtyRects.end(); ++it, ++i) - rects[i] = *it; + // Translate param: dirtyRects; type: simple_vec_byref_const + const size_t dirtyRectsCount = dirtyRects.size(); + cef_rect_t* dirtyRectsList = NULL; + if (dirtyRectsCount > 0) { + dirtyRectsList = new cef_rect_t[dirtyRectsCount]; + DCHECK(dirtyRectsList); + if (dirtyRectsList) { + for (size_t i = 0; i < dirtyRectsCount; ++i) { + dirtyRectsList[i] = dirtyRects[i]; + } + } + } - struct_->on_paint(struct_, CefBrowserCppToC::Wrap(browser), type, rectCt, - rects, buffer); - - delete [] rects; + // Execute + struct_->on_paint(struct_, + CefBrowserCppToC::Wrap(browser), + type, + dirtyRectsCount, + dirtyRectsList, + buffer); } + void CefRenderHandlerCToCpp::OnCursorChange(CefRefPtr browser, CefCursorHandle cursor) { if (CEF_MEMBER_MISSING(struct_, on_cursor_change)) return; - return struct_->on_cursor_change(struct_, CefBrowserCppToC::Wrap(browser), + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return; + + // Execute + struct_->on_cursor_change(struct_, + CefBrowserCppToC::Wrap(browser), cursor); } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/render_handler_ctocpp.h b/libcef_dll/ctocpp/render_handler_ctocpp.h index bc25a6683..da7e9d86d 100644 --- a/libcef_dll/ctocpp/render_handler_ctocpp.h +++ b/libcef_dll/ctocpp/render_handler_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _RENDERHANDLER_CTOCPP_H diff --git a/libcef_dll/ctocpp/request_ctocpp.cc b/libcef_dll/ctocpp/request_ctocpp.cc index c6a7317c9..b307f4e3f 100644 --- a/libcef_dll/ctocpp/request_ctocpp.cc +++ b/libcef_dll/ctocpp/request_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/ctocpp/post_data_ctocpp.h" @@ -19,170 +19,272 @@ CefRefPtr CefRequest::CreateRequest() { - cef_request_t* impl = cef_request_create(); - if(impl) - return CefRequestCToCpp::Wrap(impl); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_request_t* _retval = cef_request_create(); + + // Return type: refptr_same + return CefRequestCToCpp::Wrap(_retval); } + // VIRTUAL METHODS - Body may be edited by hand. CefString CefRequestCToCpp::GetURL() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_url)) - return str; - - cef_string_userfree_t strPtr = struct_->get_url(struct_); - str.AttachToUserFree(strPtr); - return str; + if (CEF_MEMBER_MISSING(struct_, get_url)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_url(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + void CefRequestCToCpp::SetURL(const CefString& url) { - if(CEF_MEMBER_MISSING(struct_, set_url)) + if (CEF_MEMBER_MISSING(struct_, set_url)) return; - struct_->set_url(struct_, url.GetStruct()); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: url; type: string_byref_const + DCHECK(!url.empty()); + if (url.empty()) + return; + + // Execute + struct_->set_url(struct_, + url.GetStruct()); } + CefString CefRequestCToCpp::GetMethod() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_method)) - return str; - - cef_string_userfree_t strPtr = struct_->get_method(struct_); - str.AttachToUserFree(strPtr); - return str; + if (CEF_MEMBER_MISSING(struct_, get_method)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_method(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + void CefRequestCToCpp::SetMethod(const CefString& method) { - if(CEF_MEMBER_MISSING(struct_, set_method)) + if (CEF_MEMBER_MISSING(struct_, set_method)) return; - struct_->set_method(struct_, method.GetStruct()); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: method; type: string_byref_const + DCHECK(!method.empty()); + if (method.empty()) + return; + + // Execute + struct_->set_method(struct_, + method.GetStruct()); } + CefRefPtr CefRequestCToCpp::GetPostData() { - if(CEF_MEMBER_MISSING(struct_, get_post_data)) + if (CEF_MEMBER_MISSING(struct_, get_post_data)) return NULL; - cef_post_data_t* postDataStruct = struct_->get_post_data(struct_); - if(postDataStruct) - return CefPostDataCToCpp::Wrap(postDataStruct); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_post_data_t* _retval = struct_->get_post_data(struct_); + + // Return type: refptr_same + return CefPostDataCToCpp::Wrap(_retval); } + void CefRequestCToCpp::SetPostData(CefRefPtr postData) { - if(CEF_MEMBER_MISSING(struct_, set_post_data)) + if (CEF_MEMBER_MISSING(struct_, set_post_data)) return; - cef_post_data_t* postDataStruct = NULL; - if(postData.get()) - postDataStruct = CefPostDataCToCpp::Unwrap(postData); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - struct_->set_post_data(struct_, postDataStruct); + // Verify param: postData; type: refptr_same + DCHECK(postData.get()); + if (!postData.get()) + return; + + // Execute + struct_->set_post_data(struct_, + CefPostDataCToCpp::Unwrap(postData)); } + void CefRequestCToCpp::GetHeaderMap(HeaderMap& headerMap) { - if(CEF_MEMBER_MISSING(struct_, get_header_map)) + if (CEF_MEMBER_MISSING(struct_, get_header_map)) return; - cef_string_multimap_t map = cef_string_multimap_alloc(); - if(!map) - return; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - struct_->get_header_map(struct_, map); - transfer_string_multimap_contents(map, headerMap); - cef_string_multimap_free(map); + // Translate param: headerMap; type: string_map_multi_byref + cef_string_multimap_t headerMapMultimap = cef_string_multimap_alloc(); + DCHECK(headerMapMultimap); + if (headerMapMultimap) + transfer_string_multimap_contents(headerMap, headerMapMultimap); + + // Execute + struct_->get_header_map(struct_, + headerMapMultimap); + + // Restore param:headerMap; type: string_map_multi_byref + if (headerMapMultimap) { + headerMap.clear(); + transfer_string_multimap_contents(headerMapMultimap, headerMap); + cef_string_multimap_free(headerMapMultimap); + } } + void CefRequestCToCpp::SetHeaderMap(const HeaderMap& headerMap) { - if(CEF_MEMBER_MISSING(struct_, set_header_map)) + if (CEF_MEMBER_MISSING(struct_, set_header_map)) return; - cef_string_multimap_t map = NULL; - if(!headerMap.empty()) { - map = cef_string_multimap_alloc(); - if(!map) - return; - transfer_string_multimap_contents(headerMap, map); - } + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - struct_->set_header_map(struct_, map); - - if(map) - cef_string_multimap_free(map); + // Translate param: headerMap; type: string_map_multi_byref_const + cef_string_multimap_t headerMapMultimap = cef_string_multimap_alloc(); + DCHECK(headerMapMultimap); + if (headerMapMultimap) + transfer_string_multimap_contents(headerMap, headerMapMultimap); + + // Execute + struct_->set_header_map(struct_, + headerMapMultimap); + + // Restore param:headerMap; type: string_map_multi_byref_const + if (headerMapMultimap) + cef_string_multimap_free(headerMapMultimap); } + void CefRequestCToCpp::Set(const CefString& url, const CefString& method, CefRefPtr postData, const HeaderMap& headerMap) { - if(CEF_MEMBER_MISSING(struct_, set)) + if (CEF_MEMBER_MISSING(struct_, set)) return; - cef_post_data_t* postDataStruct = NULL; - if(postData.get()) - postDataStruct = CefPostDataCToCpp::Unwrap(postData); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - cef_string_multimap_t map = NULL; - if(!headerMap.empty()) { - map = cef_string_multimap_alloc(); - if(!map) - return; - transfer_string_multimap_contents(headerMap, map); - } + // Verify param: url; type: string_byref_const + DCHECK(!url.empty()); + if (url.empty()) + return; + // Verify param: method; type: string_byref_const + DCHECK(!method.empty()); + if (method.empty()) + return; + // Unverified params: postData - struct_->set(struct_, url.GetStruct(), method.GetStruct(), postDataStruct, - map); - - if(map) - cef_string_multimap_free(map); + // Translate param: headerMap; type: string_map_multi_byref_const + cef_string_multimap_t headerMapMultimap = cef_string_multimap_alloc(); + DCHECK(headerMapMultimap); + if (headerMapMultimap) + transfer_string_multimap_contents(headerMap, headerMapMultimap); + + // Execute + struct_->set(struct_, + url.GetStruct(), + method.GetStruct(), + CefPostDataCToCpp::Unwrap(postData), + headerMapMultimap); + + // Restore param:headerMap; type: string_map_multi_byref_const + if (headerMapMultimap) + cef_string_multimap_free(headerMapMultimap); } + CefRequest::RequestFlags CefRequestCToCpp::GetFlags() { - if(CEF_MEMBER_MISSING(struct_, get_flags)) + if (CEF_MEMBER_MISSING(struct_, get_flags)) return WUR_FLAG_NONE; - return struct_->get_flags(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_weburlrequest_flags_t _retval = struct_->get_flags(struct_); + + // Return type: simple + return _retval; } + void CefRequestCToCpp::SetFlags(RequestFlags flags) { - if(CEF_MEMBER_MISSING(struct_, set_flags)) + if (CEF_MEMBER_MISSING(struct_, set_flags)) return; - struct_->set_flags(struct_, flags); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->set_flags(struct_, + flags); } + CefString CefRequestCToCpp::GetFirstPartyForCookies() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_first_party_for_cookies)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_first_party_for_cookies)) + return CefString(); - cef_string_userfree_t strPtr = struct_->get_first_party_for_cookies(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_first_party_for_cookies(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + void CefRequestCToCpp::SetFirstPartyForCookies(const CefString& url) { - if(CEF_MEMBER_MISSING(struct_, set_first_party_for_cookies)) + if (CEF_MEMBER_MISSING(struct_, set_first_party_for_cookies)) return; - struct_->set_first_party_for_cookies(struct_, url.GetStruct()); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: url; type: string_byref_const + DCHECK(!url.empty()); + if (url.empty()) + return; + + // Execute + struct_->set_first_party_for_cookies(struct_, + url.GetStruct()); } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/request_ctocpp.h b/libcef_dll/ctocpp/request_ctocpp.h index 60e089a77..c156c2e35 100644 --- a/libcef_dll/ctocpp/request_ctocpp.h +++ b/libcef_dll/ctocpp/request_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _REQUEST_CTOCPP_H diff --git a/libcef_dll/ctocpp/request_handler_ctocpp.cc b/libcef_dll/ctocpp/request_handler_ctocpp.cc index 4c388a2cd..f4eabf8a1 100644 --- a/libcef_dll/ctocpp/request_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/request_handler_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/cpptoc/browser_cpptoc.h" @@ -27,13 +27,36 @@ bool CefRequestHandlerCToCpp::OnBeforeBrowse(CefRefPtr browser, bool isRedirect) { if (CEF_MEMBER_MISSING(struct_, on_before_browse)) - return true; + return false; - return struct_->on_before_browse(struct_, CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), CefRequestCppToC::Wrap(request), - navType, isRedirect) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return false; + // Verify param: frame; type: refptr_diff + DCHECK(frame.get()); + if (!frame.get()) + return false; + // Verify param: request; type: refptr_diff + DCHECK(request.get()); + if (!request.get()) + return false; + + // Execute + int _retval = struct_->on_before_browse(struct_, + CefBrowserCppToC::Wrap(browser), + CefFrameCppToC::Wrap(frame), + CefRequestCppToC::Wrap(request), + navType, + isRedirect); + + // Return type: bool + return _retval?true:false; } + bool CefRequestHandlerCToCpp::OnBeforeResourceLoad( CefRefPtr browser, CefRefPtr request, CefString& redirectUrl, CefRefPtr& resourceStream, @@ -42,19 +65,50 @@ bool CefRequestHandlerCToCpp::OnBeforeResourceLoad( if (CEF_MEMBER_MISSING(struct_, on_before_resource_load)) return false; - cef_stream_reader_t* streamRet = NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - int rv = struct_->on_before_resource_load(struct_, - CefBrowserCppToC::Wrap(browser), CefRequestCppToC::Wrap(request), - redirectUrl.GetWritableStruct(), &streamRet, - CefResponseCppToC::Wrap(response), loadFlags); + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return false; + // Verify param: request; type: refptr_diff + DCHECK(request.get()); + if (!request.get()) + return false; + // Verify param: response; type: refptr_diff + DCHECK(response.get()); + if (!response.get()) + return false; - if(streamRet) - resourceStream = CefStreamReaderCppToC::Unwrap(streamRet); + // Translate param: resourceStream; type: refptr_diff_byref + cef_stream_reader_t* resourceStreamStruct = NULL; + if(resourceStream.get()) + resourceStreamStruct = CefStreamReaderCppToC::Wrap(resourceStream); + cef_stream_reader_t* resourceStreamOrig = resourceStreamStruct; - return (rv ? true : false); + // Execute + int _retval = struct_->on_before_resource_load(struct_, + CefBrowserCppToC::Wrap(browser), + CefRequestCppToC::Wrap(request), + redirectUrl.GetWritableStruct(), + &resourceStreamStruct, + CefResponseCppToC::Wrap(response), + loadFlags); + + // Restore param:resourceStream; type: refptr_diff_byref + if (resourceStreamStruct) { + if (resourceStreamStruct != resourceStreamOrig) { + resourceStream = CefStreamReaderCppToC::Unwrap(resourceStreamStruct); + } + } else { + resourceStream = NULL; + } + + // Return type: bool + return _retval?true:false; } + void CefRequestHandlerCToCpp::OnResourceResponse(CefRefPtr browser, const CefString& url, CefRefPtr response, CefRefPtr& filter) @@ -62,29 +116,79 @@ void CefRequestHandlerCToCpp::OnResourceResponse(CefRefPtr browser, if (CEF_MEMBER_MISSING(struct_, on_resource_response)) return; - cef_content_filter_t* filterRet = NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return; + // Verify param: url; type: string_byref_const + DCHECK(!url.empty()); + if (url.empty()) + return; + // Verify param: response; type: refptr_diff + DCHECK(response.get()); + if (!response.get()) + return; + + // Translate param: filter; type: refptr_same_byref + cef_content_filter_t* filterStruct = NULL; + if(filter.get()) + filterStruct = CefContentFilterCToCpp::Unwrap(filter); + cef_content_filter_t* filterOrig = filterStruct; + + // Execute struct_->on_resource_response(struct_, - CefBrowserCppToC::Wrap(browser), url.GetStruct(), - CefResponseCppToC::Wrap(response), &filterRet); - - if(filterRet) - filter = CefContentFilterCToCpp::Wrap(filterRet); + CefBrowserCppToC::Wrap(browser), + url.GetStruct(), + CefResponseCppToC::Wrap(response), + &filterStruct); + + // Restore param:filter; type: refptr_same_byref + if (filterStruct) { + if (filterStruct != filterOrig) { + filter = CefContentFilterCToCpp::Wrap(filterStruct); + } + } else { + filter = NULL; + } } + bool CefRequestHandlerCToCpp::OnProtocolExecution(CefRefPtr browser, const CefString& url, bool& allowOSExecution) { if (CEF_MEMBER_MISSING(struct_, on_protocol_execution)) return false; - int allowExec = allowOSExecution; - int rv = struct_->on_protocol_execution(struct_, - CefBrowserCppToC::Wrap(browser), url.GetStruct(), &allowExec); - allowOSExecution = allowExec?true:false; - return (rv ? true : false); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return false; + // Verify param: url; type: string_byref_const + DCHECK(!url.empty()); + if (url.empty()) + return false; + + // Translate param: allowOSExecution; type: bool_byref + int allowOSExecutionInt = allowOSExecution; + + // Execute + int _retval = struct_->on_protocol_execution(struct_, + CefBrowserCppToC::Wrap(browser), + url.GetStruct(), + &allowOSExecutionInt); + + // Restore param:allowOSExecution; type: bool_byref + allowOSExecution = allowOSExecutionInt?true:false; + + // Return type: bool + return _retval?true:false; } + bool CefRequestHandlerCToCpp::GetDownloadHandler(CefRefPtr browser, const CefString& mimeType, const CefString& fileName, int64 contentLength, CefRefPtr& handler) @@ -92,18 +196,49 @@ bool CefRequestHandlerCToCpp::GetDownloadHandler(CefRefPtr browser, if (CEF_MEMBER_MISSING(struct_, get_download_handler)) return false; - cef_download_handler_t* handlerRet = NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - int rv = struct_->get_download_handler(struct_, - CefBrowserCppToC::Wrap(browser), mimeType.GetStruct(), - fileName.GetStruct(), contentLength, &handlerRet); + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return false; + // Verify param: mimeType; type: string_byref_const + DCHECK(!mimeType.empty()); + if (mimeType.empty()) + return false; + // Verify param: fileName; type: string_byref_const + DCHECK(!fileName.empty()); + if (fileName.empty()) + return false; - if(handlerRet) - handler = CefDownloadHandlerCToCpp::Wrap(handlerRet); + // Translate param: handler; type: refptr_same_byref + cef_download_handler_t* handlerStruct = NULL; + if(handler.get()) + handlerStruct = CefDownloadHandlerCToCpp::Unwrap(handler); + cef_download_handler_t* handlerOrig = handlerStruct; - return (rv ? true : false); + // Execute + int _retval = struct_->get_download_handler(struct_, + CefBrowserCppToC::Wrap(browser), + mimeType.GetStruct(), + fileName.GetStruct(), + contentLength, + &handlerStruct); + + // Restore param:handler; type: refptr_same_byref + if (handlerStruct) { + if (handlerStruct != handlerOrig) { + handler = CefDownloadHandlerCToCpp::Wrap(handlerStruct); + } + } else { + handler = NULL; + } + + // Return type: bool + return _retval?true:false; } + bool CefRequestHandlerCToCpp::GetAuthCredentials(CefRefPtr browser, bool isProxy, const CefString& host, int port, const CefString& realm, const CefString& scheme, CefString& username, CefString& password) @@ -111,13 +246,42 @@ bool CefRequestHandlerCToCpp::GetAuthCredentials(CefRefPtr browser, if (CEF_MEMBER_MISSING(struct_, get_auth_credentials)) return false; - return struct_->get_auth_credentials(struct_, CefBrowserCppToC::Wrap(browser), - isProxy, host.GetStruct(), port, realm.GetStruct(), scheme.GetStruct(), - username.GetWritableStruct(), password.GetWritableStruct()) ? - true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return false; + // Verify param: host; type: string_byref_const + DCHECK(!host.empty()); + if (host.empty()) + return false; + // Verify param: realm; type: string_byref_const + DCHECK(!realm.empty()); + if (realm.empty()) + return false; + // Verify param: scheme; type: string_byref_const + DCHECK(!scheme.empty()); + if (scheme.empty()) + return false; + + // Execute + int _retval = struct_->get_auth_credentials(struct_, + CefBrowserCppToC::Wrap(browser), + isProxy, + host.GetStruct(), + port, + realm.GetStruct(), + scheme.GetStruct(), + username.GetWritableStruct(), + password.GetWritableStruct()); + + // Return type: bool + return _retval?true:false; } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/request_handler_ctocpp.h b/libcef_dll/ctocpp/request_handler_ctocpp.h index 31fb645c0..e576503fb 100644 --- a/libcef_dll/ctocpp/request_handler_ctocpp.h +++ b/libcef_dll/ctocpp/request_handler_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _REQUESTHANDLER_CTOCPP_H diff --git a/libcef_dll/ctocpp/response_ctocpp.cc b/libcef_dll/ctocpp/response_ctocpp.cc index 7ad6d1947..500abc12e 100644 --- a/libcef_dll/ctocpp/response_ctocpp.cc +++ b/libcef_dll/ctocpp/response_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/ctocpp/response_ctocpp.h" @@ -18,103 +18,175 @@ int CefResponseCToCpp::GetStatus() { - if(CEF_MEMBER_MISSING(struct_, get_status)) + if (CEF_MEMBER_MISSING(struct_, get_status)) return 0; - - return struct_->get_status(struct_); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_status(struct_); + + // Return type: simple + return _retval; } + void CefResponseCToCpp::SetStatus(int status) { - if(CEF_MEMBER_MISSING(struct_, set_status)) + if (CEF_MEMBER_MISSING(struct_, set_status)) return; - struct_->set_status(struct_, status); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->set_status(struct_, + status); } + CefString CefResponseCToCpp::GetStatusText() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_status_text)) - return str; - - cef_string_userfree_t strPtr = struct_->get_status_text(struct_); - str.AttachToUserFree(strPtr); - return str; + if (CEF_MEMBER_MISSING(struct_, get_status_text)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_status_text(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + void CefResponseCToCpp::SetStatusText(const CefString& statusText) { - if(CEF_MEMBER_MISSING(struct_, set_status_text)) + if (CEF_MEMBER_MISSING(struct_, set_status_text)) return; - struct_->set_status_text(struct_, statusText.GetStruct()); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: statusText; type: string_byref_const + DCHECK(!statusText.empty()); + if (statusText.empty()) + return; + + // Execute + struct_->set_status_text(struct_, + statusText.GetStruct()); } + CefString CefResponseCToCpp::GetMimeType() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_mime_type)) - return str; - - cef_string_userfree_t strPtr = struct_->get_mime_type(struct_); - str.AttachToUserFree(strPtr); - return str; + if (CEF_MEMBER_MISSING(struct_, get_mime_type)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_mime_type(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + void CefResponseCToCpp::SetMimeType(const CefString& mimeType) { - if(CEF_MEMBER_MISSING(struct_, set_mime_type)) + if (CEF_MEMBER_MISSING(struct_, set_mime_type)) return; - struct_->set_mime_type(struct_, mimeType.GetStruct()); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: mimeType; type: string_byref_const + DCHECK(!mimeType.empty()); + if (mimeType.empty()) + return; + + // Execute + struct_->set_mime_type(struct_, + mimeType.GetStruct()); } + CefString CefResponseCToCpp::GetHeader(const CefString& name) { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_header)) - return str; - - cef_string_userfree_t strPtr = struct_->get_header(struct_, name.GetStruct()); - str.AttachToUserFree(strPtr); - return str; + if (CEF_MEMBER_MISSING(struct_, get_header)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: name; type: string_byref_const + DCHECK(!name.empty()); + if (name.empty()) + return CefString(); + + // Execute + cef_string_userfree_t _retval = struct_->get_header(struct_, + name.GetStruct()); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + void CefResponseCToCpp::GetHeaderMap(HeaderMap& headerMap) { - if(CEF_MEMBER_MISSING(struct_, get_header_map)) + if (CEF_MEMBER_MISSING(struct_, get_header_map)) return; - cef_string_multimap_t map = cef_string_multimap_alloc(); - if(!map) - return; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - struct_->get_header_map(struct_, map); - transfer_string_multimap_contents(map, headerMap); - cef_string_multimap_free(map); + // Translate param: headerMap; type: string_map_multi_byref + cef_string_multimap_t headerMapMultimap = cef_string_multimap_alloc(); + DCHECK(headerMapMultimap); + if (headerMapMultimap) + transfer_string_multimap_contents(headerMap, headerMapMultimap); + + // Execute + struct_->get_header_map(struct_, + headerMapMultimap); + + // Restore param:headerMap; type: string_map_multi_byref + if (headerMapMultimap) { + headerMap.clear(); + transfer_string_multimap_contents(headerMapMultimap, headerMap); + cef_string_multimap_free(headerMapMultimap); + } } + void CefResponseCToCpp::SetHeaderMap(const HeaderMap& headerMap) { - if(CEF_MEMBER_MISSING(struct_, set_header_map)) + if (CEF_MEMBER_MISSING(struct_, set_header_map)) return; - cef_string_multimap_t map = NULL; - if(!headerMap.empty()) { - map = cef_string_multimap_alloc(); - if(!map) - return; - transfer_string_multimap_contents(headerMap, map); - } + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - struct_->set_header_map(struct_, map); - - if(map) - cef_string_multimap_free(map); + // Translate param: headerMap; type: string_map_multi_byref_const + cef_string_multimap_t headerMapMultimap = cef_string_multimap_alloc(); + DCHECK(headerMapMultimap); + if (headerMapMultimap) + transfer_string_multimap_contents(headerMap, headerMapMultimap); + + // Execute + struct_->set_header_map(struct_, + headerMapMultimap); + + // Restore param:headerMap; type: string_map_multi_byref_const + if (headerMapMultimap) + cef_string_multimap_free(headerMapMultimap); } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/response_ctocpp.h b/libcef_dll/ctocpp/response_ctocpp.h index 434a5f97c..cd1225616 100644 --- a/libcef_dll/ctocpp/response_ctocpp.h +++ b/libcef_dll/ctocpp/response_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _RESPONSE_CTOCPP_H diff --git a/libcef_dll/ctocpp/scheme_handler_callback_ctocpp.cc b/libcef_dll/ctocpp/scheme_handler_callback_ctocpp.cc index 12b74f750..9c1e7fd6d 100644 --- a/libcef_dll/ctocpp/scheme_handler_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/scheme_handler_callback_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/ctocpp/scheme_handler_callback_ctocpp.h" @@ -20,26 +20,38 @@ void CefSchemeHandlerCallbackCToCpp::HeadersAvailable() if (CEF_MEMBER_MISSING(struct_, headers_available)) return; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute struct_->headers_available(struct_); } + void CefSchemeHandlerCallbackCToCpp::BytesAvailable() { if (CEF_MEMBER_MISSING(struct_, bytes_available)) return; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute struct_->bytes_available(struct_); } + void CefSchemeHandlerCallbackCToCpp::Cancel() { if (CEF_MEMBER_MISSING(struct_, cancel)) return; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute struct_->cancel(struct_); } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/scheme_handler_callback_ctocpp.h b/libcef_dll/ctocpp/scheme_handler_callback_ctocpp.h index b258777cd..1514cdf9a 100644 --- a/libcef_dll/ctocpp/scheme_handler_callback_ctocpp.h +++ b/libcef_dll/ctocpp/scheme_handler_callback_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _SCHEMEHANDLERCALLBACK_CTOCPP_H diff --git a/libcef_dll/ctocpp/scheme_handler_ctocpp.cc b/libcef_dll/ctocpp/scheme_handler_ctocpp.cc index 664185fba..1abff2d4d 100644 --- a/libcef_dll/ctocpp/scheme_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/scheme_handler_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/cpptoc/request_cpptoc.h" @@ -21,42 +21,93 @@ bool CefSchemeHandlerCToCpp::ProcessRequest(CefRefPtr request, CefRefPtr callback) { - if(CEF_MEMBER_MISSING(struct_, process_request)) + if (CEF_MEMBER_MISSING(struct_, process_request)) return false; - return struct_->process_request(struct_, CefRequestCppToC::Wrap(request), - CefSchemeHandlerCallbackCppToC::Wrap(callback)) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: request; type: refptr_diff + DCHECK(request.get()); + if (!request.get()) + return false; + // Verify param: callback; type: refptr_diff + DCHECK(callback.get()); + if (!callback.get()) + return false; + + // Execute + int _retval = struct_->process_request(struct_, + CefRequestCppToC::Wrap(request), + CefSchemeHandlerCallbackCppToC::Wrap(callback)); + + // Return type: bool + return _retval?true:false; } + void CefSchemeHandlerCToCpp::GetResponseHeaders(CefRefPtr response, int64& response_length, CefString& redirectUrl) { if (CEF_MEMBER_MISSING(struct_, get_response_headers)) return; - struct_->get_response_headers(struct_, CefResponseCppToC::Wrap(response), - &response_length, redirectUrl.GetWritableStruct()); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: response; type: refptr_diff + DCHECK(response.get()); + if (!response.get()) + return; + + // Execute + struct_->get_response_headers(struct_, + CefResponseCppToC::Wrap(response), + &response_length, + redirectUrl.GetWritableStruct()); } + bool CefSchemeHandlerCToCpp::ReadResponse(void* data_out, int bytes_to_read, int& bytes_read, CefRefPtr callback) { - if(CEF_MEMBER_MISSING(struct_, read_response)) + if (CEF_MEMBER_MISSING(struct_, read_response)) return false; - return struct_->read_response(struct_, data_out, bytes_to_read, &bytes_read, - CefSchemeHandlerCallbackCppToC::Wrap(callback)) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: data_out; type: simple_byaddr + DCHECK(data_out); + if (!data_out) + return false; + // Verify param: callback; type: refptr_diff + DCHECK(callback.get()); + if (!callback.get()) + return false; + + // Execute + int _retval = struct_->read_response(struct_, + data_out, + bytes_to_read, + &bytes_read, + CefSchemeHandlerCallbackCppToC::Wrap(callback)); + + // Return type: bool + return _retval?true:false; } + void CefSchemeHandlerCToCpp::Cancel() { - if(CEF_MEMBER_MISSING(struct_, cancel)) + if (CEF_MEMBER_MISSING(struct_, cancel)) return; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute struct_->cancel(struct_); } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/scheme_handler_ctocpp.h b/libcef_dll/ctocpp/scheme_handler_ctocpp.h index 6e3e6562f..74dcef43d 100644 --- a/libcef_dll/ctocpp/scheme_handler_ctocpp.h +++ b/libcef_dll/ctocpp/scheme_handler_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _SCHEMEHANDLER_CTOCPP_H diff --git a/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc b/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc index f4f4fc4bc..f14e99c71 100644 --- a/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc +++ b/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/cpptoc/browser_cpptoc.h" @@ -22,22 +22,36 @@ CefRefPtr CefSchemeHandlerFactoryCToCpp::Create( CefRefPtr browser, const CefString& scheme_name, CefRefPtr request) { - if(CEF_MEMBER_MISSING(struct_, create)) + if (CEF_MEMBER_MISSING(struct_, create)) return NULL; - cef_browser_t* browserStruct = NULL; - if (browser.get()) - browserStruct = CefBrowserCppToC::Wrap(browser); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - cef_scheme_handler_t* rv = struct_->create(struct_, browserStruct, - scheme_name.GetStruct(), CefRequestCppToC::Wrap(request)); - if (rv) - return CefSchemeHandlerCToCpp::Wrap(rv); + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return NULL; + // Verify param: scheme_name; type: string_byref_const + DCHECK(!scheme_name.empty()); + if (scheme_name.empty()) + return NULL; + // Verify param: request; type: refptr_diff + DCHECK(request.get()); + if (!request.get()) + return NULL; - return NULL; + // Execute + cef_scheme_handler_t* _retval = struct_->create(struct_, + CefBrowserCppToC::Wrap(browser), + scheme_name.GetStruct(), + CefRequestCppToC::Wrap(request)); + + // Return type: refptr_same + return CefSchemeHandlerCToCpp::Wrap(_retval); } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h b/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h index 4a21299a6..2aadd420a 100644 --- a/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h +++ b/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _SCHEMEHANDLERFACTORY_CTOCPP_H diff --git a/libcef_dll/ctocpp/storage_visitor_ctocpp.cc b/libcef_dll/ctocpp/storage_visitor_ctocpp.cc index 91c2f4627..eabac48f6 100644 --- a/libcef_dll/ctocpp/storage_visitor_ctocpp.cc +++ b/libcef_dll/ctocpp/storage_visitor_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/ctocpp/storage_visitor_ctocpp.h" @@ -22,16 +22,43 @@ bool CefStorageVisitorCToCpp::Visit(CefStorageType type, if (CEF_MEMBER_MISSING(struct_, visit)) return false; - int delVal = deleteData; - bool retVal = struct_->visit(struct_, type, origin.GetStruct(), - key.GetStruct(), value.GetStruct(), count, total, &delVal) ? - true : false; - deleteData = delVal?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return retVal; + // Verify param: origin; type: string_byref_const + DCHECK(!origin.empty()); + if (origin.empty()) + return false; + // Verify param: key; type: string_byref_const + DCHECK(!key.empty()); + if (key.empty()) + return false; + // Verify param: value; type: string_byref_const + DCHECK(!value.empty()); + if (value.empty()) + return false; + + // Translate param: deleteData; type: bool_byref + int deleteDataInt = deleteData; + + // Execute + int _retval = struct_->visit(struct_, + type, + origin.GetStruct(), + key.GetStruct(), + value.GetStruct(), + count, + total, + &deleteDataInt); + + // Restore param:deleteData; type: bool_byref + deleteData = deleteDataInt?true:false; + + // Return type: bool + return _retval?true:false; } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/storage_visitor_ctocpp.h b/libcef_dll/ctocpp/storage_visitor_ctocpp.h index 461b20276..8921d4eec 100644 --- a/libcef_dll/ctocpp/storage_visitor_ctocpp.h +++ b/libcef_dll/ctocpp/storage_visitor_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _STORAGEVISITOR_CTOCPP_H diff --git a/libcef_dll/ctocpp/stream_reader_ctocpp.cc b/libcef_dll/ctocpp/stream_reader_ctocpp.cc index c3ceba4fa..98c73e515 100644 --- a/libcef_dll/ctocpp/stream_reader_ctocpp.cc +++ b/libcef_dll/ctocpp/stream_reader_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/cpptoc/read_handler_cpptoc.h" @@ -19,68 +19,135 @@ CefRefPtr CefStreamReader::CreateForFile( const CefString& fileName) { - cef_stream_reader_t* impl = - cef_stream_reader_create_for_file(fileName.GetStruct()); - if(impl) - return CefStreamReaderCToCpp::Wrap(impl); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: fileName; type: string_byref_const + DCHECK(!fileName.empty()); + if (fileName.empty()) + return NULL; + + // Execute + cef_stream_reader_t* _retval = cef_stream_reader_create_for_file( + fileName.GetStruct()); + + // Return type: refptr_same + return CefStreamReaderCToCpp::Wrap(_retval); } + CefRefPtr CefStreamReader::CreateForData(void* data, size_t size) { - cef_stream_reader_t* impl = cef_stream_reader_create_for_data(data, size); - if(impl) - return CefStreamReaderCToCpp::Wrap(impl); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: data; type: simple_byaddr + DCHECK(data); + if (!data) + return NULL; + + // Execute + cef_stream_reader_t* _retval = cef_stream_reader_create_for_data( + data, + size); + + // Return type: refptr_same + return CefStreamReaderCToCpp::Wrap(_retval); } + CefRefPtr CefStreamReader::CreateForHandler( CefRefPtr handler) { - cef_stream_reader_t* impl = - cef_stream_reader_create_for_handler(CefReadHandlerCppToC::Wrap(handler)); - if(impl) - return CefStreamReaderCToCpp::Wrap(impl); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: handler; type: refptr_diff + DCHECK(handler.get()); + if (!handler.get()) + return NULL; + + // Execute + cef_stream_reader_t* _retval = cef_stream_reader_create_for_handler( + CefReadHandlerCppToC::Wrap(handler)); + + // Return type: refptr_same + return CefStreamReaderCToCpp::Wrap(_retval); } + // VIRTUAL METHODS - Body may be edited by hand. size_t CefStreamReaderCToCpp::Read(void* ptr, size_t size, size_t n) { - if(CEF_MEMBER_MISSING(struct_, read)) + if (CEF_MEMBER_MISSING(struct_, read)) return 0; - return struct_->read(struct_, ptr, size, n); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: ptr; type: simple_byaddr + DCHECK(ptr); + if (!ptr) + return 0; + + // Execute + size_t _retval = struct_->read(struct_, + ptr, + size, + n); + + // Return type: simple + return _retval; } + int CefStreamReaderCToCpp::Seek(long offset, int whence) { - if(CEF_MEMBER_MISSING(struct_, seek)) + if (CEF_MEMBER_MISSING(struct_, seek)) return 0; - return struct_->seek(struct_, offset, whence); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->seek(struct_, + offset, + whence); + + // Return type: simple + return _retval; } + long CefStreamReaderCToCpp::Tell() { - if(CEF_MEMBER_MISSING(struct_, tell)) + if (CEF_MEMBER_MISSING(struct_, tell)) return 0; - return struct_->tell(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + long _retval = struct_->tell(struct_); + + // Return type: simple + return _retval; } + int CefStreamReaderCToCpp::Eof() { - if(CEF_MEMBER_MISSING(struct_, eof)) + if (CEF_MEMBER_MISSING(struct_, eof)) return 0; - return struct_->eof(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->eof(struct_); + + // Return type: simple + return _retval; } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/stream_reader_ctocpp.h b/libcef_dll/ctocpp/stream_reader_ctocpp.h index ee291cc55..e9f0b7bc1 100644 --- a/libcef_dll/ctocpp/stream_reader_ctocpp.h +++ b/libcef_dll/ctocpp/stream_reader_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _STREAMREADER_CTOCPP_H diff --git a/libcef_dll/ctocpp/stream_writer_ctocpp.cc b/libcef_dll/ctocpp/stream_writer_ctocpp.cc index b92c66ca4..39911f21a 100644 --- a/libcef_dll/ctocpp/stream_writer_ctocpp.cc +++ b/libcef_dll/ctocpp/stream_writer_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/cpptoc/write_handler_cpptoc.h" @@ -19,68 +19,115 @@ CefRefPtr CefStreamWriter::CreateForFile( const CefString& fileName) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: fileName; type: string_byref_const DCHECK(!fileName.empty()); - if(fileName.empty()) + if (fileName.empty()) return NULL; - cef_stream_writer_t* impl = - cef_stream_writer_create_for_file(fileName.GetStruct()); - if(impl) - return CefStreamWriterCToCpp::Wrap(impl); - return NULL; + // Execute + cef_stream_writer_t* _retval = cef_stream_writer_create_for_file( + fileName.GetStruct()); + + // Return type: refptr_same + return CefStreamWriterCToCpp::Wrap(_retval); } + CefRefPtr CefStreamWriter::CreateForHandler( CefRefPtr handler) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: handler; type: refptr_diff DCHECK(handler.get()); - if(!handler.get()) + if (!handler.get()) return NULL; - cef_stream_writer_t* impl = - cef_stream_writer_create_for_handler( - CefWriteHandlerCppToC::Wrap(handler)); - if(impl) - return CefStreamWriterCToCpp::Wrap(impl); - return NULL; + // Execute + cef_stream_writer_t* _retval = cef_stream_writer_create_for_handler( + CefWriteHandlerCppToC::Wrap(handler)); + + // Return type: refptr_same + return CefStreamWriterCToCpp::Wrap(_retval); } + // VIRTUAL METHODS - Body may be edited by hand. size_t CefStreamWriterCToCpp::Write(const void* ptr, size_t size, size_t n) { - if(CEF_MEMBER_MISSING(struct_, write)) + if (CEF_MEMBER_MISSING(struct_, write)) return 0; - return struct_->write(struct_, ptr, size, n); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: ptr; type: simple_byaddr + DCHECK(ptr); + if (!ptr) + return 0; + + // Execute + size_t _retval = struct_->write(struct_, + ptr, + size, + n); + + // Return type: simple + return _retval; } + int CefStreamWriterCToCpp::Seek(long offset, int whence) { - if(CEF_MEMBER_MISSING(struct_, seek)) + if (CEF_MEMBER_MISSING(struct_, seek)) return 0; - return struct_->seek(struct_, offset, whence); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->seek(struct_, + offset, + whence); + + // Return type: simple + return _retval; } + long CefStreamWriterCToCpp::Tell() { - if(CEF_MEMBER_MISSING(struct_, tell)) + if (CEF_MEMBER_MISSING(struct_, tell)) return 0; - return struct_->tell(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + long _retval = struct_->tell(struct_); + + // Return type: simple + return _retval; } + int CefStreamWriterCToCpp::Flush() { - if(CEF_MEMBER_MISSING(struct_, flush)) + if (CEF_MEMBER_MISSING(struct_, flush)) return 0; - return struct_->flush(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->flush(struct_); + + // Return type: simple + return _retval; } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/stream_writer_ctocpp.h b/libcef_dll/ctocpp/stream_writer_ctocpp.h index 777860db0..12083c320 100644 --- a/libcef_dll/ctocpp/stream_writer_ctocpp.h +++ b/libcef_dll/ctocpp/stream_writer_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _STREAMWRITER_CTOCPP_H diff --git a/libcef_dll/ctocpp/task_ctocpp.cc b/libcef_dll/ctocpp/task_ctocpp.cc index 7949065b3..1b90f4de6 100644 --- a/libcef_dll/ctocpp/task_ctocpp.cc +++ b/libcef_dll/ctocpp/task_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/ctocpp/task_ctocpp.h" @@ -17,13 +17,18 @@ void CefTaskCToCpp::Execute(CefThreadId threadId) { - if(CEF_MEMBER_MISSING(struct_, execute)) - return; + if (CEF_MEMBER_MISSING(struct_, execute)) + return; - struct_->execute(struct_, threadId); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->execute(struct_, + threadId); } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; #endif diff --git a/libcef_dll/ctocpp/task_ctocpp.h b/libcef_dll/ctocpp/task_ctocpp.h index 9260338e2..79a690f83 100644 --- a/libcef_dll/ctocpp/task_ctocpp.h +++ b/libcef_dll/ctocpp/task_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _TASK_CTOCPP_H diff --git a/libcef_dll/ctocpp/v8accessor_ctocpp.cc b/libcef_dll/ctocpp/v8accessor_ctocpp.cc index df27076c2..3ab76e4e3 100644 --- a/libcef_dll/ctocpp/v8accessor_ctocpp.cc +++ b/libcef_dll/ctocpp/v8accessor_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/cpptoc/v8value_cpptoc.h" @@ -20,36 +20,82 @@ bool CefV8AccessorCToCpp::Get(const CefString& name, const CefRefPtr object, CefRefPtr& retval, CefString& exception) { - if(CEF_MEMBER_MISSING(struct_, get)) + if (CEF_MEMBER_MISSING(struct_, get)) return false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: name; type: string_byref_const + DCHECK(!name.empty()); + if (name.empty()) + return false; + // Verify param: object; type: refptr_diff + DCHECK(object.get()); + if (!object.get()) + return false; + + // Translate param: retval; type: refptr_diff_byref cef_v8value_t* retvalStruct = NULL; + if(retval.get()) + retvalStruct = CefV8ValueCppToC::Wrap(retval); + cef_v8value_t* retvalOrig = retvalStruct; - int rv = struct_->get(struct_, name.GetStruct(), - CefV8ValueCppToC::Wrap(object), &retvalStruct, - exception.GetWritableStruct()); - if(retvalStruct) - retval = CefV8ValueCppToC::Unwrap(retvalStruct); + // Execute + int _retval = struct_->get(struct_, + name.GetStruct(), + CefV8ValueCppToC::Wrap(object), + &retvalStruct, + exception.GetWritableStruct()); - return rv ? true : false; + // Restore param:retval; type: refptr_diff_byref + if (retvalStruct) { + if (retvalStruct != retvalOrig) { + retval = CefV8ValueCppToC::Unwrap(retvalStruct); + } + } else { + retval = NULL; + } + + // Return type: bool + return _retval?true:false; } + bool CefV8AccessorCToCpp::Set(const CefString& name, const CefRefPtr object, const CefRefPtr value, CefString& exception) { - if(CEF_MEMBER_MISSING(struct_, set)) + if (CEF_MEMBER_MISSING(struct_, set)) return false; - int rv = struct_->set(struct_, name.GetStruct(), - CefV8ValueCppToC::Wrap(object), - CefV8ValueCppToC::Wrap(value), - exception.GetWritableStruct()); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return rv ? true : false; + // Verify param: name; type: string_byref_const + DCHECK(!name.empty()); + if (name.empty()) + return false; + // Verify param: object; type: refptr_diff + DCHECK(object.get()); + if (!object.get()) + return false; + // Verify param: value; type: refptr_diff + DCHECK(value.get()); + if (!value.get()) + return false; + + // Execute + int _retval = struct_->set(struct_, + name.GetStruct(), + CefV8ValueCppToC::Wrap(object), + CefV8ValueCppToC::Wrap(value), + exception.GetWritableStruct()); + + // Return type: bool + return _retval?true:false; } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/v8accessor_ctocpp.h b/libcef_dll/ctocpp/v8accessor_ctocpp.h index a35649c25..e2f78c47e 100644 --- a/libcef_dll/ctocpp/v8accessor_ctocpp.h +++ b/libcef_dll/ctocpp/v8accessor_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _V8ACCESSOR_CTOCPP_H diff --git a/libcef_dll/ctocpp/v8context_ctocpp.cc b/libcef_dll/ctocpp/v8context_ctocpp.cc index 9a86c8881..930f1312d 100644 --- a/libcef_dll/ctocpp/v8context_ctocpp.cc +++ b/libcef_dll/ctocpp/v8context_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/ctocpp/browser_ctocpp.h" @@ -20,89 +20,140 @@ CefRefPtr CefV8Context::GetCurrentContext() { - cef_v8context_t* impl = cef_v8context_get_current_context(); - if(impl) - return CefV8ContextCToCpp::Wrap(impl); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_v8context_t* _retval = cef_v8context_get_current_context(); + + // Return type: refptr_same + return CefV8ContextCToCpp::Wrap(_retval); } + CefRefPtr CefV8Context::GetEnteredContext() { - cef_v8context_t* impl = cef_v8context_get_entered_context(); - if(impl) - return CefV8ContextCToCpp::Wrap(impl); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_v8context_t* _retval = cef_v8context_get_entered_context(); + + // Return type: refptr_same + return CefV8ContextCToCpp::Wrap(_retval); } + bool CefV8Context::InContext() { - return cef_v8context_in_context() ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = cef_v8context_in_context(); + + // Return type: bool + return _retval?true:false; } + // VIRTUAL METHODS - Body may be edited by hand. CefRefPtr CefV8ContextCToCpp::GetBrowser() { - if(CEF_MEMBER_MISSING(struct_, get_browser)) + if (CEF_MEMBER_MISSING(struct_, get_browser)) return NULL; - cef_browser_t* browserStruct = struct_->get_browser(struct_); - if(browserStruct) - return CefBrowserCToCpp::Wrap(browserStruct); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return NULL; + // Execute + cef_browser_t* _retval = struct_->get_browser(struct_); + + // Return type: refptr_same + return CefBrowserCToCpp::Wrap(_retval); } + CefRefPtr CefV8ContextCToCpp::GetFrame() { - if(CEF_MEMBER_MISSING(struct_, get_frame)) + if (CEF_MEMBER_MISSING(struct_, get_frame)) return NULL; - cef_frame_t* frameStruct = struct_->get_frame(struct_); - if(frameStruct) - return CefFrameCToCpp::Wrap(frameStruct); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return NULL; + // Execute + cef_frame_t* _retval = struct_->get_frame(struct_); + + // Return type: refptr_same + return CefFrameCToCpp::Wrap(_retval); } + CefRefPtr CefV8ContextCToCpp::GetGlobal() { - if(CEF_MEMBER_MISSING(struct_, get_global)) + if (CEF_MEMBER_MISSING(struct_, get_global)) return NULL; - cef_v8value_t* v8valueStruct = struct_->get_global(struct_); - if(v8valueStruct) - return CefV8ValueCToCpp::Wrap(v8valueStruct); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return NULL; + // Execute + cef_v8value_t* _retval = struct_->get_global(struct_); + + // Return type: refptr_same + return CefV8ValueCToCpp::Wrap(_retval); } + bool CefV8ContextCToCpp::Enter() { - if(CEF_MEMBER_MISSING(struct_, enter)) + if (CEF_MEMBER_MISSING(struct_, enter)) return false; - return struct_->enter(struct_)?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->enter(struct_); + + // Return type: bool + return _retval?true:false; } + bool CefV8ContextCToCpp::Exit() { - if(CEF_MEMBER_MISSING(struct_, exit)) + if (CEF_MEMBER_MISSING(struct_, exit)) return false; - return struct_->exit(struct_)?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->exit(struct_); + + // Return type: bool + return _retval?true:false; } + bool CefV8ContextCToCpp::IsSame(CefRefPtr that) { if (CEF_MEMBER_MISSING(struct_, is_same)) return false; - return struct_->is_same(struct_, CefV8ContextCToCpp::Unwrap(that))?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: that; type: refptr_same + DCHECK(that.get()); + if (!that.get()) + return false; + + // Execute + int _retval = struct_->is_same(struct_, + CefV8ContextCToCpp::Unwrap(that)); + + // Return type: bool + return _retval?true:false; } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/v8context_ctocpp.h b/libcef_dll/ctocpp/v8context_ctocpp.h index 535bbb97e..6bb23f8e9 100644 --- a/libcef_dll/ctocpp/v8context_ctocpp.h +++ b/libcef_dll/ctocpp/v8context_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _V8CONTEXT_CTOCPP_H diff --git a/libcef_dll/ctocpp/v8context_handler_ctocpp.cc b/libcef_dll/ctocpp/v8context_handler_ctocpp.cc index 7438c9221..545849ba2 100644 --- a/libcef_dll/ctocpp/v8context_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/v8context_handler_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/cpptoc/browser_cpptoc.h" @@ -24,21 +24,59 @@ void CefV8ContextHandlerCToCpp::OnContextCreated(CefRefPtr browser, if (CEF_MEMBER_MISSING(struct_, on_context_created)) return; - struct_->on_context_created(struct_, CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), CefV8ContextCppToC::Wrap(context)); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return; + // Verify param: frame; type: refptr_diff + DCHECK(frame.get()); + if (!frame.get()) + return; + // Verify param: context; type: refptr_diff + DCHECK(context.get()); + if (!context.get()) + return; + + // Execute + struct_->on_context_created(struct_, + CefBrowserCppToC::Wrap(browser), + CefFrameCppToC::Wrap(frame), + CefV8ContextCppToC::Wrap(context)); } + void CefV8ContextHandlerCToCpp::OnContextReleased(CefRefPtr browser, CefRefPtr frame, CefRefPtr context) { if (CEF_MEMBER_MISSING(struct_, on_context_released)) return; - struct_->on_context_released(struct_, CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), CefV8ContextCppToC::Wrap(context)); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: browser; type: refptr_diff + DCHECK(browser.get()); + if (!browser.get()) + return; + // Verify param: frame; type: refptr_diff + DCHECK(frame.get()); + if (!frame.get()) + return; + // Verify param: context; type: refptr_diff + DCHECK(context.get()); + if (!context.get()) + return; + + // Execute + struct_->on_context_released(struct_, + CefBrowserCppToC::Wrap(browser), + CefFrameCppToC::Wrap(frame), + CefV8ContextCppToC::Wrap(context)); } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/v8context_handler_ctocpp.h b/libcef_dll/ctocpp/v8context_handler_ctocpp.h index eb81531b5..a64b6bdb8 100644 --- a/libcef_dll/ctocpp/v8context_handler_ctocpp.h +++ b/libcef_dll/ctocpp/v8context_handler_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _V8CONTEXTHANDLER_CTOCPP_H diff --git a/libcef_dll/ctocpp/v8exception_ctocpp.cc b/libcef_dll/ctocpp/v8exception_ctocpp.cc index dbf868ffb..0e3241d97 100644 --- a/libcef_dll/ctocpp/v8exception_ctocpp.cc +++ b/libcef_dll/ctocpp/v8exception_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/ctocpp/v8exception_ctocpp.h" @@ -17,78 +17,131 @@ CefString CefV8ExceptionCToCpp::GetMessage() { - CefString str; if (CEF_MEMBER_MISSING(struct_, get_message)) - return str; + return CefString(); - cef_string_userfree_t strPtr = struct_->get_message(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_message(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + CefString CefV8ExceptionCToCpp::GetSourceLine() { - CefString str; if (CEF_MEMBER_MISSING(struct_, get_source_line)) - return str; + return CefString(); - cef_string_userfree_t strPtr = struct_->get_source_line(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_source_line(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + CefString CefV8ExceptionCToCpp::GetScriptResourceName() { - CefString str; if (CEF_MEMBER_MISSING(struct_, get_script_resource_name)) - return str; + return CefString(); - cef_string_userfree_t strPtr = struct_->get_script_resource_name(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_script_resource_name(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + int CefV8ExceptionCToCpp::GetLineNumber() { if (CEF_MEMBER_MISSING(struct_, get_line_number)) return 0; - return struct_->get_line_number(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_line_number(struct_); + + // Return type: simple + return _retval; } + int CefV8ExceptionCToCpp::GetStartPosition() { if (CEF_MEMBER_MISSING(struct_, get_start_position)) return 0; - return struct_->get_start_position(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_start_position(struct_); + + // Return type: simple + return _retval; } + int CefV8ExceptionCToCpp::GetEndPosition() { if (CEF_MEMBER_MISSING(struct_, get_end_position)) return 0; - return struct_->get_end_position(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_end_position(struct_); + + // Return type: simple + return _retval; } + int CefV8ExceptionCToCpp::GetStartColumn() { if (CEF_MEMBER_MISSING(struct_, get_start_column)) return 0; - return struct_->get_start_column(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_start_column(struct_); + + // Return type: simple + return _retval; } + int CefV8ExceptionCToCpp::GetEndColumn() { if (CEF_MEMBER_MISSING(struct_, get_end_column)) return 0; - return struct_->get_end_column(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_end_column(struct_); + + // Return type: simple + return _retval; } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/v8exception_ctocpp.h b/libcef_dll/ctocpp/v8exception_ctocpp.h index daa83dbc4..991888af8 100644 --- a/libcef_dll/ctocpp/v8exception_ctocpp.h +++ b/libcef_dll/ctocpp/v8exception_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _V8EXCEPTION_CTOCPP_H diff --git a/libcef_dll/ctocpp/v8handler_ctocpp.cc b/libcef_dll/ctocpp/v8handler_ctocpp.cc index 1e92400aa..23de82b8d 100644 --- a/libcef_dll/ctocpp/v8handler_ctocpp.cc +++ b/libcef_dll/ctocpp/v8handler_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/cpptoc/v8value_cpptoc.h" @@ -20,32 +20,62 @@ bool CefV8HandlerCToCpp::Execute(const CefString& name, CefRefPtr object, const CefV8ValueList& arguments, CefRefPtr& retval, CefString& exception) { - if(CEF_MEMBER_MISSING(struct_, execute)) + if (CEF_MEMBER_MISSING(struct_, execute)) return false; - cef_v8value_t** argsStructPtr = NULL; - int argsSize = arguments.size(); - if(argsSize > 0) { - argsStructPtr = new cef_v8value_t*[argsSize]; - for(int i = 0; i < argsSize; ++i) - argsStructPtr[i] = CefV8ValueCppToC::Wrap(arguments[i]); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: name; type: string_byref_const + DCHECK(!name.empty()); + if (name.empty()) + return false; + // Verify param: object; type: refptr_diff + DCHECK(object.get()); + if (!object.get()) + return false; + + // Translate param: arguments; type: refptr_vec_diff_byref_const + const size_t argumentsCount = arguments.size(); + cef_v8value_t** argumentsList = NULL; + if (argumentsCount > 0) { + argumentsList = new cef_v8value_t*[argumentsCount]; + DCHECK(argumentsList); + if (argumentsList) { + for (size_t i = 0; i < argumentsCount; ++i) { + argumentsList[i] = CefV8ValueCppToC::Wrap(arguments[i]); + } + } + } + // Translate param: retval; type: refptr_diff_byref + cef_v8value_t* retvalStruct = NULL; + if(retval.get()) + retvalStruct = CefV8ValueCppToC::Wrap(retval); + cef_v8value_t* retvalOrig = retvalStruct; + + // Execute + int _retval = struct_->execute(struct_, + name.GetStruct(), + CefV8ValueCppToC::Wrap(object), + argumentsCount, + argumentsList, + &retvalStruct, + exception.GetWritableStruct()); + + // Restore param:retval; type: refptr_diff_byref + if (retvalStruct) { + if (retvalStruct != retvalOrig) { + retval = CefV8ValueCppToC::Unwrap(retvalStruct); + } + } else { + retval = NULL; } - cef_v8value_t* retvalStruct = NULL; - - int rv = struct_->execute(struct_, name.GetStruct(), - CefV8ValueCppToC::Wrap(object), argsSize, argsStructPtr, &retvalStruct, - exception.GetWritableStruct()); - if(retvalStruct) - retval = CefV8ValueCppToC::Unwrap(retvalStruct); - - if(argsStructPtr) - delete [] argsStructPtr; - - return rv ? true : false; + // Return type: bool + return _retval?true:false; } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/v8handler_ctocpp.h b/libcef_dll/ctocpp/v8handler_ctocpp.h index 9c271834d..918faf797 100644 --- a/libcef_dll/ctocpp/v8handler_ctocpp.h +++ b/libcef_dll/ctocpp/v8handler_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _V8HANDLER_CTOCPP_H diff --git a/libcef_dll/ctocpp/v8value_ctocpp.cc b/libcef_dll/ctocpp/v8value_ctocpp.cc index 999cd5f6c..adf9739d2 100644 --- a/libcef_dll/ctocpp/v8value_ctocpp.cc +++ b/libcef_dll/ctocpp/v8value_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/cpptoc/base_cpptoc.h" @@ -23,493 +23,827 @@ CefRefPtr CefV8Value::CreateUndefined() { - cef_v8value_t* impl = cef_v8value_create_undefined(); - if(impl) - return CefV8ValueCToCpp::Wrap(impl); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_v8value_t* _retval = cef_v8value_create_undefined(); + + // Return type: refptr_same + return CefV8ValueCToCpp::Wrap(_retval); } + CefRefPtr CefV8Value::CreateNull() { - cef_v8value_t* impl = cef_v8value_create_null(); - if(impl) - return CefV8ValueCToCpp::Wrap(impl); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_v8value_t* _retval = cef_v8value_create_null(); + + // Return type: refptr_same + return CefV8ValueCToCpp::Wrap(_retval); } + CefRefPtr CefV8Value::CreateBool(bool value) { - cef_v8value_t* impl = cef_v8value_create_bool(value); - if(impl) - return CefV8ValueCToCpp::Wrap(impl); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_v8value_t* _retval = cef_v8value_create_bool( + value); + + // Return type: refptr_same + return CefV8ValueCToCpp::Wrap(_retval); } + CefRefPtr CefV8Value::CreateInt(int value) { - cef_v8value_t* impl = cef_v8value_create_int(value); - if(impl) - return CefV8ValueCToCpp::Wrap(impl); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_v8value_t* _retval = cef_v8value_create_int( + value); + + // Return type: refptr_same + return CefV8ValueCToCpp::Wrap(_retval); } + CefRefPtr CefV8Value::CreateDouble(double value) { - cef_v8value_t* impl = cef_v8value_create_double(value); - if(impl) - return CefV8ValueCToCpp::Wrap(impl); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_v8value_t* _retval = cef_v8value_create_double( + value); + + // Return type: refptr_same + return CefV8ValueCToCpp::Wrap(_retval); } + CefRefPtr CefV8Value::CreateDate(const CefTime& date) { - cef_v8value_t* impl = cef_v8value_create_date(&date); - if(impl) - return CefV8ValueCToCpp::Wrap(impl); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_v8value_t* _retval = cef_v8value_create_date( + &date); + + // Return type: refptr_same + return CefV8ValueCToCpp::Wrap(_retval); } + CefRefPtr CefV8Value::CreateString(const CefString& value) { - cef_v8value_t* impl = cef_v8value_create_string(value.GetStruct()); - if(impl) - return CefV8ValueCToCpp::Wrap(impl); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: value + + // Execute + cef_v8value_t* _retval = cef_v8value_create_string( + value.GetStruct()); + + // Return type: refptr_same + return CefV8ValueCToCpp::Wrap(_retval); } + CefRefPtr CefV8Value::CreateObject(CefRefPtr user_data) { - cef_base_t* baseStruct = NULL; - if(user_data) - baseStruct = CefBaseCppToC::Wrap(user_data); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - cef_v8value_t* impl = cef_v8value_create_object(baseStruct); - if(impl) - return CefV8ValueCToCpp::Wrap(impl); - return NULL; + // Unverified params: user_data + + // Execute + cef_v8value_t* _retval = cef_v8value_create_object( + CefBaseCppToC::Wrap(user_data)); + + // Return type: refptr_same + return CefV8ValueCToCpp::Wrap(_retval); } + CefRefPtr CefV8Value::CreateObject(CefRefPtr user_data, CefRefPtr accessor) { - cef_base_t* baseStruct = NULL; - if(user_data) - baseStruct = CefBaseCppToC::Wrap(user_data); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - cef_v8accessor_t* accessorStruct = NULL; - if(accessor) - accessorStruct = CefV8AccessorCppToC::Wrap(accessor); + // Unverified params: user_data, accessor - cef_v8value_t* impl = cef_v8value_create_object_with_accessor(baseStruct, - accessorStruct); - if(impl) - return CefV8ValueCToCpp::Wrap(impl); - return NULL; + // Execute + cef_v8value_t* _retval = cef_v8value_create_object_with_accessor( + CefBaseCppToC::Wrap(user_data), + CefV8AccessorCppToC::Wrap(accessor)); + + // Return type: refptr_same + return CefV8ValueCToCpp::Wrap(_retval); } + CefRefPtr CefV8Value::CreateArray() { - cef_v8value_t* impl = cef_v8value_create_array(); - if(impl) - return CefV8ValueCToCpp::Wrap(impl); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_v8value_t* _retval = cef_v8value_create_array(); + + // Return type: refptr_same + return CefV8ValueCToCpp::Wrap(_retval); } + CefRefPtr CefV8Value::CreateFunction(const CefString& name, CefRefPtr handler) { - cef_v8handler_t* handlerStruct = NULL; - if(handler.get()) - handlerStruct = CefV8HandlerCppToC::Wrap(handler); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - cef_v8value_t* impl = cef_v8value_create_function(name.GetStruct(), - handlerStruct); - if(impl) - return CefV8ValueCToCpp::Wrap(impl); - return NULL; + // Verify param: name; type: string_byref_const + DCHECK(!name.empty()); + if (name.empty()) + return NULL; + // Verify param: handler; type: refptr_diff + DCHECK(handler.get()); + if (!handler.get()) + return NULL; + + // Execute + cef_v8value_t* _retval = cef_v8value_create_function( + name.GetStruct(), + CefV8HandlerCppToC::Wrap(handler)); + + // Return type: refptr_same + return CefV8ValueCToCpp::Wrap(_retval); } + // VIRTUAL METHODS - Body may be edited by hand. bool CefV8ValueCToCpp::IsUndefined() { - if(CEF_MEMBER_MISSING(struct_, is_undefined)) + if (CEF_MEMBER_MISSING(struct_, is_undefined)) return false; - return struct_->is_undefined(struct_)?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_undefined(struct_); + + // Return type: bool + return _retval?true:false; } + bool CefV8ValueCToCpp::IsNull() { - if(CEF_MEMBER_MISSING(struct_, is_null)) + if (CEF_MEMBER_MISSING(struct_, is_null)) return false; - return struct_->is_null(struct_)?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_null(struct_); + + // Return type: bool + return _retval?true:false; } + bool CefV8ValueCToCpp::IsBool() { - if(CEF_MEMBER_MISSING(struct_, is_bool)) + if (CEF_MEMBER_MISSING(struct_, is_bool)) return false; - return struct_->is_bool(struct_)?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_bool(struct_); + + // Return type: bool + return _retval?true:false; } + bool CefV8ValueCToCpp::IsInt() { - if(CEF_MEMBER_MISSING(struct_, is_int)) + if (CEF_MEMBER_MISSING(struct_, is_int)) return false; - return struct_->is_int(struct_)?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_int(struct_); + + // Return type: bool + return _retval?true:false; } + bool CefV8ValueCToCpp::IsDouble() { - if(CEF_MEMBER_MISSING(struct_, is_double)) + if (CEF_MEMBER_MISSING(struct_, is_double)) return false; - return struct_->is_double(struct_)?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_double(struct_); + + // Return type: bool + return _retval?true:false; } + bool CefV8ValueCToCpp::IsDate() { if (CEF_MEMBER_MISSING(struct_, is_date)) return false; - return struct_->is_date(struct_)?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_date(struct_); + + // Return type: bool + return _retval?true:false; } + bool CefV8ValueCToCpp::IsString() { - if(CEF_MEMBER_MISSING(struct_, is_string)) + if (CEF_MEMBER_MISSING(struct_, is_string)) return false; - return struct_->is_string(struct_)?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_string(struct_); + + // Return type: bool + return _retval?true:false; } + bool CefV8ValueCToCpp::IsObject() { - if(CEF_MEMBER_MISSING(struct_, is_object)) + if (CEF_MEMBER_MISSING(struct_, is_object)) return false; - return struct_->is_object(struct_)?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_object(struct_); + + // Return type: bool + return _retval?true:false; } + bool CefV8ValueCToCpp::IsArray() { - if(CEF_MEMBER_MISSING(struct_, is_array)) + if (CEF_MEMBER_MISSING(struct_, is_array)) return false; - return struct_->is_array(struct_)?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_array(struct_); + + // Return type: bool + return _retval?true:false; } + bool CefV8ValueCToCpp::IsFunction() { - if(CEF_MEMBER_MISSING(struct_, is_function)) + if (CEF_MEMBER_MISSING(struct_, is_function)) return false; - return struct_->is_function(struct_)?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_function(struct_); + + // Return type: bool + return _retval?true:false; } + bool CefV8ValueCToCpp::IsSame(CefRefPtr that) { - if(CEF_MEMBER_MISSING(struct_, is_same)) + if (CEF_MEMBER_MISSING(struct_, is_same)) return false; - return struct_->is_same(struct_, CefV8ValueCToCpp::Unwrap(that))?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: that; type: refptr_same + DCHECK(that.get()); + if (!that.get()) + return false; + + // Execute + int _retval = struct_->is_same(struct_, + CefV8ValueCToCpp::Unwrap(that)); + + // Return type: bool + return _retval?true:false; } + bool CefV8ValueCToCpp::GetBoolValue() { - if(CEF_MEMBER_MISSING(struct_, get_bool_value)) + if (CEF_MEMBER_MISSING(struct_, get_bool_value)) return false; - return struct_->get_bool_value(struct_)?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_bool_value(struct_); + + // Return type: bool + return _retval?true:false; } + int CefV8ValueCToCpp::GetIntValue() { - if(CEF_MEMBER_MISSING(struct_, get_int_value)) + if (CEF_MEMBER_MISSING(struct_, get_int_value)) return 0; - return struct_->get_int_value(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_int_value(struct_); + + // Return type: simple + return _retval; } + double CefV8ValueCToCpp::GetDoubleValue() { - if(CEF_MEMBER_MISSING(struct_, get_double_value)) - return 0.; + if (CEF_MEMBER_MISSING(struct_, get_double_value)) + return 0; - return struct_->get_double_value(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + double _retval = struct_->get_double_value(struct_); + + // Return type: simple + return _retval; } + CefTime CefV8ValueCToCpp::GetDateValue() { if (CEF_MEMBER_MISSING(struct_, get_date_value)) return CefTime(); - return struct_->get_date_value(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_time_t _retval = struct_->get_date_value(struct_); + + // Return type: simple + return _retval; } + CefString CefV8ValueCToCpp::GetStringValue() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_string_value)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_string_value)) + return CefString(); - cef_string_userfree_t strPtr = struct_->get_string_value(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_string_value(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + bool CefV8ValueCToCpp::HasValue(const CefString& key) { - if(CEF_MEMBER_MISSING(struct_, has_value_bykey)) + if (CEF_MEMBER_MISSING(struct_, has_value_bykey)) return false; - return struct_->has_value_bykey(struct_, key.GetStruct())?true:false; -} - -bool CefV8ValueCToCpp::HasValue(int index) -{ - if(CEF_MEMBER_MISSING(struct_, has_value_byindex)) - return false; - - DCHECK(index >= 0); - if (index < 0) - return false; - - return struct_->has_value_byindex(struct_, index)?true:false; -} - -bool CefV8ValueCToCpp::DeleteValue(const CefString& key) -{ - if(CEF_MEMBER_MISSING(struct_, delete_value_bykey)) - return false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + // Verify param: key; type: string_byref_const DCHECK(!key.empty()); if (key.empty()) return false; - return struct_->delete_value_bykey(struct_, key.GetStruct())?true:false; + // Execute + int _retval = struct_->has_value_bykey(struct_, + key.GetStruct()); + + // Return type: bool + return _retval?true:false; } -bool CefV8ValueCToCpp::DeleteValue(int index) + +bool CefV8ValueCToCpp::HasValue(size_t index) { - if(CEF_MEMBER_MISSING(struct_, delete_value_byindex)) + if (CEF_MEMBER_MISSING(struct_, has_value_byindex)) return false; - DCHECK(index >= 0); - if (index < 0) - return false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - return struct_->delete_value_byindex(struct_, index)?true:false; + // Execute + int _retval = struct_->has_value_byindex(struct_, + index); + + // Return type: bool + return _retval?true:false; } + +bool CefV8ValueCToCpp::DeleteValue(const CefString& key) +{ + if (CEF_MEMBER_MISSING(struct_, delete_value_bykey)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: key; type: string_byref_const + DCHECK(!key.empty()); + if (key.empty()) + return false; + + // Execute + int _retval = struct_->delete_value_bykey(struct_, + key.GetStruct()); + + // Return type: bool + return _retval?true:false; +} + + +bool CefV8ValueCToCpp::DeleteValue(size_t index) +{ + if (CEF_MEMBER_MISSING(struct_, delete_value_byindex)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->delete_value_byindex(struct_, + index); + + // Return type: bool + return _retval?true:false; +} + + CefRefPtr CefV8ValueCToCpp::GetValue(const CefString& key) { - if(CEF_MEMBER_MISSING(struct_, get_value_bykey)) + if (CEF_MEMBER_MISSING(struct_, get_value_bykey)) return NULL; - DCHECK(!key.empty()); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: key; type: string_byref_const + DCHECK(!key.empty()); if (key.empty()) return NULL; - cef_v8value_t* valueStruct = struct_->get_value_bykey(struct_, + // Execute + cef_v8value_t* _retval = struct_->get_value_bykey(struct_, key.GetStruct()); - if(valueStruct) - return CefV8ValueCToCpp::Wrap(valueStruct); - return NULL; + + // Return type: refptr_same + return CefV8ValueCToCpp::Wrap(_retval); } -CefRefPtr CefV8ValueCToCpp::GetValue(int index) + +CefRefPtr CefV8ValueCToCpp::GetValue(size_t index) { - if(CEF_MEMBER_MISSING(struct_, get_value_byindex)) + if (CEF_MEMBER_MISSING(struct_, get_value_byindex)) return NULL; - DCHECK(index >= 0); - if (index < 0) - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - cef_v8value_t* valueStruct = struct_->get_value_byindex(struct_, index); - if(valueStruct) - return CefV8ValueCToCpp::Wrap(valueStruct); - return NULL; + // Execute + cef_v8value_t* _retval = struct_->get_value_byindex(struct_, + index); + + // Return type: refptr_same + return CefV8ValueCToCpp::Wrap(_retval); } + bool CefV8ValueCToCpp::SetValue(const CefString& key, CefRefPtr value, PropertyAttribute attribute) { - if(CEF_MEMBER_MISSING(struct_, set_value_bykey)) + if (CEF_MEMBER_MISSING(struct_, set_value_bykey)) return false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: key; type: string_byref_const DCHECK(!key.empty()); + if (key.empty()) + return false; + // Verify param: value; type: refptr_same DCHECK(value.get()); - if (key.empty() || !value.get()) + if (!value.get()) return false; - return struct_->set_value_bykey(struct_, key.GetStruct(), - CefV8ValueCToCpp::Unwrap(value), attribute)?true:false; + // Execute + int _retval = struct_->set_value_bykey(struct_, + key.GetStruct(), + CefV8ValueCToCpp::Unwrap(value), + attribute); + + // Return type: bool + return _retval?true:false; } -bool CefV8ValueCToCpp::SetValue(int index, CefRefPtr value) + +bool CefV8ValueCToCpp::SetValue(size_t index, CefRefPtr value) { - if(CEF_MEMBER_MISSING(struct_, set_value_byindex)) + if (CEF_MEMBER_MISSING(struct_, set_value_byindex)) return false; - DCHECK(index >= 0); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: value; type: refptr_same DCHECK(value.get()); - if (index < 0 || !value.get()) + if (!value.get()) return false; - return struct_->set_value_byindex(struct_, index, - CefV8ValueCToCpp::Unwrap(value))?true:false; + // Execute + int _retval = struct_->set_value_byindex(struct_, + index, + CefV8ValueCToCpp::Unwrap(value)); + + // Return type: bool + return _retval?true:false; } + bool CefV8ValueCToCpp::SetValue(const CefString& key, AccessControl settings, PropertyAttribute attribute) { - if(CEF_MEMBER_MISSING(struct_, set_value_byaccessor)) + if (CEF_MEMBER_MISSING(struct_, set_value_byaccessor)) return false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: key; type: string_byref_const DCHECK(!key.empty()); if (key.empty()) return false; - return struct_->set_value_byaccessor(struct_, key.GetStruct(), - settings, attribute)?true:false; + // Execute + int _retval = struct_->set_value_byaccessor(struct_, + key.GetStruct(), + settings, + attribute); + + // Return type: bool + return _retval?true:false; } + bool CefV8ValueCToCpp::GetKeys(std::vector& keys) { - if(CEF_MEMBER_MISSING(struct_, get_keys)) + if (CEF_MEMBER_MISSING(struct_, get_keys)) return false; - cef_string_list_t list = cef_string_list_alloc(); - if (!list) - return false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - if(struct_->get_keys(struct_, list)) { - transfer_string_list_contents(list, keys); - cef_string_list_free(list); - return true; + // Translate param: keys; type: string_vec_byref + cef_string_list_t keysList = cef_string_list_alloc(); + DCHECK(keysList); + if (keysList) + transfer_string_list_contents(keys, keysList); + + // Execute + int _retval = struct_->get_keys(struct_, + keysList); + + // Restore param:keys; type: string_vec_byref + if (keysList) { + keys.clear(); + transfer_string_list_contents(keysList, keys); + cef_string_list_free(keysList); } - return false; + + // Return type: bool + return _retval?true:false; } + CefRefPtr CefV8ValueCToCpp::GetUserData() { - if(CEF_MEMBER_MISSING(struct_, get_user_data)) + if (CEF_MEMBER_MISSING(struct_, get_user_data)) return NULL; - cef_base_t* baseStruct = struct_->get_user_data(struct_); - if(baseStruct) - return CefBaseCppToC::Unwrap(baseStruct); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_base_t* _retval = struct_->get_user_data(struct_); + + // Return type: refptr_diff + return CefBaseCppToC::Unwrap(_retval); } + int CefV8ValueCToCpp::GetArrayLength() { - if(CEF_MEMBER_MISSING(struct_, get_array_length)) + if (CEF_MEMBER_MISSING(struct_, get_array_length)) return 0; - return struct_->get_array_length(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_array_length(struct_); + + // Return type: simple + return _retval; } + CefString CefV8ValueCToCpp::GetFunctionName() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_function_name)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_function_name)) + return CefString(); - cef_string_userfree_t strPtr = struct_->get_function_name(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_function_name(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + CefRefPtr CefV8ValueCToCpp::GetFunctionHandler() { - if(CEF_MEMBER_MISSING(struct_, get_function_handler)) + if (CEF_MEMBER_MISSING(struct_, get_function_handler)) return NULL; - cef_v8handler_t* handlerStruct = struct_->get_function_handler(struct_); - if(handlerStruct) - return CefV8HandlerCppToC::Unwrap(handlerStruct); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_v8handler_t* _retval = struct_->get_function_handler(struct_); + + // Return type: refptr_diff + return CefV8HandlerCppToC::Unwrap(_retval); } + bool CefV8ValueCToCpp::ExecuteFunction(CefRefPtr object, const CefV8ValueList& arguments, CefRefPtr& retval, CefRefPtr& exception, bool rethrow_exception) { - if(CEF_MEMBER_MISSING(struct_, execute_function)) + if (CEF_MEMBER_MISSING(struct_, execute_function)) return false; - cef_v8value_t** argsStructPtr = NULL; - int argsSize = arguments.size(); - if(argsSize > 0) { - argsStructPtr = new cef_v8value_t*[argsSize]; - for(int i = 0; i < argsSize; ++i) - argsStructPtr[i] = CefV8ValueCToCpp::Unwrap(arguments[i]); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: object + + // Translate param: arguments; type: refptr_vec_same_byref_const + const size_t argumentsCount = arguments.size(); + cef_v8value_t** argumentsList = NULL; + if (argumentsCount > 0) { + argumentsList = new cef_v8value_t*[argumentsCount]; + DCHECK(argumentsList); + if (argumentsList) { + for (size_t i = 0; i < argumentsCount; ++i) { + argumentsList[i] = CefV8ValueCToCpp::Unwrap(arguments[i]); + } + } } - + // Translate param: retval; type: refptr_same_byref cef_v8value_t* retvalStruct = NULL; - cef_v8exception_t* exeptionStruct = NULL; + if(retval.get()) + retvalStruct = CefV8ValueCToCpp::Unwrap(retval); + cef_v8value_t* retvalOrig = retvalStruct; + // Translate param: exception; type: refptr_same_byref + cef_v8exception_t* exceptionStruct = NULL; + if(exception.get()) + exceptionStruct = CefV8ExceptionCToCpp::Unwrap(exception); + cef_v8exception_t* exceptionOrig = exceptionStruct; - int rv = struct_->execute_function(struct_, - object.get() ? CefV8ValueCToCpp::Unwrap(object): NULL, - argsSize, argsStructPtr, &retvalStruct, &exeptionStruct, + // Execute + int _retval = struct_->execute_function(struct_, + CefV8ValueCToCpp::Unwrap(object), + argumentsCount, + argumentsList, + &retvalStruct, + &exceptionStruct, rethrow_exception); - if (retvalStruct) - retval = CefV8ValueCToCpp::Wrap(retvalStruct); - if (exeptionStruct) - exception = CefV8ExceptionCToCpp::Wrap(exeptionStruct); + // Restore param:retval; type: refptr_same_byref + if (retvalStruct) { + if (retvalStruct != retvalOrig) { + retval = CefV8ValueCToCpp::Wrap(retvalStruct); + } + } else { + retval = NULL; + } + // Restore param:exception; type: refptr_same_byref + if (exceptionStruct) { + if (exceptionStruct != exceptionOrig) { + exception = CefV8ExceptionCToCpp::Wrap(exceptionStruct); + } + } else { + exception = NULL; + } - if(argsStructPtr) - delete [] argsStructPtr; - - return rv?true:false; + // Return type: bool + return _retval?true:false; } + bool CefV8ValueCToCpp::ExecuteFunctionWithContext( CefRefPtr context, CefRefPtr object, const CefV8ValueList& arguments, CefRefPtr& retval, CefRefPtr& exception, bool rethrow_exception) { - if(CEF_MEMBER_MISSING(struct_, execute_function_with_context)) + if (CEF_MEMBER_MISSING(struct_, execute_function_with_context)) return false; - cef_v8value_t** argsStructPtr = NULL; - int argsSize = arguments.size(); - if(argsSize > 0) { - argsStructPtr = new cef_v8value_t*[argsSize]; - for(int i = 0; i < argsSize; ++i) - argsStructPtr[i] = CefV8ValueCToCpp::Unwrap(arguments[i]); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: context; type: refptr_same + DCHECK(context.get()); + if (!context.get()) + return false; + // Unverified params: object + + // Translate param: arguments; type: refptr_vec_same_byref_const + const size_t argumentsCount = arguments.size(); + cef_v8value_t** argumentsList = NULL; + if (argumentsCount > 0) { + argumentsList = new cef_v8value_t*[argumentsCount]; + DCHECK(argumentsList); + if (argumentsList) { + for (size_t i = 0; i < argumentsCount; ++i) { + argumentsList[i] = CefV8ValueCToCpp::Unwrap(arguments[i]); + } + } } - + // Translate param: retval; type: refptr_same_byref cef_v8value_t* retvalStruct = NULL; - cef_v8exception_t* exeptionStruct = NULL; + if(retval.get()) + retvalStruct = CefV8ValueCToCpp::Unwrap(retval); + cef_v8value_t* retvalOrig = retvalStruct; + // Translate param: exception; type: refptr_same_byref + cef_v8exception_t* exceptionStruct = NULL; + if(exception.get()) + exceptionStruct = CefV8ExceptionCToCpp::Unwrap(exception); + cef_v8exception_t* exceptionOrig = exceptionStruct; - int rv = struct_->execute_function_with_context(struct_, - context.get() ? CefV8ContextCToCpp::Unwrap(context): NULL, - object.get() ? CefV8ValueCToCpp::Unwrap(object): NULL, - argsSize, argsStructPtr, &retvalStruct, &exeptionStruct, + // Execute + int _retval = struct_->execute_function_with_context(struct_, + CefV8ContextCToCpp::Unwrap(context), + CefV8ValueCToCpp::Unwrap(object), + argumentsCount, + argumentsList, + &retvalStruct, + &exceptionStruct, rethrow_exception); - if(retvalStruct) - retval = CefV8ValueCToCpp::Wrap(retvalStruct); - if (exeptionStruct) - exception = CefV8ExceptionCToCpp::Wrap(exeptionStruct); + // Restore param:retval; type: refptr_same_byref + if (retvalStruct) { + if (retvalStruct != retvalOrig) { + retval = CefV8ValueCToCpp::Wrap(retvalStruct); + } + } else { + retval = NULL; + } + // Restore param:exception; type: refptr_same_byref + if (exceptionStruct) { + if (exceptionStruct != exceptionOrig) { + exception = CefV8ExceptionCToCpp::Wrap(exceptionStruct); + } + } else { + exception = NULL; + } - if(argsStructPtr) - delete [] argsStructPtr; - - return rv?true:false; + // Return type: bool + return _retval?true:false; } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/v8value_ctocpp.h b/libcef_dll/ctocpp/v8value_ctocpp.h index d0fdb6b94..d570075e4 100644 --- a/libcef_dll/ctocpp/v8value_ctocpp.h +++ b/libcef_dll/ctocpp/v8value_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _V8VALUE_CTOCPP_H @@ -48,14 +49,14 @@ public: virtual CefTime GetDateValue() OVERRIDE; virtual CefString GetStringValue() OVERRIDE; virtual bool HasValue(const CefString& key) OVERRIDE; - virtual bool HasValue(int index) OVERRIDE; + virtual bool HasValue(size_t index) OVERRIDE; virtual bool DeleteValue(const CefString& key) OVERRIDE; - virtual bool DeleteValue(int index) OVERRIDE; + virtual bool DeleteValue(size_t index) OVERRIDE; virtual CefRefPtr GetValue(const CefString& key) OVERRIDE; - virtual CefRefPtr GetValue(int index) OVERRIDE; + virtual CefRefPtr GetValue(size_t index) OVERRIDE; virtual bool SetValue(const CefString& key, CefRefPtr value, PropertyAttribute attribute) OVERRIDE; - virtual bool SetValue(int index, CefRefPtr value) OVERRIDE; + virtual bool SetValue(size_t index, CefRefPtr value) OVERRIDE; virtual bool SetValue(const CefString& key, AccessControl settings, PropertyAttribute attribute) OVERRIDE; virtual bool GetKeys(std::vector& keys) OVERRIDE; diff --git a/libcef_dll/ctocpp/web_urlrequest_client_ctocpp.cc b/libcef_dll/ctocpp/web_urlrequest_client_ctocpp.cc index bb5c3e27f..67ea7c671 100644 --- a/libcef_dll/ctocpp/web_urlrequest_client_ctocpp.cc +++ b/libcef_dll/ctocpp/web_urlrequest_client_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/cpptoc/request_cpptoc.h" @@ -21,66 +21,145 @@ void CefWebURLRequestClientCToCpp::OnStateChange( CefRefPtr requester, RequestState state) { - if(CEF_MEMBER_MISSING(struct_, on_state_change)) + if (CEF_MEMBER_MISSING(struct_, on_state_change)) return; - struct_->on_state_change(struct_, CefWebURLRequestCppToC::Wrap(requester), + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: requester; type: refptr_diff + DCHECK(requester.get()); + if (!requester.get()) + return; + + // Execute + struct_->on_state_change(struct_, + CefWebURLRequestCppToC::Wrap(requester), state); } + void CefWebURLRequestClientCToCpp::OnRedirect( CefRefPtr requester, CefRefPtr request, CefRefPtr response) { - if(CEF_MEMBER_MISSING(struct_, on_redirect)) + if (CEF_MEMBER_MISSING(struct_, on_redirect)) return; - struct_->on_redirect(struct_, CefWebURLRequestCppToC::Wrap(requester), - CefRequestCppToC::Wrap(request), CefResponseCppToC::Wrap(response) ); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: requester; type: refptr_diff + DCHECK(requester.get()); + if (!requester.get()) + return; + // Verify param: request; type: refptr_diff + DCHECK(request.get()); + if (!request.get()) + return; + // Verify param: response; type: refptr_diff + DCHECK(response.get()); + if (!response.get()) + return; + + // Execute + struct_->on_redirect(struct_, + CefWebURLRequestCppToC::Wrap(requester), + CefRequestCppToC::Wrap(request), + CefResponseCppToC::Wrap(response)); } + void CefWebURLRequestClientCToCpp::OnHeadersReceived( CefRefPtr requester, CefRefPtr response) { - if(CEF_MEMBER_MISSING(struct_, on_headers_received)) + if (CEF_MEMBER_MISSING(struct_, on_headers_received)) return; - struct_->on_headers_received(struct_, CefWebURLRequestCppToC::Wrap(requester), - CefResponseCppToC::Wrap(response) ); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: requester; type: refptr_diff + DCHECK(requester.get()); + if (!requester.get()) + return; + // Verify param: response; type: refptr_diff + DCHECK(response.get()); + if (!response.get()) + return; + + // Execute + struct_->on_headers_received(struct_, + CefWebURLRequestCppToC::Wrap(requester), + CefResponseCppToC::Wrap(response)); } + void CefWebURLRequestClientCToCpp::OnProgress( CefRefPtr requester, uint64 bytesSent, uint64 totalBytesToBeSent) { - if(CEF_MEMBER_MISSING(struct_, on_progress)) + if (CEF_MEMBER_MISSING(struct_, on_progress)) return; - struct_->on_progress(struct_, CefWebURLRequestCppToC::Wrap(requester), - bytesSent, totalBytesToBeSent); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: requester; type: refptr_diff + DCHECK(requester.get()); + if (!requester.get()) + return; + + // Execute + struct_->on_progress(struct_, + CefWebURLRequestCppToC::Wrap(requester), + bytesSent, + totalBytesToBeSent); } + void CefWebURLRequestClientCToCpp::OnData(CefRefPtr requester, const void* data, int dataLength) { - if(CEF_MEMBER_MISSING(struct_, on_data)) + if (CEF_MEMBER_MISSING(struct_, on_data)) return; - struct_->on_data(struct_, CefWebURLRequestCppToC::Wrap(requester), - data, dataLength); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: requester; type: refptr_diff + DCHECK(requester.get()); + if (!requester.get()) + return; + // Verify param: data; type: simple_byaddr + DCHECK(data); + if (!data) + return; + + // Execute + struct_->on_data(struct_, + CefWebURLRequestCppToC::Wrap(requester), + data, + dataLength); } + void CefWebURLRequestClientCToCpp::OnError( CefRefPtr requester, ErrorCode errorCode) { - if(CEF_MEMBER_MISSING(struct_, on_error)) + if (CEF_MEMBER_MISSING(struct_, on_error)) return; - struct_->on_error(struct_, CefWebURLRequestCppToC::Wrap(requester), + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: requester; type: refptr_diff + DCHECK(requester.get()); + if (!requester.get()) + return; + + // Execute + struct_->on_error(struct_, + CefWebURLRequestCppToC::Wrap(requester), errorCode); } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/web_urlrequest_client_ctocpp.h b/libcef_dll/ctocpp/web_urlrequest_client_ctocpp.h index fa82687f3..8f8ac4095 100644 --- a/libcef_dll/ctocpp/web_urlrequest_client_ctocpp.h +++ b/libcef_dll/ctocpp/web_urlrequest_client_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _WEBURLREQUESTCLIENT_CTOCPP_H diff --git a/libcef_dll/ctocpp/web_urlrequest_ctocpp.cc b/libcef_dll/ctocpp/web_urlrequest_ctocpp.cc index d1e4f9549..589fded3f 100644 --- a/libcef_dll/ctocpp/web_urlrequest_ctocpp.cc +++ b/libcef_dll/ctocpp/web_urlrequest_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/cpptoc/web_urlrequest_client_cpptoc.h" @@ -20,41 +20,58 @@ CefRefPtr CefWebURLRequest::CreateWebURLRequest( CefRefPtr request, CefRefPtr client) { - cef_request_t* requestStruct = NULL; - if(request.get()) - requestStruct = CefRequestCToCpp::Unwrap(request); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - cef_web_urlrequest_client_t* clientStruct = NULL; - if(client.get()) - clientStruct = CefWebURLRequestClientCppToC::Wrap(client); + // Verify param: request; type: refptr_same + DCHECK(request.get()); + if (!request.get()) + return NULL; + // Verify param: client; type: refptr_diff + DCHECK(client.get()); + if (!client.get()) + return NULL; - cef_web_urlrequest_t* impl = - cef_web_urlrequest_create(requestStruct, clientStruct); - if(impl) - return CefWebURLRequestCToCpp::Wrap(impl); - return NULL; + // Execute + cef_web_urlrequest_t* _retval = cef_web_urlrequest_create( + CefRequestCToCpp::Unwrap(request), + CefWebURLRequestClientCppToC::Wrap(client)); + + // Return type: refptr_same + return CefWebURLRequestCToCpp::Wrap(_retval); } + // VIRTUAL METHODS - Body may be edited by hand. void CefWebURLRequestCToCpp::Cancel() { - if(CEF_MEMBER_MISSING(struct_, cancel)) + if (CEF_MEMBER_MISSING(struct_, cancel)) return; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute struct_->cancel(struct_); } + CefWebURLRequest::RequestState CefWebURLRequestCToCpp::GetState() { - if(CEF_MEMBER_MISSING(struct_, get_state)) + if (CEF_MEMBER_MISSING(struct_, get_state)) return WUR_STATE_UNSENT; - return struct_->get_state(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_weburlrequest_state_t _retval = struct_->get_state(struct_); + + // Return type: simple + return _retval; } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/web_urlrequest_ctocpp.h b/libcef_dll/ctocpp/web_urlrequest_ctocpp.h index f60ddb19b..4a7e01de4 100644 --- a/libcef_dll/ctocpp/web_urlrequest_ctocpp.h +++ b/libcef_dll/ctocpp/web_urlrequest_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _WEBURLREQUEST_CTOCPP_H diff --git a/libcef_dll/ctocpp/write_handler_ctocpp.cc b/libcef_dll/ctocpp/write_handler_ctocpp.cc index 80950a57a..3d1171816 100644 --- a/libcef_dll/ctocpp/write_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/write_handler_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/ctocpp/write_handler_ctocpp.h" @@ -17,37 +17,75 @@ size_t CefWriteHandlerCToCpp::Write(const void* ptr, size_t size, size_t n) { - if(CEF_MEMBER_MISSING(struct_, write)) + if (CEF_MEMBER_MISSING(struct_, write)) return 0; - return struct_->write(struct_, ptr, size, n); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: ptr; type: simple_byaddr + DCHECK(ptr); + if (!ptr) + return 0; + + // Execute + size_t _retval = struct_->write(struct_, + ptr, + size, + n); + + // Return type: simple + return _retval; } + int CefWriteHandlerCToCpp::Seek(long offset, int whence) { - if(CEF_MEMBER_MISSING(struct_, seek)) + if (CEF_MEMBER_MISSING(struct_, seek)) return 0; - return struct_->seek(struct_, offset, whence); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->seek(struct_, + offset, + whence); + + // Return type: simple + return _retval; } + long CefWriteHandlerCToCpp::Tell() { - if(CEF_MEMBER_MISSING(struct_, tell)) + if (CEF_MEMBER_MISSING(struct_, tell)) return 0; - return struct_->tell(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + long _retval = struct_->tell(struct_); + + // Return type: simple + return _retval; } + int CefWriteHandlerCToCpp::Flush() { - if(CEF_MEMBER_MISSING(struct_, flush)) + if (CEF_MEMBER_MISSING(struct_, flush)) return 0; - return struct_->flush(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->flush(struct_); + + // Return type: simple + return _retval; } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/write_handler_ctocpp.h b/libcef_dll/ctocpp/write_handler_ctocpp.h index 280179238..b9f9e083f 100644 --- a/libcef_dll/ctocpp/write_handler_ctocpp.h +++ b/libcef_dll/ctocpp/write_handler_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _WRITEHANDLER_CTOCPP_H diff --git a/libcef_dll/ctocpp/xml_reader_ctocpp.cc b/libcef_dll/ctocpp/xml_reader_ctocpp.cc index 33ecbeeda..75899225a 100644 --- a/libcef_dll/ctocpp/xml_reader_ctocpp.cc +++ b/libcef_dll/ctocpp/xml_reader_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/ctocpp/stream_reader_ctocpp.h" @@ -19,294 +19,531 @@ CefRefPtr CefXmlReader::Create(CefRefPtr stream, EncodingType encodingType, const CefString& URI) { - cef_xml_reader_t* impl = cef_xml_reader_create( - CefStreamReaderCToCpp::Unwrap(stream), encodingType, URI.GetStruct()); - if(impl) - return CefXmlReaderCToCpp::Wrap(impl); - return NULL; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: stream; type: refptr_same + DCHECK(stream.get()); + if (!stream.get()) + return NULL; + // Verify param: URI; type: string_byref_const + DCHECK(!URI.empty()); + if (URI.empty()) + return NULL; + + // Execute + cef_xml_reader_t* _retval = cef_xml_reader_create( + CefStreamReaderCToCpp::Unwrap(stream), + encodingType, + URI.GetStruct()); + + // Return type: refptr_same + return CefXmlReaderCToCpp::Wrap(_retval); } + // VIRTUAL METHODS - Body may be edited by hand. bool CefXmlReaderCToCpp::MoveToNextNode() { - if(CEF_MEMBER_MISSING(struct_, move_to_next_node)) + if (CEF_MEMBER_MISSING(struct_, move_to_next_node)) return false; - return struct_->move_to_next_node(struct_) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->move_to_next_node(struct_); + + // Return type: bool + return _retval?true:false; } + bool CefXmlReaderCToCpp::Close() { - if(CEF_MEMBER_MISSING(struct_, close)) + if (CEF_MEMBER_MISSING(struct_, close)) return false; - return struct_->close(struct_) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->close(struct_); + + // Return type: bool + return _retval?true:false; } + bool CefXmlReaderCToCpp::HasError() { - if(CEF_MEMBER_MISSING(struct_, has_error)) + if (CEF_MEMBER_MISSING(struct_, has_error)) return false; - return struct_->has_error(struct_) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->has_error(struct_); + + // Return type: bool + return _retval?true:false; } + CefString CefXmlReaderCToCpp::GetError() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_error)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_error)) + return CefString(); - cef_string_userfree_t strPtr = struct_->get_error(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_error(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + CefXmlReader::NodeType CefXmlReaderCToCpp::GetType() { - if(CEF_MEMBER_MISSING(struct_, get_type)) + if (CEF_MEMBER_MISSING(struct_, get_type)) return XML_NODE_UNSUPPORTED; - return struct_->get_type(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_xml_node_type_t _retval = struct_->get_type(struct_); + + // Return type: simple + return _retval; } + int CefXmlReaderCToCpp::GetDepth() { - if(CEF_MEMBER_MISSING(struct_, get_depth)) - return -1; + if (CEF_MEMBER_MISSING(struct_, get_depth)) + return 0; - return struct_->get_depth(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_depth(struct_); + + // Return type: simple + return _retval; } + CefString CefXmlReaderCToCpp::GetLocalName() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_local_name)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_local_name)) + return CefString(); - cef_string_userfree_t strPtr = struct_->get_local_name(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_local_name(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + CefString CefXmlReaderCToCpp::GetPrefix() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_prefix)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_prefix)) + return CefString(); - cef_string_userfree_t strPtr = struct_->get_prefix(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_prefix(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + CefString CefXmlReaderCToCpp::GetQualifiedName() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_qualified_name)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_qualified_name)) + return CefString(); - cef_string_userfree_t strPtr = struct_->get_qualified_name(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_qualified_name(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + CefString CefXmlReaderCToCpp::GetNamespaceURI() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_namespace_uri)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_namespace_uri)) + return CefString(); - cef_string_userfree_t strPtr = struct_->get_namespace_uri(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_namespace_uri(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + CefString CefXmlReaderCToCpp::GetBaseURI() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_base_uri)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_base_uri)) + return CefString(); - cef_string_userfree_t strPtr = struct_->get_base_uri(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_base_uri(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + CefString CefXmlReaderCToCpp::GetXmlLang() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_xml_lang)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_xml_lang)) + return CefString(); - cef_string_userfree_t strPtr = struct_->get_xml_lang(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_xml_lang(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + bool CefXmlReaderCToCpp::IsEmptyElement() { - if(CEF_MEMBER_MISSING(struct_, is_empty_element)) + if (CEF_MEMBER_MISSING(struct_, is_empty_element)) return false; - return struct_->is_empty_element(struct_) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_empty_element(struct_); + + // Return type: bool + return _retval?true:false; } + bool CefXmlReaderCToCpp::HasValue() { - if(CEF_MEMBER_MISSING(struct_, has_value)) + if (CEF_MEMBER_MISSING(struct_, has_value)) return false; - return struct_->has_value(struct_) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->has_value(struct_); + + // Return type: bool + return _retval?true:false; } + CefString CefXmlReaderCToCpp::GetValue() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_value)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_value)) + return CefString(); - cef_string_userfree_t strPtr = struct_->get_value(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_value(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + bool CefXmlReaderCToCpp::HasAttributes() { - if(CEF_MEMBER_MISSING(struct_, has_attributes)) + if (CEF_MEMBER_MISSING(struct_, has_attributes)) return false; - return struct_->has_attributes(struct_) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->has_attributes(struct_); + + // Return type: bool + return _retval?true:false; } + size_t CefXmlReaderCToCpp::GetAttributeCount() { - if(CEF_MEMBER_MISSING(struct_, get_attribute_count)) + if (CEF_MEMBER_MISSING(struct_, get_attribute_count)) return 0; - return struct_->get_attribute_count(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + size_t _retval = struct_->get_attribute_count(struct_); + + // Return type: simple + return _retval; } -CefString CefXmlReaderCToCpp::GetAttribute(int index) + +CefString CefXmlReaderCToCpp::GetAttribute(size_t index) { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_attribute_byindex)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_attribute_byindex)) + return CefString(); - cef_string_userfree_t strPtr = struct_->get_attribute_byindex(struct_, index); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_attribute_byindex(struct_, + index); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + CefString CefXmlReaderCToCpp::GetAttribute(const CefString& qualifiedName) { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_attribute_byqname)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_attribute_byqname)) + return CefString(); - cef_string_userfree_t strPtr = struct_->get_attribute_byqname(struct_, + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: qualifiedName; type: string_byref_const + DCHECK(!qualifiedName.empty()); + if (qualifiedName.empty()) + return CefString(); + + // Execute + cef_string_userfree_t _retval = struct_->get_attribute_byqname(struct_, qualifiedName.GetStruct()); - str.AttachToUserFree(strPtr); - return str; + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + CefString CefXmlReaderCToCpp::GetAttribute(const CefString& localName, const CefString& namespaceURI) { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_attribute_bylname)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_attribute_bylname)) + return CefString(); - cef_string_userfree_t strPtr = struct_->get_attribute_bylname(struct_, - localName.GetStruct(), namespaceURI.GetStruct()); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: localName; type: string_byref_const + DCHECK(!localName.empty()); + if (localName.empty()) + return CefString(); + // Verify param: namespaceURI; type: string_byref_const + DCHECK(!namespaceURI.empty()); + if (namespaceURI.empty()) + return CefString(); + + // Execute + cef_string_userfree_t _retval = struct_->get_attribute_bylname(struct_, + localName.GetStruct(), + namespaceURI.GetStruct()); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + CefString CefXmlReaderCToCpp::GetInnerXml() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_inner_xml)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_inner_xml)) + return CefString(); - cef_string_userfree_t strPtr = struct_->get_inner_xml(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_inner_xml(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + CefString CefXmlReaderCToCpp::GetOuterXml() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_outer_xml)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_outer_xml)) + return CefString(); - cef_string_userfree_t strPtr = struct_->get_outer_xml(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_outer_xml(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + int CefXmlReaderCToCpp::GetLineNumber() { - if(CEF_MEMBER_MISSING(struct_, get_line_number)) - return false; + if (CEF_MEMBER_MISSING(struct_, get_line_number)) + return 0; - return struct_->get_line_number(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_line_number(struct_); + + // Return type: simple + return _retval; } -bool CefXmlReaderCToCpp::MoveToAttribute(int index) + +bool CefXmlReaderCToCpp::MoveToAttribute(size_t index) { - if(CEF_MEMBER_MISSING(struct_, move_to_attribute_byindex)) + if (CEF_MEMBER_MISSING(struct_, move_to_attribute_byindex)) return false; - return struct_->move_to_attribute_byindex(struct_, index) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->move_to_attribute_byindex(struct_, + index); + + // Return type: bool + return _retval?true:false; } + bool CefXmlReaderCToCpp::MoveToAttribute(const CefString& qualifiedName) { - if(CEF_MEMBER_MISSING(struct_, move_to_attribute_byqname)) + if (CEF_MEMBER_MISSING(struct_, move_to_attribute_byqname)) return false; - return struct_->move_to_attribute_byqname(struct_, qualifiedName.GetStruct())? - true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: qualifiedName; type: string_byref_const + DCHECK(!qualifiedName.empty()); + if (qualifiedName.empty()) + return false; + + // Execute + int _retval = struct_->move_to_attribute_byqname(struct_, + qualifiedName.GetStruct()); + + // Return type: bool + return _retval?true:false; } + bool CefXmlReaderCToCpp::MoveToAttribute(const CefString& localName, const CefString& namespaceURI) { - if(CEF_MEMBER_MISSING(struct_, move_to_attribute_bylname)) + if (CEF_MEMBER_MISSING(struct_, move_to_attribute_bylname)) return false; - return struct_->move_to_attribute_bylname(struct_, localName.GetStruct(), - namespaceURI.GetStruct()) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: localName; type: string_byref_const + DCHECK(!localName.empty()); + if (localName.empty()) + return false; + // Verify param: namespaceURI; type: string_byref_const + DCHECK(!namespaceURI.empty()); + if (namespaceURI.empty()) + return false; + + // Execute + int _retval = struct_->move_to_attribute_bylname(struct_, + localName.GetStruct(), + namespaceURI.GetStruct()); + + // Return type: bool + return _retval?true:false; } + bool CefXmlReaderCToCpp::MoveToFirstAttribute() { - if(CEF_MEMBER_MISSING(struct_, move_to_first_attribute)) + if (CEF_MEMBER_MISSING(struct_, move_to_first_attribute)) return false; - return struct_->move_to_first_attribute(struct_) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->move_to_first_attribute(struct_); + + // Return type: bool + return _retval?true:false; } + bool CefXmlReaderCToCpp::MoveToNextAttribute() { - if(CEF_MEMBER_MISSING(struct_, move_to_next_attribute)) + if (CEF_MEMBER_MISSING(struct_, move_to_next_attribute)) return false; - return struct_->move_to_next_attribute(struct_) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->move_to_next_attribute(struct_); + + // Return type: bool + return _retval?true:false; } + bool CefXmlReaderCToCpp::MoveToCarryingElement() { - if(CEF_MEMBER_MISSING(struct_, move_to_carrying_element)) + if (CEF_MEMBER_MISSING(struct_, move_to_carrying_element)) return false; - return struct_->move_to_carrying_element(struct_) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->move_to_carrying_element(struct_); + + // Return type: bool + return _retval?true:false; } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/xml_reader_ctocpp.h b/libcef_dll/ctocpp/xml_reader_ctocpp.h index 65d9035de..acf8745fb 100644 --- a/libcef_dll/ctocpp/xml_reader_ctocpp.h +++ b/libcef_dll/ctocpp/xml_reader_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _XMLREADER_CTOCPP_H @@ -48,14 +49,14 @@ public: virtual CefString GetValue() OVERRIDE; virtual bool HasAttributes() OVERRIDE; virtual size_t GetAttributeCount() OVERRIDE; - virtual CefString GetAttribute(int index) OVERRIDE; + virtual CefString GetAttribute(size_t index) OVERRIDE; virtual CefString GetAttribute(const CefString& qualifiedName) OVERRIDE; virtual CefString GetAttribute(const CefString& localName, const CefString& namespaceURI) OVERRIDE; virtual CefString GetInnerXml() OVERRIDE; virtual CefString GetOuterXml() OVERRIDE; virtual int GetLineNumber() OVERRIDE; - virtual bool MoveToAttribute(int index) OVERRIDE; + virtual bool MoveToAttribute(size_t index) OVERRIDE; virtual bool MoveToAttribute(const CefString& qualifiedName) OVERRIDE; virtual bool MoveToAttribute(const CefString& localName, const CefString& namespaceURI) OVERRIDE; diff --git a/libcef_dll/ctocpp/zip_reader_ctocpp.cc b/libcef_dll/ctocpp/zip_reader_ctocpp.cc index 14dccff11..76d85f4b4 100644 --- a/libcef_dll/ctocpp/zip_reader_ctocpp.cc +++ b/libcef_dll/ctocpp/zip_reader_ctocpp.cc @@ -4,10 +4,10 @@ // // --------------------------------------------------------------------------- // -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #include "libcef_dll/ctocpp/stream_reader_ctocpp.h" @@ -18,118 +18,226 @@ CefRefPtr CefZipReader::Create(CefRefPtr stream) { - cef_zip_reader_t* impl = cef_zip_reader_create( + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: stream; type: refptr_same + DCHECK(stream.get()); + if (!stream.get()) + return NULL; + + // Execute + cef_zip_reader_t* _retval = cef_zip_reader_create( CefStreamReaderCToCpp::Unwrap(stream)); - if(impl) - return CefZipReaderCToCpp::Wrap(impl); - return NULL; + + // Return type: refptr_same + return CefZipReaderCToCpp::Wrap(_retval); } + // VIRTUAL METHODS - Body may be edited by hand. bool CefZipReaderCToCpp::MoveToFirstFile() { - if(CEF_MEMBER_MISSING(struct_, move_to_first_file)) + if (CEF_MEMBER_MISSING(struct_, move_to_first_file)) return false; - return struct_->move_to_first_file(struct_) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->move_to_first_file(struct_); + + // Return type: bool + return _retval?true:false; } + bool CefZipReaderCToCpp::MoveToNextFile() { - if(CEF_MEMBER_MISSING(struct_, move_to_next_file)) + if (CEF_MEMBER_MISSING(struct_, move_to_next_file)) return false; - return struct_->move_to_next_file(struct_) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->move_to_next_file(struct_); + + // Return type: bool + return _retval?true:false; } + bool CefZipReaderCToCpp::MoveToFile(const CefString& fileName, bool caseSensitive) { - if(CEF_MEMBER_MISSING(struct_, move_to_file)) + if (CEF_MEMBER_MISSING(struct_, move_to_file)) return false; - return struct_->move_to_file(struct_, fileName.GetStruct(), caseSensitive) ? - true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: fileName; type: string_byref_const + DCHECK(!fileName.empty()); + if (fileName.empty()) + return false; + + // Execute + int _retval = struct_->move_to_file(struct_, + fileName.GetStruct(), + caseSensitive); + + // Return type: bool + return _retval?true:false; } + bool CefZipReaderCToCpp::Close() { - if(CEF_MEMBER_MISSING(struct_, close)) + if (CEF_MEMBER_MISSING(struct_, close)) return false; - return struct_->close(struct_) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->close(struct_); + + // Return type: bool + return _retval?true:false; } + CefString CefZipReaderCToCpp::GetFileName() { - CefString str; - if(CEF_MEMBER_MISSING(struct_, get_file_name)) - return str; + if (CEF_MEMBER_MISSING(struct_, get_file_name)) + return CefString(); - cef_string_userfree_t strPtr = struct_->get_file_name(struct_); - str.AttachToUserFree(strPtr); - return str; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_file_name(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } + long CefZipReaderCToCpp::GetFileSize() { - if(CEF_MEMBER_MISSING(struct_, get_file_size)) - return -1; + if (CEF_MEMBER_MISSING(struct_, get_file_size)) + return 0; - return struct_->get_file_size(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + long _retval = struct_->get_file_size(struct_); + + // Return type: simple + return _retval; } + time_t CefZipReaderCToCpp::GetFileLastModified() { - if(CEF_MEMBER_MISSING(struct_, get_file_last_modified)) + if (CEF_MEMBER_MISSING(struct_, get_file_last_modified)) return 0; - return struct_->get_file_last_modified(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + time_t _retval = struct_->get_file_last_modified(struct_); + + // Return type: simple + return _retval; } + bool CefZipReaderCToCpp::OpenFile(const CefString& password) { - if(CEF_MEMBER_MISSING(struct_, open_file)) - return 0; + if (CEF_MEMBER_MISSING(struct_, open_file)) + return false; - return struct_->open_file(struct_, password.GetStruct()) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: password + + // Execute + int _retval = struct_->open_file(struct_, + password.GetStruct()); + + // Return type: bool + return _retval?true:false; } + bool CefZipReaderCToCpp::CloseFile() { - if(CEF_MEMBER_MISSING(struct_, close_file)) - return 0; + if (CEF_MEMBER_MISSING(struct_, close_file)) + return false; - return struct_->close_file(struct_) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->close_file(struct_); + + // Return type: bool + return _retval?true:false; } + int CefZipReaderCToCpp::ReadFile(void* buffer, size_t bufferSize) { - if(CEF_MEMBER_MISSING(struct_, read_file)) - return -1; + if (CEF_MEMBER_MISSING(struct_, read_file)) + return 0; - return struct_->read_file(struct_, buffer, bufferSize); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: buffer; type: simple_byaddr + DCHECK(buffer); + if (!buffer) + return 0; + + // Execute + int _retval = struct_->read_file(struct_, + buffer, + bufferSize); + + // Return type: simple + return _retval; } + long CefZipReaderCToCpp::Tell() { - if(CEF_MEMBER_MISSING(struct_, tell)) - return -1; + if (CEF_MEMBER_MISSING(struct_, tell)) + return 0; - return struct_->tell(struct_); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + long _retval = struct_->tell(struct_); + + // Return type: simple + return _retval; } + bool CefZipReaderCToCpp::Eof() { - if(CEF_MEMBER_MISSING(struct_, eof)) + if (CEF_MEMBER_MISSING(struct_, eof)) return false; - return struct_->eof(struct_) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->eof(struct_); + + // Return type: bool + return _retval?true:false; } + #ifndef NDEBUG template<> long CefCToCpp::DebugObjCt = 0; diff --git a/libcef_dll/ctocpp/zip_reader_ctocpp.h b/libcef_dll/ctocpp/zip_reader_ctocpp.h index 11f987f36..c293ece3f 100644 --- a/libcef_dll/ctocpp/zip_reader_ctocpp.h +++ b/libcef_dll/ctocpp/zip_reader_ctocpp.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. // #ifndef _ZIPREADER_CTOCPP_H diff --git a/libcef_dll/libcef_dll.cc b/libcef_dll/libcef_dll.cc index 5b391621b..a0f4c73c4 100644 --- a/libcef_dll/libcef_dll.cc +++ b/libcef_dll/libcef_dll.cc @@ -1,363 +1,636 @@ -// Copyright (c) 2009 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// -#include "include/cef.h" -#include "include/cef_capi.h" -#include "include/cef_version.h" -#include "include/cef_nplugin.h" -#include "include/cef_nplugin_capi.h" -#include "cef_logging.h" -#include "cpptoc/browser_cpptoc.h" -#include "cpptoc/domdocument_cpptoc.h" -#include "cpptoc/domevent_cpptoc.h" -#include "cpptoc/domnode_cpptoc.h" -#include "cpptoc/post_data_cpptoc.h" -#include "cpptoc/post_data_element_cpptoc.h" -#include "cpptoc/request_cpptoc.h" -#include "cpptoc/stream_reader_cpptoc.h" -#include "cpptoc/stream_writer_cpptoc.h" -#include "cpptoc/v8context_cpptoc.h" -#include "cpptoc/v8value_cpptoc.h" -#include "cpptoc/web_urlrequest_cpptoc.h" -#include "cpptoc/xml_reader_cpptoc.h" -#include "cpptoc/zip_reader_cpptoc.h" -#include "ctocpp/app_ctocpp.h" -#include "ctocpp/content_filter_ctocpp.h" -#include "ctocpp/cookie_visitor_ctocpp.h" -#include "ctocpp/domevent_listener_ctocpp.h" -#include "ctocpp/domvisitor_ctocpp.h" -#include "ctocpp/download_handler_ctocpp.h" -#include "ctocpp/read_handler_ctocpp.h" -#include "ctocpp/scheme_handler_ctocpp.h" -#include "ctocpp/scheme_handler_factory_ctocpp.h" -#include "ctocpp/storage_visitor_ctocpp.h" -#include "ctocpp/task_ctocpp.h" -#include "ctocpp/v8accessor_ctocpp.h" -#include "ctocpp/v8handler_ctocpp.h" -#include "ctocpp/web_urlrequest_client_ctocpp.h" -#include "ctocpp/write_handler_ctocpp.h" -#include "base/string_split.h" +#include "libcef_dll/cpptoc/browser_cpptoc.h" +#include "libcef_dll/cpptoc/domdocument_cpptoc.h" +#include "libcef_dll/cpptoc/domevent_cpptoc.h" +#include "libcef_dll/cpptoc/domnode_cpptoc.h" +#include "libcef_dll/cpptoc/drag_data_cpptoc.h" +#include "libcef_dll/cpptoc/frame_cpptoc.h" +#include "libcef_dll/cpptoc/post_data_cpptoc.h" +#include "libcef_dll/cpptoc/post_data_element_cpptoc.h" +#include "libcef_dll/cpptoc/request_cpptoc.h" +#include "libcef_dll/cpptoc/response_cpptoc.h" +#include "libcef_dll/cpptoc/scheme_handler_callback_cpptoc.h" +#include "libcef_dll/cpptoc/stream_reader_cpptoc.h" +#include "libcef_dll/cpptoc/stream_writer_cpptoc.h" +#include "libcef_dll/cpptoc/v8context_cpptoc.h" +#include "libcef_dll/cpptoc/v8exception_cpptoc.h" +#include "libcef_dll/cpptoc/v8value_cpptoc.h" +#include "libcef_dll/cpptoc/web_urlrequest_cpptoc.h" +#include "libcef_dll/cpptoc/xml_reader_cpptoc.h" +#include "libcef_dll/cpptoc/zip_reader_cpptoc.h" +#include "libcef_dll/ctocpp/app_ctocpp.h" +#include "libcef_dll/ctocpp/content_filter_ctocpp.h" +#include "libcef_dll/ctocpp/cookie_visitor_ctocpp.h" +#include "libcef_dll/ctocpp/domevent_listener_ctocpp.h" +#include "libcef_dll/ctocpp/domvisitor_ctocpp.h" +#include "libcef_dll/ctocpp/display_handler_ctocpp.h" +#include "libcef_dll/ctocpp/download_handler_ctocpp.h" +#include "libcef_dll/ctocpp/drag_handler_ctocpp.h" +#include "libcef_dll/ctocpp/find_handler_ctocpp.h" +#include "libcef_dll/ctocpp/focus_handler_ctocpp.h" +#include "libcef_dll/ctocpp/jsdialog_handler_ctocpp.h" +#include "libcef_dll/ctocpp/keyboard_handler_ctocpp.h" +#include "libcef_dll/ctocpp/life_span_handler_ctocpp.h" +#include "libcef_dll/ctocpp/load_handler_ctocpp.h" +#include "libcef_dll/ctocpp/menu_handler_ctocpp.h" +#include "libcef_dll/ctocpp/print_handler_ctocpp.h" +#include "libcef_dll/ctocpp/proxy_handler_ctocpp.h" +#include "libcef_dll/ctocpp/read_handler_ctocpp.h" +#include "libcef_dll/ctocpp/render_handler_ctocpp.h" +#include "libcef_dll/ctocpp/request_handler_ctocpp.h" +#include "libcef_dll/ctocpp/scheme_handler_ctocpp.h" +#include "libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h" +#include "libcef_dll/ctocpp/storage_visitor_ctocpp.h" +#include "libcef_dll/ctocpp/task_ctocpp.h" +#include "libcef_dll/ctocpp/v8accessor_ctocpp.h" +#include "libcef_dll/ctocpp/v8context_handler_ctocpp.h" +#include "libcef_dll/ctocpp/v8handler_ctocpp.h" +#include "libcef_dll/ctocpp/web_urlrequest_client_ctocpp.h" +#include "libcef_dll/ctocpp/write_handler_ctocpp.h" -CEF_EXPORT int cef_build_revision() -{ - return CEF_REVISION; -} +// GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT int cef_initialize(const struct _cef_settings_t* settings, - struct _cef_app_t* application) + struct _cef_app_t* application) { - CefSettings settingsObj; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - // Reference the values instead of copying. + // Verify param: settings; type: struct_byref_const + DCHECK(settings); + if (!settings) + return 0; + // Unverified params: application + + // Translate param: settings; type: struct_byref_const + CefSettings settingsObj; if (settings) settingsObj.Set(*settings, false); - return CefInitialize(settingsObj, CefAppCToCpp::Wrap(application)); + // Execute + bool _retval = CefInitialize( + settingsObj, + CefAppCToCpp::Wrap(application)); + + // Return type: bool + return _retval; } + CEF_EXPORT void cef_shutdown() { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute CefShutdown(); #ifndef NDEBUG // Check that all wrapper objects have been destroyed DCHECK(CefBrowserCppToC::DebugObjCt == 0); - DCHECK(CefDOMDocumentCppToC::DebugObjCt == 0); - DCHECK(CefDOMEventCppToC::DebugObjCt == 0); - DCHECK(CefDOMNodeCppToC::DebugObjCt == 0); - DCHECK(CefRequestCppToC::DebugObjCt == 0); - DCHECK(CefPostDataCppToC::DebugObjCt == 0); - DCHECK(CefPostDataElementCppToC::DebugObjCt == 0); - DCHECK(CefStreamReaderCppToC::DebugObjCt == 0); - DCHECK(CefStreamWriterCppToC::DebugObjCt == 0); - DCHECK(CefV8ContextCppToC::DebugObjCt == 0); - DCHECK(CefV8ValueCppToC::DebugObjCt == 0); - DCHECK(CefWebURLRequestCppToC::DebugObjCt == 0); - DCHECK(CefXmlReaderCppToC::DebugObjCt == 0); - DCHECK(CefZipReaderCppToC::DebugObjCt == 0); DCHECK(CefContentFilterCToCpp::DebugObjCt == 0); DCHECK(CefCookieVisitorCToCpp::DebugObjCt == 0); + DCHECK(CefDOMDocumentCppToC::DebugObjCt == 0); + DCHECK(CefDOMEventCppToC::DebugObjCt == 0); DCHECK(CefDOMEventListenerCToCpp::DebugObjCt == 0); + DCHECK(CefDOMNodeCppToC::DebugObjCt == 0); DCHECK(CefDOMVisitorCToCpp::DebugObjCt == 0); + DCHECK(CefDisplayHandlerCToCpp::DebugObjCt == 0); DCHECK(CefDownloadHandlerCToCpp::DebugObjCt == 0); + DCHECK(CefDragDataCppToC::DebugObjCt == 0); + DCHECK(CefDragHandlerCToCpp::DebugObjCt == 0); + DCHECK(CefFindHandlerCToCpp::DebugObjCt == 0); + DCHECK(CefFocusHandlerCToCpp::DebugObjCt == 0); + DCHECK(CefFrameCppToC::DebugObjCt == 0); + DCHECK(CefJSDialogHandlerCToCpp::DebugObjCt == 0); + DCHECK(CefKeyboardHandlerCToCpp::DebugObjCt == 0); + DCHECK(CefLifeSpanHandlerCToCpp::DebugObjCt == 0); + DCHECK(CefLoadHandlerCToCpp::DebugObjCt == 0); + DCHECK(CefMenuHandlerCToCpp::DebugObjCt == 0); + DCHECK(CefPostDataCppToC::DebugObjCt == 0); + DCHECK(CefPostDataElementCppToC::DebugObjCt == 0); + DCHECK(CefPrintHandlerCToCpp::DebugObjCt == 0); + DCHECK(CefProxyHandlerCToCpp::DebugObjCt == 0); DCHECK(CefReadHandlerCToCpp::DebugObjCt == 0); + DCHECK(CefRenderHandlerCToCpp::DebugObjCt == 0); + DCHECK(CefRequestCppToC::DebugObjCt == 0); + DCHECK(CefRequestHandlerCToCpp::DebugObjCt == 0); + DCHECK(CefResponseCppToC::DebugObjCt == 0); DCHECK(CefSchemeHandlerCToCpp::DebugObjCt == 0); + DCHECK(CefSchemeHandlerCallbackCppToC::DebugObjCt == 0); DCHECK(CefSchemeHandlerFactoryCToCpp::DebugObjCt == 0); DCHECK(CefStorageVisitorCToCpp::DebugObjCt == 0); + DCHECK(CefStreamReaderCppToC::DebugObjCt == 0); + DCHECK(CefStreamWriterCppToC::DebugObjCt == 0); + DCHECK(CefTaskCToCpp::DebugObjCt == 0); DCHECK(CefV8AccessorCToCpp::DebugObjCt == 0); + DCHECK(CefV8ContextCppToC::DebugObjCt == 0); + DCHECK(CefV8ContextHandlerCToCpp::DebugObjCt == 0); + DCHECK(CefV8ExceptionCppToC::DebugObjCt == 0); DCHECK(CefV8HandlerCToCpp::DebugObjCt == 0); + DCHECK(CefV8ValueCppToC::DebugObjCt == 0); DCHECK(CefWebURLRequestClientCToCpp::DebugObjCt == 0); + DCHECK(CefWebURLRequestCppToC::DebugObjCt == 0); DCHECK(CefWriteHandlerCToCpp::DebugObjCt == 0); + DCHECK(CefXmlReaderCppToC::DebugObjCt == 0); + DCHECK(CefZipReaderCppToC::DebugObjCt == 0); #endif // !NDEBUG } + CEF_EXPORT void cef_do_message_loop_work() { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute CefDoMessageLoopWork(); } + CEF_EXPORT void cef_run_message_loop() { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute CefRunMessageLoop(); } + CEF_EXPORT int cef_register_extension(const cef_string_t* extension_name, - const cef_string_t* javascript_code, - struct _cef_v8handler_t* handler) + const cef_string_t* javascript_code, struct _cef_v8handler_t* handler) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: extension_name; type: string_byref_const DCHECK(extension_name); + if (!extension_name) + return 0; + // Verify param: javascript_code; type: string_byref_const DCHECK(javascript_code); + if (!javascript_code) + return 0; + // Unverified params: handler - CefRefPtr handlerPtr; - std::wstring nameStr, codeStr; - - if(handler) - handlerPtr = CefV8HandlerCToCpp::Wrap(handler); - - return CefRegisterExtension(CefString(extension_name), - CefString(javascript_code), handlerPtr); + // Execute + bool _retval = CefRegisterExtension( + CefString(extension_name), + CefString(javascript_code), + CefV8HandlerCToCpp::Wrap(handler)); + + // Return type: bool + return _retval; } -CEF_EXPORT int cef_register_plugin(const cef_plugin_info_t* plugin_info) -{ - DCHECK(plugin_info); - return CefRegisterPlugin(*plugin_info); -} CEF_EXPORT int cef_register_custom_scheme(const cef_string_t* scheme_name, int is_standard, int is_local, int is_display_isolated) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: scheme_name; type: string_byref_const DCHECK(scheme_name); if (!scheme_name) return 0; - return CefRegisterCustomScheme(CefString(scheme_name), is_standard?true:false, - is_local?true:false, is_display_isolated?true:false); + // Execute + bool _retval = CefRegisterCustomScheme( + CefString(scheme_name), + is_standard?true:false, + is_local?true:false, + is_display_isolated?true:false); + + // Return type: bool + return _retval; } + CEF_EXPORT int cef_register_scheme_handler_factory( const cef_string_t* scheme_name, const cef_string_t* domain_name, struct _cef_scheme_handler_factory_t* factory) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: scheme_name; type: string_byref_const DCHECK(scheme_name); if (!scheme_name) return 0; + // Unverified params: domain_name, factory - CefRefPtr factoryPtr; - if (factory) - factoryPtr = CefSchemeHandlerFactoryCToCpp::Wrap(factory); + // Execute + bool _retval = CefRegisterSchemeHandlerFactory( + CefString(scheme_name), + CefString(domain_name), + CefSchemeHandlerFactoryCToCpp::Wrap(factory)); - return CefRegisterSchemeHandlerFactory(CefString(scheme_name), - CefString(domain_name), factoryPtr); + // Return type: bool + return _retval; } + CEF_EXPORT int cef_clear_scheme_handler_factories() { - return CefClearSchemeHandlerFactories(); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + bool _retval = CefClearSchemeHandlerFactories(); + + // Return type: bool + return _retval; } + CEF_EXPORT int cef_add_cross_origin_whitelist_entry( const cef_string_t* source_origin, const cef_string_t* target_protocol, const cef_string_t* target_domain, int allow_target_subdomains) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: source_origin; type: string_byref_const DCHECK(source_origin); + if (!source_origin) + return 0; + // Verify param: target_protocol; type: string_byref_const DCHECK(target_protocol); + if (!target_protocol) + return 0; + // Verify param: target_domain; type: string_byref_const DCHECK(target_domain); - if (!source_origin || !target_protocol || !target_domain) + if (!target_domain) return 0; - return CefAddCrossOriginWhitelistEntry(CefString(source_origin), - CefString(target_protocol), CefString(target_domain), + // Execute + bool _retval = CefAddCrossOriginWhitelistEntry( + CefString(source_origin), + CefString(target_protocol), + CefString(target_domain), allow_target_subdomains?true:false); + + // Return type: bool + return _retval; } + CEF_EXPORT int cef_remove_cross_origin_whitelist_entry( const cef_string_t* source_origin, const cef_string_t* target_protocol, const cef_string_t* target_domain, int allow_target_subdomains) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: source_origin; type: string_byref_const DCHECK(source_origin); + if (!source_origin) + return 0; + // Verify param: target_protocol; type: string_byref_const DCHECK(target_protocol); + if (!target_protocol) + return 0; + // Verify param: target_domain; type: string_byref_const DCHECK(target_domain); - if (!source_origin || !target_protocol || !target_domain) + if (!target_domain) return 0; - return CefRemoveCrossOriginWhitelistEntry(CefString(source_origin), - CefString(target_protocol), CefString(target_domain), + // Execute + bool _retval = CefRemoveCrossOriginWhitelistEntry( + CefString(source_origin), + CefString(target_protocol), + CefString(target_domain), allow_target_subdomains?true:false); + + // Return type: bool + return _retval; } + CEF_EXPORT int cef_clear_cross_origin_whitelist() { - return CefClearCrossOriginWhitelist(); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + bool _retval = CefClearCrossOriginWhitelist(); + + // Return type: bool + return _retval; } + CEF_EXPORT int cef_currently_on(cef_thread_id_t threadId) { - return CefCurrentlyOn(threadId); + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + bool _retval = CefCurrentlyOn( + threadId); + + // Return type: bool + return _retval; } -CEF_EXPORT int cef_post_task(cef_thread_id_t threadId, - struct _cef_task_t* task) + +CEF_EXPORT int cef_post_task(cef_thread_id_t threadId, struct _cef_task_t* task) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: task; type: refptr_diff DCHECK(task); - if(!task) + if (!task) return 0; - return CefPostTask(threadId, CefTaskCToCpp::Wrap(task)); + // Execute + bool _retval = CefPostTask( + threadId, + CefTaskCToCpp::Wrap(task)); + + // Return type: bool + return _retval; } + CEF_EXPORT int cef_post_delayed_task(cef_thread_id_t threadId, struct _cef_task_t* task, long delay_ms) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: task; type: refptr_diff DCHECK(task); - if(!task) + if (!task) return 0; - return CefPostDelayedTask(threadId, CefTaskCToCpp::Wrap(task), delay_ms); + // Execute + bool _retval = CefPostDelayedTask( + threadId, + CefTaskCToCpp::Wrap(task), + delay_ms); + + // Return type: bool + return _retval; } + CEF_EXPORT int cef_parse_url(const cef_string_t* url, struct _cef_urlparts_t* parts) { - DCHECK(url && parts); - if(!url || !parts) + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: url; type: string_byref_const + DCHECK(url); + if (!url) + return 0; + // Verify param: parts; type: struct_byref + DCHECK(parts); + if (!parts) return 0; - CefURLParts urlParts; - bool ret = CefParseURL(CefString(url), urlParts); + // Translate param: parts; type: struct_byref + CefURLParts partsObj; + if (parts) + partsObj.AttachTo(*parts); - urlParts.DetachTo(*parts); + // Execute + bool _retval = CefParseURL( + CefString(url), + partsObj); - return ret; + // Restore param: parts; type: struct_byref + if (parts) + partsObj.DetachTo(*parts); + + // Return type: bool + return _retval; } + CEF_EXPORT int cef_create_url(const struct _cef_urlparts_t* parts, cef_string_t* url) { - DCHECK(parts && url); - if(!parts || !url) + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: parts; type: struct_byref_const + DCHECK(parts); + if (!parts) + return 0; + // Verify param: url; type: string_byref + DCHECK(url); + if (!url) return 0; - // Reference the existing values without copying. - CefURLParts urlParts; - urlParts.Set(*parts, false); - + // Translate param: parts; type: struct_byref_const + CefURLParts partsObj; + if (parts) + partsObj.Set(*parts, false); + // Translate param: url; type: string_byref CefString urlStr(url); - return CefCreateURL(urlParts, urlStr); + + // Execute + bool _retval = CefCreateURL( + partsObj, + urlStr); + + // Return type: bool + return _retval; } + CEF_EXPORT int cef_visit_all_cookies(struct _cef_cookie_visitor_t* visitor) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: visitor; type: refptr_diff DCHECK(visitor); if (!visitor) return 0; - return CefVisitAllCookies(CefCookieVisitorCToCpp::Wrap(visitor)); + // Execute + bool _retval = CefVisitAllCookies( + CefCookieVisitorCToCpp::Wrap(visitor)); + + // Return type: bool + return _retval; } + CEF_EXPORT int cef_visit_url_cookies(const cef_string_t* url, int includeHttpOnly, struct _cef_cookie_visitor_t* visitor) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: url; type: string_byref_const DCHECK(url); + if (!url) + return 0; + // Verify param: visitor; type: refptr_diff DCHECK(visitor); - if (!url || !visitor) + if (!visitor) return 0; - return CefVisitUrlCookies(CefString(url), includeHttpOnly?true:false, + // Execute + bool _retval = CefVisitUrlCookies( + CefString(url), + includeHttpOnly?true:false, CefCookieVisitorCToCpp::Wrap(visitor)); + + // Return type: bool + return _retval; } + CEF_EXPORT int cef_set_cookie(const cef_string_t* url, const struct _cef_cookie_t* cookie) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: url; type: string_byref_const DCHECK(url); + if (!url) + return 0; + // Verify param: cookie; type: struct_byref_const DCHECK(cookie); - if (!url || !cookie) + if (!cookie) return 0; - // Reference the existing values without copying. + // Translate param: cookie; type: struct_byref_const CefCookie cookieObj; - cookieObj.Set(*cookie, false); + if (cookie) + cookieObj.Set(*cookie, false); - return CefSetCookie(CefString(url), cookieObj); + // Execute + bool _retval = CefSetCookie( + CefString(url), + cookieObj); + + // Return type: bool + return _retval; } + CEF_EXPORT int cef_delete_cookies(const cef_string_t* url, const cef_string_t* cookie_name) { - CefString urlStr, cookieNameStr; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - if (url) - urlStr = url; - if (cookie_name) - cookieNameStr = cookie_name; + // Unverified params: url, cookie_name - return CefDeleteCookies(urlStr, cookieNameStr); + // Execute + bool _retval = CefDeleteCookies( + CefString(url), + CefString(cookie_name)); + + // Return type: bool + return _retval; } + CEF_EXPORT int cef_set_cookie_path(const cef_string_t* path) { - CefString pathStr; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - if (path) - pathStr = path; + // Unverified params: path - return CefSetCookiePath(pathStr); + // Execute + bool _retval = CefSetCookiePath( + CefString(path)); + + // Return type: bool + return _retval; } + CEF_EXPORT int cef_visit_storage(enum cef_storage_type_t type, const cef_string_t* origin, const cef_string_t* key, struct _cef_storage_visitor_t* visitor) { - CefString originStr, keyStr; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - if (origin) - originStr = origin; - if (key) - keyStr = key; + // Verify param: visitor; type: refptr_diff + DCHECK(visitor); + if (!visitor) + return 0; + // Unverified params: origin, key - return CefVisitStorage(type, originStr, keyStr, + // Execute + bool _retval = CefVisitStorage( + type, + CefString(origin), + CefString(key), CefStorageVisitorCToCpp::Wrap(visitor)); + + // Return type: bool + return _retval; } + CEF_EXPORT int cef_set_storage(enum cef_storage_type_t type, const cef_string_t* origin, const cef_string_t* key, const cef_string_t* value) { - CefString originStr, keyStr, valueStr; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - if (origin) - originStr = origin; - if (key) - keyStr = key; - if (value) - valueStr = value; + // Verify param: origin; type: string_byref_const + DCHECK(origin); + if (!origin) + return 0; + // Verify param: key; type: string_byref_const + DCHECK(key); + if (!key) + return 0; + // Verify param: value; type: string_byref_const + DCHECK(value); + if (!value) + return 0; - return CefSetStorage(type, originStr, keyStr, valueStr); + // Execute + bool _retval = CefSetStorage( + type, + CefString(origin), + CefString(key), + CefString(value)); + + // Return type: bool + return _retval; } + CEF_EXPORT int cef_delete_storage(enum cef_storage_type_t type, const cef_string_t* origin, const cef_string_t* key) { - CefString originStr, keyStr; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - if (origin) - originStr = origin; - if (key) - keyStr = key; + // Unverified params: origin, key - return CefDeleteStorage(type, origin, key); + // Execute + bool _retval = CefDeleteStorage( + type, + CefString(origin), + CefString(key)); + + // Return type: bool + return _retval; } + CEF_EXPORT int cef_set_storage_path(enum cef_storage_type_t type, const cef_string_t* path) { - CefString pathStr; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - if (path) - pathStr = path; + // Unverified params: path - return CefSetStoragePath(type, pathStr); + // Execute + bool _retval = CefSetStoragePath( + type, + CefString(path)); + + // Return type: bool + return _retval; } + + diff --git a/libcef_dll/libcef_dll2.cc b/libcef_dll/libcef_dll2.cc new file mode 100644 index 000000000..3159b0dee --- /dev/null +++ b/libcef_dll/libcef_dll2.cc @@ -0,0 +1,25 @@ +// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// reserved. Use of this source code is governed by a BSD-style license that +// can be found in the LICENSE file. +// + +#include "include/cef.h" +#include "include/cef_capi.h" +#include "include/cef_version.h" +#include "include/cef_nplugin.h" +#include "include/cef_nplugin_capi.h" +#include "cef_logging.h" + +CEF_EXPORT int cef_build_revision() +{ + return CEF_REVISION; +} + +CEF_EXPORT int cef_register_plugin(const cef_plugin_info_t* plugin_info) +{ + DCHECK(plugin_info); + if (!plugin_info) + return 0; + + return CefRegisterPlugin(*plugin_info); +} diff --git a/libcef_dll/wrapper/libcef_dll_wrapper.cc b/libcef_dll/wrapper/libcef_dll_wrapper.cc index 9d715aa38..810501225 100644 --- a/libcef_dll/wrapper/libcef_dll_wrapper.cc +++ b/libcef_dll/wrapper/libcef_dll_wrapper.cc @@ -1,24 +1,42 @@ -// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// -#include "include/cef.h" -#include "include/cef_capi.h" -#include "include/cef_nplugin.h" -#include "include/cef_nplugin_capi.h" #include "include/cef_version.h" #include "libcef_dll/cpptoc/app_cpptoc.h" #include "libcef_dll/cpptoc/content_filter_cpptoc.h" #include "libcef_dll/cpptoc/cookie_visitor_cpptoc.h" #include "libcef_dll/cpptoc/domevent_listener_cpptoc.h" #include "libcef_dll/cpptoc/domvisitor_cpptoc.h" +#include "libcef_dll/cpptoc/display_handler_cpptoc.h" #include "libcef_dll/cpptoc/download_handler_cpptoc.h" +#include "libcef_dll/cpptoc/drag_handler_cpptoc.h" +#include "libcef_dll/cpptoc/find_handler_cpptoc.h" +#include "libcef_dll/cpptoc/focus_handler_cpptoc.h" +#include "libcef_dll/cpptoc/jsdialog_handler_cpptoc.h" +#include "libcef_dll/cpptoc/keyboard_handler_cpptoc.h" +#include "libcef_dll/cpptoc/life_span_handler_cpptoc.h" +#include "libcef_dll/cpptoc/load_handler_cpptoc.h" +#include "libcef_dll/cpptoc/menu_handler_cpptoc.h" +#include "libcef_dll/cpptoc/print_handler_cpptoc.h" +#include "libcef_dll/cpptoc/proxy_handler_cpptoc.h" #include "libcef_dll/cpptoc/read_handler_cpptoc.h" +#include "libcef_dll/cpptoc/render_handler_cpptoc.h" +#include "libcef_dll/cpptoc/request_handler_cpptoc.h" #include "libcef_dll/cpptoc/scheme_handler_cpptoc.h" #include "libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h" #include "libcef_dll/cpptoc/storage_visitor_cpptoc.h" #include "libcef_dll/cpptoc/task_cpptoc.h" #include "libcef_dll/cpptoc/v8accessor_cpptoc.h" +#include "libcef_dll/cpptoc/v8context_handler_cpptoc.h" #include "libcef_dll/cpptoc/v8handler_cpptoc.h" #include "libcef_dll/cpptoc/web_urlrequest_client_cpptoc.h" #include "libcef_dll/cpptoc/write_handler_cpptoc.h" @@ -26,19 +44,30 @@ #include "libcef_dll/ctocpp/domdocument_ctocpp.h" #include "libcef_dll/ctocpp/domevent_ctocpp.h" #include "libcef_dll/ctocpp/domnode_ctocpp.h" +#include "libcef_dll/ctocpp/drag_data_ctocpp.h" +#include "libcef_dll/ctocpp/frame_ctocpp.h" #include "libcef_dll/ctocpp/post_data_ctocpp.h" #include "libcef_dll/ctocpp/post_data_element_ctocpp.h" #include "libcef_dll/ctocpp/request_ctocpp.h" +#include "libcef_dll/ctocpp/response_ctocpp.h" +#include "libcef_dll/ctocpp/scheme_handler_callback_ctocpp.h" #include "libcef_dll/ctocpp/stream_reader_ctocpp.h" #include "libcef_dll/ctocpp/stream_writer_ctocpp.h" -#include "libcef_dll/ctocpp/v8value_ctocpp.h" #include "libcef_dll/ctocpp/v8context_ctocpp.h" +#include "libcef_dll/ctocpp/v8exception_ctocpp.h" +#include "libcef_dll/ctocpp/v8value_ctocpp.h" #include "libcef_dll/ctocpp/web_urlrequest_ctocpp.h" #include "libcef_dll/ctocpp/xml_reader_ctocpp.h" #include "libcef_dll/ctocpp/zip_reader_ctocpp.h" +// Define used to facilitate parsing. +#define CEF_GLOBAL -bool CefInitialize(const CefSettings& settings, CefRefPtr application) + +// GLOBAL METHODS - Body may be edited by hand. + +CEF_GLOBAL bool CefInitialize(const CefSettings& settings, + CefRefPtr application) { int build_revision = cef_build_revision(); if (build_revision != CEF_REVISION) { @@ -47,201 +76,518 @@ bool CefInitialize(const CefSettings& settings, CefRefPtr application) return false; } - return cef_initialize(&settings, CefAppCppToC::Wrap(application))?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: application + + // Execute + int _retval = cef_initialize( + &settings, + CefAppCppToC::Wrap(application)); + + // Return type: bool + return _retval?true:false; } -void CefShutdown() + +CEF_GLOBAL void CefShutdown() { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute cef_shutdown(); #ifndef NDEBUG // Check that all wrapper objects have been destroyed + DCHECK(CefBrowserCToCpp::DebugObjCt == 0); DCHECK(CefContentFilterCppToC::DebugObjCt == 0); DCHECK(CefCookieVisitorCppToC::DebugObjCt == 0); + DCHECK(CefDOMDocumentCToCpp::DebugObjCt == 0); + DCHECK(CefDOMEventCToCpp::DebugObjCt == 0); DCHECK(CefDOMEventListenerCppToC::DebugObjCt == 0); + DCHECK(CefDOMNodeCToCpp::DebugObjCt == 0); DCHECK(CefDOMVisitorCppToC::DebugObjCt == 0); + DCHECK(CefDisplayHandlerCppToC::DebugObjCt == 0); DCHECK(CefDownloadHandlerCppToC::DebugObjCt == 0); + DCHECK(CefDragDataCToCpp::DebugObjCt == 0); + DCHECK(CefDragHandlerCppToC::DebugObjCt == 0); + DCHECK(CefFindHandlerCppToC::DebugObjCt == 0); + DCHECK(CefFocusHandlerCppToC::DebugObjCt == 0); + DCHECK(CefFrameCToCpp::DebugObjCt == 0); + DCHECK(CefJSDialogHandlerCppToC::DebugObjCt == 0); + DCHECK(CefKeyboardHandlerCppToC::DebugObjCt == 0); + DCHECK(CefLifeSpanHandlerCppToC::DebugObjCt == 0); + DCHECK(CefLoadHandlerCppToC::DebugObjCt == 0); + DCHECK(CefMenuHandlerCppToC::DebugObjCt == 0); + DCHECK(CefPostDataCToCpp::DebugObjCt == 0); + DCHECK(CefPostDataElementCToCpp::DebugObjCt == 0); + DCHECK(CefPrintHandlerCppToC::DebugObjCt == 0); + DCHECK(CefProxyHandlerCppToC::DebugObjCt == 0); DCHECK(CefReadHandlerCppToC::DebugObjCt == 0); + DCHECK(CefRenderHandlerCppToC::DebugObjCt == 0); + DCHECK(CefRequestCToCpp::DebugObjCt == 0); + DCHECK(CefRequestHandlerCppToC::DebugObjCt == 0); + DCHECK(CefResponseCToCpp::DebugObjCt == 0); + DCHECK(CefSchemeHandlerCallbackCToCpp::DebugObjCt == 0); DCHECK(CefSchemeHandlerCppToC::DebugObjCt == 0); DCHECK(CefSchemeHandlerFactoryCppToC::DebugObjCt == 0); DCHECK(CefStorageVisitorCppToC::DebugObjCt == 0); - DCHECK(CefV8AccessorCppToC::DebugObjCt == 0); - DCHECK(CefV8HandlerCppToC::DebugObjCt == 0); - DCHECK(CefWebURLRequestClientCppToC::DebugObjCt == 0); - DCHECK(CefWriteHandlerCppToC::DebugObjCt == 0); - DCHECK(CefBrowserCToCpp::DebugObjCt == 0); - DCHECK(CefDOMDocumentCToCpp::DebugObjCt == 0); - DCHECK(CefDOMEventCToCpp::DebugObjCt == 0); - DCHECK(CefDOMNodeCToCpp::DebugObjCt == 0); - DCHECK(CefRequestCToCpp::DebugObjCt == 0); - DCHECK(CefPostDataCToCpp::DebugObjCt == 0); - DCHECK(CefPostDataElementCToCpp::DebugObjCt == 0); DCHECK(CefStreamReaderCToCpp::DebugObjCt == 0); DCHECK(CefStreamWriterCToCpp::DebugObjCt == 0); + DCHECK(CefTaskCppToC::DebugObjCt == 0); + DCHECK(CefV8AccessorCppToC::DebugObjCt == 0); DCHECK(CefV8ContextCToCpp::DebugObjCt == 0); + DCHECK(CefV8ContextHandlerCppToC::DebugObjCt == 0); + DCHECK(CefV8ExceptionCToCpp::DebugObjCt == 0); + DCHECK(CefV8HandlerCppToC::DebugObjCt == 0); DCHECK(CefV8ValueCToCpp::DebugObjCt == 0); DCHECK(CefWebURLRequestCToCpp::DebugObjCt == 0); + DCHECK(CefWebURLRequestClientCppToC::DebugObjCt == 0); + DCHECK(CefWriteHandlerCppToC::DebugObjCt == 0); DCHECK(CefXmlReaderCToCpp::DebugObjCt == 0); DCHECK(CefZipReaderCToCpp::DebugObjCt == 0); #endif // !NDEBUG } -void CefDoMessageLoopWork() + +CEF_GLOBAL void CefDoMessageLoopWork() { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute cef_do_message_loop_work(); } -void CefRunMessageLoop() + +CEF_GLOBAL void CefRunMessageLoop() { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute cef_run_message_loop(); } -bool CefRegisterExtension(const CefString& extension_name, - const CefString& javascript_code, - CefRefPtr handler) + +CEF_GLOBAL bool CefRegisterExtension(const CefString& extension_name, + const CefString& javascript_code, CefRefPtr handler) { - return cef_register_extension(extension_name.GetStruct(), - javascript_code.GetStruct(), CefV8HandlerCppToC::Wrap(handler))? - true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: extension_name; type: string_byref_const + DCHECK(!extension_name.empty()); + if (extension_name.empty()) + return false; + // Verify param: javascript_code; type: string_byref_const + DCHECK(!javascript_code.empty()); + if (javascript_code.empty()) + return false; + // Unverified params: handler + + // Execute + int _retval = cef_register_extension( + extension_name.GetStruct(), + javascript_code.GetStruct(), + CefV8HandlerCppToC::Wrap(handler)); + + // Return type: bool + return _retval?true:false; } -bool CefRegisterPlugin(const CefPluginInfo& plugin_info) + +CEF_GLOBAL bool CefRegisterCustomScheme(const CefString& scheme_name, + bool is_standard, bool is_local, bool is_display_isolated) { - return cef_register_plugin(&plugin_info)?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: scheme_name; type: string_byref_const + DCHECK(!scheme_name.empty()); + if (scheme_name.empty()) + return false; + + // Execute + int _retval = cef_register_custom_scheme( + scheme_name.GetStruct(), + is_standard, + is_local, + is_display_isolated); + + // Return type: bool + return _retval?true:false; } -bool CefRegisterCustomScheme(const CefString& scheme_name, - bool is_standard, - bool is_local, - bool is_display_isolated) + +CEF_GLOBAL bool CefRegisterSchemeHandlerFactory(const CefString& scheme_name, + const CefString& domain_name, CefRefPtr factory) { - return cef_register_custom_scheme(scheme_name.GetStruct(), is_standard, - is_local, is_display_isolated)?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: scheme_name; type: string_byref_const + DCHECK(!scheme_name.empty()); + if (scheme_name.empty()) + return false; + // Unverified params: domain_name, factory + + // Execute + int _retval = cef_register_scheme_handler_factory( + scheme_name.GetStruct(), + domain_name.GetStruct(), + CefSchemeHandlerFactoryCppToC::Wrap(factory)); + + // Return type: bool + return _retval?true:false; } -bool CefRegisterSchemeHandlerFactory(const CefString& scheme_name, - const CefString& domain_name, - CefRefPtr factory) + +CEF_GLOBAL bool CefClearSchemeHandlerFactories() { - cef_scheme_handler_factory_t* factory_struct = NULL; - if (factory.get()) - factory_struct = CefSchemeHandlerFactoryCppToC::Wrap(factory); - - return cef_register_scheme_handler_factory(scheme_name.GetStruct(), - domain_name.GetStruct(), factory_struct)?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = cef_clear_scheme_handler_factories(); + + // Return type: bool + return _retval?true:false; } -bool CefClearSchemeHandlerFactories() + +CEF_GLOBAL bool CefAddCrossOriginWhitelistEntry(const CefString& source_origin, + const CefString& target_protocol, const CefString& target_domain, + bool allow_target_subdomains) { - return cef_clear_scheme_handler_factories()?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: source_origin; type: string_byref_const + DCHECK(!source_origin.empty()); + if (source_origin.empty()) + return false; + // Verify param: target_protocol; type: string_byref_const + DCHECK(!target_protocol.empty()); + if (target_protocol.empty()) + return false; + // Verify param: target_domain; type: string_byref_const + DCHECK(!target_domain.empty()); + if (target_domain.empty()) + return false; + + // Execute + int _retval = cef_add_cross_origin_whitelist_entry( + source_origin.GetStruct(), + target_protocol.GetStruct(), + target_domain.GetStruct(), + allow_target_subdomains); + + // Return type: bool + return _retval?true:false; } -bool CefAddCrossOriginWhitelistEntry(const CefString& source_origin, - const CefString& target_protocol, - const CefString& target_domain, - bool allow_target_subdomains) + +CEF_GLOBAL bool CefRemoveCrossOriginWhitelistEntry( + const CefString& source_origin, const CefString& target_protocol, + const CefString& target_domain, bool allow_target_subdomains) { - return cef_add_cross_origin_whitelist_entry(source_origin.GetStruct(), - target_protocol.GetStruct(), target_domain.GetStruct(), - allow_target_subdomains)?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: source_origin; type: string_byref_const + DCHECK(!source_origin.empty()); + if (source_origin.empty()) + return false; + // Verify param: target_protocol; type: string_byref_const + DCHECK(!target_protocol.empty()); + if (target_protocol.empty()) + return false; + // Verify param: target_domain; type: string_byref_const + DCHECK(!target_domain.empty()); + if (target_domain.empty()) + return false; + + // Execute + int _retval = cef_remove_cross_origin_whitelist_entry( + source_origin.GetStruct(), + target_protocol.GetStruct(), + target_domain.GetStruct(), + allow_target_subdomains); + + // Return type: bool + return _retval?true:false; } -bool CefRemoveCrossOriginWhitelistEntry(const CefString& source_origin, - const CefString& target_protocol, - const CefString& target_domain, - bool allow_target_subdomains) + +CEF_GLOBAL bool CefClearCrossOriginWhitelist() { - return cef_remove_cross_origin_whitelist_entry(source_origin.GetStruct(), - target_protocol.GetStruct(), target_domain.GetStruct(), - allow_target_subdomains)?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = cef_clear_cross_origin_whitelist(); + + // Return type: bool + return _retval?true:false; } -bool CefClearCrossOriginWhitelist() + +CEF_GLOBAL bool CefCurrentlyOn(CefThreadId threadId) { - return cef_clear_cross_origin_whitelist()?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = cef_currently_on( + threadId); + + // Return type: bool + return _retval?true:false; } -bool CefCurrentlyOn(CefThreadId threadId) + +CEF_GLOBAL bool CefPostTask(CefThreadId threadId, CefRefPtr task) { - return cef_currently_on(threadId)?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: task; type: refptr_diff + DCHECK(task.get()); + if (!task.get()) + return false; + + // Execute + int _retval = cef_post_task( + threadId, + CefTaskCppToC::Wrap(task)); + + // Return type: bool + return _retval?true:false; } -bool CefPostTask(CefThreadId threadId, CefRefPtr task) + +CEF_GLOBAL bool CefPostDelayedTask(CefThreadId threadId, + CefRefPtr task, long delay_ms) { - return cef_post_task(threadId, CefTaskCppToC::Wrap(task))?true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: task; type: refptr_diff + DCHECK(task.get()); + if (!task.get()) + return false; + + // Execute + int _retval = cef_post_delayed_task( + threadId, + CefTaskCppToC::Wrap(task), + delay_ms); + + // Return type: bool + return _retval?true:false; } -bool CefPostDelayedTask(CefThreadId threadId, CefRefPtr task, - long delay_ms) + +CEF_GLOBAL bool CefParseURL(const CefString& url, CefURLParts& parts) { - return cef_post_delayed_task(threadId, CefTaskCppToC::Wrap(task), delay_ms)? - true:false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: url; type: string_byref_const + DCHECK(!url.empty()); + if (url.empty()) + return false; + + // Execute + int _retval = cef_parse_url( + url.GetStruct(), + &parts); + + // Return type: bool + return _retval?true:false; } -bool CefParseURL(const CefString& url, - CefURLParts& parts) + +CEF_GLOBAL bool CefCreateURL(const CefURLParts& parts, CefString& url) { - return cef_parse_url(url.GetStruct(), &parts) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = cef_create_url( + &parts, + url.GetWritableStruct()); + + // Return type: bool + return _retval?true:false; } -bool CefCreateURL(const CefURLParts& parts, - CefString& url) + +CEF_GLOBAL bool CefVisitAllCookies(CefRefPtr visitor) { - return cef_create_url(&parts, url.GetWritableStruct()) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: visitor; type: refptr_diff + DCHECK(visitor.get()); + if (!visitor.get()) + return false; + + // Execute + int _retval = cef_visit_all_cookies( + CefCookieVisitorCppToC::Wrap(visitor)); + + // Return type: bool + return _retval?true:false; } -bool CefVisitAllCookies(CefRefPtr visitor) + +CEF_GLOBAL bool CefVisitUrlCookies(const CefString& url, bool includeHttpOnly, + CefRefPtr visitor) { - return cef_visit_all_cookies(CefCookieVisitorCppToC::Wrap(visitor)) ? - true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: url; type: string_byref_const + DCHECK(!url.empty()); + if (url.empty()) + return false; + // Verify param: visitor; type: refptr_diff + DCHECK(visitor.get()); + if (!visitor.get()) + return false; + + // Execute + int _retval = cef_visit_url_cookies( + url.GetStruct(), + includeHttpOnly, + CefCookieVisitorCppToC::Wrap(visitor)); + + // Return type: bool + return _retval?true:false; } -bool CefVisitUrlCookies(const CefString& url, bool includeHttpOnly, - CefRefPtr visitor) + +CEF_GLOBAL bool CefSetCookie(const CefString& url, const CefCookie& cookie) { - return cef_visit_url_cookies(url.GetStruct(), includeHttpOnly, - CefCookieVisitorCppToC::Wrap(visitor)) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: url; type: string_byref_const + DCHECK(!url.empty()); + if (url.empty()) + return false; + + // Execute + int _retval = cef_set_cookie( + url.GetStruct(), + &cookie); + + // Return type: bool + return _retval?true:false; } -bool CefSetCookie(const CefString& url, const CefCookie& cookie) + +CEF_GLOBAL bool CefDeleteCookies(const CefString& url, + const CefString& cookie_name) { - return cef_set_cookie(url.GetStruct(), &cookie) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: url, cookie_name + + // Execute + int _retval = cef_delete_cookies( + url.GetStruct(), + cookie_name.GetStruct()); + + // Return type: bool + return _retval?true:false; } -bool CefDeleteCookies(const CefString& url, const CefString& cookie_name) + +CEF_GLOBAL bool CefSetCookiePath(const CefString& path) { - return cef_delete_cookies(url.GetStruct(), cookie_name.GetStruct()) ? - true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: path + + // Execute + int _retval = cef_set_cookie_path( + path.GetStruct()); + + // Return type: bool + return _retval?true:false; } -bool CefSetCookiePath(const CefString& path) + +CEF_GLOBAL bool CefVisitStorage(CefStorageType type, const CefString& origin, + const CefString& key, CefRefPtr visitor) { - return cef_set_cookie_path(path.GetStruct()) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: visitor; type: refptr_diff + DCHECK(visitor.get()); + if (!visitor.get()) + return false; + // Unverified params: origin, key + + // Execute + int _retval = cef_visit_storage( + type, + origin.GetStruct(), + key.GetStruct(), + CefStorageVisitorCppToC::Wrap(visitor)); + + // Return type: bool + return _retval?true:false; } -bool CefVisitStorage(CefStorageType type, const CefString& origin, - const CefString& key, - CefRefPtr visitor) + +CEF_GLOBAL bool CefSetStorage(CefStorageType type, const CefString& origin, + const CefString& key, const CefString& value) { - return cef_visit_storage(type, origin.GetStruct(), key.GetStruct(), - CefStorageVisitorCppToC::Wrap(visitor)) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: origin; type: string_byref_const + DCHECK(!origin.empty()); + if (origin.empty()) + return false; + // Verify param: key; type: string_byref_const + DCHECK(!key.empty()); + if (key.empty()) + return false; + // Verify param: value; type: string_byref_const + DCHECK(!value.empty()); + if (value.empty()) + return false; + + // Execute + int _retval = cef_set_storage( + type, + origin.GetStruct(), + key.GetStruct(), + value.GetStruct()); + + // Return type: bool + return _retval?true:false; } -bool CefSetStorage(CefStorageType type, const CefString& origin, - const CefString& key, const CefString& value) + +CEF_GLOBAL bool CefDeleteStorage(CefStorageType type, const CefString& origin, + const CefString& key) { - return cef_set_storage(type, origin.GetStruct(), key.GetStruct(), - value.GetStruct()) ? true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: origin, key + + // Execute + int _retval = cef_delete_storage( + type, + origin.GetStruct(), + key.GetStruct()); + + // Return type: bool + return _retval?true:false; } -bool CefDeleteStorage(CefStorageType type, const CefString& origin, - const CefString& key) + +CEF_GLOBAL bool CefSetStoragePath(CefStorageType type, const CefString& path) { - return cef_delete_storage(type, origin.GetStruct(), key.GetStruct()) ? - true : false; + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: path + + // Execute + int _retval = cef_set_storage_path( + type, + path.GetStruct()); + + // Return type: bool + return _retval?true:false; } -bool CefSetStoragePath(CefStorageType type, const CefString& path) -{ - return cef_set_storage_path(type, path.GetStruct()) ? true : false; -} + diff --git a/libcef_dll/wrapper/libcef_dll_wrapper2.cc b/libcef_dll/wrapper/libcef_dll_wrapper2.cc new file mode 100644 index 000000000..28943a1b8 --- /dev/null +++ b/libcef_dll/wrapper/libcef_dll_wrapper2.cc @@ -0,0 +1,13 @@ +// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// reserved. Use of this source code is governed by a BSD-style license that +// can be found in the LICENSE file. + +#include "include/cef.h" +#include "include/cef_capi.h" +#include "include/cef_nplugin.h" +#include "include/cef_nplugin_capi.h" + +bool CefRegisterPlugin(const CefPluginInfo& plugin_info) +{ + return cef_register_plugin(&plugin_info)?true:false; +} diff --git a/tests/unittests/test_suite.cc b/tests/unittests/test_suite.cc index bfdd6af9b..558f6b675 100644 --- a/tests/unittests/test_suite.cc +++ b/tests/unittests/test_suite.cc @@ -18,8 +18,6 @@ void CefTestSuite::Initialize() { CefSettings settings; settings.multi_threaded_message_loop = true; - CommandLine* command_line = CommandLine::ForCurrentProcess(); - std::string cache_path; if (GetCachePath(cache_path)) { // Set the cache_path value. diff --git a/tools/cef_parser.py b/tools/cef_parser.py index afbb356c5..173a3cfa1 100644 --- a/tools/cef_parser.py +++ b/tools/cef_parser.py @@ -2,6 +2,7 @@ # reserved. Use of this source code is governed by a BSD-style license that # can be found in the LICENSE file. +from date_util import * from file_util import * import os import re @@ -147,7 +148,7 @@ def get_comment(body, name): result.append(None) else: break - elif line[0:2] == '/*': + elif line[0:2] == '/*' or line[-2:] == '*/': continue elif line[0:2] == '//': # keep the comment line including any leading spaces @@ -288,7 +289,8 @@ def format_translation_includes(body): return result def str_to_dict(str): - """ Convert a string to a dictionary. """ + """ Convert a string to a dictionary. If the same key has multiple values + the values will be stored in a list. """ dict = {} parts = string.split(str, ',') for part in parts: @@ -296,21 +298,40 @@ def str_to_dict(str): if len(part) == 0: continue sparts = string.split(part, '=') - if len(sparts) != 2: + if len(sparts) > 2: raise Exception('Invalid dictionary pair format: '+part) - dict[string.strip(sparts[0])] = string.strip(sparts[1]) + name = string.strip(sparts[0]) + if len(sparts) == 2: + val = string.strip(sparts[1]) + else: + val = True + if name in dict: + # a value with this name already exists + curval = dict[name] + if not isinstance(curval, list): + # convert the string value to a list + dict[name] = [curval] + dict[name].append(val) + else: + dict[name] = val return dict def dict_to_str(dict): """ Convert a dictionary to a string. """ str = [] for name in dict.keys(): - str.append(name+'='+dict[name]) + if not isinstance(dict[name], list): + # currently a string value + str.append(name+'='+dict[name]) + else: + # currently a list value + for val in dict[name]: + str.append(name+'='+val) return string.join(str, ',') # regex for matching comment-formatted attributes -_cre_attrib = '/\*--cef\(([A-Za-z0-9_ ,=]{0,})\)--\*/' +_cre_attrib = '/\*--cef\(([A-Za-z0-9_ ,=:\n]{0,})\)--\*/' # regex for matching class and function names _cre_cfname = '([A-Za-z0-9_]{1,})' # regex for matching typedef values and function return values @@ -377,6 +398,25 @@ def get_next_function_impl(existing, name): break return result +def get_copyright(): + result = \ +"""// Copyright (c) $YEAR$ The Chromium Embedded Framework Authors. All rights +// reserved. Use of this source code is governed by a BSD-style license that +// can be found in the LICENSE file. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +""" + # add the copyright year + return result.replace('$YEAR$', get_year()) + + class obj_header: """ Class representing a C++ header file. """ @@ -632,8 +672,34 @@ class obj_class: return self.comment def get_attribs(self): - """ Return the class attributes as a dictionary. """ - return self.attribs; + """ Return all attributes as a dictionary. """ + return self.attribs + + def has_attrib(self, name): + """ Return true if the specified attribute exists. """ + return name in self.attribs + + def get_attrib(self, name): + """ Return the first or only value for specified attribute. """ + if name in self.attribs: + if isinstance(self.attribs[name], list): + # the value is a list + return self.attribs[name][0] + else: + # the value is a string + return self.attribs[name] + return None; + + def get_attrib_list(self, name): + """ Return all values for specified attribute as a list. """ + if name in self.attribs: + if isinstance(self.attribs[name], list): + # the value is already a list + return self.attribs[name] + else: + # convert the value to a list + return [self.attribs[name]] + return None; def get_typedefs(self): """ Return the array of typedef objects. """ @@ -727,7 +793,18 @@ class obj_function: for arg in arglist: arg = string.strip(arg) if len(arg) > 0: - self.arguments.append(obj_argument(self, arg)) + argument = obj_argument(self, arg) + if argument.needs_attrib_count_func() and \ + argument.get_attrib_count_func() is None: + raise Exception("A 'count_func' attribute is required "+ \ + "for the '"+argument.get_name()+ \ + "' parameter to "+self.get_qualified_name()) + self.arguments.append(argument) + + if self.retval.needs_attrib_default_retval() and \ + self.retval.get_attrib_default_retval() is None: + raise Exception("A 'default_retval' attribute is required for "+ \ + self.get_qualified_name()) def __repr__(self): return '/* '+dict_to_str(self.attribs)+' */ '+self.get_cpp_proto() @@ -736,6 +813,15 @@ class obj_function: """ Return the function name. """ return self.name + def get_qualified_name(self): + """ Return the fully qualified function name. """ + if isinstance(self.parent, obj_header): + # global function + return self.name + else: + # member function + return self.parent.get_name()+'::'+self.name + def get_capi_name(self, prefix = None): """ Return the CAPI function name. """ if 'capi_name' in self.attribs: @@ -747,9 +833,35 @@ class obj_function: return self.comment def get_attribs(self): - """ Return the function attributes as a dictionary. """ + """ Return all attributes as a dictionary. """ return self.attribs + def has_attrib(self, name): + """ Return true if the specified attribute exists. """ + return name in self.attribs + + def get_attrib(self, name): + """ Return the first or only value for specified attribute. """ + if name in self.attribs: + if isinstance(self.attribs[name], list): + # the value is a list + return self.attribs[name][0] + else: + # the value is a string + return self.attribs[name] + return None; + + def get_attrib_list(self, name): + """ Return all values for specified attribute as a list. """ + if name in self.attribs: + if isinstance(self.attribs[name], list): + # the value is already a list + return self.attribs[name] + else: + # convert the value to a list + return [self.attribs[name]] + return None; + def get_retval(self): """ Return the return value object. """ return self.retval @@ -789,19 +901,14 @@ class obj_function: args.append(dict['value']) elif dict['format'] == 'multi-arg': # add an additional argument for the size of the array - type = type.get_name() - if type[-1] == 's': - type = type[:-1] - args.append('size_t '+type+'Count') + type_name = type.get_name() + if type.is_const(): + # for const arrays pass the size argument by value + args.append('size_t '+type_name+'Count') + else: + # for non-const arrays pass the size argument by address + args.append('size_t* '+type_name+'Count') args.append(dict['value']) - elif dict['format'] == 'multi-func': - # change the function to return one value of the - # required type based on an index parameter - type = type.get_name() - if type[-1] == 's': - type = type[:-1] - args.append('int '+type+'Index') - retval = dict['value'] return { 'retval' : retval, 'name' : name, 'args' : args } @@ -825,8 +932,7 @@ class obj_function: if isimpl and isinstance(self, obj_function_virtual): # enumeration return values must be qualified with the class name type = self.get_retval().get_type() - if type.is_result_struct() and not type.is_byref() \ - and not type.is_byaddr(): + if type.is_result_struct() and type.is_result_struct_enum(): retval = self.parent.get_name()+'::'+retval return { 'retval' : retval, 'name' : name, 'args' : args } @@ -841,6 +947,28 @@ class obj_function: if isinstance(self, obj_function_virtual) and self.is_const(): result += ' const' return result + + def is_same_side(self, other_class_name): + """ Returns true if this function is on the same side (library or + client) and the specified class. """ + if isinstance(self.parent, obj_class): + # this function is part of a class + this_is_library_side = self.parent.is_library_side() + header = self.parent.parent + else: + # this function is global + this_is_library_side = True + header = self.parent + + if other_class_name == 'CefBase': + other_is_library_side = False + else: + other_class = header.get_class(other_class_name) + if other_class is None: + raise Exception('Unknown class: '+other_class_name) + other_is_library_side = other_class.is_library_side() + + return other_is_library_side == this_is_library_side class obj_function_static(obj_function): @@ -904,6 +1032,10 @@ class obj_argument: result += ' '+self.type.get_name() return result + def get_name(self): + """ Return the name for this argument. """ + return self.type.get_name() + def remove_name(self): """ Remove and return the name value. """ name = self.type.get_name() @@ -921,7 +1053,210 @@ class obj_argument: name = self.type.get_type() if not name in list: list[name] = self.type + + def needs_attrib_count_func(self): + """ Returns true if this argument requires a 'count_func' attribute. """ + # A 'count_func' attribute is required for non-const non-string vector + # attribute types + return self.type.has_name() and \ + self.type.is_result_vector() and \ + not self.type.is_result_vector_string() and \ + not self.type.is_const() + + def get_attrib_count_func(self): + """ Returns the count function for this argument. """ + # The 'count_func' attribute value format is name:function + if not self.parent.has_attrib('count_func'): + return None; + name = self.type.get_name(); + vals = self.parent.get_attrib_list('count_func') + for val in vals: + parts = string.split(val, ':') + if len(parts) != 2: + raise Exception("Invalid 'count_func' attribute value for "+ \ + this.parent.get_qualified_name()+': '+val) + if string.strip(parts[0]) == name: + return string.strip(parts[1]) + return None + + def needs_attrib_default_retval(self): + """ Returns true if this argument requires a 'default_retval' attribute. + """ + # A 'default_retval' attribute is required for enumeration return value + # types. + return not self.type.has_name() and \ + self.type.is_result_struct() and \ + self.type.is_result_struct_enum() + + def get_attrib_default_retval(self): + """ Returns the defualt return value for this argument. """ + return self.parent.get_attrib('default_retval') + + def get_arg_type(self): + """ Returns the argument type as defined in translator.README.txt. """ + if not self.type.has_name(): + raise Exception('Cannot be called for retval types') + + # simple or enumeration type + if (self.type.is_result_simple() and \ + self.type.get_type() != 'bool') or \ + (self.type.is_result_struct() and \ + self.type.is_result_struct_enum()): + if self.type.is_byref(): + if self.type.is_const(): + return 'simple_byref_const' + return 'simple_byref' + elif self.type.is_byaddr(): + return 'simple_byaddr' + return 'simple_byval' + + # boolean type + if self.type.get_type() == 'bool': + if self.type.is_byref(): + return 'bool_byref' + elif self.type.is_byaddr(): + return 'bool_byaddr' + return 'bool_byval' + + # structure type + if self.type.is_result_struct() and self.type.is_byref(): + if self.type.is_const(): + return 'struct_byref_const' + return 'struct_byref' + + # string type + if self.type.is_result_string() and self.type.is_byref(): + if self.type.is_const(): + return 'string_byref_const' + return 'string_byref' + # refptr type + if self.type.is_result_refptr(): + same_side = self.parent.is_same_side(self.type.get_refptr_type()) + if self.type.is_byref(): + if same_side: + return 'refptr_same_byref' + return 'refptr_diff_byref' + if same_side: + return 'refptr_same' + return 'refptr_diff' + + + if self.type.is_result_vector(): + # all vector types must be passed by reference + if not self.type.is_byref(): + return 'invalid' + + if self.type.is_result_vector_string(): + # string vector type + if self.type.is_const(): + return 'string_vec_byref_const' + return 'string_vec_byref' + + if self.type.is_result_vector_simple(): + if self.type.get_vector_type() != 'bool': + # simple/enumeration vector types + if self.type.is_const(): + return 'simple_vec_byref_const' + return 'simple_vec_byref' + + # boolean vector types + if self.type.is_const(): + return 'bool_vec_byref_const' + return 'bool_vec_byref' + + if self.type.is_result_vector_refptr(): + # refptr vector types + same_side = self.parent.is_same_side(self.type.get_refptr_type()) + if self.type.is_const(): + if same_side: + return 'refptr_vec_same_byref_const' + return 'refptr_vec_diff_byref_const' + if same_side: + return 'refptr_vec_same_byref' + return 'refptr_vec_diff_byref' + + + # string single map type + if self.type.is_result_map_single(): + if not self.type.is_byref(): + return 'invalid' + if self.type.is_const(): + return 'string_map_single_byref_const' + return 'string_map_single_byref' + + # string multi map type + if self.type.is_result_map_multi(): + if not self.type.is_byref(): + return 'invalid' + if self.type.is_const(): + return 'string_map_multi_byref_const' + return 'string_map_multi_byref' + + return 'invalid'; + + def get_retval_type(self): + """ Returns the retval type as defined in translator.README.txt. """ + if self.type.has_name(): + raise Exception('Cannot be called for argument types') + + # unsupported modifiers + if self.type.is_const() or self.type.is_byref() or \ + self.type.is_byaddr(): + return 'invalid' + + # void types don't have a return value + if self.type.get_type() == 'void': + return 'none' + + if (self.type.is_result_simple() and \ + self.type.get_type() != 'bool') or \ + (self.type.is_result_struct() and self.type.is_result_struct_enum()): + return 'simple' + + if self.type.get_type() == 'bool': + return 'bool' + + if self.type.is_result_string(): + return 'string' + + if self.type.is_result_refptr(): + if self.parent.is_same_side(self.type.get_refptr_type()): + return 'refptr_same' + else: + return 'refptr_diff' + + return 'invalid'; + + def get_retval_default(self, for_capi): + """ Returns the default return value based on the retval type. """ + # start with the default retval attribute, if any. + retval = self.get_attrib_default_retval() + if not retval is None: + if for_capi: + # apply any appropriate C API translations. + if retval == 'true': + return '1' + if retval == 'false': + return '0' + return retval; + + # next look at the retval type value. + type = self.get_retval_type() + if type == 'simple': + return self.get_type().get_result_simple_default() + elif type == 'bool': + if for_capi: + return '0' + return 'false' + elif type == 'string': + if for_capi: + return 'NULL' + return 'CefString()' + elif type == 'refptr_same' or type == 'refptr_diff': + return 'NULL' + + return '' class obj_analysis: """ Class representing an analysis of a data type value. """ @@ -930,6 +1265,8 @@ class obj_analysis: self.value = value self.result_type = 'unknown' self.result_value = None + self.result_default = None + self.refptr_type = None # parse the argument string partlist = string.split(string.strip(value)) @@ -996,10 +1333,11 @@ class obj_analysis: # check for vectors if value.find('std::vector') == 0: self.result_type = 'vector' - val = value[12:-1] + val = string.strip(value[12:-1]) self.result_value = [ self._get_basic(val) ] + self.result_value[0]['vector_type'] = val return True # check for maps @@ -1029,6 +1367,10 @@ class obj_analysis: if not basic is None: self.result_type = basic['result_type'] self.result_value = basic['result_value'] + if 'refptr_type' in basic: + self.refptr_type = basic['refptr_type'] + if 'result_default' in basic: + self.result_default = basic['result_default'] return True return False @@ -1043,27 +1385,28 @@ class obj_analysis: # check for simple direct translations simpletypes = { - 'void' : 'void', - 'int' : 'int', - 'int64' : 'int64', - 'uint64' : 'uint64', - 'double' : 'double', - 'long' : 'long', - 'unsigned long' : 'unsigned long', - 'size_t' : 'size_t', - 'time_t' : 'time_t', - 'bool' : 'int', - 'char* const': 'char* const', - 'CefCursorHandle' : 'cef_cursor_handle_t', - 'CefWindowHandle' : 'cef_window_handle_t', - 'CefRect' : 'cef_rect_t', - 'CefThreadId' : 'cef_thread_id_t', - 'CefTime' : 'cef_time_t', + 'void' : ['void', ''], + 'int' : ['int', '0'], + 'int64' : ['int64', '0'], + 'uint64' : ['uint64', '0'], + 'double' : ['double', '0'], + 'long' : ['long', '0'], + 'unsigned long' : ['unsigned long', '0'], + 'size_t' : ['size_t', '0'], + 'time_t' : ['time_t', '0'], + 'bool' : ['int', '0'], + 'char* const': ['char* const', 'NULL'], + 'CefCursorHandle' : ['cef_cursor_handle_t', 'NULL'], + 'CefWindowHandle' : ['cef_window_handle_t', 'NULL'], + 'CefRect' : ['cef_rect_t', 'CefRect()'], + 'CefThreadId' : ['cef_thread_id_t', 'TID_UI'], + 'CefTime' : ['cef_time_t', 'CefTime()'], } if value in simpletypes.keys(): return { 'result_type' : 'simple', - 'result_value' : simpletypes[value] + 'result_value' : simpletypes[value][0], + 'result_default' : simpletypes[value][1], } # check if already a C API structure @@ -1079,7 +1422,8 @@ class obj_analysis: if len(list) == 1: return { 'result_type' : 'refptr', - 'result_value' : get_capi_name(list[0], True)+'*' + 'result_value' : get_capi_name(list[0], True)+'*', + 'refptr_type' : list[0] } # check for CEF structure types @@ -1103,13 +1447,27 @@ class obj_analysis: return self.name def get_value(self): - """ Return the name. """ + """ Return the C++ value (type + name). """ return self.value def get_type(self): - """ Return the type. """ + """ Return the C++ type. """ return self.type + def get_refptr_type(self): + """ Return the C++ class type referenced by a CefRefPtr. """ + if self.is_result_vector() and self.is_result_vector_refptr(): + # return the vector RefPtr type + return self.result_value[0]['refptr_type'] + # return the basic RefPtr type + return self.refptr_type + + def get_vector_type(self): + """ Return the C++ class type referenced by a std::vector. """ + if self.is_result_vector(): + return self.result_value[0]['vector_type'] + return None + def is_const(self): """ Returns true if the argument value is constant. """ return self.isconst @@ -1126,6 +1484,10 @@ class obj_analysis: """ Returns true if this is a simple argument type. """ return (self.result_type == 'simple') + def get_result_simple_type_root(self): + """ Return the simple structure or basic type name. """ + return self.result_value + def get_result_simple_type(self): """ Return the simple type. """ result = '' @@ -1136,10 +1498,18 @@ class obj_analysis: result += '*' return result + def get_result_simple_default(self): + """ Return the default value fo the basic type. """ + return self.result_default + def is_result_refptr(self): """ Returns true if this is a reference pointer type. """ return (self.result_type == 'refptr') + def get_result_refptr_type_root(self): + """ Return the refptr type structure name. """ + return self.result_value[:-1] + def get_result_refptr_type(self, defined_structs = []): """ Return the refptr type. """ result = '' @@ -1154,12 +1524,19 @@ class obj_analysis: """ Returns true if this is a structure type. """ return (self.result_type == 'structure') + def is_result_struct_enum(self): + """ Returns true if this struct type is likely an enumeration. """ + # structure values that are passed by reference or address must be + # structures and not enumerations + if not self.is_byref() and not self.is_byaddr(): + return True + return False + def get_result_struct_type(self, defined_structs = []): """ Return the structure or enumeration type. """ result = '' - # structure values that are passed by reference or address must be - # structures and not enumerations - if self.is_byref() or self.is_byaddr(): + is_enum = self.is_result_struct_enum() + if not is_enum: if self.is_const(): result += 'const ' if not self.result_value in defined_structs: @@ -1167,7 +1544,7 @@ class obj_analysis: else: result += 'enum ' result += self.result_value - if self.is_byref() or self.is_byaddr(): + if not is_enum: result += '*' return result @@ -1192,6 +1569,22 @@ class obj_analysis: """ Returns true if this is a vector type. """ return (self.result_type == 'vector') + def is_result_vector_string(self): + """ Returns true if this is a string vector. """ + return self.result_value[0]['result_type'] == 'string' + + def is_result_vector_simple(self): + """ Returns true if this is a string vector. """ + return self.result_value[0]['result_type'] == 'simple' + + def is_result_vector_refptr(self): + """ Returns true if this is a string vector. """ + return self.result_value[0]['result_type'] == 'refptr' + + def get_result_vector_type_root(self): + """ Return the vector structure or basic type name. """ + return self.result_value[0]['result_value'] + def get_result_vector_type(self, defined_structs = []): """ Return the vector type. """ if not self.has_name(): @@ -1209,7 +1602,8 @@ class obj_analysis: if type == 'simple': str = value if self.is_const(): - str += ' const*' + str += ' const' + str += '*' result['value'] = str elif type == 'refptr': str = '' @@ -1217,25 +1611,29 @@ class obj_analysis: str += 'struct _' str += value if self.is_const(): - str += ' const*' + str += ' const' + str += '*' result['value'] = str else: raise Exception('Unsupported vector type: '+type) - if self.is_const(): - # const vector values must be passed as the value array parameter - # and a size parameter - result['format'] = 'multi-arg' - else: - # non-const vector values must be passed as one function to get the - # size and another function to get the element at a specified index - result['format'] = 'multi-func' + # vector values must be passed as a value array parameter + # and a size parameter + result['format'] = 'multi-arg' return result def is_result_map(self): """ Returns true if this is a map type. """ return (self.result_type == 'map' or self.result_type == 'multimap') + def is_result_map_single(self): + """ Returns true if this is a single map type. """ + return (self.result_type == 'map') + + def is_result_map_multi(self): + """ Returns true if this is a multi map type. """ + return (self.result_type == 'multimap') + def get_result_map_type(self, defined_structs = []): """ Return the map type. """ if not self.has_name(): @@ -1278,7 +1676,7 @@ class obj_analysis: format = resdict['format'] result += resdict['value'] - if self.has_name() and format != 'multi-func': + if self.has_name(): result += ' '+self.get_name(); return {'format' : format, 'value' : result} diff --git a/tools/make_capi_header.py b/tools/make_capi_header.py index 6be8ce1f0..746e60791 100644 --- a/tools/make_capi_header.py +++ b/tools/make_capi_header.py @@ -3,6 +3,7 @@ # can be found in the LICENSE file. from cef_parser import * +from date_util import * def make_capi_global_funcs(funcs, defined_names, translate_map, indent): result = '' @@ -45,7 +46,7 @@ def make_capi_header(header): # header string result = \ -"""// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +"""// Copyright (c) $YEAR$ Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -96,6 +97,8 @@ extern "C" { #include "internal/cef_types.h" """ + # add the copyright year + result = result.replace('$YEAR$', get_year()) # output global functions result += make_capi_global_funcs(header.get_funcs(), defined_names, diff --git a/tools/make_cpptoc_header.py b/tools/make_cpptoc_header.py index 696c5b88d..0fc9bba26 100644 --- a/tools/make_cpptoc_header.py +++ b/tools/make_cpptoc_header.py @@ -13,18 +13,8 @@ def make_cpptoc_header(header, clsname): defname = string.upper(clsname[3:]) capiname = cls.get_capi_name() - result = \ -"""// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights -// reserved. Use of this source code is governed by a BSD-style license that -// can be found in the LICENSE file. -// -// --------------------------------------------------------------------------- -// -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. -// -""" + result = get_copyright() + result += '#ifndef _'+defname+'_CPPTOC_H\n'+ \ '#define _'+defname+'_CPPTOC_H\n' diff --git a/tools/make_cpptoc_impl.py b/tools/make_cpptoc_impl.py index 07e0bf9c2..e3d366d72 100644 --- a/tools/make_cpptoc_impl.py +++ b/tools/make_cpptoc_impl.py @@ -11,49 +11,405 @@ def make_cpptoc_impl_proto(name, func, parts): proto = 'CEF_EXPORT '+parts['retval'] proto += ' '+name+'('+string.join(parts['args'], ', ')+')' - return wrap_code(proto) + return proto -def make_cpptoc_impl_existing(name, func, impl, defined_names): +def make_cpptoc_function_impl_existing(name, func, impl, defined_names): + notify(name+' has manual edits') + # retrieve the C API prototype parts parts = func.get_capi_parts(defined_names) changes = format_translation_changes(impl, parts) if len(changes) > 0: - notify('Changed prototype for '+name) + notify(name+' prototype changed') - return make_cpptoc_impl_proto(name, func, parts)+'{'+ \ + return wrap_code(make_cpptoc_impl_proto(name, func, parts))+'{'+ \ changes+impl['body']+'\n}\n\n' return result -def make_cpptoc_impl_new(name, func, defined_names): - notify('Added implementation for '+name) - +def make_cpptoc_function_impl_new(name, func, defined_names): # retrieve the C API prototype parts parts = func.get_capi_parts(defined_names) - result = make_cpptoc_impl_proto(name, func, parts)+'{' + result = make_cpptoc_impl_proto(name, func, parts)+'\n{' - result += '\n // BEGIN DELETE BEFORE MODIFYING' - result += '\n // AUTO-GENERATED CONTENT' + invalid = [] - result += '\n #pragma message("Warning: "__FILE__": '+name+' is not implemented")' + # retrieve the function arguments + args = func.get_arguments() + + # determine the argument types + for arg in args: + if arg.get_arg_type() == 'invalid': + invalid.append(arg.get_name()) + + # retrieve the function return value + retval = func.get_retval() + retval_type = retval.get_retval_type() + if retval_type == 'invalid': + invalid.append('(return value)') + retval_default = '' + else: + retval_default = retval.get_retval_default(True) + if len(retval_default) > 0: + retval_default = ' '+retval_default; + + if len(invalid) > 0: + notify(name+' could not be autogenerated') + # code could not be auto-generated + result += '\n // BEGIN DELETE BEFORE MODIFYING' + result += '\n // AUTO-GENERATED CONTENT' + result += '\n // COULD NOT IMPLEMENT DUE TO: '+string.join(invalid, ', ') + result += '\n #pragma message("Warning: "__FILE__": '+name+' is not implemented")' + result += '\n // END DELETE BEFORE MODIFYING' + result += '\n}\n\n' + return wrap_code(result) + + result += '\n // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING\n' + + result_len = len(result) + + optional = [] + + # parameter verification + if isinstance(func, obj_function_virtual): + result += '\n DCHECK(self);'\ + '\n if (!self)'\ + '\n return'+retval_default+';' + + for arg in args: + arg_type = arg.get_arg_type() + arg_name = arg.get_type().get_name() + + # skip optional params + optional_params = arg.parent.get_attrib_list('optional_param') + if not optional_params is None and arg_name in optional_params: + optional.append(arg_name) + continue + + comment = '\n // Verify param: '+arg_name+'; type: '+arg_type - result += '\n // END DELETE BEFORE MODIFYING' - - # NULL check all pointer arguments. - if len(parts['args']) > 0: - check = []; - for arg in parts['args']: - if arg.find('*') >= 0: - argname = string.split(arg)[-1]; - result += '\n DCHECK('+argname+');' - check.append('!'+argname); - result += '\n if ('+string.join(check,' || ')+')' - result += '\n return;' - - result += '\n}\n\n' - return result + if arg_type == 'simple_byref' or arg_type == 'simple_byref_const' or \ + arg_type == 'simple_byaddr' or arg_type == 'bool_byref' or arg_type == 'bool_byaddr' or \ + arg_type == 'struct_byref_const' or arg_type == 'struct_byref' or \ + arg_type == 'string_byref_const' or arg_type == 'string_byref' or \ + arg_type == 'refptr_same' or arg_type == 'refptr_same_byref' or \ + arg_type == 'refptr_diff' or arg_type == 'refptr_diff_byref' or \ + arg_type == 'string_vec_byref' or arg_type == 'string_vec_byref_const' or \ + arg_type == 'string_map_single_byref' or arg_type == 'string_map_single_byref_const' or \ + arg_type == 'string_map_multi_byref' or arg_type == 'string_map_multi_byref_const': + result += comment+\ + '\n DCHECK('+arg_name+');'\ + '\n if (!'+arg_name+')'\ + '\n return'+retval_default+';' + elif arg_type == 'simple_vec_byref' or arg_type == 'bool_vec_byref' or \ + arg_type == 'refptr_vec_same_byref' or arg_type == 'refptr_vec_diff_byref': + result += comment+\ + '\n DCHECK('+arg_name+'Count && (*'+arg_name+'Count == 0 || '+arg_name+'));'\ + '\n if (!'+arg_name+'Count || (*'+arg_name+'Count > 0 && !'+arg_name+'))'\ + '\n return'+retval_default+';' + elif arg_type == 'simple_vec_byref_const' or arg_type == 'bool_vec_byref_const' or \ + arg_type == 'refptr_vec_same_byref_const' or arg_type == 'refptr_vec_diff_byref_const': + result += comment+\ + '\n DCHECK('+arg_name+'Count == 0 || '+arg_name+');'\ + '\n if ('+arg_name+'Count > 0 && !'+arg_name+')'\ + '\n return'+retval_default+';' -def make_cpptoc_impl(header, clsname, impl): + if len(optional) > 0: + result += '\n // Unverified params: '+string.join(optional,', ') + + if len(result) != result_len: + result += '\n' + result_len = len(result) + + # parameter translation + params = [] + + for arg in args: + arg_type = arg.get_arg_type() + arg_name = arg.get_type().get_name() + + comment = '\n // Translate param: '+arg_name+'; type: '+arg_type + + if arg_type == 'simple_byval' or arg_type == 'simple_byaddr': + params.append(arg_name) + elif arg_type == 'simple_byref' or arg_type == 'simple_byref_const': + data_type = arg.get_type().get_type() + default = arg.get_type().get_result_simple_default() + result += comment+\ + '\n '+data_type+' '+arg_name+'Val = '+arg_name+'?*'+arg_name+':'+default+';' + params.append(arg_name+'Val') + elif arg_type == 'bool_byval': + params.append(arg_name+'?true:false') + elif arg_type == 'bool_byref' or arg_type == 'bool_byaddr': + result += comment+\ + '\n bool '+arg_name+'Bool = ('+arg_name+' && *'+arg_name+')?true:false;' + if arg_type == 'bool_byref': + params.append(arg_name+'Bool') + else: + params.append('&'+arg_name+'Bool') + elif arg_type == 'struct_byref_const': + struct_type = arg.get_type().get_type() + result += comment+\ + '\n '+struct_type+' '+arg_name+'Obj;'\ + '\n if ('+arg_name+')'\ + '\n '+arg_name+'Obj.Set(*'+arg_name+', false);' + params.append(arg_name+'Obj') + elif arg_type == 'struct_byref': + struct_type = arg.get_type().get_type() + result += comment+\ + '\n '+struct_type+' '+arg_name+'Obj;'\ + '\n if ('+arg_name+')'\ + '\n '+arg_name+'Obj.AttachTo(*'+arg_name+');' + params.append(arg_name+'Obj') + elif arg_type == 'string_byref_const': + params.append('CefString('+arg_name+')') + elif arg_type == 'string_byref': + result += comment+\ + '\n CefString '+arg_name+'Str('+arg_name+');' + params.append(arg_name+'Str') + elif arg_type == 'refptr_same' or arg_type == 'refptr_diff': + refptr_class = arg.get_type().get_refptr_type() + if arg_type == 'refptr_same': + params.append(refptr_class+'CppToC::Unwrap('+arg_name+')') + else: + params.append(refptr_class+'CToCpp::Wrap('+arg_name+')') + elif arg_type == 'refptr_same_byref' or arg_type == 'refptr_diff_byref': + refptr_class = arg.get_type().get_refptr_type() + if arg_type == 'refptr_same_byref': + assign = refptr_class+'CppToC::Unwrap(*'+arg_name+')' + else: + assign = refptr_class+'CToCpp::Wrap(*'+arg_name+')' + result += comment+\ + '\n CefRefPtr<'+refptr_class+'> '+arg_name+'Ptr;'\ + '\n if ('+arg_name+' && *'+arg_name+')'\ + '\n '+arg_name+'Ptr = '+assign+';'\ + '\n '+refptr_class+'* '+arg_name+'Orig = '+arg_name+'Ptr.get();' + params.append(arg_name+'Ptr') + elif arg_type == 'string_vec_byref' or arg_type == 'string_vec_byref_const': + result += comment+\ + '\n std::vector '+arg_name+'List;'\ + '\n transfer_string_list_contents('+arg_name+', '+arg_name+'List);' + params.append(arg_name+'List') + elif arg_type == 'string_map_single_byref' or arg_type == 'string_map_single_byref_const': + result += comment+\ + '\n std::map '+arg_name+'Map;'\ + '\n transfer_string_map_contents('+arg_name+', '+arg_name+'Map);' + params.append(arg_name+'Map') + elif arg_type == 'string_map_multi_byref' or arg_type == 'string_map_multi_byref_const': + result += comment+\ + '\n std::multimap '+arg_name+'Multimap;'\ + '\n transfer_string_multimap_contents('+arg_name+', '+arg_name+'Multimap);' + params.append(arg_name+'Multimap') + elif arg_type == 'simple_vec_byref' or arg_type == 'bool_vec_byref' or \ + arg_type == 'refptr_vec_same_byref' or arg_type == 'refptr_vec_diff_byref': + vec_type = arg.get_type().get_vector_type() + if arg_type == 'simple_vec_byref': + assign = arg_name+'[i]' + elif arg_type == 'bool_vec_byref': + assign = arg_name+'[i]?true:false' + elif arg_type == 'refptr_vec_same_byref': + refptr_class = arg.get_type().get_refptr_type() + assign = refptr_class+'CppToC::Unwrap('+arg_name+'[i])' + elif arg_type == 'refptr_vec_diff_byref': + refptr_class = arg.get_type().get_refptr_type() + assign = refptr_class+'CToCpp::Wrap('+arg_name+'[i])' + result += comment+\ + '\n std::vector<'+vec_type+' > '+arg_name+'List;'\ + '\n if ('+arg_name+'Count && *'+arg_name+'Count > 0 && '+arg_name+') {'\ + '\n for (size_t i = 0; i < *'+arg_name+'Count; ++i) {'\ + '\n '+arg_name+'List.push_back('+assign+');'\ + '\n }'\ + '\n }' + params.append(arg_name+'List') + elif arg_type == 'simple_vec_byref_const' or arg_type == 'bool_vec_byref_const' or \ + arg_type == 'refptr_vec_same_byref_const' or arg_type == 'refptr_vec_diff_byref_const': + vec_type = arg.get_type().get_vector_type() + if arg_type == 'simple_vec_byref_const': + assign = arg_name+'[i]' + elif arg_type == 'bool_vec_byref_const': + assign = arg_name+'[i]?true:false' + elif arg_type == 'refptr_vec_same_byref_const': + refptr_class = arg.get_type().get_refptr_type() + assign = refptr_class+'CppToC::Unwrap('+arg_name+'[i])' + elif arg_type == 'refptr_vec_diff_byref_const': + refptr_class = arg.get_type().get_refptr_type() + assign = refptr_class+'CToCpp::Wrap('+arg_name+'[i])' + result += comment+\ + '\n std::vector<'+vec_type+' > '+arg_name+'List;'\ + '\n if ('+arg_name+'Count > 0) {'\ + '\n for (size_t i = 0; i < '+arg_name+'Count; ++i) {'\ + '\n '+arg_name+'List.push_back('+assign+');'\ + '\n }'\ + '\n }' + params.append(arg_name+'List') + + if len(result) != result_len: + result += '\n' + result_len = len(result) + + # execution + result += '\n // Execute\n ' + + if retval_type != 'none': + # has a return value + if retval_type == 'simple': + result += retval.get_type().get_result_simple_type() + else: + result += retval.get_type().get_type() + result += ' _retval = ' + + if isinstance(func.parent, obj_class): + # virtual and static class methods + if isinstance(func, obj_function_virtual): + result += func.parent.get_name()+'CppToC::Get(self)->' + else: + result += func.parent.get_name()+'::' + result += func.get_name()+'(' + + if len(params) > 0: + result += '\n '+string.join(params,',\n ') + + result += ');\n' + + result_len = len(result) + + # parameter restoration + for arg in args: + arg_type = arg.get_arg_type() + arg_name = arg.get_type().get_name() + + comment = '\n // Restore param: '+arg_name+'; type: '+arg_type + + if arg_type == 'simple_byref': + result += comment+\ + '\n if ('+arg_name+')'\ + '\n *'+arg_name+' = '+arg_name+'Val;' + elif arg_type == 'bool_byref' or arg_type == 'bool_byaddr': + result += comment+\ + '\n if ('+arg_name+')'\ + '\n *'+arg_name+' = '+arg_name+'Bool?true:false;' + elif arg_type == 'struct_byref': + result += comment+\ + '\n if ('+arg_name+')'\ + '\n '+arg_name+'Obj.DetachTo(*'+arg_name+');' + elif arg_type == 'refptr_same_byref' or arg_type == 'refptr_diff_byref': + refptr_class = arg.get_type().get_refptr_type() + if arg_type == 'refptr_same_byref': + assign = refptr_class+'CppToC::Wrap('+arg_name+'Ptr)' + else: + assign = refptr_class+'CToCpp::Unwrap('+arg_name+'Ptr)' + result += comment+\ + '\n if ('+arg_name+') {'\ + '\n if ('+arg_name+'Ptr.get()) {'\ + '\n if ('+arg_name+'Ptr.get() != '+arg_name+'Orig) {'\ + '\n *'+arg_name+' = '+assign+';'\ + '\n }'\ + '\n } else {'\ + '\n *'+arg_name+' = NULL;'\ + '\n }'\ + '\n }' + elif arg_type == 'string_vec_byref': + result += comment+\ + '\n cef_string_list_clear('+arg_name+');'\ + '\n transfer_string_list_contents('+arg_name+'List, '+arg_name+');' + elif arg_type == 'string_map_single_byref': + result += comment+\ + '\n cef_string_map_clear('+arg_name+');'\ + '\n transfer_string_map_contents('+arg_name+'Map, '+arg_name+');' + elif arg_type == 'string_map_multi_byref': + result += comment+\ + '\n cef_string_multimap_clear('+arg_name+');'\ + '\n transfer_string_multimap_contents('+arg_name+'Multimap, '+arg_name+');' + elif arg_type == 'simple_vec_byref' or arg_type == 'bool_vec_byref' or \ + arg_type == 'refptr_vec_same_byref' or arg_type == 'refptr_vec_diff_byref': + if arg_type == 'simple_vec_byref' or arg_type == 'bool_vec_byref': + assign = arg_name+'List[i]' + elif arg_type == 'refptr_vec_same_byref': + refptr_class = arg.get_type().get_refptr_type() + assign = refptr_class+'CppToC::Wrap('+arg_name+'List[i])' + elif arg_type == 'refptr_vec_diff_byref': + refptr_class = arg.get_type().get_refptr_type() + assign = refptr_class+'CToCpp::Unwrap('+arg_name+'List[i])' + result += comment+\ + '\n if ('+arg_name+'Count && '+arg_name+') {'\ + '\n *'+arg_name+'Count = std::min('+arg_name+'List.size(), *'+arg_name+'Count);'\ + '\n if (*'+arg_name+'Count > 0) {'\ + '\n for (size_t i = 0; i < *'+arg_name+'Count; ++i) {'\ + '\n '+arg_name+'[i] = '+assign+';'\ + '\n }'\ + '\n }'\ + '\n }' + + if len(result) != result_len: + result += '\n' + result_len = len(result) + + # special handling for the global cef_shutdown function + if name == 'cef_shutdown' and isinstance(func.parent, obj_header): + classes = func.parent.get_classes() + + names = [] + for cls in classes: + if cls.has_attrib('no_debugct_check'): + continue; + + if cls.is_library_side(): + names.append(cls.get_name()+'CppToC') + else: + names.append(cls.get_name()+'CToCpp') + + if len(names) > 0: + names = sorted(names) + result += '\n#ifndef NDEBUG'\ + '\n // Check that all wrapper objects have been destroyed' + for name in names: + result += '\n DCHECK('+name+'::DebugObjCt == 0);'; + result += '\n#endif // !NDEBUG' + + if len(result) != result_len: + result += '\n' + result_len = len(result) + + # return translation + if retval_type != 'none': + # has a return value + result += '\n // Return type: '+retval_type + if retval_type == 'simple' or retval_type == 'bool': + result += '\n return _retval;' + elif retval_type == 'string': + result += '\n return _retval.DetachToUserFree();' + elif retval_type == 'refptr_same': + refptr_class = retval.get_type().get_refptr_type() + result += '\n return '+refptr_class+'CppToC::Wrap(_retval);' + elif retval_type == 'refptr_diff': + refptr_class = retval.get_type().get_refptr_type() + result += '\n return '+refptr_class+'CToCpp::Unwrap(_retval);' + + if len(result) != result_len: + result += '\n' + + result += '}\n\n' + return wrap_code(result) + +def make_cpptoc_function_impl(funcs, existing, prefixname, defined_names): + impl = '' + + for func in funcs: + if not prefixname is None: + name = prefixname+'_'+func.get_capi_name() + else: + name = func.get_capi_name() + value = get_next_function_impl(existing, name) + if not value is None \ + and value['body'].find('// AUTO-GENERATED CONTENT') < 0: + # an implementation exists that was not auto-generated + impl += make_cpptoc_function_impl_existing(name, func, value, defined_names) + else: + impl += make_cpptoc_function_impl_new(name, func, defined_names) + + return impl + +def make_cpptoc_class_impl(header, clsname, impl): # structure names that have already been defined defined_names = header.get_defined_structs() @@ -62,7 +418,6 @@ def make_cpptoc_impl(header, clsname, impl): if cls is None: raise Exception('Class does not exist: '+clsname) - defname = string.upper(clsname[3:]) capiname = cls.get_capi_name() prefixname = get_capi_name(clsname[3:], False) @@ -70,19 +425,7 @@ def make_cpptoc_impl(header, clsname, impl): existing = get_function_impls(impl, 'CEF_CALLBACK') # generate virtual functions - virtualimpl = '' - funcs = cls.get_virtual_funcs() - for func in funcs: - name = prefixname+'_'+func.get_capi_name() - value = get_next_function_impl(existing, name) - if not value is None \ - and value['body'].find('// AUTO-GEN') < 0: - # an implementation exists that was not auto-generated - virtualimpl += make_cpptoc_impl_existing(name, func, value, - defined_names) - else: - virtualimpl += make_cpptoc_impl_new(name, func, defined_names) - + virtualimpl = make_cpptoc_function_impl(cls.get_virtual_funcs(), existing, prefixname, defined_names) if len(virtualimpl) > 0: virtualimpl = '\n// MEMBER FUNCTIONS - Body may be edited by hand.\n\n'+virtualimpl @@ -93,19 +436,7 @@ def make_cpptoc_impl(header, clsname, impl): existing = get_function_impls(impl, 'CEF_EXPORT') # generate static functions - staticimpl = '' - funcs = cls.get_static_funcs() - for func in funcs: - name = func.get_capi_name() - value = get_next_function_impl(existing, name) - if not value is None \ - and value['body'].find('// AUTO-GENERATED CONTENT') < 0: - # an implementation exists that was not auto-generated - staticimpl += make_cpptoc_impl_existing(name, func, value, - defined_names) - else: - staticimpl += make_cpptoc_impl_new(name, func, defined_names) - + staticimpl = make_cpptoc_function_impl(cls.get_static_funcs(), existing, None, defined_names) if len(staticimpl) > 0: staticimpl = '\n// GLOBAL FUNCTIONS - Body may be edited by hand.\n\n'+staticimpl @@ -116,21 +447,8 @@ def make_cpptoc_impl(header, clsname, impl): includes = format_translation_includes(resultingimpl) # build the final output - result = \ -"""// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights -// reserved. Use of this source code is governed by a BSD-style license that -// can be found in the LICENSE file. -// -// --------------------------------------------------------------------------- -// -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing function -// implementations. See the translator.README.txt file in the tools directory -// for more information. -// + result = get_copyright() -""" - result += includes+'\n'+resultingimpl+'\n' const = '// CONSTRUCTOR - Do not edit by hand.\n\n'+ \ @@ -151,16 +469,46 @@ def make_cpptoc_impl(header, clsname, impl): return result +def make_cpptoc_global_impl(header, impl): + # structure names that have already been defined + defined_names = header.get_defined_structs() + + # retrieve the existing global function implementations + existing = get_function_impls(impl, 'CEF_EXPORT') + + # generate global functions + impl = make_cpptoc_function_impl(header.get_funcs(), existing, None, defined_names) + if len(impl) > 0: + impl = '\n// GLOBAL FUNCTIONS - Body may be edited by hand.\n\n'+impl + + # determine what includes are required by identifying what translation + # classes are being used + includes = format_translation_includes(impl) + + # build the final output + result = get_copyright() + + result += includes+'\n'+impl + + return result def write_cpptoc_impl(header, clsname, dir, backup): - file = dir+os.sep+get_capi_name(clsname[3:], False)+'_cpptoc.cc' + if clsname is None: + # global file + file = dir + else: + # class file + file = dir+os.sep+get_capi_name(clsname[3:], False)+'_cpptoc.cc' if path_exists(file): oldcontents = read_file(file) else: oldcontents = '' - newcontents = make_cpptoc_impl(header, clsname, oldcontents) + if clsname is None: + newcontents = make_cpptoc_global_impl(header, oldcontents) + else: + newcontents = make_cpptoc_class_impl(header, clsname, oldcontents) if newcontents != oldcontents: if backup and oldcontents != '': backup_file(file) diff --git a/tools/make_ctocpp_header.py b/tools/make_ctocpp_header.py index cbb66df42..1b08cf7cc 100644 --- a/tools/make_ctocpp_header.py +++ b/tools/make_ctocpp_header.py @@ -13,19 +13,8 @@ def make_ctocpp_header(header, clsname): defname = string.upper(clsname[3:]) capiname = cls.get_capi_name() - result = \ -"""// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights -// reserved. Use of this source code is governed by a BSD-style license that -// can be found in the LICENSE file. -// -// ------------------------------------------------------------------------- -// -// This file was generated by the CEF translator tool and should not edited -// by hand. See the translator.README.txt file in the tools directory for -// more information. -// + result = get_copyright() -""" result += '#ifndef _'+defname+'_CTOCPP_H\n'+ \ '#define _'+defname+'_CTOCPP_H\n' diff --git a/tools/make_ctocpp_impl.py b/tools/make_ctocpp_impl.py index 9cba5ff6d..a74cb56e2 100644 --- a/tools/make_ctocpp_impl.py +++ b/tools/make_ctocpp_impl.py @@ -5,54 +5,442 @@ from cef_parser import * def make_ctocpp_impl_proto(clsname, name, func, parts): - proto = parts['retval']+' '+clsname const = '' - if isinstance(func, obj_function_virtual): - proto += 'CToCpp' - if func.is_const(): - const = ' const' - proto += '::'+name+'('+string.join(parts['args'], ', ')+')'+const - return wrap_code(proto) + if clsname is None: + proto = 'CEF_GLOBAL '+parts['retval']+' ' + else: + proto = parts['retval']+' '+clsname + if isinstance(func, obj_function_virtual): + proto += 'CToCpp' + if func.is_const(): + const = ' const' + + proto += '::' + + proto += name+'('+string.join(parts['args'], ', ')+')'+const + return proto -def make_ctocpp_impl_existing(clsname, name, func, impl): +def make_ctocpp_function_impl_existing(clsname, name, func, impl): + notify(name+' has manual edits') + # retrieve the C++ prototype parts parts = func.get_cpp_parts(True) changes = format_translation_changes(impl, parts) if len(changes) > 0: - if isinstance(func, obj_function_virtual): - notify('Changed prototype for '+clsname+'CToCpp::'+name) - else: - notify('Changed prototype for '+clsname+'::'+name) + notify(name+' prototype changed') - return make_ctocpp_impl_proto(clsname, name, func, parts)+'{'+ \ + return wrap_code(make_ctocpp_impl_proto(clsname, name, func, parts))+'{'+ \ changes+impl['body']+'\n}\n\n' -def make_ctocpp_impl_new(clsname, name, func): - if isinstance(func, obj_function_virtual): - notify('Added implementation for '+clsname+'CToCpp::'+name) - else: - notify('Added implementation for '+clsname+'::'+name) - - # retrieve the C++ prototype parts +def make_ctocpp_function_impl_new(clsname, name, func): + # build the C++ prototype parts = func.get_cpp_parts(True) - result = make_ctocpp_impl_proto(clsname, name, func, parts)+'{' + result = make_ctocpp_impl_proto(clsname, name, func, parts)+'\n{' - result += '\n // BEGIN DELETE BEFORE MODIFYING' - result += '\n // AUTO-GENERATED CONTENT' + invalid = [] - result += '\n #pragma message("Warning: "__FILE__": '+name+' is not implemented")' + # retrieve the function arguments + args = func.get_arguments() + + # determine the argument types + for arg in args: + if arg.get_arg_type() == 'invalid': + invalid.append(arg.get_name()) + + # retrieve the function return value + retval = func.get_retval() + retval_type = retval.get_retval_type() + if retval_type == 'invalid': + invalid.append('(return value)') + retval_default = '' + else: + retval_default = retval.get_retval_default(False) + if len(retval_default) > 0: + retval_default = ' '+retval_default; + + # add revision check + if func.has_attrib('revision_check'): + result += '\n int build_revision = cef_build_revision();'\ + '\n if (build_revision != CEF_REVISION) {'\ + '\n // The libcef build revision does not match the CEF API revision.'\ + '\n DCHECK(false);'\ + '\n return'+retval_default+';'\ + '\n }\n' + + if isinstance(func, obj_function_virtual): + # add the structure size check + result += '\n if (CEF_MEMBER_MISSING(struct_, '+func.get_capi_name()+'))' + result += '\n return'+retval_default+';\n' - result += '\n // END DELETE BEFORE MODIFYING' + if len(invalid) > 0: + notify(name+' could not be autogenerated') + # code could not be auto-generated + result += '\n // BEGIN DELETE BEFORE MODIFYING' + result += '\n // AUTO-GENERATED CONTENT' + result += '\n // COULD NOT IMPLEMENT DUE TO: '+string.join(invalid, ', ') + result += '\n #pragma message("Warning: "__FILE__": '+name+' is not implemented")' + result += '\n // END DELETE BEFORE MODIFYING' + result += '\n}\n\n' + return wrap_code(result) - result += '\n if (CEF_MEMBER_MISSING(struct_, '+func.get_capi_name()+'))' - result += '\n return;' + result += '\n // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING\n' - result += '\n}\n\n' - return result + result_len = len(result) + + optional = [] + + # parameter verification + for arg in args: + arg_type = arg.get_arg_type() + arg_name = arg.get_type().get_name() + + # skip optional params + optional_params = arg.parent.get_attrib_list('optional_param') + if not optional_params is None and arg_name in optional_params: + optional.append(arg_name) + continue + + comment = '\n // Verify param: '+arg_name+'; type: '+arg_type -def make_ctocpp_impl(header, clsname, impl): + if arg_type == 'simple_byaddr' or arg_type == 'bool_byaddr': + result += comment+\ + '\n DCHECK('+arg_name+');'\ + '\n if (!'+arg_name+')'\ + '\n return'+retval_default+';' + elif arg_type == 'refptr_same' or arg_type == 'refptr_diff': + result += comment+\ + '\n DCHECK('+arg_name+'.get());'\ + '\n if (!'+arg_name+'.get())'\ + '\n return'+retval_default+';' + elif arg_type == 'string_byref_const': + result += comment+\ + '\n DCHECK(!'+arg_name+'.empty());'\ + '\n if ('+arg_name+'.empty())'\ + '\n return'+retval_default+';' + + if len(optional) > 0: + result += '\n // Unverified params: '+string.join(optional,', ') + + if len(result) != result_len: + result += '\n' + result_len = len(result) + + # parameter translation + params = [] + if isinstance(func, obj_function_virtual): + params.append('struct_') + + for arg in args: + arg_type = arg.get_arg_type() + arg_name = arg.get_type().get_name() + + comment = '\n // Translate param: '+arg_name+'; type: '+arg_type + + if arg_type == 'simple_byval' or arg_type == 'simple_byaddr' or \ + arg_type == 'bool_byval': + params.append(arg_name) + elif arg_type == 'simple_byref' or arg_type == 'simple_byref_const' or \ + arg_type == 'struct_byref_const' or arg_type == 'struct_byref': + params.append('&'+arg_name) + elif arg_type == 'bool_byref': + result += comment+\ + '\n int '+arg_name+'Int = '+arg_name+';' + params.append('&'+arg_name+'Int') + elif arg_type == 'bool_byaddr': + result += comment+\ + '\n int '+arg_name+'Int = '+arg_name+'?*'+arg_name+':0;' + params.append('&'+arg_name+'Int') + elif arg_type == 'string_byref_const': + params.append(arg_name+'.GetStruct()') + elif arg_type == 'string_byref': + params.append(arg_name+'.GetWritableStruct()') + elif arg_type == 'refptr_same': + refptr_class = arg.get_type().get_refptr_type() + params.append(refptr_class+'CToCpp::Unwrap('+arg_name+')') + elif arg_type == 'refptr_diff': + refptr_class = arg.get_type().get_refptr_type() + params.append(refptr_class+'CppToC::Wrap('+arg_name+')') + elif arg_type == 'refptr_same_byref' or arg_type == 'refptr_diff_byref': + refptr_class = arg.get_type().get_refptr_type() + refptr_struct = arg.get_type().get_result_refptr_type_root() + if arg_type == 'refptr_same_byref': + assign = refptr_class+'CToCpp::Unwrap('+arg_name+')' + else: + assign = refptr_class+'CppToC::Wrap('+arg_name+')' + result += comment+\ + '\n '+refptr_struct+'* '+arg_name+'Struct = NULL;'\ + '\n if('+arg_name+'.get())'\ + '\n '+arg_name+'Struct = '+assign+';'\ + '\n '+refptr_struct+'* '+arg_name+'Orig = '+arg_name+'Struct;' + params.append('&'+arg_name+'Struct') + elif arg_type == 'string_vec_byref' or arg_type == 'string_vec_byref_const': + result += comment+\ + '\n cef_string_list_t '+arg_name+'List = cef_string_list_alloc();'\ + '\n DCHECK('+arg_name+'List);'\ + '\n if ('+arg_name+'List)'\ + '\n transfer_string_list_contents('+arg_name+', '+arg_name+'List);' + params.append(arg_name+'List') + elif arg_type == 'string_map_single_byref' or arg_type == 'string_map_single_byref_const': + result += comment+\ + '\n cef_string_map_t '+arg_name+'Map = cef_string_map_alloc();'\ + '\n DCHECK('+arg_name+'Map);'\ + '\n if ('+arg_name+'Map)'\ + '\n transfer_string_map_contents('+arg_name+', '+arg_name+'Map);' + params.append(arg_name+'Map') + elif arg_type == 'string_map_multi_byref' or arg_type == 'string_map_multi_byref_const': + result += comment+\ + '\n cef_string_multimap_t '+arg_name+'Multimap = cef_string_multimap_alloc();'\ + '\n DCHECK('+arg_name+'Multimap);'\ + '\n if ('+arg_name+'Multimap)'\ + '\n transfer_string_multimap_contents('+arg_name+', '+arg_name+'Multimap);' + params.append(arg_name+'Multimap') + elif arg_type == 'simple_vec_byref' or arg_type == 'bool_vec_byref' or \ + arg_type == 'refptr_vec_same_byref' or arg_type == 'refptr_vec_diff_byref': + count_func = arg.get_attrib_count_func() + vec_type = arg.get_type().get_result_vector_type_root() + if arg_type == 'refptr_vec_same_byref': + refptr_class = arg.get_type().get_refptr_type() + assign = refptr_class+'CToCpp::Unwrap('+arg_name+'[i])' + elif arg_type == 'refptr_vec_diff_byref': + refptr_class = arg.get_type().get_refptr_type() + assign = refptr_class+'CppToC::Wrap('+arg_name+'[i])' + else: + assign = arg_name+'[i]' + result += comment+\ + '\n size_t '+arg_name+'Size = '+arg_name+'.size();'\ + '\n size_t '+arg_name+'Count = std::max('+count_func+'(), '+arg_name+'Size);'\ + '\n '+vec_type+'* '+arg_name+'List = NULL;'\ + '\n if ('+arg_name+'Count > 0) {'\ + '\n '+arg_name+'List = new '+vec_type+'['+arg_name+'Count];'\ + '\n DCHECK('+arg_name+'List);'\ + '\n if ('+arg_name+'List) {'\ + '\n memset('+arg_name+'List, 0, sizeof('+vec_type+')*'+arg_name+'Count);'\ + '\n }'\ + '\n if ('+arg_name+'List && '+arg_name+'Size > 0) {'\ + '\n for (size_t i = 0; i < '+arg_name+'Size; ++i) {'\ + '\n '+arg_name+'List[i] = '+assign+';'\ + '\n }'\ + '\n }'\ + '\n }' + params.append('&'+arg_name+'Count') + params.append(arg_name+'List') + elif arg_type == 'simple_vec_byref_const' or arg_type == 'bool_vec_byref_const' or \ + arg_type == 'refptr_vec_same_byref_const' or arg_type == 'refptr_vec_diff_byref_const': + count_func = arg.get_attrib_count_func() + vec_type = arg.get_type().get_result_vector_type_root() + if arg_type == 'refptr_vec_same_byref_const': + refptr_class = arg.get_type().get_refptr_type() + assign = refptr_class+'CToCpp::Unwrap('+arg_name+'[i])' + elif arg_type == 'refptr_vec_diff_byref_const': + refptr_class = arg.get_type().get_refptr_type() + assign = refptr_class+'CppToC::Wrap('+arg_name+'[i])' + else: + assign = arg_name+'[i]' + result += comment+\ + '\n const size_t '+arg_name+'Count = '+arg_name+'.size();'\ + '\n '+vec_type+'* '+arg_name+'List = NULL;'\ + '\n if ('+arg_name+'Count > 0) {'\ + '\n '+arg_name+'List = new '+vec_type+'['+arg_name+'Count];'\ + '\n DCHECK('+arg_name+'List);'\ + '\n if ('+arg_name+'List) {'\ + '\n for (size_t i = 0; i < '+arg_name+'Count; ++i) {'\ + '\n '+arg_name+'List[i] = '+assign+';'\ + '\n }'\ + '\n }'\ + '\n }' + params.append(arg_name+'Count') + params.append(arg_name+'List') + + if len(result) != result_len: + result += '\n' + result_len = len(result) + + # execution + result += '\n // Execute\n ' + + if retval_type != 'none': + # has a return value + if retval_type == 'simple' or retval_type == 'bool': + result += retval.get_type().get_result_simple_type_root() + elif retval_type == 'string': + result += 'cef_string_userfree_t' + elif retval_type == 'refptr_same' or retval_type == 'refptr_diff': + refptr_struct = retval.get_type().get_result_refptr_type_root() + result += refptr_struct+'*' + + result += ' _retval = ' + + if isinstance(func, obj_function_virtual): + result += 'struct_->' + result += func.get_capi_name()+'(' + + if len(params) > 0: + if not isinstance(func, obj_function_virtual): + result += '\n ' + result += string.join(params,',\n ') + + result += ');\n' + + result_len = len(result) + + # parameter restoration + for arg in args: + arg_type = arg.get_arg_type() + arg_name = arg.get_type().get_name() + + comment = '\n // Restore param:'+arg_name+'; type: '+arg_type + + if arg_type == 'bool_byref': + result += comment+\ + '\n '+arg_name+' = '+arg_name+'Int?true:false;' + elif arg_type == 'bool_byaddr': + result += comment+\ + '\n if ('+arg_name+')'\ + '\n *'+arg_name+' = '+arg_name+'Int?true:false;' + elif arg_type == 'refptr_same_byref' or arg_type == 'refptr_diff_byref': + refptr_class = arg.get_type().get_refptr_type() + refptr_struct = arg.get_type().get_result_refptr_type_root() + if arg_type == 'refptr_same_byref': + assign = refptr_class+'CToCpp::Wrap('+arg_name+'Struct)' + else: + assign = refptr_class+'CppToC::Unwrap('+arg_name+'Struct)' + result += comment+\ + '\n if ('+arg_name+'Struct) {'\ + '\n if ('+arg_name+'Struct != '+arg_name+'Orig) {'\ + '\n '+arg_name+' = '+assign+';'\ + '\n }'\ + '\n } else {'\ + '\n '+arg_name+' = NULL;'\ + '\n }' + elif arg_type == 'string_vec_byref': + result += comment+\ + '\n if ('+arg_name+'List) {'\ + '\n '+arg_name+'.clear();'\ + '\n transfer_string_list_contents('+arg_name+'List, '+arg_name+');'\ + '\n cef_string_list_free('+arg_name+'List);'\ + '\n }' + elif arg_type == 'string_vec_byref_const': + result += comment+\ + '\n if ('+arg_name+'List)'\ + '\n cef_string_list_free('+arg_name+'List);' + elif arg_type == 'string_map_single_byref': + result += comment+\ + '\n if ('+arg_name+'Map) {'\ + '\n '+arg_name+'.clear();'\ + '\n transfer_string_map_contents('+arg_name+'Map, '+arg_name+');'\ + '\n cef_string_map_free('+arg_name+'Map);'\ + '\n }' + elif arg_type == 'string_map_single_byref_const': + result += comment+\ + '\n if ('+arg_name+'Map)'\ + '\n cef_string_map_free('+arg_name+'Map);' + elif arg_type == 'string_map_multi_byref': + result += comment+\ + '\n if ('+arg_name+'Multimap) {'\ + '\n '+arg_name+'.clear();'\ + '\n transfer_string_multimap_contents('+arg_name+'Multimap, '+arg_name+');'\ + '\n cef_string_multimap_free('+arg_name+'Multimap);'\ + '\n }' + elif arg_type == 'string_map_multi_byref_const': + result += comment+\ + '\n if ('+arg_name+'Multimap)'\ + '\n cef_string_multimap_free('+arg_name+'Multimap);' + elif arg_type == 'simple_vec_byref' or arg_type == 'bool_vec_byref' or \ + arg_type == 'refptr_vec_same_byref' or arg_type == 'refptr_vec_diff_byref': + count_func = arg.get_attrib_count_func() + vec_type = arg.get_type().get_result_vector_type_root() + if arg_type == 'refptr_vec_same_byref': + refptr_class = arg.get_type().get_refptr_type() + assign = refptr_class+'CToCpp::Wrap('+arg_name+'List[i])' + elif arg_type == 'refptr_vec_diff_byref': + refptr_class = arg.get_type().get_refptr_type() + assign = refptr_class+'CppToC::Unwrap('+arg_name+'List[i])' + elif arg_type == 'bool_vec_byref': + assign = arg_name+'List[i]?true:false' + else: + assign = arg_name+'List[i]' + result += comment+\ + '\n '+arg_name+'.clear();'\ + '\n if ('+arg_name+'Count > 0 && '+arg_name+'List) {'\ + '\n for (size_t i = 0; i < '+arg_name+'Count; ++i) {'\ + '\n '+arg_name+'.push_back('+assign+');'\ + '\n }'\ + '\n delete [] '+arg_name+'List;'\ + '\n }' + + if len(result) != result_len: + result += '\n' + result_len = len(result) + + # special handling for the global CefShutdown function + if name == 'CefShutdown' and isinstance(func.parent, obj_header): + classes = func.parent.get_classes() + + names = [] + for cls in classes: + if cls.has_attrib('no_debugct_check'): + continue; + + if cls.is_library_side(): + names.append(cls.get_name()+'CToCpp') + else: + names.append(cls.get_name()+'CppToC') + + if len(names) > 0: + names = sorted(names) + result += '\n#ifndef NDEBUG'\ + '\n // Check that all wrapper objects have been destroyed' + for name in names: + result += '\n DCHECK('+name+'::DebugObjCt == 0);'; + result += '\n#endif // !NDEBUG' + + if len(result) != result_len: + result += '\n' + result_len = len(result) + + # return translation + if retval_type != 'none': + # has a return value + result += '\n // Return type: '+retval_type + if retval_type == 'simple': + result += '\n return _retval;' + elif retval_type == 'bool': + result += '\n return _retval?true:false;' + elif retval_type == 'string': + result += '\n CefString _retvalStr;'\ + '\n _retvalStr.AttachToUserFree(_retval);'\ + '\n return _retvalStr;' + elif retval_type == 'refptr_same': + refptr_class = retval.get_type().get_refptr_type() + result += '\n return '+refptr_class+'CToCpp::Wrap(_retval);' + elif retval_type == 'refptr_diff': + refptr_class = retval.get_type().get_refptr_type() + result += '\n return '+refptr_class+'CppToC::Unwrap(_retval);' + + if len(result) != result_len: + result += '\n' + + result += '}\n\n' + return wrap_code(result) + +def make_ctocpp_function_impl(clsname, funcs, existing): + impl = '' + + for func in funcs: + name = func.get_name() + value = get_next_function_impl(existing, name) + if not value is None \ + and value['body'].find('// AUTO-GENERATED CONTENT') < 0: + # an implementation exists that was not auto-generated + impl += make_ctocpp_function_impl_existing(clsname, name, func, value) + else: + impl += make_ctocpp_function_impl_new(clsname, name, func) + + return impl + +def make_ctocpp_class_impl(header, clsname, impl): cls = header.get_class(clsname) if cls is None: raise Exception('Class does not exist: '+clsname) @@ -63,19 +451,7 @@ def make_ctocpp_impl(header, clsname, impl): existing = get_function_impls(impl, clsname+'CToCpp::') # generate virtual functions - virtualimpl = '' - funcs = cls.get_virtual_funcs() - for func in funcs: - name = func.get_name() - value = get_next_function_impl(existing, name) - if not value is None \ - and value['body'].find('// AUTO-GEN') < 0: - # an implementation exists that was not auto-generated - virtualimpl += make_ctocpp_impl_existing(clsname, name, func, - value) - else: - virtualimpl += make_ctocpp_impl_new(clsname, name, func) - + virtualimpl = make_ctocpp_function_impl(clsname, cls.get_virtual_funcs(), existing) if len(virtualimpl) > 0: virtualimpl = '\n// VIRTUAL METHODS - Body may be edited by hand.\n\n'+virtualimpl @@ -83,19 +459,7 @@ def make_ctocpp_impl(header, clsname, impl): existing = get_function_impls(impl, clsname+'::') # generate static functions - staticimpl = '' - funcs = cls.get_static_funcs() - for func in funcs: - name = func.get_name() - value = get_next_function_impl(existing, name) - if not value is None \ - and value['body'].find('// AUTO-GENERATED CONTENT') < 0: - # an implementation exists that was not auto-generated - staticimpl += make_ctocpp_impl_existing(clsname, name, func, - value) - else: - staticimpl += make_ctocpp_impl_new(clsname, name, func) - + staticimpl = make_ctocpp_function_impl(clsname, cls.get_static_funcs(), existing) if len(staticimpl) > 0: staticimpl = '\n// STATIC METHODS - Body may be edited by hand.\n\n'+staticimpl @@ -106,21 +470,8 @@ def make_ctocpp_impl(header, clsname, impl): includes = format_translation_includes(resultingimpl) # build the final output - result = \ -"""// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights -// reserved. Use of this source code is governed by a BSD-style license that -// can be found in the LICENSE file. -// -// --------------------------------------------------------------------------- -// -// A portion of this file was generated by the CEF translator tool. When -// making changes by hand only do so within the body of existing static and -// virtual method implementations. See the translator.README.txt file in the -// tools directory for more information. -// + result = get_copyright() -""" - result += includes+'\n'+resultingimpl+'\n' result += wrap_code('#ifndef NDEBUG\n'+ \ @@ -129,16 +480,43 @@ def make_ctocpp_impl(header, clsname, impl): return result +def make_ctocpp_global_impl(header, impl): + # retrieve the existing global function implementations + existing = get_function_impls(impl, 'CEF_GLOBAL') + + # generate static functions + impl = make_ctocpp_function_impl(None, header.get_funcs(), existing) + if len(impl) > 0: + impl = '\n// GLOBAL METHODS - Body may be edited by hand.\n\n'+impl + + # determine what includes are required by identifying what translation + # classes are being used + includes = format_translation_includes(impl) + + # build the final output + result = get_copyright() + + result += includes+'\n// Define used to facilitate parsing.\n#define CEF_GLOBAL\n\n'+impl + + return result def write_ctocpp_impl(header, clsname, dir, backup): - file = dir+os.sep+get_capi_name(clsname[3:], False)+'_ctocpp.cc' + if clsname is None: + # global file + file = dir + else: + # class file + file = dir+os.sep+get_capi_name(clsname[3:], False)+'_ctocpp.cc' if path_exists(file): oldcontents = read_file(file) else: oldcontents = '' - newcontents = make_ctocpp_impl(header, clsname, oldcontents) + if clsname is None: + newcontents = make_ctocpp_global_impl(header, oldcontents) + else: + newcontents = make_ctocpp_class_impl(header, clsname, oldcontents) if newcontents != oldcontents: if backup and oldcontents != '': backup_file(file) diff --git a/tools/translator.README.txt b/tools/translator.README.txt index a38999135..b4f0fe169 100644 --- a/tools/translator.README.txt +++ b/tools/translator.README.txt @@ -1,7 +1,7 @@ Chromium Embedded Framework (CEF) Translator Tool -- translator.py ------------------------------------------------------------------------------- -Document Last Updated: June 20, 2009 +Document Last Updated: December 7, 2011 OVERVIEW @@ -17,11 +17,12 @@ the file that currently exists on disk a backup of the existing file will be created before the new file is written (this behavior can be controlled using a command-line switch -- see 'translator.py -h' for more information). Header files (*.h) are completely generated by the translator and should never be -edited by hand. Implementation files (*.cc) contain user-created content within -method and function body blocks. The user-created content is extracted from the -existing file and inserted into the new translator-generated file. Any +edited by hand. Implementation files (*.cc) may contain user-created content +within method and function body blocks. The user-created content is extracted +from the existing file and inserted into the new translator-generated file. Any differences between existing method/function prototypes and new method/function -prototypes will be noted as a warning in new output file. +prototypes in manually edited implementations will be noted as a warning in new +output file. // WARNING - CHANGED ATTRIBUTES // REMOVED: const wchar_t* key @@ -31,12 +32,12 @@ prototypes will be noted as a warning in new output file. // NOW: int #pragma message("Warning: "__FILE__": MyFunction prototype has changed") -Place-holder implementations will be added in the new output file for any +Auto-generated implementations will be added in the new output file for any methods/functions that exist in the CEF header file but did not exist in the current on-disk implementation file. Each time the translator re-generates the -implementation file it will warn if place-holder implementations exist. Delete -the indicated portion of the generated code after adding the implementation by -hand. +implementation file it will warn if an implementation could not be auto- +generated. Delete the indicated portion of the generated code after adding the +implementation manually. size_t CEF_CALLBACK frame_new_func(struct _cef_frame_t* self) { @@ -46,10 +47,18 @@ hand. // END DELETE BEFORE MODIFYING } -The 'translator.bat' file can be used to run the translator tool with command- -line arguments that match the default CEF directory structure and output -options. Run 'translator.py -h' for a complete list of available command-line -arguments. +If the complete function or method implementation has been auto-generated the +body of the function or method will contain the following comment. + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + +If you edit the implementation manually you should remove this comment so that +CEF will not discard your changes on the next run of the translator tool. + +The 'translator.[bat|sh]' file can be used to run the translator tool with +command- line arguments that match the default CEF directory structure and +output options. Run 'translator.py -h' for a complete list of available command- +line arguments. HEADER ATTRIBUTES @@ -64,10 +73,19 @@ and must all exist on a single line. /*--cef(name1=value1,name2=value2,name3=value3)--*/ -Supported method attributes: +Supported method/function attributes: capi_name=[string] (Optional) Force a specific output name for the resulting C API function. + optional_param=[param] (Optional) Parameter name that will be optional + instead of required. + default_retval=[string] (Required for enumeration types, Optional for other + types) Specify the default return value. + count_func=[param:func] (Required for non-const non-string std::vector + types) Specify the C++ function that returns the + count of elements for a vector parameter. + revision_check (Optional) If set a revision check will be added + to the CToCpp version of the method/function. Supported class attributes: @@ -75,6 +93,8 @@ Supported class attributes: implementation is provided by the library or the client. This effects the generation of guard blocks in the cpptoc and ctocpp header files. + no_debugct_check (Optional) If set the debug reference count + of the object will not be checked on shutdown. TRANSLATION RULES @@ -118,62 +138,1481 @@ repeat of 'classname' in the function name is removed. C++: static CefRefPtr CreateRequest() C API: struct _cef_request_t* cef_request_create() +Implementation of the wrapper method/function body is generally formatted as +follows. + + Static/Global CppToC (without Return): + + CEF_EXPORT void cef_function(capi_params) + { + // Parameter Verification (Optional) + // Verify the C parameter values. + // ... + + // Parameter Translation (Optional) + // Convert C parameter values to C++ parameter values. + // ... + + // Execution + CefFunction(cpp_arams); + + // Parameter Restoration (Optional) + // Retore the C parameter values if changed. + // ... + } + + Static/Global CppToC (with Return): + + CEF_EXPORT capi_retval cef_function(capi_params) + { + // Parameter Verification (Optional) + // Verify the C parameter values. + // ... + + // Parameter Translation (Optional) + // Convert C parameter values to C++ parameter values. + // ... + + // Execution + cpp_retval _rv = CefFunction(cpp_params); + + // Parameter Restoration (Optional) + // Restore the C parameter values if changed. + // ... + + // Return Translation + // Convert the C++ return value to a C return value. + return ...; + } + + Static/Global CToCpp (without Return): + + void CefFunction(cpp_params) + { + // Parameter Verification (Optional) + // Verify the C++ parameter values. + // ... + + // Parameter Translation (Optional) + // Convert C++ parameter values to C parameter values. + // ... + + // Execution + cef_function(capi_params); + + // Parameter Restoration (Optional) + // Restore the C++ parameter values if changed. + // ... + } + + Static/Global CToCpp (with Return): + + cpp_retval CefFunction(cpp_params) + { + // Parameter Verification (Optional) + // Verify the C++ parameter values. + // ... + + // Parameter Translation (Optional) + // Convert C++ parameter values to C parameter values. + // ... + + // Execution + capi_retval _rv = cef_function(capi_params); + + // Parameter Restoration (Optional) + // Restore the C++ parameter values if changed. + // ... + + // Return Translation + // Convert the C return value to a C++ return value. + return ...; + } + + Member CppToC (without Return): + + CEF_CALLBACK void class_function(cef_class_t* self, capi_params) + { + // Parameter Verification. + // Verify the C parameter values. + DCHECK(self); + DCHECK(...); + if (!self || ...) + return; + + // Parameter Translation (Optional) + // Convert the C parameter values to C++ parameter values. + // ... + + // Execution + CefClassCppToC::Get(self)->CefFunction(cpp_params); + + // Parameter Restoration (Optional) + // Restore the C parameter values if changed. + // ... + } + + Member CppToC (with Return): + + CEF_CALLBACK capi_retval class_function(cef_class_t* self, capi_params) + { + // Parameter Verification. + // Verify the C parameter values. + DCHECK(self); + DCHECK(...); + if (!self || ...) + return default_retval; // Configured or defaulted automatically. + + // Parameter Translation (Optional) + // Convert the C parameter values to C++ parameter values. + // ... + + // Execution + cpp_retval _rv = CefClassCppToC::Get(self)->CefFunction(cpp_params); + + // Parameter Restoration (Optional) + // Restore the C parameter values if changed. + // ... + + // Return Translation + // Convert the C++ return value to a C return value. + return ...; + } + + Member CToCpp (without Return): + + void CefClassCToCpp::Function(cpp_params) + { + // Structure Verification + if (CEF_MEMBER_MISSING(struct_, function)) + return; + + // Parameter Verification (Optional) + // Verify the C++ parameter values. + // ... + + // Parameter Translation (Optional) + // Convert C++ parameter values to C parameter values. + // ... + + // Execution + struct_->class_function(struct_, capi_params); + + // Parameter Restoration (Optional) + // Restore the C++ parameter values if changed. + // ... + } + + Member CToCpp (with Return): + + cpp_retval CefClassCToCpp::Function(cpp_params) + { + // Structure Verification + if (CEF_MEMBER_MISSING(struct_, function)) + return default_retval; // Configured or defaulted automatically. + + // Parameter Verification (Optional) + // Verify the C++ parameter values. + // ... + + // Parameter Translation (Optional) + // Convert C++ parameter values to C parameter values. + // ... + + // Execution + capi_retval _rv = struct_->class_function(struct_, capi_params); + + // Parameter Restoration (Optional) + // Restore the C++ parameter values if changed. + // ... + + // Return Translation + // Convert the C return value to a C++ return value. + return ...; + } + Translating Data Types ---------------------- Data types that are available in both C++ and C are left unchanged. This -includes the 'double', 'int', 'long', 'size_t' and 'void' built-in types. Other +includes the 'double', 'int', 'long', 'size_t' and 'void' basic types. Other data types have differing levels of support as indicated below. The translation -tool will terminate with an exception if it encounters a data type -that it cannot translate. +tool will terminate with an exception if it encounters a data type that it +cannot translate. + +Parameters: + + Simple/enumeration type by value (simple_byval): + C++: int value + C API: int value + + // CppToC Example + CEF_EXPORT void cef_function(int value) + { + // Execution + CefFunction(value); + } + + // CToCpp Example + void CefFunction(int value) + { + // Execution + cef_function(value); + } + + Simple/enumeration type by reference (simple_byref): + C++: int& value + C API: int* value + + // CppToC Example + CEF_EXPORT void cef_function(int* value) + { + // Parameter Verification + DHECK(value); + if (!value) + return; + + // Parameter Translation + int valueVal = value?*value:0; + + // Execution + CefFunction(valueVal); + + // Parameter Restoration + if (value) + *value = valueVal; + } + + // CToCpp Example + void CefFunction(int& value) + { + // Execution + cef_function(&value); + } + + Simple/enumeration const type by reference (simple_byref_const): + C++: const int& value + C API: const int* value + + // CppToC Example + CEF_EXPORT void cef_function(const int* value) + { + // Parameter Verification + DHECK(value); + if (!value) + return; + + // Parameter Translation + int valueVal = value?*value:0; + + // Execution + CefFunction(valueVal); + } + + // CToCpp Example + void CefFunction(const int& value) + { + // Execution + cef_function(&value); + } + + Simple/enumeration type by address (simple_byaddr): + C++: int* value + C API: int* value + + // CppToC Example + CEF_EXPORT void cef_function(int* value) + { + // Parameter Verification + DHECK(value); + if (!value) + return; + + // Execution + CefFunction(value); + } + + // CToCpp Example + void CefFunction(int* value) + { + // Parameter Verification + DHECK(value); + if (!value) + return; + + // Execution + cef_function(value); + } + + Boolean type by value (bool_byval): + C++: bool value + C API: int value + + // CppToC Example + CEF_EXPORT void cef_function(int value) + { + // Execution + CefFunction(value?true:false); + } + + // CToCpp Example + void CefFunction(bool value) + { + // Execution + cef_function(value); + } + + Boolean type by reference (bool_byref): + C++: bool& value + C API: int* value + + // CppToC Example + CEF_EXPORT void cef_function(int* value) + { + // Parameter Verification + DHECK(value); + if (!value) + return; + + // Parameter Translation + bool valueBool = (value && *value)?true:false; + + // Execution + CefFunction(valueBool); + + // Parameter Restoration + if (value) + *value = valueBool?true:false; + } + + // CToCpp Example + void CefFunction(bool& value) + { + // Parameter Translation + int valueInt = value; + + // Execution + cef_function(&valueInt); + + // Parameter Restoration + value = valueInt?true:false; + } + + Boolean type by address (bool_byaddr): + C++: bool* value + C API: int* value + + // CppToC Example + CEF_EXPORT void cef_function(int* value) + { + // Parameter Verification + DHECK(value); + if (!value) + return; + + // Parameter Translation + bool valueBool = (value && *value)?true:false; + + // Execution + CefFunction(&valueBool); + + // Parameter Restoration + if (value) + *value = valueBool?true:false; + } + + // CToCpp Example + void CefFunction(bool* value) + { + // Parameter Verification + DHECK(value); + if (!value) + return; + + // Parameter Translation + int valueInt = value?*value:0; + + // Execution + cef_function(&valueInt); + + // Parameter Restoration + if (value) + *value = valueInt?true:false; + } + + Structure const type by reference (struct_byref_const): + C++: const CefPopupFeatures& value + C API: const cef_popup_features_t* value + + // CppToC Example + CEF_EXPORT void cef_function(const cef_popup_features_t* value) + { + // Parameter Verification + DHECK(value); + if (!value) + return; + + // Parameter Translation + CefPopupFeatures valueObj; + // Reference the existing values instead of copying. + if (value) + valueObj.Set(*value, false); + + // Execution + CefFunction(valueObj); + } + + // CToCpp Example + void CefFunction(const CefPopupFeatures& value) + { + // Execution + cef_function(&value); + } + + Structure non-const type by reference (struct_byref): + C++: CefWindowInfo& value + C API: cef_window_info_t* value + + // CppToC Example + CEF_EXPORT void cef_function(cef_window_info_t* value) + { + // Parameter Verification + DHECK(value); + if (!value) + return; + + // Parameter Translation + CefWindowInfo valueObj; + // Take ownership of the values. + if (value) + valueObj.AttachTo(*value); + + // Execution + CefFunction(valueObj); + + // Parameter Restoration + // Return the values to the structure. + if (value) + valueObj.DetachTo(*value); + } + + // CToCpp Example + void CefFunction(CefWindowInfo& value) + { + // Execution + cef_function(&value); + } + + String const type by reference (string_byref_const): + C++: const CefString& value + C API: const cef_string_t* value + + // CppToC Example + CEF_EXPORT void cef_function(const cef_string_t* value) + { + // Parameter Verification + DHECK(value); + if (!value) + return; + + // Execution + CefFunction(CefString(value)); + } + + // CToCpp Example + void CefFunction(const CefString& value) + { + // Execution + cef_function(value.GetStruct()); + } + + String non-const type by reference (string_byref): + C++: CefString& value + C API: cef_string_t* value + + // CppToC Example + CEF_EXPORT void cef_function(cef_string_t* value) + { + // Parameter Verification + DHECK(value); + if (!value) + return; + + // Parameter Translation + CefString valueStr(value); + + // Execution + CefFunction(valueStr); + } + + // CToCpp Example + void CefFunction(CefString& value) + { + // Execution + cef_function(value.GetWritableStruct()); + } + + Smart pointer type same boundary side (refptr_same): + C++: CefRefPtr value + C API: cef_browser_t* value + + // CppToC Example + CEF_EXPORT void cef_function(cef_browser_t* value) + { + // Parameter Verification + DHECK(value); + if (!value) + return; + + // Execution + CefFunction(CefBrowserCppToC::Unwrap(value)); + } + + // CToCpp Example + void CefFunction(CefRefPtr value) + { + // Execution + cef_function(CefBrowserCToCpp::Unwrap(value)); + } + + Smart pointer type same boundary side by reference (refptr_same_byref): + C++: CefRefPtr& value + C API: cef_client_t** value + + // CppToC Example + CEF_EXPORT void cef_function(cef_client_t** value) + { + // Parameter Verification + DHECK(value); + if (!value) + return; + + // Parameter Translation + CefRefPtr valuePtr; + if (value && *value) + valuePtr = CefClientCppToC::Unwrap(*value); + CefClient* valueOrig = valuePtr.get(); + + // Execution + CefFunction(valuePtr); + + // Parameter Restoration + if (value) { + if (valuePtr.get()) { + if (valuePtr.get() != valueOrig) { + // The value has been changed. + *value = CefClientCppToC::Wrap(valuePtr); + } + } else { + *value = NULL; + } + } + } + + // CToCpp Example + void CefFunction(CefRefPtr& value) + { + // Parameter Translation + cef_client_t* valueStruct = NULL; + if(value.get()) + valueStruct = CefClientCToCpp::Unwrap(value); + cef_client_t* valueOrig = valueStruct; + + // Execution + cef_function(valueStuct); + + // Parameter Restoration + if (valueStruct) { + if (valueStruct != valueOrig) { + // The value was changed. + value = CefClientCToCpp::Wrap(valueStruct); + } + } else { + value = NULL; + } + } + + Smart pointer type different boundary side (refptr_diff): + C++: CefRefPtr value + C API: cef_browser_t* value + + // CppToC Example + CEF_EXPORT void cef_function(cef_browser_t* value) + { + // Parameter Verification + DHECK(value); + if (!value) + return; + + // Execution + CefFunction(CefBrowserCToCpp::Wrap(value)); + } + + // CToCpp Example + void CefFunction(CefRefPtr value) + { + // Execution + cef_function(CefBrowserCppToC::Wrap(value)); + } + + Smart pointer type different boundary side by reference (refptr_diff_byref): + C++: CefRefPtr& value + C API: cef_client_t** value + + // CppToC Example + CEF_EXPORT void cef_function(cef_client_t** value) + { + // Parameter Verification + DHECK(value); + if (!value) + return; + + // Parameter Translation + CefRefPtr valuePtr; + if (value && *value) + valuePtr = CefClientCToCpp::Wrap(*value); + CefClient* valueOrig = valuePtr.get(); + + // Execution + CefFunction(valuePtr); + + // Parameter Restoration + if (value) { + if (valuePtr.get()) { + if (valuePtr.get() != valueOrig) { + // The value has been changed. + *value = CefClientCToCpp::Unwrap(valuePtr); + } + } else { + *value = NULL; + } + } + } + + // CToCpp Example + void CefFunction(CefRefPtr& value) + { + // Parameter Translation + cef_client_t* valueStruct = NULL; + if(value.get()) + valueStruct = CefClientCppToC::Wrap(value); + cef_client_t* valueOrig = valueStruct; + + // Execution + cef_function(valueStuct); + + // Parameter Restoration + if (valueStruct) { + if (valueStruct != valueOrig) { + // The value was changed. + value = CefClientCppToC::Unwrap(valueStruct); + } + } else { + value = NULL; + } + } + + String vector type by reference (string_vec_byref): + C++: std::vector& value + C API: cef_string_list_t value + + // CppToC Example + CEF_EXPORT void cef_function(cef_string_list_t value) + { + // Parameter Verification + DHECK(value); + if (!value) + return; + + // Parameter Translation + std::vector valueList; + transfer_string_list_contents(value, valueList); + + // Execution + CefFunction(valueList); + + // Parameter Restoration + cef_string_list_clear(value); + transfer_string_list_contents(valueList, value); + } + + // CToCpp Example + void CefFunction(std::vector& value) + { + // Parameter Translation + cef_string_list_t valueList = cef_string_list_alloc(); + DCHECK(valueList); + if (valueList) + transfer_string_list_contents(value, valueList); + + // Execution + cef_function(valueList); + + // Parameter Restoration + if (valueList) { + value.clear(); + transfer_string_list_contents(valueList, value); + cef_string_list_free(valueList); + } + } + + String vector const type by reference (string_vec_byref_const): + C++: const std::vector& value + C API: cef_string_list_t value + + // CppToC Example + CEF_EXPORT void cef_function(cef_string_list_t value) + { + // Parameter Verification + DHECK(value); + if (!value) + return; + + // Parameter Translation + std::vector valueList; + transfer_string_list_contents(value, valueList); + + // Execution + CefFunction(valueList); + } + + // CToCpp Example + void CefFunction(const std::vector& value) + { + // Parameter Translation + cef_string_list_t valueList = cef_string_list_alloc(); + DCHECK(valueList); + if (valueList) + transfer_string_list_contents(value, valueList); + + // Execution + cef_function(valueList); + + // Parameter Restoration + if (valueList) + cef_string_list_free(valueList); + } + + String-to-string single map type by reference (string_map_single_byref): + C++: std::map& value + C API: cef_string_map_t value + + // CppToC Example + CEF_EXPORT void cef_function(cef_string_map_t value) + { + // Parameter Verification + DHECK(value); + if (!value) + return; + + // Parameter Translation + std::map valueMap; + transfer_string_map_contents(value, valueMap); + + // Execution + CefFunction(valueMap); + + // Parameter Restoration + cef_string_map_clear(value); + transfer_string_map_contents(valueMap, value); + } + + // CToCpp Example + void CefFunction(std::map& value) + { + // Parameter Translation + cef_string_map_t valueMap = cef_string_map_alloc(); + DCHECK(valueMap); + if (valueMap) + transfer_string_map_contents(value, valueMap); + + // Execution + cef_function(valueMap); + + // Parameter Restoration + if (valueMap) { + value.clear(); + transfer_string_map_contents(valueMap, value); + cef_string_map_free(valueMap); + } + } + + String-to-string single map const type by reference + (string_map_single_byref_const): + C++: const std::map& value + C API: cef_string_map_t value + + // CppToC Example + CEF_EXPORT void cef_function(cef_string_map_t value) + { + // Parameter Verification + DHECK(value); + if (!value) + return; + + // Parameter Translation + std::map valueMap; + transfer_string_map_contents(value, valueMap); + + // Execution + CefFunction(valueMap); + } + + // CToCpp Example + void CefFunction(const std::map& value) + { + // Parameter Translation + cef_string_map_t valueMap = cef_string_map_alloc(); + DCHECK(valueMap); + if (valueMap) + transfer_string_map_contents(value, valueMap); + + // Execution + cef_function(valueMap); + + // Parameter Restoration + if (valueMap) + cef_string_map_free(valueMap); + } + + String-to-string multi map type by reference (string_map_multi_byref): + C++: std::multimap& value + C API: cef_string_multimap_t value + + // CppToC Example + CEF_EXPORT void cef_function(cef_string_multimap_t value) + { + // Parameter Verification + DHECK(value); + if (!value) + return; + + // Parameter Translation + std::multimap valueMultimap; + transfer_string_multimap_contents(value, valueMultimap); + + // Execution + CefFunction(valueMultimap); + + // Parameter Restoration + cef_string_multimap_clear(value); + transfer_string_multimap_contents(valueMultimap, value); + } + + // CToCpp Example + void CefFunction(std::multimap& value) + { + // Parameter Translation + cef_string_multimap_t valueMultimap = cef_string_multimap_alloc(); + DCHECK(valueMultimap); + if (valueMultimap) + transfer_string_multimap_contents(value, valueMultimap); + + // Execution + cef_function(valueMultimap); + + // Parameter Restoration + if (valueMultimap) { + value.clear(); + transfer_string_multimap_contents(valueMultimap, value); + cef_string_multimap_free(valueMultimap); + } + } - Boolean type translation (argument or return value): + String-to-string multi map const type by reference + (string_map_multi_byref_const): + C++: const std::multimap& value + C API: cef_string_multimap_t value + + // CppToC Example + CEF_EXPORT void cef_function(cef_string_multimap_t value) + { + // Parameter Verification + DHECK(value); + if (!value) + return; + + // Parameter Translation + std::multimap valueMultimap; + transfer_string_multimap_contents(value, valueMultimap); + + // Execution + CefFunction(valueMultimap); + } + + // CToCpp Example + void CefFunction(const std::multimap& value) + { + // Parameter Translation + cef_string_multimap_t valueMultimap = cef_string_multimap_alloc(); + DCHECK(valueMultimap); + if (valueMultimap) + transfer_string_multimap_contents(value, valueMultimap); + + // Execution + cef_function(valueMultimap); + + // Parameter Restoration + if (valueMultimap) + cef_string_multimap_free(valueMultimap); + } + + Simple/Enumeration vector non-const type by reference (simple_vec_byref): + C++: std::vector& value + C API: size_t* valueCount, int* value + + // CppToC Example + CEF_EXPORT void cef_function(size_t* valueCount, int* value) + { + // Parameter Verification + DCHECK(valueCount && (*valueCount == 0 || value)); + if (!valueCount || (*valueCount > 0 && !value)) + return; + + // Parameter Translation + std::vector valueList; + if (valueCount && *valueCount > 0 && value) { + for (size_t i = 0; i < *valueCount; ++i) + valueList.push_back(value[i]); + } + + // Execution + CefFunction(valueList); + + // Parameter Restoration + if (valueCount && value) { + *valueCount = std::min(valueList.size(), *valueCount); + if (*valueCount > 0) { + for (size_t i = 0; i < *valueCount; ++i) + value[i] = valueList[i]; + } + } + } + + // CToCpp Example + void CefFunction(std::vector& value) + { + // Parameter Translation + // Function identified by the "count_func" method attribute. + size_t valueSize = value.size(); + size_t valueCount = std::max(GetFunctionCount(), valueSize); + int* valueList = NULL; + if (valueCount > 0) { + valueList = new int[valueCount]; + DCHECK(valueList); + if (valueList) + memset(valueList, 0, sizeof(int)*valueCount); + if (valueList && valueSize > 0) { + for (size_t i = 0; i < valueSize; ++i) { + valueList[i] = value[i]; + } + } + } + + // Execution + cef_function(&valueCount, valueList); + + // Parameter Restoration + value.clear(); + if (valueCount > 0 && valueList) { + for (size_t i = 0; i < valueCount; ++i) + value.push_back(valueList[i]); + delete [] valueList; + } + } + + Simple/Enumeration vector const type by reference (simple_vec_byref_const): + C++: const std::vector& value + C API: size_t valueCount, int const* value + + // CppToC Example + CEF_EXPORT void cef_function(size_t valueCount, int const* value) + { + // Parameter Verification + DCHECK(valueCount == 0 || value); + if (valueCount > 0 && !value) + return; + + // Parameter Translation + std::vector valueList; + if (valueCount > 0) { + for (size_t i = 0; i < valueCount; ++i) + valueList.push_back(value[i]); + } + + // Execution + CefFunction(valueList); + } + + // CToCpp Example + void CefFunction(const std::vector& value) + { + // Parameter Translation + const size_t valueCount = value.size(); + int* valueList = NULL; + if (valueCount > 0) { + valueList = new int[valueCount]; + DCHECK(valueList); + if (valueList) { + for (size_t i = 0; i < valueCount; ++i) + valueList[i] = value[i]; + } + } + + // Execution + cef_function(valueCount, valueList); + } + + Boolean vector non-const type by reference (bool_vec_byref): + C++: std::vector& value + C API: size_t* valueCount, int* value + + // CppToC Example + CEF_EXPORT void cef_function(size_t* valueCount, int* value) + { + // Parameter Verification + DCHECK(valueCount && (*valueCount == 0 || value)); + if (!valueCount || (*valueCount > 0 && !value)) + return; + + // Parameter Translation + std::vector valueList; + if (valueCount && *valueCount > 0 && value) { + for (size_t i = 0; i < *valueCount; ++i) + valueList.push_back(value[i]?true:false); + } + + // Execution + CefFunction(valueList); + + // Parameter Restoration + if (valueCount && value) { + *valueCount = std::min(valueList.size(), *valueCount); + if (*valueCount > 0) { + for (size_t i = 0; i < *valueCount; ++i) + value[i] = valueList[i]; + } + } + } + + // CToCpp Example + void CefFunction(std::vector& value) + { + // Parameter Translation + // Function identified by the "count_func" method attribute. + size_t valueSize = value.size(); + size_t valueCount = std::max(GetFunctionCount(), valueSize); + int* valueList = NULL; + if (valueCount > 0) { + valueList = new int[valueCount]; + DCHECK(valueList); + if (valueList) + memset(valueList, 0, sizeof(int)*valueCount); + if (valueList && valueSize > 0) { + for (size_t i = 0; i < valueSize; ++i) { + valueList[i] = value[i]; + } + } + } + + // Execution + cef_function(&valueCount, valueList); + + // Parameter Restoration + value.clear(); + if (valueCount > 0 && valueList) { + for (size_t i = 0; i < valueCount; ++i) + value.push_back(valueList[i]?true:false); + delete [] valueList; + } + } + + Boolean vector const type by reference (bool_vec_byref_const): + C++: const std::vector& value + C API: size_t valueCount, int const* value + + // CppToC Example + CEF_EXPORT void cef_function(size_t valueCount, int const* value) + { + // Parameter Verification + DCHECK(valueCount == 0 || value); + if (valueCount > 0 && !value) + return; + + // Parameter Translation + std::vector valueList; + if (valueCount > 0) { + for (size_t i = 0; i < valueCount; ++i) + valueList.push_back(value[i]?true:false); + } + + // Execution + CefFunction(valueList); + } + + // CToCpp Example + void CefFunction(const std::vector& value) + { + // Parameter Translation + const size_t valueCount = value.size(); + int* valueList = NULL; + if (valueCount > 0) { + valueList = new int[valueCount]; + DCHECK(valueList) + if (valueList) { + for (size_t i = 0; i < valueCount; ++i) + valueList[i] = value[i]; + } + } + + // Execution + cef_function(valueCount, valueList); + } + + Smart pointer vector non-const type same boundary side by reference + (refptr_vec_same_byref): + C++: std::vector>& value + C API: size_t* valueCount, cef_post_data_element_t** value + + // CppToC Example + CEF_EXPORT void cef_function(size_t* valueCount, + cef_post_data_element_t** value) + { + // Parameter Verification + DCHECK(valueCount && (*valueCount == 0 || value)); + if (!valueCount || (*valueCount > 0 && !value)) + return; + + // Parameter Translation + std::vector> valueList; + if (valueCount && *valueCount > 0 && value) { + for (size_t i = 0; i < *valueCount; ++i) + valueList.push_back(CefPostDataElementCppToC::Unwrap(value[i])); + } + + // Execution + CefFunction(valueList); + + // Parameter Restoration + if (valueCount && value) { + *valueCount = std::min(valueList.size(), *valueCount); + if (*valueCount > 0) { + for (size_t i = 0; i < *valueCount; ++i) + value[i] = CefPostDataElementCppToC::Wrap(valueList[i]); + } + } + } + + // CToCpp Example + void CefFunction(std::vector& value) + { + // Parameter Translation + // Function identified by the "count_func" method attribute. + size_t valueSize = value.size(); + size_t valueCount = std::max(GetFunctionCount(), valueSize); + cef_post_data_element_t** valueList = NULL; + if (valueCount > 0) { + valueList = new cef_post_data_element_t*[valueCount]; + DCHECK(valueList); + if (valueList) + memset(valueList, 0, sizeof(cef_post_data_element_t*)*valueCount); + if (valueList && valueSize > 0) { + for (size_t i = 0; i < valueSize; ++i) { + valueList[i] = CefPostDataElementCToCpp::Unwrap(value[i]); + } + } + } + + // Execution + cef_function(&valueCount, valueList); + + // Parameter Restoration + value.clear(); + if (valueCount > 0 && valueList) { + for (size_t i = 0; i < valueCount; ++i) + value.push_back(CefPostDataElementCToCpp::Wrap(valueList[i])); + delete [] valueList; + } + } + + Smart pointer vector const type same boundary side by reference + (refptr_vec_same_byref_const): + C++: const std::vector>& value + C API: size_t valueCount, const cef_v8value_t** value + + // CppToC Example + CEF_EXPORT void cef_function(size_t valueCount, + const cef_v8value_t** value) + { + // Parameter Verification + DCHECK(valueCount == 0 || value); + if (valueCount > 0 && !value) + return; + + // Parameter Translation + std::vector> valueList; + if (valueCount > 0) { + for (size_t i = 0; i < valueCount; ++i) + valueList.push_back(CefV8ValueCppToC::Unwrap(value[i])); + } + + // Execution + CefFunction(valueList); + } + + // CToCpp Example + void CefFunction(const std::vector& value) + { + // Parameter Translation + const size_t valueCount = value.size(); + cef_v8value_t** valueList = NULL; + if (valueCount > 0) { + valueList = new int[valueCount]; + DCHECK(valueList); + if (valueList) { + for (size_t i = 0; i < valueCount; ++i) + valueList[i] = CefV8ValueCToCpp::Unwrap(value[i]); + } + } + + // Execution + cef_function(valueCount, valueList); + } + + Smart pointer vector non-const type different boundary side by reference + (refptr_vec_diff_byref): + C++: std::vector>& value + C API: size_t* valueCount, cef_post_data_element_t** value + + // CppToC Example + CEF_EXPORT void cef_function(size_t* valueCount, + cef_post_data_element_t** value) + { + // Parameter Verification + DCHECK(valueCount && (*valueCount == 0 || value)); + if (!valueCount || (*valueCount > 0 && !value)) + return; + + // Parameter Translation + std::vector> valueList; + if (valueCount && *valueCount > 0 && value) { + for (size_t i = 0; i < *valueCount; ++i) + valueList.push_back(CefPostDataElementCToCpp::Wrap(value[i])); + } + + // Execution + CefFunction(valueList); + + // Parameter Restoration + if (valueCount && value) { + *valueCount = std::min(valueList.size(), *valueCount); + if (*valueCount > 0) { + for (size_t i = 0; i < *valueCount; ++i) + value[i] = CefPostDataElementCToCpp::Unwrap(valueList[i]); + } + } + } + + // CToCpp Example + void CefFunction(std::vector& value) + { + // Parameter Translation + // Function identified by the "count_func" method attribute. + size_t valueSize = value.size(); + size_t valueCount = std::max(GetFunctionCount(), valueSize); + cef_post_data_element_t** valueList = NULL; + if (valueCount > 0) { + valueList = new cef_post_data_element_t*[valueCount]; + DCHECK(valueList); + if (valueList) + memset(valueList, 0, sizeof(cef_post_data_element_t*)*valueCount); + if (valueList && valueSize > 0) { + for (size_t i = 0; i < valueSize; ++i) { + valueList[i] = CefPostDataElementCppToC::Wrap(value[i]); + } + } + } + + // Execution + cef_function(&valueCount, valueList); + + // Parameter Restoration + value.clear(); + if (valueCount > 0 && valueList) { + for (size_t i = 0; i < valueCount; ++i) + value.push_back(CefPostDataElementCppToC::Unwrap(valueList[i])); + delete [] valueList; + } + } + + Smart pointer vector const type different boundary side by reference + (refptr_vec_diff_byref_const): + C++: const std::vector>& value + C API: size_t valueCount, const cef_v8value_t** value + + // CppToC Example + CEF_EXPORT void cef_function(size_t valueCount, + const cef_v8value_t** value) + { + // Parameter Verification + DCHECK(valueCount == 0 || value); + if (valueCount > 0 && !value) + return; + + // Parameter Translation + std::vector> valueList; + if (valueCount > 0) { + for (size_t i = 0; i < valueCount; ++i) + valueList.push_back(CefV8ValueCToCpp::Wrap(value[i])); + } + + // Execution + CefFunction(valueList); + } + + // CToCpp Example + void CefFunction(const std::vector& value) + { + // Parameter Translation + const size_t valueCount = value.size(); + cef_v8value_t** valueList = NULL; + if (valueCount > 0) { + valueList = new int[valueCount]; + DCHECK(valueList); + if (valueList) { + for (size_t i = 0; i < valueCount; ++i) + valueList[i] = CefV8ValueCppToC::Wrap(value[i]); + } + } + + // Execution + cef_function(valueCount, valueList); + } + +Return Values: + + Simple/Enumeration type (simple): + C++: int + C API: int + + // CppToC Example + CEF_EXPORT int cef_function() + { + // Execution + int _rv = CefFunction(); + + // Return Translation + return _rv; + } + + // CToCpp Example + int CefFunction() + { + // Execution + int _rv = cef_function(); + + // Return Translation + return _rv; + } + + Boolean type (bool): C++: bool C API: int - - String const by reference type translation (argument only) - C++: const std::wstring& value - C API: const wchar_t* value - - String non-const by reference type translation (argument only) - C++: std::wstring& value - C API (result must be freed by the user): - cef_string_t* value - - String non-const by reference type translation (return value only) - C++: std::wstring - C API (result must be freed by the user): - cef_string_t - - Smart pointer type translation (argument or return value) + + // CppToC Example + CEF_EXPORT int cef_function() + { + // Execution + bool _rv = CefFunction(); + + // Return Translation + return _rv; + } + + // CToCpp Example + bool CefFunction() + { + // Execution + int _rv = cef_function(); + + // Return Translation + return _rv?true:false; + } + + String non-const by reference type (string): + C++: CefString + C API: cef_string_userfree_t + + // CppToC Example + CEF_EXPORT cef_string_userfree_t cef_function() + { + // Execution + CefString _rv = CefFunction(); + + // Return Translation + return _rv.DetachToUserFree(); + } + + // CToCpp Example + CefString CefFunction() + { + // Execution + cef_string_userfree_t _rv = cef_function(); + + // Return Translation + CefString _rvStr; + _rvStr.AttachToUserFree(_rv); + return _rvStr; + } + + Smart pointer type same boundary side (refptr_same): C++: CefRefPtr C API: cef_browser_t* - - Smart pointer by reference type translation (argument only) - C++: CefRefPtr& value - C API: cef_browser_t** value - - String vector by reference type translation (argument only) - C++: std::vector& value - C API (must be allocated and freed by the user): - cef_string_list_t value - - Non-string vector non-const by reference type translation (argument only) - C++: std::vector>& elements - C API (changes the function prototype): - cef_post_data_element_t* func(..., int elementIndex, ...) - - Non-string vector const by reference type translation (argument only) - C++: const std::vector>& arguments - C API (changes the function prototype): - ... func(..., size_t argumentCount, - const struct _cef_v8value_t** arguments, ...) - - String-to-string map by reference type translation (argument only) - C++: std::map& value - C API (must be allocated and freed by the user): - cef_string_map_t value + + // CppToC Example + CEF_EXPORT cef_browser_t* cef_function() + { + // Execution + CefRefPtr _rv = CefFunction(); + + // Return Translation + return CefBrowserCppToC::Wrap(_rv); + } + + // CToCpp Example + CefString CefFunction() + { + // Execution + cef_browser_t* _rv = cef_function(); + + // Return Translation + return CefBrowserCToCpp::Wrap(_rv); + } + + Smart pointer type different boundary side (refptr_diff): + C++: CefRefPtr + C API: cef_browser_t* + + // CppToC Example + CEF_EXPORT cef_browser_t* cef_function() + { + // Execution + CefRefPtr _rv = CefFunction(); + + // Return Translation + return CefBrowserCToCpp::Unwrap(_rv); + } + + // CToCpp Example + CefString CefFunction() + { + // Execution + cef_browser_t* _rv = cef_function(); + + // Return Translation + return CefBrowserCppToC::Unwrap(_rv); + } Translating Comments @@ -238,11 +1677,3 @@ C++: // // create the 'example' global object if it doesn't already exist. // if (!example) // example = {}; - - -WORK REMAINING --------------- - -o Generate place-holder implementations for C++ global functions. -o Automatically generate some function implementations based on an analysis of - the function prototype. diff --git a/tools/translator.bat b/tools/translator.bat index 6ffe4b752..4c80f49a1 100644 --- a/tools/translator.bat +++ b/tools/translator.bat @@ -1,3 +1,3 @@ @echo off -..\..\third_party\python_26\python.exe translator.py --cpp-header ..\include\cef.h --capi-header ..\include\cef_capi.h --cpptoc-dir ..\libcef_dll\cpptoc --ctocpp-dir ..\libcef_dll\ctocpp +..\..\third_party\python_26\python.exe translator.py --cpp-header ..\include\cef.h --capi-header ..\include\cef_capi.h --cpptoc-global-impl ..\libcef_dll\libcef_dll.cc --ctocpp-global-impl ..\libcef_dll\wrapper\libcef_dll_wrapper.cc --cpptoc-dir ..\libcef_dll\cpptoc --ctocpp-dir ..\libcef_dll\ctocpp pause \ No newline at end of file diff --git a/tools/translator.py b/tools/translator.py index 08de5711a..22b61fc8d 100644 --- a/tools/translator.py +++ b/tools/translator.py @@ -28,10 +28,14 @@ parser.add_option('--cpp-header', dest='cppheader', metavar='FILE', help='source CEF C++ header file [required]') parser.add_option('--capi-header', dest='capiheader', metavar='FILE', help='output CEF C API header file') +parser.add_option('--cpptoc-global-impl', dest='cpptocglobalimpl', metavar='FILE', + help='input/output file for CppToC global translations') +parser.add_option('--ctocpp-global-impl', dest='ctocppglobalimpl', metavar='FILE', + help='input/output file for CppToC global translations') parser.add_option('--cpptoc-dir', dest='cpptocdir', metavar='DIR', - help='input/output directory for CppToC translations') + help='input/output directory for CppToC class translations') parser.add_option('--ctocpp-dir', dest='ctocppdir', metavar='DIR', - help='input/output directory for CppToC translations') + help='input/output directory for CppToC class translations') parser.add_option('--no-cpptoc-header', action='store_true', dest='nocpptocheader', default=False, help='do not output the CppToC headers') @@ -91,36 +95,50 @@ else: classes = sorted(classes) +if not options.cpptocglobalimpl is None: + # output CppToC global file + if not options.quiet: + sys.stdout.write('Generating CppToC global implementation...\n') + writect += write_cpptoc_impl(header, None, options.cpptocglobalimpl, \ + not options.nobackup) + +if not options.ctocppglobalimpl is None: + # output CToCpp global file + if not options.quiet: + sys.stdout.write('Generating CToCpp global implementation...\n') + writect += write_ctocpp_impl(header, None, options.ctocppglobalimpl, \ + not options.nobackup) + if not options.cpptocdir is None: - #output CppToC files + #output CppToC class files if not options.quiet: sys.stdout.write('In CppToC directory '+options.cpptocdir+'...\n') for cls in classes: if not options.nocpptocheader: if not options.quiet: - sys.stdout.write('Generating '+cls+'CppToC header...\n') + sys.stdout.write('Generating '+cls+'CppToC class header...\n') writect += write_cpptoc_header(header, cls, options.cpptocdir, not options.nobackup) if not options.nocpptocimpl: if not options.quiet: - sys.stdout.write('Generating '+cls+'CppToC implementation...\n') + sys.stdout.write('Generating '+cls+'CppToC class implementation...\n') writect += write_cpptoc_impl(header, cls, options.cpptocdir, not options.nobackup) if not options.ctocppdir is None: - #output CppToC files + #output CppToC class files if not options.quiet: sys.stdout.write('In CToCpp directory '+options.ctocppdir+'...\n') for cls in classes: if not options.nocpptocheader: if not options.quiet: - sys.stdout.write('Generating '+cls+'CToCpp header...\n') + sys.stdout.write('Generating '+cls+'CToCpp class header...\n') writect += write_ctocpp_header(header, cls, options.ctocppdir, not options.nobackup) if not options.nocpptocimpl: if not options.quiet: - sys.stdout.write('Generating '+cls+'CToCpp implementation...\n') + sys.stdout.write('Generating '+cls+'CToCpp class implementation...\n') writect += write_ctocpp_impl(header, cls, options.ctocppdir, not options.nobackup) diff --git a/tools/translator.sh b/tools/translator.sh index 92bdcba85..f91737e00 100755 --- a/tools/translator.sh +++ b/tools/translator.sh @@ -1,2 +1,2 @@ #!/bin/sh -python translator.py --cpp-header ../include/cef.h --capi-header ../include/cef_capi.h --cpptoc-dir ../libcef_dll/cpptoc --ctocpp-dir ../libcef_dll/ctocpp +python translator.py --cpp-header ../include/cef.h --capi-header ../include/cef_capi.h --cpptoc-global-impl ../libcef_dll/libcef_dll.cc --ctocpp-global-impl ../libcef_dll/wrapper/libcef_dll_wrapper.cc --cpptoc-dir ../libcef_dll/cpptoc --ctocpp-dir ../libcef_dll/ctocpp