From e02e10153321c00e908ef49ffb864143c32335bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Salvador=20D=C3=ADaz=20Fau?= Date: Fri, 14 Jun 2024 12:03:35 +0200 Subject: [PATCH] Fixed incorrect type definitions Fixed TCefCustomStringList.GetHandle return value type --- .../Delphi_VCL/MiniBrowserD7/uMiniBrowser.pas | 8 +-- source/uCEFDragAndDropMgr.pas | 5 +- source/uCEFInterfaces.pas | 2 +- source/uCEFStringList.pas | 4 +- source/uCEFTypes.pas | 62 +++++++++---------- update_CEF4Delphi.json | 2 +- 6 files changed, 43 insertions(+), 40 deletions(-) diff --git a/demos/Delphi_VCL/MiniBrowserD7/uMiniBrowser.pas b/demos/Delphi_VCL/MiniBrowserD7/uMiniBrowser.pas index 5220b2b2..e7dcbd95 100644 --- a/demos/Delphi_VCL/MiniBrowserD7/uMiniBrowser.pas +++ b/demos/Delphi_VCL/MiniBrowserD7/uMiniBrowser.pas @@ -53,9 +53,9 @@ type procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser); procedure Chromium1BeforeContextMenu(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; const model: ICefMenuModel); procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction); - procedure Chromium1ContextMenuCommand(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; commandId: Integer; eventFlags: Cardinal; out Result: Boolean); + procedure Chromium1ContextMenuCommand(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; commandId: Integer; eventFlags: TCefEventFlags; out Result: Boolean); procedure Chromium1LoadEnd(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; httpStatusCode: Integer); - procedure Chromium1LoadError(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; errorCode: Integer; const errorText, failedUrl: ustring); + procedure Chromium1LoadError(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; errorCode: TCefErrorCode; const errorText, failedUrl: ustring); procedure Chromium1StatusMessage(Sender: TObject; const browser: ICefBrowser; const value: ustring); procedure Chromium1TitleChange(Sender: TObject; const browser: ICefBrowser; const title: ustring); @@ -231,7 +231,7 @@ end; procedure TMiniBrowserFrm.Chromium1ContextMenuCommand(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; commandId: Integer; - eventFlags: Cardinal; out Result: Boolean); + eventFlags: TCefEventFlags; out Result: Boolean); begin Result := False; @@ -271,7 +271,7 @@ begin end; procedure TMiniBrowserFrm.Chromium1LoadError(Sender: TObject; - const browser: ICefBrowser; const frame: ICefFrame; errorCode: Integer; + const browser: ICefBrowser; const frame: ICefFrame; errorCode: TCefErrorCode; const errorText, failedUrl: ustring); var TempString : string; diff --git a/source/uCEFDragAndDropMgr.pas b/source/uCEFDragAndDropMgr.pas index 4a77077d..36074127 100644 --- a/source/uCEFDragAndDropMgr.pas +++ b/source/uCEFDragAndDropMgr.pas @@ -682,6 +682,7 @@ var TempResult : HRESULT; TempFormatArray : TOLEFormatArray; TempMediumArray : TOLEMediumArray; + TempDragOps : TCefDragOperations; i : integer; begin Result := DRAG_OPERATION_NONE; @@ -711,7 +712,9 @@ begin if (TempResult <> DRAGDROP_S_DROP) then TempResEffect := DROPEFFECT_NONE; FCurrentDragData := nil; - DropEffectToDragOperation(TempResEffect, Result); + TempDragOps := TCefDragOperations(Result); + DropEffectToDragOperation(TempResEffect, TempDragOps); + Result := TCefDragOperation(TempDragOps); end; end; end; diff --git a/source/uCEFInterfaces.pas b/source/uCEFInterfaces.pas index 67b295cc..e85a1573 100644 --- a/source/uCEFInterfaces.pas +++ b/source/uCEFInterfaces.pas @@ -6648,7 +6648,7 @@ type /// error text and |failedUrl| is the URL that failed to load. See /// net\base\net_error_list.h for complete descriptions of the error codes. /// - procedure OnLoadError(const browser: ICefBrowser; const frame: ICefFrame; errorCode: Integer; const errorText, failedUrl: ustring); + procedure OnLoadError(const browser: ICefBrowser; const frame: ICefFrame; errorCode: TCefErrorCode; const errorText, failedUrl: ustring); /// /// Custom procedure to clear all references. /// diff --git a/source/uCEFStringList.pas b/source/uCEFStringList.pas index 67d2c025..b23683bd 100644 --- a/source/uCEFStringList.pas +++ b/source/uCEFStringList.pas @@ -27,7 +27,7 @@ type protected FHandle : TCefStringList; - function GetHandle: TCefStringMap; virtual; + function GetHandle: TCefStringList; virtual; /// /// Return the number of elements in the string list. /// @@ -107,7 +107,7 @@ begin if (FHandle <> nil) then cef_string_list_clear(FHandle); end; -function TCefCustomStringList.GetHandle: TCefStringMap; +function TCefCustomStringList.GetHandle: TCefStringList; begin Result := FHandle; end; diff --git a/source/uCEFTypes.pas b/source/uCEFTypes.pas index d7337d9b..1dc15435 100644 --- a/source/uCEFTypes.pas +++ b/source/uCEFTypes.pas @@ -484,7 +484,7 @@ type /// /// CEF source file: /include/internal/cef_thread_internal.h (cef_platform_thread_id_t) /// - TCefPlatformThreadId = DWORD; + TCefPlatformThreadId = type DWORD; /// /// Platform thread handle. @@ -492,7 +492,7 @@ type /// /// CEF source file: /include/internal/cef_thread_internal.h (cef_platform_thread_handle_t) /// - TCefPlatformThreadHandle = DWORD; + TCefPlatformThreadHandle = type DWORD; /// /// Transition type for a request. Made up of one source value and 0 or more @@ -502,7 +502,7 @@ type /// See the uCEFConstants unit for all possible values. /// CEF source file: /include/internal/cef_types.h (cef_transition_type_t) /// - TCefTransitionType = Cardinal; + TCefTransitionType = type Cardinal; /// /// 32-bit ARGB color value, not premultiplied. The color components are always @@ -511,7 +511,7 @@ type /// /// CEF source file: /include/internal/cef_types.h (cef_color_t) /// - TCefColor = Cardinal; + TCefColor = type Cardinal; /// /// Supported error code values. @@ -533,7 +533,7 @@ type /// CEF source file: /include/internal/cef_types.h (cef_errorcode_t) /// For the complete list of error values see include/base/internal/cef_net_error_list.h which includes this Chromium source file /net/base/net_error_list.h /// - TCefErrorCode = Integer; + TCefErrorCode = type Integer; /// /// Supported certificate status code values. See net\cert\cert_status_flags.h @@ -544,7 +544,7 @@ type /// See the uCEFConstants unit for all possible values. /// CEF source file: /include/internal/cef_types.h (cef_cert_status_t) /// - TCefCertStatus = Integer; + TCefCertStatus = type Integer; /// /// Supported SSL version values. @@ -554,7 +554,7 @@ type /// CEF source file: /include/internal/cef_types.h (cef_ssl_version_t) /// See net/ssl/ssl_connection_status_flags.h for more information. /// - TCefSSLVersion = integer; + TCefSSLVersion = type integer; /// /// CEF string maps are a set of key/value string pairs. @@ -562,7 +562,7 @@ type /// /// CEF source file: /include/internal/cef_string_list.h (cef_string_list_t) /// - TCefStringList = Pointer; + TCefStringList = type Pointer; /// /// CEF string maps are a set of key/value string pairs. @@ -570,7 +570,7 @@ type /// /// CEF source file: /include/internal/cef_string_map.h (cef_string_map_t) /// - TCefStringMap = Pointer; + TCefStringMap = type Pointer; /// /// CEF string multimaps are a set of key/value string pairs. @@ -579,7 +579,7 @@ type /// /// CEF source file: /include/internal/cef_string_multimap.h (cef_string_multimap_t) /// - TCefStringMultimap = Pointer; + TCefStringMultimap = type Pointer; /// /// URI unescape rules passed to CefURIDecode(). @@ -588,7 +588,7 @@ type /// See the uCEFConstants unit for all possible values. /// CEF source file: /include/internal/cef_types.h (cef_uri_unescape_rule_t) /// - TCefUriUnescapeRule = Integer; + TCefUriUnescapeRule = type Integer; /// /// DOM event category flags. @@ -597,7 +597,7 @@ type /// See the uCEFConstants unit for all possible values. /// CEF source file: /include/internal/cef_types.h (cef_dom_event_category_t) /// - TCefDomEventCategory = Integer; + TCefDomEventCategory = type Integer; /// /// Supported event bit flags. @@ -606,7 +606,7 @@ type /// See the uCEFConstants unit for all possible values. /// CEF source file: /include/internal/cef_types.h (cef_event_flags_t) /// - TCefEventFlags = Cardinal; + TCefEventFlags = type Cardinal; /// /// "Verb" of a drag-and-drop operation as negotiated between the source and @@ -617,8 +617,8 @@ type /// See the uCEFConstants unit for all possible values. /// CEF source file: /include/internal/cef_types.h (cef_drag_operations_mask_t) /// - TCefDragOperations = Cardinal; - TCefDragOperation = Cardinal; + TCefDragOperations = type Cardinal; + TCefDragOperation = type Cardinal; /// /// V8 access control values. @@ -627,7 +627,7 @@ type /// See the uCEFConstants unit for all possible values. /// CEF source file: /include/internal/cef_types.h (cef_v8_accesscontrol_t) /// - TCefV8AccessControls = Cardinal; + TCefV8AccessControls = type Cardinal; /// /// V8 property attribute values. @@ -636,7 +636,7 @@ type /// See the uCEFConstants unit for all possible values. /// CEF source file: /include/internal/cef_types.h (cef_v8_propertyattribute_t) /// - TCefV8PropertyAttributes = Cardinal; + TCefV8PropertyAttributes = type Cardinal; /// /// Flags used to customize the behavior of CefURLRequest. @@ -645,7 +645,7 @@ type /// See the uCEFConstants unit for all possible values. /// CEF source file: /include/internal/cef_types.h (cef_urlrequest_flags_t) /// - TCefUrlRequestFlags = Cardinal; + TCefUrlRequestFlags = type Cardinal; /// /// Supported context menu type flags. @@ -654,7 +654,7 @@ type /// See the uCEFConstants unit for all possible values. /// CEF source file: /include/internal/cef_types.h (cef_context_menu_type_flags_t) /// - TCefContextMenuTypeFlags = Cardinal; + TCefContextMenuTypeFlags = type Cardinal; /// /// Supported context menu media state bit flags. These constants match their @@ -665,7 +665,7 @@ type /// See the uCEFConstants unit for all possible values. /// CEF source file: /include/internal/cef_types.h (cef_context_menu_media_state_flags_t) /// - TCefContextMenuMediaStateFlags = Cardinal; + TCefContextMenuMediaStateFlags = type Cardinal; /// /// Supported context menu edit state bit flags. These constants match their @@ -676,7 +676,7 @@ type /// See the uCEFConstants unit for all possible values. /// CEF source file: /include/internal/cef_types.h (cef_context_menu_edit_state_flags_t) /// - TCefContextMenuEditStateFlags = Cardinal; + TCefContextMenuEditStateFlags = type Cardinal; /// /// Options that can be passed to CefWriteJSON. @@ -685,7 +685,7 @@ type /// See the uCEFConstants unit for all possible values. /// CEF source file: /include/internal/cef_types.h (cef_json_writer_options_t) /// - TCefJsonWriterOptions = Cardinal; + TCefJsonWriterOptions = type Cardinal; /// /// Supported SSL content status flags. See content/public/common/ssl_status.h @@ -695,7 +695,7 @@ type /// See the uCEFConstants unit for all possible values. /// CEF source file: /include/internal/cef_types.h (cef_ssl_content_status_t) /// - TCefSSLContentStatus = Cardinal; + TCefSSLContentStatus = type Cardinal; /// /// Log severity levels. @@ -704,7 +704,7 @@ type /// See the uCEFConstants unit for all possible values. /// CEF source file: /include/internal/cef_types.h (cef_log_severity_t) /// - TCefLogSeverity = Cardinal; + TCefLogSeverity = type Cardinal; /// /// Supported file dialog modes. @@ -713,7 +713,7 @@ type /// See the uCEFConstants unit for all possible values. /// CEF source file: /include/internal/cef_types.h (cef_file_dialog_mode_t) /// - TCefFileDialogMode = Cardinal; + TCefFileDialogMode = type Cardinal; /// /// Print job duplex mode values. @@ -722,7 +722,7 @@ type /// See the uCEFConstants unit for all possible values. /// CEF source file: /include/internal/cef_types.h (cef_duplex_mode_t) /// - TCefDuplexMode = Integer; + TCefDuplexMode = type Integer; /// /// Configuration options for registering a custom scheme. @@ -732,7 +732,7 @@ type /// See the uCEFConstants unit for all possible values. /// CEF source file: /include/internal/cef_types.h (cef_scheme_options_t) /// - TCefSchemeOptions = Integer; + TCefSchemeOptions = type Integer; /// /// Result codes for ICefMediaRouter.CreateRoute. Should be kept in sync with @@ -742,7 +742,7 @@ type /// See the uCEFConstants unit for all possible values. /// CEF source file: /include/internal/cef_types.h (cef_media_route_create_result_t) /// - TCefMediaRouterCreateResult = Integer; + TCefMediaRouterCreateResult = type Integer; /// /// Cookie priority values. @@ -751,7 +751,7 @@ type /// See the uCEFConstants unit for all possible values. /// CEF source file: /include/internal/cef_types.h (cef_cookie_priority_t) /// - TCefCookiePriority = Integer; + TCefCookiePriority = type Integer; /// /// Represents commands available to TextField. @@ -760,7 +760,7 @@ type /// See the uCEFConstants unit for all possible values. /// CEF source file: /include/internal/cef_types.h (cef_text_field_commands_t) /// - TCefTextFieldCommands = Integer; + TCefTextFieldCommands = type Integer; /// /// Chrome toolbar types. @@ -769,7 +769,7 @@ type /// See the uCEFConstants unit for all possible values. /// CEF source file: /include/internal/cef_types.h (cef_chrome_toolbar_type_t) /// - TCefChromeToolbarType = Integer; + TCefChromeToolbarType = type Integer; /// /// Docking modes supported by ICefWindow.AddOverlay. diff --git a/update_CEF4Delphi.json b/update_CEF4Delphi.json index c6be975b..68b646de 100644 --- a/update_CEF4Delphi.json +++ b/update_CEF4Delphi.json @@ -2,7 +2,7 @@ "UpdateLazPackages" : [ { "ForceNotify" : true, - "InternalVersion" : 612, + "InternalVersion" : 613, "Name" : "cef4delphi_lazarus.lpk", "Version" : "125.0.22" }