You've already forked CEF4Delphi
mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-12-13 21:45:55 +02:00
Added support for Lazarus/FPC (windows 32bit)
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
// For more information about CEF4Delphi visit :
|
||||
// https://www.briskbard.com/index.php?lang=en&pageid=cef
|
||||
//
|
||||
// Copyright � 2018 Salvador D�az Fau. All rights reserved.
|
||||
// Copyright � 2018 Salvador Diaz Fau. All rights reserved.
|
||||
//
|
||||
// ************************************************************************
|
||||
// ************ vvvv Original license and comments below vvvv *************
|
||||
@@ -37,6 +37,10 @@
|
||||
|
||||
unit uCEFListValue;
|
||||
|
||||
{$IFDEF FPC}
|
||||
{$MODE OBJFPC}{$H+}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFNDEF CPUX64}
|
||||
{$ALIGN ON}
|
||||
{$MINENUMSIZE 4}
|
||||
@@ -93,156 +97,157 @@ uses
|
||||
|
||||
function TCefListValueRef.Clear: Boolean;
|
||||
begin
|
||||
Result := PCefListValue(FData).clear(PCefListValue(FData)) <> 0;
|
||||
Result := PCefListValue(FData)^.clear(PCefListValue(FData)) <> 0;
|
||||
end;
|
||||
|
||||
function TCefListValueRef.Copy: ICefListValue;
|
||||
begin
|
||||
Result := UnWrap(PCefListValue(FData).copy(PCefListValue(FData)));
|
||||
Result := UnWrap(PCefListValue(FData)^.copy(PCefListValue(FData)));
|
||||
end;
|
||||
|
||||
class function TCefListValueRef.New: ICefListValue;
|
||||
begin
|
||||
Result := UnWrap(cef_list_value_create);
|
||||
Result := UnWrap(cef_list_value_create());
|
||||
end;
|
||||
|
||||
function TCefListValueRef.GetBinary(index: NativeUInt): ICefBinaryValue;
|
||||
begin
|
||||
Result := TCefBinaryValueRef.UnWrap(PCefListValue(FData).get_binary(PCefListValue(FData), index));
|
||||
Result := TCefBinaryValueRef.UnWrap(PCefListValue(FData)^.get_binary(PCefListValue(FData), index));
|
||||
end;
|
||||
|
||||
function TCefListValueRef.GetBool(index: NativeUInt): Boolean;
|
||||
begin
|
||||
Result := PCefListValue(FData).get_bool(PCefListValue(FData), index) <> 0;
|
||||
Result := PCefListValue(FData)^.get_bool(PCefListValue(FData), index) <> 0;
|
||||
end;
|
||||
|
||||
function TCefListValueRef.GetDictionary(index: NativeUInt): ICefDictionaryValue;
|
||||
begin
|
||||
Result := TCefDictionaryValueRef.UnWrap(PCefListValue(FData).get_dictionary(PCefListValue(FData), index));
|
||||
Result := TCefDictionaryValueRef.UnWrap(PCefListValue(FData)^.get_dictionary(PCefListValue(FData), index));
|
||||
end;
|
||||
|
||||
function TCefListValueRef.GetDouble(index: NativeUInt): Double;
|
||||
begin
|
||||
Result := PCefListValue(FData).get_double(PCefListValue(FData), index);
|
||||
Result := PCefListValue(FData)^.get_double(PCefListValue(FData), index);
|
||||
end;
|
||||
|
||||
function TCefListValueRef.GetInt(index: NativeUInt): Integer;
|
||||
begin
|
||||
Result := PCefListValue(FData).get_int(PCefListValue(FData), index);
|
||||
Result := PCefListValue(FData)^.get_int(PCefListValue(FData), index);
|
||||
end;
|
||||
|
||||
function TCefListValueRef.GetList(index: NativeUInt): ICefListValue;
|
||||
begin
|
||||
Result := UnWrap(PCefListValue(FData).get_list(PCefListValue(FData), index));
|
||||
Result := UnWrap(PCefListValue(FData)^.get_list(PCefListValue(FData), index));
|
||||
end;
|
||||
|
||||
function TCefListValueRef.GetSize: NativeUInt;
|
||||
begin
|
||||
Result := PCefListValue(FData).get_size(PCefListValue(FData));
|
||||
Result := PCefListValue(FData)^.get_size(PCefListValue(FData));
|
||||
end;
|
||||
|
||||
function TCefListValueRef.GetString(index: NativeUInt): ustring;
|
||||
begin
|
||||
Result := CefStringFreeAndGet(PCefListValue(FData).get_string(PCefListValue(FData), index));
|
||||
Result := CefStringFreeAndGet(PCefListValue(FData)^.get_string(PCefListValue(FData), index));
|
||||
end;
|
||||
|
||||
function TCefListValueRef.GetType(index: NativeUInt): TCefValueType;
|
||||
begin
|
||||
Result := PCefListValue(FData).get_type(PCefListValue(FData), index);
|
||||
Result := PCefListValue(FData)^.get_type(PCefListValue(FData), index);
|
||||
end;
|
||||
|
||||
function TCefListValueRef.GetValue(index: NativeUInt): ICefValue;
|
||||
begin
|
||||
Result := TCefValueRef.UnWrap(PCefListValue(FData).get_value(PCefListValue(FData), index));
|
||||
Result := TCefValueRef.UnWrap(PCefListValue(FData)^.get_value(PCefListValue(FData), index));
|
||||
end;
|
||||
|
||||
function TCefListValueRef.IsEqual(const that: ICefListValue): Boolean;
|
||||
begin
|
||||
Result := PCefListValue(FData).is_equal(PCefListValue(FData), CefGetData(that)) <> 0;
|
||||
Result := PCefListValue(FData)^.is_equal(PCefListValue(FData), CefGetData(that)) <> 0;
|
||||
end;
|
||||
|
||||
function TCefListValueRef.IsOwned: Boolean;
|
||||
begin
|
||||
Result := PCefListValue(FData).is_owned(PCefListValue(FData)) <> 0;
|
||||
Result := PCefListValue(FData)^.is_owned(PCefListValue(FData)) <> 0;
|
||||
end;
|
||||
|
||||
function TCefListValueRef.IsReadOnly: Boolean;
|
||||
begin
|
||||
Result := PCefListValue(FData).is_read_only(PCefListValue(FData)) <> 0;
|
||||
Result := PCefListValue(FData)^.is_read_only(PCefListValue(FData)) <> 0;
|
||||
end;
|
||||
|
||||
function TCefListValueRef.IsSame(const that: ICefListValue): Boolean;
|
||||
begin
|
||||
Result := PCefListValue(FData).is_same(PCefListValue(FData), CefGetData(that)) <> 0;
|
||||
Result := PCefListValue(FData)^.is_same(PCefListValue(FData), CefGetData(that)) <> 0;
|
||||
end;
|
||||
|
||||
function TCefListValueRef.IsValid: Boolean;
|
||||
begin
|
||||
Result := PCefListValue(FData).is_valid(PCefListValue(FData)) <> 0;
|
||||
Result := PCefListValue(FData)^.is_valid(PCefListValue(FData)) <> 0;
|
||||
end;
|
||||
|
||||
function TCefListValueRef.Remove(index: NativeUInt): Boolean;
|
||||
begin
|
||||
Result := PCefListValue(FData).remove(PCefListValue(FData), index) <> 0;
|
||||
Result := PCefListValue(FData)^.remove(PCefListValue(FData), index) <> 0;
|
||||
end;
|
||||
|
||||
function TCefListValueRef.SetBinary(index: NativeUInt; const value: ICefBinaryValue): Boolean;
|
||||
begin
|
||||
Result := PCefListValue(FData).set_binary(PCefListValue(FData), index, CefGetData(value)) <> 0;
|
||||
Result := PCefListValue(FData)^.set_binary(PCefListValue(FData), index, CefGetData(value)) <> 0;
|
||||
end;
|
||||
|
||||
function TCefListValueRef.SetBool(index: NativeUInt; value: Boolean): Boolean;
|
||||
begin
|
||||
Result := PCefListValue(FData).set_bool(PCefListValue(FData), index, Ord(value)) <> 0;
|
||||
Result := PCefListValue(FData)^.set_bool(PCefListValue(FData), index, Ord(value)) <> 0;
|
||||
end;
|
||||
|
||||
function TCefListValueRef.SetDictionary(index: NativeUInt; const value: ICefDictionaryValue): Boolean;
|
||||
begin
|
||||
Result := PCefListValue(FData).set_dictionary(PCefListValue(FData), index, CefGetData(value)) <> 0;
|
||||
Result := PCefListValue(FData)^.set_dictionary(PCefListValue(FData), index, CefGetData(value)) <> 0;
|
||||
end;
|
||||
|
||||
function TCefListValueRef.SetDouble(index: NativeUInt; value: Double): Boolean;
|
||||
begin
|
||||
Result := PCefListValue(FData).set_double(PCefListValue(FData), index, value) <> 0;
|
||||
Result := PCefListValue(FData)^.set_double(PCefListValue(FData), index, value) <> 0;
|
||||
end;
|
||||
|
||||
function TCefListValueRef.SetInt(index: NativeUInt; value: Integer): Boolean;
|
||||
begin
|
||||
Result := PCefListValue(FData).set_int(PCefListValue(FData), index, value) <> 0;
|
||||
Result := PCefListValue(FData)^.set_int(PCefListValue(FData), index, value) <> 0;
|
||||
end;
|
||||
|
||||
function TCefListValueRef.SetList(index: NativeUInt; const value: ICefListValue): Boolean;
|
||||
begin
|
||||
Result := PCefListValue(FData).set_list(PCefListValue(FData), index, CefGetData(value)) <> 0;
|
||||
Result := PCefListValue(FData)^.set_list(PCefListValue(FData), index, CefGetData(value)) <> 0;
|
||||
end;
|
||||
|
||||
function TCefListValueRef.SetNull(index: NativeUInt): Boolean;
|
||||
begin
|
||||
Result := PCefListValue(FData).set_null(PCefListValue(FData), index) <> 0;
|
||||
Result := PCefListValue(FData)^.set_null(PCefListValue(FData), index) <> 0;
|
||||
end;
|
||||
|
||||
function TCefListValueRef.SetSize(size: NativeUInt): Boolean;
|
||||
begin
|
||||
Result := PCefListValue(FData).set_size(PCefListValue(FData), size) <> 0;
|
||||
Result := PCefListValue(FData)^.set_size(PCefListValue(FData), size) <> 0;
|
||||
end;
|
||||
|
||||
function TCefListValueRef.SetString(index: NativeUInt; const value: ustring): Boolean;
|
||||
var
|
||||
v: TCefString;
|
||||
TempValue : TCefString;
|
||||
begin
|
||||
v := CefString(value);
|
||||
Result := PCefListValue(FData).set_string(PCefListValue(FData), index, @v) <> 0;
|
||||
TempValue := CefString(value);
|
||||
Result := PCefListValue(FData)^.set_string(PCefListValue(FData), index, @TempValue) <> 0;
|
||||
end;
|
||||
|
||||
function TCefListValueRef.SetValue(index: NativeUInt; const value: ICefValue): Boolean;
|
||||
begin
|
||||
Result := PCefListValue(FData).set_value(PCefListValue(FData), index, CefGetData(value)) <> 0;
|
||||
Result := PCefListValue(FData)^.set_value(PCefListValue(FData), index, CefGetData(value)) <> 0;
|
||||
end;
|
||||
|
||||
class function TCefListValueRef.UnWrap(data: Pointer): ICefListValue;
|
||||
begin
|
||||
if data <> nil then
|
||||
Result := Create(data) as ICefListValue else
|
||||
if (data <> nil) then
|
||||
Result := Create(data) as ICefListValue
|
||||
else
|
||||
Result := nil;
|
||||
end;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user